Surface Documentation#

Start here when you are working on the Surface repo or building against @kontourai/surface.

The public docs site at https://kontourai.github.io/surface/ is built from these sources by docs-kit. This index includes both published pages and repo-only references for maintainers and contributors.

Folder Layout#

  • product/ — product thesis, vocabulary, positioning, use cases, and what builds on Surface.
  • guides/ — task-oriented walkthroughs for builders and consumers.
  • reference/ — CLI, schemas, adapters, Console, extension API, analytics, examples, and versioning reference.
  • architecture/ — current system architecture and foundation boundaries.
  • specs/ — portable trust format and product capability specs.
  • audits/ — point-in-time audits and migration maps.
  • roadmap/ — forward-looking plans and integration direction.
  • adr/ — durable architecture decisions.
  • maintenance/ — release and contributor workflow docs.

Keep new docs in the folder that matches the reader's intent. If a page is a durable contract, prefer reference/ or specs/; if it records a point-in-time assessment, prefer audits/; if it is contributor workflow, prefer maintenance/.

Published Site Pages#

corpus.json at the repository root lists every published page, its navigation section, and the topics the Kontour docs MCP serves to agents. Every docs/**/*.md file must be either listed there or named in its exclude list; npm run docs:check fails otherwise, and also checks links, anchors, and topic headings. npm run docs:build renders the site into dist-pages/.

Repo-only material is named in exclude: brand language, the internal sales notes, the source module audit, and Claim Subject Matching while its API settles.

Product Model#

  • Overview — public homepage source for the generated docs site
  • The Problem in Plain Terms — plain-language explainer of the problem, the recomputable-trust solution, and why it's useful (newcomer entry point)
  • Concepts — the trust model: claims, evidence traces, policies, Trust Snapshots, claim groups, status, and transparency gaps
  • Use Cases — repo governance, public data trust, fact resolution, dependency audit
  • Vision — product transparency thesis
  • Principles — kernel and adapter rules
  • Where Kontour Fits — Kontour's place in the trust/attestation landscape, with verified evidence, and the AI-evaluation wedge
  • Brand Language — product language and positioning
  • Selling Kontour — repo-only internal sales enablement (honest pitch, buyers, objection handles, guardrails); not published to the docs site

Building With Surface#

Reference#

  • CLI — surface report, surface claim, and output formats
  • Claim Authoring — authored claim stores and surface claim write commands
  • Extension API — producer branding, vocabulary, claim types, and policy templates
  • Adapters — adapter registry and producer-owned input mapping
  • Claim Subject Matching — matching incoming child rows to existing claim subjects by natural key, and disposing of orphaned claims (new, minimal, shape may evolve)
  • Schemas — JSON contracts for adapter authors and downstream systems
  • Waiver Validity — accepted-gap waiver validity projection: verdicts, precedence, residual, and Flow consumption paths
  • Examples — examples used by tests and docs
  • Schema Versioning — versioning rules for contract changes
  • Trust Analytics Projection — evidence intelligence derived from TrustReport
  • Answer Card Projection — compact report-only answer-card read model
  • Basis Headless Projection — bounded answer evidence and owner-context projection
  • Claim Basis View — the "how was this established" line after a claim's status, and its label tables
  • Surface Console — local Console server over producer read models
  • Agents and MCP — surface mcp trust-state tools over the Model Context Protocol
  • Trust Panel Embed — the dependency-free surface-trust-panel web component

Architecture And Specs#

Audits And Direction#

Maintenance#

Package Boundary#

The public npm package exposes @kontourai/surface, the headless @kontourai/surface/basis subpath, the browser-safe @kontourai/surface/display subpath (display names and the claim basis view), and the surface CLI. The root declarations are published through dist/src/index.d.ts; Basis has its own tree-shaken declaration entrypoint. Consumers should not import deep dist/ paths directly.

The package intentionally includes docs, schemas, examples, and built runtime files. It intentionally excludes source files, tests, scripts, generated docs site output, Playwright artifacts, and local workflow artifacts. npm run check:package-contents is the release guard for that boundary.

Source: docs/README.md