-
Notifications
You must be signed in to change notification settings - Fork 2
Lesson Validation Methodology
type: synthesis up: "Home_llm-wiki-memory-template" supports: "Three-Operations" tags: [lesson, testing, methodology]
Template changes need two distinct kinds of validation: structural (does the template still instantiate cleanly?) and behavioral (does a live agent actually follow the new procedure?). PR #1 shipped initially with neither; the review caught six issues, four of which would have been caught by a structural test and one by a behavioral test.
Build a throwaway project from the branch, run instantiate.sh end to end, and verify with a small check script that:
- All expected files exist at their expected paths
- The generated
CLAUDE.mdandSCHEMA_<repo>.mdcontain the expected sections - The per-overlay surfaces install correctly
- Any optional features (hooks, KG pipeline) install correctly when their flags are passed
- Per-overlay setup-script flags work as documented
PR #4's self-test was 21 checks; PR #1's follow-up structural test caught the missing CLAUDE.md.template update (Priscila's point 6).
Open a Claude Code session in a freshly instantiated project and exercise the procedure as a user would:
- Run
/wiki-sourceon a test document. Observe whether the agent readsgit config user.namerather than guessing it. - Verify the log entry's first bullet has the correct
by:attribution. - Verify the wiki repo receives the expected number of commits (two per ingest: pages+index, then log).
- Run an action that triggers the PostToolUse-Hook. Verify the hook fires, the agent receives the reminder, and the action proceeds (advisory, not blocking).
PR #1's point 7, the prompt-vs-command hook type bug, was only surfaced by behavioral testing. The hook installed correctly (structural pass) but broke the ingest flow when actually invoked (behavioral fail). See Lesson-Hook-Type-Matters.
Structural validation is fast and cheap; behavioral validation is slow but catches the cases structural cannot. For template changes, both are needed. Roughly:
- Structural: a single check script, runs in seconds, repeatable, ~21 checks for the current template surface.
- Behavioral: 10 to 15 minutes of manual interaction per overlay; hard to script because the agent's free-form decisions are part of what is being tested.
The current template has structural validation for the Claude Code overlay; Cursor and none overlays are structurally validated but not behaviorally, see Limitation-Untested-Overlays. Closing that gap requires running the same behavioral protocol against each overlay in a real session of the corresponding agent.
For template changes, a PR description should state what kind of validation was performed. "Structural: 21/21 PASS. Behavioral: ran /wiki-source in live Claude Code session, 6/6 properties verified." Without that, reviewers either re-run the validation themselves or merge on trust.
- Three-Operations
- Lesson-Parallel-File-Drift
- Lesson-Hook-Type-Matters
- Limitation-Untested-Overlays
- Limitation-Inverse-Edges-Missing: surfaced by behavioral testing during PR #4
- Template-vs-Derived-Projects: instantiation is the load-bearing path the structural half exercises
- Agent-Overlays: the per-overlay behavioral checks that close out validation
- Lessons-Learned-From-model_fusion: the field report's verification-against-filesystem methodology mirrors the structural + behavioral discipline