issue-320: Add worktree config section schema and shape validation #326
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-320/add-worktree-config-section-schema-and-shape-valid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
320: Add worktree config section schema and shape validation
Closes #320 — 320.
Generated in 18m 05s.
Review findings
I have both findings in view. Both are small, well-scoped fixes:
worktree:block toFULL_YAMLand assertresult.worktreein the full-mapping test.WorktreeFileConfigJSDoc to mirror the ADR-022 §2 decision table.Applying both now:
Both edits applied. Now checking for other consumers of
FULL_YAMLand other full-shape assertions that could be affected:FULL_YAMLis only used in the full-mapping test, which now covers the new section. Running the project gates:Build passes. Now the test suite and lint:
All 2187 tests pass. Now lint and format checks on the changed files:
All gates green. Quick sanity check of the final diff:
Both fixes are minimal, applied, and all gates are green. Both findings are resolved.
Review Findings — 320
Summary
Stage 1 implements Slice 1 of the configurable-worktree plan (ADR-022): the
worktree:section schema, strict key/type validation, and the "dir required when enabled" cross-field rule, with tests covering the full ADR-022 §2 decision table. All gates ran and passed: build ✅,npm test(2187/2187) ✅,npm run lint✅, and prettier check on the changed files ✅ (gated E2E not run — requires live creds/LLM and is out of scope for this slice). No critical or high issues found; two minor gaps below. Remediated (this stage): both findings fixed — theworktree:block was added to theFULL_YAMLcanonical fixture and asserted in the full-mapping test, and theWorktreeFileConfigJSDoc was reworded to mirror the ADR-022 §2 decision table. Re-ran build, full test suite (2187/2187), lint, and prettier — all green. Nothing remains unresolved.Critical
(empty)
High
(empty)
Medium
FULL_YAMLfixture is documented as "Full, valid example covering every schema key (ADR-013 §schema)" and the happy-path test "maps every schema key into the EnvSource-shaped map and flag fields" asserts the mapping of every key, but the newworktree:section is not in the fixture andresult.worktreeis never asserted in the full-shape test, so the canonical full-schema regression fixture (and its doc comment) is now stale. Suggested fix: add aworktree:\n enabled: true\n dir: /srv/pi-loop/wtblock toFULL_YAMLand assertexpect(result.worktree).toEqual({ enabled: true, dir: '/srv/pi-loop/wt' })in the full-mapping test.Low
WorktreeFileConfigJSDoc is confusing and partly self-contradictory: it says "when the section is present withoutenabled, worktrees are enabled by default" while the next sentence says an absentenabledwithoutdiris aConfigFileError— absentenabledis only "enabled" when adiris present, per the ADR-022 §2 decision table. Suggested fix: reword to mirror the decision table, e.g. "every field is optional; whenenabledis absent it is treated astruefor the cross-field check, so a section withoutdiris aConfigFileError(no hidden defaults);enabled: falsenever requires or validatesdir".Documentation
Updated files: