Repository navigation
tools: advisory semantic checks for invariant statements and sources - #23
Merged
Merged
Conversation
dwn/authorization.md does not state the descriptor/payload grant invocation match rule, and dwn/records.md does not describe snapshot populations; both rules live in the pages now cited. The dropped pages move to related, where they remain useful context.
DID-DHT-003 was the one did:dht invariant the page neither stated nor tagged.
Source paths are now required to exist, and the optional revisions and source_notes fields are checked for shape.
Two checks run against the TypeSafe System One API. A changed statement is scored against its previous version as a rewording, a refinement, or a different rule; a refinement keeps its ID and records a revisions entry, while a different rule needs a new ID. Each invariant is also judged against the pages it cites, on pull requests for invariants that changed or that cite a changed page, and weekly across the registry. Reported: a source that contradicts a statement, and an invariant no source supports. Not reported: a context citation once another source states the rule, a dwn/ page contradicting an enbox-parity invariant, and a page that names a non-normative invariant's ID instead of restating it. A finding is asked a second time, since confidence drifts between runs, and a changed answer is reported as unstable rather than as a finding. The job never fails while the checks are calibrated, and skips when no API key is present, as on fork pull requests.
6 tasks done
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
Adds two advisory CI checks over
invariants/, plus the citation fixes the first calibration run surfaced.Semantic checks (
tools/check_invariant_semantics.py). Calls the TypeSafe System One API over the HTTP API, so there's no new dependency.revisionsentry; a different rule needs a new ID. This enforces a policymaintenance/freshness.mdalready stated but nothing checked.The job never fails while the checks are calibrated, and skips when no API key is present, as on fork PRs. Findings go to the job summary. It needs a
TYPESAFE_API_KEYrepo secret.Policy, kept in code rather than in the model. Reported: a source that contradicts a statement, and an invariant no source supports. Not reported: a context citation once another source states the rule, a
dwn/page contradicting anenbox-parityinvariant, and a page that names a non-normative invariant's ID instead of restating it, which is the page deferring to the registry. A finding is asked a second time, because confidence drifts between runs, and a changed answer is reported as unstable rather than as a finding.Metadata validation (
tools/check_knowledge_metadata.py). Source paths must now exist, and the optionalrevisionsandsource_notesfields are checked for shape. Plain code, no model.Findings from calibration, fixed here.
dwn/authorization.md, which never states the descriptor/payload match ruledwn/permissions.md§"Invoking a Grant", which does; the old page moves torelateddwn/records.md, which never mentions Count, Subscribe or snapshot populationsdwn/queries-and-sync.md, which doesenbox/did-dht.md§"DNS mapping"Calibration ran against the three historical statement edits (
70ccea4,7166e82,3fb5c24). All three scored ~1.0, the refinement level, which matches how they were handled. A full--allrun over 56 invariants produced 8 findings, of which 1 was real and 7 came from over-strict handling of secondary citations, now fixed.Source / provenance checklist
enbox/did-dht.mdas implementation knowledge.spec-revieweddate changed.enbox/did-dht.mdstates a rule already registered as DID-DHT-003 against the sameupstream-baseline, soreviewedis unchanged.Behavior-change checklist
Not applicable. No engine behaviour changes; the invariant statements themselves are untouched.
Drift
revisionsentries are not backfilled for the three historical edits (ENBOX-REC-001, DWN-REC-008, ENBOX-ENC-003). The field starts empty and applies going forward.