Vault card schemas v2: extension fields, memory families, tension/tombstone + validator - #517
Merged
Merged
Conversation
#496) The distillation-pass open contract, first slice: an insight card validates through a type-dispatching validator with field-precise path errors. The schema file is the published open contract (any JSON Schema tool can check a card); the module is amicode's seam.
…sion/tombstone, records, validator The open contract for the vault distillation pass's schema layer (amicode#496, spec-20260821-090401 incl. Amendments 1-3): - 18 card schemas (12 legacy types + 4 memory families + tension + tombstone) as standalone JSON Schema files, generated from one canonical table (vault-schemas/generate.mjs) - extension fields (provenance, confidence, review_by, subject) optional on all card types; the reviewed-sentinel rule enforced via if/then - tombstone closed vocabulary (superseded_by, expired_ttl, provenance_unrecoverable, redundant_with, filed_to, lifecycle_complete) with justification-conditional required fields - evidence-plane record schema (records, not cards: minimal frontmatter) - plane-residency table (knowledge/evidence/work per type) - minimal zero-dependency JSON-Schema-subset validator with named violated paths; file-level (frontmatter) validation; tombstone pointer existence check; canonical JSON helper - fixture corpora: 45 valid (all 18 types, round-trip), 18 invalid (named-path refusals), 1 markdown card — 124 tests Closes #496.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Closes #496.
The open contract for the vault distillation pass (spec-20260821-090401, incl. Amendments 1–3). 124 new tests; full suite 101 files / 1,315 tests green; typecheck clean.
What ships:
vault-schemas/— 18 card schemas as standalone JSON Schema (12 legacy + 4 memory families + tension + tombstone), generated from one canonical table; evidence-plane record schema; plane-residency table. Generated files are the committed contract.src/vault_card_validator.ts— zero-dependency JSON-Schema-subset validator with named violated paths, frontmatter file validation, tombstone pointer existence check, canonical JSON.test/fixtures/vault-cards/— 45 valid (all 18 types, canonical round-trip), 18 invalid (named-path refusals incl. sentinel conflicts, tombstone conditionals, the masquerade class), 1 markdown card.Design notes:
additionalProperties: truethroughout — unknown-field flagging is the schema-check skill's job, not a schema-level refusal (legacy cards carry platform extras).provenance_unrecoverable⟹ empty provenance +reviewed_after) is enforced on every card type via if/then.pointer;expired_ttlrequiresoriginal_review_by;provenance_unrecoverablerequiresreview_pointer.filed_topointers may berepo:URIs (existence resolved by the dev gate, not the vault).Reviewer note (authorship gate): the fixture corpus is implementer-generated — the README records the obligation for the reviewer to spot-check refusals and add adversarial variants before merge.