agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
31 lines • 1.56 kB
JavaScript
;
/**
* hosting/processLocalStore — which session stores live in this process's
* memory, and so cannot be read by another process.
*
* Role: one fact for the proof that a closed pause's call never ran
* (`answeredPause.ts` · `closedConversation`). A request minted under
* this process's default decision ledger can be proven unspent only
* when no other process can have answered it — when its pause was kept
* in this process's memory. Any store that other processes can reach (a
* database, a file, a service) is never marked: another replica, on its
* own default ledger, may have spent the request and run the call.
* Reads: nothing. Writes: a process-local mark on the store object.
*
* Only the store object itself is marked: a wrapper around it (a proxy, a
* decorator) is not, and proves nothing — the safe direction.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isProcessLocalStore = exports.markProcessLocalStore = void 0;
const local = new WeakSet();
/** Mark `store` as one that lives in this process's memory only (`memorySessions`). */
function markProcessLocalStore(store) {
local.add(store);
}
exports.markProcessLocalStore = markProcessLocalStore;
/** Whether `store` was marked as living in this process's memory only. */
function isProcessLocalStore(store) {
return typeof store === 'object' && store !== null && local.has(store);
}
exports.isProcessLocalStore = isProcessLocalStore;
//# sourceMappingURL=processLocalStore.js.map