T-2W56-lease-noun-migration
Status: closed/done · Impact: high · Complexity: large
lease is the largest hidden noun and, after T-ZSSE-task-sort-registry-move, the last
hand-wired CLI subtree besides backlog. Migrate its 11 verb files into
discovered op modules preserving the real two-axis depth-3 shape
(lease task *, lease op claim) — atomically, because a partial drain
creates a split-brain window where lease task acquire routes to the old
dispatcher while flat lease heartbeat routes to the registry.
| Location | Role today |
|---|---|
plugin/cli/lease_cli/ | 11 hand-wired verbs incl. the two-axis task_claim/task_acquire/task_reacquire/task_transition/task_archive + op_claim |
plugin/cli/lease_cli/index.ts | noun-scoped --authority/--project-root flags applied to every subcommand |
plugin/cli/lease_cli/_common.ts | deterministic markers (CLAIMED/HEARTBEAT/CAS-FAILED/…) + exit codes 2–8 |
plugin/skills/task-work/tests/lease_integration.test.ts | spawns scripts/sdlc_lease.ts and lease_heartbeat_loop.ts by path |
plugin/cli/sdlc.ts | LEGACY_NOUNS carries lease |
Proposed
Section titled “Proposed”services/lease/ops/task/{claim,acquire,reacquire,transition,archive}.ts
and ops/op/claim.ts as 3-segment paths, plus flat
ops/{heartbeat,release,inspect,list,parse-footer,reconcile,migrate}.ts;
authority declared via a shared optional input fragment on each lease op
(the noun-level flag becomes verb-level — adapter has no inherited-flag
mechanism; callers are codemodded anyway); markers and exit codes
preserved via render hooks; the single-shot heartbeat op stays distinct
from the heartbeat-loop service; lease leaves LEGACY_NOUNS in the same
commit the ops register, with a post-flip sdlc lease task acquire
behavior test guarding the split-brain window.
Approach
Section titled “Approach”- Goldens for every verb: markers, exit codes 2–8,
--jsonshapes (reuse the existing lease test fixtures). - Port the flat verbs, then the two-axis depth-3 verbs under
ops/task/andops/op/. - Shared
authorityinput fragment; verify expansion semantics matchresolveAuthority(via lib/config from T-KO35-config-sdlc-yaml). - Atomic flip: ops registration + LEGACY_NOUNS removal in one commit; post-flip dispatch test for a depth-3 verb.
- Re-point
lease_integration.test.ts(andscripts/sdlc_lease.tscallers) to spawncli/sdlc.ts; full lease suites green.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/services/lease/ | modify | ops/ tree lands here (post T-JJZ3-lib-root-tidy relocation) |
plugin/cli/lease_cli/ | delete | verbs become discovered ops (git mv cores) |
plugin/cli/sdlc.ts | modify | LEGACY_NOUNS drops lease (same commit) |
plugin/skills/task-work/tests/lease_integration.test.ts | modify | spawn cli/sdlc.ts |
plugin/scripts/sdlc_lease.ts | modify | forwards to the CLI until deletion |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: every lease verb golden parity — markers, exit codes 2–8,
--json— including all fivelease taskverbs andlease op claimat depth-3. - AC-2: ops registration and LEGACY_NOUNS removal are one commit; a post-flip test dispatches
sdlc lease task acquirethrough the registry (no legacy fall-through). - AC-3:
--authorityaccepted at verb level with unchanged expansion semantics; lease namespace-conflict guard behavior preserved. - AC-4:
lease_integration.test.tsgreen spawning the CLI; single-shotheartbeatand the heartbeat-loop service remain distinct paths.
Out of scope
Section titled “Out of scope”- The heartbeat-loop defineService (T-OSEH-long-running-services).
- Lease protocol/CAS semantics changes.
- Caller prose codemod (T-QL5F-skill-prose-codemod).
Dependencies
Section titled “Dependencies”- T-NV49-op-path-substrate —
ops/<group>/walk descent must be merged and fixture-proven first. - T-JJZ3-lib-root-tidy — lease library relocated to services/lease/ first.
Discovery context
Section titled “Discovery context”- The adversarial loop’s strongest catch: all four candidate designs flattened the lease two-axis lossily, and the ambiguity refuter proved the mergeSplitNoun split-brain window. docs/plans/op-substrate-full-sweep.md T11 amendment.
Depends on
Section titled “Depends on”T-NV49-op-path-substrate, T-JJZ3-lib-root-tidy