validators: calibrate bidirectional convention + --entity-key (SL-005)#5
Merged
Merged
Conversation
…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
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>
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.
Calibrates
cross-references-bidirectionalso the validator can green a real corpus without false positives, staying strict for the public spec. PerDR-2026-06-19(fix-or-calibrate, never suppress).find_docsskips frozen dirs (superseded/deprecated/archive)--entity-key(defaultentity) so a runtime can map e.g.datta_entitySpec stays green under
--checks all; the vault corpus greens with--entity-key datta_entity(SL-005).