Skip to content

Token lanes carrier: fetch routing, intent, executor-backed cwd, loadable lane ids and wrapper exemption - #412

Merged
seathatflowsinourveins merged 4 commits into
mainfrom
claude/w3-lanes-20260927
Sep 27, 2026
Merged

seathatflowsinourveins merged 4 commits into
mainfrom
claude/w3-lanes-20260927

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Owner

Summary

Closes the measured gaps in the SubagentStart token-lanes carrier, the block injected into every non-blind subagent.
Compared with main, the carrier now:

  • routes page fetches through ctx_fetch_and_index and ctx_search, and does not use WebFetch for evidence;
  • adds ctx_fetch_and_index to the one-call ToolSearch bootstrap, with exact loadable tool ids for each lane a task needs;
  • runs output over ~5 KB through ctx_execute/ctx_batch_execute with intent, with specific ctx_search queries (limit <=3);
  • states the working-directory rule the context-mode 1.0.169 executor implements: pass cwd for every language (src/executor.ts:295-306, Prepare CLOCK-R2 Windows Time changes and boot persistence checks #788);
  • exempts agents told to return output unmodified from the output-routing and footer rules.
    The block grows from 3,159 bytes on main to 4,051 bytes, under a bound raised from 3,500 to 4,100 bytes. The byte itemization under Changes is relative to the intermediate build (3,490 bytes).

Changes

  • adoption/hooks/claude/token-lanes-block.md: explicit cwd for every language
    with Rust's absolute-path exception; exact task-needed ToolSearch ids and
    tool-grant boundaries; specific ctx_search queries with limit <=3; full
    wrapper exemption and end-of-return accounting for other agents.
  • adoption/hooks/claude/SHA256SUMS: refresh the installer digest. The carrier
    measures 4,051 UTF-8 bytes under a 4,100-byte bound, up 561 bytes:
    316 bootstrap, 122 cwd/Rust, 54 search, 69 wrapper/footer.
  • docs/token-session-handbook.md: mirror every carrier line and cite its
    sources; record the dated Claude Code 2.1.283 in-process teammate
    HTTP-transport boundary without prescribing a workaround.
  • docs/decisions/2026-09-27-token-lanes-subagent-start.md: date repair errata,
    correct the false schema-based correction, justify the budget and require
    per-child tool exposure for future routing counts. The original decision
    before the measured-gap addendum is unchanged.
  • evidence/artifacts/token-lanes-subagent-start-20260927/measured-gaps.md:
    mark 0/15 as M4-style outside PR-H: E2E preregistration for the token-save-practice stack (frozen tasks, metrics, gate, procedure) #381's population, link the preregistration,
    correct counter provenance and separately attribute later matrix/smoke-3
    observations. The two counter .txt records added by the build, original
    counts and historical README/receipt retain their bytes.
  • tests/test_token_lanes_subagent_start.py: failing-first cwd, wrapper,
    bootstrap and search controls; preserve UTF-8 budget, blind and fail-open
    coverage. Exact additionalContext delivery covers all seven shipped
    non-blind roles plus general-purpose, workflow, teammate and unknown roles.

Hook executable, installer implementation and installer tests are unchanged.
The carrier grants no tools and changes no client configuration.

Evidence

  • Local integration, repair: after export TMPDIR=/var/tmp/claude-lanes,
    python3 -m unittest tests.test_token_lanes_subagent_start tests.test_install_claude_profile
    returned exit 0: Ran 64 tests in 1.023s; OK (skipped=3). All 14 carrier
    tests pass; three existing optional PyYAML checks are skipped. The sandbox
    refused creation of the requested directory as read-only; Python used
    /tmp. These covering modules passed there, not a full-suite run.
  • Failing-first repair controls: cwd failed 5 assertions/subtests, wrapper
    scope/footer 3, bootstrap 1, search 1; each then passed. The old byte bound
    rejected 4,051 bytes; the UTF-8 control now rejects 4,120 against 4,100.
    The checksum control failed until its digest was refreshed. These tests
    verify delivered instructions, not model compliance.
  • Historical builder integration: original web routing failed once,
    intent/cwd seven times, wrapper once; covering modules then reported 62 tests
    OK, skipped=3. The old cwd assertions encoded the wrong rule and are replaced;
    that earlier green run did not verify runtime cwd.
  • Coordinator harness integration, supplied review facts: validate.sh
    FAILS=0. The contended full suite ended with 205 failures and 119 errors.
    Unit-only failing modules rerun alone with TMPDIR=/var/tmp: 1,143 tests
    OK (skipped=66)
    and an empty rerun failset. The base failed only
    tests.test_pre_commit_gate, absent from the unit failset. The reviewer
    attributed no regression to this unit. These are historical build results,
    not a repair validation/full-suite run.
  • Local structural checks: git diff --check exit 0; all carrier lines
    match the handbook; documentation links resolve. Carrier digest:
    2a9bab79fea04ec2c626973428e7db73fad6ace1267e34c2a9553f586e1f8b76.
    Added-text scan: zero personal paths, emails, UUIDs and bearer values.
    Historical receipts, both counters and this repair's evidence manifest are
    unchanged. Read-only Python/JavaScript ctx_execute probes with explicit cwd
    saw the worktree and carrier, while script files were outside it; persistence
    is source-backed, with no write probe.
  • Local measurement, coordinator-reported: smoke-2 0/15 is outside M4's
    population, with ctx_fetch_and_index exposure unknown. M3 oversized-byte
    shares remain 61.4%, 70.7%, 74.7%; ctx_execute M5-style counts 40/119, 78/214,
    16/34; wrapper copy check 2/2. Later peer smoke 3 reported ctx_search 11/20
    and ctx_execute 27/52 over 5 KB; it is not an after-measurement of this repair.
    The matrix describes exposure on 2.1.283, not general client guarantees.
  • Synthetic fixtures: existing subprocess and temporary installer fixtures
    remain local integration evidence; no native transcripts were synthesized.
  • Unchanged upstream tests: none run. Source/schema/release-note review is
    distinct from upstream runtime acceptance.
  • Live provider execution: none by this repair builder. No after-repair
    native workflow, installation, provider usage or savings claim.

SOTA sources

Review dispositions

All six findings are accepted; none is disputed.

  1. Cwd blocker: executor-backed cwd, persistence and Rust guidance; refreshed
    checksum and measured budget.
  2. False erratum: dated correction affirms the original bound-to-main-checkout
    warning for non-shell child calls without cwd.
  3. Handoff accuracy: corrected shell-only claims, embedded red/green and
    harness results, accurate registration status. Corrected commit-build.txt
    and supplied commit-repair.txt; no Git history rewritten.
  4. Wrapper scope: explicit routing/footer exemption, restored footer
    position, sweep.js citation and tests.
  5. M4 scope/access: 0/15 labelled outside PR-H: E2E preregistration for the token-save-practice stack (frozen tasks, metrics, gate, procedure) #381; next remeasure records each
    child's exposure to both fetch tools. Only confirmed ctx_fetch_and_index
    exposure contributes to the routing denominator; absent/unknown is separate.
  6. Counter provenance: retained-copy digest identified; tables predate the
    later ctxSrch edit; both counter copies preserved.

A1-A4 are incorporated: exact lane ids, specific queries with limit <=3, dated
teammate boundary, and unchanged non-blind context injection.

Residuals and not done

  • Coordinator acceptance at the replayed head (local integration, this host): validate.sh FAILS=0 after the replay onto main. python3 -m unittest tests.test_token_lanes_subagent_start tests.test_install_claude_profile tests.test_adaptive_paper_metrics tests.test_secret_path_guard ran 126 tests OK (skipped=3). The replay resolved adoption/hooks/claude/SHA256SUMS by recomputing every entry from the files; sha256sum -c passes. The re-registration is limited to this branch's own files.

  • Cross-unit residual: once the measure unit (PR-A) lands, the decision addendum should name this unit's figures after their counters (for example "fetch-tool share", "results over 5 KB") and state that PR-H: E2E preregistration for the token-save-practice stack (frozen tasks, metrics, gate, procedure) #381's overturn gate uses PR-A's published M3/M4/M5 definitions, not these scratch counts.

  • The branch's first commit message still says "shell-only cwd" and "unchanged 3,500-byte budget". The squash-merge subject and body use this PR's text instead.

  • Re-measure routing/containment on the next sweep and coordinator waves with
    per-child exposure and population boundaries; smoke 2 cannot retroactively
    supply an access-qualified compliance baseline.

  • Private transcripts and original counter argv/timing/exit records and stdout
    were not supplied; retained methods and tables do not independently reproduce
    historical counts.

  • No after-repair model run or live installation. Three PyYAML skips and the
    requested-TMPDIR sandbox restriction remain recorded.

  • Coordinator owns committing, evidence registration, generated reports,
    validate.sh and full-suite acceptance. Builder left manifests/evidence.json
    unchanged and ran no prohibited Git/report-writing operations.

  • The existing plugin-scoped blind-role caveat is unchanged.

Recommended lane label: lane:foundation. The coordinator's reviewed final
the branch's last commit changes manifests/evidence.json only by re-registering this branch's own files;
docs/lanes.md L147-148 keeps that work in foundation. This repair checkout starts
at 67f4a88f and leaves the next registration to the harness.

Token tools: context-mode processing and indexed source fetches/searches; RTK
for commands and rtk proxy for exact blobs. No compression or savings claim.

🤖 Generated with Claude Code

Scout and others added 4 commits September 27, 2026 11:44
Route evidence pages through ctx_fetch_and_index and ctx_search, expose
batched requests/concurrency, and specify ctx_execute intent and shell-only
cwd. Preserve verbatim wrapper returns and the unchanged 3,500-byte budget
(the revised block is 3,490 bytes). Refresh the installer checksum.

Keep the handbook synchronized, append a dated decision addendum, and retain
counts-only M4/M3/M5 tables with unchanged .txt copies of both counters.
Add failing-first injected-context tests; covering modules run 62 tests,
with 3 existing optional PyYAML skips and no failures.

Sources: mksglu/context-mode v1.0.169, commit
589d8214d56740a28b5f7bf63167743d586b0b40, src/server.ts L1675-1690,
L1728-1740, L1979-1980 and L3423-3478; connected tool schemas;
https://code.claude.com/docs/en/tools-reference#webfetch-tool-behavior
and https://code.claude.com/docs/en/hooks#subagentstart (Claude 2.1.283).
Measurement source: coordinator units/w3/lanes-facts.md (2026-09-27)
and the unchanged profile_workflow_tools.py / containment_m3.py counters.
No after-change native workflow, provider-usage or savings claim.

Content written by GPT-6 (gpt-6-astra, effort max) through the Codex worker lane and the OmniRoute
pool; committed by the coordinator harness.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Follow the executor rather than stale schema: non-shell child calls without cwd
use the coordinator checkout and writes persist; Rust needs absolute paths.
Load exact granted lane ids, keep search limit <=3, and exempt verbatim returns
from output routing and footers.

Date the false-correction erratum, qualify smoke-2 counts outside #381's M4
population, require per-child tool exposure, and correct counter provenance.
Record the 2.1.283 teammate boundary. Carrier: 4,051 bytes, bound 4,100; refresh
checksum. Preserve non-blind additionalContext, blind gating and fail-open code.

Sources: mksglu/context-mode v1.0.169 at
589d8214d56740a28b5f7bf63167743d586b0b40, src/executor.ts L290-312,
hooks/core/routing.mjs L939-941, src/server.ts L1822, L1733-1740, L1979-1980,
L3423-3478, src/search/ctx-search-schema.ts L88-94;
https://code.claude.com/docs/en/tools-reference#webfetch-tool-behavior,
https://code.claude.com/docs/en/mcp#scale-with-mcp-tool-search and
https://code.claude.com/docs/en/hooks#subagentstart;
native-agent-stack 5f3a7c2 sweep.js L83-87; #381 preregistration and
coordinator units/w3/lanes-facts.md / units/w4/e2e-facts.md local observations.

Failing-first local controls; covering modules: 64 tests OK (skipped=3).
Historical harness evidence is separately attributed in the PR body.
No after-repair native workflow, provider usage or savings claim.

Content written by GPT-6 (gpt-6-astra, effort max) through the Codex worker lane and the OmniRoute
pool; committed by the coordinator harness.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tate the byte-bound rule inline

Coordinator corrections after the independent repair verification: the handbook no longer credits the matrix observations with supplying tool ids (they show only the grant boundary), and the decision record states its byte-budget rule instead of citing an unpublished brief.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 27, 2026
@seathatflowsinourveins
seathatflowsinourveins merged commit 9f110b2 into main Sep 27, 2026
24 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/w3-lanes-20260927 branch September 27, 2026 16:04
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