build: --explain-copies hint line for nested writes (take out, put back) #302
Loading…
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?
Context
torb build --explain-copies(#61) reports each copy the compiler can prove, with its source span and the reason. PERFORMANCE.md section 6 also shows a second=line that says how to avoid the copy (take the row out and put it back,removeAt...insert). #61 deliberately ships without it.Acceptance criteria
a[i][j] = ...wherea[i]is shared), the--explain-copiesnote gains the second=line from PERFORMANCE.md section 6 naming the take-out / put-back rewrite with the user's own variable names.compiler/tests/pins the full text of one note with the hint and one without.docs/tooling/torb-build.mdshows the extended note.Dependencies
Seed impact
None: the flag is not used by the compiler's own build (
tools/bootstrap.shpasses onlybuild ./compiler --output), so one commit.torb build --explain-copies#61torb build --explain-copies#61[loop:torbscript] intake: in scope, no duplicate, dependencies closed (#61 / #111), definition of ready met (goal, acceptance criteria, design, no seed impact). Set
ready. next: implement[loop:torbscript] claim implement by session:loop-torbscript-20261021 until 2026-10-21T04:00:43Z
[loop:torbscript] implement: PR #394 opened from
loop/302-explain-copies-hint(one Conventional Commit,Closes #302). A note for a write into an element of a list a variable holds now gets the second=line with the take-out / put-back rewrite in the program's own names; fields, deeper paths and arrays keep the single reason line. Tests pin one note with and one without the hint; torb-build.md, PERFORMANCE.md section 6 and the generated skills copy show it. Forge CI green on917f6bd0(tier A and B, gates, commit messages; the first push failed onlyformat --check, fixed by writing one call as a command). Map owners: the analysis reports no nested map writes today, so there is nothing to hint at. Worker usage: about 0.1M tokens (Sonnet), next: review