Skip to content

PRÆTORE v0.3.4

Choose a tag to compare

@github-actions github-actions released this 14 Nov 02:59
· 293 commits to main since this release
a606c11

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 matching tools/call is not forwarded. The proxy writes a pending
    file under the praetore-mcp home and returns the approval id plus the
    exact praetore-mcp approve <id> --dir <home> command. approvals lists
    pending calls, approve and reject sign the decision with a new local
    approver key (init creates it; running init again adds it to an
    existing home and does not replace keys or receipts). approve reads 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_SECONDS or
    approvals/ttl-seconds), and authorizes one later matching call. The
    decision and that execution are appended to approvals/journal.jsonl.
    verify checks the approver signature, the binding, the expiry and that
    the approval was not used twice. receipts shows the state. Observe mode
    still forwards, and the receipt list says enforce would ask. Receipt
    lines in receipts/*.jsonl are 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, mensaje and nota are stable
    English snake_case codes ("awaiting_approval",
    {"codigo": "request_gone"}, {"codigo": "inbox_truncated", "limite": 200});
    queria and sobre are {"texto": ...} or {"codigo": "not_shown"};
    agente is {"nombre": ...} or {"numero": N}. Times are RFC 3339 UTC
    in cuando_utc, actualizado_utc, pedida_utc and vale_hasta_utc;
    cuando, actualizado, pedida, vale_hasta and queda are 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-demo requires PRAETORE_GATEWAY_ADAPTER (T-016).
    The service no longer falls back to local-demo when 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, including local-demo for local runs (docs/operations.md).

  • Gateway attester keys are read from owner-only files (T-016).
    PRAETORE_GATEWAY_EVIDENCE_ATTESTER_KEY_FILE and
    PRAETORE_GATEWAY_EXECUTION_ATTESTER_KEY_FILE name 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_HEX variables 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_HEX variables.

  • praetore-observe requires its read-only role (T-016). At startup it
    checks that PRAETORE_OBSERVE_DATABASE_URL logs in as praetore_observe
    or as a member of it, is not a member of praetore_runtime,
    praetore_safety_ingest or praetore_safety_audit, and holds no
    privilege beyond the documented column SELECT grant
    (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 journal renames database_head_verified to
    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 new database_head_anchored is true
    only with --expected-database-head, a head the caller holds; the head
    of a --database-journal file is not anchored by that file. Action:
    scripts that read database_head_verified read database_head_consistent,
    and check database_head_anchored where an anchored database head is
    required.

  • A journal chain holds the receipts of one tenant (T-016). praetore-verify journal and praetore journal-export refuse 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 (null for a database chain, or when the receipts name
    none). Exports written by journal-export --tenant hold 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.
    praetore only ever wrote lowercase.

  • Cooperative execution is refused by default (T-013). The local HTTP
    API (praetore run) and praetore-gateway-demo, with every adapter and
    with or without sandbox_root, require praetore-exec-mode: gateway on
    every execution-path request and never answer approved on /status
    for an approved action. Before, this applied only with sandbox_root, and
    praetore-gateway-demo never applied it. http_api::HttpOptions now has
    exec_mode: ExecMode instead of gateway_executes_effects: bool. Action:
    clients send the header (the praetore CLI already does). Development
    only, with no guarantee about who performs an effect:
    praetore init --dev-cooperative-exec or
    PRAETORE_GATEWAY_DEV_COOPERATIVE_EXEC=1 (local-demo adapter).

  • ExecutionJournal::record_human_approval takes a HumanDecisionRecord
    (T-016).
    A rejection now carries its signed approval_rejected close 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, as PostgresExecutionJournal does.

  • ExecutionAttestation::create takes observed_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>.jsonl is now {"seq","prev","evidence"}, the line
    format of praetore_core::journal_chain, instead of a bare evidence
    document. praetore-mcp verify checks 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-head against 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 the evidence member (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 a safety* 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 carries execution: "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_approval with final: false after the request was approved
    and executed; it can no longer be read as a closed not_dispatched
    request. awaiting_approval is a signed receipt state only, never a
    journal state: GatewayReceipt::execution and
    ExecutionAttestation::execution are now AttestedExecution
    (ExecutionStatus remains the journal row state, and
    AttestedExecution::journal_status() maps between them).
    NonFinalReason gains AwaitingApproval and loses Intermediate (no
    signed receipt carries an intermediate state). Action: HTTP clients that
    match on the 202 execution field accept awaiting_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 signed not_dispatched_reason
    (schema v3) for an approved request whose single dispatch is claimed too
    late. approval_expired now means only that the window closed without a
    decision. Rows closed before this release keep approval_expired.

  • ActionDispatcher::preflight takes the verified authority (T-016).
    The signature is now preflight(&self, authority: &Authority, action: &Action); the gateway passes the same authority that dispatch receives,
    so an adapter that routes per tenant can check its route before an action
    is dispatched or held for approval. Action: adapters that override
    preflight add the parameter.

  • HTTP and sandbox-supervisor adapters report refusals made before sending
    as no_effect (T-016).
    HttpActionDispatcher now 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, signed not_dispatched with reason
    dispatch_refused), and an action that requires approval is not held.
    Before, it was dispatched and signed outcome_unknown, or held for
    approval first. In dispatch, every check before the request is sent
    (action digest, tenant, route, capability, size) now returns
    DispatchError::NotApplied (signed failed with the class no_effect)
    instead of Ambiguous (outcome_unknown). SandboxActionDispatcher
    (the mTLS supervisor client) does the same for its checks before sending
    (tenant, action digest, request size), and its preflight refuses a
    request without a verified tenant or over 64 KiB. Any error after the
    request may have been sent is still outcome_unknown. Action: clients
    that expected outcome_unknown for these cases handle 403
    action_not_dispatchable and failed / no_effect.

  • A sandbox delete whose unlinkat fails is signed effect_failed
    (T-016).
    fs:delete_file is failed / no_effect (403
    action_not_dispatchable) only when the checks before unlinkat refuse
    it (path, parent directory, entry). An error from the unlinkat call
    itself, ENOENT included, is now failed / effect_failed (502
    action_effect_failed): that error does not show that nothing was
    removed. Before, it was signed no_effect. New:
    praetore_sandbox_fs::Dir::unlink_file; Root::remove_file is
    unchanged.

  • Migration 0022 (0022_awaiting_approval_state). Admits
    awaiting_approval in execution_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_expired to both reason vocabularies, and refuses a new
    approval_expired close of approved_pending_dispatch and an
    approved_claim_expired close without an approve decision. No row is
    rewritten. A held row written before 0022 keeps its existing attestation.
    Gateway::reconcile adds an awaiting_approval attestation (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 as final: false (awaiting_approval_or_legacy). Manual
    rollback:
    docs/rollback/0022-awaiting-approval-state.sql, refused while any
    awaiting_approval or approved_claim_expired row exists (in practice,
    once a request was held under 0022). The gateway never signs a held
    request as not_dispatched with no reason: a held row with a decision or
    an expiration and no signed close is reported as InvalidRecord.

    praetore-verify / Python binding <= 0.3.3 This release
    Receipts v1 to v4 verify verify as before; pending v2 receipts and outcome_unknown report final: false
    Receipt v5 (awaiting_approval) rejected (RECEIPT_INVALID, False) verifies, final: false, non_final_reason: awaiting_approval
    Reason approved_claim_expired rejected (RECEIPT_INVALID, False) verifies, final
    Rollback of 0022 n/a only while no awaiting_approval or approved_claim_expired row exists

    The <= 0.3.3 column is the receipts that release already knew. v0.3.3
    rejects the later v3 reason approval_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 with praetore-gateway-demo migrate (schema owner URL in
    PRAETORE_GATEWAY_MIGRATION_DATABASE_URL), and praetore run also
    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, key praetore_idioma); without a
    saved choice it follows the browser's languages, then Spanish. The
    catalogs are embedded and served at GET /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 and LEEME.txt stay in
    Spanish.

  • Tenant journal in ranges. praetore journal-export --tenant takes
    --from-seq N [--limit M] and exports one range of the tenant's chain of
    receipts, in the order of the whole export, printing next_from_seq.
    Each range after the first starts with its anchor, the receipt at seq
    N - 1, whose link is the head of the previous range.
    praetore-verify journal --range [--expected-anchor <head>] verifies one
    range (new in praetore_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-seq counts receipts, so
    in a database with storage records the head of a range and the head of
    the whole-chain export are not interchangeable; an evidence_id repeated
    across ranges is only detected by a whole-chain verification
    (docs/operations.md).

  • praetore init writes attester-public-key.hex; praetore attester-pin. init also writes the evidence attester's public key,
    64 lowercase hex characters (the --attester-pin format of praetore journal-export), next to evidence-attester.key. The console's
    PRAETORE_CONSOLE_ATTESTER_PIN_FILES and praetore journal-export --attester-pin take it. praetore attester-pin <directory> writes it
    for a directory initialized before: it reads evidence-attester.key
    itself, fails without it, and never overwrites. No secret file changes.

  • praetore-verify journal reports an unanchored head (T-016). Without
    --expected-head it reports the head_not_anchored warning, on stderr
    and in details.warnings, as safety-journal does: a truncated or
    re-linked chain also verifies then. --require-anchored fails with
    JOURNAL_NOT_ANCHORED (exit 1) after the chain verifies when no
    --expected-head was given.

  • praetore-verify evidence always reports authority_verified, and
    takes --strict (T-016).
    authority_verified is false when no
    --issuer-pins were given. --strict requires --issuer-pins and
    --policy (USAGE otherwise) and implies --require-intent and
    --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
    reports final and non_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, and outcome_unknown as outcome_unknown,
    because a later receipt for the same request can record another state.
    --require-final fails with RECEIPT_NOT_FINAL for them. Rust:
    GatewayReceipt::is_final() and non_final_reason(); Python:
    verify_final_gateway_receipt and gateway_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 loopback http://IP:port),
    PRAETORE_CONSOLE_APPROVER_KEY_ID, PRAETORE_CONSOLE_APPROVER_KEY_FILE
    and PRAETORE_CONSOLE_APPROVER_TOKEN_FILE (owner-only files, the
    approver.key / approver-api.token formats of praetore 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 through PRAETORE_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, as praetore approve does, 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 own Origin and an x-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 read approver.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-console sessions 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_FILE is
    ignored, with a warning); a cookie from an earlier run stops working. At
    startup the console writes http://<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 carry Referrer-Policy: no-referrer. Every request must carry the
    console's own Host (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_FILE and PRAETORE_CONSOLE_ATTESTER_PIN_FILES
    (one to 16 public-key files, separated like PATH) the page offers
    "Descargar paquete de compliance": a praetore-compliance.tar.gz built on
    this computer with journal.jsonl (the tenant's chain, produced by the
    same code as praetore journal-export --tenant), policy.json as read,
    policy-digest.txt (the digest praetore-verify policy-digest
    computes), attester-pin-N.hex, export.json, SHA256SUMS over every
    other file, and LEEME.txt with the praetore-verify commands 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 in approvals.jsonl, see below).
    LEEME.txt asks for praetore-verify built from main: the v0.3.3
    verifier also accepts this journal.jsonl, but does not report
    tenant_id nor warn head_not_anchored, which the instructions use,
    and has no outcomes command; v0.3.3 also rejects with
    RECEIPT_INVALID schema v5 execution receipts (awaiting_approval) and
    the reasons approved_claim_expired and approval_rejected, which
    approvals.jsonl can carry. LEEME.txt counts the decision receipts apart from the
    database_head reference line, and has a section on completeness
    (--expected-head, and --expected-database-head when the chain
    references the database head). The download is a GET that needs the session cookie, the
    console's Host, the x-praetore-consola header 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 in PRAETORE_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/estado and, 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: tar and
    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 adds approvals.jsonl: the tenant's human
    decisions (approve, reject), approval-expiration receipts and execution
    receipts (schema v1 to v5, the GatewayReceipt the gateway returned,
    with the journal's evidence and, for executed and confirmed, the
    adapter output its signature covers), one signed record per line, read
    in the same read-only snapshot as journal.jsonl. New optional
    settings PRAETORE_CONSOLE_EXECUTION_PIN_FILES and
    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, and LEEME.txt and export.json ("outcomes": {"included": false, ...}) say the console is not configured to include
    those receipts. The pins use the JSON format of the
    approver-pin.json that praetore init writes
    ({"schema_version":1,"key_id":...,"public_key_hex":...}); they go in
    the package as execution-pin-N.json and approver-pin-N.json,
    re-encoded from the parsed key. Before anything is archived, every
    record is verified with the code praetore-verify outcomes runs; 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 an approvals.jsonl over 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 no approver-pin-1.json).
    export.json counts the records of each kind, the held requests by
    outcome and the omitted pins (omitted_execution_pins,
    omitted_approver_pins). LEEME.txt has a new step 5
    (praetore-verify outcomes, how to find each held request of the
    journal in its held list; the order of the lines is not verified, and
    an unused pin is reported, not an error) and says what it does not
    show: that approvals.jsonl is complete (its records are not chained,
    so an approved or executed request can show as pending,
    approved_pending_dispatch or not_dispatched), and that a
    request shown as pending may also have expired without the gateway
    having recorded it yet. The step 2 note on v0.3.3 now says that
    approvals.jsonl can carry what v0.3.3 rejects. The page's notice on the
    package names approvals.jsonl and 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 init writes execution-pin.json; praetore execution-pin
    (P-002 D3.1).
    init also writes the execution key's public pin
    ({"schema_version":1,"key_id":"local-demo-<public key hex>","public_key_hex":...}),
    the format of approver-pin.json, for the console's
    PRAETORE_CONSOLE_EXECUTION_PIN_FILES and praetore-verify outcomes --execution-pin. praetore execution-pin <directory> writes it for a
    directory initialized before: it reads execution-attester.key itself
    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 as approvals.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_dispatched or not_dispatched), held_by_outcome, the
    pins that verified nothing, and head_not_anchored without
    --expected-head. New error codes OUTCOME_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_chain adds
    verify_journal_receipts, which also returns the verified receipts, and
    praetore_replay_postgres::journal_export adds
    export_tenant_with_outcomes.

  • praetore_replay_postgres::journal_export (P-002 D3). The tenant
    export of praetore 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-mcp uses
    @modelcontextprotocol/server-filesystem@2.3.0
    (was 2.1.0), pinned in
    scripts/mcp-smoke/package.json, its lockfile and scripts/mcp-smoke.py.
    This takes glob 13.0.7 (GHSA-3g3m-2fjr-6pw4) and minimatch 10.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 by chain_seq
    instead of created_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_seq is
    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
    on praetore.execution_journal until it commits: apply it with the
    gateways stopped or in a maintenance window. JOURNAL_QUERY returns chain_seq as 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-console checks journal evidence against the attester pins
    and the local policy before it offers a decision.
    The approvals inbox
    now requires PRAETORE_CONSOLE_POLICY_FILE and
    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 approve and praetore reject still 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-console keeps its session per tab. The opening link is now
    http://<bind>/#abrir=<code>; the page redeems the code once over
    POST /api/sesion and keeps the session token in sessionStorage for
    that tab, sent as Authorization: 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, ApprovalExpiredReceipt and
    ApprovalError moved from praetore-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_signature and
    is_self_approval (the checks the gateway already ran, now shared);
    ApprovalExpiredReceipt::create is public behind the signing feature,
    like ExecutionAttestation::create.

  • Migration 0021_journal_insert_rules (T-016). The execution journal
    accepts on INSERT only the initial states the gateway writes (authorized
    for allowed, not_dispatched otherwise, 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_at comes 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
    dispatched until reconcile closes it.

  • A human rejection and its signed close commit together (T-016). The
    decision and the approval_rejected close 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.sh no longer execs 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 a deny decision. The
    binary turns a panic during authorization into a deny. The README
    registers the hook with "onFailure": "block" and a timeout.

  • Claude Code hook example: -c in a group of short options (T-016).
    bash -lc '...', sh -ec '...' and fish's --command are 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_link is 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 stays dispatched until reconcile) and the scope of the 0012
    trigger next to 0021. The descriptions of praetore-gateway-service and
    praetore-mcp, demo/README.md, the release-signing notes in
    docs/assurance-matrix.md and docs/pre-user-pilot-gates.md, the policy
    golden-vector test names in docs/assurance-matrix.md and
    docs/threat-model.md, and the migration range in
    docs/observability-mvp.md are corrected. The praetore-mcp GUIDE lists a
    held journal lock as a troubleshooting case. The help of
    praetore-mcp policy describes how --arg-path-prefix values 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-egress and praetore-sandbox each 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-data is 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_BIN must 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 conflict event as a duplicate
    (T-016).
    An event identical to one already recorded as conflict for
    its source_seq creates no second record: it is counted as duplicate,
    like a resend of the first event. A different event with that
    source_seq is still recorded as conflict. The record format, the
    verifier and the signed counts are unchanged; chains written before may
    hold the same conflict more than once and still verify. Rust:
    safety_ingest::EventLookup has a new method, conflict_recorded
    (implemented by MemoryLookup and PostgresSafetyStore); custom
    lookups implement it.

  • Safety ingestion docs (T-016). docs/operations.md and
    SafetySourceKey state that a source key is used by one source,
    ingester and tenant, and is not shared between ingesters or tenants.
    EpochFile and docs/operations.md state 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).
    In Assurance gates, mcp-binaries builds, packages and
    checksums each binary without installing Node tooling, and a new
    mcp-smoke job tests the uploaded archive after checking its .sha256.
    Release checksums waits for both. The smoke test installs
    @modelcontextprotocol/server-filesystem@2.1.0 with npm ci from the
    committed scripts/mcp-smoke/package-lock.json instead of npx -y, and
    scripts/mcp-smoke.py stops if that install is missing or another version.
    The binaries and the archive layout are unchanged.

Fixed

  • CLI PostgreSQL tests locate praetore-verify on 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 and postgres_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/debug or target/release), which is still where Cargo
    uplifts workspace binaries.