TRN-01 in the other direction: bulk tool output has no file transport and no register #200

Closed
opened 2026-08-16 17:16:06 +00:00 by john · 0 comments
Owner

The symmetric gap

v3.5.2 shipped TRN-01: caller-derived free text going INTO a seam rides a file
path instead of a shell word, stated once in references/conventions.md, with a
36-row register in lib/text-transport.mjs and self-verify check 19 refusing a
seventeenth inline site.

The same lesson has never been applied to bulk output coming BACK. A git log, a
git status, a broad grep or a wide Read lands in the live window and is then
re-paid at the cache-read rate on every subsequent turn of that session.

The cost

Over the last 7 days on this repo, cache-read is 62.5% of the bill
(181,626,530 billed-equivalent, 1,816,265,297 raw tokens) at an average window of
121,250 tokens across 15,579 messages. A 2,000-line read is not a one-time cost:
in a 100-turn session it is paid ~100 times at 0.10x. That is what makes window
growth compound rather than accumulate.

The precedent already in the tree

workflows/execute.md already does the right thing in one place: on a
risk_surface fire it writes git diff {base}..HEAD to
reports/plan-<k>-risk.diff and passes the PATH, explicitly marking the file
transient and deleting it once the trigger returns. RES-01 and RES-02 did the
same for executor reports and verifier findings.

So the pattern is established, proven and applied at three sites out of however
many there are. Nothing states the rule, and nothing checks it.

The proposal

Mirror TRN-01's shape exactly, in the other direction:

  1. State the rule once, beside the caller-derived-text rule in
    references/conventions.md: bulk command output that a workflow does not need
    verbatim in-context goes to a file, and the workflow reads the slice it needs.
    With the criterion for "bulk" stated rather than left to judgment.
  2. A register of the sites, the lib/text-transport.mjs shape: every
    workflow site issuing a command whose output can exceed the threshold, with a
    verdict and a reason for the ones deliberately kept inline (a git log --oneline of 6 commits is fine and should be recorded as fine).
  3. A self-verify check that reads the register, so a new unbudgeted site is
    refused rather than noticed a milestone later.

Scope note

This is about workflow-prescribed commands, not about constraining what an
executor does inside its own turn. The executor's reads are its own business and
its report file already leaves the orchestrator's context. The target is the
orchestrator's own accumulating window, which is 59% of spend and the half no
budget currently governs.

## The symmetric gap `v3.5.2` shipped TRN-01: caller-derived free text going INTO a seam rides a file path instead of a shell word, stated once in `references/conventions.md`, with a 36-row register in `lib/text-transport.mjs` and `self-verify` check 19 refusing a seventeenth inline site. The same lesson has never been applied to bulk output coming BACK. A `git log`, a `git status`, a broad `grep` or a wide `Read` lands in the live window and is then re-paid at the cache-read rate on **every subsequent turn of that session**. ## The cost Over the last 7 days on this repo, cache-read is 62.5% of the bill (181,626,530 billed-equivalent, 1,816,265,297 raw tokens) at an average window of 121,250 tokens across 15,579 messages. A 2,000-line read is not a one-time cost: in a 100-turn session it is paid ~100 times at 0.10x. That is what makes window growth compound rather than accumulate. ## The precedent already in the tree `workflows/execute.md` already does the right thing in one place: on a `risk_surface` fire it writes `git diff {base}..HEAD` to `reports/plan-<k>-risk.diff` and passes the PATH, explicitly marking the file transient and deleting it once the trigger returns. RES-01 and RES-02 did the same for executor reports and verifier findings. So the pattern is established, proven and applied at three sites out of however many there are. Nothing states the rule, and nothing checks it. ## The proposal Mirror TRN-01's shape exactly, in the other direction: 1. **State the rule once**, beside the caller-derived-text rule in `references/conventions.md`: bulk command output that a workflow does not need verbatim in-context goes to a file, and the workflow reads the slice it needs. With the criterion for "bulk" stated rather than left to judgment. 2. **A register of the sites**, the `lib/text-transport.mjs` shape: every workflow site issuing a command whose output can exceed the threshold, with a verdict and a reason for the ones deliberately kept inline (a `git log --oneline` of 6 commits is fine and should be recorded as fine). 3. **A `self-verify` check that reads the register**, so a new unbudgeted site is refused rather than noticed a milestone later. ## Scope note This is about workflow-prescribed commands, not about constraining what an executor does inside its own turn. The executor's reads are its own business and its report file already leaves the orchestrator's context. The target is the orchestrator's own accumulating window, which is 59% of spend and the half no budget currently governs.
john added this to the v3.5.3 milestone 2026-08-16 17:17:43 +00:00
john closed this issue 2026-08-18 09:37:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: crenshawdev/cadence-archived#200
No description provided.