Skip to content

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/.

LocationRole 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

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).

  1. git mv plugin/lib/lease plugin/lib/services/lease; rewrite importers. Own commit.
  2. entity_namingutil/naming.ts; prose_matchutil/prose.ts. One commit each.
  3. Split prs_field: generic half merges into util/frontmatter.ts (created by T-MBOK-lib-util-modules), footer half → services/lease/footer.ts; re-point append_pr_url.ts and lease callers.
  4. Full bun test after each move — the lease suites must pass at the new home.
LocationKindChange
plugin/lib/lease/deletegit mv → lib/services/lease/
plugin/lib/entity_naming/deletefolds into util/naming.ts
plugin/lib/prose_match/deletefolds into util/prose.ts
plugin/lib/prs_field/deletesplit: util/frontmatter.ts + services/lease/footer.ts
plugin/skills/task-work/append_pr_url.tsmodifyprs_field import path
plugin/cli/lease_cli/modifylease import paths
plugin/scripts/sdlc_lease.tsmodifylease import path
  • AC-1: lib root contains only registry.ts, configuration.ts, config/, util/, model/, services/, _example/, tests/.
  • AC-2: git log --follow on each moved module shows pre-move history.
  • AC-3: all lease test suites green at services/lease/; full bun test + tsc green.
  • AC-4: no importer references the old paths (grep @lib/lease, lib/entity_naming, lib/prose_match, lib/prs_field → zero).
  • 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.
  • Soft: T-MBOK-lib-util-modules creates util/frontmatter.ts first so the prs_field generic half has a merge target.
  • 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).

← Back to Tasks