Skip to content

T-Y1L0-entities-validate-absorb

Status: closed/done · Impact: high · Complexity: medium

Fourteen skills gate every frontmatter edit on validators/validate_frontmatter.ts. The op behind it exits 0 on validation failure and lacks the shim’s 3-tier schema resolution, so a naive codemod would silently green every gate. Absorb the shim’s full contract into entities validate so the codemod becomes a one-line diff per caller and validators/ can be deleted with no carve-out.

LocationRole today
plugin/validators/validate_frontmatter.ts3-tier resolution (--schematype: → parent-dir basename + singularize); OK/FAIL <path> (schema: <name>) text; exit 0/1/2; --quiet, --list-types; entitiesDir defaults to the plugin’s entities dir
plugin/lib/model/ops/validate.ts#handlerexplicit-schema or entitiesDir+type: only; returns {failed} so the generated CLI exits 0 on failure; hidden: true; JSON only

The op gains the dir-basename + singularize tier, the entitiesDir default, a cli.render hook reproducing the exact OK/FAIL + indented at <loc>: + stderr-summary text, exit 1 when failed > 0, and --quiet. The op is un-hidden. --list-types is dropped (zero SKILL.md callers). The shim’s output is locked as golden BEFORE the absorb; the shim file itself stays until T-YBKU-shim-deletion-guard deletes it.

  1. Golden-snapshot the shim: pass, fail, mixed-type multi-file (task + backlog in one call), parse-error, and no-schema cases.
  2. Port the resolution tiers + entitiesDir default into the op handler.
  3. Add the cli.render hook (lands with T-NV49-op-path-substrate) reproducing text + exit shaping; keep --json canonical.
  4. Un-hide; add --quiet to the input schema.
  5. Parity test: bun run plugin/cli/sdlc.ts entities validate … vs the goldens, byte-identical.
LocationKindChange
plugin/lib/model/ops/validate.tsmodifyresolution tiers, default, render hook, exit shaping, —quiet, un-hide
plugin/lib/tests/ops_generic.test.tsmodifyabsorb coverage
plugin/lib/tests/modifynew CLI-spawned parity goldens
plugin/validators/validate_frontmatter.tsmodifynone beyond comments — stays until T-YBKU-shim-deletion-guard
  • AC-1: CLI parity goldens byte-match the shim, including the mixed-type multi-file call.
  • AC-2: sdlc entities validate <bad-file> exits 1; --json still emits the validated JSON shape.
  • AC-3: a draft file with no type: field in docs/planning/tasks/ resolves to the task schema via the dir-basename tier.
  • AC-4: the op appears in sdlc entities --help (un-hidden); full bun test green.
  • Resolved design question (e) in docs/plans/op-substrate-full-sweep.md: absorb-into-op chosen over retain-as-adapter; the op’s exit-0-on-failure was the disqualifier for a naive codemod.

T-NV49-op-path-substrate


← Back to Tasks