context weight: defer branch-local blocks behind Reads (~22,300 B) #102
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
external-review
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence-archived#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
~22,300 B off the eager path by moving branch-local blocks behind a
Readat the step that needs them. Blocked on #1 — every one of these anchors in a coverage hole of check 13's register, so landing them first means shipping deferrals CI cannot guard.Each move is tested against
references/seams.md:216-253: only some branches reach it, one consult site, and the read folds into a turn already being taken.config.md:71-133->references/config-catalog.md--reviewand direct-set — two of three routes — never touch it. Takes/cad-configeager 20,547 -> ~11,700 (-43%). Keep behind: "Never hand-validate against this table; call the seam" — it binds all three routes. The:61-70derivation defense moves to the head of the new reference.plan.md:267-336->references/plan-revision.mdBRACKETINGedit intrace.test.mjs(plan.md 4 -> 2 dispatch moments, with 2 return and 2 checkpoint closes moving too). Guardrail 410 keeps the one-revision cap eager.execute.md:343-402->references/execute-parallel.mdexecute_parallelbody.choose_path(:120-171) stays eager — it decides the branch. Two of the four per-arm triage-gate Read sentences travel along; do not consolidate the rest.cad-executor-contract:151-193->references/worktree-executor.md<worktree_mode>. Dead on a default install (worktree.baseRefdefaultsfresh->parallelSafe:false,execute.md:139-150), yet paid by every executor dispatch. The pointer must be an unconditional gate before task 1, andexecute.md:356's mode line should name the reference. Rules are safety-critical (never stash/merge/rebase, branch check before every commit) — this one needs the register most.plan.md:100-121,:173-178andcontext.md:74-104->references/recall.md<recalled_memory>render rule, D-01/D-03 rationale — near-verbatim in both, andworkflows/debug.mdis a third consumer. Each side keeps ~200-250 B of site wiring includingplan.md's check-10-linted batching sentence.context.md:324-363->templates/CONTEXT.mdplan.mdpoints cad-planner attemplates/PLAN.md. Keep the one-line section list (:365-366) eager as the parse backstop for /cad-audit and /cad-verify.execute.md:316-335execute_parallel. Arguably a second consult site — if that reading wins, take only the ~450 B of pure rationale and leave the remedy.Constraints
weight-budgets.jsonrow (check 4 requires a row per measured surface) and must exist before its Read sentence lands (check 3).seams.md:240-243: each new Read sentence states the reference's measured bytes and consult-site count inline.references/is walked, but deleting rows would orphanrisk.override.<surface>and the threereview.triggers.<t>.*keys, which are named only in that table.references/too, so concurrency sentences survive a move unchanged.config-reach.md:136-138namesworkflows/execute.mdas the reach site for the threeparallelization.*keys — deferringexecute_parallelmoves it.Rejected, recorded so they are not re-derived
cad-reviewer-contractandcad-plan-checker-contract, but a dispatch preloads exactly one — they never share a context. Factoring them out adds a Read round-trip per dispatch to save ~200 B each: a net loss under seams.md's own test.config.md's catalog from the schema.config.mjs keysdumps 24,544 B, larger than the whole 19,256 B document, and carries no per-value explanation, which the walk requires as each option'sdescription. The fix is residency, not derivation.cad-land/cad-healthto workflow files. Saves zero eager bytes:@-included loads on turn one, and the process is consulted at every step so it cannot defer (seams.md:235-237). Hygiene argument only.git-guard.md's 6,721 B eager include in cad-land. Correct as-is — consulted at steps 1, 2 and 3, the exact caseseams.md:236-240names.Multiplier caveat
execute.md:192-195asserts the contract is the "stable, cached definition", so repeat dispatches within a session read those bytes from prefix cache, not as fresh input. Honest fresh-input multiplier is ~1.3x, not the raw ~4x; the raw figure is the upper bound (cold cache, worktree batches where prefixes diverge, dispatches past TTL). Do not size this work off the 4x number.Shipped: all four moves landed - config-catalog.md, plan-revision.md, execute-parallel.md, worktree-executor.md all exist as references with their consult-site Reads, and config.md sits at 11,470 B against the predicted ~11,700.