Repository navigation
fix: duplicate goal tool registrations, dead RetryPolicy, and stale config docs - #98
Merged
Merged
Conversation
serkanalgur
force-pushed
the
fix/remove-dead-retry-policy
branch
from
September 28, 2026 06:17
0f903e0 to
7bbedcc
Compare
… wrong None of the three is observable at a call boundary, so each is asserted against the file it was wrong in rather than against behaviour. #87 src/index.ts registered goal.status, goal.complete and goal.list twice. A duplicate editor.add does not throw, the second simply wins, so nothing failed. The test parses the registrations out of the blanked source and asserts no name repeats, and that the set matches README's Tools table in both directions. Two-way matters: a count comparison passes when a tool is renamed on one side only. #86 docs/API.md said "all four" blocks where getSaveableConfig() writes eight. The block list is read out of the method body by brace matching from the declaration, not the first mention, which is a call site. It is then cross-checked against what saveProjectConfig actually writes, and against every number word API.md uses to count blocks, so the next added block moves the doc with it. #89 RetryPolicy was a type nothing implemented, and analyzeComplexity carried a 15-point 'medium' risk arm no producer could reach. The test greps src/ for both names. The 30-point weight is pinned too, but note the delta alone cannot see an unreachable branch: no input produces 'medium', so a behavioural test stays green. The source assertion carries that half, which is why both exist. Mutation-checked: reverting ce17786 fails the three #87 tests, reverting 6930376 fails the two #86 tests, re-adding the field fails the grep, and re-adding the arm and its cast fails the body test. 1322 -> 1334.
docs/API.md named memory, security and communication as constructor-only NexusConfig blocks. None of the three exist on the type: they were deleted rather than left unread, and saveProjectConfig cannot drop what is not there. The same sentence omitted agents, learning and cost, which do exist, so the list was wrong in both directions. TECHNICAL_DESIGN.md still sketched retryPolicy?: RetryPolicy on Task, which #89 removed from the type. The doc-sweep test from the previous commit asserted that stale copy as its expected result, so fixing the doc would have failed the test; it now asserts the field appears in no source file and no doc. The block list itself was untested, which is how it drifted. A new test derives the constructor-only complement from src/types.ts and compares it to the sentence in both directions. Two smaller ones: numberWord() returned undefined past twelve while the mention regex stopped at twelve, so a thirteenth block would have compared undefined to undefined. It now throws, naming what to extend. And saveableConfigBlocks() re-implemented brace matching that already exists in test/helpers/dashboard-page.ts; it uses matchBrace() instead.
serkanalgur
force-pushed
the
fix/remove-dead-retry-policy
branch
from
September 28, 2026 06:25
7bbedcc to
eef7d13
Compare
…ger describe the code
This was referenced Sep 28, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #86, #87, #89. Closes #85 (already fixed by 07460d5).
#85 — bare-id model autocomplete
Already resolved in
07460d5:src/orchestrator.tsmatches viatryParseModelRef(m)?.idinstead ofsplit('/')[1], so multi-slash refsno longer throw. No code change here.
#86 — docs/API.md claimed four config blocks; the code writes eight
getSaveableConfig()(src/config.ts:1429-1484) writes eight blocks:models, budget, selfHealing, dashboard, notifications, gitFlow, effort,
customRoles. The doc said "all four".
The adjacent "not in this schema" list was also wrong in the other
direction:
memory,securityandcommunicationare not onNexusConfigat all (deliberately removed — see the doc comments insrc/types.ts), whileagentswas missing. Corrected toagents, learning, cost.Docs-only. No config-writing behaviour touched.
#87 — three goal tools registered twice
goal.status,goal.completeandgoal.listwere each added to thenexusnamespace twice. The registry keys onnamespace_name, so thesecond registration overwrote the first and the first set was
unreachable. Removed 38 lines of dead code (51 → 48 registrations, 48
unique, exact 1:1 with the README tool table).
The surviving set is the richer one: it returns
autoContinue,shouldContinue()andcreatedAtfromgoal.status, andgoal.completeis the one that persists state. The removed set would have silently
dropped the write had the order been reversed, so the two were compared
field by field before deleting.
Note: the key this writes (
nexus-goal) is written but never read —GoalManageris an in-memoryMap. That is pre-existing and out ofscope here, but it means a goal that is never completed does not survive
a reload. Worth a separate issue.
#89 — dead
RetryPolicyand an unreachable'medium'armRetryPolicyandTask.retryPolicywere declared but never read orwritten anywhere — the real backoff is
selfHealing.retryDelay(
src/orchestrator.ts:1123, 1231, 2049, 3379), which already carriesbackoffMultiplier. Removed the duplicate concept.analyzeComplexityonly ever produced'low' | 'high', so theriskLevel === 'medium' ? 15 : 0arm atsrc/orchestrator.ts:3934could not run. Narrowed the local type and removed the arm.
ComplexityScore.riskLevelstays'low' | 'medium' | 'high'— that ispublic shape and
src/templates.ts:65still produces'medium', whichtest/templates.test.ts:121asserts. It simply never reaches thedifficulty ladder, because
selectQualifiedModelrecomputes viaanalyzeComplexityinstead of readingtask.complexity.Also updated the stale
retryPolicyreference inTECHNICAL_DESIGN.mdand three comments in
test/config-knobs.test.tsthat justifiedthemselves by pointing at the deleted type.
Tests
test/issue-regressions.test.ts, 14 tests, each verified by mutation(reverting the corresponding fix makes the right tests fail):
getSaveableConfig()block count matches what API.md documents, andthe "not in this schema" list matches
NexusConfigin both directionsretryPolicyappears in no source file and no docanalyzeComplexityexposes no third risk levelTypecheck, lint and build are clean.
bun testgoes 1322 → 1335 passing,0 failing.
Review notes
Two things a reviewer may want to weigh in on:
SDK
editor.addbehaviour, which is not verifiable from this repo (theplugin package is not vendored). The conclusion is safe either way —
the set that survives is the richer one, so removing the other is an
improvement under both readings.
Task.retryPolicyis a type-level breaking change for any externalcaller constructing a
Taskliteral with that field. Nothing in thisrepo did, and the field was never read.