T-ZSSE-task-sort-registry-move
Status: closed/done · Impact: medium · Complexity: medium
task sits in LEGACY_NOUNS for exactly one verb: sort. Move sort into
the registry to drain it — atomically, because mergeSplitNoun’s
legacy-wins collision rule would dead-shadow a registry sort while
task stays legacy, and a naive parity test would pass against the
still-live legacy path, masking the unreachable op.
| Location | Role today |
|---|---|
plugin/cli/task_cli/sort.ts | pickup-order algorithm (D-Q2WR): line-per-basename output consumed by orchestrate; CYCLE markers |
plugin/cli/sdlc.ts | LEGACY_NOUNS carries task solely for the sort dispatch |
plugin/cli/task_cli/tests/ | dispatch tests spawn task_cli/index.ts by path |
Proposed
Section titled “Proposed”model/entities/task/ops/sort.ts with path: ['task','sort']; a
cli.render hook preserves the line-per-basename output and CYCLE
marker; task leaves LEGACY_NOUNS in the same commit; the parity
test asserts registry dispatch — getOp(['task','sort']) resolves AND
task is absent from LEGACY_NOUNS — so a shadowed op fails loudly. The
CLI path sdlc task sort is unchanged: no caller codemod.
Approach
Section titled “Approach”- Golden-snapshot
sdlc task sort(normal + cycle fixture), byte-exact. - Port the algorithm into the op with its render hook.
- In the SAME commit: register the op and remove
taskfrom LEGACY_NOUNS. - Parity + registry-dispatch assertions; re-point task_cli dispatch tests to spawn
cli/sdlc.ts.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/model/entities/task/ops/sort.ts | new | the op + render hook |
plugin/cli/task_cli/sort.ts | delete | algorithm moves to the op (git mv core) |
plugin/cli/sdlc.ts | modify | LEGACY_NOUNS drops task (same commit as op registration) |
plugin/cli/task_cli/tests/dispatch.test.ts | modify | spawn cli/sdlc.ts; assert registry dispatch |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
sdlc task sortbyte-matches the golden, including the CYCLE-marker case. - AC-2: a test asserts
getOp(['task','sort'])resolves ANDtask∉ LEGACY_NOUNS — the shadow scenario cannot pass silently. - AC-3: the op registration and the LEGACY_NOUNS removal are one commit (
git showexhibits both). - AC-4: after merge,
backlogis the only remaining split/legacy noun.
Out of scope
Section titled “Out of scope”- Sort-algorithm changes (T-0015’s dispatchability filter stays separate).
- The lease noun drain (T-2W56-lease-noun-migration).
Dependencies
Section titled “Dependencies”- T-NV49-op-path-substrate — path[] registration and render hook.
Discovery context
Section titled “Discovery context”- Adversarial refutation: mergeSplitNoun’s first-positional probe + legacy-wins rule create a silent-shadow window; the atomic-flip discipline here mirrors T-2W56-lease-noun-migration’s split-brain guard.