DEV Community

Charlie Hu
Charlie Hu

Posted on

Stop After One Call: A Weekend Export Tour With a Hard Attempt Cap

A weekend agent demo is done when one lane returns one valid payload. Another call is a different project. This proposed build log keeps an export tour inside that limit: one canned file list, a local stub, an optional hosted run, and a hard cap of one attempt per lane.

The tour names exports from a folder list. It does not edit files, open a pull request, or rank assistants. The stub lane is the demo. The hosted lane is a switch that stays off until a URL has been checked the same day.

What the cut protects

Recent public discussion has treated model quality as the main variable and ordinary software work as an afterthought. That framing is a poor fit for a side project. The failure mode on a weekend is smaller and duller: an unset variable, a second call that quietly changes the result, or a paragraph that sounds finished while the JSON is wrong.

Path that stayed

The surviving path has four parts.

  1. samples/exports.json stores the canned file list and sets allow_writes to false.
  2. lane_runner.py runs a deterministic stub with no network.
  3. --lane both may perform one hosted call when HOSTED_BASE_URL is present.
  4. lane-report.json records the payload, the attempt count, and any skip reason.

Path that left

Work that did not survive the cut:

  • backoff, jitter, and a backup model
  • install, format, or commit steps
  • a vendor scoreboard
  • signup automation
  • any numeric claim about token grants, machine size, or how long a free tier lasts

The cut is the artifact. A longer prompt would only lengthen the skip list.

Working stub

The script in the next section is a proposal. It has not been executed for this article. No latency number is claimed, because none was measured.

Expected stub behavior is narrow. Given src/app.py, src/__init__.py, and README.md, the export list contains app and nothing else. attempts equals 1 and writes is empty. A visitor can inspect that result with the network disconnected.

A non-zero exit means the shape check failed. The demo is not mostly working in that case. The stub gets fixed, then the same command runs again. That later local run is a human edit cycle, not a model retry.

Commands for the local lane

mkdir -p samples
printf '%s\n' '{"allow_writes":false,"files":["src/app.py","src/__init__.py","README.md"]}' > samples/exports.json
python lane_runner.py --lane stub
python -m json.tool lane-report.json
Enter fullscreen mode Exit fullscreen mode

Runner, one attempt per lane

#!/usr/bin/env python3
"""Proposal only. Not executed for this article. One attempt per lane."""

import argparse
import json
import os
import sys
import urllib.error
import urllib.request
from pathlib import Path

ROOT = Path(__file__).resolve().parent
SAMPLE = ROOT / "samples" / "exports.json"
REPORT = ROOT / "lane-report.json"
MAX_ATTEMPTS = 1


def load_sample() -> dict:
    data = json.loads(SAMPLE.read_text(encoding="utf-8"))
    if data.get("allow_writes") is not False:
        raise SystemExit("sample must set allow_writes to false")
    files = data.get("files")
    if not isinstance(files, list) or not files:
        raise SystemExit("sample needs a non-empty files list")
    return data


def stub_lane(sample: dict) -> dict:
    exports = []
    for name in sample["files"]:
        if name.endswith(".py") and not name.endswith("__init__.py"):
            exports.append(Path(name).stem)
    return {
        "exports": exports,
        "attempts": 1,
        "writes": [],
        "source": "stub",
    }


def hosted_lane(sample: dict) -> dict:
    base = os.environ.get("HOSTED_BASE_URL", "").rstrip("/")
    if not base:
        return {
            "skipped": True,
            "reason": "HOSTED_BASE_URL unset",
            "attempts": 0,
        }
    payload = json.dumps(
        {
            "files": sample["files"],
            "allow_writes": False,
            "attempts_allowed": MAX_ATTEMPTS,
        }
    ).encode("utf-8")
    req = urllib.request.Request(
        base + "/export-tour",
        data=payload,
        headers={"Content-Type": "application/json"},
        method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=8) as resp:
            body = json.loads(resp.read().decode("utf-8"))
    except (urllib.error.URLError, TimeoutError, json.JSONDecodeError) as exc:
        # One failure ends the lane. There is no retry branch.
        return {"skipped": True, "reason": type(exc).__name__, "attempts": 1}
    body["attempts"] = 1
    body["skipped"] = False
    body["source"] = "hosted"
    return body


def problems(result: dict) -> list[str]:
    if result.get("skipped"):
        return []
    found = []
    if result.get("attempts") != 1:
        found.append("attempts must equal 1")
    if result.get("writes"):
        found.append("writes must stay empty")
    if not isinstance(result.get("exports"), list):
        found.append("exports must be a list")
    return found


def main() -> int:
    parser = argparse.ArgumentParser(description="Run one attempt per lane")
    parser.add_argument("--lane", choices=("stub", "both"), default="stub")
    args = parser.parse_args()
    sample = load_sample()
    report = {"demo": "export-tour", "max_attempts": MAX_ATTEMPTS, "lanes": {}}
    stub = stub_lane(sample)
    report["lanes"]["stub"] = {"result": stub, "problems": problems(stub)}
    if args.lane == "both":
        hosted = hosted_lane(sample)
        report["lanes"]["hosted"] = {
            "result": hosted,
            "problems": problems(hosted),
        }
    REPORT.write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8")
    bad = [name for name, lane in report["lanes"].items() if lane["problems"]]
    if bad:
        print("failed lanes: " + ",".join(bad), file=sys.stderr)
        return 1
    print("wrote", REPORT)
    return 0


if __name__ == "__main__":
    sys.exit(main())
Enter fullscreen mode Exit fullscreen mode

Report the runner should write

A passing stub report looks like the sample below. The values come from the canned file list, not from a live service.

{
  "demo": "export-tour",
  "max_attempts": 1,
  "lanes": {
    "stub": {
      "result": {
        "exports": ["app"],
        "attempts": 1,
        "writes": [],
        "source": "stub"
      },
      "problems": []
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

problems must be empty. A witty summary field is ignored on purpose, because the tour did not ask for one. Extra prose is how a weekend demo starts pretending to be finished.

Hosted lane, without invented limits

Disclosure: This article was prepared as part of MonkeyCode's product outreach.

The operator brief for this draft describes MonkeyCode as an open-source project and supplies two availability claims: free model access, and a free server option. Both belong only to the hosted lane. They are not benchmark results.

This article names no model, states no token grant, describes no hardware, and does not say how long either option remains in place. No primary quota or pricing page was attached for a check on 2026-10-12. Stale numbers would be worse than silence, so the numbers stay out.

A free server, when the project still offers one, is a convenient place to boot this same runner. It does not raise MAX_ATTEMPTS. A failed free call is still one attempt. The skip reason goes in the report, and the process stops.

export HOSTED_BASE_URL="https://example.invalid"
python lane_runner.py --lane both
unset HOSTED_BASE_URL
Enter fullscreen mode Exit fullscreen mode

example.invalid is a placeholder, not a service. It should be replaced only after the current project documentation has been read. Running the hosted lane before the stub is green reverses the weekend: the interesting failure moves onto a network, and the local bug stays hidden.

Situation Lane to trust What the report should show
No account, laptop only stub one stub result, hosted key absent
Host URL checked that day both hosted shape matches, or one recorded skip
URL missing or docs stale stub hosted skipped, attempts 0
Timeout or bad JSON stub hosted skipped, attempts 1, no second call
Demo needs writes or an SLA neither stop; this runner does not cover that

Free model access changes the location of the single call. It does not change the pass rule. Shape still beats fluency.

Order of work

The weekend order is fixed so the hosted option cannot sneak in early.

  1. Write the canned file list and refuse writes in that file.
  2. Run the stub lane until problems is empty.
  3. Read the current host documentation. Stop if the free server option is unclear or gone.
  4. Run --lane both once. Record a skip if the call fails.
  5. Leave retries unimplemented.

A demo that starts at step 4 has no baseline. The stub result is the baseline. Hosted output is interesting only when it matches that shape or admits a skip.

This order also keeps a free model call from becoming the first test. The first test should pass on a laptop with the cable unplugged. That constraint is ordinary engineering, not a comment on any vendor.

What this weekend skips

The skip list is part of the log, not a second tool.

  • Retry helpers of every kind. One miss ends the lane.
  • Shell side effects, patches, and commits. The tour describes exports.
  • Multi-account orchestration and any script that signs a person up.
  • A comparison post against other assistants. One folder list cannot carry that weight.
  • Persistence past a single JSON report. There is no database in this demo.
  • Portfolio layout, launch copy, and a public uptime claim.

Those items can return on a later weekend. They are not required to show the export tour.

Checks before the demo is called done

The checks below describe control flow. They are not measured timings, and they were not executed for this article.

env -u HOSTED_BASE_URL python lane_runner.py --lane stub
env -u HOSTED_BASE_URL python lane_runner.py --lane both
python - <<'PY'
import json
report = json.load(open("lane-report.json"))
hosted = report["lanes"]["hosted"]["result"]
assert report["max_attempts"] == 1
assert hosted["attempts"] == 0
assert hosted["skipped"] is True
print("hosted lane skipped without a second call")
PY
Enter fullscreen mode Exit fullscreen mode

One more check belongs on a scratch branch. Change stub_lane so attempts is 2, run the stub lane, and expect exit code 1. Revert the edit after the failure appears. That failure is the point of the cap.

A green process that called a host twice would be the bug the cap is meant to catch. The report is the place that bug should show up, as a non-zero exit rather than a second request.

Who should leave this approach alone

The cap is a scope lock for a side project. It is a bad default in other settings.

  • An on-call debug of idempotent reads, where a documented retry policy may be appropriate.
  • A procurement note that needs a contractual quota, a named model, or a hardware spec.
  • A security review. An empty writes list in a stub does not prove a real tool cannot touch disk.
  • A leaderboard, a hackathon ranking, or any claim that one canned file measures assistant quality.
  • A production agent with customer data. lane-report.json is not an audit log.

A free host makes the extra attempt feel cheap. Cheap is not the same as finished. Extra calls also risk rate limits that this draft refuses to guess.

The runner stays useful if every product name is removed. Keep the canned file list, the single attempt, and the report. A reader who still wants the hosted lane can read the project's current notes on free model access and the free server option, then decide whether that second command belongs in the same weekend.

Top comments (0)