@agenticprimitives/witness
v0.0.0-alpha.5
Published
Evidentiary dispute attestation (spec 307 / G-11): deterministically walk a relationship record + verification receipt and attest in_scope / out_of_scope / revoked_before_execution / stale_status_used / insufficient_evidence. Facts, never remedies.
Maintainers
Readme
@agenticprimitives/witness
Evidentiary dispute attestation — the neutral function that answers, from artifacts alone: was this action inside the delegated relationship at the time it happened — and if not, whose check failed?
Spec: specs/307-witness.md · Consumes:
verification receipts (spec 303) +
relationship records (spec 306).
The walk
import { evaluateDispute, mintWitnessAttestation } from '@agenticprimitives/witness';
const evaluation = await evaluateDispute({
record, // the spec-306 hash-linked evidence chain
receipt, // the disputed spec-303 public receipt
detail, // optional — released to the witness via releaseMode 'witness_escrow'
verifyReceiptSignature,
});
// → { outcome: 'in_scope' | 'out_of_scope' | 'revoked_before_execution'
// | 'stale_status_used' | 'insufficient_evidence', ... }
const attestation = await mintWitnessAttestation(
{ witness: witnessSa, relationshipId, evaluation, receipt, checkedDetail: !!detail, attestedAt },
{ sign: witnessSigner },
);The walk is total and ordered (evidence integrity → record membership → revocation timeline →
scope), so two witnesses given the same artifacts produce the same outcome and the same
attestation hash. Anything unverifiable — a broken chain, an invalid receipt, a receipt that isn't
an entry of the record, a detail that doesn't open — is insufficient_evidence, never a guess.
stale_status_used is the load-bearing outcome: a revocation entry precedes the receipt in the
relationship record, yet the verifier allowed on revocation: 'active' — the verifier relied on
stale status, which is exactly the liability trigger the article's procurement checklist assigns.
Status
w1-evaluate-attest — the walk + attestation mint/verify, 8-test suite (one per outcome,
determinism, tamper, no-identity-leak). W2: attestation anchoring + the witness-escrow
DecryptGrant release path. W3: the G-12 liability schema over these outcomes.
