feat(setup/hooks): wave-5.2+5.3 — context7 baseline, deps-hash hook, D4 audit probe - #35
Merged
Merged
Conversation
…in setup.sh Adds Step 2d/5 to setup.sh: seeds .ai-factory/tool-decisions.md from the skills/tool-bootstrapping/templates/tool-decisions.md.template with context7 as the auto-accepted baseline MCP, stamps current deps-hash into frontmatter (sha256 of package.json deps), and adds context7 to .mcp.json if absent. Idempotent: skips if tool-decisions.md or context7 entry already present. Documents the tool-bootstrapping workflow in INSTALL-FOR-AI.md; adds cross-link in INSTALL.md. Prior-art: skipped — setup.sh bash step + consumer install docs addition, no new capability per CLAUDE.md hook definition; SSOT entries #31-#37 landed in Wave 5.1 (commit b1e9c5e)
…obe + AGENTS bullet Consumer UserPromptSubmit hook (packages/core/hooks/deps-hash-check.sh) detects stale .ai-factory/tool-decisions.md at session start (sha256 of package.json deps vs stored deps-hash frontmatter; WARN injected into context). install.sh extended to copy hook + register in consumer .claude/settings.json. D4 audit probe added to audit-ai-docs.sh: WARN when package.json is newer than .ai-factory/tool-decisions.md (or file absent). Negative test test_D4 covers WARN-on-absent case. AGENTS.md.template gains tool-bootstrapping skill bullet. Prior-art: skipped — bash hook + audit probe + template bullet, no new capability per CLAUDE.md hook definition; thin-wrapper reuse of AIF /aif per SSOT #31 (prior-art-evaluations.md)
This was referenced May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 5.2 — surfaces tool-bootstrapping discipline at consumer install time:
setup.shStep 2d/5: seeds.ai-factory/tool-decisions.mdfrom template (context7 auto-accepted baseline), stamps currentdeps-hash, adds context7 to consumer's.mcp.json; idempotentINSTALL-FOR-AI.md: new "Tool bootstrapping" section explaining the discipline +.ai-factory/tool-decisions.mdpersistenceINSTALL.md: cross-link to new INSTALL-FOR-AI.md sectionWave 5.3 — runtime enforcement:
packages/core/templates/shared/AGENTS.md.template:tool-bootstrappingskill bullet added afterrules-as-testspackages/core/hooks/deps-hash-check.sh(NEW, 44 LOC): consumer UserPromptSubmit hook — sha256 ofpackage.jsondeps vs storeddeps-hash:frontmatter; injects WARN on mismatchinstall.sh: hooks copy section + idempotentsettings.jsonupdate to register the hookpackages/core/audit-self/audit-ai-docs.sh: D4 probe — WARN whenpackage.jsonis newer than.ai-factory/tool-decisions.md(or file absent); cross-platformstat(Linux + macOS)packages/core/audit-self/audit-ai-docs.test.sh:test_D4negative-test function (WARN-on-absent pattern, mirrorstest_D2)Confirmed §11 decisions applied: D2=b (committed), D3=b (context7 baseline in setup.sh), D4=d (audit probe ships now), D7=a (deps-hash UserPromptSubmit hook).
§1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)
§1.7 Forward-check applied
Source: research-patch §13.1 (2026-05-10), applied to Wave 5.2+5.3 artefacts. The new artefacts comply with each currently-active enforcement layer:
deps-hash-check.shand D4 probe are bash — R1-R20 do not apply.packages/core/hooks/deps-hash-check.shis a new file under new subdirectorypackages/core/hooks/— 44 LOC, below the ≥50 LOC capability-commit threshold. No new explicit deps; no file ≥80 LOC underpackages/.Prior-art: skipped —trailers on both commits specify reason (≥20 chars)./aifper fix: wave-5 readiness — AIF Handoff overlap analysis + scope annotations (SSOT #27-#29) #31.INSTALL-FOR-AI.mdhas existingAuthoritative-forheader;AGENTS.md.templatehas existing header. No new authority-bearing docs introduced.§1.7 Backward-check applied
Source: research-patch §13.2 (2026-05-10) backward-check sweep, Wave 5.2+5.3 completion status:
setup.shINSTALL-FOR-AI.mdINSTALL.mdpackages/core/templates/shared/AGENTS.md.templateREADME.mdExemption: D4 probe scopes exclusively to
.ai-factory/tool-decisions.md; fixture files inpackages/*/fixtures/**are never checked by the probe. Exemption meta-test deferred — D4 does not scan fixture paths, making the exemption vacuously satisfied until the probe is generalized.Test plan
node_modules/.bin/vitest run packages/core/principles/— 56/56 passed (10 files)bash packages/core/audit-self/audit-ai-docs.test.sh— 6 pass / 0 fail (includes new D4 test)npx tsx packages/core/render/render-rules.ts --check— rules-table up-to-dateexit=0on missingtool-decisions.md; WARN emitted on staledeps-hashinstall.sh --dry-run: hooks copy block + settings.json registration visiblesetup.shdry-run: Step 2d/5 visible withtool-decisions.md+ context7 dry-run messagespackages/core/hooks/deps-hash-check.sh— 44 LOC (below 45-LOC capability-commit threshold)2026-05-12 retroactive Wave 8.5 note: This PR's §1.7 Forward-check section would not pass the Wave 8.1 substance gate (no file:line citations present). Pre-Wave-8 acceptance — kept as historical evidence of the
#discipline-theatregap that motivated §13.29.