Repository navigation
PRÆTORE v0.3.4
Adds local approval to praetore-mcp: in enforce mode a REQUIRE_APPROVAL
rule holds the call until someone approves or rejects it from a terminal on
the same machine. Also carries everything merged to main since v0.3.3.
Added
- praetore-mcp 0.3.4: local approval for
REQUIRE_APPROVAL. In enforce
mode a matchingtools/callis not forwarded. The proxy writes a pending
file under the praetore-mcp home and returns the approval id plus the
exactpraetore-mcp approve <id> --dir <home>command.approvalslists
pending calls,approveandrejectsign the decision with a new local
approver key (initcreates it; runninginitagain adds it to an
existing home and does not replace keys or receipts).approvereads a
confirmation code from an interactive terminal. That check is cooperative.
An approval is bound to the server, tool and canonical arguments, expires
(default 10 minutes,PRAETORE_MCP_APPROVAL_TTL_SECONDSor
approvals/ttl-seconds), and authorizes one later matching call. The
decision and that execution are appended toapprovals/journal.jsonl.
verifychecks the approver signature, the binding, the expiry and that
the approval was not used twice.receiptsshows the state. Observe mode
still forwards, and the receipt list says enforce would ask. Receipt
lines inreceipts/*.jsonlare unchanged, so journals written by v0.3.3
and by current main keep verifying.
Breaking
-
The console's JSON API sends codes and UTC instants instead of Spanish
text.situacion,relato,aviso,mensajeandnotaare stable
Englishsnake_casecodes ("awaiting_approval",
{"codigo": "request_gone"},{"codigo": "inbox_truncated", "limite": 200});
queriaandsobreare{"texto": ...}or{"codigo": "not_shown"};
agenteis{"nombre": ...}or{"numero": N}. Times are RFC 3339 UTC
incuando_utc,actualizado_utc,pedida_utcandvale_hasta_utc;
cuando,actualizado,pedida,vale_hastaandquedaare gone (the
page counts the time left itself). The history filter takes the code and
still accepts the earlier Spanish phrase. An unused attester pin is now
named by its number ("La clave n.º 2 …") instead of an ordinal word.
Action: a script that read the console's API compares codes instead of
phrases. Nothing signed, recorded or exported changes. -
praetore-gateway-demorequiresPRAETORE_GATEWAY_ADAPTER(T-016).
The service no longer falls back tolocal-demowhen the variable is
missing or empty: it exits before it connects to PostgreSQL and names the
three values (sandbox,http,local-demo). Action: set the adapter
explicitly, includinglocal-demofor local runs (docs/operations.md). -
Gateway attester keys are read from owner-only files (T-016).
PRAETORE_GATEWAY_EVIDENCE_ATTESTER_KEY_FILEand
PRAETORE_GATEWAY_EXECUTION_ATTESTER_KEY_FILEname two files with 64
lowercase hexadecimal characters each, checked like the safety namespace
key (regular file, not a symlink, owned by the service user, no group or
other bits, at most 128 bytes). The two keys must differ. The
..._KEY_HEXvariables are no longer read; the service refuses to start
while either is set. Execution receipts carry the key id
execution-attester-<public key hex>instead of the earlier prefixed id.
Legacy baseline adoption reads the evidence key from the same file
variable. Action: move each key into its own file and remove the
..._KEY_HEXvariables. -
praetore-observerequires its read-only role (T-016). At startup it
checks thatPRAETORE_OBSERVE_DATABASE_URLlogs in aspraetore_observe
or as a member of it, is not a member ofpraetore_runtime,
praetore_safety_ingestorpraetore_safety_audit, and holds no
privilege beyond the documented columnSELECTgrant
(docs/observability-mvp.md). New
praetore_replay_postgres::verify_observe_role_with. No migration creates
the role. Action: run observe with the documented role instead of the
gateway runtime credential. -
praetore-verify journalrenamesdatabase_head_verifiedto
database_head_consistent(T-016). The field means that the tenant
chain's reference matches the database head given by--database-journal
or--expected-database-head. The newdatabase_head_anchoredis true
only with--expected-database-head, a head the caller holds; the head
of a--database-journalfile is not anchored by that file. Action:
scripts that readdatabase_head_verifiedreaddatabase_head_consistent,
and checkdatabase_head_anchoredwhere an anchored database head is
required. -
A journal chain holds the receipts of one tenant (T-016).
praetore-verify journalandpraetore journal-exportrefuse a chain whose receipts name
different tenants in their signed authority, or a tenant and none
(JOURNAL_TENANT_MISMATCH). The verifier reports the chain's tenant as
tenant_id(nullfor a database chain, or when the receipts name
none). Exports written byjournal-export --tenanthold one tenant and
are not affected. -
Storage record signatures must be lowercase hex (T-016). A storage
record whose signature is written in uppercase or mixed-case hex is
refused (EVIDENCE_FAIL), as receipts and safety records already were.
praetoreonly ever wrote lowercase. -
Cooperative execution is refused by default (T-013). The local HTTP
API (praetore run) andpraetore-gateway-demo, with every adapter and
with or withoutsandbox_root, requirepraetore-exec-mode: gatewayon
every execution-path request and never answerapprovedon/status
for an approved action. Before, this applied only withsandbox_root, and
praetore-gateway-demonever applied it.http_api::HttpOptionsnow has
exec_mode: ExecModeinstead ofgateway_executes_effects: bool. Action:
clients send the header (thepraetoreCLI already does). Development
only, with no guarantee about who performs an effect:
praetore init --dev-cooperative-execor
PRAETORE_GATEWAY_DEV_COOPERATIVE_EXEC=1(local-demo adapter). -
ExecutionJournal::record_human_approvaltakes aHumanDecisionRecord
(T-016). A rejection now carries its signedapproval_rejectedclose and
the journal writes the decision and the close in one transaction; an
approval carries no close. Action: custom journal implementations write
both, or neither, asPostgresExecutionJournaldoes. -
ExecutionAttestation::createtakesobserved_at(T-016,signing
feature). Callers pass the time from their trusted clock; the gateway
passes the engine's clock. -
praetore-mcp journal lines are hash-linked (T-016). Each line of
receipts/<date>.jsonlis now{"seq","prev","evidence"}, the line
format ofpraetore_core::journal_chain, instead of a bare evidence
document.praetore-mcp verifychecks the order (an entry removed,
duplicated or reordered is reported), prints the journal head and accepts
--expected-head HEX. Entries removed at the end of the journal are only
detected with--expected-headagainst a head kept elsewhere; the chain
has no key. Lines written by earlier versions still verify as unchained
entries before the chain. Action: tools that read journal lines
directly take theevidencemember (see the praetore-mcp README). -
praetore-mcp no longer forwards unchecked client lines in observe
(T-016). A line it cannot parse that may name asafety*tool, and any
line over 32 MiB, is refused in both modes. Other unparseable lines are
still forwarded in observe, now with a warning that gives the SHA-256 and
the length. -
The receipt of a held approval is signed as
awaiting_approval
(T-016, schema v5). The 202 response of a request that requires human
approval now carriesexecution: "awaiting_approval"(before:
"not_dispatched"with no reason), signed in execution attestation
schema v5. Schema v5 has exactly one shape:requires_approval, no
reason, no output, no failure. A saved 202 receipt keeps verifying as
awaiting_approvalwithfinal: falseafter the request was approved
and executed; it can no longer be read as a closednot_dispatched
request.awaiting_approvalis a signed receipt state only, never a
journal state:GatewayReceipt::executionand
ExecutionAttestation::executionare nowAttestedExecution
(ExecutionStatusremains the journal row state, and
AttestedExecution::journal_status()maps between them).
NonFinalReasongainsAwaitingApprovaland losesIntermediate(no
signed receipt carries an intermediate state). Action: HTTP clients that
match on the 202executionfield acceptawaiting_approval; offline
verifiers are upgraded together with the gateway (see the table below). -
An approval claimed after its window closes as
approved_claim_expired(T-016). New signednot_dispatched_reason
(schema v3) for an approved request whose single dispatch is claimed too
late.approval_expirednow means only that the window closed without a
decision. Rows closed before this release keepapproval_expired. -
ActionDispatcher::preflighttakes the verified authority (T-016).
The signature is nowpreflight(&self, authority: &Authority, action: &Action); the gateway passes the same authority thatdispatchreceives,
so an adapter that routes per tenant can check its route before an action
is dispatched or held for approval. Action: adapters that override
preflightadd the parameter. -
HTTP and sandbox-supervisor adapters report refusals made before sending
asno_effect(T-016).HttpActionDispatchernow implements
preflight: an action with no configured route for the verified tenant,
action type and target, with a capability other than the route's, or with
parameters over 64 KiB is refused at submission (403
action_not_dispatchable, signednot_dispatchedwith reason
dispatch_refused), and an action that requires approval is not held.
Before, it was dispatched and signedoutcome_unknown, or held for
approval first. Indispatch, every check before the request is sent
(action digest, tenant, route, capability, size) now returns
DispatchError::NotApplied(signedfailedwith the classno_effect)
instead ofAmbiguous(outcome_unknown).SandboxActionDispatcher
(the mTLS supervisor client) does the same for its checks before sending
(tenant, action digest, request size), and itspreflightrefuses a
request without a verified tenant or over 64 KiB. Any error after the
request may have been sent is stilloutcome_unknown. Action: clients
that expectedoutcome_unknownfor these cases handle 403
action_not_dispatchableandfailed/no_effect. -
A sandbox delete whose
unlinkatfails is signedeffect_failed
(T-016).fs:delete_fileisfailed/no_effect(403
action_not_dispatchable) only when the checks beforeunlinkatrefuse
it (path, parent directory, entry). An error from theunlinkatcall
itself,ENOENTincluded, is nowfailed/effect_failed(502
action_effect_failed): that error does not show that nothing was
removed. Before, it was signedno_effect. New:
praetore_sandbox_fs::Dir::unlink_file;Root::remove_fileis
unchanged. -
Migration 0022 (
0022_awaiting_approval_state). Admits
awaiting_approvalinexecution_attestations(accepted only while the
journal row is held:requires_approval,not_dispatched, no reason, no
decision, no expiration receipt, schema v5; a held row is attested only as
awaiting_approval, and schema v5 is accepted for no other state), adds
approved_claim_expiredto both reason vocabularies, and refuses a new
approval_expiredclose ofapproved_pending_dispatchand an
approved_claim_expiredclose without an approve decision. No row is
rewritten. A held row written before 0022 keeps its existing attestation.
Gateway::reconcileadds anawaiting_approvalattestation (schema v5)
next to it; starting the gateway,praetore run, and the published HTTP
and CLI routes do not. Until that reconcile, the inherited v2 receipt
still verifies asfinal: false(awaiting_approval_or_legacy). Manual
rollback:
docs/rollback/0022-awaiting-approval-state.sql, refused while any
awaiting_approvalorapproved_claim_expiredrow exists (in practice,
once a request was held under 0022). The gateway never signs a held
request asnot_dispatchedwith no reason: a held row with a decision or
an expiration and no signed close is reported asInvalidRecord.praetore-verify / Python binding <= 0.3.3 This release Receipts v1 to v4 verify verify as before; pending v2 receipts and outcome_unknownreportfinal: falseReceipt v5 ( awaiting_approval)rejected ( RECEIPT_INVALID,False)verifies, final: false,non_final_reason: awaiting_approvalReason approved_claim_expiredrejected ( RECEIPT_INVALID,False)verifies, final Rollback of 0022 n/a only while no awaiting_approvalorapproved_claim_expiredrow existsThe <= 0.3.3 column is the receipts that release already knew. v0.3.3
rejects the later v3 reasonapproval_rejected(RECEIPT_INVALID).A gateway or CLI built before this release refuses a database at 0022
(unknown migration version). This release applies 0022 to a database at
0021 withpraetore-gateway-demo migrate(schema owner URL in
PRAETORE_GATEWAY_MIGRATION_DATABASE_URL), andpraetore runalso
applies pending migrations when it starts. A production gateway process
applies them on start only when that migration URL is set. Release 0.3.3
knows migrations up to 0019 and already refuses a database at 0020 or
0021. The offline verifiers do not open the database.Older verifiers fail closed: they never accept a new receipt with another
meaning.
Added
-
Console language and local time. The console page can be read in
Spanish, English or Portuguese (Brazil), chosen with a selector at the top
and kept in the browser (localStorage, keypraetore_idioma); without a
saved choice it follows the browser's languages, then Spanish. The
catalogs are embedded and served atGET /i18n/{es,en,pt}.json; the
Content-Security-Policy is unchanged and the server never reads
Accept-Language. Every time is shown in the browser's zone with its
offset and in UTC beside it; deadlines with seconds. Presentation only:
tests check that the signed decision and the compliance package are the
same bytes in all three languages. The page's logic has Node built-in
tests (crates/praetore-console/tests-js/), run in CI with no npm
packages. The console's terminal messages andLEEME.txtstay in
Spanish. -
Tenant journal in ranges.
praetore journal-export --tenanttakes
--from-seq N [--limit M]and exports one range of the tenant's chain of
receipts, in the order of the whole export, printingnext_from_seq.
Each range after the first starts with its anchor, the receipt atseq
N - 1, whose link is the head of the previous range.
praetore-verify journal --range [--expected-anchor <head>]verifies one
range (new inpraetore_core::journal_chain:verify_journal_range,
ChainExporter::resume_after,JournalReport::range,
ChainError::AnchorMismatch). A whole tenant chain stays limited to 4096
entries and 8 MiB, and its format and the console's compliance package
are unchanged; when it is too large the export error names ranges.
Ranges carry no database reference and--from-seqcounts receipts, so
in a database with storage records the head of a range and the head of
the whole-chain export are not interchangeable; anevidence_idrepeated
across ranges is only detected by a whole-chain verification
(docs/operations.md). -
praetore initwritesattester-public-key.hex;praetore attester-pin.initalso writes the evidence attester's public key,
64 lowercase hex characters (the--attester-pinformat ofpraetore journal-export), next toevidence-attester.key. The console's
PRAETORE_CONSOLE_ATTESTER_PIN_FILESandpraetore journal-export --attester-pintake it.praetore attester-pin <directory>writes it
for a directory initialized before: it readsevidence-attester.key
itself, fails without it, and never overwrites. No secret file changes. -
praetore-verify journalreports an unanchored head (T-016). Without
--expected-headit reports thehead_not_anchoredwarning, on stderr
and indetails.warnings, assafety-journaldoes: a truncated or
re-linked chain also verifies then.--require-anchoredfails with
JOURNAL_NOT_ANCHORED(exit 1) after the chain verifies when no
--expected-headwas given. -
praetore-verify evidencealways reportsauthority_verified, and
takes--strict(T-016).authority_verifiedisfalsewhen no
--issuer-pinswere given.--strictrequires--issuer-pinsand
--policy(USAGEotherwise) and implies--require-intentand
--require-decision-time. A receipt that is not HighAssurance does not
record the engine mode that produced it; no flag can show it. -
Receipt finality in the verifiers (T-016).
praetore-verify receipt
reportsfinalandnon_final_reason: the receipt returned while a human
approval is pending (requires_approval,not_dispatched, no signed
reason; older receipts with that shape too) is reported as
awaiting_approval_or_legacy, andoutcome_unknownasoutcome_unknown,
because a later receipt for the same request can record another state.
--require-finalfails withRECEIPT_NOT_FINALfor them. Rust:
GatewayReceipt::is_final()andnon_final_reason(); Python:
verify_final_gateway_receiptandgateway_receipt_finality. The signed
format and the result of signature verification are unchanged. -
Approvals inbox in
praetore-console(P-002 D2). With
PRAETORE_CONSOLE_GATEWAY_URL(a loopbackhttp://IP:port),
PRAETORE_CONSOLE_APPROVER_KEY_ID,PRAETORE_CONSOLE_APPROVER_KEY_FILE
andPRAETORE_CONSOLE_APPROVER_TOKEN_FILE(owner-only files, the
approver.key/approver-api.tokenformats ofpraetore init) the
console lists the requests held for approval and lets the operator
approve, reject, or run the single dispatch of an approved request. It
reads the journal throughPRAETORE_CONSOLE_DATABASE_URL, which in the
tested setup is the gateway's runtime role: the reads run in
transactions the console opens read only (per session, not by
privilege), under the tenant's row-level security. Each request shows
who, what (quoted), on what (quoted), until when, and its parameters
with keys sorted and quoted: texts quoted, numbers as written, each list
element apart with its own mark, and characters escaped by Unicode
category (Cc, Cf, Zl, Zp, Co, Cn, every Zs other than U+0020, plus
variation selectors, U+034F, the Hangul fillers and U+2800). The inbox
tells apart structure, types and invisible characters; it does not flag
look-alike characters from different scripts (homoglyphs). A request whose parameters do not fit (more than 20 lines, 200
characters per value or 2 levels) or could be read two ways (a key with
a dot, keys that repeat once normalized, text not in Unicode NFC) can
only be rejected in the console, also server side, and approved with
praetore approve. Approve and reject take a confirmation in the same
card that repeats the parameters and the deadline. The console signs on
this computer, aspraetore approvedoes, only after it checks that the
gateway challenge is the one rebuilt from the journal evidence it read;
it checks that evidence against the attester pins and the local policy
(see Changed). The gateway verifies, records and dispatches. The browser
gets opaque references, never keys, journal ids or raw evidence.
Actions need the console's ownOriginand anx-praetore-consola
header besides the session cookie. A partial set of the four variables
is a startup error;
none of them leaves the console without the inbox (history only). The
gateway API is unchanged. Limit: a process running as the same operating
system user as the console can readapprover.key(and the token file)
directly and sign without the console; real separation requires running
the agent as another user (crates/praetore-console/README.md). -
praetore-consolesessions are per run and open through a single-use
link (P-002 D2). The session secret is new on every start and is no
longer read from or written to a file (PRAETORE_CONSOLE_SESSION_FILEis
ignored, with a warning); a cookie from an earlier run stops working. At
startup the console writeshttp://<bind>/?abrir=<code>to stderr; under
systemd that is the journal, readable by whoever reads it. The link works
once and for at most five minutes. A new link is issued only by the
operator (Enter in the console's terminal, when stdin and stderr are a
terminal and the console is in its foreground, or a restart); asking for
the page never issues one. SIGTTIN is ignored, so a console sent to the
background keeps serving instead of being stopped by the system./alone
no longer sets the cookie, and responses carryReferrer-Policy: no-referrer. Every request must carry the
console's ownHost(DNS rebinding). Agent-chosen text in the history
is shown with the same characters escaped. Action: open the printed
link after each start. -
Compliance package in
praetore-console(P-002 D3). With
PRAETORE_CONSOLE_POLICY_FILEandPRAETORE_CONSOLE_ATTESTER_PIN_FILES
(one to 16 public-key files, separated likePATH) the page offers
"Descargar paquete de compliance": apraetore-compliance.tar.gzbuilt on
this computer withjournal.jsonl(the tenant's chain, produced by the
same code aspraetore journal-export --tenant),policy.jsonas read,
policy-digest.txt(the digestpraetore-verify policy-digest
computes),attester-pin-N.hex,export.json,SHA256SUMSover every
other file, andLEEME.txtwith thepraetore-verifycommands and what
the package does not show: a path around the gateway, anything before
the first record or after the export, completeness without an anchored
head (the chain carries the policy decision only; since D3.1 the
approval and execution receipts travel inapprovals.jsonl, see below).
LEEME.txtasks forpraetore-verifybuilt frommain: the v0.3.3
verifier also accepts thisjournal.jsonl, but does not report
tenant_idnor warnhead_not_anchored, which the instructions use,
and has nooutcomescommand; v0.3.3 also rejects with
RECEIPT_INVALIDschema v5 execution receipts (awaiting_approval) and
the reasonsapproved_claim_expiredandapproval_rejected, which
approvals.jsonlcan carry.LEEME.txtcounts the decision receipts apart from the
database_headreference line, and has a section on completeness
(--expected-head, and--expected-database-headwhen the chain
references the database head). The download is aGETthat needs the session cookie, the
console'sHost, thex-praetore-consolaheader and, when the browser
sends it,Sec-Fetch-Site: same-origin; it writes nothing. Pins are
parsed and written back as public keys only; a pin equal to the
approver's public key or secret (with the inbox configured) is refused,
and so is any pin that verified no entry of the export, so a secret key
file listed by mistake is refused instead of copied; the page names the
unused pin in words by its place inPRAETORE_CONSOLE_ATTESTER_PIN_FILES
and the log records its position and path. Every piece is read again at
each download; if one is missing or does not check out (policy, pins,
or the export) no package is produced and the page says what failed
(for a failed export, the possible causes; an export stops at 4096
entries or 8 MiB of chain). One package is built at a time; a second
request meanwhile is told to wait. The page asks
/api/paquete/estadoand, when the package is not configured, says so
instead of offering the button. One variable without the other is a
startup error. New dependencies of the console:tarand
flate2(Rust backend). -
Approval and execution receipts in the compliance package (P-002
D3.1). When at least one of the new settings below is configured, the
package addsapprovals.jsonl: the tenant's human
decisions (approve, reject), approval-expiration receipts and execution
receipts (schema v1 to v5, theGatewayReceiptthe gateway returned,
with the journal's evidence and, forexecutedandconfirmed, the
adapter output its signature covers), one signed record per line, read
in the same read-only snapshot asjournal.jsonl. New optional
settingsPRAETORE_CONSOLE_EXECUTION_PIN_FILESand
PRAETORE_CONSOLE_APPROVER_PIN_FILES(0 to 16 each, only with the D3
settings) name the pins that verify them; with neither, the package is
the D3 one, andLEEME.txtandexport.json("outcomes": {"included": false, ...}) say the console is not configured to include
those receipts. The pins use the JSON format of the
approver-pin.jsonthatpraetore initwrites
({"schema_version":1,"key_id":...,"public_key_hex":...}); they go in
the package asexecution-pin-N.jsonandapprover-pin-N.json,
re-encoded from the parsed key. Before anything is archived, every
record is verified with the codepraetore-verify outcomesruns; a
record that does not verify, does not match its request of the journal
or contradicts another record of that request, or a record signed by a
key no pin names, means no package, and the page says so without ids or
hex; so does anapprovals.jsonlover 32 MiB or 20,480 lines. An
execution pin equal to the approver's key, an approver pin equal to the
approver's secret, a file that is not a JSON pin, and a repeated key or
key id are refused. An execution or approver pin that verified no
record is left out of the package and logged with its position and path
(a tenant with no human decision gets noapprover-pin-1.json).
export.jsoncounts the records of each kind, the held requests by
outcome and the omitted pins (omitted_execution_pins,
omitted_approver_pins).LEEME.txthas a new step 5
(praetore-verify outcomes, how to find each held request of the
journal in itsheldlist; the order of the lines is not verified, and
an unused pin is reported, not an error) and says what it does not
show: thatapprovals.jsonlis complete (its records are not chained,
so an approved or executed request can show aspending,
approved_pending_dispatchornot_dispatched), and that a
request shown aspendingmay also have expired without the gateway
having recorded it yet. The step 2 note on v0.3.3 now says that
approvals.jsonlcan carry what v0.3.3 rejects. The page's notice on the
package namesapprovals.jsonland the execution and approver public
keys, and asks to review the output of each executed action, which may
hold sensitive data, before handing the package over. -
praetore initwritesexecution-pin.json;praetore execution-pin
(P-002 D3.1).initalso writes the execution key's public pin
({"schema_version":1,"key_id":"local-demo-<public key hex>","public_key_hex":...}),
the format ofapprover-pin.json, for the console's
PRAETORE_CONSOLE_EXECUTION_PIN_FILESandpraetore-verify outcomes --execution-pin.praetore execution-pin <directory>writes it for a
directory initialized before: it readsexecution-attester.keyitself
and never overwrites. No secret file changes. -
praetore-verify outcomes(P-002 D3.1). Verifies a tenant's
approval and execution records (a JSONL file such asapprovals.jsonl)
against its journal chain, which it verifies first: each human decision
against the challenge derived from its journal receipt and an
--approver-pin, each expiration and execution receipt against an
--execution-pin(both repeatable, up to 16, JSON pins), the evidence
embedded in each execution receipt against the journal's receipt for
that request, and that the records of one request agree. It reports
counts,held(every held request of the journal with its outcome:
pending,rejected,expired,approved_pending_dispatch,
approved_executed,approved_failed,approved_outcome_unknown,
approved_not_dispatchedornot_dispatched),held_by_outcome, the
pins that verified nothing, andhead_not_anchoredwithout
--expected-head. New error codesOUTCOME_MALFORMED,
OUTCOME_UNKNOWN_REQUEST,OUTCOME_EVIDENCE_MISMATCH,
OUTCOME_KEY_UNKNOWN,OUTCOME_SIGNATURE_INVALID,
OUTCOME_SELF_APPROVAL,OUTCOME_DUPLICATE,OUTCOME_INCONSISTENT,
OUTCOME_PIN_DUPLICATE,OUTCOMES_TOO_LARGE. Before, the verifier
checked one execution receipt per run (receipt) and had no command for
human decisions or expiration receipts. The code is
praetore_receipt::outcomes;praetore_core::journal_chainadds
verify_journal_receipts, which also returns the verified receipts, and
praetore_replay_postgres::journal_exportadds
export_tenant_with_outcomes. -
praetore_replay_postgres::journal_export(P-002 D3). The tenant
export ofpraetore journal-export(export_tenant: receipts and
storage records in one read-only, repeatable-read snapshot, then the
chain) moved from the CLI to this module, so the CLI and the console run
the same code. The CLI's output and errors are unchanged. New in
praetore_core::journal_chain:ChainExporter::unused_attesters, the
pins that verified no entry.
Changed
-
The CI smoke test of
praetore-mcpuses
@modelcontextprotocol/server-filesystem@2.3.0(was 2.1.0), pinned in
scripts/mcp-smoke/package.json, its lockfile andscripts/mcp-smoke.py.
This takesglob13.0.7 (GHSA-3g3m-2fjr-6pw4) andminimatch10.2.6
(GHSA-g3hv-75wg-m249) out of the test lockfile. Those npm packages are only
installed by the smoke job; they are not published and are not inside any
binary. The binaries do not change. -
A tenant's journal chain follows the commit order (migration 0024).
Every journal row takes its tenant's next position,
execution_journal.chain_seq, in the transaction that writes it (table
praetore.journal_positions, BEFORE INSERT trigger, row lock held until
COMMIT).praetore journal-export --tenant, its ranges, the console's
compliance package and its approval records are ordered bychain_seq
instead ofcreated_at, so a transaction that commits late, or a step
back of the database clock, no longer moves a row in front of receipts
already exported. Rows written before 0024 are numbered in the former
order, so existing exports and anchored heads are unchanged, byte for
byte; rows already out of commit order keep that order.chain_seqis
immutable, and an export fails, naming the expected and found position,
when a tenant's positions are not contiguous from 0 (a gap or a jump).
Deleting a tenant's newest rows, or all of them, leaves the positions
contiguous and is not detected, and neither is a consistent renumbering
by whoever can write to the database; only a head anchored outside the
operator's control shows those changes. Writers of one tenant now wait
for each other until COMMIT; writers of different tenants do not. The
gateway writes the journal row in a READ COMMITTED transaction whatever
the database's default isolation. Applying 0024 holds ACCESS EXCLUSIVE
onpraetore.execution_journaluntil it commits: apply it with the
gateways stopped or in a maintenance window.JOURNAL_QUERYreturnschain_seqas a second column
(new:journal_export::check_position,receipts_in_chain_order). The
JSONL format is unchanged. Manual rollback:
docs/rollback/0024-journal-commit-order-position.sql. -
praetore-consolechecks journal evidence against the attester pins
and the local policy before it offers a decision. The approvals inbox
now requiresPRAETORE_CONSOLE_POLICY_FILEand
PRAETORE_CONSOLE_ATTESTER_PIN_FILES; without them the console does not
start, and the error names what is missing, so a console with the inbox
also offers the compliance package. A held request is shown, and can be
approved or rejected, only when its evidence is signed by one of the pins
and records the local policy's digest; the console checks again just
before signing, and still requires the gateway challenge to match the
evidence. A request that does not verify is only counted. With pins, the
history also checks each receipt's attester signature, not the current
policy; a receipt that does not verify is shown as unreadable instead of
failing the page. Without pins, the history checks the integrity hash
only, as before. The inbox and the history read the pins and the policy
once, at startup: a change takes effect on restart. After a policy
change, requests held under the earlier policy are no longer offered in
the inbox;praetore approveandpraetore rejectstill decide them.
With the policy and the pins but no inbox (package only), the console
now reads those files at startup and does not start if one cannot be
read, is a symlink or is not a regular file; before, they were first
read at download, and the download still follows symlinks. The package
download is otherwise unchanged. -
praetore-consolekeeps its session per tab. The opening link is now
http://<bind>/#abrir=<code>; the page redeems the code once over
POST /api/sesionand keeps the session token insessionStoragefor
that tab, sent asAuthorization: Bearer. No session cookie is set. A
token expires after 12 hours and does not survive a restart; another tab
needs a new link.PRAETORE_CONSOLE_*variables are unchanged. -
Approval types moved to
praetore-receipt(P-002 D3.1).
ExecutionKey,ApprovalChallenge,HumanApprovalOutcome,
HumanApprovalDecision,ExpiredOutcome,ApprovalExpiredReceiptand
ApprovalErrormoved frompraetore-gateway, which re-exports them
unchanged, so offline verifiers can check decisions and expiration
receipts without server dependencies. What they sign and how they verify
is unchanged. New:HumanApprovalDecision::verify_signatureand
is_self_approval(the checks the gateway already ran, now shared);
ApprovalExpiredReceipt::createis public behind thesigningfeature,
likeExecutionAttestation::create. -
Migration
0021_journal_insert_rules(T-016). The execution journal
accepts on INSERT only the initial states the gateway writes (authorized
forallowed,not_dispatchedotherwise, with no output, reason or
failure class), and an execution attestation only for the journal row's
current state, with the same reason, failure class and signed identity.
Rows written before 0021 are not rewritten. Manual rollback:
docs/rollback/0021-journal-insert-rules.sql; the 0020 rollback now
refuses to run while 0021 is applied. -
Execution attestations are timestamped with the engine's trusted clock
(T-016).observed_atcomes from the same clock as approval
expirations, not the host clock. When that clock is unavailable the gateway signs
nothing and returns an error; an execution already dispatched stays
dispatcheduntilreconcilecloses it. -
A human rejection and its signed close commit together (T-016). The
decision and theapproval_rejectedclose are written in one
transaction: when the write fails, neither is recorded and the request
can still be decided. Rows written by earlier releases with a decision
and no close are still repaired on the next read. -
Claude Code hook example fails closed when its binary fails (T-016).
hook/praetore-hook.shno longerexecs the binary: a binary that cannot
start, panics, is killed by a signal, exits with a status other than 0 or
prints something other than a JSON object yields adenydecision. The
binary turns a panic during authorization into a deny. The README
registers the hook with"onFailure": "block"and atimeout. -
Claude Code hook example:
-cin a group of short options (T-016).
bash -lc '...',sh -ec '...'and fish's--commandare treated as
shell -c(unanalyzable command). -
praetore-mcp fsyncs directories (T-016) after creating a daily journal
file or a directory, and after writing a new file, a backup or a renamed
config or policy. -
praetore_core::journal_chain::receipt_linkis public, so other journals
link receipts with the same function. -
Documentation matches the current code (T-016).
docs/operations.md
describes an execution attestation that cannot be signed after dispatch
(the row staysdispatcheduntilreconcile) and the scope of the 0012
trigger next to 0021. The descriptions ofpraetore-gateway-serviceand
praetore-mcp,demo/README.md, the release-signing notes in
docs/assurance-matrix.mdanddocs/pre-user-pilot-gates.md, the policy
golden-vector test names indocs/assurance-matrix.mdand
docs/threat-model.md, and the migration range in
docs/observability-mvp.mdare corrected. The praetore-mcp GUIDE lists a
held journal lock as a troubleshooting case. The help of
praetore-mcp policydescribes how--arg-path-prefixvalues are
resolved; the flags and their behavior are unchanged. -
Kubernetes templates deny ingress and egress by default per namespace
(T-016).praetore-agents,praetore-gateway,praetore-tools,
praetore-egressandpraetore-sandboxeach get a policy that selects
every pod for ingress and egress; the existing allows add to it. The
gateway proxy gets an explicit egress allow (protected tools, public 443,
DNS) and the sandbox supervisor an egress allow for the Kubernetes API
and DNS, to be narrowed to the cluster's API server addresses. The Cilium
profile writes these policies with the empty-rule form (- {}).
praetore-datais not covered. CI checks the floor with
scripts/check-k8s-default-deny.rb. Action: add the egress your protected
tools need as separate allow policies. -
Claude Code hook example:
PRAETORE_HOOK_BINmust be an absolute path
to an executable regular file (T-016). Otherwise the wrapper denies
without running anything; an empty value still means the installed
binary. The README states what is not checked: whoever controls the
environment of the hook process chooses the binary. -
Safety ingestion counts a resent
conflictevent as a duplicate
(T-016). An event identical to one already recorded asconflictfor
itssource_seqcreates no second record: it is counted asduplicate,
like a resend of the first event. A different event with that
source_seqis still recorded asconflict. The record format, the
verifier and the signed counts are unchanged; chains written before may
hold the sameconflictmore than once and still verify. Rust:
safety_ingest::EventLookuphas a new method,conflict_recorded
(implemented byMemoryLookupandPostgresSafetyStore); custom
lookups implement it. -
Safety ingestion docs (T-016).
docs/operations.mdand
SafetySourceKeystate that a source key is used by one source,
ingester and tenant, and is not shared between ingesters or tenants.
EpochFileanddocs/operations.mdstate that a missing epoch file is
read as the first start of the source, including after the file is
deleted, and how to recover from that. -
praetore-mcp release archives are packaged before the smoke test
(T-016). InAssurance gates,mcp-binariesbuilds, packages and
checksums each binary without installing Node tooling, and a new
mcp-smokejob tests the uploaded archive after checking its.sha256.
Release checksumswaits for both. The smoke test installs
@modelcontextprotocol/server-filesystem@2.1.0withnpm cifrom the
committedscripts/mcp-smoke/package-lock.jsoninstead ofnpx -y, and
scripts/mcp-smoke.pystops if that install is missing or another version.
The binaries and the archive layout are unchanged.
Fixed
- CLI PostgreSQL tests locate
praetore-verifyon Cargo 1.100.
The test helper walked two parent directories from the test
executable, which matched Cargo 1.99 (target/debug/deps/). Cargo
1.100 places test executables under
target/debug/build/<package>/<hash>/out/, so the helper looked in
the hash directory andpostgres_t013b_refusal_before_effect_is_a_signed_failed_state
failed after stable moved to rustc 1.100.0. The helper now walks
ancestors until it finds the binary in the artifact directory
(target/debugortarget/release), which is still where Cargo
uplifts workspace binaries.