Choose an evidence destination
Use this guide when application events need an explicit archive. Recent SDK events are bounded local metadata, not durable storage. The Node audit FIFO is an opt-in construction option with a finite capacity and an explicit host drain after calls. The Python SDK has local events but no guest audit drain. It cannot be combined with selectiveRepair; use repair events for that integration.
Run the audit collection exercise
The complete local example below configures Node audit, performs one labelled read and drains the real guest record into a temporary in-memory destination. It makes no vendor request. The Python tab demonstrates the supported local-event boundary and explicitly has no audit drain. For a real archive replace the Node sink with your own durable persistence and acknowledge only after saving. Do not treat the in-memory exercise as production storage.
import { createAgindow } from 'agindow';
import type { AuditRecord } from 'agindow';
const sdk = createAgindow({ mode: 'observe', audit: { tenant: 'synthetic', capacity: 4 } });
await sdk.ready;
const payload = { id: 'synthetic-customer' };
const result = sdk.guard(() => payload, { tool: 'vendor.read', operation: 'read' })();
if (result !== payload) throw Error('Observe changed the payload');
// Synthetic, in-memory sink only. A real host must persist before acknowledging.
const artifacts: AuditRecord[] = [];
const receipt = await sdk.drainAudit(artifact => { artifacts.push(artifact); });
if (!receipt.available || receipt.delivered !== 1 || artifacts[0]?.['decision'] !== 'ok') throw Error('Missing audit evidence');
console.log('Synthetic audit receipt', receipt, artifacts[0]?.id);# Guest audit FIFO drain (Node sdk.drainAudit) is not published on Python.
# This fixture still proves observe identity and retained local events.
from agindow import Agindow
sdk = Agindow(mode="observe")
payload = {"id": "synthetic-customer"}
@sdk.guard(tool="vendor.read", operation="read")
def read() -> dict[str, str]:
return payload
result = read()
if result is not payload:
raise AssertionError("Observe changed the payload")
print("Synthetic fixture: Python retains identity; guest audit drain remains Node-only.")Inspect delivery separately from the call
Read the drain receipt delivered, pending, dropped and available values. The Node exercise requires one delivered record with decision ok; that decision does not prove detection was configured. A full queue, restart or delivery error can lose evidence. A sink failure must not change the original API outcome. No hosted retrieval URL is produced by this local exercise.
Review and retrieval are separate
A review case needs admitted policy evidence and a separately configured host review service; this example creates none. A review receipt does not execute a write. Remote artifact/outcome reads use their execution host and retention rules; missing evidence is not proof that a write did not execute.
Reference and next steps
Continue with the reference for this task.