Skip to content

validators: calibrate bidirectional convention + --entity-key (SL-005)#5

Merged
anrasi merged 1 commit into
mainfrom
feat/dogfooding-validator-calibration
Jun 22, 2026
Merged

validators: calibrate bidirectional convention + --entity-key (SL-005)#5
anrasi merged 1 commit into
mainfrom
feat/dogfooding-validator-calibration

Conversation

@anrasi

@anrasi anrasi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Calibrates cross-references-bidirectional so the validator can green a real corpus without false positives, staying strict for the public spec. Per DR-2026-06-19 (fix-or-calibrate, never suppress).

  • bidirectional reciprocity enforced only between two DecisionRecords in the live corpus (non-DR sources are one-way by design; frozen/external targets exempt)
  • find_docs skips frozen dirs (superseded/deprecated/archive)
  • --entity-key (default entity) so a runtime can map e.g. datta_entity
  • +5 tests (17 total)

Spec stays green under --checks all; the vault corpus greens with --entity-key datta_entity (SL-005).

…ey (SL-005)

Per DR-2026-06-19 ("fixed or calibrated by DEC, never silently ignored"), so the
validator can green a real corpus (the vault) without false positives, while
staying strict for the public spec.

- cross-references-bidirectional now enforces reciprocity ONLY between two
  DecisionRecords present in the live corpus. A non-DR source (InsightRecord /
  LearningPattern / OutcomeRecord / ActivePriority) references decisions one-way
  by design; a frozen/superseded or external target is not ours to reciprocate.
- find_docs skips frozen lifecycle dirs (superseded/deprecated/archive) — they
  are immutable history, not live corpus.
- --entity-key flag (default "entity"): a runtime may instantiate entities under
  a mapped key (e.g. datta_entity) without the vendor-neutral spec prescribing it.
- tests/: 5 new regression tests (DR-pair reciprocity, one-way DR caught, non-DR
  source exempt, frozen target skipped, custom entity-key). 17 total.

Spec stays green under --checks all (default entity-key); vault greens with
--entity-key datta_entity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anrasi anrasi merged commit f552ef2 into main Jun 22, 2026
1 check passed
@anrasi anrasi deleted the feat/dogfooding-validator-calibration branch June 22, 2026 16:47
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