Memory
CONTRACT/EVIDENCE LOOP — pragmatic design v0 (Mike + Perplexity, Sep 3, 2026, ~8:15am BST). The loop is the core of the DocuClear/GlassAgent approach; this is its mechanical design. FOUR ARTIFACTS: (1) CONTRACT — one file per boundary, versioned + hashed, duplicated verbatim in both repos, conflicts reported not improvised around (origin: 794c9197 Aug 20; exemplar: INGESTION_CONTRACT.md v2 with SHA-256 pin; family per 5d0286c4: INGESTION_CONTRACT, SPHERE_GATEKEEPER_CONTRACT — every boundary a versioned contract). (2) WORK ITEM — the requirement: goal, contract clauses touched (contract@version), plan, outcome enum; lives in the callsign layer (POC now, OS-native after the rebuild). (3) RUN RECORD — one Markdown file per work session: brief, plan, every claim tagged [VERIFIED]/[INFERRED]/[UNKNOWN] with raw artifacts, warnings verbatim, outcome enum (content per evidence standard a5e10e10). (4) DECISION TRACE — the runtime twin (compliance enabler 10244feb; vault evidence log c49d395e). THREE CHECKS (all CI-able): contract↔code (contract tests both sides; pattern = deployment repo's 7 live-verification tests); requirement→diff (the mapping table AS the PR body); claim↔code (the evidence centre — v0 = human + re-run script; v1 = agent with a callsign; format earned after 5–10 real records, codify-after-exceptions). TOPOLOGY: build plane runs the loop on the platform itself; runtime plane runs the same loop as the product (obligations graph = contract, agent-run shell = work, deterministic evaluation = check, Artifacts trace = evidence). The gatekeeper is the runtime evidence emission point (audit event per governed call — amendment 4). Build plane proves the loop; product plane sells it — 'every merge reconstructible' and 'every yes reconstructible' are one machinery. THE STORE (Mike's catch, Sep 3): the OS context gatekeeper ALREADY uses Artifacts git and it works (context-git role from the MVP boundary; corroborated by the a092abb2 Sep 2 update: 'OS context-git / Artifacts now covers part of what a SurrealDB document store might have done'). Evidence repo = docuclear-evidence (platform scope) written via that path: governed emission (evidence writes pass the same ambient aperture), append-only by capability design even with VERIFY disabled (VERIFY later upgrades the same repo to attested — queue item 3 shrinks to entitlement + limits), readable by any git client (CI, humans, the future evidence-centre agent). Contracts stay canonical in GitHub and are snapshotted into the evidence repo at each referenced version (/contracts/NAME@version.md + hash) so audits reconstruct from the evidence repo alone. Seam: local opencode sessions push run records straight to the Artifacts repo with a scoped short-lived token; after the gatekeeper lands, agents commit through the workspace. Run-record path: /runs/<work-item-id>/<date>-<callsign>.md; PR body ends with the evidence commit SHA. V0 RITUAL for the gatekeeper build: contract first → branch → five amendment commits → run record → PR with mapping table + evidence SHA. CI addition: deletion guard on config files (the secrets.required incident, 794c9197). [Update Sep 3, 2026]: [Status, Sep 3, 2026, ~10:25am BST — reported by Mike]: both remaining gatekeeper preconditions complete. (1) second-brain-cloudflare default branch flipped v3-custom → main (origin/HEAD updates on next fetch). (2) docuclear-evidence collection created via the context gatekeeper path. CAPABILITY NOTE: the collection UI supports creating folders, creating files, and uploading Markdown — so the evidence store has a HUMAN write path as well as the agent/git path (drop-in notes, meeting artifacts, manual evidence). Caveat per the evidence standard: the collection's existence is UI-verified; the git push path remains [UNKNOWN] until the opencode session's first push lands. The gatekeeper build is now fully staged: repos canonical, contract-first step queued, evidence store ready, bridge live, brief v2 written. [Digest: 441278e2-67ad-4bd6-8187-df580abcca19]
Tags: docuclear, evidence, contracts, evidence-centre, dogfood, artifacts, design, loop, volatility:state, project:docuclear, kind:episodic, rolled-up — Source: perplexity — 2026-09-03 07:28:58 UTC