Repository navigation
refactor(config): one set of config-document editors, out of proxy and dash - #1336
Conversation
…d dash Move the toolfilter, save-more tools and adapt-compaction document edits into package config: EditToolfilterRemoved, EditToolfilterDefer, EditAdaptCompaction, DeclConfigName, RemovalNote and their helpers. The proxy keeps thin wrappers that map an editor error to an HTTP status. dash keeps its exported names as aliases. The text written is byte-identical. Golden files taken before the move pin it, and both the proxy and the config tests read them. Closes #1304 Refs #1309 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | a5dd8330d8bb |
approve |
Verdict: approve
Findings
None. The move is behavior-preserving. I compared each moved function line by line
against the code the diff removes, and found no difference in logic, error text or
HTTP status.
Non-blocking
- config/edit.go:246-252 —
AdaptCandidatesandAdaptKnobsare exported mutable globals.
dash.AdaptCompactionCandidatesanddash.adaptKnobsnow alias the same slice and
map. Today every caller only reads them, so nothing breaks. But any consumer that
appends to the slice or writes to the map changes the grid for every host at once.
A future change could unexport them and offer read accessors, or return copies. - proxy/toolfilterctl.go:216 —
withComponenthas no production caller left. Only
proxy/adapttoolsctl_test.gocalls it. The other wrappers (removedFrom,
deferSettings,withDecl,declConfigName) still serve production routes.
Consider dropping this one and pointing the test atconfig.WithComponent. - config/edit.go:69-90 — each editor parses the document two to three times per call.
EditToolfilterRemovedrunsParseForm, thenToolfilterRemovedparses again.
The same shape existed in the proxy before the move, so this is not a regression.
A later change could let the editor accept the parsedForm. - config/edit_test.go:75-77 — the config test hardcodes the host's deferral answer
(on := dn == "always"), which restatesdocDefers' rule. Drift is caught anyway:
the proxy golden test driveseditDefer, which uses the realdocDefers, and reads
the same golden files.
What I checked
- Read
CLAUDE.mdanddocs/design.md. - Read the full diff (one commit, 51 files) and the code around each change.
- Compared every moved function against the removed code, line by line:
EditToolfilterRemovedvseditRemoved,EditToolfilterDefervseditDefer,
EditAdaptCompactionvsadaptCompactionDoc,NameListvsnameListand the
inline switch inremovedFrom,RemovalNotevsapplyNote,DeclConfigNamevs
declConfigName,WithNamevswithDecl,WithComponentvswithComponent,
AdaptMergevsdash.AdaptCompactionMerge. All identical in logic. - Error parity:
ErrUnloadable's text is byte-identical to the three 409 strings the
old proxy code built (adaptctl, toolfilterctl, savemoretools).ErrNotAdaptable
renders the old 400 message verbatim.editStatusmaps 409 forErrUnloadableand
400 for everything else, which matches every old status choice. - Import graph:
configimports onlyerrors,sort,stringsand
internal/skills(which imports nothing from this module).dashandproxy
importconfig;configimports neither, so the newdash→configedge and
theKind*const aliases create no cycle. - The aliased globals (
AdaptCompactionCandidates,adaptKnobs) are read-only at
every call site indashandproxy;preserveUnmodelleddoes not mutate
PipelineKnown. - Golden files: checked the byte format against the test code, including the
trailing space inPIPELINE \nfor the error cases (strings.Join(nil, ",")is
empty). The 42 goldens cover all 8 input documents for all 5 edit kinds plus the
two adapt edge cases (refused value, stored value outside the grid). Both the
config test and the proxy test read the same files, so a change that alters one
byte fails in both packages. - Checked every modified file's imports against its remaining code; none unused.
- Commit message: DCO sign-off and
Assisted-By:present, per repo convention. - Tests were not run (live tests not approved for this review). The claim that the
golden files were taken before the move rests on the line-by-line comparison
above, not on a run.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | a5dd8330d8bb |
approve |
Verdict: approve
Findings
None. I compared every moved function line by line against its old body in proxy/toolfilterctl.go, proxy/savemoretools.go, proxy/adaptctl.go, proxy/adapttoolsctl.go and dash/adaptcompaction.go. Each is a faithful move. I found no case where the written document, the error text or the HTTP status changes.
Non-blocking
dash/adaptcompaction.go:71anddash/adaptcompaction.go:75—AdaptCompactionCandidatesandadaptKnobsarevaraliases of theconfigpackage's slice and map. Go slices and maps share backing state, so a future sort or write in dash would change the grid inconfigtoo. Today every use is read-only (checked all 7 use sites). A getter function, or a copy at the alias, would remove the trap.config/edit_test.go:40—editGoldenhas noUPDATE_EDIT_GOLDENpath, but the proxy twin (proxy/configedit_golden_test.go:48) does. To refresh a golden you must run the proxy test. One refresh path for both would be clearer.- Each editor parses the document two or three times (
ParseForm, thenToolfilterRemoved/ToolfilterLists, anddocDefersagain in the host). The old code did the same, and the documents are small. Not worth a change now. - The PR text says 37 golden files. The tree holds 42. Count error in the prose only.
proxy/adapttoolsctl.go:3— theconfigimport sits in the stdlib import group. Style only.
What I checked
- The move is faithful. I read the old bodies out of the diff and the new bodies in full:
EditToolfilterRemovedvs the oldeditRemoved;EditToolfilterDefervs the oldeditDefer;
EditAdaptCompactionvs the oldadaptCompactionDoc;RemovalNote,DeclConfigName,
WithName,WithComponent,NameList,AdaptMerge,AdaptKnobAllowedvs their old
proxy and dash bodies. Every step, every key written, every deletion and every
Pipeline/PipelineKnownassignment matches. - Error text and status.
ErrUnloadable's message is byte-identical to the three old
inline 409 messages (I concatenated each old string pair and compared).
editStatusmapsErrUnloadableto 409 and everything else to 400, which is the old
mapping in all three hosts.ErrNotAdaptable's text matches the old 400 message. - The defer path reads the same values. Old
editDeferreadkeepandalwaysfrom one
ParseFormandonfromdocDefers. NeweditDeferpassesonfromdocDefersand reads
keep/alwaysinsideconfig.EditToolfilterDeferviaToolfilterLists. Both parse the same
document with the sameParseForm, so the values are the same. - Golden tests. Both new tests read the same 42 files in
config/testdata/editgolden.
The config test'son := dn == "always"matches whatdocDefersanswers for each of the 8
input documents (I checked each: onlyalwayshastoolfilterin its pipeline with
defer: auto). I tracedremoved-add-full,defer-flip-always,defer-flip-minimal,
adapt-full,adapt-minimalandadapt-nopipethroughParseForm,AdaptMergeand
ApplyFormby hand; each golden matches the traced output. - Import cycle.
confignow importsinternal/skills. I checked:internal/skills
imports no repo package.dashalready importedconfig. No cycle. - Shared state. All users of
AdaptCandidates,AdaptKnobs,AdaptCompactionCandidates
andadaptKnobsare read-only.ApplyForm'snormalize/validateand
preserveUnmodelleddo not mutatePipelineKnown, so assigning the package-level
AdaptCandidatesinto a form is safe. - Name collisions. No other file in package
configdefines the new exported names. - Leftover callers.
removedFrom,withDecl,withComponent,declConfigName,
applyNote,deferSettings,editDefer,editRemovedandadaptCompactionDockeep their
old signatures; the existing tests inproxy/adapttoolsctl_test.gostill exercise them.
withComponentkeeps its test callers. No dead code was left. - Repo rules. No component added, so no
docs/data-dependence/row is needed. The PR
states "Behaviour: none" and my line-by-line comparison confirms it. The commit carries the
DCO sign-off andAssisted-By:. The new tests wait on no clock. - I did not run builds or tests: this review reads code only, as instructed. The PR reports
the goldens pass on unmodifiedorigin/main; my reading of the moved code is the check
I could do here, and it agrees.
…efresh - AdaptCandidates and AdaptKnobGrid return copies. The package globals are unexported, so a caller cannot change them. dash keeps its own copies. - The config golden helper has the same UPDATE_EDIT_GOLDEN refresh as the proxy twin. - Put the config import in the repo import group in proxy/adapttoolsctl.go. Refs #1304 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Round 1 notes, all handled. Head: b75a271.
Kept as is:
Tests at b75a271 (macOS, Go 1.27.4): build, vet and |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | b75a271b0c0c |
approve |
Verdict: approve
Findings
None. The one new commit fixes the shared-state trap from round 1 and changes
nothing else in behavior.
Round-1 findings, checked against b75a271
- Mine, non-blocking 1 (exported mutable globals
AdaptCandidates/AdaptKnobs): fixed.
The globals are unexported (adaptCandidates,adaptKnobs).AdaptCandidates()
returns a slice copy;AdaptKnobGrid()returns a deep copy (outer map, inner
maps, value slices).dashtakes its own copies at init
(dash/adaptcompaction.go:71,75), so no aliasing remains between the packages.
EditAdaptCompactionnow assigns a fresh copy toPipelineKnown
(config/edit.go:351), so even a future mutation insideApplyFormcould not
reach the grid.TestAdaptAccessorsReturnCopiesmutates a returned copy and
checks the next call, includingAdaptKnobAllowed. - Mine, non-blocking 2 (
withComponenthas no production caller): rejected by the author, reason accepted.
The wrapper keeps the existing proxy test unedited, which the move rules ask
for. It is a one-line delegate toconfig.WithComponent, so it carries no risk. - Mine, non-blocking 3 (two to three parses per editor): rejected, reason accepted.
The old code did the same, and the documents are small. Not a regression. - Mine, non-blocking 4 (hard-coded
onin the config test): rejected, reason accepted.
The proxy golden test runs the realdocDefersover the same golden files, so
the two answers are checked against each other. - Reviewer 1's findings: agree, all fixed in b75a271. I checked each myself:
the mutable-alias finding (same fix as mine, verified above), the missing
UPDATE_EDIT_GOLDENpath in the configeditGolden(now present,
config/edit_test.go:41-47, same shape as the proxy twin), the import group in
proxy/adapttoolsctl.go(now in the repo group), and the golden-count prose
(now 42; I counted 42.goldenfiles inconfig/testdata/editgolden). - The author's round-1 notes (amiddavid, 2026-11-24T09:49:58Z) answer every
non-blocking point. I found no request in them that is unaddressed.
Non-blocking
dash/adaptcompaction.go:71—AdaptCompactionCandidatesis still an exported
mutablevarindash. That was also its shape before this PR, and it no
longer shares state withconfig, so this is the status quo, not a new trap.
What I checked
- Last review: round 1, a5dd833, 2026-11-24T09:24:35Z.
- New commits read: 1 (b75a271 "refactor(config): return copies of the adapt
grid, share the golden refresh"). - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt). - New items since my last review: my own round-1 review, reviewer 1's round-1
review, and the author's round-1 notes comment. Each is addressed above. - Read the new commit's full diff (
git diff a5dd8330..b75a271b) and the changed
files around the changes. Grep confirms no reference to the old exported
globals remains: every use ofAdaptCandidates/AdaptKnobGridgoes through
the copy-returning accessors, andIsAdaptCandidate/AdaptKnobAllowedread
the unexported globals only. - Verified the copies are real:
AdaptCandidatesis
append([]string(nil), adaptCandidates...);AdaptKnobGridrebuilds the outer
map, each inner map, and each value slice.dash's package-init copies run
afterconfig's init, becausedashimportsconfig. - Verified
editGolden's new refresh path writes to
config/testdata/editgoldenand matches the proxy helper's shape. - No behavior change: the accessors only change who holds the slice and map, not
the values. The commit message states this and the diff confirms it. - The author reports tests at b75a271 (macOS, Go 1.27.4): build, vet, gofmt
clean; unit tests pass for./config,./proxy/...,./dash/...; race for
./configand./dash/.... I did not run tests myself (not approved this
round).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | b75a271b0c0c |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 1, non-blocking:
dashvars aliasedconfig's mutable grid. Fixed in
b75a271b.adaptCandidatesandadaptKnobsinconfig/edit.goare now unexported.
AdaptCandidates()returns a slice copy;AdaptKnobGrid()returns a deep copy (outer map,
inner maps, value slices).dash/adaptcompaction.go:71,75now takes its own copies at init,
so a dash write can no longer reachconfig.EditAdaptCompactionputs a fresh copy into
f.PipelineKnown, andpreserveUnmodelledonly reads it. Checked. - Reviewer 1, round 1, non-blocking: config golden test had no refresh path. Fixed.
editGoldeninconfig/edit_test.gonow has the sameUPDATE_EDIT_GOLDENpath and the same
"run with UPDATE_EDIT_GOLDEN=1" hint as the proxy twin. Checked. - Reviewer 1, round 1, non-blocking:
configimport in the stdlib group. Fixed in
proxy/adapttoolsctl.go. Checked. - Reviewer 1, round 1, non-blocking: PR text said 37 goldens, tree holds 42. Fixed. The PR
body now says 42. Checked against the live PR body. - Reviewer 2, round 1, non-blocking:
withComponentwrapper has no production caller.
The author kept it, to leave the existing proxy test unedited. The reason is sound: the
wrapper is one line and the test still checks real behavior through it. Accepted. - Reviewer 2, round 1, non-blocking: 2-3 parses per editor. The author kept it. The reason
is right: the old proxy code had the same shape, so this is not a regression. Accepted. - Reviewer 2, round 1, non-blocking: hard-coded
onin the config test. The author kept
it. The reason is right: the proxy golden test runs the realdocDefersover the same
golden files, so the two answers check each other. Accepted.
New commit
b75a271b changes 4 files, 54 insertions, 12 deletions. I read the full diff and the code
around each change:
config/edit.go— the two globals became unexported; two copy-returning accessors were
added;IsAdaptCandidate,AdaptKnobAllowedandEditAdaptCompactionnow read the
unexported globals. The values are the same, so no behavior change. No other package used
the old exported vars: I grepped the whole tree at the new head; every reference is either
the new accessors, the new test, or dash's updated init.config/edit_test.go— newTestAdaptAccessorsReturnCopies. It mutates a returned
candidate slice, a returned grid's inner map, inner slice and outer map, then checks the
next call sees the original values, and thatAdaptKnobAllowedstill answers from the
untouched grid. The checks are correct for slice, map and nested isolation.dash/adaptcompaction.go— the two vars now copy fromconfigat init. All 7 dash use
sites read only, so the copy is equivalent.proxy/adapttoolsctl.go— import moved to the repo group.stringsandskillsare
still used in the file.
Non-blocking
config/edit.go:278— the comment onIsAdaptCandidatestill says "one of AdaptCandidates",
which is now a function, not a list. Wording only.
What I checked
- Last review: round 1, a5dd833, 2026-11-24T09:25:19Z.
- New commits read: 1 (
b75a271b"refactor(config): return copies of the adapt grid, share
the golden refresh"). - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt; the inline
file is empty). - New items since my last review:
- Reviewer 2's round-1 review (posted 09:24:35Z, 44 seconds before mine). I read it in
full now. Its four non-blocking notes overlap mine; the author fixed the aliasing note
and gave sound reasons for keeping the other three. Nothing in it needs a new finding. - Author comment at 09:49:58Z. I checked each claim against the code: globals unexported
with copy accessors (true), golden refresh path added (true), import group fixed (true),
PR count now 42 (true, read from the live PR body). - Commit
b75a271b. Reviewed above, as a first review.
- Reviewer 2's round-1 review (posted 09:24:35Z, 44 seconds before mine). I read it in
- No golden file changed in the new commit, so the byte-identity pin from round 1 still holds.
- I did not run builds or tests: this review reads code only, as instructed.
Comment only. Refs #1304 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
approved: b75a271 (base 30a8076) patch-id c1468d6b10c5 |
|
approved: b75a271 (base 30a8076) patch-id c1468d6b10c5 |
…igedit Signed-off-by: DAVID AMID <[email protected]> # Conflicts: # proxy/savemoretools.go
|
Merged Conflict:
Resolution:
Tests (macOS, Go 1.27.4): build, vet and |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 3 of 3 | 9106e895ca9e |
approve |
Verdict: approve
Findings
None. The branch gained one comment-only commit and a merge of origin/main.
The merge resolves its one conflict correctly. No behavior changed.
Earlier findings, checked against 9106e89
- All round-1 and round-2 findings were fixed or accepted in round 2. Nothing
reopened: the merge touches none of the fixed code paths. - Reviewer 1's round-2 non-blocking (the
IsAdaptCandidatecomment named the
oldAdaptCandidatesvariable): fixed in bdc646c. The comment now reads
"one of the adapt candidates". Comment only, no code change.
New commits
- bdc646c — comment fix, verified. One line in
config/edit.go:278. No
code change. - 9106e89 — merge of
origin/main, verified. One conflict, in
proxy/savemoretools.go, indeferSettings:- This branch had
deferConf{on: docDefers(doc), keep, always}with the lists
fromconfig.ToolfilterLists. - main (#1325) had replaced
docDeferswithtooldefer.DocOnand still used
the localnameList, which this branch had moved toconfig.NameList. - The resolution takes both:
onfromtooldefer.DocOn, the lists from
config.ToolfilterLists. That is the correct combination. I read the merged
deferSettingsandeditDeferin full, and the file's imports
(tooldeferadded,sortgone).
- This branch had
- The other commits in
git log b75a271b..HEAD(9f34a5c, de4e2f9, d6cc528,
98c9a74, 8e3e674, 28383ae, c3096ca) came frommainthrough the merge.
They are not this PR's changes: the PR diff against the new base c3096ca is
the same 51-file set I reviewed in rounds 1 and 2, plus the merged
savemoretools.golines. I read their messages and stats, and checked the two
that touch this PR's files (#1325 forsavemoretools.go, #1315 for
CLAUDE.md).
Merge-safety checks
tooldefer.DocOnanswers what the olddocDefersanswered for every
input this PR's paths can see. Old:Decodesucceeds anddefer == "auto".
New:Decodesucceeds andreformat.DeferMode(defer)is on.DeferMode
maps""and"off"to off,"auto"to on, anything else to an error, and
the error path returns false. So the answers agree on empty,off,auto
and invalid values. The 42 golden files therefore stay valid, as the author
reports.- The golden tests' deferral premise still holds. The proxy golden test
driveseditDefer→deferSettings→tooldefer.DocOn. Of the 8 input
documents, onlyalwayshastoolfilterin its pipeline withdefer: auto,
which matches the config test's hard-codedon := dn == "always". - No silent drop on either side of the merge. I diffed the merge result
against both parents forproxy/savemoretools.go: against the branch it adds
only #1325'stooldefer.DocOnswap; against main it applies only this PR's
editor refactor. The other PR files (config/edit.go,config/edit_test.go,
proxy/toolfilterctl.go,proxy/adaptctl.go,proxy/adapttoolsctl.go,
dash/*, the goldens) are untouched by main, so the merge carried them
through unchanged. - The PR now also satisfies main's new rule ("What goes in the proxy",
CLAUDE.md from #1315): config-document edits are named there as business
logic that must live in a library package. This PR is the move that rule
asks for.
Non-blocking
docDefersinproxy/tooldefer.go:251and the directtooldefer.DocOncall
inproxy/savemoretools.gonow both exist. Both defer to the same function,
so they cannot disagree. A later cleanup could drop the proxy wrapper. This
shape came from main's #1325, not from this PR.
What I checked
- Last review: round 2, b75a271, 2026-11-24T09:51:46Z.
- New commits read: 2 on this branch (bdc646c "docs(config): fix a comment
that named the old AdaptCandidates variable"; 9106e89 "Merge origin/main"),
plus 7maincommits reached through the merge, listed above. - Read in full: 4 reviews, 4 comments, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt;
the inline file is empty). - New items since my last review, and what I did about each:
- Range-diff notes at 09:53:29Z ("SAME CHANGE") and 09:53:47Z ("COMMENTS
ONLY"). Mechanical skill output; the claims match what I verified in the
diffs. - Reviewer 1's round-2 review. Its one non-blocking (comment wording) is
fixed in bdc646c, which I checked. - Author's merge note at 10:51:07Z. It describes the conflict and the
resolution; I verified both against the code and both parents.
- Range-diff notes at 09:53:29Z ("SAME CHANGE") and 09:53:47Z ("COMMENTS
- Read
git diff b75a271b..bdc646c1(one comment line), the merge diffs
against both parents for the conflicted file, and
git diff --stat c3096caa..9106e895(the same 51-file PR set,
+1153/−294). - Read
tooldefer/on.goandreformat.DeferMode
(components/reformat/toolfilter.go:146) to confirm the deferral answers
did not change. - The author reports tests at 9106e89 (macOS, Go 1.27.4): build, vet, gofmt
clean; unit tests pass for./config,./proxy,./dash/...and
./tooldefer/..., golden tests included and unchanged. I did not run tests
myself (not approved this round).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 3 of 3 | 9106e895ca9e |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 2, non-blocking: the
IsAdaptCandidatecomment named the old
AdaptCandidatesvariable. Fixed inbdc646c1. The comment now says "one of the adapt
candidates". That commit changes one comment line and nothing else. Checked. - All round-1 findings were settled in round 2 (fixed in
b75a271b, or kept with a reason I
accepted). Nothing reopened.
New commits
Two commits since b75a271b, plus main merged in:
bdc646c1"docs(config): fix a comment that named the old AdaptCandidates variable".
One comment line inconfig/edit.go. No code change. Checked in full.9106e895— merge oforigin/main(c3096caa) into the branch. Not a rebase: the
two PR commits keep their SHAs. Main brings 7 commits (docs #1316 and #1315, opencode
signals #1317, Codex session keying #1322, opencode docs #1339, tooldefer move #1325,
campaign move #1332). Onlyproxy/savemoretools.goconflicted, and I checked the
resolution against both parents:- Against our parent (
bdc646c1), the merge takes main's rename only:
docDefers(doc)becomestooldefer.DocOn(doc)indeferSettings, and theeditDefer
comment follows. Nothing else of ours changed. - Against main's parent (
c3096caa), the merge keeps our whole refactor:
deferSettingsreads its lists throughconfig.ToolfilterLists, andeditDeferwrites
throughconfig.EditToolfilterDeferwitheditStatus. - Both sides are preserved.
tooldefer.DocOn(main #1325) answers the same as the old
docDefersfor every input:reformat.DeferModemaps""/"off"to off,"auto"to
on, and anything else to an error, whichDocOnturns into off — the old code compared
== "auto". Same answers, so the golden tests'onvalues are unchanged. docDefersstays inproxy/tooldefer.go:251as a one-line wrapper of
tooldefer.DocOn, used by the start-up scan and one test. The author's comment says
the same; checked.- Main's change to
components/reformat/toolfilter.goonly extractsDeferModefrom the
constructor. The declared field set is unchanged, soParseForm'sreadBlocksand the
golden outputs are unaffected.
- Against our parent (
The PR's own diff against its new base (c3096caa..9106e895) is the same 51 files I approved
in round 2, plus the comment fix and main's one-line DocOn rename. No golden file changed.
One note on the new CLAUDE.md rule from main (#1315): "edits to the config document" are
business logic and belong in a library package. This PR is the compliance for the toolfilter,
save-more tools and adapt-compaction edits: the editors live in config, and the proxy keeps
only decode, call and status mapping. The PR matches the rule it precedes.
Non-blocking
- Nothing new. The round-2 notes that remain (2-3 parses per editor, the
withComponent
test-only wrapper, the hard-codedonin the config test) were all kept by the author with
reasons I accepted in round 2.
What I checked
- Last review: round 2, b75a271, 2026-11-24T09:52:04Z.
- New commits read: 2 (
bdc646c1"docs(config): fix a comment that named the old
AdaptCandidates variable",9106e895"Merge remote-tracking branch 'origin/main' into
worktree-mv-1304-configedit"). The merge brings 7 main commits; I read their stats and the
two that touch this PR's files in full (#1325'sproxy/savemoretools.go,
proxy/tooldefer.goandcomponents/reformat/toolfilter.gochanges). - Read in full: 4 reviews, 4 comments, 0 inline comments (from the three files
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt; the inline
file is empty). - New items since my last review:
- Reviewer 2's round-2 review (09:51:46Z, 18 seconds before mine). Read in full. It agrees
with my round-2 result and adds nothing unanswered. - Comment at 09:53:29Z and 09:53:47Z: approval bookkeeping (range-diff, patch-id). The
"comments only" claim forbdc646c1I verified myself: one comment line. - Comment at 10:51:07Z: the merge note. I checked each claim: the conflict site, the
resolution text, and thedocDeferswrapper. All true. - Commits
bdc646c1and9106e895. Reviewed above, as a first review.
- Reviewer 2's round-2 review (09:51:46Z, 18 seconds before mine). Read in full. It agrees
- Confirmed the PR diff against the new base is the same file set as round 2 (51 files) and
thatb75a271b..9106e895touches our files only inproxy/savemoretools.go(theDocOn
rename) andconfig/edit.go(the comment fix). - I did not run builds or tests: this review reads code only, as instructed. The author
reports the golden tests pass unchanged at9106e895; my reading of the merge and of
reformat.DeferModeagrees.
Summary
The config-document editors now live in package
config. Proxy and dash call them. Closes #1304. Refs #1309.What changed
config/edit.go:EditToolfilterRemoved,EditToolfilterDefer,EditAdaptCompaction,DeclConfigName,RemovalNote,ToolfilterRemoved,ToolfilterLists,NameList,WithName,WithComponent.AdaptCandidates,AdaptKnobs,AdaptKnobAllowed,AdaptMergenow live inconfig. dash keepsAdaptCompactionCandidates,AdaptCompactionMerge,AdaptCompactionKnobAllowedand theKind*constants as aliases of them.removedFromandnameListwere the same decode. Now one:config.NameList.editRemovedandeditDefershared one body. NowtoolfilterBlockandapplyToolfilterinconfig.editStatus:config.ErrUnloadablebecomes 409, any other error 400.docDefersanddeferOn(refactor(tooldefer): move the tool-deferral flow out of the proxy #1299).deferSettingsstill callsdocDefersfor "is deferral on". The library editor takes that answer as theonargument, so it holds no deferral check.Behaviour
None. Written text, error text and HTTP status are the same.
Data dependence
Same as before. These editors read and write the config document only. No stored customer data. No
docs/data-dependence/row changes.How it was tested
macOS, Go 1.27.4.
config/testdata/editgolden/hold the exact text each editor writes (comments are normalised byApplyForm, key order fixed). They were checked against unmodifiedorigin/mainand pass there. The proxy test and the config test read the same files.delete(blk, "always_defer")makes the config and proxy golden tests fail (defer-on-always,defer-flip-always).go build ./... && go vet ./... && gofmt -l .: clean.go test ./config ./proxy/... ./dash/... ./cmd/...: pass../configpass,./dash/...pass../proxy/...had one failure,TestMetricsCallLatency(p99 timing, run while 6 other agents used the machine). It passes alone with-race, with the editor, defer, tool-filter and adapt tests.Technical notes
confignow importsinternal/skillsforDeclConfigName.internal/skillsimports no repo package, so there is no cycle.dash.Kind*aliasconfig.Kind*, so the kind strings have one source.