T-JJZ3-lib-root-tidy
Status: closed/done · Impact: medium · Complexity: medium
The lib root carries pre-D-0007 homes: lease/ is a service,
entity_naming/ and prose_match/ are util algorithms, and prs_field/
mixes generic frontmatter editing with lease-footer parsing. Move each to
its D-0007 home so the port tasks import final paths and the lease noun
migration starts from services/lease/.
| Location | Role today |
|---|---|
plugin/lib/lease/ | lifecycle-lease protocol (13 modules + tests) at lib root |
plugin/lib/entity_naming/ | pluralize() — an entity-agnostic algorithm at lib root |
plugin/lib/prose_match/ | phraseInProse() at lib root |
plugin/lib/prs_field/ | generic prs: frontmatter read/write + lease-footer logic in one module |
Proposed
Section titled “Proposed”services/lease/ (verbatim git mv, imports rewritten);
util/naming.ts; util/prose.ts; prs_field split — generic prs:
helpers merge into util/frontmatter.ts, lease-binding-footer parsing
lands at services/lease/footer.ts (the split D-0007 §Migration step 2
prescribes).
Approach
Section titled “Approach”git mv plugin/lib/lease plugin/lib/services/lease; rewrite importers. Own commit.entity_naming→util/naming.ts;prose_match→util/prose.ts. One commit each.- Split
prs_field: generic half merges intoutil/frontmatter.ts(created by T-MBOK-lib-util-modules), footer half →services/lease/footer.ts; re-pointappend_pr_url.tsand lease callers. - Full
bun testafter each move — the lease suites must pass at the new home.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/lease/ | delete | git mv → lib/services/lease/ |
plugin/lib/entity_naming/ | delete | folds into util/naming.ts |
plugin/lib/prose_match/ | delete | folds into util/prose.ts |
plugin/lib/prs_field/ | delete | split: util/frontmatter.ts + services/lease/footer.ts |
plugin/skills/task-work/append_pr_url.ts | modify | prs_field import path |
plugin/cli/lease_cli/ | modify | lease import paths |
plugin/scripts/sdlc_lease.ts | modify | lease import path |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: lib root contains only
registry.ts,configuration.ts,config/,util/,model/,services/,_example/,tests/. - AC-2:
git log --followon each moved module shows pre-move history. - AC-3: all lease test suites green at
services/lease/; fullbun test+ tsc green. - AC-4: no importer references the old paths (grep
@lib/lease,lib/entity_naming,lib/prose_match,lib/prs_field→ zero).
Out of scope
Section titled “Out of scope”- Migrating the lease CLI verbs into the registry (T-2W56-lease-noun-migration).
_example/— convention smoke test, stays.- Any behavior change inside the moved modules.
Dependencies
Section titled “Dependencies”- Soft: T-MBOK-lib-util-modules creates
util/frontmatter.tsfirst so the prs_field generic half has a merge target.
Discovery context
Section titled “Discovery context”- docs/plans/op-substrate-full-sweep.md §1c target tree; D-0007 §1 (“lease is a service for now”) and §Migration step 2 (prs_field split).