oficina / memoria Public

Clone
git clone https://amadan.net/oficina/memoria

Plain git — no account needed to clone.

Download

Download this file

1# Delegated note retry and authority hardening
2
3Status: implementation design approved by GPT-6 Astra on 2026-10-25 after
4reviewing the existing Memoria, Calendar and Calls adapters. Source review,
5CI and deployed canary verification remain separate requirements.
6
7Persist a keyed receipt-authority marker binding the content fingerprint key,
8exact Home issuer, delegation issuer and selected team. Initialize under the
9SQLite writer reservation only if receipt and attribution state is empty. Check
10on enablement and every mutation before receipt lookup. Existing receipt state
11without the marker requires explicit migration; do not bless, erase or reset it.
12Include both issuers in new receipt coordinates.
13
14The HTTP adapter supplies a private context callback using only the original
15credential's underlying verifier. Compare subject, client, grant and required
16team/scope. Never invoke local-DB/rate-limit middleware from inside the writer
17transaction. Check delegation and the existing local Home link/admission using
18the reserved transaction, then repeat before every successful commit, including
19retry exits. An absent callback fails closed on agent mutations. Reject malformed
20Unicode before lossy decoding.
21
22Memoria's current Ingest is an upsert. A guard alone cannot make pending receipt
23recovery safe: after body commit but before receipt completion, retrying that
24upsert can overwrite intervening edits or recreate a deleted note. The delegated
25creation path must commit the document/chunks and receipt document ID together.
26Keep public Ingest behavior; factor its transaction body into an inner function
27surrounded by private required agent hooks. All early successes pass the final
28hook. The before hook reserves the writer, validates marker and authority, claims
29and rereads the receipt. Completed receipts skip ingestion entirely, check the
30referenced document still exists, and preserve current edits/revision. Deletion
31returns not_found. For an incomplete receipt, refuse if source/key already exists;
32agent creation must never upsert even matching content.
33
34Indexing remains derived postcommit work. Preserve committed IDs on index failure.
35A skipped ingestion does not prove indexing succeeded. Any repair uses current
36stored content, never the old request body. Keep indexed false until indexing
37actually succeeds; no success-looking result for a deleted document.
38
39Test crash/reopen at receipt/body/index boundaries, independent concurrent
40requests, deletion and edits before retry, orphan source/key refusal, changed
41key/authority refusal, and revocation while waiting for the writer and just before
42commit. Adverse mutations must fail meaningful behavior tests. Source approval
43and checks do not claim a deployed canary.
44
45The same immutable-marker and writer-boundary pattern applies to Calendar and
46Calls in their own adapters. Existing direct Registry.HTTP read emission remains
47a separate response-revalidation gap; this write-hardening slice does not claim
48Docs-equivalent response guards or full suite completion.
49