A remote coding pass should follow a scored packet. The local git index should stay on disk. Only a bounded diff plus tests may leave.
Vibe driven uploads treat the cloud like another brain. That analogy fails for latency, secrets, and offline work.
A clinic does not mail the entire building. It mails a labeled sample with a test. Your repo index is the clinic on disk.
This gate scores the sample before any network hop. It ignores model brands and marketing names. It asks whether the packet earned travel.
Git already lists the candidate paths for you. Status and diff name dirty files without a chat. The assay reads those paths as evidence.
Chat remains a prompt sitting on the side. The packet is the thing that can move. Mixing them is how whole trees leak.
The script below is a labeled proposal only. Thresholds are starting constants, not lab measurements. Run it on your tree before you trust it.
#!/usr/bin/env python3
"""Work-packet assay. Proposal, not a published benchmark."""
from __future__ import annotations
import re
import subprocess
import sys
import tarfile
from pathlib import Path
# Proposed constants. Tune after you watch local logs.
MAX_BYTES = 256 * 1024
MAX_FILES = 12
SECRET_HITS_MAX = 0
SECRET_PATTERNS = [
re.compile(r"AKIA[0-9A-Z]{16}"),
re.compile(r"(?i)api[_-]?key\s*[:=]\s*\S+"),
re.compile(r"(?i)secret\s*[:=]\s*\S+"),
re.compile(r"-----BEGIN .*PRIVATE KEY-----"),
]
SKIP_NAMES = {".env", ".env.local", "id_rsa", "id_ed25519", "credentials"}
def git_paths() -> list[Path]:
named = subprocess.check_output(
["git", "diff", "--name-only", "HEAD"], text=True
)
extra = subprocess.check_output(
["git", "ls-files", "--others", "--exclude-standard"], text=True
)
names = [n.strip() for n in (named + extra).splitlines() if n.strip()]
return [Path(n) for n in names if Path(n).is_file()]
def secret_hits(text: str) -> int:
return sum(len(p.findall(text)) for p in SECRET_PATTERNS)
def assay(paths: list[Path]) -> dict:
files = []
hits = 0
total = 0
skipped = []
for p in paths:
if p.name in SKIP_NAMES:
skipped.append(str(p))
continue
data = p.read_bytes()
total += len(data)
hits += secret_hits(data.decode("utf-8", errors="ignore"))
files.append(p)
reasons = []
if len(files) == 0:
reasons.append("empty_packet")
if len(files) > MAX_FILES:
reasons.append("too_many_files")
if total > MAX_BYTES:
reasons.append("over_max_bytes")
if hits > SECRET_HITS_MAX:
reasons.append("secret_pattern")
if skipped:
reasons.append("skipped_sensitive_names")
decision = "REMOTE" if files and not reasons else "LOCAL"
return {
"decision": decision,
"file_count": len(files),
"bytes": total,
"secret_hits": hits,
"skipped": skipped,
"reasons": reasons,
"files": [str(p) for p in files],
}
def pack(files: list[str], dest: Path) -> None:
with tarfile.open(dest, "w:gz") as tar:
for f in files:
tar.add(f)
def main() -> int:
report = assay(git_paths())
print(report)
if report["decision"] != "REMOTE":
print("stay_local", ",".join(report["reasons"]) or "no_files")
return 2
dest = Path("work-packet.tgz")
pack(report["files"], dest)
print("packet", dest, report["bytes"])
return 0
if __name__ == "__main__":
sys.exit(main())
Save it as assay_packet.py beside the repo root. Then run a dry pass from a dirty branch. Read the dict before you open a remote session.
git status --short
python3 assay_packet.py; echo $?
# 0 means REMOTE. 2 means stay on disk.
The exit code is the entire travel policy. A zero exit means the sample may travel. Two means the index won and the wire lost.
A free server wins on a clean small packet. It does not win on a whole monorepo tarball. It also fails when the test oracle is missing.
Disclosure: This article was prepared as part of MonkeyCode's product outreach. MonkeyCode provides free model access and a free server option. Those two properties fit this assay, not a blank upload.
Keep the first hop boring and measurable. Send the tarball plus one test command. Ask the remote side for a patch or log.
# Proposed remote contract. Unexecuted here. Adjust paths.
scp work-packet.tgz user@free-server:inbox/
ssh user@free-server 'mkdir -p /tmp/pkt && tar -xzf inbox/work-packet.tgz -C /tmp/pkt'
ssh user@free-server 'cd /tmp/pkt && python -m pytest -q'
That contract stays dull for a reason. Dull contracts keep secrets off the wire. They also keep latency honest with known bytes.
Latency still matters after the score prints. A 256 KiB packet still is not free. It is only cheaper than a huge context dump.
Secrets fail the assay by explicit design. Pattern hits force LOCAL even when size is tiny. Name skips catch env files that must never travel.
The skipped list is not a full secret scanner. It is a cheap tripwire at the door. Dedicated scanners still belong in local pre-commit.
Tests are the other half of the sample label. A packet without a failing test is a rumor. Add a local command and record its exit.
# Proposed test stamp. Store beside the tarball.
python -m pytest -q tests/test_touched.py
echo $? > packet-test.exit
git diff --stat HEAD > packet-diff.stat
If the local test already passes, stay local. Remote review of green tests wastes the hop. If the test cannot run offline, stop the assay.
Incomplete assays should not go remote today. Fix the oracle on disk before any hop. The cloud cannot invent a missing fixture.
Think of the score as a tariff at the dock. Heavy and dirty unlabeled cargo stays in port. Light secret-free cargo may sail after scoring.
That tariff is the engineering part of the loop. Calling a chat session engineering skips the tariff. The packet score puts a number on the claim.
Current debate around vibe coding misses this meter. The problem is not a fast local draft. The problem is an unmeasured upload wearing a lab coat.
Use the meter on one branch for a week. Log decision, bytes, and secret_hits after each run. Compare those logs with how often remote patches landed.
# Proposed log line. Append only. No extra services.
python3 assay_packet.py | tee -a .packet-assay.log
Do not parse vibes from that log. Parse the counts and the reasons field. If REMOTE never appears, your diffs are too fat.
Fat diffs mean the change set is not a sample. Split the branch until the assay prints REMOTE. Dirty diffs mean secrets or env files still sit nearby.
When REMOTE does appear, the free server is a mill. It grinds the sample and then returns grit. You still own the index and the merge.
Local-first work remains the default mill. Editors, grep, and unit tests stay on disk. The wire is a burst lane for a scored sample.
A free server option helps when local CPU is busy. It also helps when you want a clean tree. It does not help when you cannot name the files.
It does not help during a network partition. Offline hours should keep shipping inside git. The assay will keep printing LOCAL, which is correct.
Limitations are part of the method, not a footnote. The byte cap is a proposal, not physics. Binary assets will blow the cap on purpose.
Generated folders will also blow the cap. Do not add dist or node_modules to the packet. If the diff includes them, stay local and clean.
Monorepos can produce twelve tiny files that still leak. File count is a weak proxy for coupling. Read the file list before you accept REMOTE.
This approach is a poor fit for several shops. Regulated datasets should not leave the disk at all. If legal review forbids any packet, skip the wire.
It is also a poor fit without a local test command. Remote green-light theater is not an assay. Teach the test to run offline first.
Do not use this gate as a secret scanner replacement. Regex tripwires miss custom tokens and cloud roles. Keep a real scanner in the local pre-commit path.
Do not use it to justify pasting logs into random chats. The tarball contract is narrower than a prompt box. Narrower is the point of the whole assay.
If your work is single-file and already local, skip the server. The assay will often print LOCAL instead. That result is a success, not a failed product moment.
The core loop stays short on purpose. Score the dirty paths before any hop. Refuse unlabeled cargo and ship only a judged sample.
Run the assay on one dirty branch. Keep the score next to the patch.
Top comments (0)