@nakafa/aksara-contracts
v8.12.0
Published
Schemas and verification contracts for Nakafa content releases.
Readme
@nakafa/aksara-contracts
This package defines exact runtime contracts for the Aksara compiler and publisher. Nakafa runtime consumes the exact published contract: a proven npm package, its immutable release archive, and the renderer manifest that its releases sign.
This package contains schemas, branded identifiers, canonical wire encodings,
and Ed25519 signature verification on Effect's effect/crypto services. It contains no corpus, renderer
implementation, signing key, deployment credential, or browser-side MDX
runtime.
Consumers install the exact @nakafa/aksara-contracts version from npm and
commit its bun.lock integrity. npm provenance and the matching immutable
GitHub Release bind those package bytes to the reviewed Aksara source. A contract
change ships with the Nakafa renderer that consumes it, in one step.
Node-only writer and incremental digest exports remain isolated behind package conditions. Default-runtime exports used by Convex are audited to reject reachable Node built-ins. Verification accepts only reviewed, signed Aksara artifacts and releases. It does not make MDX safe for arbitrary uploads; MDX remains trusted executable source.
Consumer boundaries
Current consumers use unversioned semantic Interfaces:
treeowns the signed content tree: a fragment of intrinsic tags, renderer components, and text, whose props are JSON data or nested elements.canonicalizeContentTreegives the bytes that hashes and signatures cover.graph/familyclassifies either a complete graph identity or one exact asset ID into its application locale and content family.projection/materialowns the application-locale material namespace and validates every signed route and projection against it. Lesson metadata may carry an optionalsearchTitlefor the HTML title, whiletitlestays the short navigation name.projection/pageowns stable public page identities, localized paths, and signed metadata for human, agent, and sitemap delivery.math/baseowns the unversioned base schemas that mathematical visuals share, such as finite plane and space points, ordered axis ranges, appearance roles, and label placements, plus the geometry tolerance and exact point predicates.math/visualowns the unversioned, renderer-neutral plane and space scene contract, including exact straight geometry, rich-label anchors, and the axis-aligned cuboid dimension mapping.assessment/*owns the assessment contract: a ProseMirror JSONdocumentwith typedfigureprops, twelveinteractionkinds that hold no answer key,scoringas data, thekeyand theexplanationof an item version as records of their own,itemandstimulusversions named by a content hash, the examprofile, the frozenpaper, and thetoolsregistry.answerowns the typed-answer keys: every runtime grades a typed answer only throughmatchesAnswerKey, reads a typed number only throughreadNumberAnswer, the one number grammar, and decides that a typed answer is blank only throughisBlankAnswer.catalogowns the try-out navigation rows, each set naming its paper, andsnapshottheassessmentsnapshot family that publishes all of it in one signed release. ADR 0005 records the decisions.
Publication dates
Article, material, and public page metadata carry one required
datePublished and one optional dateModified, both as exact DateOnly
values.
Decode external metadata and signed payloads with onExcessProperty: "error".
Effect schemas own the shape and invariants; the decoder owns excess-property
policy. This rejects obsolete fields instead of silently discarding them.
datePublishedis the first verified public availability of that specific locale page.dateModifiedis the public activation date of a later signed release that contains a meaningful content change.- When present,
dateModifiedmust be strictly later thandatePublished.
Neither value may be derived from a build clock, import time, Convex
_creationTime, an unsigned source commit, or an unactivated candidate. The
signed release and activation history remain the audit evidence for both
values. These rules keep visible dates and structured data aligned with
Google publication date guidance
and
Article structured data.
Runtime verification authenticates the independently signed release and artifact values against the exact renderer manifest frozen into that release. Execution verification also proves the selected artifact against the complete live renderer when the deployed manifest hash differs. Non-rendering evidence verification authenticates the same frozen release and artifact without claiming that its consumer can execute the artifact. This directional execution check lets an additive live renderer serve an older release only when it still publishes the selected domain and contains every required component name. Every current manifest contains the complete canonical domain set. The same contract validates stored and deployed manifests. A renderer-changing release remains bound to the exact deployed manifest. A scoped content-only release may retain the active frozen manifest only when activation proves the live renderer still publishes every frozen domain and contains every frozen component name. The renderer is not a third signed value. Current production trusts authenticated Convex state for route/head membership, delivery class, and the active pointer; a release result digest is not a per-row inclusion proof. This boundary is recorded explicitly in ADR 0002.
The package source is publicly readable for supply-chain review. All use and redistribution remain subject to the included Nakafa Source Available License 1.0. The package grants no rights to the Nakafa corpus, branding, or educational material.
