Skip to content

docs(skills): verification-first loop, hallucination defense, scope lens (U17/U18/U19 — O10/O15/O17) - #50

Merged
dralgorhythm merged 3 commits into
mainfrom
claude/hardening-pr9-skills-round2
Jul 24, 2026
Merged

docs(skills): verification-first loop, hallucination defense, scope lens (U17/U18/U19 — O10/O15/O17)#50
dralgorhythm merged 3 commits into
mainfrom
claude/hardening-pr9-skills-round2

Conversation

@dralgorhythm

Copy link
Copy Markdown
Owner

Summary

Round-2 units from the research's deferred set, as requested: O10 + O15 + O17 in one PR, three atomic commits. All skill/docs prose — no defaults change, no hooks touched.

What changed

  • U17/O10 — verification-first loop (testing skill as policy home, builder cross-reference): bug fixes start from a failing regression test the agent observes fail; features state a falsifiable "done when" first; completion cites evidence (test output, pushed SHA), never narration. docs/hooks.md gains an opt-in pointer to TDD-Guard-style mechanical enforcement (external, not vendored) that composes with the shipped commit/task gates.
  • U18/O15 — hallucination defense (builder as policy home): named steps — Grep-first-then-Context7/docs verification for unfamiliar APIs, and a registry-existence check (npm/PyPI/crates.io/pkg.go.dev) before adding any new dependency (slopsquatting defense; explicitly scoped as not-a-vuln-scan — that remains O7). dependency-upgrade cross-references it beside "a version string is a claim."
  • U19/O17 — scope-adherence lens: new swarm-review perspective ("does this diff exceed its stated task?" — unrequested refactors, drive-by edits, dead code; compared against task AC + PR-template scope/Risk Tier, citing the diff-size advisory) plus the adversarial question "What in this diff did nobody ask for?"; matching code-check audit dimension, cross-referenced not restated.

Provenance

  • Author: worker-builder (sonnet) via /swarm-execute; orchestrator re-ran both gates on the lane tip.
  • Gates: check-invariants.sh ALL GREEN; test-hooks.sh ALL GREEN (untouched hooks stay green); frontmatter/description grep across the full range: zero matches (desc-budget unaffected).
  • Meta-note: the builder declined a symmetry edit to code-check's worker-launch list on the grounds that it would be "exactly the kind of drive-by edit U19 itself is about catching" — the lens working before it merged.

Risk tier

low — skills/docs prose only; enforcement stays at the skill rung by design (the research's stated honest rung for these three).

Test plan

  • Both gates green after each of the three commits and on the lane tip
  • No skill frontmatter/description modified (grep-verified)
  • Remaining research options after this PR: O5 and O7 only

🤖 Generated with Claude Code

Upgrade the testing skill's regression-test-per-bug content into an
explicit red-green-observe discipline: a bug fix's failing regression
test must be run and its failure observed before the fix, a feature
states a falsifiable "done when" before implementation, and a
completion claim cites evidence (test output, pushed SHA) rather than
narrating it. builder/SKILL.md cross-references the loop from its
Implementation Workflow instead of restating it, keeping testing the
single policy home. docs/hooks.md's opt-in recipes gain a paragraph on
mechanical TDD enforcement for teams that want a hard PreToolUse
block, citing nizos/tdd-guard as a worked external example (not
vendored) that composes with the shipped commit/task quality gates.

Source: artifacts/research_ai_coding_frustrations.md Part 3, O10.
Give builder a concrete Hallucination Defense workflow section that
concretizes CLAUDE.md Core Principle 1 with two named steps: (a)
verify an API against Context7/official docs before calling it if
it's not already used elsewhere in this repo (checked via Grep
first); (b) verify a new dependency exists in its official registry
before installing it — hallucinated package names are deterministic
enough to be pre-registered by attackers (slopsquatting). Registry
existence is explicitly scoped as not a vulnerability scan (that's
the separately tracked, unselected O7).
dependency-upgrade/SKILL.md gains a one-line cross-reference to
builder's new-dependency check beside its "a version string is a
claim" rule, rather than restating it.

Source: artifacts/research_ai_coding_frustrations.md Part 3, O15.
Add a "does this diff exceed its stated task?" perspective to
swarm-review's Parallel Review Perspectives: flag unrequested
refactors, drive-by edits outside the task/plan's acceptance
criteria, and dead code left behind; compare against the task/plan's
AC and the PR template's stated scope and Risk Tier field; cite the
diff-size CI job's >400-LOC advisory as the size signal rather than a
hard threshold. Adversarial Questions' Challenge Assumptions gains a
matching question ("What in this diff did nobody ask for?").
code-check/SKILL.md's Audit Dimensions gains a matching Scope
Adherence entry that cross-references swarm-review's lens instead of
restating it, applying the same lens codebase-wide rather than
diff-by-diff.

Source: artifacts/research_ai_coding_frustrations.md Part 3, O17.
@dralgorhythm
dralgorhythm merged commit 3033c78 into main Jul 24, 2026
5 checks passed
@dralgorhythm
dralgorhythm deleted the claude/hardening-pr9-skills-round2 branch July 24, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant