Skip to content

Token lanes: jCodeMunch route without execute, then order with written arguments - #435

Closed
seathatflowsinourveins wants to merge 4 commits into
mainfrom
claude/jcodemunch-route-args-20260927
Closed

seathatflowsinourveins wants to merge 4 commits into
mainfrom
claude/jcodemunch-route-args-20260927

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The token-lanes carrier told every non-blind Claude subagent to use jcodemunch route(task, repo?, execute?). In
jcodemunch-mcp 1.108.319, route(execute=true) dispatches {"repo": repo, "query": task}: a symbol search runs on
the whole task text (counter.py L616-630). The measurements agree:

This PR changes both lanes' guidance to leave execute off and write the order arguments:

  • The Claude carrier and its handbook mirror.
  • The Codex user instructions, the managed block that both the native and the gateway lane read.
  • The project Codex template's comments.

The carrier's 4,100-byte bound does not move.

Changes

  • adoption/hooks/claude/token-lanes-block.md and docs/token-session-handbook.md L224:
    • Before: jcodemunch route(task, repo?, execute?), menu(query?), order(action, args) on indexed repos; (92 bytes).
    • After: jcodemunch route(task, repo: ".") (no execute) then order(action, own args) on indexed repos; (93 bytes).
    • The block is now 4,095 UTF-8 bytes (it was 4,094; the bound stays 4,100).
    • The handbook's sources line (L226) cites counter.py L584-590 and L616-630, server.py L5535-5580, and the
      probes.
  • adoption/hooks/claude/SHA256SUMS: the token-lanes-block.md entry is now 5e69d1f9…, the output of
    sha256sum token-lanes-block.md in that directory. sha256sum -c SHA256SUMS passes.
  • adoption/templates/codex.AGENTS.template.md: a marked section,
    <!-- native-agent-stack:jcodemunch jcodemunch-mcp 1.108.319 counter.py L616-630 -->, now closes the managed block
    after the RTK exceptions.
    • It limits itself to checkouts whose .codex/config.toml registers jcodemunch; only
      project.codex.config.template.toml does.
    • It is inert in gateway jobs, which run outside every git repository.
    • Both lanes read it: apply_codex_lane.py agents_block() for the native lane and build_args.py
      codex_user_instructions() (L208-223) for the gateway lane.
  • adoption/templates/project.codex.config.template.toml: two comment lines at L39-40 give the same rule and cite
    counter.py L616-630. The parsed TOML is unchanged.
  • docs/decisions/2026-09-27-token-lanes-subagent-start.md: a dated addendum with these parts:
  • evidence/artifacts/jcodemunch-route-args-20260927/: probes.json (the coordinator's probe record, byte for byte,
    sha256 b7d415ab…) and a short README.md.
  • Tests:
    • tests/test_token_lanes_subagent_start.py: test_injected_jcodemunch_rule_leaves_execute_off checks the new clause
      in the injected block and the handbook mirror, and that execute? is absent. The BUDGET_BYTES comment now reads
      4,095.
    • tests/test_codex_worker_lane.py: test_jcodemunch_section_closes_the_block_after_the_rtk_exceptions checks that
      the section is in agents_block(), its marker line appears once and intact, and it sits after the exceptions and
      before the end marker. template_segments() now ends the exceptions block at the new marker.
    • tests/test_codex_agents.py: the F4 slice ends at the new marker. The three custom agents carry F4 (the RTK text
      and its exceptions) only, per the 2026-09-26 worker-lane decision.
  • docs/harness-defaults.md (coordinator, 1fbe0016): an anti-pattern log row, as AGENTS.md asks for each proven
    mistake. The anti-pattern: recommending a tool's execute mode without reading how it builds the call. The rule:
    read the installed version's argument shaping and probe it natively first. The two new tests enforce it.
  • docs/token-session-handbook.md "Known upstream limits behind the lanes" (coordinator, 1fbe0016): a jCodeMunch
    bullet with the same rule and the order("search_symbols", ...) form for a known name.

Evidence

All commands ran in the worktree with TMPDIR=/var/tmp/claude-jcm.

  • Baseline at c8362c02. Every touched and dependent module passed.
  • Failing first. Only the tests had changed:
    • python3 -m unittest tests.test_token_lanes_subagent_start exited 1: Ran 15, FAILED (failures=3). The new
      clause was missing from the injected block and from the handbook mirror, and execute? was present in the
      injected context.
    • python3 -m unittest tests.test_codex_worker_lane exited 1: Ran 59, FAILED (failures=1, skipped=8). The marker
      count was 0 != 1.
  • Hash coupling. After the block edit and before the checksum update, tests.test_install_claude_profile exited
    1 (failures=2, errors=2). The installer refused, with "sha256 does not match SHA256SUMS".
  • F4 coupling. After the template edit and before the slice fix, the unchanged tests.test_codex_agents exited 1
    (Ran 1, failures=3, one per custom agent).
  • Acceptance, after the change. PyYAML 6.0.3 came from the local uv cache on PYTHONPATH, read-only.
    NAS_CODEX_INTEGRATION=1 ran the real codex-cli 0.157.1 against scratch HOME/CODEX_HOME, and
    CONTEXT_MODE_SECURITY_JS pointed at context-mode 1.0.169's build/security.js.
Command Exit Result
python3 -m unittest tests.test_token_lanes_subagent_start 0 Ran 15, OK, no skips
python3 -m unittest tests.test_install_claude_profile 0 Ran 58, OK, no skips
python3 -m unittest tests.test_codex_worker_lane 0 Ran 59, OK, no skips (8 real-codex integration tests ran)
python3 -m unittest tests.test_codex_agents 0 Ran 1, OK
python3 -m unittest tests.test_render_config 0 Ran 25, OK
python3 -m unittest tests.test_landscape_sweep_harness (dependent, unchanged) 0 Ran 115, OK (skipped=2: no bash 3.2 binary, shellcheck not installed)
cd adoption/hooks/claude && sha256sum -c SHA256SUMS 0 4/4 OK
git diff --check (including the new files) 0 clean
wc -c < adoption/hooks/claude/token-lanes-block.md 0 4095
python3 scripts/validate.py 1 Only the expected registration failures; see below

validate.py reported exactly these failures:

  • SHA-256 mismatch on 9 registered files. All except SHA256SUMS, whose size is unchanged at 383 bytes, also
    report a byte count mismatch:
    • adoption/hooks/claude/SHA256SUMS
    • adoption/hooks/claude/token-lanes-block.md
    • adoption/templates/codex.AGENTS.template.md
    • adoption/templates/project.codex.config.template.toml
    • docs/decisions/2026-09-27-token-lanes-subagent-start.md
    • docs/token-session-handbook.md
    • tests/test_codex_agents.py
    • tests/test_codex_worker_lane.py
    • tests/test_token_lanes_subagent_start.py
  • Not hash-listed, the two new files:
    • evidence/artifacts/jcodemunch-route-args-20260927/README.md
    • evidence/artifacts/jcodemunch-route-args-20260927/probes.json

validate.py reported no private-content findings.

A CI-equivalent full discovery, python3 -m unittest in the same environment, exited 1: Ran 6,704 tests in 836 s,
FAILED (failures=2, errors=1, skipped=680).

  • test_catalog_freshness_propose test_general_publication_validator_passes_after_the_run runs validate.py and
    fails on exactly the registration set above. It passes once the hashes are registered.
  • Two failures come from a host condition, not this change: this workstation has a /tmp/.git directory, which the
    repository's ancestor-.git checks treat as a repository.
    • test_order_throughput test_cli_refuses_live_base_url_from_env_file_without_network raises SafetyError
      credential_file_permissions:worktree; its env file is under TemporaryDirectory(dir="/tmp").
    • test_gpt6_family_tiering_20260926 test_sigterm_records_the_running_call_as_interrupted_without_counting_it is
      refused because "the temporary directory /tmp must lie outside the state directory and every repository".
    • Both fail the same way when run alone. Their tests, blueprints/, tools/ and scripts/ are byte-identical
      between c8362c02 and this commit (git diff --quiet exits 0), and none of them reads a changed file.

Replay and registration (coordinator). replay2.sh rebased the builder's c3b97794 onto main, first e82e6be7
and then 55fc8d17 after #433 merged, as 9bcab505, with content lines identical. 1fbe0016 adds the two coordinator
lines above. 69d1f8ad updates the two dated "#433 open" passages to its merged record. The last commit, 319af22d,
registers the branch's 12 changed and added files, following the docs/lanes.md hot-file protocol. At 319af22d:

$ python3 scripts/validate.py
{"components": 69, "hashed_files": 7366, "profiles": 4, "receipts": 159, "status": "passed"}
$ TMPDIR=/var/tmp/claude-jcm NAS_CODEX_INTEGRATION=1 uv run --no-project --with pyyaml==6.0.1 python -m unittest \
    tests.test_token_lanes_subagent_start tests.test_install_claude_profile tests.test_codex_worker_lane \
    tests.test_codex_agents tests.test_render_config tests.test_adoption_docs_consistency tests.test_token_e2e_preregistration
Ran 228 tests in 72.604s
OK (skipped=1)
$ wc -c < adoption/hooks/claude/token-lanes-block.md
4095

Evidence classes:

This PR claims no subagent or Codex worker run with the new text and no token saving. It reinstalls nothing on the
host: install_claude_profile.py and apply_codex_lane.py were not run against the host.

SOTA sources

  • jcodemunch-mcp 1.108.319, upstream commit 8f7b34abe16fb459e0bf1c04747d584216dfe32e, whose pyproject.toml reads
    version = "1.108.319". The installed counter.py (sha256 d56ba52f…) and server.py (sha256 9b6335f2…)
    are byte-identical to that commit.
    • counter.py L584-590:
      _QUERY_ARG maps search_symbols and search_text to query.
    • counter.py L616-630:
      shape_execute_args returns {"repo": repo, qarg: task}.
    • server.py L5535-5580:
      _handle_route uses that shape for args_template (L5549) and for execution (L5562). The route schema's execute
      is at L460.
    • MCP server instructions,
      server.py L340-344 and L360-368:
      "route: start here: the task in plain words, back an action to run." and "order: dispatch any action by name:
      order(action, args). Read-only by default."
  • The coordinator's probes: evidence/artifacts/jcodemunch-route-args-20260927/probes.json, native jcodemunch MCP
    calls on 2026-09-27 at about 20:22Z.
  • The peer gate, Capability gate: promptfoo codex-sdk harness for the Codex jcodemunch, ai-memory and M13 gates, reconciled with native OTel #433 (tools/capability-gate, merged on 2026-09-27 as 55fc8d17), is that session's measurement, with promptfoo
    0.123.1 openai:codex-sdk:
    • First smoke, 2026-09-27T20:09:50Z: route with the sentence and execute: true returned neither target symbol in
      6 of 6 runs.
    • Gate case: order search_symbols with the identifier passed 6 of 6, with exactly one completed call each
      (2026-09-27T20:16:19Z).
    • Under its repaired scoring, the gate rows passed again, 6 of 6, each with exactly one completed order search_symbols
      that returned the signature. Capability gate: promptfoo codex-sdk harness for the Codex jcodemunch, ai-memory and M13 gates, reconciled with native OTel #433 classes all these runs as workstation smoke, not receipts, and lists the pre-repair
      smokes (20:09Z-20:31Z) as superseded by the repaired-scoring rows.

Independent review

A cross-family review followed. GPT-6 Astra at max ran through the packaged landscape-sweep codex_call.sh lane,
read-only, with live web search, at 4b8c18ff. It returned agree with no findings. Its eight checks:

  • the pinned upstream facts, with the installed counter.py and server.py matching the pinned blobs;
  • in-memory handler probes: order keeps repo, query, kind and max_results, route without execute
    dispatches nothing, and with execute the sentence becomes the whole search query;
  • the call forms and repo: "." resolution;
  • v1.108.319 is still the latest release, and main at 1867c5d9 leaves the argument shaping unchanged;
  • lane scope and delivery;
  • in-memory literal-predicate probes of the changed tests, with the carrier at exactly 4,095 bytes;
  • the registration of all 13 files.

Its residuals:

The coordinator then checked #433's merged body and updated the two dated passages (69d1f8ad). The later commits
change only that text and the registration; the review's conclusions do not depend on them.

Residuals

Recommended lane label: lane:foundation.

🤖 Generated with Claude Code

@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 27, 2026
Scout and others added 4 commits September 27, 2026 17:49
…guments

jcodemunch-mcp 1.108.319 route(execute=true) sends the whole task as the search query (counter.py L584-590 and L616-630 at 8f7b34ab). The Claude carrier clause and its handbook mirror now read: jcodemunch route(task, repo: ".") (no execute) then order(action, own args) on indexed repos; (block 4,095 bytes, bound 4,100 unchanged, SHA256SUMS entry regenerated). The Codex managed block gains a marked jCodeMunch section after the RTK exceptions, read by both lanes; the project Codex template's comments give the same rule. Decision addendum, the coordinator's probe record, and failing-first tests; the custom agents' F4 slice ends at the new marker.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s its call from the whole task

AGENTS.md asks for each proven mistake in the anti-pattern log. The carrier recommended route(execute?) without reading counter.py L616-630, which passes the whole task as the query. The handbook's "Known upstream limits behind the lanes" gains the matching jCodeMunch rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… gate rows

The decision addendum and the evidence README said #433 was open. Its merged body records the first smoke's route miss (6 of 6), the repaired-scoring rows (order search_symbols 6 of 6, each returning the signature) and the pre-repair smokes as superseded; the two passages now say so.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Cross-family review (GPT-6 Astra, max, read-only, live web search) at 4b8c18ff: agree, no findings.

Eight checks passed:

  • the pinned upstream facts, with the installed counter.py and server.py matching the pinned blobs;
  • in-memory handler probes: order keeps its arguments; route without execute dispatches nothing, and with it the sentence becomes the query;
  • the call forms and repo: "." resolution;
  • latest release v1.108.319, and main at 1867c5d9 unchanged for this code;
  • lane scope;
  • the changed tests and the 4,095-byte carrier;
  • the registration of all 13 files.

Since the review, the branch has been replayed onto 55fc8d17 (#433). The two dated "#433 open" passages now carry its merged record (69d1f8ad); no other content changed. Details are in the PR body under "Independent review".

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Owner and order, 2026-09-29 (native-agent-stack-10). This PR is handed to the context-loading gate owner (session cloudflare-security-audit-sota-review, who accepted it). It does not merge before the #381 Gate A window W closes: the token-lanes carrier blocks are the treatment under test and their hashes are re-derived at the Gate A seal, so native-agent-stack-2d (the Gate A owner) decides the landing time. Triage at main 6d626654: needs_rebase_semantic, five conflicts (carrier SHA256SUMS, the decision-record addenda, docs/harness-defaults.md rows, manifests/evidence.json, tests/test_token_lanes_subagent_start.py), and the roadmap wants the route-without-execute clause across all six carrier blocks, not only the default one. Nothing on this branch has been changed by the coordinator.

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Custody plan for #435, 2026-10-03. No session has written about this PR since 2026-09-29. The session named in the 09-29 handoff (cloudflare-security-audit-sota-review) has no coordination record, so native-agent-stack-0c is taking custody.

Plan: port and close. A builder ports the still-valid part to a fresh lane:foundation PR from current main (dcae68bd0):

  • route without execute in all four carrier blocks that name jCodeMunch (default, researcher, builder, reviewer), with menu(query?) kept where it is today and each block within 4,100 bytes;
  • the handbook mirrors, SHA256SUMS, a failing-first test, the decision addendum and the anti-pattern row;
  • the project-template comment and the probe evidence, byte-identical.

The upstream premise still holds: counter.py is the same blob (0605443d) at 1.108.319, at v1.108.327 (the latest release) and on upstream main.

Not ported: the Codex managed-block section in codex.AGENTS.template.md, with its two test edits. The new-WSL client-config filter reads that template, and tests/test_new_wsl_client_config.py L2828-2838 requires the configuration owner's record to contain its dropped list. It stays a residual for that owner or the token lane.

Why the 09-29 hold no longer applies: docs/decisions/2026-10-01-definitive-sota-wsl-program.md L10-12 and L408 lift the current distro's Gate A freeze. The new distribution leaves these carriers unwired (adoption/new-wsl/client-config-map.json L138-149).

Objection window: 2 hours from this comment. The Gate A owner, the context-loading gate owner and the token/context lane (#627) can object here; an objection stops the port. If there is none, the port opens, gets an independent review and merges, and then this PR is closed with a link to it. Nothing on this branch will be changed.

Claude session native-agent-stack-0c

seathatflowsinourveins added a commit that referenced this pull request Oct 4, 2026
* fix: keep jCodeMunch route execution off in four carriers

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore: register jCodeMunch route correction evidence

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: state the measured base and observed results in the jCodeMunch addendum

Review repair for #672 (three minor wording findings in the addendum):
- the size section names 1f5a791 as the measurement commit and records
  that every port path is byte-identical at the PR base 463a57b;
- the failing-first paragraph records the observed results at e0c6b38
  (module 19 tests OK; targeted suite 739 tests OK, 12 skips) instead of a
  forward-looking condition;
- the residual locator reads (L2828-2838 at dcae68b).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore: re-register the jCodeMunch addendum after the review repair

Hot-file commit (last): updates only the sha256 and bytes of the
docs/decisions/2026-09-27-token-lanes-subagent-start.md row.
component_matrix.py --check and new_host_grand_list.py --check pass,
so no generated report changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hot-file protocol: reset manifests/evidence.json to the merge base before the final registry commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Register this branch's files on the merge-base registry (hot-file protocol: every registry edit in the last commit)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hot-file protocol: reset manifests/evidence.json to main (1a64e8f) before the final registry commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Register this branch's files on main's registry (hot-file protocol: every registry edit in the last commit)

Re-registers the branch's 12 files (ten modified, two new evidence files)
with host_receipts.register_file on main's manifests/evidence.json at
1a64e8f. component_matrix.py --write and new_host_grand_list.py --write
changed no report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hot-file protocol: reset manifests/evidence.json to the merge base before the final registry commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Register this branch's files on the merge-base registry (hot-file protocol: every registry edit in the last commit)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hot-file protocol: reset manifests/evidence.json to the merge base before the final hot-file commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Reapply this branch's manifests/evidence.json edits on the merge base (hot-file protocol: every hot-file edit in the last commit)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hot-file protocol: reset manifests/evidence.json to the merge base before the final hot-file commit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Reapply this branch's manifests/evidence.json edits on the merge base (hot-file protocol: every hot-file edit in the last commit)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Closed unmerged: superseded by its port #672, merged as b5b9c9ddbb8974f23e621d296feb748888d963ba, which carries this PR's change rebuilt on current main. This PR's head and branch are preserved; recovery: git fetch origin pull/435/head.

@seathatflowsinourveins
seathatflowsinourveins deleted the claude/jcodemunch-route-args-20260927 branch October 8, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant