Skip to content

feat(pages): make evidence and invalidation integrity first-class - #147

Merged
drewstone merged 9 commits into
mainfrom
feat/page-evidence-integrity-v2
Aug 17, 2026
Merged

feat(pages): make evidence and invalidation integrity first-class#147
drewstone merged 9 commits into
mainfrom
feat/page-evidence-integrity-v2

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Why

The package can grade claim evidence and can lint a knowledge index, but the two surfaces were disconnected. A page could claim rung 4 or 5 while carrying no executable check, no expected value, no evidence path, or an author-machine absolute path and still pass index lint.

The package also had no page-level representation for two distinct facts a research store needs:

  • this page explicitly refutes another page;
  • this page's own independently executed evidence refuted the page itself.

The claim ledger's symmetric contested relation is correct for unresolved source disagreement. It is not correct for an executable page that its own check contradicted: that invalidation is asymmetric and the page is dead.

Change

  • Add optional KnowledgePage.contradicts page-id references.
  • Add a strict, asymmetric KnowledgePageInvalidation whose only verdict is contradicted and which records timestamp, reason, evidence path, grader, and metadata.
  • Load both fields from frontmatter; a single contradiction id and an id array normalize to the same canonical list.
  • Extend KnowledgePageSchema and KnowledgeIndexSchema transitively.
  • Extend lintKnowledgeIndex to report:
    • rung-4/5 evidence refused by the canonical assertGradeableEvidence boundary;
    • missing evidence paths;
    • author-machine absolute paths in checks or evidence paths;
    • missing or self-referential contradiction targets;
    • malformed invalidation records.

Evidence lint reuses the package's one refusal vocabulary rather than restating what is gradeable. Invalid frontmatter remains visible in the raw page and becomes a lint error instead of disappearing silently.

Tests

The suite covers gradeable portable evidence, self-grades, absolute paths, valid and broken contradiction edges, strict invalidation semantics, and loading string/array pointers plus typed invalidation metadata from disk.

This closes the page-evidence and asymmetric-invalidation gaps identified by Discovery's adoption audit without weakening the separate claim-ledger semantics.

tangletools
tangletools previously approved these changes Aug 17, 2026

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — fbad21b2

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

This approval is provisional. It rests on the audit running. If the audit cannot run — for example the CLI bridge rejects it — this approval is dismissed rather than left standing, so an unrun check never reads as a passing one.

tangletools · auto-approval · reason: drewstone_author · 2026-08-17T01:57:46Z

@drewstone
drewstone merged commit f26ca32 into main Aug 17, 2026
2 checks passed
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.

2 participants