Repository navigation
Description
Refs #12951 (Matryoshka Token-Efficiency Program, phase P0 of its planned children), #12945 (T27 M epic), #12948 (phase 0 harness budgets, the source of the logs).
Boundary
In scope: a read-only baseline of tokens, time and outcome per model step, taken from the 10 existing session logs of the #12948 runs (56 steps, 56 usage records, one model, glm-5.3-flash through the provider t27-ladder); one file, docs/claw/token_efficiency_baseline.md, with at least 3 work classes (the task types of #12948); the named source and known error of every count (the restated item 4b of the P0 execution gate of #12951).
Out of scope: any change of routing, prompt or model; any new run of the harness; a cost in money (the log holds no price); trace ids and the 19-field spans of FR-014 of #12951 (they wait for #12948, U4); any speed, saving or quality claim; any key value, token or home path.
User Scenarios
- A reviewer opens the baseline and reads, per work class, the value, N, command, head and date of each row, and sees N before any number.
- Phase P1 (cost formulas) takes the baseline as its input and finds the source and its known error beside every count.
- The owner asks what a step costs today and reads one table that says
n/awith a reason where the log has no figure, instead of a guess. - A reader reruns the command of a row against the same logs and gets the same number.
Requirements
- FR-001: The baseline MUST list at least 3 work classes, each row holding value, N, command, head and date, and MUST state N in every row.
- FR-002: Every count MUST name its source and known error; counts from different sources MUST NOT be summed, and cache-read tokens MUST be shown apart from input tokens.
- FR-003: The file MUST NOT contain a speed, saving or money-cost claim, a key value, a partner name or a home path (
/Users/). - FR-004: Each number MUST be reproducible by the command in its row; after writing the file the tick MUST rerun every command once and record "reproduced" or the difference on this issue.
- FR-005: Every field of FR-001 of lane(mother): Matryoshka Token-Efficiency Program -- measure tokens, time and quality per layer, route to the cheapest tier that passes acceptance (Refs #12945) #12951 that the log does not give (trace and span ids, cost_usd, retries, reasoning_tokens, parent-child span links, the fallback or escalation flag, tick, task_id, issue_id, actor_id, lane, accepted) MUST appear as
n/awith a reason, and no value MAY be inferred or fabricated. - FR-006: The outcome of a run MUST be quoted from the run table of audit(mother): phase 0, pin upstream dsh and measure the four harness budgets, no fix (Refs #12945) #12948 with that table named as the source, and MUST NOT be judged again here.
- FR-007: The baseline file MUST NOT be written unless the P0 execution gate of lane(mother): Matryoshka Token-Efficiency Program -- measure tokens, time and quality per layer, route to the cheapest tier that passes acceptance (Refs #12945) #12951 passes in two samples 60 s apart taken at the start of the write (free disk above 10 GiB, 1-minute load below 15, and the other three conditions), the write begins within 120 s after the second sample, and no baseline file or partial baseline from a prior attempt exists on master or on any branch of this lane; while the gate is closed the tick MUST leave one blocked gate snapshot on lane(mother): Matryoshka Token-Efficiency Program -- measure tokens, time and quality per layer, route to the cheapest tier that passes acceptance (Refs #12945) #12951, 0 partial baseline files and no retry in the same tick.
- FR-008: The baseline file MUST carry the marker "reconciliation baseline; full span telemetry pending" and MUST NOT make a full token-efficiency claim.
- FR-009: The file MUST record, for each of the 10 source logs, the session id, the size in bytes and the sha256 of the log file, the measurement window (first and last event time per log) and the two gate samples that opened the write.
- FR-010: Step times MUST be reconciled with the run table of audit(mother): phase 0, pin upstream dsh and measure the four harness budgets, no fix (Refs #12945) #12948 the same way as token totals: the difference is shown for every row and a difference is stated, not hidden.
Success Criteria
- SC-001:
docs/claw/token_efficiency_baseline.mdis on master with at least 3 work classes, each row holding value, N, command, head and date. - SC-002: 10 of 10 session logs are accounted for: 56 steps and 56 usage records appear in the file's totals.
- SC-003: 0 rows without N, 0 speed or saving claims and 0 occurrences of the home-path prefix in the file (
grep -cfinds 0). - SC-004: the snapshot of the gate and the rerun result are on lane(mother): Matryoshka Token-Efficiency Program -- measure tokens, time and quality per layer, route to the cheapest tier that passes acceptance (Refs #12945) #12951 and on this issue, and this issue closes by the pull request that adds the file (exit 0 of the required checks).
- SC-005: 0 partial baseline files exist on any branch or on master before the gate snapshot that records "open" (2 samples, 60 s apart, free disk above 10 GiB).
- SC-006: 10 of 10 source logs have session id, size in bytes and sha256 in
docs/claw/token_efficiency_baseline.md, and the marker "reconciliation baseline; full span telemetry pending" appears 1 time in it. - SC-007: token totals reconcile with 9 of 9 rows of the run table of audit(mother): phase 0, pin upstream dsh and measure the four harness budgets, no fix (Refs #12945) #12948 and the step-time difference is shown for 9 of 9 rows.
Activity
gHashTag commentedon Oct 31, 2026
Claim (tick 156, analog loop session, started 16:06 +07): P0 gate for this issue passed on two samples 64 s apart (1-min load 14.65 and 14.78, below 15; free disk 11.25 GiB, above 10; no prior partial file; harness pinned by #12948; no routing, prompt or model change). Starting the baseline file docs/claw/token_efficiency_baseline.md now, marker "reconciliation baseline; full span telemetry pending". Another tick or session that sees this: please take a different task.
🤖 Addressed by Claude Code
gHashTag commentedon Oct 31, 2026
Claim withdrawn (tick 156). The gate was open on two samples (16:05:16 and 16:06:20), but the 120 s write window of FR-007 lapsed at 16:08:20 before the file was started; 0 baseline files exist on master or any branch, and nothing was pushed. The task is free again for the next tick or any session: take a fresh pair of gate samples 60 s apart, have the 10 source numbers ready, then begin the write inside the window. Details are on #12951.
🤖 Addressed by Claude Code
gHashTag commentedon Nov 17, 2026
Spec created: specs/claw/token_efficiency.t27 (typecheck OK, 1 test passes).