Skip to content

dogfooding: enforce + test the validators the toolkit ships#4

Merged
anrasi merged 2 commits into
mainfrom
feat/dogfooding-toolkit-enforcement
Jun 22, 2026
Merged

dogfooding: enforce + test the validators the toolkit ships#4
anrasi merged 2 commits into
mainfrom
feat/dogfooding-toolkit-enforcement

Conversation

@anrasi

@anrasi anrasi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Makes the toolkit's "recursive dogfooding" claim true.

Per DR-2026-06-19-dogfooding-enforcement-mandate (audit 2026-06-19 §2: "a validator toolkit with no test of its validators"; LP-003 published-not-enforced).

What lands

  • tests/ — stdlib unittest regression suite (Py 3.9+, no deps) pinning the documented false-positive fixes (date-slug, band-aware principle count, band-unit anti-pattern guard, singular-Entity title) + positive detections.
  • ci.yml — now runs: the test suite + validators.py self-application (corpus-agnostic checks) + gitleaks secrets scan (P7). Keeps B.2 concurrency-cancel + draft-skip + aggregation-gate.
  • Includes the date-slug counter-atomicity fix (DR-2026-… slugs no longer false-collide) — required so the spec CI (which fetches this validator) goes green.

Evidence

  • python3 -m unittest discover -s tests -v → 12 passed
  • validators.py --root . --checks counter-atomicity,principle-count-coherence,entity-count-coherence,band-unit,llm-ci-cost → exit 0

anrasi and others added 2 commits June 21, 2026 00:00
…sed slugs

The counter-atomicity check read the YEAR of DR-/CF-YYYY-MM-DD-... slugs as a
counter, flagging every same-year date-based DEC/CF as a collision. SliceOps uses
both counter-based (INS-/LP-/HANDOFF-/DEC-NNN) and date-based (DR-/CF-YYYY-MM-DD)
naming; the check now excludes date-based slugs and only collides true counters.

Surfaced by the first-ever run of validators.py against the canonical vault corpus
(2026-06-19). Per DR-2026-06-19 dogfooding-enforcement-mandate (calibrate the check,
do not suppress) + LP-003 (published-not-enforced).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Closes the repo's central contradiction named in the 2026-06-19 audit (§2):
"a validator toolkit with no test of its validators."

- tests/: stdlib regression suite pinning the documented false-positive
  fixes (date-slug, band-aware principle count, band-unit anti-pattern
  guard, singular-Entity title) + positive detections for real defects
- ci.yml: run the unittest suite + validators self-application
  (corpus-agnostic checks) + gitleaks secrets scan (P7 Security-by-
  Construction); keep B.2 concurrency-cancel + draft-skip + aggregation-gate

Authorizing decision: DR-2026-06-19-dogfooding-enforcement-mandate
(LP-003 published-not-enforced: a prescribed gate with no executing
workflow is a build failure, not a header comment).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anrasi anrasi merged commit d829b4b into main Jun 22, 2026
1 check passed
@anrasi anrasi deleted the feat/dogfooding-toolkit-enforcement branch June 22, 2026 15:49
anrasi added a commit that referenced this pull request Jun 22, 2026
Addresses the 2026-06-19 external review. Each fix ships with regression tests
(33 total; green with PyYAML and with the stdlib fallback CI uses).

validators.py:
- #2 Windows/Linux path portability: OS-agnostic part checks (_norm_parts) for
  frozen-dir skip, the .git skip, and .github/workflows detection (was '/'-only
  substring matching → broke on Windows os.walk '\\').
- #3 topic-tags semantics: unconfigured --topic-taxonomy now SKIPPED (green),
  configured-but-missing is a clear hard error (was a confusing "skipped" that
  failed the build).
- #4 frontmatter parser: uses PyYAML automatically when installed (robust:
  block scalars, nested, comments); documented stdlib subset + inline-comment
  handling as fallback. No dependency required.
- #5 llm-ci-cost: strips YAML comments before the endpoint heuristic (no more
  false-positive on comments/docs); structural concurrency + on.pull_request
  checks via PyYAML when available (handles the on:->True YAML quirk); custom
  endpoint/proxy limitation documented.

calibrate.py:
- #6 propose_bands ignored its percentile inputs and returned fixed bands →
  split into canonical_bands() (fixed reference) + observed_bands(p) (genuinely
  data-driven from p25/p50/p75/p90); output now prints both, honestly labeled.
- #7 percentiles used exclusive method (extrapolated past observed max on small
  samples) → inclusive + clamp to [min,max] + n==1 handling + small-sample
  (<8) advisory warning.

#1 (counter-atomicity date-slug false-positive) was already fixed in v0.1.0
(toolkit#4) — the review ran the pre-fix 2026-06-19 snapshot.

CI self-run upgraded to --checks all (topic-tags SKIPs cleanly now). New
tests/test_calibrate.py adds the first calibration tests.

Per DR-2026-06-19 (gates + tests for every fix). SL-010.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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