A project holds many files (folders, relative cross-links). Every file versions
independently and immutably: nothing overwrites a version's bytes or its discipline report. Uploading a
path that already exists appends a new version — a whole-folder re-upload bumps exactly the files that
changed. No code path may update a V# item in place.
guides/claims.html, ../index.html). Root-relative (/guides/…) and origin-absolute
links fail the discipline check — they break the moment a project is shared, re-hosted, or exported.
The platform's own users are the upload vector, and a document is untrusted content. The discipline check decides whether a version's scripts execute at all; its report is stored immutably with the version. Deterministic checks are authoritative for security; a Bedrock pass is advisory (findings + explanations) and authoritative for quality (e.g. the doc-theme palette). It fails closed: anything erroring or timing out saves the version with scripts disabled.
Bytes are fetched through the authenticated API and rendered via srcdoc into
<iframe sandbox="allow-scripts"> — never allow-same-origin. With no
separate serving hostname, that opaque origin is what keeps a live document away from Console cookies and tokens. Adding
allow-same-origin, or serving documents as text/html on the Console origin, is a security
regression that must not merge.
window.confirm/alert/prompt (Chrome 92+). Every iframed cartridge
inherits this — Doc Vault uses an in-app confirm dialog for destructive actions, never the native one (the bug that
once made annotation-delete "do nothing").
Automated producers don't have a signed-in user, so Doc Vault exposes a system-publish path: a direct
lambda:InvokeFunction carrying { source:'system-publish', … }, checked before the
HTTP gates — the IAM invoke permission is the authorization (the same proof-by-invoke pattern as the trash sweep). It
ensures a _system-owned project by fixed projectId, optionally grants a viewer, then runs the same commit
invariants (discipline check + append-only version).
Two producers use it today: Foundation Audit (audit reports) and the
Console MCP publish_evaluation tool (scheduled-evaluator reviews). Both write
through the identical gate a human upload passes.
cartridges/global/doc-vault/ANVIL.md (purpose, data model, threat model — read before changing anything)lambda/handler.js (JWT + X-Origin-Secret + system-publish), the store, and lib/system-publish.jsfrontend/ — project tree, version viewer, share dialog, annotations, toolbar (Add Document · New Project · Download SDK)CLAUDE.md + a doc-theme starter) so authored documents pass the discipline check by construction