UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

28 lines • 1.2 kB
/** Policy over one public-reader-admitted history, not a second stored protocol validator. */ export function storedCauseSources(history) { const sources = history.readSources; if (sources?.version !== 2 || sources.ownership.version !== 1 || sources.ownership.status !== 'captured' || sources.ownership.limitations.length !== 0) return 'source-ownership-unproven'; if (!sources.record || sources.record.version !== 1 || sources.record.segment !== 1 || !['captured', 'partial', 'failed', 'unknown'].includes(sources.status)) return 'source-incomplete'; return { status: sources.status, scope: { record: sources.record, // Only independently collected native ownership authorizes bindings. No source row, // filename, receipt, guessed root namespace or fabricated attempt may supply them. executions: sources.ownership.executions.map(({ runtimeStageId, stateAddress, attemptIds }) => ({ runtimeStageId, stateAddress, attemptIds, })), }, }; } //# sourceMappingURL=storedCauseSources.js.map