diff --git a/CHANGELOG.md b/CHANGELOG.md index 66092f5..9e793e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ Version source: `kennel.toml`; CLI and `kujo.toml` must agree. Historical releas entries are retained below. Experimental contract versions are independent of Dispatch's version. +## Unreleased — explicit graph attempt accounting + +- Add opt-in durable reservations, permanent dispatch consumption and explicit safe + release under existing graph/child locks, with event-derived accounting reports. +- Permit an explicitly authorized second child run for the same logical node only + after a sealed Dispatch pre-admission refusal, binding original inputs and lineage. + Consumed or uncertain work cannot use retry budget as replay permission. +- Bind graph finalization and retained-host repair to exact accounting history; + branch/group control events and Eval/human instances remain separate units. +- Add input-binding/v1alpha4 commitments without changing historical vectors or + participant/result bytes. See `docs/contracts/graph-attempts/` for proof boundaries. + ## Unreleased — bounded parent finalization - Bind existing Workcell preservation `$ref` evidence through an additive exact-byte diff --git a/docs/audits/graph-attempt-accounting.md b/docs/audits/graph-attempt-accounting.md new file mode 100644 index 0000000..7d51c9a --- /dev/null +++ b/docs/audits/graph-attempt-accounting.md @@ -0,0 +1,87 @@ +# Explicit graph attempt accounting proof + +Experimental retained trusted-host scope. Dispatch extends its existing static DAG, +run lock, journal, node admission, parent finalization and mechanical reconciliation. +The objective crosswalk is [requirements](../contracts/graph-attempts/requirements.md). +Exact gate results, source pins, commands, hashes, warnings and skips are in +[validation](../evidence/graph-attempt-accounting/validation.json). No partial or +interrupted run counts as a complete canonical pass. + +## Verified result (2026-10-01) + +The complete Dispatch release gate passed at source +`119de2e6f800e1cbceadcb01dec153c2e9394d19`: 106 suite groups, all 101 native +shard assertions, 55 new accounting checks, four new commitment vectors and 3/3 +bounded release workloads. The independent Go/TypeScript/Python comparison reports +152 checks, five MCP checks and nine malformed-input checks; Kujo verifies all four +new vectors. No canonical suite is skipped. The pre-implementation baseline passed +252 focused checks. Both canonical failures and the environmental interruption are +retained rather than counted as successful runs. + +Kujo documentation commit `2946f2a1a76700519292db3da8004ea1a9e31f61` passed format, +locked release build and 13 architecture/README/workflow contract tests. Two existing +artifact-dependent workflow tests remain explicitly ignored; vendor tiny_http emits +two existing warnings. No related repository was modified by this work. Kujo main +advanced independently during validation; the tested documentation branch retains its +original main base, with no claim that unrelated newer runtime changes were tested. + +## Model + +A logical node stays fixed while its explicitly declared child execution run changes. +A held reservation consumes availability; a durable graph dispatch permanently +consumes a program-dispatch unit. Node admission and effect admission remain separate. +Loss of delivery, reply or certainty does not refund dispatch. The current view is +journal-derived, not an independently mutable counter. + +Release requires graph then child lock and exact proof of no dispatch, claim, +execution, refusal or uncertainty. A released reservation remains historical; its +surviving input binding grants no admission. Retry requires a sealed Dispatch-owned +resource-preflight refusal before node admission. An operator explicitly authorizes +a new child run, exact original logical inputs and lineage. The old child stays +sealed; the new child independently crosses execution, effects, Eval and finalization. +A descendant reservation or immutable child binding blocks retiring its source. + +Only program dispatches use this unit. Inactive branches, branch activation and group +terminal receipts add none. Group members count once. Human decision and Eval instances +remain separate report categories. No price, token or elapsed-time measurement is +invented. The static graph ceiling and node ceiling remain anchored. + +## Proof and limits + +The integration chain is A → pre-admission refusal B1 → independently completed B2 → C. +The tests retain B1, validate actual typed downstream input, deny a third attempt, +reject changed artifacts and authority, and finalize all-complete work at zero +availability. Exhaustion with required work remaining blocks; it does not fabricate +failure or reclaim uncertain work. + +Fresh-process races cover the last graph slot, release and retry/next-attempt creation. +Crash injection covers reservation before binding, binding before dispatch, durable +dispatch before delivery, child load before admission, consumed admission before work, +real SQLite mutation with lost reply, and immutable terminal/index publication gaps. +Retained-host repair reconstructs exact reserve/release/retry/refusal/terminal lineage +without execution, refund, missing event invention or graph finalization. + +Portable additions are input-binding/v1alpha4 and program-attempt terminal/v1alpha2. +Four independent language implementations check the new commitments. Historical +schemas, alpha/beta commitments, execution-result/v1 and participant bytes stay intact. +Development failures and fixes are retained, including the wrong AJV draft validator. +A host restart interrupted a subsequent canonical run; its surviving evidence and +loss of temporary originals are explicit, and a complete rerun is required. The +post-restart run also exposed an assumption that historical observation-only journals +carried workflow definitions. Opt-in accounting now preserves their absence while +rejecting accounting events or unexplained ledger rows; the real effect-set crash +and renewal suite and three additional contract assertions verify the correction. + +## Ownership and next phase + +Dispatch owns accounting authority; Workcell supplies environment facts; Eval supplies +judgment facts; RunLedger reports; Watchdog observes. No unrelated repository change +or duplicate audit system is needed. The operator report is informational, not an +execution or retry ticket. + +Next major phase: sourced resource and Eval measurement with bounded reservation +planning, evaluator budgets and fan-out quotas. Establish trustworthy units before +cost/time policy. General retries, automatic redelivery, ceiling extension, arbitrary +loops, dynamic topology, distributed scheduling, remote trust, machine-loss recovery, +mixed profiles, compensation, exactly-once, universal rollback, public/stable SDKs +and new language syntax remain outside scope. diff --git a/docs/contracts/graph-attempts/accounting.md b/docs/contracts/graph-attempts/accounting.md new file mode 100644 index 0000000..a801b55 --- /dev/null +++ b/docs/contracts/graph-attempts/accounting.md @@ -0,0 +1,81 @@ +# Explicit attempts and reservations (implementation contract) + +This is the opt-in implementation contract. The validation record distinguishes +focused proofs from the complete release gate. Existing static-policy runs retain +their original bytes and dispatch behavior. + +## Authority and units + +The anchored graph definition declares a maximum number of program dispatches. +Each program has one or two predeclared execution run identities. A logical node +remains the same DAG step across those instances. The child action attempt and its +effect attempts remain independent identities; neither is a reusable graph slot. + +A graph reservation holds one program-dispatch unit. `node_start_requested` +permanently consumes it before calling the installed host. Consumption describes +Dispatch's durable dispatch decision, not delivery, execution, mutation or success. +A lost callback reply cannot establish which of those later boundaries occurred. +The controller must not redeliver a consumed dispatch automatically. + +Available units equal the immutable ceiling minus held reservations minus consumed +dispatches. Released reservations remain in history but no longer hold capacity. +Read-only assessments, denied stale requests, branch activation and group receipts +consume no program unit. Subgraph members count individually, once per dispatch. +Inactive branches reserve and consume nothing. Evaluation terminal instances and +human decision requests are reported separately; they are not program dispatches. +Unknown runtime, token or monetary measurements remain unknown. + +## Mechanical transitions + +Reservation, release and retry use the existing graph lock and source-bound control +journal. Operator candidates bind current revision, journal, source state, anchored +workflow and installed authority. Apply revalidates after acquiring the lock and +records the actor. It does not start execution. Ordinary DAG advancement may reserve +and dispatch an eligible first attempt under its existing authority. + +Release requires the graph lock followed by the child lock. The child must still be +pending, have no admission claim or event, no execution/result, and no refusal or +terminal event. The graph must contain no dispatch for this reservation. A released +never-dispatched child may be reserved again; a dispatched child may never be refunded. + +Retry requires a sealed, independently reloaded pre-admission refusal. The initial +closed refusal reason is an installed resource-availability preflight rejection. +The dispatcher records it before creating an admission claim or invoking work. An +exception, missing reply or ordinary failed execution is not such a refusal. +A refusal seals that child permanently. A new predeclared child obtains its own +binding and admission; the prior refusal and all consumed dispatch units remain. + +The new child binds the exact logical inputs, predecessor terminals and policy +receipts used by the original attempt. Only consumer execution identity and explicit +retry lineage differ. A newer producer output cannot silently replace an old input. +No dependent dispatch/binding, activated branch or finalized group may already have +used the prior attempt's terminal decision. Retry cannot invalidate downstream truth. + +## Outcome and recovery + +An explicitly retryable failure with remaining attempt allowance remains blocked for +an operator choice. Budget availability supplies no effect-safety evidence. Exhausted +node allowance exposes the failure to existing outcome policy. Required unfinished +work at a graph ceiling remains blocked. Already consumed work may still complete, +and a graph with all required terminal facts may finalize with zero available units. +Held reservations prevent sealing the graph, including reservations for optional work. + +Graph finalization binds the exact accounting projection. Recovery folds durable +reservation, release, retry, dispatch and terminal events, validates their identities, +and compares the derived view. It does not infer missing dispatches, erase old +attempts, refund consumed units, decide retry safety or invent graph finalization. + +## Remaining boundaries + +Only retained trusted-host authority is covered. Ceiling extensions, post-admission +retries, evaluator retries, monetary/token accounting, elapsed-time enforcement, +dynamic topology, distributed workers, remote authentication, machine-loss recovery, +mixed profiles, compensation, exactly-once effects and universal rollback remain +outside this contract. RunLedger and Watchdog may report these facts; neither owns +a reservation, refund, retry or admission decision. + +The graph terminal decision references the exact internal ledger by SHA-256 over its +retained JSON bytes. The ledger is not serialized as one portable participant +commitment: a multi-node history legitimately exceeds that codec's 8 KiB bound. +The bound and all historical portable encodings remain unchanged. Only the compact +input-binding/v1alpha4 addition crosses the existing portable codec boundary. diff --git a/docs/contracts/graph-attempts/crash-matrix.md b/docs/contracts/graph-attempts/crash-matrix.md new file mode 100644 index 0000000..f551c8d --- /dev/null +++ b/docs/contracts/graph-attempts/crash-matrix.md @@ -0,0 +1,40 @@ +# Retained-host attempt accounting matrix + +The executable cases live in `tests/graph_attempt_recovery.mjs` and +`tests/graph_attempt_authority.mjs`. Controllers are fresh Kujo processes. Crash +cases terminate at actual publication/admission boundaries with SIGKILL; the orphan +cases interrupt the immutable-record/index boundary in an installed source copy. +The final validation record identifies the tested source and gate outcomes. + +| Boundary | Surviving durable fact | Fresh-controller action | Prohibited inference/action | +| --- | --- | --- | --- | +| Reservation before input binding | Held reservation; no dispatch, claim or work | Operator may release under graph/child locks | Invent execution or a consumed attempt | +| Binding before dispatch | Held reservation and exact child binding | Operator may release; direct child start rejects | Treat binding as admission | +| Dispatch before child loads | Permanently consumed dispatch | Report delivery/admission as unproven | Redeliver, refund or retry from silence | +| Child loads before admission | Same consumed dispatch and child identity | Reload and preserve uncertainty | Create another attempt because no reply arrived | +| Admission before work | Permanent child claim/admission, no work result | Preserve consumed identity; require evidence/review | Clear claim or release capacity | +| SQLite mutation before reply | Consumed node/effect admission and real sink row | Independent sink verification may resolve effect fact | Replay or refund the mutation | +| Terminal fact, derived graph view stale | Exact immutable terminal observation | Mechanical retained-host repair reconstructs accounting | Invent graph finalization or erase consumption | +| Reservation immutable record, index missing | Source-bound orphan reservation | Exact reconciliation appends missing index/projection | Pick an unrelated child or run it | +| Release immutable record, index missing | Source-bound orphan release | Exact reconciliation retains release history | Release any dispatched reservation | +| Retry immutable record, index missing | New declared child and prior-terminal lineage | Reconstruct reserved next attempt; do not run | Replace old refusal or reuse its identity | +| Child refusal immutable record, index missing | Exact dispatcher refusal before claim | Reconstruct sealed refusal | Admit the refused child | +| Child authority changes after reservation | Old held reservation and stale child revision | Reject dispatch/release under stale authority | Treat remaining units as current authority | +| Operator authority revoked during apply | Informational candidate only | Final revalidation rejects | Publish the stale candidate | + +Contention uses the existing locks and revision checks. Two independently loaded +controllers compete for the last graph unit, release, and the same retry/next-child +creation. Exactly one transition may publish. A rejected candidate, duplicate delivery +or read-only assessment consumes no additional unit. + +Successful node truth remains independent of graph policy. The safe retry chain +preserves B1's refusal and B2's own execution, effect admission, output, Eval and parent +finalization. A downstream C consumes B2's exact output. Branch activation consumes no +program unit; inactive repair work has no reservation. A group receipt adds no unit +on top of its member dispatches. Held optional work must be explicitly released before +cancellation and graph sealing. + +The recovery matrix assumes retained trusted local storage and valid immutable +history. Missing/conflicting authority, corrupt records and uncertain effects cannot +be repaired by an accounting refund. General machine recovery, remote trust, +distributed coordination, compensation and exactly-once effects remain unsolved. diff --git a/docs/contracts/graph-attempts/decision.md b/docs/contracts/graph-attempts/decision.md new file mode 100644 index 0000000..4e9390e --- /dev/null +++ b/docs/contracts/graph-attempts/decision.md @@ -0,0 +1,64 @@ +# Graph attempt accounting: pre-implementation crosswalk + +Audit starts at Dispatch `27a87ecbe05566578484dac970616a20d78b0ff3` and Kujo +`da35f5b3d673e1ddc5d7bcaabacf5fdfe5bd2b30`. Existing Kujo runtime edits are unrelated +and preserved; documentation/build work uses an isolated checkout of main. + +| Existing identity/fact | Meaning | Accounting role / gap | +| --- | --- | --- | +| Graph `run_id`, anchored workflow, revision, journal cursor | Existing Dispatch control authority | Own definitions, reservation/dispatch transitions and budget projection | +| Workflow step `id` | Logical DAG node | Remains B across retries; topology does not grow | +| `node_execution.run_id` plus child step/attempt subject | Independently controlled execution instance | Reuse distinct child run identities for B's bounded attempts; preserve each old run and its immutable parent/claim records | +| Child `control_attempt`, result `subject.attempt_id` | Attempt within a child action run | Remains separate from graph dispatch; do not relabel result bytes | +| Runner `run_with_retry` / `attempt_records` | In-process retry loop | Not the graph retry mechanism; graph-backed child runner remains max-attempts one | +| `node_start_requested` | Durable graph dispatch before callback | Existing conservative budget-consumption boundary; no refund after this point even if delivery/admission is unknown | +| `node_inputs_bound` | Exact child input commitment | New child can bind the same logical inputs with its own consumer identity; producer/output/policy references must remain equal | +| Permanent node-input `.claim`, `node_execution_admitted` | One-use execution admission | Consumption cannot be erased, refunded or reused; absence of reply is not failure-before-admission | +| Effect selection ID / effect attempt ID / admission claim | Independently gated external mutation | Never inherited by another graph attempt; uncertainty blocks retry regardless of graph budget | +| `execution_result`, parent finalization | Execution knowledge and distinct terminal authority | Successful graph attempt still requires effects, outputs, evaluation and parent finalization | +| Eval subject/input IDs and local terminal receipt | Evaluation/decision instance | Count/report separately from executable dispatches; no automatic evaluator retry added | +| Human request/decision revision | Authorized decision instance | Not a program execution unit; no conversion to fake execution result | +| Branch activation | Durable path policy | Consumes no execution unit; inactive nodes reserve nothing | +| Subgraph terminal receipt | Group policy conclusion over member facts | No extra execution unit; count each executed member attempt once | + +## Bounded extension + +An opt-in accounting contract uses the existing graph lock, journal and immutable +record machinery. Reservation precedes child binding/dispatch. Availability is limit +minus held reservations minus consumed dispatches, derived from the event history. +Release is permitted only before dispatch, with child lock and exact absence of +admission/claim/execution. Released reservation history remains. A fresh reservation +may target the same never-dispatched execution instance; it is a new reservation, +not an unconsumed attempt restored from consumed work. + +A logical program node may declare up to two predeclared child run identities. They +are execution instances, not graph nodes. Each child has ordinary independent +configuration, capability/admission, result and finalization. Retry creation is an +explicit authorized graph transition with lineage, immutable input equivalence, +current authority and ceiling checks. The old child remains sealed. No dynamic +child factory, topology callback, scheduler, retry queue or backoff is introduced. + +The initial safe retry proof is an installed preflight refusal, recorded under the +child lock before creating its node admission claim or invoking execution. The child +is terminally refused and can never later admit. This is an admission fact, not an +invented execution-result or parent success. A bounded program-attempt terminal +contract wraps either that exact refusal or ordinary independent parent finalization. +Any admitted/claimed child without conclusive ordinary finalization is ineligible; +unknown effects, stale authority/evidence and reply loss cannot use the refusal path. +Remaining retry count never supplies safety evidence. + +Failure strategy remains explicit: declared same-node retry keeps a safe failed +attempt blocked for an authorized new attempt while capacity remains; exhaustion +permits ordinary terminal failure policy. Existing route/block/review policies remain +separate. A graph terminal decision binds exact attempt/reservation history and budget. +No accounting repair infers a missing attempt, dispatch, refusal or terminal event. + +## Ownership and deliberate exclusions + +RunLedger README describes correlated receipts/reporting, not authoritative Dispatch +attempts. Watchdog telemetry observes attempt chains/durations, not admission. Existing +content-addressed artifacts and control events are sufficient; no integration or +repository change is needed merely to mirror accounting. Reports can consume exact +Dispatch references later. No monetary, token or elapsed-time inference is introduced. +Ceiling extensions, evaluator retries and general retry engines remain outside this +bounded executable-attempt contract; no mutable workflow edit may raise a limit. diff --git a/docs/contracts/graph-attempts/operator.md b/docs/contracts/graph-attempts/operator.md new file mode 100644 index 0000000..a252e01 --- /dev/null +++ b/docs/contracts/graph-attempts/operator.md @@ -0,0 +1,53 @@ +# Operator workflow and authority + +The bounded installed API extends `graph_policy_operation` with `kind: "attempt"`, +`id: `, and `action: "reserve" | "release" | "retry"`. +`operation: "assess"` returns an informational, revision-bound candidate. +`operation: "apply"` requires that exact candidate and an actor accepted by the +installed `authorize_graph` mechanism. A successful apply returns +`continuation: "not_authorized"`. Normal DAG advancement is a separate operation. +There is no force mode and no increase-budget operation. + +| Fact or transition | Information producer | Validator / authority | Durable prerequisite | +| --- | --- | --- | --- | +| Logical node and ceilings | Host workflow author | Dispatch anchored definition | Negotiation and original workflow digest | +| Input identity | Producer and installed artifact reader | Existing Dispatch input validator | Producer terminal, exact artifact/schema/digest and predecessor receipts | +| Reservation | Dispatch runner or authorized operator | Existing graph run lock | Source-bound control record before child dispatch | +| Dispatch consumption | Existing DAG runner | Dispatch graph journal | Held reservation, exact selected child and binding | +| Preflight resource fact | Installed trusted host | Dispatch child admission path | Current authority and exact input binding | +| Pre-admission refusal | Dispatch only | Child lock, absence of claim | Immutable refusal before any admission or execution | +| Node admission | Dispatch child runner | Existing permanent claim primitive | Own input binding and current child authority | +| Effect admission | Existing effect lifecycle | Dispatch, independently of graph budget | Own selection, evidence, exact authority and one-use claim | +| Release | Authorized operator | Graph lock, then child lock | No dispatch, claim, execution, result or uncertainty | +| Retry | Authorized operator under anchored strategy | Dispatch | Exact sealed refusal, unused declared child, same inputs, unconsumed allowance | +| Terminal observation | Responsible terminal subsystem | Dispatch node validator | Independent parent finalization or exact refusal | +| Graph finalization | Operator plus graph policy | Dispatch graph lock | Exact node facts and accounting history; no held reservation | +| Recovery | Operator-selected mechanical plan | Existing retained-host reconciliation | Valid immutable records, journal continuity and integrity | +| Reporting | Dispatch, RunLedger or Watchdog reader | No continuation authority | References to the above facts | + +The API deliberately has no participant-facing reservation or refund request. Neither +an SDK `retryable` flag nor an agent's assertion of failure proves that admission was +never consumed. A resource preflight refusal is recorded by Dispatch at its own +boundary. If the process disappears before that record, absence of a reply remains +unknown and cannot be turned into a refusal. + +The portable addition is input-binding/v1alpha4: the existing exact binding plus an +attempt ordinal and prior-terminal reference. It retains the original logical graph +node while changing the consumer execution run. Alpha1/2/3 inputs, existing terminal +receipts and old participant commitments remain historical. Accounting records remain +Dispatch-internal; this does not create a public participant accounting API. + +`kind: "accounting", operation: "assess"` returns a versioned informational report +with budget, reservation history, current child admission/work readback, exact +terminal references, and separate evaluation/decision instances. A readback failure +is `unknown`. `result_recorded` is not proof of effect completion. Multiple released +reservations can refer to one still-never-dispatched execution identity; the ledger +retains them without charging duplicate execution attempts. There are at most sixteen +reservation records per logical node in this bounded storage contract. + +Program-attempt terminals use additive `dispatch.node-terminal/v1alpha2` with the +same universal fields and the closed `program-attempt/v1alpha1` contract. Existing +program, Eval and human terminal alpha1 bytes/schemas are unchanged. Input alpha4 +accepts either historical alpha1 terminals or this new wrapper. A downstream held +reservation or immutable child binding prevents retiring its producer attempt; +releasing capacity does not erase already-bound provenance. diff --git a/docs/contracts/graph-attempts/requirements.md b/docs/contracts/graph-attempts/requirements.md new file mode 100644 index 0000000..936b40b --- /dev/null +++ b/docs/contracts/graph-attempts/requirements.md @@ -0,0 +1,33 @@ +# Objective-to-proof crosswalk + +This maps the requested tranche to implemented mechanisms and executable assertions. +A row names coverage, not a standalone release claim; the complete validation result +is `docs/evidence/graph-attempt-accounting/validation.json`. + +| Objective parts | Mechanism / disposition | Authoritative proof | +| --- | --- | --- | +| First step, 1, 28, 29: identity and history | Existing logical node, independent child run/action/effect IDs; append-only attempt lineage; program-specific refusal or ordinary parent terminal | `decision.md`; `graph_attempt_integration.mjs` full A/B1/B2/C history; contract tests | +| 2–5, 18: reserve, consume, count | Existing run lock and journal; reserve before binding; durable dispatch consumes permanently; denied/read-only operations add no unit | `graph_attempt_smoke.mjs`; `graph_attempt_contract_tests.kujo`; recovery last-unit race | +| 6: node ceiling | Anchored maximum one or two child runs; static graph ceiling unchanged | Integration two-refusal/third-attempt denial; contract bound rejection; existing static policy mutation assertions | +| 7–11: safe retry and exact inputs | Explicit operator transition only after sealed Dispatch pre-admission refusal; fresh child and exact producer/predecessor/policy bindings | Integration full chain and stale artifact; authority ordinary execution failure rejection; binding-safety descendant reservation/binding assertions | +| 12: release | Graph then child lock; no dispatch/claim/result/refusal/running work; retained binding supplies no admission | Recovery reservation and bound-before-dispatch release; authority configuration/revocation; release contention | +| 13 A–F: crashes | Reservation, dispatch-before-load, load-before-admission, consumed admission, real mutation reply loss, retained terminal with stale projection | `graph_attempt_recovery.mjs` named crash assertions; SIGKILL and real SQLite readback | +| 14: competing controllers | Existing persisted run locks and revision-bound candidates | Recovery fresh-process last-unit, release, retry and next-attempt races; one successful transition | +| 15–17: group/branch/heterogeneous accounting | Member program dispatches count once; inactive nodes/activation/group receipts count zero; Eval/human instances separate | `graph_attempt_policy.mjs` branch, group plus human, optional reservation; accounting report fields | +| 19: reconstruct accounting | Existing retained-host inventory and mechanical reconciliation; immutable lineage and journal-derived projection | Recovery orphan reserve/release/retry/refusal and terminal-record/index gap; no execution/refund/finalization | +| 20, 30: graph outcome | Exhaustion blocks pending required work, not already consumed resolution; held reservation prevents sealing; terminal decision binds ledger digest | Integration budget exhaustion and all-complete zero availability; policy held optional reservation; contract outcome tests | +| 21: budget extension | Deliberately deferred; existing immutable ceilings cannot be raised | Decision/accounting docs; existing static policy immutable-budget tests | +| 22: resource types | Implement only sourced program-dispatch count; separate Eval/decision instances; unknown readback remains unknown | `graph_policy_operation.kujo` accounting report; smoke report assertions; operator contract | +| 23: RunLedger/Watchdog | Reviewed ownership; no authority integration or unrelated repo changes | `decision.md` ownership review; reporting/observation remains external | +| 24: portable additions | Input alpha4 and program-attempt terminal alpha2; old bytes untouched | Four vectors in `tests/vectors/graph-attempts.json`; independent Kujo/TS/Python/Go checks in canonical gate | +| 25–26: exclusions | No automatic general retries, queues/backoff or invented pricing | Explicit assess/apply operator API; sealed-refusal-only retry; accounting contract exclusions | +| 27: explanation | Informational versioned report with exact references, per-attempt state and remaining units | Operator docs; smoke report assertions; graph outcome explanations remain separate authority | +| 31 A–E: proof shapes | A/B1/B2/C, uncertain real mutation, last-slot contention, Eval branch, subgraph members | Integration, recovery and policy suites named above | +| 32: validation | Baseline before edits, focused suites, full Dispatch canonical, Kujo format/docs/contracts/locked build; related repos unchanged | Retained baseline/focused/development logs and final validation manifest; explicit skips and environment interruption | +| 33: documentation | Crosswalk, accounting/retry contract, operator authority, crash matrix, outcome interaction, remaining boundaries | Files in this directory; Dispatch audit; Kujo roadmap, next-phase architecture and Wave F accounting note | + +The sole retryable failure class is the implemented Dispatch-owned refusal before node +admission. General execution failure, unknown effects and consumed acknowledgement loss +are not promoted into that class. This is the bounded safe retry proof requested by +this tranche, not general failure recovery. Optional budget extension and time/cost +categories are deferred rather than simulated. No second scheduler is introduced. diff --git a/docs/contracts/graph-attempts/validation-plan.md b/docs/contracts/graph-attempts/validation-plan.md new file mode 100644 index 0000000..56a3879 --- /dev/null +++ b/docs/contracts/graph-attempts/validation-plan.md @@ -0,0 +1,71 @@ +# Attempt-accounting proof plan + +This is a pre-implementation checklist, not evidence of completion. The final audit +must replace planned coverage with exact commands, counts and retained results. + +| Requirement | Planned proof | +| --- | --- | +| Distinct attempt identities and terminal facts | A → B refused execution instance 1 → explicitly reserved instance 2 → independent parent finalization → C; old child and claim history retained | +| Reservation before dispatch | Crash at durable reservation; fresh report shows held one / consumed zero / admission absent; explicit release restores availability | +| Consumption boundary | Dispatch event consumes one permanently, including preflight refusal; stale/duplicate/read-only requests consume zero | +| Node ceiling | Two refusals consume two independent dispatches; third retry rejects before binding/execution | +| Same immutable input policy | Second child binds original producer/result/output/policy references; changed source bytes, subject, authority or new output cannot silently replace them | +| Unsafe retry | Real selected SQLite effect mutation and lost reply; report remains consumed/uncertain; release/retry reject; independent verification alone resolves effect fact | +| Existing failure strategies | Retry is a declared strategy, not a count heuristic; graph blocked while retry is due, terminal failure only when explicit policy/ceiling permits | +| Dispatch/child load crash | Durable dispatch before child load and child load before admission both retain identity and consumed unit; no automatic redelivery/refund | +| Consumed admission crash | Before mutation: permanent claim retained; no retry despite available graph units | +| Derived accounting stale | Actual immutable event/index gap and journal/state gap; operator reconciliation rebuilds exact projection, no invented event/refund | +| Contention | Two independent fresh processes for last graph slot, release, same-node retry/next attempt; exact single transition under existing lock | +| Branch accounting | Eval activation consumes no program unit; inactive path reserves/consumes zero; selected child remains independently admitted | +| Subgraph accounting | Count each member dispatch once; group terminal receipt adds zero program units; parent binds receipt | +| Heterogeneous units | Eval result/decision and human requests reported as separate instances, not executable attempts or invented token/cost measurements | +| Outcome and budget | Required pending work blocks at exhaustion; complete work still finalizes; unresolved consumed work cannot be reclaimed | +| Portable compatibility | Additive input-binding commitment, independent four-language vectors, unchanged historical alpha/beta/participant/parent bytes | +| Gate closure | Fresh focused baseline before source edits; new focused suites then complete Dispatch canonical; isolated Kujo docs/format/contracts/locked build | + +Safety preconditions are validated under the graph lock, then child lock where needed. +A release cannot race a legal dispatch because the same graph lock serializes both. +A refusal is published before the child admission claim and seals the child run. +Only Dispatch can produce this admission fact; a participant-supplied refusal file +or retryable flag is not evidence. Neither branch nor group policy can waive it. + +## Development corrections to retain in final evidence + +- Initial recovery artifact inventory edit missed one closing brace; parser rejected + fixture initialization. Corrected before the successful smoke/recovery proofs. +- First Go/TypeScript/Python run found the isolated checkout's missing TypeScript + build output. Built with its pinned local compiler and reran successfully. +- A full A → refused B1 → B2 → C lifecycle reached independent finalization, then + graph assessment rejected `commitment_bound`: the full internal ledger exceeded + portable-json's 8 KiB bound. Kept that bound unchanged and used an exact retained + internal JSON digest. The concurrent development policy run was explicitly stopped + before changing its installed source, after one passing branch check; a complete + rerun follows. No partial run is counted as a canonical pass. +- A changed child configuration initially failed at child admission after graph + dispatch had already consumed a unit. Added a distinct exact-authority inspection + before dispatch. Full execution admission still validates exact inputs and a durable + dispatch. The distinction also permits safe release after input binding but before + dispatch; a surviving binding alone never grants execution. The focused source + inventory now includes the changed assurance-configuration module in place of the + unchanged state module, retaining the existing sixteen-file manifest bound. +- Final review reproduced a downstream provenance gap: a retry candidate could miss + an undispatched program's immutable input binding. The guard now checks both held + descendant reservations and child bindings under the graph lock. Releasing the + reservation does not erase the binding. A fresh-controller regression proves both. +- Schema review found that the prior terminal schema's closed variants could not + describe the new program-attempt wrapper. Added node-terminal/v1alpha2 for that + variant and allowed it only in additive input-binding/v1alpha4. Historical terminal + and binding schemas remain unchanged. New vectors cover refusal and a downstream + consumer of a successful retry; the real chain validates its actual binding schema. + +- The first full canonical run reached the new real-chain schema assertion and + rejected the test harness default AJV validator because the schema declares Draft + 2020-12. Selected the installed Draft 2020-12 validator explicitly; schema checking + remains enabled. The failed canonical transcript is retained before the full rerun. + +- The post-restart canonical run found a real legacy compatibility regression: + accounting history inspection assumed every retained state carried a workflow + definition. Historical observation-only effect-set journals do not. The opt-in + detector/history view now treats a missing definition as non-accounting, while + rejecting accounting events or unexplained ledger rows. Added three contract + assertions and reran the real historical effect-set crash/renewal suite. diff --git a/docs/evidence/graph-attempt-accounting/README.md b/docs/evidence/graph-attempt-accounting/README.md new file mode 100644 index 0000000..3e02f96 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/README.md @@ -0,0 +1,10 @@ +# Graph attempt validation evidence + +Baseline, focused and development transcripts were retained before a host restart. +`source-artifacts.json` is the historical manifest of their temporary source files; +some originals no longer exist after `/tmp` cleanup. It is not proof that those paths +remain available. The combined transcripts here survive. `environment-interruption.txt` +records the interrupted gate. Final validation and hashes are published in `validation.json`: the complete rerun +passed on 2026-10-01. No partial gate is counted. The failed legacy effect-set run is +retained in `failed-canonical-effect-set.txt`; its correction is in +`legacy-correction.txt`. diff --git a/docs/evidence/graph-attempt-accounting/baseline.txt b/docs/evidence/graph-attempt-accounting/baseline.txt new file mode 100644 index 0000000..6649b9b --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/baseline.txt @@ -0,0 +1,107 @@ +===== baseline-contracts.log ===== +{"checks":14,"ok":true} +{"checks":10,"ok":true} +{"checks":12,"ok":true} + +============================================================ +Test Results +============================================================ + ✓ submitted idempotency key does not authorize replay (266ms) + ✓ observed unknown partial effects override a pure configuration (332ms) + ✓ sink enforced idempotency needs an evidence reference (261ms) + ✓ destroyed workspace cannot be retried in place (334ms) + ✓ retained filesystem permits a declared same workspace adapter (486ms) + ✓ an evaluator decision cannot target an unrelated action (335ms) + ✓ terminal states reject continuation (697ms) + ✓ evaluation crash is indeterminate rather than failed quality (465ms) + ✓ negative checks and unknown contract versions fail closed (340ms) + ✓ policy outcome is producer neutral and deterministic (1374ms) + ✓ evidence cannot promote itself to policy authority (476ms) + ✓ journal detects orphan append and tampered history (416ms) + ✓ expired preservation cannot authorize same workspace replay (282ms) + ✓ null idempotency metadata is not enforcement evidence (258ms) + ✓ continuation source cannot contradict its action (648ms) + ✓ tampered control history is detected even when JSON is valid (398ms) + ✓ an atomic event beyond an absent journal requires recovery (231ms) + ✓ review requests explain unavailable replay without granting new actions (798ms) + ✓ policy action availability work is bounded and duplicate actions reject (1031ms) + ✓ compensation metadata does not prove external reversal or admit replay (495ms) + +Tests: 20 total, 20 passed, 0 failed +Time: 10572ms +============================================================ + +All tests passed! ✨ + +============================================================ +Test Results +============================================================ + ✓ checkpoint publication is immutable repeatable and leaves authority unchanged (5959ms) + ✓ missing or altered checkpoint bytes never authorize continuation (4783ms) + ✓ checkpoint refuses changed revision or in-flight work (7567ms) + ✓ orphan and torn journal prohibit checkpoint publication (8479ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 27105ms +============================================================ + +All tests passed! ✨ + + +===== baseline-effects.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/effect-continuation-EHEXwe","checks":39,"proofs":["valid-prefix-only-C","repeat-denied","D-denied","parent-replay-denied","cannot-select-A","cannot-select-B","cannot-select-D","unknown-prefix-blocks","A-no-phantom","B-same-attempt","after_admission-no-replay","after_mutation-no-replay","after_observation-no-replay","two-fresh-controllers-one-admission","stale-registration","stale-plan","stale-target","stale-authority","stale-config","stale-revocation","stale-environment","stale-environment-ref","stale-set","stale-preservation","state-revision","state-journal","state-selected-state","state-attempt","state-control","state-preservation","state-selection-removal","final-revalidation-status","final-revalidation-environment","actual-evidence-expiry","expiry-after-admission","orphan-claim-denies","retained-evidence-required","sqlite-authority-over-json-mirror","actual-baseline-reader-refuses-new-state"]} +{"ok":true,"roots":["/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-y8U1sw","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-pZgF26"],"checks":80,"proofs":["sqlite-independent-C-D-lifecycles","sqlite-expiry-explicit-rebind-same-attempt","sqlite-cancel-retained-replacement-explicit","sqlite-after_admission-never-replay","sqlite-after_mutation-never-replay","sqlite-after_observation-never-replay","sqlite-race-cancel-cancel","sqlite-race-cancel-admit","sqlite-race-rebind-cancel","sqlite-race-rebind-rebind","sqlite-race-rebind-admit","sqlite-crash-before_rebind","sqlite-crash-after_rebind","sqlite-crash-before_cancel","sqlite-crash-after_cancel","sqlite-crash-before_selection","sqlite-crash-after_selection","sqlite-invalid-registration","sqlite-invalid-plan","sqlite-invalid-target","sqlite-invalid-authority","sqlite-invalid-configuration","sqlite-invalid-environment","sqlite-invalid-preservation","sqlite-final-revalidation","sqlite-expiry-after-rebind","sqlite-live-prefix-uncertainty-blocks","sqlite-orphan-claim-blocks","sqlite-pre-C-cursor-cannot-select-D","sqlite-retained-evidence-required","sqlite-expire-after-admission","sqlite-registration-after-admission","sqlite-state-revision","sqlite-state-journal","sqlite-state-allowed-actions","sqlite-state-effect-state","sqlite-state-parent-attempt","sqlite-parent-replay-denied","actual-old-reader-refuses-lifecycle","sqlite-authority-over-json-mirror","sqlite-two-fresh-controllers-one-admission","git-independent-C-D-lifecycles","git-expiry-explicit-rebind-same-attempt","git-cancel-retained-replacement-explicit","git-after_admission-never-replay","git-after_mutation-never-replay","git-after_observation-never-replay","git-race-cancel-cancel","git-race-cancel-admit","git-race-rebind-cancel","git-race-rebind-rebind","git-race-rebind-admit","git-crash-before_rebind","git-crash-after_rebind","git-crash-before_cancel","git-crash-after_cancel","git-crash-before_selection","git-crash-after_selection","git-invalid-registration","git-invalid-plan","git-invalid-target","git-invalid-authority","git-invalid-configuration","git-invalid-environment","git-invalid-preservation","git-final-revalidation","git-expiry-after-rebind","git-live-prefix-uncertainty-blocks","git-orphan-claim-blocks","git-pre-C-cursor-cannot-select-D","git-retained-evidence-required","git-expire-after-admission","git-registration-after-admission","git-state-revision","git-state-journal","git-state-allowed-actions","git-state-effect-state","git-state-parent-attempt","git-parent-replay-denied","git-two-fresh-controllers-one-admission"]} + + +===== baseline-graph.log ===== +PASS failed entry permits graph failure without inventing unentered group completion +{"ok":true,"checks":2,"scenarios":["failed entry without group completion","closed terminal outcome predicate"]} +PASS human abort retains decision semantics under graph policy +PASS human cancel retains decision semantics under graph policy +PASS optional Eval failure stays failed but does not fail required-success graph +PASS Eval fail mapped to review remains blocked, not automatically terminal failure +PASS unfinalized execution failure cannot become success or admit dependent +PASS consumer uncertainty leaves successful producer history unchanged +PASS optional cancellation cannot satisfy a success scheduling dependency +{"ok":true,"checks":7} +PASS needs-changes evaluation blocks producer dependency +PASS producer tool permission is not inherited by consumer +PASS ordinary cancellation blocks consumer +PASS failed terminal follows existing Eval policy and cannot satisfy dependency +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-cJm7E8","checks":4,"scenarios":["needs-changes evaluation blocks producer dependency","producer tool permission is not inherited by consumer","ordinary cancellation blocks consumer","failed terminal follows existing Eval policy and cannot satisfy dependency"]} + + +===== baseline-recovery.log ===== +{"passed":29,"proofs":["sqlite-stale-state-consumption","git-stale-state-consumption","orphan-control","exact-duplicate","cancel-tail","rebind-tail","torn","conflict","hash","ahead","missing-claim","lifecycle-orphan","stale-plan","revoked","expired","missing-workspace","sigkill-after_admission","sigkill-after_mutation","sigkill-after_observation","fresh-operator-contention","native-write-sigkill-effect_lifecycle_recorded","native-write-sigkill-retained_host_reconciled","native-write-sigkill-claim-consumption","real-workcell-retention-not-admission","real-workcell-preservation-expired-during-outage","real-workcell-workspace-missing","corrupt-materialization-checkpoint-rejected","workcell-git-changed-target","sqlite-authoritative-row-over-corrupt-mirror"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-recKFV"} +PASS pending effects block parent +PASS cancelled required selection is not completion +PASS unresolved operator review blocks +PASS real Workcell refs and original bytes preserved +PASS stale authority +PASS changed registration +PASS wrong environment +PASS operator authorization revoked +PASS stale evaluation +PASS wrong evaluation subject +PASS missing/replaced output.txt +PASS missing/replaced output-evidence.json +PASS missing/replaced workcell/receipt.json +PASS retained workspace missing +PASS changed retained Git HEAD +PASS stale run revision +PASS new unresolved child +PASS expired preservation +PASS independent sink uncertainty blocks +PASS legitimate new assessment invalidates candidate +PASS generic approved review cannot bypass finalization +PASS separate finalization without effect replay +PASS Eval fail maps through existing policy +PASS SIGKILL before decision remains nonterminal +PASS SIGKILL after terminal reply loss is final +PASS two independently assessed fresh controllers one durable finalization +PASS producer success still requires parent finalization +PASS anchored required descendant blocks terminal transition +PASS mutable optional flag cannot waive anchored required child +PASS live authority revoked inside finalization boundary +PASS orphan durable finalization recovered by fresh controllers +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/parent-finalization-M804JJ","checks":31,"proofs":["pending effects block parent","cancelled required selection is not completion","unresolved operator review blocks","real Workcell refs and original bytes preserved","stale authority","changed registration","wrong environment","operator authorization revoked","stale evaluation","wrong evaluation subject","missing/replaced output.txt","missing/replaced output-evidence.json","missing/replaced workcell/receipt.json","retained workspace missing","changed retained Git HEAD","stale run revision","new unresolved child","expired preservation","independent sink uncertainty blocks","legitimate new assessment invalidates candidate","generic approved review cannot bypass finalization","separate finalization without effect replay","Eval fail maps through existing policy","SIGKILL before decision remains nonterminal","SIGKILL after terminal reply loss is final","two independently assessed fresh controllers one durable finalization","producer success still requires parent finalization","anchored required descendant blocks terminal transition","mutable optional flag cannot waive anchored required child","live authority revoked inside finalization boundary","orphan durable finalization recovered by fresh controllers"]} diff --git a/docs/evidence/graph-attempt-accounting/canonical-suites.txt b/docs/evidence/graph-attempt-accounting/canonical-suites.txt new file mode 100644 index 0000000..7af8bb6 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/canonical-suites.txt @@ -0,0 +1,1267 @@ +===== ability_assurance.log ===== +check passed: examples/application-assurance/gateway.kujo +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/ability/tests/tmp/application-assurance-1790827637574","proof":[{"boundary":"before_business","businessBefore":0,"businessAfter":1,"receiptBefore":false},{"boundary":"before_business_commit","businessBefore":0,"businessAfter":1,"receiptBefore":false},{"boundary":"after_business_commit","businessBefore":1,"businessAfter":1,"receiptBefore":false},{"boundary":"before_receipt_commit","businessBefore":1,"businessAfter":1,"receiptBefore":false},{"boundary":"after_receipt_commit","businessBefore":1,"businessAfter":1,"receiptBefore":true},{"boundary":"before_reply","businessBefore":1,"businessAfter":1,"receiptBefore":true},{"contenders":6,"admitted":1,"replayed":0,"in_progress":5,"business":1},{"delayedAdmission":"revoked","business":0,"receipt":0},{"delayedAdmission":"expired","business":0,"receipt":0},{"fencedOldOwner":true,"business":1}],"commitFailed":"ability_idempotency_commit_failed","privacy":true} +{"dispatchProof":[{"scenario":"absent","code":"REPLAY_COMPLETED","business":1},{"scenario":"commit-failed","code":"REPLAY_COMPLETED","business":1},{"scenario":"complete","code":"REPLAY_COMPLETED","business":1},{"scenario":"revoked","code":"ability_assurance_revoked","business":0},{"scenario":"expired","code":"assurance_expired_or_future","business":0},{"scenario":"corrupt","code":"ability_business_receipt_mismatch","business":0},{"scenario":"unavailable","code":"ability_business_effect_unverified","business":null},{"controllers":2,"admitted":1,"rejected":1},{"scenario":"controller-contention","code":"REPLAY_COMPLETED","business":1}],"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/ability/tests/tmp/application-assurance-1790827637574"} + + +===== assurance_capabilities.log ===== +PASS advisory capability schema: bounded, closed, three profiles, no executable authority + + +===== assurance_compatibility.log ===== +PASS compatibility: 60 legacy comparisons and required downgrade rejection + + +===== beta_contracts.log ===== +PASS beta policy/feature/configuration isolation and portable value bounds + + +===== beta_migration.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/beta-migration-1790827458827","proofs":[{"family":"sqlite","scenario":"alpha","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"be16c418bddd0365778382f2d3dba31fb8b06aea48640fab16af9e02f55f5c37"},{"family":"sqlite","scenario":"beta","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"fa8be370df131d342eea8ddc857b27e8e4753ce2e48145979cd9515aebe8b5a4"},{"family":"sqlite","scenario":"alpha-in-beta","portable_identity_checks":0,"denied":"beta_unsupported_envelope","result_bytes_unchanged":true},{"family":"sqlite","scenario":"beta-in-alpha","portable_identity_checks":0,"denied":"compat_envelope_unsupported","result_bytes_unchanged":true},{"family":"git","scenario":"alpha","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"f31632918011e780cfccc74e270a8060fe61e5d18cf4ae97625ddb640d548714"},{"family":"git","scenario":"beta","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"d90c7dfcd845db1704fa96a11f46aa7198c80af36cbe714c333c275a5b006e5e"},{"family":"git","scenario":"alpha-in-beta","portable_identity_checks":0,"denied":"beta_unsupported_envelope","result_bytes_unchanged":true},{"family":"git","scenario":"beta-in-alpha","portable_identity_checks":0,"denied":"compat_envelope_unsupported","result_bytes_unchanged":true},{"family":"ability","scenario":"alpha","portable_identity_checks":2,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"c20fff9d92046a3781f8df68b1994030c0cc0c25841ec4f2a92e3c92b0f39f75"},{"family":"ability","scenario":"beta","portable_identity_checks":2,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"160425d3d4b7a4216e3d3559cbaacb85be77a3bcaa3636d66aa18254f834869b"},{"family":"ability","scenario":"alpha-in-beta","portable_identity_checks":2,"denied":"beta_unsupported_envelope","result_bytes_unchanged":true},{"family":"ability","scenario":"beta-in-alpha","portable_identity_checks":2,"denied":"compat_envelope_unsupported","result_bytes_unchanged":true}],"privacy":true} + + +===== control_boundary.log ===== + +============================================================ +Test Results +============================================================ + ✓ evaluation failure can pause at a durable review boundary (1548ms) + ✓ evaluation failure can fail the workflow without failing the action (1105ms) + ✓ evaluation warning can continue (1758ms) + ✓ descendant boundary drains an unrelated DAG branch before pausing (2415ms) + ✓ evaluation result cannot issue an orchestration action (201ms) + ✓ portable evaluation result resolves through workflow policy (237ms) + ✓ provider preservation and reexecution contracts cross policy without coupling (1564ms) + ✓ revision-bound intervention resumes without rerunning the producer (221ms) + ✓ retry evaluation creates an explicit new pending attempt (219ms) + ✓ stale intervention decision is rejected (206ms) + ✓ unsafe retry is rejected without an idempotency contract (221ms) + ✓ retry clean refuses to emulate a provider snapshot (215ms) + ✓ retry clean prepares a fresh provider-backed attempt (233ms) + ✓ retry clean still rejects unsafe external effects (209ms) + +Tests: 14 total, 14 passed, 0 failed +Time: 10773ms +============================================================ + +All tests passed! ✨ + + +===== decision_claim.log ===== +Decision claims: concurrent duplicate applied once; conflicting payload rejected. + + +===== dispatch-1.log ===== + +============================================================ +Test Results +============================================================ + ✓ workflow creation includes required sections (293ms) + ✓ state persistence saves and reloads run (565ms) + ✓ dispatch blocks unsafe config paths without opt in (568ms) + ✓ dispatch unknown command prints usage snapshot (537ms) + ✓ invalid step output is not committed to the idempotency cache (854ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 2959ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-10.log ===== + +============================================================ +Test Results +============================================================ + ✓ tool registry rejects invalid sources directories (251ms) + ✓ plugin registration injects custom tool and agent (344ms) + ✓ high volume run index listing remains deterministic (13142ms) + ✓ native atomic file writes content and leaves no temp residue (276ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 14135ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-11.log ===== + +============================================================ +Test Results +============================================================ + ✓ retry behavior succeeds after transient failures (257ms) + ✓ runner executes workflow and writes final report (17297ms) + ✓ trace truncation preserves limits and summary metadata (270ms) + ✓ signed bundle supports key id rotation via a trusted key set (1410ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 19355ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-12.log ===== + +============================================================ +Test Results +============================================================ + ✓ retry delay supports deterministic jitter (226ms) + ✓ report payload and markdown include lifecycle metadata (16835ms) + ✓ dispatch runs json exposes filtered and page catalogs (3336ms) + ✓ idempotency key reuses cached output instead of re-executing (1038ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 21561ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-13.log ===== + +============================================================ +Test Results +============================================================ + ✓ approval decision handling supports approve reject and pause (239ms) + ✓ run listing filters and catalog support automation workflows (1437ms) + ✓ workflow config file supports parsing and cli override precedence (20272ms) + ✓ dispatch blocks unsafe webhook sink paths and supports cancel-after-step (4482ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 26574ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-14.log ===== + +============================================================ +Test Results +============================================================ + ✓ approval rejects invalid simulated decision values (233ms) + ✓ cleanup command supports dry-run and apply pruning (1980ms) + ✓ tool policy parsing and enforcement supports allow deny normalization (199ms) + ✓ crud reliability report includes purpose-built reliability sections (238ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2773ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-15.log ===== + +============================================================ +Test Results +============================================================ + ✓ decision normalization matrix supports shared CLI and approval logic (232ms) + ✓ run pagination handles larger catalogs (6174ms) + ✓ policy profile aliases resolve and explicit lists override profile defaults (221ms) + ✓ declarative workflow loader validates and builds workflows from a spec (315ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 7067ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-16.log ===== + +============================================================ +Test Results +============================================================ + ✓ cli args parser handles flags and positionals with schema (227ms) + ✓ dependency scheduling supports parallel-ready DAG steps (2132ms) + ✓ policy profile aliases work via config and cli override (17169ms) + ✓ built-in sample plugin injects a tool and agent handler and observes events (2174ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 21823ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-17.log ===== + +============================================================ +Test Results +============================================================ + ✓ cli args parser returns missing value and unknown flag errors (236ms) + ✓ summarize run reports artifact availability (16692ms) + ✓ dispatch runs supports workflow filter (1992ms) + ✓ engine invokes a registered event hook for lifecycle events (17542ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 36585ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-18.log ===== + +============================================================ +Test Results +============================================================ + ✓ cli args parser enforces required flags (227ms) + ✓ request changes pause can be resumed to completion (19706ms) + ✓ show inspect and doctor json envelopes are consistent (2410ms) + ✓ newly created run is registered in the catalog index while running (622ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 23101ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-19.log ===== + +============================================================ +Test Results +============================================================ + ✓ step schema validation enforces input and output contracts (2465ms) + ✓ rejected approval ends workflow with failure (11663ms) + ✓ dispatch run tags persist and runs supports tags filter (2050ms) + ✓ dispatch CLI supports structured input, workflow-file, and plugin flags (33419ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 49744ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-2.log ===== + +============================================================ +Test Results +============================================================ + ✓ workflow template selection supports known and unknown IDs (378ms) + ✓ run locks are process-owned and remain on disk for crash recovery (546ms) + ✓ dispatch blocks oversized config files (6790ms) + ✓ long run stress fixture keeps traces bounded (29279ms) + ✓ final report metadata reflects the completed run (16648ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 53805ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-20.log ===== + +============================================================ +Test Results +============================================================ + ✓ step timeout and cancellation handling update run lifecycle (1622ms) + ✓ persisted artifacts redact sensitive values (887ms) + ✓ tool authorization policy supports deny and allow outcomes (1820ms) + ✓ run identifiers cannot escape the configured output root (243ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 4705ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-21.log ===== + +============================================================ +Test Results +============================================================ + ✓ lifecycle hooks emit callback and webhook sink events (1163ms) + ✓ redaction preserves non-secret token metrics (244ms) + ✓ run export and import support round trip bundles (1581ms) + ✓ bundle import requires a valid state artifact (233ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3350ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-22.log ===== + +============================================================ +Test Results +============================================================ + ✓ doctor write persists repaired state changes (1273ms) + ✓ report artifacts redact sensitive fields (638ms) + ✓ signed bundle verification supports deterministic pass and fail paths (1590ms) + ✓ partial run indexes fall back to a complete state scan (924ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 4555ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-23.log ===== + +============================================================ +Test Results +============================================================ + ✓ load run state fails safely on malformed json (601ms) + ✓ output root validation blocks dangerous paths and allows safe relative roots (242ms) + ✓ cli negative path matrix returns deterministic errors (1543ms) + ✓ doctor does not mark pending steps completed from index alone (624ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3146ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-24.log ===== + +============================================================ +Test Results +============================================================ + ✓ dispatch runs rejects invalid numeric flags (692ms) + ✓ dispatch blocks unsafe output roots without opt in (653ms) + ✓ dispatch help usage snapshot remains compatible (1571ms) + ✓ truncated trace payload previews redact sensitive values (277ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3340ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-3.log ===== + +============================================================ +Test Results +============================================================ + ✓ workflow template introspection exposes summary metadata (546ms) + ✓ load run state backfills missing contract schema metadata (576ms) + ✓ canonical source path helpers enforce root boundaries (212ms) + ✓ corruption matrix covers malformed and missing artifact scenarios (684ms) + ✓ persisted declarative workflow definitions can resume (3454ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 5625ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-4.log ===== + +============================================================ +Test Results +============================================================ + ✓ templates command supports text and json output (1622ms) + ✓ state repair can recover inconsistent running metadata (560ms) + ✓ doctor and cleanup persist mutation audit artifacts (2636ms) + ✓ optional tool step is skipped instead of failing the run when denied by policy (17343ms) + ✓ resume applies requested trace limits to persisted traces (11618ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 33949ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-5.log ===== + +============================================================ +Test Results +============================================================ + ✓ crud reliability workflow template runs with fixture tools (15632ms) + ✓ trace generation creates events and final status (215ms) + ✓ strict mutation mode blocks destructive commands unless confirmed (2591ms) + ✓ approval handoff template completes offline and avoids the flaky tool (8884ms) + ✓ resume decision rejects a mismatched approval decision id (7887ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 35372ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-6.log ===== + +============================================================ +Test Results +============================================================ + ✓ tool registry registers and executes tools (244ms) + ✓ trace markdown includes event counts and timeline (258ms) + ✓ src import smoke fixture runs successfully (736ms) + ✓ workflow template registry exposes the approval handoff template (530ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 1900ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-7.log ===== + +============================================================ +Test Results +============================================================ + ✓ module-level source tool handler returns search results (241ms) + ✓ handoff creation includes required fields (233ms) + ✓ mutation audit rotation keeps active log bounded and rolls over (302ms) + ✓ webhook sink option appends lifecycle events as jsonl (9140ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 10033ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-8.log ===== + +============================================================ +Test Results +============================================================ + ✓ tool payload adapters support custom mapping (255ms) + ✓ agent registry dispatch executes mapped and custom handlers (368ms) + ✓ doctor incremental mode supports recent count and explicit run IDs (1975ms) + ✓ report title reflects the workflow name (278ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2989ms +============================================================ + +All tests passed! ✨ + + +===== dispatch-9.log ===== + +============================================================ +Test Results +============================================================ + ✓ local source lookup blocks unsafe source ids (270ms) + ✓ agent registry dispatch reports unknown handler mapping (403ms) + ✓ run index is created and scanner fallback works when index is malformed (907ms) + ✓ signed bundle uses a cryptographic sha256 mac and rejects wrong keys (1558ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3288ms +============================================================ + +All tests passed! ✨ + + +===== effect_assurance.log ===== +PASS sqlite before_commit: real SIGKILL, 45 assurance cases, Dispatch replay, one logical effect +PASS sqlite after_commit: real SIGKILL, 45 assurance cases, Dispatch replay, one logical effect +PASS sqlite expired: real effect, continuation blocked, state intact +PASS sqlite non-idempotent: real effect, continuation blocked, state intact +PASS git before_commit: real SIGKILL, 45 assurance cases, Dispatch replay, one logical effect +PASS git after_commit: real SIGKILL, 45 assurance cases, Dispatch replay, one logical effect +PASS git expired: real effect, continuation blocked, state intact +PASS git non-idempotent: real effect, continuation blocked, state intact +Evidence: /Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/effect-assurance-1790827570017/proof.json + + +===== effect_assurance_schema.log ===== +PASS assurance schema: valid example, required fields, digests, closed properties + + +===== effect_continuation.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/effect-continuation-SmMRUr","checks":39,"proofs":["valid-prefix-only-C","repeat-denied","D-denied","parent-replay-denied","cannot-select-A","cannot-select-B","cannot-select-D","unknown-prefix-blocks","A-no-phantom","B-same-attempt","after_admission-no-replay","after_mutation-no-replay","after_observation-no-replay","two-fresh-controllers-one-admission","stale-registration","stale-plan","stale-target","stale-authority","stale-config","stale-revocation","stale-environment","stale-environment-ref","stale-set","stale-preservation","state-revision","state-journal","state-selected-state","state-attempt","state-control","state-preservation","state-selection-removal","final-revalidation-status","final-revalidation-environment","actual-evidence-expiry","expiry-after-admission","orphan-claim-denies","retained-evidence-required","sqlite-authority-over-json-mirror","actual-baseline-reader-refuses-new-state"]} + + +===== effect_lifecycle_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":6} + + +===== effect_selection_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":4} + + +===== effect_set.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/effect-set-u8LmU7","scenarios":["A: two SIGKILLs; retained A/unknown B/unstarted C,D","B: claim without verifier","C: expiry/append-only renewal","D: two sink-key contenders","journal tamper refused"],"assessmentCases":29,"first":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:bc776c9cdecf5e21e84f0049e4dae715dab8f976b65d36483391d1e74043e0c8","freshness":"current","historical_observation":"committed","next_action":"retain_completion","observed_state":"committed","reported_state":"unknown"},{"blocked_by":null,"effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"B","effect_id":"C","evidence_ref":"sha256:a419d27a6ec141bf0a98085d21a7d91488167032dfdbc8b2e4971da09251e25f","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"},{"blocked_by":"B","effect_id":"D","evidence_ref":"sha256:1a346cb9692d07e265203a95b514a246c22217bcee45da47c1602c06122358d8","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"},"expired":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:bc776c9cdecf5e21e84f0049e4dae715dab8f976b65d36483391d1e74043e0c8","freshness":"stale","historical_observation":"committed","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"A","effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"A","effect_id":"C","evidence_ref":"sha256:a419d27a6ec141bf0a98085d21a7d91488167032dfdbc8b2e4971da09251e25f","freshness":"stale","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"not_started"},{"blocked_by":"A","effect_id":"D","evidence_ref":"sha256:1a346cb9692d07e265203a95b514a246c22217bcee45da47c1602c06122358d8","freshness":"stale","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"},"renewed":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:bc776c9cdecf5e21e84f0049e4dae715dab8f976b65d36483391d1e74043e0c8","freshness":"current","historical_observation":"committed","next_action":"retain_completion","observed_state":"committed","reported_state":"unknown"},{"blocked_by":null,"effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"B","effect_id":"C","evidence_ref":"sha256:a419d27a6ec141bf0a98085d21a7d91488167032dfdbc8b2e4971da09251e25f","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"},{"blocked_by":"B","effect_id":"D","evidence_ref":"sha256:1a346cb9692d07e265203a95b514a246c22217bcee45da47c1602c06122358d8","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"}} + + +===== effect_set_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== failure_gate_execution.log ===== + +============================================================ +Test Results +============================================================ + ✓ terminal runs cannot execute pending descendants through the direct runner (2268ms) + ✓ execution failure enters review without running descendants or retrying effects (1391ms) + ✓ execution failure with no matching policy stops by default (1065ms) + ✓ evaluator crash maps to error review without declaring a quality failure (1385ms) + ✓ a passed evaluation continues through the same neutral policy path (1652ms) + ✓ accepting a failed action continues without replaying its effect (2491ms) + +Tests: 6 total, 6 passed, 0 failed +Time: 10428ms +============================================================ + +All tests passed! ✨ + + +===== failure_gate_safety.log ===== + +============================================================ +Test Results +============================================================ + ✓ submitted idempotency key does not authorize replay (84ms) + ✓ observed unknown partial effects override a pure configuration (76ms) + ✓ sink enforced idempotency needs an evidence reference (90ms) + ✓ destroyed workspace cannot be retried in place (87ms) + ✓ retained filesystem permits a declared same workspace adapter (98ms) + ✓ an evaluator decision cannot target an unrelated action (86ms) + ✓ terminal states reject continuation (135ms) + ✓ evaluation crash is indeterminate rather than failed quality (86ms) + ✓ negative checks and unknown contract versions fail closed (86ms) + ✓ policy outcome is producer neutral and deterministic (298ms) + ✓ evidence cannot promote itself to policy authority (93ms) + ✓ journal detects orphan append and tampered history (150ms) + ✓ expired preservation cannot authorize same workspace replay (90ms) + ✓ null idempotency metadata is not enforcement evidence (77ms) + ✓ continuation source cannot contradict its action (98ms) + ✓ tampered control history is detected even when JSON is valid (128ms) + ✓ an atomic event beyond an absent journal requires recovery (77ms) + ✓ review requests explain unavailable replay without granting new actions (104ms) + ✓ policy action availability work is bounded and duplicate actions reject (153ms) + ✓ compensation metadata does not prove external reversal or admit replay (76ms) + +Tests: 20 total, 20 passed, 0 failed +Time: 2386ms +============================================================ + +All tests passed! ✨ + + +===== git_participant_after.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/git-participant-1790827220659","schema":"dispatch.git-participant-rehearsal/v1","boundary":"after_commit","ok":true,"actual_sigkill":true,"initial_observed_state":"committed","logical_effects":1,"admitted_processes":2,"duplicate_denials":2,"caller_denials":15,"negative_correlations":22,"fresh_controller":true,"checkpoint":true,"stale_checkpoint_denied":true,"descendant":true,"privacy":true,"ability_used":false,"policy":{"config_revision":"b042152b3d966f4012dc7de6f57249f0f29aaebad856107321d7b777011b3e79","fallback":"deny","mode":"required","policy_sha256":"df1d075f5f3049e3afaf3f7f6c6d047dca4a8806aac04d2dacbdbaaaad0de9ab","profile":"workcell.git-cas","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"}} + + +===== git_participant_before.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/git-participant-1790827249951","schema":"dispatch.git-participant-rehearsal/v1","boundary":"before_commit","ok":true,"actual_sigkill":true,"initial_observed_state":"not_started","logical_effects":1,"admitted_processes":2,"duplicate_denials":2,"caller_denials":15,"negative_correlations":22,"fresh_controller":true,"checkpoint":true,"stale_checkpoint_denied":true,"descendant":true,"privacy":true,"ability_used":false,"policy":{"config_revision":"82b6b18b551f84a2a0b0b792a42a44392b0f05e94df5093e8fa55663657ccbd3","fallback":"deny","mode":"required","policy_sha256":"8342631962ec1613ccbe64a8338404be0ce2279f4609dcd8e8326005d9ec4a66","profile":"workcell.git-cas","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"}} + + +===== go_participant.log ===== +{"ok":true,"checks":152,"mcpChecks":5,"malformedChecks":9,"wireSHA256":"f87fd01de248eca96c685282b3ead0a95578f77f6c597f598fc9d587f0bec262","independence":"Go standard library; CLI and MCP share one codec"} + + +===== graph_attempt_authority.log ===== +{"ok":true,"checks":3,"proofs":["operator revoked at final revalidation cannot reserve","changed child authority cannot dispatch or release an old reservation","ordinary execution failure is not a Dispatch pre-admission refusal"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-XWkedM"} + + +===== graph_attempt_binding_safety.log ===== +PASS downstream reservation blocks retry before child binding +PASS retry cannot retire a terminal already bound by an undispatched program descendant +{"ok":true,"checks":2,"proofs":["downstream reservation blocks retry before child binding","retry cannot retire a terminal already bound by an undispatched program descendant"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-CjnIy1"} + + +===== graph_attempt_contracts.log ===== +{"checks":19,"ok":true} + + +===== graph_attempt_integration.log ===== +PASS A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize +PASS two refused attempts exhaust node ceiling; no third attempt and original failures retained +PASS graph budget exhaustion blocks retry without refund or fabricated terminal failure +PASS operator revocation denies reservation without consuming capacity +PASS changed producer bytes cannot become a newer retry input +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-sTg3cI","checks":5,"proofs":["A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize","two refused attempts exhaust node ceiling; no third attempt and original failures retained","graph budget exhaustion blocks retry without refund or fabricated terminal failure","operator revocation denies reservation without consuming capacity","changed producer bytes cannot become a newer retry input"]} + + +===== graph_attempt_policy.log ===== +PASS Eval branch activation consumes zero program units; inactive repair node has no attempt +PASS subgraph receipt adds no execution unit; human decision is separate from three member dispatches +PASS held optional reservation prevents graph sealing; release and cancellation remain explicit +{"ok":true,"checks":3,"proofs":["Eval branch activation consumes zero program units; inactive repair node has no attempt","subgraph receipt adds no execution unit; human decision is separate from three member dispatches","held optional reservation prevents graph sealing; release and cancellation remain explicit"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-bnRRDe"} + + +===== graph_attempt_recovery.log ===== +PASS two fresh controllers reserve exactly one last graph unit +PASS release contention records one release and restores only never-dispatched capacity +PASS crash A: durable reservation before binding releases without phantom execution +PASS bound but undispatched reservation releases; its surviving input binding grants no admission +PASS crash before_child_load: consumed dispatch is not redelivered, released or retried +PASS crash before_node_admission: consumed dispatch is not redelivered, released or retried +PASS crash after_node_admission: consumed dispatch is not redelivered, released or retried +PASS same-node retry and next-attempt creation race publishes one new reserved instance +PASS crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay +PASS orphan reserve: immutable record/index gap repaired by fresh controller without execution +PASS orphan release: immutable record/index gap repaired by fresh controller without execution +PASS orphan retry: immutable record/index gap repaired by fresh controller without execution +PASS crash F: durable terminal observation repairs stale accounting without refund or graph finalization +PASS orphan child refusal remains sealed through exact retained-host repair +{"ok":true,"checks":14,"proofs":["two fresh controllers reserve exactly one last graph unit","release contention records one release and restores only never-dispatched capacity","crash A: durable reservation before binding releases without phantom execution","bound but undispatched reservation releases; its surviving input binding grants no admission","crash before_child_load: consumed dispatch is not redelivered, released or retried","crash before_node_admission: consumed dispatch is not redelivered, released or retried","crash after_node_admission: consumed dispatch is not redelivered, released or retried","same-node retry and next-attempt creation race publishes one new reserved instance","crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay","orphan reserve: immutable record/index gap repaired by fresh controller without execution","orphan release: immutable record/index gap repaired by fresh controller without execution","orphan retry: immutable record/index gap repaired by fresh controller without execution","crash F: durable terminal observation repairs stale accounting without refund or graph finalization","orphan child refusal remains sealed through exact retained-host repair"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-cNBtCw"} + + +===== graph_attempt_smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-HnkHR6","checks":9} + + +===== graph_attempt_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":4} + + +===== hardening.log ===== + +============================================================ +Test Results +============================================================ + ✓ persisted token budgets survive workflow reload without exposing credentials (512ms) + ✓ workflow loader rejects non-object steps with structured errors (127ms) + ✓ webhook sink appends preserve exact existing JSONL framing (107ms) + ✓ exhausted model token envelope blocks the next model round (122ms) + ✓ streaming rejects step ids that escape the run directory (124ms) + ✓ redaction preserves nested shapes and leaves the original data untouched (132ms) + ✓ library run creation rejects forbidden output roots before writing (210ms) + ✓ unrouted built-in agents propagate live model failures (157ms) + +Tests: 8 total, 8 passed, 0 failed +Time: 1616ms +============================================================ + +All tests passed! ✨ + + +===== heterogeneous_contracts.log ===== +{"checks":10,"ok":true} + + +===== heterogeneous_integration.log ===== +PASS unresolved program effects block parent and downstream +PASS producer terminal is not Eval or human completion +PASS wrong evaluation subject +PASS wrong original result identity +PASS stale evaluated output +PASS wrong evaluator revision +PASS incomplete evaluation +PASS Eval terminal uses actual evaluation-result without execution-result +PASS wrong human subject +PASS stale human revision +PASS wrong human input binding +PASS unauthorized human actor +PASS live human authority revocation between assessment and decision rejects +PASS pending human prevents graph completion +PASS authorized approval is immutable; conflicting denial rejects +PASS heterogeneous join records why B proceeds and grants no effect admission +PASS missing consumer output blocks its independent finalization +PASS all node facts without graph decision stay nonterminal +PASS changed required output cannot finalize graph +PASS required membership cannot be downgraded +PASS new required descendant invalidates anchored definition +PASS stale graph assessment cannot become terminal authority +PASS explicit graph success preserves independent node truth +PASS anchored Eval fail policy yields failed graph and blocks B without rewriting A +PASS optional cancellation is not execution; completion-only H independently gates graph success +{"ok":true,"checks":25,"evidence":["/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-qHbrfA/heterogeneous-success","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-qHbrfA/evaluation-failure","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-qHbrfA/optional-and-completion-only"]} + + +===== heterogeneous_policy.log ===== +PASS human abort retains decision semantics under graph policy +PASS human cancel retains decision semantics under graph policy +PASS optional Eval failure stays failed but does not fail required-success graph +PASS Eval fail mapped to review remains blocked, not automatically terminal failure +PASS unfinalized execution failure cannot become success or admit dependent +PASS consumer uncertainty leaves successful producer history unchanged +PASS optional cancellation cannot satisfy a success scheduling dependency +{"ok":true,"checks":7} + + +===== heterogeneous_recovery.log ===== +PASS Eval terminal reply loss survives a fresh controller without a fake execution +PASS actual human terminal orphan repairs exact decision but not graph completion +PASS all durable terminal facts and recovery still require separate graph decision +PASS two fresh finalizers: one exact durable graph terminal transition +PASS graph crash before_terminal preserves exact terminal boundary +PASS graph crash after_terminal preserves exact terminal boundary +PASS graph crash immutable preserves exact terminal boundary +PASS optional outstanding dispatch blocks graph finalization before child admission +{"ok":true,"checks":8,"scenarios":["Eval terminal reply loss survives a fresh controller without a fake execution","actual human terminal orphan repairs exact decision but not graph completion","all durable terminal facts and recovery still require separate graph decision","two fresh finalizers: one exact durable graph terminal transition","graph crash before_terminal preserves exact terminal boundary","graph crash after_terminal preserves exact terminal boundary","graph crash immutable preserves exact terminal boundary","optional outstanding dispatch blocks graph finalization before child admission"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-FMoAgv"} + + +===== heterogeneous_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== http_application_error.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/http-ability-1790827339455","schema":"dispatch.http-ability-rehearsal/v1","scenario":"application-error","ok":true,"initial_business_effects":0,"business_effects":1,"receipt_rows":1,"negative_correlations":24,"invalid_http_requests_per_attempt":21,"concurrent_denied_per_attempt":1,"controller_restart":true,"server_restart":true,"standalone":true,"expired_stale_reuse_denied":true,"locked_replay_denial":true,"policy":{"config_revision":"be4260ca8f5e2a41dd32d3fee6c5e00d2263782fedb901fbe80e251d39be2103","fallback":"deny","mode":"required","policy_sha256":"76b578d3a262dc67e130e0754d858ae93ed9a097470f0549ab24962266edc734","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"initial_outcome":"application_error"} + + +===== http_response_loss.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/http-ability-1790827278529","schema":"dispatch.http-ability-rehearsal/v1","scenario":"response-loss","ok":true,"initial_business_effects":1,"business_effects":1,"receipt_rows":1,"negative_correlations":24,"invalid_http_requests_per_attempt":21,"concurrent_denied_per_attempt":1,"controller_restart":true,"server_restart":true,"standalone":true,"expired_stale_reuse_denied":true,"locked_replay_denial":true,"policy":{"config_revision":"784823fe8e70de3af90b33e3e7c0cc51bb7fa6b4a95fc58bf2386f3d680cd1ac","fallback":"deny","mode":"required","policy_sha256":"ca1dbff4f8cceae297b3c72c100d654aae5462656bdc2f022071ecac2ad6d39f","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"initial_outcome":"response_lost"} + + +===== http_timeout_before.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/http-ability-1790827309867","schema":"dispatch.http-ability-rehearsal/v1","scenario":"timeout-before","ok":true,"initial_business_effects":0,"business_effects":1,"receipt_rows":1,"negative_correlations":24,"invalid_http_requests_per_attempt":21,"concurrent_denied_per_attempt":1,"controller_restart":true,"server_restart":true,"standalone":true,"expired_stale_reuse_denied":true,"locked_replay_denial":true,"policy":{"config_revision":"a9829068f0af7012f1fadf07704f0d124d92a3dd4549d0ed9ad4676ce7e8ba0d","fallback":"deny","mode":"required","policy_sha256":"840e1a087c690140cd249e7b4be5982df4183b68ddc282f99b66f3c24ff2bc69","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"initial_outcome":"timeout"} + + +===== interop_history.log ===== +{"bytes_preserved":true,"differential":true,"fifth_namespace":true,"generic_mutations":true,"historical_families":4,"ok":true} + + +===== interop_oracles.log ===== +Frozen legacy reader hashes verified: 4 + + +===== mcp_ability.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/mcp-ability-1790827371767","scenario":"receipt-failure","schema":"dispatch.mcp-ability-rehearsal/v1","ok":true,"negative_correlations":21,"business_effects":1,"receipt_rows":1,"mcp_processes":7,"expired_admission_denied":true,"stale_admission_denied":true,"duplicate_admission_denied":true,"locked_replay_denial":true,"controller_restart":true,"beta_required":true,"checkpoint":true,"standalone":true,"receipt_commit_failed":true,"stdio_reply_lost":false,"dispatch_policy":{"config_revision":"730262a793b428ec33dfe68b58e7d82ce9d5dc8afafca75cb38f40f99fe65225","fallback":"deny","mode":"required","policy_sha256":"8080f331a4b24e836fba69c19509eacd08bead64f479f36824788bea589bdb51","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"8fcdbda50ab2e3397223046bee5e7f76fd510315d64fc63849a290e56b601e04","second_result_sha256":"63c0d4408cceffab791e6c1edc2cbe1ff7550f16975e23e10c10fea6fd5286aa"} + + +===== mcp_stdio_loss.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/mcp-ability-1790827402636","scenario":"stdio-loss","schema":"dispatch.mcp-ability-rehearsal/v1","ok":true,"negative_correlations":21,"business_effects":1,"receipt_rows":1,"mcp_processes":7,"expired_admission_denied":true,"stale_admission_denied":true,"duplicate_admission_denied":true,"locked_replay_denial":true,"controller_restart":true,"beta_required":true,"checkpoint":true,"standalone":true,"receipt_commit_failed":false,"stdio_reply_lost":true,"dispatch_policy":{"config_revision":"e4287cc1c7b244091cd783cd36db92711272a67bac54419fb9baff9ac1926042","fallback":"deny","mode":"required","policy_sha256":"50fcb1c2b60d2273db7d1c980760e36c8cdec759197545b25fedc0509f680f02","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"746d32eae41097bb5b80fc8a63923ab6e509da32f9f73bf8eb4a4c14da22c3f0","second_result_sha256":"99dfd14fd6afc9dbb0924316c52a26afc1a4e34e2d3ac459b42af6aaee587163"} + + +===== node_composition.log ===== +ROOT /var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-njk4un/two +PASS producer output exists without finalization: consumer blocked +PASS unresolved producer effect prevents finalization +PASS output missing prevents producer finalization +PASS evaluation failure and operator revocation block terminal authority +PASS effect completion and passing Eval still do not finalize producer +PASS exact source name type digest revision and producer binding +PASS binding survives fresh load; artifact mutation and absence deny execution +PASS stale installed authority denies consumer +PASS consumer executes independently with pinned provenance +PASS all required independently finalized nodes complete existing DAG +PASS historical consumer provenance cannot become a later producer version +PASS completion-only edge does not transfer an artifact +PASS bounded join requires both independently finalized producers +PASS consumer failure cannot rewrite finalized producer +PASS producer execution failure blocks dependent +PASS fresh controller before_node_binding +PASS fresh controller after_node_binding +PASS fresh controller after_node_start_requested +PASS consumed initial admission survives crash without fabricating execution +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-njk4un","checks":19,"scenarios":["producer output exists without finalization: consumer blocked","unresolved producer effect prevents finalization","output missing prevents producer finalization","evaluation failure and operator revocation block terminal authority","effect completion and passing Eval still do not finalize producer","exact source name type digest revision and producer binding","binding survives fresh load; artifact mutation and absence deny execution","stale installed authority denies consumer","consumer executes independently with pinned provenance","all required independently finalized nodes complete existing DAG","historical consumer provenance cannot become a later producer version","completion-only edge does not transfer an artifact","bounded join requires both independently finalized producers","consumer failure cannot rewrite finalized producer","producer execution failure blocks dependent","fresh controller before_node_binding","fresh controller after_node_binding","fresh controller after_node_start_requested","consumed initial admission survives crash without fabricating execution"]} + + +===== node_contracts.log ===== +{"checks":12,"ok":true} + + +===== node_policy.log ===== +PASS needs-changes evaluation blocks producer dependency +PASS producer tool permission is not inherited by consumer +PASS ordinary cancellation blocks consumer +PASS failed terminal follows existing Eval policy and cannot satisfy dependency +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-j75YeJ","checks":4,"scenarios":["needs-changes evaluation blocks producer dependency","producer tool permission is not inherited by consumer","ordinary cancellation blocks consumer","failed terminal follows existing Eval policy and cannot satisfy dependency"]} + + +===== node_recovery.log ===== +{"contention":[{"ok":true,"reason":"node_requires_independent_finalization"},{"ok":false,"reason":"run_lock_timeout"}],"admissions":1} +PASS two fresh graph controllers: one consumer admission and action +PASS real observation crash: repair retains consumption and requires separate finalization +PASS raw output orphan cannot synthesize a binding +PASS real immutable orphan node_inputs_bound reconciled without implicit execution +PASS real immutable orphan node_terminal_observed reconciled without implicit execution +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-rQJI5Y","checks":5,"scenarios":["two fresh graph controllers: one consumer admission and action","real observation crash: repair retains consumption and requires separate finalization","raw output orphan cannot synthesize a binding","real immutable orphan node_inputs_bound reconciled without implicit execution","real immutable orphan node_terminal_observed reconciled without implicit execution"]} + + +===== node_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== operational_controls.log ===== + +============================================================ +Test Results +============================================================ + ✓ Watchdog trace projection is metadata only and preserves workflow correlation (212ms) + ✓ retry backoff fails closed when it would cross the execution deadline (191ms) + ✓ unbounded custom tools are rejected before hard-deadline execution (819ms) + ✓ webhook delivery accepts only 2xx responses (200ms) + ✓ network callbacks require exact HTTPS allowlists and signing (205ms) + ✓ workflow loader validates budgets and bounded parallel controls (303ms) + ✓ workflow max steps budget fails closed before the next step (1021ms) + ✓ webhook outbox summarizes latest durable delivery state (190ms) + ✓ OpenTelemetry artifact is valid OTLP JSON with correlated ids (206ms) + +Tests: 9 total, 9 passed, 0 failed +Time: 3590ms +============================================================ + +All tests passed! ✨ + + +===== parent_finalization.log ===== +PASS pending effects block parent +PASS cancelled required selection is not completion +PASS unresolved operator review blocks +PASS real Workcell refs and original bytes preserved +PASS stale authority +PASS changed registration +PASS wrong environment +PASS operator authorization revoked +PASS stale evaluation +PASS wrong evaluation subject +PASS missing/replaced output.txt +PASS missing/replaced output-evidence.json +PASS missing/replaced workcell/receipt.json +PASS retained workspace missing +PASS changed retained Git HEAD +PASS stale run revision +PASS new unresolved child +PASS expired preservation +PASS independent sink uncertainty blocks +PASS legitimate new assessment invalidates candidate +PASS generic approved review cannot bypass finalization +PASS separate finalization without effect replay +PASS Eval fail maps through existing policy +PASS SIGKILL before decision remains nonterminal +PASS SIGKILL after terminal reply loss is final +PASS two independently assessed fresh controllers one durable finalization +PASS producer success still requires parent finalization +PASS anchored required descendant blocks terminal transition +PASS mutable optional flag cannot waive anchored required child +PASS live authority revoked inside finalization boundary +PASS orphan durable finalization recovered by fresh controllers +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/parent-finalization-j79fnH","checks":31,"proofs":["pending effects block parent","cancelled required selection is not completion","unresolved operator review blocks","real Workcell refs and original bytes preserved","stale authority","changed registration","wrong environment","operator authorization revoked","stale evaluation","wrong evaluation subject","missing/replaced output.txt","missing/replaced output-evidence.json","missing/replaced workcell/receipt.json","retained workspace missing","changed retained Git HEAD","stale run revision","new unresolved child","expired preservation","independent sink uncertainty blocks","legitimate new assessment invalidates candidate","generic approved review cannot bypass finalization","separate finalization without effect replay","Eval fail maps through existing policy","SIGKILL before decision remains nonterminal","SIGKILL after terminal reply loss is final","two independently assessed fresh controllers one durable finalization","producer success still requires parent finalization","anchored required descendant blocks terminal transition","mutable optional flag cannot waive anchored required child","live authority revoked inside finalization boundary","orphan durable finalization recovered by fresh controllers"]} + + +===== parent_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":2} + + +===== participant_sdk_parity.log ===== +{"ok":true,"schema":"kujo.participant-sdk-conformance/v1alpha1","cases":45,"comparison":"exact bytes, content references, normalized values, error/correlation categories"} + + +===== persisted_negotiation.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/persisted-negotiation-1790827014897","proofs":[{"scenario":"required-fresh-controller-weaker-default","ok":true,"revision":"35a6ecf592ecad08e50f702dc3c2b2a420e62b38806c2435bccbdd04c158bde9"},{"scenario":"revision-missing","code":"assurance_policy_revision_missing"},{"scenario":"revision-revoked","code":"assurance_policy_revision_revoked"},{"scenario":"revision-substituted","code":"assurance_configuration_mismatch"},{"scenario":"revision-changed-verifier","code":"assurance_configuration_mismatch"},{"scenario":"revision-implementation-replaced","code":"assurance_verifier_revision_mismatch"},{"scenario":"optional-absent","ok":true},{"scenario":"optional-unknown-profile","ok":true},{"scenario":"optional-unknown-envelope","ok":true},{"scenario":"optional-invalid-selected","code":"assurance_contract_invalid"},{"scenario":"optional-deleted-selected","code":"assurance_selected_evidence_unavailable"},{"scenario":"optional-expired","code":"assurance_expired_or_future"},{"scenario":"optional-revoked-selected","code":"assurance_policy_revision_revoked"},{"scenario":"delayed-revoke-before-action-and-running-restart","blocked":true},{"scenario":"delayed-expire-before-action-and-running-restart","blocked":true},{"scenario":"optional-deny","code":"compat_assurance_absent"},{"scenario":"oversized-association-no-authority-mutation","blocked":true},{"scenario":"manual-policy-tamper","blocked":true},{"scenario":"stale-checkpoint","code":"stale_checkpoint"},{"scenario":"selection-removed","code":"assurance_journal_state_mismatch"},{"scenario":"retained-r1-and-new-r2","ok":true},{"scenario":"state-rollback","code":"control_recovery_required"},{"scenario":"sqlite-authority-over-stale-json-and-weaker-backend","ok":true},{"scenario":"bundle-preserves-policy-without-claiming-portable-recovery","ok":true},{"scenario":"actual-63d8097-controller-refuses-protected-filesystem-sqlite-and-import","ok":true}]} + + +===== persisted_negotiation_adapters.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/persisted-adapters-1790827188975","proofs":[{"family":"sqlite","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"36e4a0500979d2a0f7462a66053dab1ce557026ed89bc913ba16c2bdcb5c18e2"},{"family":"git","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"2842b6af28f3a2aa1f3e832df731254b37aa55f027a6ad2195d659debf18be50"},{"family":"ability","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"a1c2db68a728fc7ef6d6697a1a2d680d06f8d06e9890791689640cf09885c4dd"}],"privacy":true} + + +===== persisted_negotiation_contracts.log ===== +PASS persisted negotiation: closed policy, guarded codec, exact configuration commitments + + +===== persisted_negotiation_legacy.log ===== +PASS historical missing policy remains historical legacy; new legacy is explicit + + +===== persisted_negotiation_schemas.log ===== +PASS configuration/negotiation schemas: closed fields and required fallback denied + + +===== policy_precedence.log ===== + +============================================================ +Test Results +============================================================ + ✓ policy precedence uses environment profile when config and cli are absent (19054ms) + ✓ policy precedence uses config profile when cli is absent (16732ms) + ✓ policy and config controls honor cli over config over env (3926ms) + +Tests: 3 total, 3 passed, 0 failed +Time: 39749ms +============================================================ + +All tests passed! ✨ + + +===== portable_clean_room.log ===== +{"checker":"independent-node","vectors":58,"ok":true} +{"checker": "independent-python", "vectors": 58, "ok": true} +{"checker":"independent-artifacts","artifacts":6,"structure_and_commitments":true,"live_authority":false} +{"clean_room":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/kujo-assurance-portability-Ip6jw6","no_ecosystem_implementation":true} + + +===== portable_commitments.log ===== +{"checker":"kujo","ok":true,"vectors":58} + + +===== preservation_binding.log ===== +PASS historical inline recipe unchanged +PASS implementation matches portable vector +PASS reference binds original bytes +PASS document and evidence have distinct identities +PASS wrong content digest rejected +PASS wrong environment rejected +PASS wrong run rejected +PASS wrong evidence subject rejected +PASS malformed or unauthorized reference rejected {"$ref":null} +PASS malformed or unauthorized reference rejected {"$ref":""} +PASS malformed or unauthorized reference rejected {"$ref":"receipt.json","extra":true} +PASS malformed or unauthorized reference rejected {"$ref":"https://untrusted.invalid/evidence"} +PASS malformed or unauthorized reference rejected {"$ref":"../outside"} +PASS malformed or unauthorized reference rejected {"$ref":"missing.json"} +PASS wrong original document rejected +PASS old codec still rejects refs +Passed: 16 +Failed: 0 + + +===== python_integration.log ===== +{"ok": true, "root": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/python-1790826847471454000", "proofs": [{"case": "before_commit", "termination": {"completion_knowledge": "unknown", "observed_state": "not_started", "phase": "before_commit", "returncode": -9, "signal": "SIGKILL"}, "required_revision_preserved": true, "fresh_controller": true, "logical_effects": 1}, {"case": "after_commit", "termination": {"completion_knowledge": "unknown", "observed_state": "committed", "phase": "after_commit", "returncode": -9, "signal": "SIGKILL"}, "required_revision_preserved": true, "fresh_controller": true, "logical_effects": 1}, {"case": "concurrency", "admitted": 1, "denied": 3, "logical_effects": 1}], "input_denials": 12, "installed_package": false} + + +===== python_isolation.log ===== +Looking in links: /Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/interop/python-participant/wheelhouse +Processing ./interop/python-participant/wheelhouse/attrs-26.1.0-py3-none-any.whl +Processing ./interop/python-participant/wheelhouse/jsonschema-4.23.0-py3-none-any.whl +Processing ./interop/python-participant/wheelhouse/jsonschema_specifications-2025.9.1-py3-none-any.whl +Processing ./interop/python-participant/wheelhouse/referencing-0.37.0-py3-none-any.whl +Processing ./interop/python-participant/wheelhouse/rpds_py-0.30.0-cp310-cp310-macosx_10_12_x86_64.whl +Processing ./interop/python-participant/wheelhouse/typing_extensions-4.16.0-py3-none-any.whl +Installing collected packages: typing-extensions, rpds-py, attrs, referencing, jsonschema-specifications, jsonschema +Successfully installed attrs-26.1.0 jsonschema-4.23.0 jsonschema-specifications-2025.9.1 referencing-0.37.0 rpds-py-0.30.0 typing-extensions-4.16.0 +test_action_attempts (test_codec.CodecTests) ... ok +test_assets (test_codec.CodecTests) ... ok +test_closed_extensions (test_codec.CodecTests) ... ok +test_correlations (test_codec.CodecTests) ... ok +test_isolated_environment (test_codec.CodecTests) ... ok +test_limits (test_codec.CodecTests) ... ok +test_python_numbers (test_codec.CodecTests) ... ok +test_request (test_codec.CodecTests) ... ok +test_roundtrip (test_codec.CodecTests) ... ok +test_unicode (test_codec.CodecTests) ... ok +test_vectors (test_codec.CodecTests) ... ok +test_wire_mutations (test_codec.CodecTests) ... ok +test_neutral_corpus (test_codec.ParityCorpusTests) ... ok +test_shared_contract (test_sdk.SDKTests) ... ok + +---------------------------------------------------------------------- +Ran 14 tests in 0.467s + +OK +{"ok": true, "external_copy": true, "network": false, "ecosystem_imports": false} + + +===== python_package.log ===== +test_action_attempts (test_codec.CodecTests) ... ok +test_assets (test_codec.CodecTests) ... ok +test_closed_extensions (test_codec.CodecTests) ... ok +test_correlations (test_codec.CodecTests) ... ok +test_isolated_environment (test_codec.CodecTests) ... ok +test_limits (test_codec.CodecTests) ... ok +test_python_numbers (test_codec.CodecTests) ... ok +test_request (test_codec.CodecTests) ... ok +test_roundtrip (test_codec.CodecTests) ... ok +test_unicode (test_codec.CodecTests) ... ok +test_vectors (test_codec.CodecTests) ... ok +test_wire_mutations (test_codec.CodecTests) ... ok +test_neutral_corpus (test_codec.ParityCorpusTests) ... ok +test_shared_contract (test_sdk.SDKTests) ... ok + +---------------------------------------------------------------------- +Ran 14 tests in 0.461s + +OK + + +===== python_parity.log ===== +{"ok":true,"cases":28,"parserChecks":22,"comparison":"acceptance, owner-projected canonical bytes, SHA256 and semantics"} + + +===== reexecution_lifecycle.log ===== +PASS actual same reexecution, attempt identity, review barrier, and journal +PASS actual clean reexecution, attempt identity, review barrier, and journal +PASS actual idempotent reexecution, attempt identity, review barrier, and journal + + +===== resume_policy.log ===== +Resume policy case: v2/direct/env +Resume policy case: v2/direct/config +Resume policy case: v2/direct/allow +Resume policy case: v2/model/env +Resume policy case: v2/model/config +Resume policy case: v2/model/allow +Resume policy case: v1/direct/env +Resume policy case: v1/direct/config +Resume policy case: v1/direct/allow +Resume policy case: v1/model/env +Resume policy case: v1/model/config +Resume policy case: v1/model/allow +Resume policy: v1/v2 direct/model env/config denial and allowed controls pass; invalid policy preserves state. +Legacy decision boundary: next approval pauses; concurrent delivery has one winner. +Unsigned callback preflight preserves both v1/v2 review states. + + +===== retained_recovery.log ===== +{"passed":29,"proofs":["sqlite-stale-state-consumption","git-stale-state-consumption","orphan-control","exact-duplicate","cancel-tail","rebind-tail","torn","conflict","hash","ahead","missing-claim","lifecycle-orphan","stale-plan","revoked","expired","missing-workspace","sigkill-after_admission","sigkill-after_mutation","sigkill-after_observation","fresh-operator-contention","native-write-sigkill-effect_lifecycle_recorded","native-write-sigkill-retained_host_reconciled","native-write-sigkill-claim-consumption","real-workcell-retention-not-admission","real-workcell-preservation-expired-during-outage","real-workcell-workspace-missing","corrupt-materialization-checkpoint-rejected","workcell-git-changed-target","sqlite-authoritative-row-over-corrupt-mirror"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-HNg6Co"} + + +===== retrieval_preferences.log ===== + +============================================================ +Test Results +============================================================ + ✓ step run and workflow preference precedence preserves explicit clearing (196ms) + ✓ loaded workflow delivers run preference to tool and preserves it through disk reload (1444ms) + ✓ retry and approval resume preserve run selection and a later explicit clear (3187ms) + +Tests: 3 total, 3 passed, 0 failed +Time: 4914ms +============================================================ + +All tests passed! ✨ + + +===== review_checkpoint.log ===== + +============================================================ +Test Results +============================================================ + ✓ checkpoint publication is immutable repeatable and leaves authority unchanged (1797ms) + ✓ missing or altered checkpoint bytes never authorize continuation (1971ms) + ✓ checkpoint refuses changed revision or in-flight work (2038ms) + ✓ orphan and torn journal prohibit checkpoint publication (2843ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 8765ms +============================================================ + +All tests passed! ✨ + + +===== routing.log ===== + +============================================================ +Test Results +============================================================ + ✓ legacy static routing preserves requested agent model (256ms) + ✓ quality first routing applies capability and quality floor (321ms) + ✓ provider cost latency tool and schema constraints reject incompatible routes (382ms) + ✓ deterministic tie break and decision id ignore candidate declaration order (395ms) + ✓ agent substitution requires execution compatibility (312ms) + ✓ no route error includes candidate evaluations (239ms) + ✓ effective agent clone changes model without mutating source (181ms) + ✓ deterministic evaluation supports accepted and configured failure outcomes (195ms) + ✓ failure classifier separates retry fallback and terminal failures (189ms) + ✓ runner persists route before execution and records explicit fallback (2187ms) + ✓ plugin style compatible agent participates in deterministic selection (298ms) + ✓ context reliability risk and output schema constraints are hard filters (277ms) + ✓ routing rejects unknown constrained risk incompatible schemas and unsupported policy modes (260ms) + ✓ cost latency and balanced objectives produce deterministic distinct choices (758ms) + ✓ AI SDK catalog metadata is authoritative over agent candidate claims (234ms) + ✓ upgrade and reroute overrides enforce their distinct semantics (431ms) + ✓ runner records same-route retry separately from fallback (1667ms) + ✓ persisted decision is reused and sensitive route fields are redacted (2475ms) + ✓ declarative loader preserves workflow agent and step routing contracts (286ms) + ✓ model catalog references reject absolute and traversal paths by default (181ms) + ✓ narrower policy layers cannot weaken broader routing constraints (199ms) + ✓ strict routing validation rejects unknown fields and providers (199ms) + ✓ generic model handler executes a declarative routed agent (1602ms) + ✓ cost-bounded live routes reject missing authoritative pricing (1628ms) + ✓ cost budgets reserve growing context when output pricing is explicitly zero (1334ms) + ✓ generic model handler executes only model-requested tools with bounded idempotent replay (214ms) + ✓ generic model handler fails closed when tool authorization denies a request (206ms) + ✓ built-in deterministic agent handlers enforce tool authorization (201ms) + ✓ generic model handler decrements the total token envelope across rounds (203ms) + ✓ generic model handler persists incremental stream events (200ms) + ✓ route evaluation pauses for native human review and resumes stored output (1986ms) + +Tests: 31 total, 31 passed, 0 failed +Time: 20378ms +============================================================ + +All tests passed! ✨ + + +===== sdk_ability.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/sdk-ability-1790827433457","schema":"dispatch.sdk-ability-rehearsal/v1","ok":true,"negative_correlations":14,"business_effects":1,"receipt_rows":1,"sdk_processes":5,"duplicate_admission_denied":true,"locked_replay_denial":true,"controller_restart":true,"beta_required":true,"checkpoint":true,"standalone":true,"receipt_commit_failed":true,"dispatch_policy":{"config_revision":"2e3be137a6fe282c73ccb7ac4380e70d3b3bfe3c646b13f1d072db4c8be7b971","fallback":"deny","mode":"required","policy_sha256":"3532a2809d645e24eeb4ddfc7e71eab90fa7443dbfcbf0123de069a72960a3e5","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"4c134ecdf35210334924725c58d32f01a6b69d1a9e1d4be2cce7c319d1e75fcb","second_result_sha256":"dfd68352d5209e37318a90579070b20308baa85de29869a31dc8a6fc336a5f8f"} + + +===== sdk_adapter.log ===== + +============================================================ +Test Results +============================================================ + ✓ custom providers cannot select arbitrary process secret variables (19ms) + ✓ parse json from output supports trailing json line (8ms) + ✓ parse error details are redacted by default (10ms) + ✓ parse error details include raw output when debug enabled (10ms) + ✓ execution error message redacts stderr by default (13ms) + ✓ execution error message includes stderr when debug enabled (10ms) + ✓ bridge spawn command is direct argv without shell wrapper (7ms) + ✓ bridge timeout is configurable with a safe default (10ms) + ✓ bridge payload carries route provenance and structured output policy (26ms) + ✓ offline fixture model calls return in process without bridge execution (11ms) + +Tests: 10 total, 10 passed, 0 failed +Time: 141ms +============================================================ + +All tests passed! ✨ + + +===== sequential_effects.log ===== +{"ok":true,"roots":["/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-6mUt8A","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-g0EDjT"],"checks":80,"proofs":["sqlite-independent-C-D-lifecycles","sqlite-expiry-explicit-rebind-same-attempt","sqlite-cancel-retained-replacement-explicit","sqlite-after_admission-never-replay","sqlite-after_mutation-never-replay","sqlite-after_observation-never-replay","sqlite-race-cancel-cancel","sqlite-race-cancel-admit","sqlite-race-rebind-cancel","sqlite-race-rebind-rebind","sqlite-race-rebind-admit","sqlite-crash-before_rebind","sqlite-crash-after_rebind","sqlite-crash-before_cancel","sqlite-crash-after_cancel","sqlite-crash-before_selection","sqlite-crash-after_selection","sqlite-invalid-registration","sqlite-invalid-plan","sqlite-invalid-target","sqlite-invalid-authority","sqlite-invalid-configuration","sqlite-invalid-environment","sqlite-invalid-preservation","sqlite-final-revalidation","sqlite-expiry-after-rebind","sqlite-live-prefix-uncertainty-blocks","sqlite-orphan-claim-blocks","sqlite-pre-C-cursor-cannot-select-D","sqlite-retained-evidence-required","sqlite-expire-after-admission","sqlite-registration-after-admission","sqlite-state-revision","sqlite-state-journal","sqlite-state-allowed-actions","sqlite-state-effect-state","sqlite-state-parent-attempt","sqlite-parent-replay-denied","actual-old-reader-refuses-lifecycle","sqlite-authority-over-json-mirror","sqlite-two-fresh-controllers-one-admission","git-independent-C-D-lifecycles","git-expiry-explicit-rebind-same-attempt","git-cancel-retained-replacement-explicit","git-after_admission-never-replay","git-after_mutation-never-replay","git-after_observation-never-replay","git-race-cancel-cancel","git-race-cancel-admit","git-race-rebind-cancel","git-race-rebind-rebind","git-race-rebind-admit","git-crash-before_rebind","git-crash-after_rebind","git-crash-before_cancel","git-crash-after_cancel","git-crash-before_selection","git-crash-after_selection","git-invalid-registration","git-invalid-plan","git-invalid-target","git-invalid-authority","git-invalid-configuration","git-invalid-environment","git-invalid-preservation","git-final-revalidation","git-expiry-after-rebind","git-live-prefix-uncertainty-blocks","git-orphan-claim-blocks","git-pre-C-cursor-cannot-select-D","git-retained-evidence-required","git-expire-after-admission","git-registration-after-admission","git-state-revision","git-state-journal","git-state-allowed-actions","git-state-effect-state","git-state-parent-attempt","git-parent-replay-denied","git-two-fresh-controllers-one-admission"]} + + +===== state_store_sqlite.log ===== + +============================================================ +Test Results +============================================================ + ✓ sqlite state store persists revisions and remains authoritative (697ms) + +Tests: 1 total, 1 passed, 0 failed +Time: 711ms +============================================================ + +All tests passed! ✨ + + +===== static_policy_contracts.log ===== +{"checks":14,"ok":true} + + +===== static_policy_edges.log ===== +PASS failed entry permits graph failure without inventing unentered group completion +{"ok":true,"checks":2,"scenarios":["failed entry without group completion","closed terminal outcome predicate"]} + + +===== static_policy_integration.log ===== +PASS unfinalized Eval cannot activate pass +PASS stale assessment and scheduling without activation reject pass +PASS only selected path independently admitted pass +PASS alternate later evaluation cannot flap consumed branch pass +PASS conditional join and outcome omit inactive without success pass +PASS unfinalized Eval cannot activate fail +PASS stale assessment and scheduling without activation reject fail +PASS only selected path independently admitted fail +PASS alternate later evaluation cannot flap consumed branch fail +PASS repair is new R execution and new E2 judgment, never retry A +PASS conditional join and outcome omit inactive without success fail +PASS authorized human approve_override routes without direct execution or rewritten decision +PASS authorized human abort routes without direct execution or rewritten decision +{"ok":true,"checks":13,"scenarios":["unfinalized Eval cannot activate pass","stale assessment and scheduling without activation reject pass","only selected path independently admitted pass","alternate later evaluation cannot flap consumed branch pass","conditional join and outcome omit inactive without success pass","unfinalized Eval cannot activate fail","stale assessment and scheduling without activation reject fail","only selected path independently admitted fail","alternate later evaluation cannot flap consumed branch fail","repair is new R execution and new E2 judgment, never retry A","conditional join and outcome omit inactive without success fail","authorized human approve_override routes without direct execution or rewritten decision","authorized human abort routes without direct execution or rewritten decision"]} + + +===== static_policy_recovery.log ===== +PASS condition fact and crash before activation do not let recovery invent a path +PASS two fresh controllers publish exactly one branch activation +PASS consumed downstream attempt cannot retry or change branch after crash +PASS lost selected effect reply stays consumed; independent SQLite verification resolves it without retry +PASS branch after_branch retains exact path without continuation +PASS branch immutable retains exact path without continuation +PASS fresh subgraph finalizers race for one receipt; parent then binds it +PASS subgraph after_subgraph survives exact recovery without implied parent execution +PASS subgraph immutable survives exact recovery without implied parent execution +{"ok":true,"checks":9,"scenarios":["condition fact and crash before activation do not let recovery invent a path","two fresh controllers publish exactly one branch activation","consumed downstream attempt cannot retry or change branch after crash","lost selected effect reply stays consumed; independent SQLite verification resolves it without retry","branch after_branch retains exact path without continuation","branch immutable retains exact path without continuation","fresh subgraph finalizers race for one receipt; parent then binds it","subgraph after_subgraph survives exact recovery without implied parent execution","subgraph immutable survives exact recovery without implied parent execution"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-UXd6RX"} + + +===== static_policy_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== static_subgraph_integration.log ===== +PASS all internal facts without subgraph terminal event block parent +PASS recovery cannot invent subgraph completion +PASS parent binds exact subgraph receipt and output without copying internal terminal list +PASS subgraph provenance and independent parent execution survive graph finalization +PASS budget exhaustion blocks new dispatch but permits consumed A resolution +PASS budget ceiling cannot be raised through a mutable workflow +PASS anchored budget mutation rejects after run start +PASS explicit failure-review strategy requires new authorized decision and preserves denial +PASS required terminal rejection follows explicit fail policy +PASS required terminal rejection follows explicit block policy +PASS fanout optional rejection remains history while required siblings succeed +PASS failed subgraph terminal seals unfinished unconsumed members and blocks parent +{"ok":true,"checks":12,"scenarios":["all internal facts without subgraph terminal event block parent","recovery cannot invent subgraph completion","parent binds exact subgraph receipt and output without copying internal terminal list","subgraph provenance and independent parent execution survive graph finalization","budget exhaustion blocks new dispatch but permits consumed A resolution","budget ceiling cannot be raised through a mutable workflow","anchored budget mutation rejects after run start","explicit failure-review strategy requires new authorized decision and preserves denial","required terminal rejection follows explicit fail policy","required terminal rejection follows explicit block policy","fanout optional rejection remains history while required siblings succeed","failed subgraph terminal seals unfinished unconsumed members and blocks parent"]} + + +===== typescript_after.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/typescript-1790826898538","package_substitution_denials":3,"installed_package":false,"artifact_tamper_denials":2,"historical_bytes_unchanged":true,"ok":true,"boundary":"after_commit","native_generic":true,"actual_sigkill":true,"controller_restart":true,"participant_restart":true,"checkpoint":true,"logical_effects":1,"concurrency":{"contenders":4,"admitted":1,"denied":3},"negative_correlations":15,"trust_denials":13,"no_new_reader":true,"privacy":true} + + +===== typescript_before.log ===== +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/tmp/typescript-1790826941394","package_substitution_denials":3,"installed_package":false,"artifact_tamper_denials":2,"historical_bytes_unchanged":true,"ok":true,"boundary":"before_commit","native_generic":true,"actual_sigkill":true,"controller_restart":true,"participant_restart":true,"checkpoint":true,"logical_effects":1,"concurrency":{"contenders":4,"admitted":1,"denied":3},"negative_correlations":15,"trust_denials":13,"no_new_reader":true,"privacy":true} + + +===== typescript_build.log ===== +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental build +> tsc + + + +===== typescript_package.log ===== +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental test +> npm run build && node --test test/*.mjs + +npm warn Unknown env config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental build +> tsc + +✔ native generic shape and deterministic independent codec (8.714639ms) +✔ deny run_id (1.349489ms) +✔ deny step_id (1.198561ms) +✔ deny attempt_id (1.247258ms) +✔ deny effect_id (1.178906ms) +✔ deny execution_result_ref (0.826638ms) +✔ deny assurance_ref (0.637071ms) +✔ deny swapped refs (0.683085ms) +✔ deny malformed ref ../../secret (0.562456ms) +✔ deny malformed ref https://example.invalid (0.562227ms) +✔ deny malformed ref sha256:ZZ (0.417681ms) +✔ deny namespace (0.404865ms) +✔ deny invocation_id (0.567744ms) +✔ deny bad identifier (0.399343ms) +✔ deny bad identifier (0.32697ms) +✔ deny missing extension (0.370857ms) +✔ deny unknown extension (0.371447ms) +✔ deny duplicate extensions (0.518302ms) +✔ deny nested value (0.377669ms) +✔ deny oversize (0.447774ms) +✔ deny reported is not commit (0.338065ms) +✔ deny knowledge mismatch (0.509452ms) +✔ wire canonical identity rejects whitespace/reordering/duplicates/invalid UTF8 (0.81524ms) +✔ untrusted profile (0.275949ms) +✔ untrusted repo (0.129214ms) +✔ untrusted config_revision (0.113503ms) +✔ untrusted dispatch_run_id (0.12753ms) +✔ untrusted dispatch_step_id (0.119218ms) +✔ untrusted dispatch_attempt_id (0.153011ms) +✔ untrusted dispatch_effect_id (0.112007ms) +✔ untrusted assurance_ref (0.111509ms) +✔ untrusted trusted_root (0.108582ms) +✔ untrusted verifier (0.173121ms) +✔ untrusted principal (0.161495ms) +✔ standalone requires host, no fabricated authority (0.26869ms) +✔ extension identifier cannot contain newline call_id (0.478949ms) +✔ extension identifier cannot contain newline process_instance_id (0.399727ms) +✔ null effect extension is supported without fake effect facts (0.459786ms) +✔ closed shape rejects joined-key collisions and inherited members (1.431757ms) +✔ codec errors never echo malformed private input (0.672944ms) +✔ published portable vectors independently reproduced (5.33512ms) +✔ packaged assets retain exact published hashes (3.314725ms) +✔ independent package runs away from all ecosystem checkouts and rejects schema substitution (1949.634393ms) +✔ direct process without host cannot invent admission (355.076076ms) +{"schema":"kujo.participant-sdk-conformance/v1alpha1","cases":[{"name":"roundtrip","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:80731b9f440c145f509af59d5212255ab57f970bffb0791fe8251748f3d6061b","value":{"assurance_ref":null,"completion_knowledge":"unknown","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"provisional","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:80731b9f440c145f509af59d5212255ab57f970bffb0791fe8251748f3d6061b","value":{"assurance_ref":null,"completion_knowledge":"unknown","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"terminal","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a227265706f72746564222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:6f3de8008e22d4f17b15c93a1af06532f9b697521bd95e29efd478daa76bb1e3","value":{"assurance_ref":null,"completion_knowledge":"reported","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"readback-unknown","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:80731b9f440c145f509af59d5212255ab57f970bffb0791fe8251748f3d6061b","value":{"assurance_ref":null,"completion_knowledge":"unknown","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"readback-selected","code":"ok","hex":"7b226173737572616e63655f726566223a227368613235363a32323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:7d43a29eef2a137bfacfc76306fb8c52137c2a62a554bab662132e39f00921da","value":{"assurance_ref":"sha256:2222222222222222222222222222222222222222222222222222222222222222","completion_knowledge":"unknown","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"no-effect-extension","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a6e756c6c2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:f1bfc4b7f67faa02bc1131a1aa22f2394a5d744f3627c5f14da6ddc307e203d3","value":{"assurance_ref":null,"completion_knowledge":"unknown","effect_extension":null,"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"wrong-provisional","code":"invalid_knowledge"},{"name":"wrong-terminal","code":"invalid_knowledge"},{"name":"matching","code":"match"},{"name":"subject.run_id","code":"subject_mismatch"},{"name":"subject.step_id","code":"subject_mismatch"},{"name":"subject.attempt_id","code":"subject_mismatch"},{"name":"subject.effect_id","code":"subject_mismatch"},{"name":"participant.invocation_id","code":"participant_mismatch"},{"name":"execution_result_ref","code":"result_ref_mismatch"},{"name":"assurance_ref","code":"assurance_ref_mismatch"},{"name":"participant_extension.values.call_id","code":"extension_mismatch"},{"name":"effect_extension.values.commitment","code":"extension_mismatch"},{"name":"completion_knowledge","code":"knowledge_mismatch"},{"name":"unknown-owner","code":"unsupported_extension"},{"name":"unknown-extension","code":"unsupported_extension"},{"name":"unknown-effect","code":"unsupported_extension"},{"name":"nested","code":"invalid_handoff"},{"name":"long-id","code":"invalid_handoff"},{"name":"newline-id","code":"invalid_handoff"},{"name":"opaque-attempt","code":"invalid_handoff"},{"name":"bad-ref","code":"invalid_handoff"},{"name":"uppercase-ref","code":"invalid_handoff"},{"name":"truth-not-knowledge","code":"invalid_handoff"},{"name":"missing-participant","code":"invalid_handoff"},{"name":"unknown-field","code":"invalid_handoff"},{"name":"oversize-extension","code":"invalid_handoff"},{"name":"whitespace","code":"invalid_handoff"},{"name":"reordered","code":"invalid_handoff"},{"name":"duplicate","code":"invalid_handoff"},{"name":"alternate_escape","code":"invalid_handoff"},{"name":"invalid_utf8","code":"invalid_handoff"},{"name":"oversize","code":"bounds_exceeded"},{"name":"surrogate","code":"invalid_handoff"},{"name":"registration-copy","code":"ok","hex":"7b226173737572616e63655f726566223a6e756c6c2c22636f6d706c6574696f6e5f6b6e6f776c65646765223a22756e6b6e6f776e222c226566666563745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e6566666563742d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b22636f6d6d69746d656e74223a2261616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161222c226566666563745f616c696173223a22616c6961732d31227d7d2c22657865637574696f6e5f726573756c745f726566223a227368613235363a31313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131222c227061727469636970616e74223a7b22696e766f636174696f6e5f6964223a22696e766f636174696f6e2d31222c226e616d657370616365223a226578616d706c652e7265636f72646572227d2c227061727469636970616e745f657874656e73696f6e223a7b22736368656d61223a226578616d706c652e7265636f726465722d636f7272656c6174696f6e2f7631616c70686131222c2276616c756573223a7b2263616c6c5f6964223a2263616c6c2d31222c2270726f636573735f696e7374616e63655f6964223a2270726f636573732d31227d7d2c22736368656d61223a226b756a6f2e696e7465726f702d68616e646f66662f7631616c70686131222c227375626a656374223a7b22617474656d70745f6964223a2231222c226566666563745f6964223a226566666563742d31222c2272756e5f6964223a2272756e2d31222c22737465705f6964223a22737465702d31227d7d","ref":"sha256:80731b9f440c145f509af59d5212255ab57f970bffb0791fe8251748f3d6061b","value":{"assurance_ref":null,"completion_knowledge":"unknown","effect_extension":{"schema":"example.effect-correlation/v1alpha1","values":{"commitment":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","effect_alias":"alias-1"}},"execution_result_ref":"sha256:1111111111111111111111111111111111111111111111111111111111111111","participant":{"invocation_id":"invocation-1","namespace":"example.recorder"},"participant_extension":{"schema":"example.recorder-correlation/v1alpha1","values":{"call_id":"call-1","process_instance_id":"process-1"}},"schema":"kujo.interop-handoff/v1alpha1","subject":{"attempt_id":"1","effect_id":"effect-1","run_id":"run-1","step_id":"step-1"}}},{"name":"registration-unknown-type","code":"invalid_registration"},{"name":"registration-no-participant","code":"invalid_registration"},{"name":"cannot-install-effect-from-wire","code":"unsupported_extension"},{"name":"content-bytes","code":"ok","ref":"sha256:712450d3c4a79eea9509e75dc1dacdeff58034df538536cfae2da882bd8a0c50"},{"name":"bytes-only","code":"invalid_handoff"}]} +✔ test/sdk-conformance.mjs (376.010926ms) +ℹ tests 45 +ℹ suites 0 +ℹ pass 45 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 2716.564568 diff --git a/docs/evidence/graph-attempt-accounting/canonical.txt b/docs/evidence/graph-attempt-accounting/canonical.txt new file mode 100644 index 0000000..798c407 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/canonical.txt @@ -0,0 +1,155 @@ +Runtime directory durability contract passed. +Dispatch release gate +Runtime: /Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified +Shards: 24 +Source tests: 101 + +Running smoke-gate regression checks... +Source layout passed. +Smoke gate tests passed (success, silent failure, diagnostics). +Run locking, at-least-once crash replay, and external idempotency passed. +Webhook JSONL validated: 150 unique events. +Pinned installer bridge path resolved. +Isolated bridge package smoke passed. +{"status":"passed","route":"operator-approved localhost SDK/bridge HTTP route","model":"local-release-probe","requests":[{"method":"POST","path":"/v1/chat/completions","model":"local-release-probe"}],"remote_provider_certification":false} +First workflow and scoped plugin walkthrough passed. +Running focused integration suites... +typescript_build passed. Evidence: tests/tmp/dispatch-test-shards/logs/typescript_build.log +preservation_binding passed. Evidence: tests/tmp/dispatch-test-shards/logs/preservation_binding.log +parent_finalization passed. Evidence: tests/tmp/dispatch-test-shards/logs/parent_finalization.log +static_policy_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_contracts.log +static_policy_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_integration.log +static_subgraph_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_subgraph_integration.log +static_policy_edges passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_edges.log +static_policy_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_recovery.log +graph_attempt_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_vectors.log +graph_attempt_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_contracts.log +graph_attempt_binding_safety passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_binding_safety.log +graph_attempt_authority passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_authority.log +graph_attempt_smoke passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_smoke.log +graph_attempt_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_integration.log +graph_attempt_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_recovery.log +graph_attempt_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_policy.log +static_policy_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_vectors.log +heterogeneous_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_contracts.log +heterogeneous_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_integration.log +heterogeneous_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_policy.log +heterogeneous_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_recovery.log +heterogeneous_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_vectors.log +node_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_contracts.log +node_composition passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_composition.log +node_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_policy.log +node_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_recovery.log +node_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_vectors.log +parent_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/parent_vectors.log +retained_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/retained_recovery.log +effect_set passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_set.log +effect_continuation passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_continuation.log +sequential_effects passed. Evidence: tests/tmp/dispatch-test-shards/logs/sequential_effects.log +effect_lifecycle_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_lifecycle_vectors.log +effect_selection_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_selection_vectors.log +effect_set_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_set_vectors.log +go_participant passed. Evidence: tests/tmp/dispatch-test-shards/logs/go_participant.log +typescript_package passed. Evidence: tests/tmp/dispatch-test-shards/logs/typescript_package.log +python_package passed. Evidence: tests/tmp/dispatch-test-shards/logs/python_package.log +python_parity passed. Evidence: tests/tmp/dispatch-test-shards/logs/python_parity.log +participant_sdk_parity passed. Evidence: tests/tmp/dispatch-test-shards/logs/participant_sdk_parity.log +python_isolation passed. Evidence: tests/tmp/dispatch-test-shards/logs/python_isolation.log +python_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/python_integration.log +typescript_after passed. Evidence: tests/tmp/dispatch-test-shards/logs/typescript_after.log +typescript_before passed. Evidence: tests/tmp/dispatch-test-shards/logs/typescript_before.log +control_boundary passed. Tests: 14 total, 14 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/control_boundary.log +failure_gate_safety passed. Tests: 20 total, 20 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/failure_gate_safety.log +failure_gate_execution passed. Tests: 6 total, 6 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/failure_gate_execution.log +review_checkpoint passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/review_checkpoint.log +persisted_negotiation_legacy passed. Evidence: tests/tmp/dispatch-test-shards/logs/persisted_negotiation_legacy.log +persisted_negotiation_schemas passed. Evidence: tests/tmp/dispatch-test-shards/logs/persisted_negotiation_schemas.log +persisted_negotiation_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/persisted_negotiation_contracts.log +persisted_negotiation passed. Evidence: tests/tmp/dispatch-test-shards/logs/persisted_negotiation.log +persisted_negotiation_adapters passed. Evidence: tests/tmp/dispatch-test-shards/logs/persisted_negotiation_adapters.log +beta_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/beta_contracts.log +portable_commitments passed. Evidence: tests/tmp/dispatch-test-shards/logs/portable_commitments.log +portable_clean_room passed. Evidence: tests/tmp/dispatch-test-shards/logs/portable_clean_room.log +interop_oracles passed. Evidence: tests/tmp/dispatch-test-shards/logs/interop_oracles.log +interop_history passed. Evidence: tests/tmp/dispatch-test-shards/logs/interop_history.log +git_participant_after passed. Evidence: tests/tmp/dispatch-test-shards/logs/git_participant_after.log +git_participant_before passed. Evidence: tests/tmp/dispatch-test-shards/logs/git_participant_before.log +http_response_loss passed. Evidence: tests/tmp/dispatch-test-shards/logs/http_response_loss.log +http_timeout_before passed. Evidence: tests/tmp/dispatch-test-shards/logs/http_timeout_before.log +http_application_error passed. Evidence: tests/tmp/dispatch-test-shards/logs/http_application_error.log +mcp_ability passed. Evidence: tests/tmp/dispatch-test-shards/logs/mcp_ability.log +mcp_stdio_loss passed. Evidence: tests/tmp/dispatch-test-shards/logs/mcp_stdio_loss.log +sdk_ability passed. Evidence: tests/tmp/dispatch-test-shards/logs/sdk_ability.log +beta_migration passed. Evidence: tests/tmp/dispatch-test-shards/logs/beta_migration.log +assurance_compatibility passed. Evidence: tests/tmp/dispatch-test-shards/logs/assurance_compatibility.log +assurance_capabilities passed. Evidence: tests/tmp/dispatch-test-shards/logs/assurance_capabilities.log +effect_assurance_schema passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_assurance_schema.log +effect_assurance passed. Evidence: tests/tmp/dispatch-test-shards/logs/effect_assurance.log +ability_assurance passed. Evidence: tests/tmp/dispatch-test-shards/logs/ability_assurance.log +reexecution_lifecycle passed. Evidence: tests/tmp/dispatch-test-shards/logs/reexecution_lifecycle.log +resume_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/resume_policy.log +decision_claim passed. Evidence: tests/tmp/dispatch-test-shards/logs/decision_claim.log +sdk_adapter passed. Tests: 10 total, 10 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/sdk_adapter.log +policy_precedence passed. Tests: 3 total, 3 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/policy_precedence.log +retrieval_preferences passed. Tests: 3 total, 3 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/retrieval_preferences.log +routing passed. Tests: 31 total, 31 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/routing.log +state_store_sqlite passed. Tests: 1 total, 1 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/state_store_sqlite.log +operational_controls passed. Tests: 9 total, 9 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/operational_controls.log +hardening passed. Tests: 8 total, 8 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/hardening.log + +Running sharded Dispatch contract suite... +Shard 1/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_1.kujo +dispatch-1 passed. Tests: 5 total, 5 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-1.log +Shard 2/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_2.kujo +dispatch-2 passed. Tests: 5 total, 5 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-2.log +Shard 3/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_3.kujo +dispatch-3 passed. Tests: 5 total, 5 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-3.log +Shard 4/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_4.kujo +dispatch-4 passed. Tests: 5 total, 5 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-4.log +Shard 5/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_5.kujo +dispatch-5 passed. Tests: 5 total, 5 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-5.log +Shard 6/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_6.kujo +dispatch-6 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-6.log +Shard 7/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_7.kujo +dispatch-7 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-7.log +Shard 8/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_8.kujo +dispatch-8 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-8.log +Shard 9/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_9.kujo +dispatch-9 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-9.log +Shard 10/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_10.kujo +dispatch-10 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-10.log +Shard 11/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_11.kujo +dispatch-11 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-11.log +Shard 12/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_12.kujo +dispatch-12 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-12.log +Shard 13/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_13.kujo +dispatch-13 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-13.log +Shard 14/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_14.kujo +dispatch-14 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-14.log +Shard 15/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_15.kujo +dispatch-15 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-15.log +Shard 16/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_16.kujo +dispatch-16 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-16.log +Shard 17/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_17.kujo +dispatch-17 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-17.log +Shard 18/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_18.kujo +dispatch-18 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-18.log +Shard 19/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_19.kujo +dispatch-19 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-19.log +Shard 20/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_20.kujo +dispatch-20 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-20.log +Shard 21/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_21.kujo +dispatch-21 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-21.log +Shard 22/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_22.kujo +dispatch-22 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-22.log +Shard 23/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_23.kujo +dispatch-23 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-23.log +Shard 24/24: tests/tmp/dispatch-test-shards/dispatch_tests_shard_24.kujo +dispatch-24 passed. Tests: 4 total, 4 passed, 0 failed Evidence: tests/tmp/dispatch-test-shards/logs/dispatch-24.log + +Running command-surface smoke... + +Running bounded release workload evidence... +Dispatch v1.1 evidence passed: 3/3 runs in 15s +Evidence: tests/tmp/v1.1-evidence/evidence.json +Dispatch release gate passed. diff --git a/docs/evidence/graph-attempt-accounting/development.txt b/docs/evidence/graph-attempt-accounting/development.txt new file mode 100644 index 0000000..0bb30ab --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/development.txt @@ -0,0 +1,267 @@ +===== dev-attempt-contracts-1.log ===== +{"checks":12,"ok":true} + + +===== dev-attempt-contracts-2.log ===== +{"checks":14,"ok":true} + + +===== dev-authority-1.log ===== +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: ++ actual - expected + ++ { ++ binding_ref: 'sha256:e16b55d0e9cdfc9b125e650e0c12e898819b25f7baf67867d06052f218e4fadf', ++ consumer: { ++ attempt_id: '1', ++ run_id: 'run-1790806869846-5772', ++ step_id: 'action' ++ }, ++ node_id: 'B' ++ } +- null + + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/graph_attempt_authority.mjs:5:460 + at ModuleJob.run (node:internal/modules/esm/module_job:569:25) + at async node:internal/modules/esm/loader:650:26 + at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) { + generatedMessage: true, + code: 'ERR_ASSERTION', + actual: { + binding_ref: 'sha256:e16b55d0e9cdfc9b125e650e0c12e898819b25f7baf67867d06052f218e4fadf', + consumer: { + attempt_id: '1', + run_id: 'run-1790806869846-5772', + step_id: 'action' + }, + node_id: 'B' + }, + expected: null, + operator: 'strictEqual', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== dev-bound-descendant-1.log ===== +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","candidate":{"action":"retry","authority_ref":"sha256:5a72174e614b2e6c85424e3fe15ec2f9000618ff1640a2491284d3a2c80d3acf","binding_ref":"sha256:ff73781af65775b555b4caeb88764fa3974a8b26cbfcdb4336fbf7b547fd51d6","candidate_id":"4f1704e02e327b1a8ba32dd3908b45e8a3ff03a700261eab21f6b6be241b1643","child_source_sha256":"c474fee77bd1051c77f6c3b58540f443529d92eb99e29c3363a6a6c2c9b7c6f5","graph":{"run_id":"run-1790807646189-2691","workflow_ref":"sha256:28fe509b297de34b1d58cfea99064daf7b215155e780d432452df2dbe860719e"},"journal":"cbcf9139616f81a869a80f1c6ae8e11da704173c2e1fe2c096b31529e2078c84","node_id":"B","ordinal":2,"previous_terminal_ref":"sha256:054034ec5916ddc9798fb49900332c2029173966ab25da32659749fbb490a57f","revision":6,"run_id":"run-1790807643094-2374","schema":"dispatch.attempt-candidate/v1alpha1","source_sha256":"cae0c86d5ffc73d81f92e7db6e2f55b9366b0512005c75fe95ffc8a4ea92a2ea"},"ok":true} + +true !== false + + at file:///private/tmp/dispatch-attempt-evidence/bound-descendant-focused.mjs:14:647 { + generatedMessage: false, + code: 'ERR_ASSERTION', + actual: true, + expected: false, + operator: 'strictEqual', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== dev-bound-descendant-2.log ===== +PASS retry cannot retire a terminal already bound by an undispatched program descendant +{"ok":true,"checks":1,"proofs":["retry cannot retire a terminal already bound by an undispatched program descendant"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-cANCi1"} + + +===== dev-contracts.log ===== +{"checks":14,"ok":true} + + +===== dev-go-1.log ===== +node:internal/modules/esm/resolve:272 + throw new ERR_MODULE_NOT_FOUND( + ^ + +Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/interop/typescript-participant/dist/codec.js' imported from /Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/go_participant_conformance.mjs + at finalizeResolution (node:internal/modules/esm/resolve:272:11) + at moduleResolve (node:internal/modules/esm/resolve:879:10) + at defaultResolve (node:internal/modules/esm/resolve:1006:11) + at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20) + at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38) + at ModuleLoader.resolveSync (node:internal/modules/esm/loader:766:56) + at #resolve (node:internal/modules/esm/loader:690:17) + at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:610:35) + at node:internal/modules/esm/loader:639:32 + at TracingChannel.tracePromise (node:diagnostics_channel:538:22) { + code: 'ERR_MODULE_NOT_FOUND', + url: 'file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/interop/typescript-participant/dist/codec.js' +} + +Node.js v26.7.0 + + +===== dev-go-2.log ===== +{"ok":true,"checks":150,"mcpChecks":5,"malformedChecks":9,"wireSHA256":"f87fd01de248eca96c685282b3ead0a95578f77f6c597f598fc9d587f0bec262","independence":"Go standard library; CLI and MCP share one codec"} + + +===== dev-integration-1.log ===== +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","ok":false,"reason":"Error { line: 0, message: commitment_bound, stack: [, outcome_facts, scoped_outcome_facts, portable_json] }"} + +false !== true + + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/graph_attempt_integration.mjs:14:111 + at ModuleJob.run (node:internal/modules/esm/module_job:569:25) + at async node:internal/modules/esm/loader:650:26 + at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) { + generatedMessage: false, + code: 'ERR_ASSERTION', + actual: false, + expected: true, + operator: 'strictEqual', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== dev-integration-2.log ===== +PASS A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize +PASS two refused attempts exhaust node ceiling; no third attempt and original failures retained +PASS graph budget exhaustion blocks retry without refund or fabricated terminal failure +PASS operator revocation denies reservation without consuming capacity +PASS changed producer bytes cannot become a newer retry input +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-YPyPTM","checks":5,"proofs":["A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize","two refused attempts exhaust node ceiling; no third attempt and original failures retained","graph budget exhaustion blocks retry without refund or fabricated terminal failure","operator revocation denies reservation without consuming capacity","changed producer bytes cannot become a newer retry input"]} + + +===== dev-policy-1.log ===== +PASS Eval branch activation consumes zero program units; inactive repair node has no attempt + + +===== dev-policy-2.log ===== +PASS Eval branch activation consumes zero program units; inactive repair node has no attempt +PASS subgraph receipt adds no execution unit; human decision is separate from three member dispatches +PASS held optional reservation prevents graph sealing; release and cancellation remain explicit +{"ok":true,"checks":3,"proofs":["Eval branch activation consumes zero program units; inactive repair node has no attempt","subgraph receipt adds no execution unit; human decision is separate from three member dispatches","held optional reservation prevents graph sealing; release and cancellation remain explicit"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-FSGBLC"} + + +===== dev-recovery-1.log ===== +PASS two fresh controllers reserve exactly one last graph unit +PASS release contention records one release and restores only never-dispatched capacity +PASS crash A: durable reservation before binding releases without phantom execution +PASS crash before_child_load: consumed dispatch is not redelivered, released or retried +PASS crash before_node_admission: consumed dispatch is not redelivered, released or retried +PASS crash after_node_admission: consumed dispatch is not redelivered, released or retried +PASS same-node retry and next-attempt creation race publishes one new reserved instance +PASS crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay +PASS orphan reserve: immutable record/index gap repaired by fresh controller without execution +PASS orphan release: immutable record/index gap repaired by fresh controller without execution +PASS orphan retry: immutable record/index gap repaired by fresh controller without execution +{"ok":true,"checks":11,"proofs":["two fresh controllers reserve exactly one last graph unit","release contention records one release and restores only never-dispatched capacity","crash A: durable reservation before binding releases without phantom execution","crash before_child_load: consumed dispatch is not redelivered, released or retried","crash before_node_admission: consumed dispatch is not redelivered, released or retried","crash after_node_admission: consumed dispatch is not redelivered, released or retried","same-node retry and next-attempt creation race publishes one new reserved instance","crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay","orphan reserve: immutable record/index gap repaired by fresh controller without execution","orphan release: immutable record/index gap repaired by fresh controller without execution","orphan retry: immutable record/index gap repaired by fresh controller without execution"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-ty7bmZ"} + + +===== dev-recovery-2.log ===== +PASS two fresh controllers reserve exactly one last graph unit +PASS release contention records one release and restores only never-dispatched capacity +PASS crash A: durable reservation before binding releases without phantom execution +PASS crash before_child_load: consumed dispatch is not redelivered, released or retried +PASS crash before_node_admission: consumed dispatch is not redelivered, released or retried +PASS crash after_node_admission: consumed dispatch is not redelivered, released or retried +PASS same-node retry and next-attempt creation race publishes one new reserved instance +PASS crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay +PASS orphan reserve: immutable record/index gap repaired by fresh controller without execution +PASS orphan release: immutable record/index gap repaired by fresh controller without execution +PASS orphan retry: immutable record/index gap repaired by fresh controller without execution +{"ok":true,"checks":11,"proofs":["two fresh controllers reserve exactly one last graph unit","release contention records one release and restores only never-dispatched capacity","crash A: durable reservation before binding releases without phantom execution","crash before_child_load: consumed dispatch is not redelivered, released or retried","crash before_node_admission: consumed dispatch is not redelivered, released or retried","crash after_node_admission: consumed dispatch is not redelivered, released or retried","same-node retry and next-attempt creation race publishes one new reserved instance","crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay","orphan reserve: immutable record/index gap repaired by fresh controller without execution","orphan release: immutable record/index gap repaired by fresh controller without execution","orphan retry: immutable record/index gap repaired by fresh controller without execution"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-sd9bmJ"} + + +===== dev-report-1.log ===== +[KUJOVM001] [vm] Runtime Error: Failed to evaluate module 'workcell.src.workspace.workspace': Module not found: src.util; Check that 'src.util' exists as a flat .kujo file or a nested src/... path under the package root, and confirm the import name matches the on-disk layout. + --> 0:0 + + + +===== dev-report-2.log ===== +{"ok":true,"report":{"attempts":[{"accounting":"released","admission":"refused_before_admission","node_id":"A","ordinal":1,"previous_terminal_ref":null,"reservation_id":"50eb44fa3d2a4d8c62b6f671b25445b0f65e22d404c7ace494338435280f68a0","run_id":"run-1790806592341-7487","terminal":null,"work":"never_admitted"},{"accounting":"consumed","admission":"refused_before_admission","node_id":"A","ordinal":1,"previous_terminal_ref":null,"reservation_id":"6129051a48c617fae9a483d9b10dee62a6454e1dcb37ebde2afac7366a5b256b","run_id":"run-1790806592341-7487","terminal":{"authority_ref":"sha256:18a95ea74de4750028f8183517451851756ec8f64e1c80abb086a4c513a21f01","contract":"program-attempt/v1alpha1","facts_ref":"sha256:8b8fcc4b7f306f9e1b9d81fb117466eb2582732bf5fdfda05e46edf05e5b63c1","finalized_revision":3,"node_id":"A","outcome":"failed","schema":"dispatch.node-terminal/v1alpha1","subject":{"attempt_id":"1","run_id":"run-1790806592341-7487","step_id":"action"}},"work":"never_admitted"},{"accounting":"consumed","admission":"consumed","node_id":"A","ordinal":2,"previous_terminal_ref":"sha256:437d05bedca4b12ca8c09d89bf3bd4d166127cfebcfd266dbc77552c874c7a8e","reservation_id":"91fffb1be2240966b6273708554f0c9430acdbbfecdc24bf868ffa0f0fd7ae80","run_id":"run-1790806594809-8535","terminal":null,"work":"result_recorded"}],"authority":"informational","budget":{"available":6,"consumed":2,"exhausted":false,"limit":8,"nodes":[{"consumed":2,"limit":2,"node_id":"A","remaining":0,"reserved":0}],"on_exhaustion":"block","released":1,"reserved":0,"unit":"program_dispatches","used":2},"decision_instances":[],"evaluation_instances":[],"journal":"1a4ced9b5bf8a7dffaac15e57a68d1c9e2967ce1f04614feb82947de61368604","revision":11,"run_id":"run-1790806596627-9410","schema":"dispatch.attempt-accounting-report/v1alpha1"}} + + +===== dev-result-recovery-1.log ===== +PASS crash F: durable terminal observation repairs stale accounting without refund or graph finalization +PASS orphan child refusal remains sealed through exact retained-host repair +{"ok":true,"checks":2,"proofs":["crash F: durable terminal observation repairs stale accounting without refund or graph finalization","orphan child refusal remains sealed through exact retained-host repair"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-XsUtYr"} + + +===== dev-smoke-1.log ===== +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: Failed to parse module 'src.core.retained_recovery': 273:1: Expected '}' to close function body but found Eof + --> 0:0 + + + +4 !== 0 + + at command (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/node_composition_helpers.mjs:12:149) + at run (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/node_composition_helpers.mjs:14:205) + at setup (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/node_composition_helpers.mjs:16:1287) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/graph_attempt_smoke.mjs:3:9 + at ModuleJob.run (node:internal/modules/esm/module_job:569:25) + at async node:internal/modules/esm/loader:650:26 + at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5) { + generatedMessage: false, + code: 'ERR_ASSERTION', + actual: 4, + expected: 0, + operator: 'strictEqual', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== dev-smoke-2.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-lIcSt1","checks":8} + + +===== dev-smoke-3.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-jsnRq2","checks":8} + + +===== dev-ts-build.log ===== +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental build +> tsc + + + +===== dev-vectors-1.log ===== +{"checker":"kujo","ok":true,"vectors":2} + + +===== dev-policy-1-interruption.json ===== +{ + "reason": "Stop this development-only run before editing its pinned source to fix the independently reproduced ledger commitment_bound failure; full suite will rerun.", + "pids": [ + 64930, + 68556 + ], + "completed_checks": 1 +} + + +===== canonical-wrapper-note.txt ===== +Replaced the unstarted canonical wait wrapper to use an immutable copy of the verified Kujo binary; no gate was interrupted. +Canonical gate remains unstarted; final review is checking immutable downstream input bindings before source freeze. + +===== Canonical validator failure, reconstructed from retained conversation tool output ===== +Source: 74800d5ca01179f4c3e794b3fb26af93005cfd5c. +Command: KUJO_BIN=/tmp/dispatch-attempt-evidence/kujo-verified DISPATCH_OFFLINE_FIXTURE=true bash scripts/run_release_gate.sh +Result: exit 1 at graph_attempt_integration; Error: no schema with key or ref "https://json-schema.org/draft/2020-12/schema". +The new test imported ajv/dist/ajv.js instead of ajv/dist/2020.js. Correction 9edf94a uses the installed Draft 2020-12 validator. The schema compiled and the corrected focused graph_attempt_integration.mjs passed all five checks, with exact input, lineage, graph/node ceilings, operator revocation and changed-artifact rejection. The full canonical rerun then progressed through smoke, parent finalization, static graph policy/recovery, attempt contracts/bindings/authority/smoke before a host restart. Its active integration log was incomplete; no full-gate result is inferred. Temporary transcripts were removed by restart; surviving per-suite logs are retained separately. A fresh complete gate is required and is recorded in canonical.txt only after completion. diff --git a/docs/evidence/graph-attempt-accounting/environment-interruption.txt b/docs/evidence/graph-attempt-accounting/environment-interruption.txt new file mode 100644 index 0000000..f41272a --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/environment-interruption.txt @@ -0,0 +1 @@ +The full canonical rerun at source 9edf94a1cfb6c95edd59dcd27b56cc8b367855e4 stopped when the host restarted. On resume, exec session 85343 was absent, no release-gate process existed, uptime was 32 minutes, and /tmp/dispatch-attempt-evidence was gone. No terminal pass or failure is inferred. Surviving repository-local per-suite logs were copied to interrupted-canonical before rerun. Earlier baseline/focused/development transcripts had already been preserved in docs/evidence/graph-attempt-accounting. Their source-artifact manifest records some now-unavailable temporary originals. The first canonical run had failed at the Draft 2020-12 test validator; that correction is committed as 9edf94a. The corrected focused integration passed five checks before restart (conversation tool evidence), but its temporary transcript was lost; it will be rerun in the full gate. Kujo gates passed before restart, but temporary transcripts were lost and will be regenerated. diff --git a/docs/evidence/graph-attempt-accounting/failed-canonical-effect-set.txt b/docs/evidence/graph-attempt-accounting/failed-canonical-effect-set.txt new file mode 100644 index 0000000..5f6f078 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/failed-canonical-effect-set.txt @@ -0,0 +1,393 @@ +===== canonical.log ===== +Runtime directory durability contract passed. +Dispatch release gate +Runtime: /Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified +Shards: 24 +Source tests: 101 + +Running smoke-gate regression checks... +Source layout passed. +Smoke gate tests passed (success, silent failure, diagnostics). +Run locking, at-least-once crash replay, and external idempotency passed. +Webhook JSONL validated: 150 unique events. +Pinned installer bridge path resolved. +Isolated bridge package smoke passed. +{"status":"passed","route":"operator-approved localhost SDK/bridge HTTP route","model":"local-release-probe","requests":[{"method":"POST","path":"/v1/chat/completions","model":"local-release-probe"}],"remote_provider_certification":false} +First workflow and scoped plugin walkthrough passed. +Running focused integration suites... +typescript_build passed. Evidence: tests/tmp/dispatch-test-shards/logs/typescript_build.log +preservation_binding passed. Evidence: tests/tmp/dispatch-test-shards/logs/preservation_binding.log +parent_finalization passed. Evidence: tests/tmp/dispatch-test-shards/logs/parent_finalization.log +static_policy_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_contracts.log +static_policy_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_integration.log +static_subgraph_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_subgraph_integration.log +static_policy_edges passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_edges.log +static_policy_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_recovery.log +graph_attempt_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_vectors.log +graph_attempt_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_contracts.log +graph_attempt_binding_safety passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_binding_safety.log +graph_attempt_authority passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_authority.log +graph_attempt_smoke passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_smoke.log +graph_attempt_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_integration.log +graph_attempt_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_recovery.log +graph_attempt_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/graph_attempt_policy.log +static_policy_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/static_policy_vectors.log +heterogeneous_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_contracts.log +heterogeneous_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_integration.log +heterogeneous_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_policy.log +heterogeneous_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_recovery.log +heterogeneous_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/heterogeneous_vectors.log +node_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_contracts.log +node_composition passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_composition.log +node_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_policy.log +node_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_recovery.log +node_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/node_vectors.log +parent_vectors passed. Evidence: tests/tmp/dispatch-test-shards/logs/parent_vectors.log +retained_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/retained_recovery.log +effect_set failed (exit 1). Full evidence: tests/tmp/dispatch-test-shards/logs/effect_set.log +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: effect_set_fixture_failed + --> 0:0 + +Call stack: + 0 at require + + + at killAt (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/effect_set_integration.mjs:20:432) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/effect_set_integration.mjs:21:58 { + generatedMessage: false, + code: 'ERR_ASSERTION', + actual: false, + expected: true, + operator: '==', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== effect_set.log ===== +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: effect_set_fixture_failed + --> 0:0 + +Call stack: + 0 at require + + + at killAt (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/effect_set_integration.mjs:20:432) + at process.processTicksAndRejections (node:internal/process/task_queues:104:5) + at async file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting/tests/effect_set_integration.mjs:21:58 { + generatedMessage: false, + code: 'ERR_ASSERTION', + actual: false, + expected: true, + operator: '==', + diff: 'simple' +} + +Node.js v26.7.0 + + +===== graph_attempt_authority.log ===== +{"ok":true,"checks":3,"proofs":["operator revoked at final revalidation cannot reserve","changed child authority cannot dispatch or release an old reservation","ordinary execution failure is not a Dispatch pre-admission refusal"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-nPWldN"} + + +===== graph_attempt_binding_safety.log ===== +PASS downstream reservation blocks retry before child binding +PASS retry cannot retire a terminal already bound by an undispatched program descendant +{"ok":true,"checks":2,"proofs":["downstream reservation blocks retry before child binding","retry cannot retire a terminal already bound by an undispatched program descendant"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-Z5052m"} + + +===== graph_attempt_contracts.log ===== +{"checks":16,"ok":true} + + +===== graph_attempt_integration.log ===== +PASS A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize +PASS two refused attempts exhaust node ceiling; no third attempt and original failures retained +PASS graph budget exhaustion blocks retry without refund or fabricated terminal failure +PASS operator revocation denies reservation without consuming capacity +PASS changed producer bytes cannot become a newer retry input +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-pNP3wP","checks":5,"proofs":["A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize","two refused attempts exhaust node ceiling; no third attempt and original failures retained","graph budget exhaustion blocks retry without refund or fabricated terminal failure","operator revocation denies reservation without consuming capacity","changed producer bytes cannot become a newer retry input"]} + + +===== graph_attempt_policy.log ===== +PASS Eval branch activation consumes zero program units; inactive repair node has no attempt +PASS subgraph receipt adds no execution unit; human decision is separate from three member dispatches +PASS held optional reservation prevents graph sealing; release and cancellation remain explicit +{"ok":true,"checks":3,"proofs":["Eval branch activation consumes zero program units; inactive repair node has no attempt","subgraph receipt adds no execution unit; human decision is separate from three member dispatches","held optional reservation prevents graph sealing; release and cancellation remain explicit"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-JWLPWJ"} + + +===== graph_attempt_recovery.log ===== +PASS two fresh controllers reserve exactly one last graph unit +PASS release contention records one release and restores only never-dispatched capacity +PASS crash A: durable reservation before binding releases without phantom execution +PASS bound but undispatched reservation releases; its surviving input binding grants no admission +PASS crash before_child_load: consumed dispatch is not redelivered, released or retried +PASS crash before_node_admission: consumed dispatch is not redelivered, released or retried +PASS crash after_node_admission: consumed dispatch is not redelivered, released or retried +PASS same-node retry and next-attempt creation race publishes one new reserved instance +PASS crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay +PASS orphan reserve: immutable record/index gap repaired by fresh controller without execution +PASS orphan release: immutable record/index gap repaired by fresh controller without execution +PASS orphan retry: immutable record/index gap repaired by fresh controller without execution +PASS crash F: durable terminal observation repairs stale accounting without refund or graph finalization +PASS orphan child refusal remains sealed through exact retained-host repair +{"ok":true,"checks":14,"proofs":["two fresh controllers reserve exactly one last graph unit","release contention records one release and restores only never-dispatched capacity","crash A: durable reservation before binding releases without phantom execution","bound but undispatched reservation releases; its surviving input binding grants no admission","crash before_child_load: consumed dispatch is not redelivered, released or retried","crash before_node_admission: consumed dispatch is not redelivered, released or retried","crash after_node_admission: consumed dispatch is not redelivered, released or retried","same-node retry and next-attempt creation race publishes one new reserved instance","crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay","orphan reserve: immutable record/index gap repaired by fresh controller without execution","orphan release: immutable record/index gap repaired by fresh controller without execution","orphan retry: immutable record/index gap repaired by fresh controller without execution","crash F: durable terminal observation repairs stale accounting without refund or graph finalization","orphan child refusal remains sealed through exact retained-host repair"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-iwhBQQ"} + + +===== graph_attempt_smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-u8KqXA","checks":9} + + +===== graph_attempt_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":4} + + +===== heterogeneous_contracts.log ===== +{"checks":10,"ok":true} + + +===== heterogeneous_integration.log ===== +PASS unresolved program effects block parent and downstream +PASS producer terminal is not Eval or human completion +PASS wrong evaluation subject +PASS wrong original result identity +PASS stale evaluated output +PASS wrong evaluator revision +PASS incomplete evaluation +PASS Eval terminal uses actual evaluation-result without execution-result +PASS wrong human subject +PASS stale human revision +PASS wrong human input binding +PASS unauthorized human actor +PASS live human authority revocation between assessment and decision rejects +PASS pending human prevents graph completion +PASS authorized approval is immutable; conflicting denial rejects +PASS heterogeneous join records why B proceeds and grants no effect admission +PASS missing consumer output blocks its independent finalization +PASS all node facts without graph decision stay nonterminal +PASS changed required output cannot finalize graph +PASS required membership cannot be downgraded +PASS new required descendant invalidates anchored definition +PASS stale graph assessment cannot become terminal authority +PASS explicit graph success preserves independent node truth +PASS anchored Eval fail policy yields failed graph and blocks B without rewriting A +PASS optional cancellation is not execution; completion-only H independently gates graph success +{"ok":true,"checks":25,"evidence":["/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-69oZur/heterogeneous-success","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-69oZur/evaluation-failure","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-69oZur/optional-and-completion-only"]} + + +===== heterogeneous_policy.log ===== +PASS human abort retains decision semantics under graph policy +PASS human cancel retains decision semantics under graph policy +PASS optional Eval failure stays failed but does not fail required-success graph +PASS Eval fail mapped to review remains blocked, not automatically terminal failure +PASS unfinalized execution failure cannot become success or admit dependent +PASS consumer uncertainty leaves successful producer history unchanged +PASS optional cancellation cannot satisfy a success scheduling dependency +{"ok":true,"checks":7} + + +===== heterogeneous_recovery.log ===== +PASS Eval terminal reply loss survives a fresh controller without a fake execution +PASS actual human terminal orphan repairs exact decision but not graph completion +PASS all durable terminal facts and recovery still require separate graph decision +PASS two fresh finalizers: one exact durable graph terminal transition +PASS graph crash before_terminal preserves exact terminal boundary +PASS graph crash after_terminal preserves exact terminal boundary +PASS graph crash immutable preserves exact terminal boundary +PASS optional outstanding dispatch blocks graph finalization before child admission +{"ok":true,"checks":8,"scenarios":["Eval terminal reply loss survives a fresh controller without a fake execution","actual human terminal orphan repairs exact decision but not graph completion","all durable terminal facts and recovery still require separate graph decision","two fresh finalizers: one exact durable graph terminal transition","graph crash before_terminal preserves exact terminal boundary","graph crash after_terminal preserves exact terminal boundary","graph crash immutable preserves exact terminal boundary","optional outstanding dispatch blocks graph finalization before child admission"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-0W7GIu"} + + +===== heterogeneous_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== node_composition.log ===== +ROOT /var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-7JzsQP/two +PASS producer output exists without finalization: consumer blocked +PASS unresolved producer effect prevents finalization +PASS output missing prevents producer finalization +PASS evaluation failure and operator revocation block terminal authority +PASS effect completion and passing Eval still do not finalize producer +PASS exact source name type digest revision and producer binding +PASS binding survives fresh load; artifact mutation and absence deny execution +PASS stale installed authority denies consumer +PASS consumer executes independently with pinned provenance +PASS all required independently finalized nodes complete existing DAG +PASS historical consumer provenance cannot become a later producer version +PASS completion-only edge does not transfer an artifact +PASS bounded join requires both independently finalized producers +PASS consumer failure cannot rewrite finalized producer +PASS producer execution failure blocks dependent +PASS fresh controller before_node_binding +PASS fresh controller after_node_binding +PASS fresh controller after_node_start_requested +PASS consumed initial admission survives crash without fabricating execution +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-7JzsQP","checks":19,"scenarios":["producer output exists without finalization: consumer blocked","unresolved producer effect prevents finalization","output missing prevents producer finalization","evaluation failure and operator revocation block terminal authority","effect completion and passing Eval still do not finalize producer","exact source name type digest revision and producer binding","binding survives fresh load; artifact mutation and absence deny execution","stale installed authority denies consumer","consumer executes independently with pinned provenance","all required independently finalized nodes complete existing DAG","historical consumer provenance cannot become a later producer version","completion-only edge does not transfer an artifact","bounded join requires both independently finalized producers","consumer failure cannot rewrite finalized producer","producer execution failure blocks dependent","fresh controller before_node_binding","fresh controller after_node_binding","fresh controller after_node_start_requested","consumed initial admission survives crash without fabricating execution"]} + + +===== node_contracts.log ===== +{"checks":12,"ok":true} + + +===== node_policy.log ===== +PASS needs-changes evaluation blocks producer dependency +PASS producer tool permission is not inherited by consumer +PASS ordinary cancellation blocks consumer +PASS failed terminal follows existing Eval policy and cannot satisfy dependency +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-CCxtWE","checks":4,"scenarios":["needs-changes evaluation blocks producer dependency","producer tool permission is not inherited by consumer","ordinary cancellation blocks consumer","failed terminal follows existing Eval policy and cannot satisfy dependency"]} + + +===== node_recovery.log ===== +{"contention":[{"ok":true,"reason":"node_requires_independent_finalization"},{"ok":false,"reason":"run_lock_timeout"}],"admissions":1} +PASS two fresh graph controllers: one consumer admission and action +PASS real observation crash: repair retains consumption and requires separate finalization +PASS raw output orphan cannot synthesize a binding +PASS real immutable orphan node_inputs_bound reconciled without implicit execution +PASS real immutable orphan node_terminal_observed reconciled without implicit execution +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-x7a1Cy","checks":5,"scenarios":["two fresh graph controllers: one consumer admission and action","real observation crash: repair retains consumption and requires separate finalization","raw output orphan cannot synthesize a binding","real immutable orphan node_inputs_bound reconciled without implicit execution","real immutable orphan node_terminal_observed reconciled without implicit execution"]} + + +===== node_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== parent_finalization.log ===== +PASS pending effects block parent +PASS cancelled required selection is not completion +PASS unresolved operator review blocks +PASS real Workcell refs and original bytes preserved +PASS stale authority +PASS changed registration +PASS wrong environment +PASS operator authorization revoked +PASS stale evaluation +PASS wrong evaluation subject +PASS missing/replaced output.txt +PASS missing/replaced output-evidence.json +PASS missing/replaced workcell/receipt.json +PASS retained workspace missing +PASS changed retained Git HEAD +PASS stale run revision +PASS new unresolved child +PASS expired preservation +PASS independent sink uncertainty blocks +PASS legitimate new assessment invalidates candidate +PASS generic approved review cannot bypass finalization +PASS separate finalization without effect replay +PASS Eval fail maps through existing policy +PASS SIGKILL before decision remains nonterminal +PASS SIGKILL after terminal reply loss is final +PASS two independently assessed fresh controllers one durable finalization +PASS producer success still requires parent finalization +PASS anchored required descendant blocks terminal transition +PASS mutable optional flag cannot waive anchored required child +PASS live authority revoked inside finalization boundary +PASS orphan durable finalization recovered by fresh controllers +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/parent-finalization-DWHiy8","checks":31,"proofs":["pending effects block parent","cancelled required selection is not completion","unresolved operator review blocks","real Workcell refs and original bytes preserved","stale authority","changed registration","wrong environment","operator authorization revoked","stale evaluation","wrong evaluation subject","missing/replaced output.txt","missing/replaced output-evidence.json","missing/replaced workcell/receipt.json","retained workspace missing","changed retained Git HEAD","stale run revision","new unresolved child","expired preservation","independent sink uncertainty blocks","legitimate new assessment invalidates candidate","generic approved review cannot bypass finalization","separate finalization without effect replay","Eval fail maps through existing policy","SIGKILL before decision remains nonterminal","SIGKILL after terminal reply loss is final","two independently assessed fresh controllers one durable finalization","producer success still requires parent finalization","anchored required descendant blocks terminal transition","mutable optional flag cannot waive anchored required child","live authority revoked inside finalization boundary","orphan durable finalization recovered by fresh controllers"]} + + +===== parent_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":2} + + +===== preservation_binding.log ===== +PASS historical inline recipe unchanged +PASS implementation matches portable vector +PASS reference binds original bytes +PASS document and evidence have distinct identities +PASS wrong content digest rejected +PASS wrong environment rejected +PASS wrong run rejected +PASS wrong evidence subject rejected +PASS malformed or unauthorized reference rejected {"$ref":null} +PASS malformed or unauthorized reference rejected {"$ref":""} +PASS malformed or unauthorized reference rejected {"$ref":"receipt.json","extra":true} +PASS malformed or unauthorized reference rejected {"$ref":"https://untrusted.invalid/evidence"} +PASS malformed or unauthorized reference rejected {"$ref":"../outside"} +PASS malformed or unauthorized reference rejected {"$ref":"missing.json"} +PASS wrong original document rejected +PASS old codec still rejects refs +Passed: 16 +Failed: 0 + + +===== retained_recovery.log ===== +{"passed":29,"proofs":["sqlite-stale-state-consumption","git-stale-state-consumption","orphan-control","exact-duplicate","cancel-tail","rebind-tail","torn","conflict","hash","ahead","missing-claim","lifecycle-orphan","stale-plan","revoked","expired","missing-workspace","sigkill-after_admission","sigkill-after_mutation","sigkill-after_observation","fresh-operator-contention","native-write-sigkill-effect_lifecycle_recorded","native-write-sigkill-retained_host_reconciled","native-write-sigkill-claim-consumption","real-workcell-retention-not-admission","real-workcell-preservation-expired-during-outage","real-workcell-workspace-missing","corrupt-materialization-checkpoint-rejected","workcell-git-changed-target","sqlite-authoritative-row-over-corrupt-mirror"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-ctfxLx"} + + +===== static_policy_contracts.log ===== +{"checks":14,"ok":true} + + +===== static_policy_edges.log ===== +PASS failed entry permits graph failure without inventing unentered group completion +{"ok":true,"checks":2,"scenarios":["failed entry without group completion","closed terminal outcome predicate"]} + + +===== static_policy_integration.log ===== +PASS unfinalized Eval cannot activate pass +PASS stale assessment and scheduling without activation reject pass +PASS only selected path independently admitted pass +PASS alternate later evaluation cannot flap consumed branch pass +PASS conditional join and outcome omit inactive without success pass +PASS unfinalized Eval cannot activate fail +PASS stale assessment and scheduling without activation reject fail +PASS only selected path independently admitted fail +PASS alternate later evaluation cannot flap consumed branch fail +PASS repair is new R execution and new E2 judgment, never retry A +PASS conditional join and outcome omit inactive without success fail +PASS authorized human approve_override routes without direct execution or rewritten decision +PASS authorized human abort routes without direct execution or rewritten decision +{"ok":true,"checks":13,"scenarios":["unfinalized Eval cannot activate pass","stale assessment and scheduling without activation reject pass","only selected path independently admitted pass","alternate later evaluation cannot flap consumed branch pass","conditional join and outcome omit inactive without success pass","unfinalized Eval cannot activate fail","stale assessment and scheduling without activation reject fail","only selected path independently admitted fail","alternate later evaluation cannot flap consumed branch fail","repair is new R execution and new E2 judgment, never retry A","conditional join and outcome omit inactive without success fail","authorized human approve_override routes without direct execution or rewritten decision","authorized human abort routes without direct execution or rewritten decision"]} + + +===== static_policy_recovery.log ===== +PASS condition fact and crash before activation do not let recovery invent a path +PASS two fresh controllers publish exactly one branch activation +PASS consumed downstream attempt cannot retry or change branch after crash +PASS lost selected effect reply stays consumed; independent SQLite verification resolves it without retry +PASS branch after_branch retains exact path without continuation +PASS branch immutable retains exact path without continuation +PASS fresh subgraph finalizers race for one receipt; parent then binds it +PASS subgraph after_subgraph survives exact recovery without implied parent execution +PASS subgraph immutable survives exact recovery without implied parent execution +{"ok":true,"checks":9,"scenarios":["condition fact and crash before activation do not let recovery invent a path","two fresh controllers publish exactly one branch activation","consumed downstream attempt cannot retry or change branch after crash","lost selected effect reply stays consumed; independent SQLite verification resolves it without retry","branch after_branch retains exact path without continuation","branch immutable retains exact path without continuation","fresh subgraph finalizers race for one receipt; parent then binds it","subgraph after_subgraph survives exact recovery without implied parent execution","subgraph immutable survives exact recovery without implied parent execution"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-qnK2P0"} + + +===== static_policy_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":7} + + +===== static_subgraph_integration.log ===== +PASS all internal facts without subgraph terminal event block parent +PASS recovery cannot invent subgraph completion +PASS parent binds exact subgraph receipt and output without copying internal terminal list +PASS subgraph provenance and independent parent execution survive graph finalization +PASS budget exhaustion blocks new dispatch but permits consumed A resolution +PASS budget ceiling cannot be raised through a mutable workflow +PASS anchored budget mutation rejects after run start +PASS explicit failure-review strategy requires new authorized decision and preserves denial +PASS required terminal rejection follows explicit fail policy +PASS required terminal rejection follows explicit block policy +PASS fanout optional rejection remains history while required siblings succeed +PASS failed subgraph terminal seals unfinished unconsumed members and blocks parent +{"ok":true,"checks":12,"scenarios":["all internal facts without subgraph terminal event block parent","recovery cannot invent subgraph completion","parent binds exact subgraph receipt and output without copying internal terminal list","subgraph provenance and independent parent execution survive graph finalization","budget exhaustion blocks new dispatch but permits consumed A resolution","budget ceiling cannot be raised through a mutable workflow","anchored budget mutation rejects after run start","explicit failure-review strategy requires new authorized decision and preserves denial","required terminal rejection follows explicit fail policy","required terminal rejection follows explicit block policy","fanout optional rejection remains history while required siblings succeed","failed subgraph terminal seals unfinished unconsumed members and blocks parent"]} + + +===== typescript_build.log ===== +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental build +> tsc + diff --git a/docs/evidence/graph-attempt-accounting/focused.txt b/docs/evidence/graph-attempt-accounting/focused.txt new file mode 100644 index 0000000..f11437c --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/focused.txt @@ -0,0 +1,69 @@ +===== focused-authority.log ===== +{"ok":true,"checks":3,"proofs":["operator revoked at final revalidation cannot reserve","changed child authority cannot dispatch or release an old reservation","ordinary execution failure is not a Dispatch pre-admission refusal"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-MhJ5zg"} + + +===== focused-binding-safety.log ===== +PASS downstream reservation blocks retry before child binding +PASS retry cannot retire a terminal already bound by an undispatched program descendant +{"ok":true,"checks":2,"proofs":["downstream reservation blocks retry before child binding","retry cannot retire a terminal already bound by an undispatched program descendant"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-uCaknN"} + + +===== focused-contracts.log ===== +{"checks":14,"ok":true} +{"checks":14,"ok":true} +{"checks":10,"ok":true} +{"checks":12,"ok":true} +{"checker":"kujo","ok":true,"vectors":2} +{"ok":true,"checks":150,"mcpChecks":5,"malformedChecks":9,"wireSHA256":"f87fd01de248eca96c685282b3ead0a95578f77f6c597f598fc9d587f0bec262","independence":"Go standard library; CLI and MCP share one codec"} + + +===== focused-final-contracts.log ===== +{"checks":16,"ok":true} +{"checker":"kujo","ok":true,"vectors":4} +{"ok":true,"checks":152,"mcpChecks":5,"malformedChecks":9,"wireSHA256":"f87fd01de248eca96c685282b3ead0a95578f77f6c597f598fc9d587f0bec262","independence":"Go standard library; CLI and MCP share one codec"} + + +===== focused-final-smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-vw5QFI","checks":9} + + +===== focused-integration.log ===== +PASS A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize +PASS two refused attempts exhaust node ceiling; no third attempt and original failures retained +PASS graph budget exhaustion blocks retry without refund or fabricated terminal failure +PASS operator revocation denies reservation without consuming capacity +PASS changed producer bytes cannot become a newer retry input +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-W8806Y","checks":5,"proofs":["A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize","two refused attempts exhaust node ceiling; no third attempt and original failures retained","graph budget exhaustion blocks retry without refund or fabricated terminal failure","operator revocation denies reservation without consuming capacity","changed producer bytes cannot become a newer retry input"]} + + +===== focused-policy.log ===== +PASS Eval branch activation consumes zero program units; inactive repair node has no attempt +PASS subgraph receipt adds no execution unit; human decision is separate from three member dispatches +PASS held optional reservation prevents graph sealing; release and cancellation remain explicit +{"ok":true,"checks":3,"proofs":["Eval branch activation consumes zero program units; inactive repair node has no attempt","subgraph receipt adds no execution unit; human decision is separate from three member dispatches","held optional reservation prevents graph sealing; release and cancellation remain explicit"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-b5z04P"} + + +===== focused-recovery.log ===== +PASS two fresh controllers reserve exactly one last graph unit +PASS release contention records one release and restores only never-dispatched capacity +PASS crash A: durable reservation before binding releases without phantom execution +PASS bound but undispatched reservation releases; its surviving input binding grants no admission +PASS crash before_child_load: consumed dispatch is not redelivered, released or retried +PASS crash before_node_admission: consumed dispatch is not redelivered, released or retried +PASS crash after_node_admission: consumed dispatch is not redelivered, released or retried +PASS same-node retry and next-attempt creation race publishes one new reserved instance +PASS crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay +PASS orphan reserve: immutable record/index gap repaired by fresh controller without execution +PASS orphan release: immutable record/index gap repaired by fresh controller without execution +PASS orphan retry: immutable record/index gap repaired by fresh controller without execution +PASS crash F: durable terminal observation repairs stale accounting without refund or graph finalization +PASS orphan child refusal remains sealed through exact retained-host repair +{"ok":true,"checks":14,"proofs":["two fresh controllers reserve exactly one last graph unit","release contention records one release and restores only never-dispatched capacity","crash A: durable reservation before binding releases without phantom execution","bound but undispatched reservation releases; its surviving input binding grants no admission","crash before_child_load: consumed dispatch is not redelivered, released or retried","crash before_node_admission: consumed dispatch is not redelivered, released or retried","crash after_node_admission: consumed dispatch is not redelivered, released or retried","same-node retry and next-attempt creation race publishes one new reserved instance","crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay","orphan reserve: immutable record/index gap repaired by fresh controller without execution","orphan release: immutable record/index gap repaired by fresh controller without execution","orphan retry: immutable record/index gap repaired by fresh controller without execution","crash F: durable terminal observation repairs stale accounting without refund or graph finalization","orphan child refusal remains sealed through exact retained-host repair"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-KgCvE3"} + + +===== focused-resource-smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-h5FY8u","checks":9} + + +===== focused-smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-tmvTxx","checks":9} diff --git a/docs/evidence/graph-attempt-accounting/interrupted-canonical-suites.txt b/docs/evidence/graph-attempt-accounting/interrupted-canonical-suites.txt new file mode 100644 index 0000000..be17bf5 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/interrupted-canonical-suites.txt @@ -0,0 +1,142 @@ +===== graph_attempt_authority.log ===== +{"ok":true,"checks":3,"proofs":["operator revoked at final revalidation cannot reserve","changed child authority cannot dispatch or release an old reservation","ordinary execution failure is not a Dispatch pre-admission refusal"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-9ipqSW"} + + +===== graph_attempt_binding_safety.log ===== +PASS downstream reservation blocks retry before child binding +PASS retry cannot retire a terminal already bound by an undispatched program descendant +{"ok":true,"checks":2,"proofs":["downstream reservation blocks retry before child binding","retry cannot retire a terminal already bound by an undispatched program descendant"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-inTYPt"} + + +===== graph_attempt_contracts.log ===== +{"checks":16,"ok":true} + + +===== graph_attempt_integration.log ===== + + +===== graph_attempt_smoke.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-C7auao","checks":9} + + +===== graph_attempt_vectors.log ===== +{"checker":"kujo","ok":true,"vectors":4} + + +===== parent_finalization.log ===== +PASS pending effects block parent +PASS cancelled required selection is not completion +PASS unresolved operator review blocks +PASS real Workcell refs and original bytes preserved +PASS stale authority +PASS changed registration +PASS wrong environment +PASS operator authorization revoked +PASS stale evaluation +PASS wrong evaluation subject +PASS missing/replaced output.txt +PASS missing/replaced output-evidence.json +PASS missing/replaced workcell/receipt.json +PASS retained workspace missing +PASS changed retained Git HEAD +PASS stale run revision +PASS new unresolved child +PASS expired preservation +PASS independent sink uncertainty blocks +PASS legitimate new assessment invalidates candidate +PASS generic approved review cannot bypass finalization +PASS separate finalization without effect replay +PASS Eval fail maps through existing policy +PASS SIGKILL before decision remains nonterminal +PASS SIGKILL after terminal reply loss is final +PASS two independently assessed fresh controllers one durable finalization +PASS producer success still requires parent finalization +PASS anchored required descendant blocks terminal transition +PASS mutable optional flag cannot waive anchored required child +PASS live authority revoked inside finalization boundary +PASS orphan durable finalization recovered by fresh controllers +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/parent-finalization-R2Hx0E","checks":31,"proofs":["pending effects block parent","cancelled required selection is not completion","unresolved operator review blocks","real Workcell refs and original bytes preserved","stale authority","changed registration","wrong environment","operator authorization revoked","stale evaluation","wrong evaluation subject","missing/replaced output.txt","missing/replaced output-evidence.json","missing/replaced workcell/receipt.json","retained workspace missing","changed retained Git HEAD","stale run revision","new unresolved child","expired preservation","independent sink uncertainty blocks","legitimate new assessment invalidates candidate","generic approved review cannot bypass finalization","separate finalization without effect replay","Eval fail maps through existing policy","SIGKILL before decision remains nonterminal","SIGKILL after terminal reply loss is final","two independently assessed fresh controllers one durable finalization","producer success still requires parent finalization","anchored required descendant blocks terminal transition","mutable optional flag cannot waive anchored required child","live authority revoked inside finalization boundary","orphan durable finalization recovered by fresh controllers"]} + + +===== preservation_binding.log ===== +PASS historical inline recipe unchanged +PASS implementation matches portable vector +PASS reference binds original bytes +PASS document and evidence have distinct identities +PASS wrong content digest rejected +PASS wrong environment rejected +PASS wrong run rejected +PASS wrong evidence subject rejected +PASS malformed or unauthorized reference rejected {"$ref":null} +PASS malformed or unauthorized reference rejected {"$ref":""} +PASS malformed or unauthorized reference rejected {"$ref":"receipt.json","extra":true} +PASS malformed or unauthorized reference rejected {"$ref":"https://untrusted.invalid/evidence"} +PASS malformed or unauthorized reference rejected {"$ref":"../outside"} +PASS malformed or unauthorized reference rejected {"$ref":"missing.json"} +PASS wrong original document rejected +PASS old codec still rejects refs +Passed: 16 +Failed: 0 + + +===== static_policy_contracts.log ===== +{"checks":14,"ok":true} + + +===== static_policy_edges.log ===== +PASS failed entry permits graph failure without inventing unentered group completion +{"ok":true,"checks":2,"scenarios":["failed entry without group completion","closed terminal outcome predicate"]} + + +===== static_policy_integration.log ===== +PASS unfinalized Eval cannot activate pass +PASS stale assessment and scheduling without activation reject pass +PASS only selected path independently admitted pass +PASS alternate later evaluation cannot flap consumed branch pass +PASS conditional join and outcome omit inactive without success pass +PASS unfinalized Eval cannot activate fail +PASS stale assessment and scheduling without activation reject fail +PASS only selected path independently admitted fail +PASS alternate later evaluation cannot flap consumed branch fail +PASS repair is new R execution and new E2 judgment, never retry A +PASS conditional join and outcome omit inactive without success fail +PASS authorized human approve_override routes without direct execution or rewritten decision +PASS authorized human abort routes without direct execution or rewritten decision +{"ok":true,"checks":13,"scenarios":["unfinalized Eval cannot activate pass","stale assessment and scheduling without activation reject pass","only selected path independently admitted pass","alternate later evaluation cannot flap consumed branch pass","conditional join and outcome omit inactive without success pass","unfinalized Eval cannot activate fail","stale assessment and scheduling without activation reject fail","only selected path independently admitted fail","alternate later evaluation cannot flap consumed branch fail","repair is new R execution and new E2 judgment, never retry A","conditional join and outcome omit inactive without success fail","authorized human approve_override routes without direct execution or rewritten decision","authorized human abort routes without direct execution or rewritten decision"]} + + +===== static_policy_recovery.log ===== +PASS condition fact and crash before activation do not let recovery invent a path +PASS two fresh controllers publish exactly one branch activation +PASS consumed downstream attempt cannot retry or change branch after crash +PASS lost selected effect reply stays consumed; independent SQLite verification resolves it without retry +PASS branch after_branch retains exact path without continuation +PASS branch immutable retains exact path without continuation +PASS fresh subgraph finalizers race for one receipt; parent then binds it +PASS subgraph after_subgraph survives exact recovery without implied parent execution +PASS subgraph immutable survives exact recovery without implied parent execution +{"ok":true,"checks":9,"scenarios":["condition fact and crash before activation do not let recovery invent a path","two fresh controllers publish exactly one branch activation","consumed downstream attempt cannot retry or change branch after crash","lost selected effect reply stays consumed; independent SQLite verification resolves it without retry","branch after_branch retains exact path without continuation","branch immutable retains exact path without continuation","fresh subgraph finalizers race for one receipt; parent then binds it","subgraph after_subgraph survives exact recovery without implied parent execution","subgraph immutable survives exact recovery without implied parent execution"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-cl3JLA"} + + +===== static_subgraph_integration.log ===== +PASS all internal facts without subgraph terminal event block parent +PASS recovery cannot invent subgraph completion +PASS parent binds exact subgraph receipt and output without copying internal terminal list +PASS subgraph provenance and independent parent execution survive graph finalization +PASS budget exhaustion blocks new dispatch but permits consumed A resolution +PASS budget ceiling cannot be raised through a mutable workflow +PASS anchored budget mutation rejects after run start +PASS explicit failure-review strategy requires new authorized decision and preserves denial +PASS required terminal rejection follows explicit fail policy +PASS required terminal rejection follows explicit block policy +PASS fanout optional rejection remains history while required siblings succeed +PASS failed subgraph terminal seals unfinished unconsumed members and blocks parent +{"ok":true,"checks":12,"scenarios":["all internal facts without subgraph terminal event block parent","recovery cannot invent subgraph completion","parent binds exact subgraph receipt and output without copying internal terminal list","subgraph provenance and independent parent execution survive graph finalization","budget exhaustion blocks new dispatch but permits consumed A resolution","budget ceiling cannot be raised through a mutable workflow","anchored budget mutation rejects after run start","explicit failure-review strategy requires new authorized decision and preserves denial","required terminal rejection follows explicit fail policy","required terminal rejection follows explicit block policy","fanout optional rejection remains history while required siblings succeed","failed subgraph terminal seals unfinished unconsumed members and blocks parent"]} + + +===== typescript_build.log ===== +npm warn Unknown user config "python". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options. + +> @kujolang/interop-typescript-rehearsal@0.0.0-experimental build +> tsc + diff --git a/docs/evidence/graph-attempt-accounting/kujo-checks.txt b/docs/evidence/graph-attempt-accounting/kujo-checks.txt new file mode 100644 index 0000000..e05dd7a --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/kujo-checks.txt @@ -0,0 +1,76 @@ +===== kujo-build.log ===== +warning: unused import: `SequentialWriter` + --> vendor/tiny_http-0.12.0/src/util/mod.rs:7:28 + | +7 | pub use self::sequential::{SequentialWriter, SequentialWriterBuilder}; + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: trait `MustBeShareDummy` is never used + --> vendor/tiny_http-0.12.0/src/lib.rs:164:7 + | +164 | trait MustBeShareDummy: Sync + Send {} + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `tiny_http` (lib) generated 2 warnings (run `cargo fix --lib -p tiny_http` to apply 1 suggestion) + Finished `release` profile [optimized] target(s) in 1.99s + + +===== kujo-fmt.log ===== + + +===== kujo-contracts.log ===== +warning: unused import: `SequentialWriter` + --> vendor/tiny_http-0.12.0/src/util/mod.rs:7:28 + | +7 | pub use self::sequential::{SequentialWriter, SequentialWriterBuilder}; + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + +warning: trait `MustBeShareDummy` is never used + --> vendor/tiny_http-0.12.0/src/lib.rs:164:7 + | +164 | trait MustBeShareDummy: Sync + Send {} + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `tiny_http` (lib) generated 2 warnings (run `cargo fix --lib -p tiny_http` to apply 1 suggestion) + Finished `release` profile [optimized] target(s) in 1.47s + Running tests/architecture_docs_contract.rs (target/release/deps/architecture_docs_contract-8e146c6858eac426) + +running 1 test +test architecture_doc_matches_current_runtime_posture ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/readme_contracts.rs (target/release/deps/readme_contracts-1f336d86eb0a7ca9) + +running 1 test +test readme_covers_v1_status_cli_security_and_core_reference_links ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Running tests/workflow_control_contracts.rs (target/release/deps/workflow_control_contracts-2d40b60bb6568be2) + +running 13 tests +test actual_cross_component_failure_evidence_conforms ... ignored, requires the local Dispatch failure-gate golden-path handoff +test actual_workspace_reexecution_artifacts_match_shared_schemas ... ignored, requires Dispatch tests/reexecution_lifecycle_fixture.kujo output +test control_contracts_keep_secrets_as_references ... ok +test workflow_control_schema_ids_and_contract_constants_are_unique ... ok +test intervention_availability_is_additive_and_typed ... ok +test portable_control_event_is_bounded_and_versioned ... ok +test evaluation_result_cannot_issue_workflow_control_action ... ok +test oversized_evidence_and_invalid_effect_enums_are_rejected ... ok +test error_verdict_and_reexecution_modes_have_explicit_semantics ... ok +test embedded_evidence_has_the_same_integrity_requirements_as_standalone ... ok +test workflow_control_valid_fixtures_conform ... ok +test workflow_control_rejects_missing_fields_bad_versions_and_bounds ... ok +test producer_neutral_evaluations_preserve_error_and_rule_facts ... ok + +test result: ok. 11 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.05s + diff --git a/docs/evidence/graph-attempt-accounting/legacy-correction.txt b/docs/evidence/graph-attempt-accounting/legacy-correction.txt new file mode 100644 index 0000000..21385f0 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/legacy-correction.txt @@ -0,0 +1,5 @@ +===== legacy-contracts.log ===== +{"checks":19,"ok":true} + +===== effect-set-corrected.log ===== +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/effect-set-LW39PG","scenarios":["A: two SIGKILLs; retained A/unknown B/unstarted C,D","B: claim without verifier","C: expiry/append-only renewal","D: two sink-key contenders","journal tamper refused"],"assessmentCases":29,"first":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:06d2c7b17f07818cbfdd6690cc42b9143bfa3c16f0465f0f01dd4038ea5128c6","freshness":"current","historical_observation":"committed","next_action":"retain_completion","observed_state":"committed","reported_state":"unknown"},{"blocked_by":null,"effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"B","effect_id":"C","evidence_ref":"sha256:60a07e180ec678a42e42dcef019a9f39d22a29478d536d4b9f48cdbc372af4a3","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"},{"blocked_by":"B","effect_id":"D","evidence_ref":"sha256:3936e2f4de16e1f311e58e8a0e239b7a0c8970ba39b5f11ddfcfc42e1c8ab91a","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"},"expired":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:06d2c7b17f07818cbfdd6690cc42b9143bfa3c16f0465f0f01dd4038ea5128c6","freshness":"stale","historical_observation":"committed","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"A","effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"A","effect_id":"C","evidence_ref":"sha256:60a07e180ec678a42e42dcef019a9f39d22a29478d536d4b9f48cdbc372af4a3","freshness":"stale","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"not_started"},{"blocked_by":"A","effect_id":"D","evidence_ref":"sha256:3936e2f4de16e1f311e58e8a0e239b7a0c8970ba39b5f11ddfcfc42e1c8ab91a","freshness":"stale","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"},"renewed":{"condition":"partial_or_uncertain","continuation":"review_required","effects":[{"blocked_by":null,"effect_id":"A","evidence_ref":"sha256:06d2c7b17f07818cbfdd6690cc42b9143bfa3c16f0465f0f01dd4038ea5128c6","freshness":"current","historical_observation":"committed","next_action":"retain_completion","observed_state":"committed","reported_state":"unknown"},{"blocked_by":null,"effect_id":"B","evidence_ref":null,"freshness":"missing","historical_observation":"unknown","next_action":"inspect_or_revalidate","observed_state":"unknown","reported_state":"unknown"},{"blocked_by":"B","effect_id":"C","evidence_ref":"sha256:60a07e180ec678a42e42dcef019a9f39d22a29478d536d4b9f48cdbc372af4a3","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"},{"blocked_by":"B","effect_id":"D","evidence_ref":"sha256:3936e2f4de16e1f311e58e8a0e239b7a0c8970ba39b5f11ddfcfc42e1c8ab91a","freshness":"current","historical_observation":"not_started","next_action":"inspect_or_revalidate","observed_state":"not_started","reported_state":"not_started"}],"ok":true,"parent_replay":"prohibited"}} diff --git a/docs/evidence/graph-attempt-accounting/source-artifacts.json b/docs/evidence/graph-attempt-accounting/source-artifacts.json new file mode 100644 index 0000000..a7ac346 --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/source-artifacts.json @@ -0,0 +1,347 @@ +[ + { + "path": "/tmp/dispatch-attempt-evidence/baseline-contracts.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-contracts.log", + "bytes": 2353, + "sha256": "02cc3081801a60784c55c41eb651ec7a9caaf1e78c909340ce25285fb44ed7ce" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-effects.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-effects.log", + "bytes": 3597, + "sha256": "6c42ab969f95edc1a0b2e5b36d3bb533bd6a64394c57c863f71d4e33577d2128" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-graph.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-graph.log", + "bytes": 1319, + "sha256": "c817561b821ebfdf8d7e081ce236d5f0b0438ffe3e63de2cf4a05566a23d421c" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-recovery.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/baseline-recovery.log", + "bytes": 3502, + "sha256": "da985bb94d9240ec598c3d4d9fc4cf2a38245ef0649a45e40b58fd8c2cea1a50" + }, + { + "path": "/tmp/dispatch-attempt-evidence/canonical-source.txt", + "bytes": 41, + "sha256": "02626aa35a7f001813b9d15a9aa43b982692033a78dda5fdeda8b96e16b19011" + }, + { + "path": "/tmp/dispatch-attempt-evidence/canonical-wrapper-note.txt", + "bytes": 242, + "sha256": "4d9aff5d4cd71822d769ca1a2b944a8859ed821cb79d65cfc0db32e4fa9a8a06" + }, + { + "path": "/tmp/dispatch-attempt-evidence/canonical.log", + "bytes": 1203, + "sha256": "dbbe9f81175be5002c1e717db10099089f559cbde7a27f1a18b70e952d22129e" + }, + { + "path": "/tmp/dispatch-attempt-evidence/descendant-guard.json", + "bytes": 810, + "sha256": "11f3d9825e63559a72557798b2350980dcb39a9ae403035988846ee6701d53b6" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-attempt-contracts-1.log", + "bytes": 24, + "sha256": "42781b40a80c1d24c70e66b79108240013f9b319ad52b37e0b5fa42859b9333b" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-attempt-contracts-2.log", + "bytes": 24, + "sha256": "aff3a294b3f850a0828afeec57eee807cbe2b7c54437a9a8f83298dbc0baa2b5" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-authority-1.exit", + "bytes": 2, + "sha256": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-authority-1.log", + "bytes": 1099, + "sha256": "0cd1d12ef5a32441e2e1dc2662c0886a857a8cf88b8b00d7c7e85605addd2727" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-bound-descendant-1.exit", + "bytes": 2, + "sha256": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-bound-descendant-1.log", + "bytes": 1293, + "sha256": "9e1e1e72e3b091e50a632135941e3636a56d1814e0651699299de5fe770b500c" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-bound-descendant-2.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-bound-descendant-2.log", + "bytes": 289, + "sha256": "6f7fb28126f3c2eb791ed31afdb9fcc5f46451cdd3ea9e5e9ea08288c26066c0" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-contracts.log", + "bytes": 24, + "sha256": "aff3a294b3f850a0828afeec57eee807cbe2b7c54437a9a8f83298dbc0baa2b5" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-go-1.log", + "bytes": 1253, + "sha256": "14426500e36aa2f9ba0f58f5b3374ab6746ce7b6ac5dd81c62cd1a77fb3ce3bf" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-go-2.log", + "bytes": 205, + "sha256": "83f0ce173e3ed8d6cee0897552ae196e4322101d48ed517c6b43ea28cb12ce29" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-integration-1.log", + "bytes": 791, + "sha256": "194586d5a379782a7795fe312d9c9d69240764a6cb485e045d7cc10b97b31b89" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-integration-2.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-integration-2.log", + "bytes": 941, + "sha256": "308f31083ab9ed45f4b4a107161843d6eec6aa3e86c35376b4c089632f927d7c" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-policy-1-interruption.json", + "bytes": 237, + "sha256": "4a20d4696ee40e364a8fba76bb3c984e4bc385e81776bad235e9725c8eb40018" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-policy-1.log", + "bytes": 93, + "sha256": "f38d2eb7c6a51f53fb506b5831e8e579ac4c378a99511f33eff0161dcb57cf56" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-policy-2.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-policy-2.log", + "bytes": 689, + "sha256": "a732984e739aab78b22dfe700309f9a2d8a5898182a86a98b8ebbd55809d2df3" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-recovery-1.log", + "bytes": 2020, + "sha256": "19cc96941bc762283ce269c2b1b116e1a97670a631de7c5bc6cb7b85c047fab3" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-recovery-2.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-recovery-2.log", + "bytes": 2020, + "sha256": "e42356b1af236f3122fc1f6211d46da02705aa3d288e06e8c4fec7bc493a94f5" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-report-1.log", + "bytes": 296, + "sha256": "32a98629c0b98f9930376a47ed70643a15caa7e2d612cc5afae1eed4b1dd3b9d" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-report-2.log", + "bytes": 1803, + "sha256": "0abfaee19ca292005b76ba6bd7a9e364307f483d2dd64ad42a10f674bacc82fd" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-result-recovery-1.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-result-recovery-1.log", + "bytes": 472, + "sha256": "1241cb9c279e5ee9550aebba5f606ee87def0d2f6ffa8350f5fc8f413f803419" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-smoke-1.log", + "bytes": 1150, + "sha256": "50518049e75fe405a39aa47e436c303e18b8c2b52079df0266b315c3a7b51f69" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-smoke-2.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-smoke-2.log", + "bytes": 105, + "sha256": "dd72ea51f07d374e5cd0bdbc67c9f3df9791c356d0846badaf3a8e1e8b84cdba" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-smoke-3.log", + "bytes": 105, + "sha256": "e70d87d9bad9ae94873d36c5f78d96e64cd92c291ef29e3e58a804fad37711cd" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-ts-build.log", + "bytes": 221, + "sha256": "24158393e216186de823227cee0b3fad00cb08ca917a14338081aabd72a69373" + }, + { + "path": "/tmp/dispatch-attempt-evidence/dev-vectors-1.log", + "bytes": 41, + "sha256": "11b138dd7d06156f9334506449e2c91bc25cfe8c851277956c1a1b7b2c2bd9ec" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-authority.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-authority.log", + "bytes": 313, + "sha256": "81569118a10046afe20f002e72ad23c8dce379fdf0777605003325b621a64b48" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-binding-safety.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-binding-safety.log", + "bytes": 410, + "sha256": "0c5f14587188178798df6b700ca1b138d0e78d1d400fd4b3565e741aba2a10f3" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-contracts.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-contracts.log", + "bytes": 342, + "sha256": "c01d04fae49a8afff2e01e38b527365f1f955beb71679e43286ac4b96c2e4dc4" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-final-contracts.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-final-contracts.log", + "bytes": 270, + "sha256": "cf25f962064aaf24bac0a1b0e0b67085f06710f446dfd8aff31b95a4a738d98b" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-final-smoke.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-final-smoke.log", + "bytes": 105, + "sha256": "e10f76e3020137a5ef4ad3bf548026b927e7768f3d730f938517f3e04cafedf7" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-integration.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-integration.log", + "bytes": 941, + "sha256": "e22af91de1524c0e37ed65731b5fa17cb032614fe3bbb8c2421a05c4860d7e16" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-policy.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-policy.log", + "bytes": 689, + "sha256": "52a5fe5b59eac0b8cc75e4fa35b26fd36b53c210268827f12f5d00b815c36a12" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-recovery.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-recovery.log", + "bytes": 2569, + "sha256": "e475445c748d7cb8e151eb64b6c9ade91fd3a632ff056af2dbed30bb7a9658dc" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-resource-smoke.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-resource-smoke.log", + "bytes": 105, + "sha256": "b4146b21e7c8ffb18242d439e454dfe06847987760a3a96e2ae2f6e038f864e3" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-smoke.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/focused-smoke.log", + "bytes": 105, + "sha256": "581520ffb8bc7179146a2a04ab3518b373e430b910643669e091da87a751982f" + }, + { + "path": "/tmp/dispatch-attempt-evidence/kujo-contracts.log", + "bytes": 3917, + "sha256": "9715983313a44d3fa263b43847c9906c933cbaa1584a5a1f0c210c8e23bbb6a1" + }, + { + "path": "/tmp/dispatch-attempt-evidence/kujo-fmt.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/kujo-fmt.log", + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "path": "/tmp/dispatch-attempt-evidence/kujo-initial-build.exit", + "bytes": 2, + "sha256": "9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa" + }, + { + "path": "/tmp/dispatch-attempt-evidence/kujo-initial-build.log", + "bytes": 16270, + "sha256": "75a41a8942a8ff30248259bcf0ded0f58c448e2eb55c0175483cc8c372a01d37" + }, + { + "path": "/tmp/dispatch-attempt-evidence/starting-pins.json", + "bytes": 1027, + "sha256": "0d8b4a9327582ddaa4f3bf5d07d9a2f4c8eef1e4bb4aca305e6a2b9cfd60e80f" + } +] diff --git a/docs/evidence/graph-attempt-accounting/validation.json b/docs/evidence/graph-attempt-accounting/validation.json new file mode 100644 index 0000000..20b539e --- /dev/null +++ b/docs/evidence/graph-attempt-accounting/validation.json @@ -0,0 +1,685 @@ +{ + "schema": "dispatch.graph-attempt-accounting-validation/v1alpha1", + "verified": true, + "starting_commits": { + "dispatch": "27a87ecbe05566578484dac970616a20d78b0ff3", + "kujo": "da35f5b3d673e1ddc5d7bcaabacf5fdfe5bd2b30" + }, + "tested_source_commit": "119de2e6f800e1cbceadcb01dec153c2e9394d19", + "kujo_documentation_commit": "2946f2a1a76700519292db3da8004ea1a9e31f61", + "related_repository_pins_at_validation": { + "dispatch": "27a87ecbe05566578484dac970616a20d78b0ff3", + "kujo": "0c67dd4b840d93431707f732dc25c0c4ea4a8078", + "workcell": "0f9595b79872d2500f0bb35a8cf6227171fd7eeb", + "eval": "6a5ab09e5c24cc1a842b374afccb64da40db2874", + "agents-sdk": "5a9d5525e511a293b743b1c44d9ef270fd491f9f", + "runledger": "97cb607a062efeecc7fcdc4e4a4e0308f90d45fe", + "watchdog": "fafea3abb594638e442127496ca6ac4c9bcd5390" + }, + "commands": [ + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true bash scripts/run_release_gate.sh", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "exit": 0, + "log": "canonical.txt", + "suite_commands": "scripts/run_release_gate.sh", + "suite_logs": "canonical-suites.txt" + }, + { + "command": "cargo build --release --locked", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-attempt-accounting", + "exit": 0 + }, + { + "command": "cargo fmt --check", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-attempt-accounting", + "exit": 0 + }, + { + "command": "cargo test --release --locked --test architecture_docs_contract --test workflow_control_contracts --test readme_contracts", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-attempt-accounting", + "exit": 0, + "passed": 13, + "failed": 0, + "ignored": 2 + }, + { + "command": "../kujo/target/release/kujo run tests/static_policy_contract_tests.kujo", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 14, + "exit": 0 + }, + { + "command": "../kujo/target/release/kujo run tests/heterogeneous_contract_tests.kujo", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 10, + "exit": 0 + }, + { + "command": "../kujo/target/release/kujo run tests/node_contract_tests.kujo", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 12, + "exit": 0 + }, + { + "command": "../kujo/target/release/kujo test-run tests/failure_gate_safety_tests.kujo -v", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 20, + "exit": 0 + }, + { + "command": "../kujo/target/release/kujo test-run tests/review_checkpoint_tests.kujo -v", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 4, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/static_policy_edges.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 2, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/heterogeneous_policy.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 7, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/node_composition_policy.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 4, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/effect_continuation_integration.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 39, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/sequential_effect_integration.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 80, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/retained_recovery_integration.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 29, + "exit": 0 + }, + { + "command": "KUJO_BIN=../kujo/target/release/kujo DISPATCH_OFFLINE_FIXTURE=true node tests/parent_finalization_integration.mjs", + "phase": "baseline", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch", + "passed": 31, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_authority.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 3, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_binding_safety.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 2, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_smoke.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 9, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_integration.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 5, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_recovery.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 14, + "exit": 0 + }, + { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true node tests/graph_attempt_policy.mjs", + "phase": "canonical focused suite", + "cwd": "/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-attempt-accounting", + "passed": 3, + "exit": 0 + }, + { + "command": "/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified run tests/graph_attempt_contract_tests.kujo", + "passed": 19, + "exit": 0 + }, + { + "command": "/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified run tests/portable_commitments.kujo tests/vectors/graph-attempts.json", + "vectors": 4, + "exit": 0 + } + ], + "canonical": { + "exit": 0, + "passed_suite_groups": 106, + "suite_groups": [ + "typescript_build", + "preservation_binding", + "parent_finalization", + "static_policy_contracts", + "static_policy_integration", + "static_subgraph_integration", + "static_policy_edges", + "static_policy_recovery", + "graph_attempt_vectors", + "graph_attempt_contracts", + "graph_attempt_binding_safety", + "graph_attempt_authority", + "graph_attempt_smoke", + "graph_attempt_integration", + "graph_attempt_recovery", + "graph_attempt_policy", + "static_policy_vectors", + "heterogeneous_contracts", + "heterogeneous_integration", + "heterogeneous_policy", + "heterogeneous_recovery", + "heterogeneous_vectors", + "node_contracts", + "node_composition", + "node_policy", + "node_recovery", + "node_vectors", + "parent_vectors", + "retained_recovery", + "effect_set", + "effect_continuation", + "sequential_effects", + "effect_lifecycle_vectors", + "effect_selection_vectors", + "effect_set_vectors", + "go_participant", + "typescript_package", + "python_package", + "python_parity", + "participant_sdk_parity", + "python_isolation", + "python_integration", + "typescript_after", + "typescript_before", + "control_boundary", + "failure_gate_safety", + "failure_gate_execution", + "review_checkpoint", + "persisted_negotiation_legacy", + "persisted_negotiation_schemas", + "persisted_negotiation_contracts", + "persisted_negotiation", + "persisted_negotiation_adapters", + "beta_contracts", + "portable_commitments", + "portable_clean_room", + "interop_oracles", + "interop_history", + "git_participant_after", + "git_participant_before", + "http_response_loss", + "http_timeout_before", + "http_application_error", + "mcp_ability", + "mcp_stdio_loss", + "sdk_ability", + "beta_migration", + "assurance_compatibility", + "assurance_capabilities", + "effect_assurance_schema", + "effect_assurance", + "ability_assurance", + "reexecution_lifecycle", + "resume_policy", + "decision_claim", + "sdk_adapter", + "policy_precedence", + "retrieval_preferences", + "routing", + "state_store_sqlite", + "operational_controls", + "hardening", + "dispatch-1", + "dispatch-2", + "dispatch-3", + "dispatch-4", + "dispatch-5", + "dispatch-6", + "dispatch-7", + "dispatch-8", + "dispatch-9", + "dispatch-10", + "dispatch-11", + "dispatch-12", + "dispatch-13", + "dispatch-14", + "dispatch-15", + "dispatch-16", + "dispatch-17", + "dispatch-18", + "dispatch-19", + "dispatch-20", + "dispatch-21", + "dispatch-22", + "dispatch-23", + "dispatch-24" + ], + "native_source_tests": 101, + "new_suites": { + "graph_attempt_authority": [ + { + "ok": true, + "checks": 3, + "proofs": [ + "operator revoked at final revalidation cannot reserve", + "changed child authority cannot dispatch or release an old reservation", + "ordinary execution failure is not a Dispatch pre-admission refusal" + ], + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-XWkedM" + } + ], + "graph_attempt_binding_safety": [ + { + "ok": true, + "checks": 2, + "proofs": [ + "downstream reservation blocks retry before child binding", + "retry cannot retire a terminal already bound by an undispatched program descendant" + ], + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-CjnIy1" + } + ], + "graph_attempt_contracts": [ + { + "checks": 19, + "ok": true + } + ], + "graph_attempt_integration": [ + { + "ok": true, + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-sTg3cI", + "checks": 5, + "proofs": [ + "A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize", + "two refused attempts exhaust node ceiling; no third attempt and original failures retained", + "graph budget exhaustion blocks retry without refund or fabricated terminal failure", + "operator revocation denies reservation without consuming capacity", + "changed producer bytes cannot become a newer retry input" + ] + } + ], + "graph_attempt_policy": [ + { + "ok": true, + "checks": 3, + "proofs": [ + "Eval branch activation consumes zero program units; inactive repair node has no attempt", + "subgraph receipt adds no execution unit; human decision is separate from three member dispatches", + "held optional reservation prevents graph sealing; release and cancellation remain explicit" + ], + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-bnRRDe" + } + ], + "graph_attempt_recovery": [ + { + "ok": true, + "checks": 14, + "proofs": [ + "two fresh controllers reserve exactly one last graph unit", + "release contention records one release and restores only never-dispatched capacity", + "crash A: durable reservation before binding releases without phantom execution", + "bound but undispatched reservation releases; its surviving input binding grants no admission", + "crash before_child_load: consumed dispatch is not redelivered, released or retried", + "crash before_node_admission: consumed dispatch is not redelivered, released or retried", + "crash after_node_admission: consumed dispatch is not redelivered, released or retried", + "same-node retry and next-attempt creation race publishes one new reserved instance", + "crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay", + "orphan reserve: immutable record/index gap repaired by fresh controller without execution", + "orphan release: immutable record/index gap repaired by fresh controller without execution", + "orphan retry: immutable record/index gap repaired by fresh controller without execution", + "crash F: durable terminal observation repairs stale accounting without refund or graph finalization", + "orphan child refusal remains sealed through exact retained-host repair" + ], + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-cNBtCw" + } + ], + "graph_attempt_smoke": [ + { + "ok": true, + "root": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-HnkHR6", + "checks": 9 + } + ], + "graph_attempt_vectors": [ + { + "checker": "kujo", + "ok": true, + "vectors": 4 + } + ] + }, + "counted_native_suites": { + "dispatch-8": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-17": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-16": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-9": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-14": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-15": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-11": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-10": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "sdk_adapter": { + "total": 10, + "passed": 10, + "failed": 0 + }, + "dispatch-12": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-13": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "routing": { + "total": 31, + "passed": 31, + "failed": 0 + }, + "operational_controls": { + "total": 9, + "passed": 9, + "failed": 0 + }, + "state_store_sqlite": { + "total": 1, + "passed": 1, + "failed": 0 + }, + "hardening": { + "total": 8, + "passed": 8, + "failed": 0 + }, + "policy_precedence": { + "total": 3, + "passed": 3, + "failed": 0 + }, + "control_boundary": { + "total": 14, + "passed": 14, + "failed": 0 + }, + "dispatch-1": { + "total": 5, + "passed": 5, + "failed": 0 + }, + "dispatch-22": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-23": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "retrieval_preferences": { + "total": 3, + "passed": 3, + "failed": 0 + }, + "dispatch-2": { + "total": 5, + "passed": 5, + "failed": 0 + }, + "review_checkpoint": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-21": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-20": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-3": { + "total": 5, + "passed": 5, + "failed": 0 + }, + "failure_gate_safety": { + "total": 20, + "passed": 20, + "failed": 0 + }, + "dispatch-7": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-24": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-18": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-19": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-6": { + "total": 4, + "passed": 4, + "failed": 0 + }, + "dispatch-4": { + "total": 5, + "passed": 5, + "failed": 0 + }, + "failure_gate_execution": { + "total": 6, + "passed": 6, + "failed": 0 + }, + "dispatch-5": { + "total": 5, + "passed": 5, + "failed": 0 + } + }, + "native_shard_assertions": 101, + "new_checks": 55, + "release_workload": { + "schema_version": "1.0", + "dispatch_commit": "119de2e6f800e1cbceadcb01dec153c2e9394d19", + "fixture": true, + "requested_runs": 3, + "completed_runs": 3, + "duration_seconds": 15, + "generated_at_epoch": 1790828281 + }, + "go_participant": { + "ok": true, + "checks": 152, + "mcpChecks": 5, + "malformedChecks": 9, + "wireSHA256": "f87fd01de248eca96c685282b3ead0a95578f77f6c597f598fc9d587f0bec262", + "independence": "Go standard library; CLI and MCP share one codec" + } + }, + "skips": [ + "Kujo actual_cross_component_failure_evidence_conforms: repository ignore; requires local Dispatch golden-path handoff", + "Kujo actual_workspace_reexecution_artifacts_match_shared_schemas: repository ignore; requires lifecycle fixture output", + "Remote provider certification not performed; localhost bridge route only", + "Related repositories unmodified: no separate full gates; Workcell and Eval exercised through Dispatch" + ], + "warnings": [ + "Existing vendor tiny_http unused SequentialWriter import and MustBeShareDummy dead trait", + "Existing Strata npm unknown python configuration warning" + ], + "interruptions": [ + "First canonical run failed at wrong AJV schema draft; fixed in 9edf94a and focused integration passed", + "Next canonical run interrupted by host restart; temporary originals lost; surviving per-suite logs retained; no full pass inferred", + "Post-restart canonical failed at legacy effect-set journal lacking workflow_definition; fixed by opt-in-safe defaults plus three contract negatives; focused effect-set passed before complete rerun" + ], + "toolchain": { + "rustc": "rustc 1.96.0 (ac68faa20 2026-05-25)\nbinary: rustc\ncommit-hash: ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96\ncommit-date: 2026-05-25\nhost: x86_64-apple-darwin\nrelease: 1.96.0\nLLVM version: 22.1.2", + "cargo": "cargo 1.96.0 (30a34c682 2026-05-25)", + "node": "v26.7.0", + "npm": "11.19.0", + "go": "go version go1.25.3 darwin/amd64", + "python": "Python 3.10.5", + "host": "Darwin 25.6.0 x86_64" + }, + "runtime": { + "baseline_sha256": "930e0da1fec2562f6990d1226a479330640c8c78eb4c36c148cee3f950b29a47", + "original_focused_verified_sha256": "87925801fa5d6fb7da63a1a730c705455cae96895c75015b861518447908013c", + "canonical_sha256": "dbddb62bba1f08682a1c9b5cc74fa5a94fe9e1b2320b26b61fb857b82db71ad3", + "canonical_source": "clean Kujo main base plus docs-only 2946f2a; cargo build --release --locked after restart" + }, + "artifacts": [ + { + "path": "docs/evidence/graph-attempt-accounting/README.md", + "bytes": 670, + "sha256": "d1cd2bdc8bec03103bef9339d1902f7d6aa3d888d2f73ba6c98bb61aecc33793" + }, + { + "path": "docs/evidence/graph-attempt-accounting/baseline.txt", + "bytes": 10910, + "sha256": "75a3aae36d7b66d1fd0359938f759a1724947cec01d6e585906483b8283ff43d" + }, + { + "path": "docs/evidence/graph-attempt-accounting/canonical-suites.txt", + "bytes": 101192, + "sha256": "bd3698fdfad538d25e0f368aa2b90dee2ebd9c71f484aab6c01cdf78cbf4c62d" + }, + { + "path": "docs/evidence/graph-attempt-accounting/canonical.txt", + "bytes": 14083, + "sha256": "4c13a38d32183be15254f1453ec4d8cec1b62ff97663bb47d2aae75e2d4fee6f" + }, + { + "path": "docs/evidence/graph-attempt-accounting/development.txt", + "bytes": 17425, + "sha256": "ac6f1464a45041660e9fe4e353bbb7cd694e63aa724975e1ff6a7b45a3c87d3b" + }, + { + "path": "docs/evidence/graph-attempt-accounting/environment-interruption.txt", + "bytes": 966, + "sha256": "0193439638d9e57de1ca78e06324cf774a50462f04dfd217c4a2b3fde9786f4b" + }, + { + "path": "docs/evidence/graph-attempt-accounting/failed-canonical-effect-set.txt", + "bytes": 28922, + "sha256": "7ec3cec2545d1668bfa35c725e65bdb9cc1ae3ded47ac8b85c68a27134eba0d9" + }, + { + "path": "docs/evidence/graph-attempt-accounting/focused.txt", + "bytes": 6219, + "sha256": "63f3902b5b51de8ecf94c75ac7e3619a834250ebeb374d4d42978aac4e5bd0ed" + }, + { + "path": "docs/evidence/graph-attempt-accounting/interrupted-canonical-suites.txt", + "bytes": 10302, + "sha256": "d6bd8dd73a8f4d58a3774cab1bf9bfade2709c666868690a8ec1a2cd1b821843" + }, + { + "path": "docs/evidence/graph-attempt-accounting/kujo-checks.txt", + "bytes": 3356, + "sha256": "fbf4cb944e27571f0bfae348961183d8b0bc83857d644f202a068782400d49a4" + }, + { + "path": "docs/evidence/graph-attempt-accounting/legacy-correction.txt", + "bytes": 3911, + "sha256": "7bf61fdfee17f516705a15f5822cd97b8526a6be4e45eee2527ec132aa2a62f5" + }, + { + "path": "docs/evidence/graph-attempt-accounting/source-artifacts.json", + "bytes": 12080, + "sha256": "5adab5dd8559d7bb2bb82e4ed437015a5b6ddd143a4671d1996269789732edea" + } + ], + "verified_at": "2026-10-01", + "source_contract_hashes": { + "schemas/node-input-binding-v1alpha4.schema.json": "f3f78b41162b2b2084ca40c868944efe5f6c1fcd5f96c671afafb053836a233f", + "schemas/node-terminal-v1alpha2.schema.json": "76b77c291e124da751d467a12bd88670c853b9d5dbdf1af63da1e87bdc69b683", + "tests/vectors/graph-attempts.json": "950454cda34d9c993340cd11f337e86fc80a2a1e2e32939453ef9406f0aa8b5e", + "../kujo-attempt-accounting/Cargo.lock": "26061df9462d1648acc59ce38380ab34bdc3253ad4c66008f125c7793dcdc7ac" + } +} diff --git a/schemas/node-input-binding-v1alpha4.schema.json b/schemas/node-input-binding-v1alpha4.schema.json new file mode 100644 index 0000000..95301d3 --- /dev/null +++ b/schemas/node-input-binding-v1alpha4.schema.json @@ -0,0 +1,357 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "dispatch.node-input-binding/v1alpha4", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "graph", + "node_id", + "consumer", + "predecessors", + "inputs", + "artifacts", + "policy", + "attempt" + ], + "properties": { + "schema": { + "const": "dispatch.node-input-binding/v1alpha4" + }, + "graph": { + "type": "object", + "additionalProperties": false, + "required": [ + "run_id", + "workflow_ref" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + }, + "workflow_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + } + }, + "node_id": { + "type": "string", + "minLength": 1 + }, + "consumer": { + "type": "object", + "additionalProperties": false, + "required": [ + "run_id", + "step_id", + "attempt_id" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + }, + "step_id": { + "type": "string", + "minLength": 1 + }, + "attempt_id": { + "type": "string", + "minLength": 1 + } + } + }, + "predecessors": { + "type": "array", + "maxItems": 8, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "node_id", + "terminal" + ], + "properties": { + "node_id": { + "type": "string", + "minLength": 1 + }, + "terminal": { + "oneOf": [ + { + "$id": "dispatch.node-terminal/v1alpha1", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "node_id", + "contract", + "subject", + "facts_ref", + "finalized_revision", + "outcome", + "authority_ref" + ], + "properties": { + "schema": { + "const": "dispatch.node-terminal/v1alpha1" + }, + "node_id": { + "type": "string", + "minLength": 1 + }, + "contract": { + "enum": [ + "parent-finalization/v1alpha1", + "evaluation-result/v1", + "intervention-decision/v2" + ] + }, + "subject": { + "type": "object", + "required": [ + "run_id" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + } + } + }, + "facts_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "finalized_revision": { + "type": "integer", + "minimum": 1 + }, + "outcome": { + "enum": [ + "completed", + "failed", + "rejected", + "cancelled" + ] + }, + "authority_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + } + }, + { + "$id": "dispatch.node-terminal/v1alpha2", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "node_id", + "contract", + "subject", + "facts_ref", + "finalized_revision", + "outcome", + "authority_ref" + ], + "properties": { + "schema": { + "const": "dispatch.node-terminal/v1alpha2" + }, + "node_id": { + "type": "string", + "minLength": 1 + }, + "contract": { + "const": "program-attempt/v1alpha1" + }, + "subject": { + "type": "object", + "required": [ + "run_id" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + } + } + }, + "facts_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "finalized_revision": { + "type": "integer", + "minimum": 1 + }, + "outcome": { + "enum": [ + "completed", + "failed", + "rejected", + "cancelled" + ] + }, + "authority_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + } + } + ] + } + } + } + }, + "inputs": { + "type": "array", + "maxItems": 8, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "producer_node", + "producer_subject", + "result_ref", + "finalization_ref", + "finalized_revision", + "output_name", + "type_id", + "schema_ref", + "evidence_ref", + "content_ref", + "name" + ], + "properties": { + "producer_node": { + "type": "string", + "minLength": 1 + }, + "producer_subject": { + "type": "object", + "additionalProperties": false, + "required": [ + "run_id", + "step_id", + "attempt_id" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + }, + "step_id": { + "type": "string", + "minLength": 1 + }, + "attempt_id": { + "type": "string", + "minLength": 1 + } + } + }, + "result_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "finalization_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "finalized_revision": { + "type": "integer", + "minimum": 1 + }, + "output_name": { + "type": "string", + "minLength": 1 + }, + "type_id": { + "type": "string", + "minLength": 1 + }, + "schema_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "evidence_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "content_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "name": { + "type": "string", + "minLength": 1 + } + } + } + }, + "artifacts": { + "type": "array", + "maxItems": 64, + "items": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + }, + "policy": { + "type": "object", + "additionalProperties": false, + "required": [ + "branches", + "subgraphs" + ], + "properties": { + "branches": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + }, + "subgraphs": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + } + } + }, + "attempt": { + "type": "object", + "additionalProperties": false, + "required": [ + "ordinal", + "previous_terminal_ref" + ], + "properties": { + "ordinal": { + "type": "integer", + "minimum": 1, + "maximum": 2 + }, + "previous_terminal_ref": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + ] + } + } + } + } +} diff --git a/schemas/node-terminal-v1alpha2.schema.json b/schemas/node-terminal-v1alpha2.schema.json new file mode 100644 index 0000000..c158c2c --- /dev/null +++ b/schemas/node-terminal-v1alpha2.schema.json @@ -0,0 +1,59 @@ +{ + "$id": "dispatch.node-terminal/v1alpha2", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "node_id", + "contract", + "subject", + "facts_ref", + "finalized_revision", + "outcome", + "authority_ref" + ], + "properties": { + "schema": { + "const": "dispatch.node-terminal/v1alpha2" + }, + "node_id": { + "type": "string", + "minLength": 1 + }, + "contract": { + "const": "program-attempt/v1alpha1" + }, + "subject": { + "type": "object", + "required": [ + "run_id" + ], + "properties": { + "run_id": { + "type": "string", + "minLength": 1 + } + } + }, + "facts_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "finalized_revision": { + "type": "integer", + "minimum": 1 + }, + "outcome": { + "enum": [ + "completed", + "failed", + "rejected", + "cancelled" + ] + }, + "authority_ref": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + } + } +} diff --git a/scripts/run_release_gate.sh b/scripts/run_release_gate.sh index 5007381..6619ae8 100755 --- a/scripts/run_release_gate.sh +++ b/scripts/run_release_gate.sh @@ -94,6 +94,14 @@ run_suite static_policy_integration env KUJO_BIN="$KUJO_BIN" node tests/static_p run_suite static_subgraph_integration env KUJO_BIN="$KUJO_BIN" node tests/static_subgraph_integration.mjs run_suite static_policy_edges env KUJO_BIN="$KUJO_BIN" node tests/static_policy_edges.mjs run_suite static_policy_recovery env KUJO_BIN="$KUJO_BIN" node tests/static_policy_recovery.mjs +run_suite graph_attempt_vectors "$KUJO_BIN" run tests/portable_commitments.kujo tests/vectors/graph-attempts.json +run_suite graph_attempt_contracts "$KUJO_BIN" run tests/graph_attempt_contract_tests.kujo +run_suite graph_attempt_binding_safety env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_binding_safety.mjs +run_suite graph_attempt_authority env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_authority.mjs +run_suite graph_attempt_smoke env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_smoke.mjs +run_suite graph_attempt_integration env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_integration.mjs +run_suite graph_attempt_recovery env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_recovery.mjs +run_suite graph_attempt_policy env KUJO_BIN="$KUJO_BIN" node tests/graph_attempt_policy.mjs run_suite static_policy_vectors "$KUJO_BIN" run tests/portable_commitments.kujo tests/vectors/static-graph-policy.json run_suite heterogeneous_contracts "$KUJO_BIN" run tests/heterogeneous_contract_tests.kujo run_suite heterogeneous_integration env KUJO_BIN="$KUJO_BIN" node tests/heterogeneous_integration.mjs diff --git a/src/core/assurance_configuration.kujo b/src/core/assurance_configuration.kujo index c3430ce..bae1989 100644 --- a/src/core/assurance_configuration.kujo +++ b/src/core/assurance_configuration.kujo @@ -34,7 +34,7 @@ export func negotiation_selection(descriptor) { } # Called under the run lock, again at execution. The host resolves the persisted # revision, not process defaults. Status is live and deliberately outside the hash. -export func resolve_run_configuration(state, options) { +export func resolve_run_authority(state, options) { if assurance_protected(state) == false {return {"ok": true, "legacy": true}} try { host := dict_get_or(options, "assurance_host", null) @@ -48,12 +48,22 @@ export func resolve_run_configuration(state, options) { if configuration_revision(descriptor) != policy["config_revision"]||to_json(negotiation_selection(descriptor)) != to_json(policy) {return denial("assurance_configuration_mismatch")} if dict_get_or(installed, "authority_sha256", "") != descriptor["authority_sha256"] {return denial("assurance_authority_mismatch")} if implementation_digest(installed["implementation"]) != descriptor["verifier_sha256"]||type(installed["verify"]) != "function" {return denial("assurance_verifier_revision_mismatch")} + return {"ok": true, "installed": installed} + } except err {return denial("assurance_configuration_invalid")} +} +# Authority inspection alone is not admission. Execution always uses the full +# configuration resolver, including the installed exact-input validator. +export func resolve_run_configuration(state, options) { + resolved := resolve_run_authority(state, options) + if resolved["ok"] == false||dict_get_or(resolved, "legacy", false) {return resolved} + try { + installed := resolved["installed"] metadata := dict_get_or(dict_get_or(state, "workflow_definition", {}), "metadata", {}) if dict_get_or(metadata, "node_input_required", "") == "dispatch.node-input/v1alpha1"&&has_key(state, "node_input_binding") { validate := dict_get_or(installed, "validate_node_inputs", null) if type(validate) != "function"||validate(state) != true {return denial("node_input_invalid")} } - return {"ok": true, "installed": installed} + return resolved } except err {return denial("assurance_configuration_invalid")} } export func evaluate_run_assurance(state, options) { diff --git a/src/core/assurance_state.kujo b/src/core/assurance_state.kujo index 87dede4..1db6906 100644 --- a/src/core/assurance_state.kujo +++ b/src/core/assurance_state.kujo @@ -34,12 +34,13 @@ export func validate_assurance_policy(policy) { } # Additive controller requirements derive from the anchored workflow, not claims. export func node_controller_features(state, features) { - retained := [];for feature in features {if contains(["node-composition/v1alpha1", "node-input/v1alpha1", "heterogeneous-terminals/v1alpha1", "static-graph-policy/v1alpha1"], feature) == false {retained = push(retained, feature)}};features = retained + retained := [];for feature in features {if contains(["node-composition/v1alpha1", "node-input/v1alpha1", "heterogeneous-terminals/v1alpha1", "static-graph-policy/v1alpha1", "graph-attempt-accounting/v1alpha1"], feature) == false {retained = push(retained, feature)}};features = retained metadata := dict_get_or(dict_get_or(state, "workflow_definition", {}), "metadata", {}) if dict_get_or(metadata, "node_composition", "") == "dispatch.node-composition/v1alpha1" {features = push(features, "node-composition/v1alpha1")} if dict_get_or(metadata, "node_input_required", "") == "dispatch.node-input/v1alpha1" {features = push(features, "node-input/v1alpha1")} - if dict_get_or(metadata, "graph_outcome", "") == "dispatch.graph-outcome/v1alpha1"||contains(["dispatch.node-input-binding/v1alpha2", "dispatch.node-input-binding/v1alpha3"], dict_get_or(dict_get_or(state, "node_input_binding", {}), "schema", "")) {features = push(features, "heterogeneous-terminals/v1alpha1")} - if has_key(metadata, "graph_policy")||dict_get_or(dict_get_or(state, "node_input_binding", {}), "schema", "") == "dispatch.node-input-binding/v1alpha3" {features = push(features, "static-graph-policy/v1alpha1")} + if dict_get_or(metadata, "graph_outcome", "") == "dispatch.graph-outcome/v1alpha1"||contains(["dispatch.node-input-binding/v1alpha2", "dispatch.node-input-binding/v1alpha3", "dispatch.node-input-binding/v1alpha4"], dict_get_or(dict_get_or(state, "node_input_binding", {}), "schema", "")) {features = push(features, "heterogeneous-terminals/v1alpha1")} + if has_key(metadata, "graph_policy")||contains(["dispatch.node-input-binding/v1alpha3", "dispatch.node-input-binding/v1alpha4"], dict_get_or(dict_get_or(state, "node_input_binding", {}), "schema", "")) {features = push(features, "static-graph-policy/v1alpha1")} + if has_key(metadata, "graph_accounting")||dict_get_or(dict_get_or(state, "node_input_binding", {}), "schema", "") == "dispatch.node-input-binding/v1alpha4" {features = push(features, "graph-attempt-accounting/v1alpha1")} return features } export func encode_authoritative_state(state) { diff --git a/src/core/graph_attempts.kujo b/src/core/graph_attempts.kujo new file mode 100644 index 0000000..899cc99 --- /dev/null +++ b/src/core/graph_attempts.kujo @@ -0,0 +1,98 @@ +# Pure, opt-in accounting projection. Dispatch is consumption, not proof of work. +from src.core.utils import dict_get_or +from src.core.portable_commitments import portable_json +func need(ok, reason) {if ok != true {throw(reason)}} +export func accounting_enabled(state) {return dict_get_or(dict_get_or(dict_get_or(state, "workflow_definition", {}), "metadata", {}), "graph_accounting", "") == "dispatch.graph-attempt-accounting/v1alpha1"} +export func program_contract(step) {return contains(["parent-finalization/v1alpha1", "program-attempt/v1alpha1"], dict_get_or(step["config"], "terminal_contract", "parent-finalization/v1alpha1"))} +func definition(state, id) {for step in state["workflow_definition"]["steps"] {if step["id"] == id {return step}};throw("attempt_node_missing")} +export func attempt_runs(state, id) { + node := definition(state, id)["config"]["node_execution"] + return push([node["run_id"]], dict_get_or(node, "retry_run_id", "")) +} +export func attempt_limit(state, id) {return dict_get_or(definition(state, id)["config"]["node_execution"], "max_attempts", 1)} +export func current_attempt(state, id) { + rows := dict_get_or(dict_get_or(state, "graph_attempts", {}), id, []) + if len(rows) == 0 {return null};return rows[len(rows) - 1] +} +export func attempt_run(state, id) {row := current_attempt(state, id);if row != null {return row["run_id"]};return attempt_runs(state, id)[0]} +export func held_reservation(state, id) {row := current_attempt(state, id);return row != null&&row["dispatch"] == null&&row["release"] == null} +export func validate_accounting(state) { + metadata := dict_get_or(state["workflow_definition"], "metadata", {}) + if has_key(metadata, "graph_accounting") == 0 {return true} + need(accounting_enabled(state)&&has_key(metadata, "graph_policy"), "attempt_accounting_unsupported") + runs := [] + for step in state["workflow_definition"]["steps"] { + if program_contract(step) { + node := step["config"]["node_execution"];limit := attempt_limit(state, step["id"]) + need(type(limit) == "int"&&limit >= 1&&limit <= 2, "node_attempt_limit_invalid") + if limit == 2 {need(step["config"]["terminal_contract"] == "program-attempt/v1alpha1"&&dict_get_or(node, "retry_run_id", "") != ""&&dict_get_or(dict_get_or(step["config"], "on_unsuccessful", {}), "action", "") == "retry_same_node", "retry_contract_required")} + else {need(has_key(node, "retry_run_id") == 0, "undeclared_retry_run")} + ids := attempt_runs(state, step["id"]) + for i in range(0, limit) {need(type(ids[i]) == "string"&&ids[i] != ""&&contains(runs, ids[i]) == false, "duplicate_attempt_run");runs = push(runs, ids[i])} + } + } + return true +} +export func accounting_budget(state) { + consumed := 0;reserved := 0;released := 0;nodes := [] + history := dict_get_or(state, "graph_attempts", {}) + for step in state["workflow_definition"]["steps"] {if program_contract(step) { + used := 0;held := 0;rows := dict_get_or(history, step["id"], []) + for row in rows {if row["dispatch"] != null {consumed = consumed + 1;used = used + 1} else if row["release"] != null {released = released + 1} else {reserved = reserved + 1;held = held + 1}} + nodes = push(nodes, {"node_id":step["id"], "limit":attempt_limit(state, step["id"]), "consumed":used, "reserved":held, "remaining":attempt_limit(state, step["id"]) - used - held}) + }} + limit := state["workflow_definition"]["metadata"]["graph_policy"]["budget"]["max_program_dispatches"] + need(consumed + reserved <= limit, "graph_attempt_budget_oversubscribed") + return {"unit":"program_dispatches", "limit":limit, "used":consumed, "consumed":consumed, "reserved":reserved, "released":released, "available":limit - consumed - reserved, "exhausted":consumed + reserved >= limit, "on_exhaustion":"block", "nodes":nodes} +} +export func attempt_event(kind) {return contains(["graph_attempt_reserved", "graph_reservation_released", "graph_attempt_retried"], kind)} +# All callers provide source-checked journal transitions. This fold additionally +# validates lineage and prevents duplicate consumption even during reconstruction. +export func fold_attempt(state, kind, data) { + if accounting_enabled(state) == false {need(attempt_event(kind) == false, "attempt_accounting_required");return state} + if attempt_event(kind) == false&&contains(["node_start_requested", "node_terminal_observed"], kind) == false {return state} + c := data;if attempt_event(kind) {c = data["candidate"]} + id := c["node_id"];step := definition(state, id) + if program_contract(step) == false {need(attempt_event(kind) == false, "program_attempt_required");return state} + history := dict_get_or(state, "graph_attempts", {});rows := dict_get_or(history, id, []);row := current_attempt(state, id) + if kind == "graph_attempt_reserved"||kind == "graph_attempt_retried" { + ordinal := 1;prior := null + if row != null { + ordinal = row["ordinal"];prior = row["reservation"]["candidate"]["previous_terminal_ref"] + if kind == "graph_attempt_retried" { + need(row["dispatch"] != null&&row["terminal"] != null&&row["terminal"]["terminal"]["outcome"] == "failed", "retry_terminal_required") + ordinal = ordinal + 1;prior = "sha256:" + sha256(portable_json(row["terminal"])) + } else {need(row["release"] != null&&row["dispatch"] == null, "attempt_already_reserved")} + } else {need(kind == "graph_attempt_reserved", "retry_prior_missing")} + need(ordinal <= attempt_limit(state, id)&&c["ordinal"] == ordinal&&c["run_id"] == attempt_runs(state, id)[ordinal - 1]&&c["previous_terminal_ref"] == prior, "attempt_lineage_mismatch") + need(accounting_budget(state)["available"] > 0, "graph_attempt_budget_exhausted") + need(len(rows) < 16, "attempt_reservation_history_limit") + row = {"ordinal":ordinal, "run_id":c["run_id"], "reservation":data, "dispatch":null, "release":null, "terminal":null} + rows = push(rows, row) + } else { + # Optional never-dispatched cancellation is still a terminal policy fact, + # not an execution unit. It may have no reservation at all. + if kind == "node_terminal_observed"&&(row == null||row["release"] != null) {need(data["terminal"]["outcome"] == "cancelled", "attempt_reservation_missing");return state} + need(row != null, "attempt_reservation_missing") + if kind == "graph_reservation_released" { + need(row["dispatch"] == null&&row["release"] == null&&row["terminal"] == null&&c["reservation_id"] == row["reservation"]["candidate"]["candidate_id"], "reservation_release_unsafe") + row["release"] := data + } else if kind == "node_start_requested" { + need(row["dispatch"] == null&&row["release"] == null&&row["terminal"] == null&&data["consumer"]["run_id"] == row["run_id"], "attempt_dispatch_conflict") + row["dispatch"] := data + } else { + need(row["terminal"] == null&&row["release"] == null&&data["terminal"]["subject"]["run_id"] == row["run_id"], "attempt_terminal_conflict") + need(row["dispatch"] != null||data["terminal"]["outcome"] == "cancelled", "attempt_dispatch_missing") + row["terminal"] := data + } + rows[len(rows) - 1] := row + } + history[id] := rows;state["graph_attempts"] := history;accounting_budget(state);return state +} +export func attempt_history(state, events) { + view := {"workflow_definition":dict_get_or(state, "workflow_definition", {})} + for event in events {if attempt_event(event["kind"])||contains(["node_start_requested", "node_terminal_observed"], event["kind"]) {view = fold_attempt(view, event["kind"], event["details"]["data"])}} + need(to_json(dict_get_or(view, "graph_attempts", {})) == to_json(dict_get_or(state, "graph_attempts", {})), "attempt_history_mismatch");return true +} + +export func attempt_terminal_schema(contract) {if contract == "program-attempt/v1alpha1" {return "dispatch.node-terminal/v1alpha2"};return "dispatch.node-terminal/v1alpha1"} diff --git a/src/core/graph_outcome.kujo b/src/core/graph_outcome.kujo index 21e692b..c66253f 100644 --- a/src/core/graph_outcome.kujo +++ b/src/core/graph_outcome.kujo @@ -1,3 +1,4 @@ +from src.core.graph_attempts import program_contract, accounting_enabled, accounting_budget, held_reservation from src.core.graph_policy import policy_enabled, path_state, failure_strategy, static_policy, dispatch_budget, policy_group # Installed local operator API. Inspect is informational; apply never runs nodes. from src.core.node_composition import runtime, spec, validate_node_outputs, local_node_inputs, node_terminal, program_node_state, retain, persist_node_transition @@ -82,10 +83,10 @@ export func scoped_outcome_facts(graph, host, scope) { checked := node_terminal(graph, id, host, false);terminal = checked["identity"] demand(same(terminal, graph["node_completions"][id]["terminal"]), "graph_terminal_observation_stale") for raw in checked["artifacts"] {raws = push(raws, raw)} - if graph_contract(step) != "parent-finalization/v1alpha1" { + if program_contract(step) == false { input := local_node_inputs(graph, id, host);demand(same(input["binding"], graph["graph_node_bindings"][id]), "stale_terminal_inputs") } - if graph_contract(step) == "parent-finalization/v1alpha1"&&terminal["outcome"] == "completed" {validate_node_outputs(graph, id, host)} + if program_contract(step)&&terminal["outcome"] == "completed" {validate_node_outputs(graph, id, host)} reason = "terminal" strategy := terminal["outcome"] if policy_enabled(graph) {strategy = failure_strategy(graph, step, terminal["outcome"]);reason = strategy} @@ -97,7 +98,7 @@ export func scoped_outcome_facts(graph, host, scope) { # A surviving dispatch may admit in another child process. Even before # the claim exists it cannot be waived by optional graph completion. if has_key(dict_get_or(graph, "node_dispatches", {}), id) {inflight = true;reason = "dispatched_node_requires_terminal_evidence"} - if graph_contract(step) == "parent-finalization/v1alpha1" { + if program_contract(step) { child := program_node_state(graph, id, host) if has_key(child, "node_execution_admission")||has_key(child, "node_input_binding")&&file_exists(child["run_dir"] + "/" + node_claim_path(child["node_input_binding"])) { inflight = true;reason = "consumed_node_requires_terminal_evidence" @@ -119,11 +120,13 @@ export func scoped_outcome_facts(graph, host, scope) { } } } + if accounting_enabled(graph)&&accounting_budget(graph)["reserved"] > 0 {policy_block = true} if inflight == false&&policy_block == false { if required_failed {outcome = "failed"} else if required_cancelled {outcome = "cancelled"} else if pending == false {outcome = "completed"} } data := {"schema":"dispatch.graph-outcome-candidate/v1alpha1", "outcome":outcome, "nodes":nodes, "policy":"required-success/no-unfinished-admission/v1alpha1"} if policy_enabled(graph) {data["schema"] := "dispatch.graph-outcome-candidate/v1alpha2";data["policy"] := "static-active-path/v1alpha1";branches := [];for id in keys(dict_get_or(graph, "branch_activations", {})) {record := graph["branch_activations"][id];raw := portable_json(record);branches = push(branches, {"branch_id":id, "selected":record["candidate"]["selected"], "activation_ref":"sha256:" + sha256(raw)});raws = push(raws, raw)};data["branches"] := branches;data["subgraphs"] := groups;data["budget"] := dispatch_budget(graph)} + if accounting_enabled(graph) {raw := to_json(dict_get_or(graph, "graph_attempts", {}));data["accounting_ref"] := "sha256:" + sha256(raw);raws = push(raws, raw)} return {"candidate":candidate(graph, data), "artifacts":raws} } func review_request(graph, id, host) { @@ -181,6 +184,7 @@ export func graph_terminal_operation(root, run_id, request, options) { func cancel_optional(graph, id, actor, host, options) { step := spec(graph, id) + demand(held_reservation(graph, id) == false, "release_reservation_before_cancellation") demand(step["optional"]&&has_key(dict_get_or(graph, "node_completions", {}), id) == 0&&has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0, "optional_cancel_not_permitted") demand(graph_contract(step) == "parent-finalization/v1alpha1", "optional_cancel_requires_program") child := program_node_state(graph, id, host);lock := acquire_run_lock(child);demand(lock["ok"], "node_locked") diff --git a/src/core/graph_policy.kujo b/src/core/graph_policy.kujo index 175ac83..e238e6e 100644 --- a/src/core/graph_policy.kujo +++ b/src/core/graph_policy.kujo @@ -1,3 +1,4 @@ +from src.core.graph_attempts import accounting_enabled, validate_accounting, accounting_budget, current_attempt, attempt_limit # Static policy and pure projections. No execution, callbacks or expression language. from src.core.utils import dict_get_or from src.core.portable_commitments import portable_json @@ -13,6 +14,7 @@ func prior(state, id) { return found } export func validate_static_policy(state) { + validate_accounting(state) if policy_enabled(state) == false {return true} p := static_policy(state) need(p["schema"] == "dispatch.static-graph-policy/v1alpha1"&&len(p["branches"]) <= 2&&len(p["subgraphs"]) <= 2, "static_policy_unsupported") @@ -46,7 +48,8 @@ export func validate_static_policy(state) { } for step in state["workflow_definition"]["steps"] { action := dict_get_or(step["config"], "on_unsuccessful", {"action":"fail"}) - need(contains(["fail", "block", "continue_optional", "route", "require_review"], action["action"]), "failure_strategy_invalid") + need(contains(["fail", "block", "continue_optional", "route", "require_review", "retry_same_node"], action["action"]), "failure_strategy_invalid") + if action["action"] == "retry_same_node" {need(accounting_enabled(state)&&step["config"]["terminal_contract"] == "program-attempt/v1alpha1", "retry_accounting_required")} if action["action"] == "continue_optional" {need(step["optional"], "required_failure_cannot_be_ignored")} if action["action"] == "route" {need(policy_branch(state, action["branch"])["source"] == step["id"], "failure_route_source_mismatch")} if action["action"] == "require_review" {review := policy_step(state, action["review_node"]);need(review["config"]["terminal_contract"] == "intervention-decision/v2"&&contains(prior(state, review["id"]), step["id"])&&review["optional"] == false, "failure_review_invalid")} @@ -126,12 +129,14 @@ export func policy_controls(state, step) { return {"controls":controls, "artifacts":raws} } export func dispatch_budget(state) { + if accounting_enabled(state) {return accounting_budget(state)} limit := static_policy(state)["budget"]["max_program_dispatches"];used := len(keys(dict_get_or(state, "node_dispatches", {}))) return {"unit":"program_dispatch_reservations", "used":used, "limit":limit, "exhausted":used >= limit, "on_exhaustion":"block"} } export func failure_strategy(state, step, outcome) { if outcome == "completed" {return "satisfied"} action := dict_get_or(step["config"], "on_unsuccessful", {"action":"fail"}) + if action["action"] == "retry_same_node" {row := current_attempt(state, step["id"]);if row != null&&row["ordinal"] < attempt_limit(state, step["id"]) {return "blocked"}} if action["action"] == "block" {return "blocked"} if action["action"] == "route" {if has_key(dict_get_or(state, "branch_activations", {}), action["branch"]) {return "routed"};return "awaiting_selection"} if action["action"] == "require_review" { diff --git a/src/core/graph_policy_operation.kujo b/src/core/graph_policy_operation.kujo index 19fef07..d06cf2c 100644 --- a/src/core/graph_policy_operation.kujo +++ b/src/core/graph_policy_operation.kujo @@ -1,8 +1,11 @@ +from src.core.control_journal import reconcile_control_journal +from src.core.node_transition import node_claim_path +from src.core.graph_attempts import program_contract, accounting_enabled, accounting_budget # Installed operator API. Assessment never schedules; apply revalidates under run lock. from src.core.graph_policy import policy_enabled, policy_branch, policy_group from src.core.graph_outcome import candidate, authorize, scoped_outcome_facts from src.core.graph_transition import graph_contract -from src.core.node_composition import runtime, spec, node_terminal, local_node_inputs, validate_node_outputs, retain, persist_node_transition +from src.core.node_composition import runtime, spec, assess_attempt, endpoint, node_terminal, local_node_inputs, validate_node_outputs, retain, persist_node_transition from src.core.node_transition import node_raw from src.core.state import load_run_state, acquire_run_lock, release_run_lock from src.core.portable_commitments import portable_json @@ -10,13 +13,14 @@ from src.core.utils import dict_get_or func need(ok, reason) {if ok != true {throw(reason)}} func assess(graph, request, host) { kind := request["kind"];id := request["id"] + if kind == "attempt" {checked := assess_attempt(graph, id, request["action"], host);return {"candidate":candidate(graph, checked["data"]), "artifacts":checked["artifacts"]}} if kind == "branch" { need(has_key(dict_get_or(graph, "branch_activations", {}), id) == 0, "branch_already_activated") branch := policy_branch(graph, id);source := branch["source"] verified := node_terminal(graph, source, host, false);terminal := verified["identity"] need(to_json(terminal) == to_json(graph["node_completions"][source]["terminal"]), "branch_source_not_observed") contract := graph_contract(spec(graph, source)) - if contract == "parent-finalization/v1alpha1" {if terminal["outcome"] == "completed" {validate_node_outputs(graph, source, host)}} + if program_contract(spec(graph, source)) {if terminal["outcome"] == "completed" {validate_node_outputs(graph, source, host)}} else {need(to_json(local_node_inputs(graph, source, host)["binding"]) == to_json(graph["graph_node_bindings"][source]), "branch_source_inputs_stale")} value := terminal["outcome"];fact_ref := terminal["facts_ref"] if branch["predicate"] != "terminal_outcome" { @@ -40,11 +44,14 @@ func assess(graph, request, host) { } export func graph_policy_operation(root, run_id, request, options) { loaded := load_run_state(root, run_id);if loaded["ok"] == false {return loaded} - lock := null;apply := request["operation"] == "apply";answer := {"ok":false} + if request["kind"] == "accounting" {try {need(request["operation"] == "assess"&&accounting_enabled(loaded["run_state"]), "accounting_read_only");host := runtime(loaded["run_state"], options);return {"ok":true, "report":accounting_report(loaded["run_state"], host)}} except err {return {"ok":false, "reason":to_string(err)}}} + lock := null;child_lock := null;apply := request["operation"] == "apply";answer := {"ok":false} if apply {lock = acquire_run_lock(loaded["run_state"]);if lock["ok"] == false {return lock}} try { graph := load_run_state(root, run_id)["run_state"];need(policy_enabled(graph)&&has_key(graph, "graph_finalization") == 0, "policy_graph_terminal_or_unsupported") - host := runtime(graph, options);checked := assess(graph, request, host) + host := runtime(graph, options) + if apply&&request["kind"] == "attempt" {child_lock = acquire_run_lock(endpoint(graph, request["id"], host)["state"]);need(child_lock["ok"], "attempt_child_locked")} + checked := assess(graph, request, host) if apply { need(to_json(checked["candidate"]) == to_json(request["candidate"]), "stale_policy_candidate") if request["kind"] == "subgraph" {need(checked["candidate"]["outcome"] != "blocked", "subgraph_blocked")} @@ -55,11 +62,43 @@ export func graph_policy_operation(root, run_id, request, options) { need(to_json(latest["candidate"]) == to_json(request["candidate"]), "stale_policy_candidate");authorize(host, request["actor"], graph, latest["candidate"]) refs := ["sha256:" + sha256(actor_raw)];for raw in latest["artifacts"] {refs = push(refs, "sha256:" + sha256(raw))} data := {"candidate":latest["candidate"], "actor_ref":"sha256:" + sha256(actor_raw), "artifacts":refs, "resulting_revision":graph["revision"] + 1} - kind := "graph_branch_activated";if request["kind"] == "subgraph" {kind = "graph_subgraph_finalized"} + kind := "graph_branch_activated";if request["kind"] == "attempt" {kind = "graph_attempt_reserved";if request["action"] == "release" {kind = "graph_reservation_released"};if request["action"] == "retry" {kind = "graph_attempt_retried"}};if request["kind"] == "subgraph" {kind = "graph_subgraph_finalized"} graph = persist_node_transition(graph, kind, data) if type(hook) == "function" {hook("after_" + request["kind"])} answer = {"ok":true, "receipt":data, "continuation":"not_authorized"} } else {need(request["operation"] == "assess", "policy_operation_invalid");answer = {"ok":true, "candidate":checked["candidate"], "authority":"informational"}} } except err {answer = {"ok":false, "reason":to_string(err)}} + if child_lock != null&&child_lock["ok"] {release_run_lock(child_lock)} if lock != null {release_run_lock(lock)};return answer } + +# Informational readback separates recorded dispatch from admission and work truth. +func accounting_report(graph, host) { + attempts := [];evaluations := [];decisions := [] + for step in graph["workflow_definition"]["steps"] { + id := step["id"];contract := graph_contract(step) + if program_contract(step) { + for row in dict_get_or(dict_get_or(graph, "graph_attempts", {}), id, []) { + phase := "reserved";admission := "not_recorded";work := "unknown";terminal := null + if row["release"] != null {phase = "released";work = "never_dispatched"} + if row["dispatch"] != null {phase = "consumed"} + if row["terminal"] != null {terminal = row["terminal"]["terminal"]} + try { + entry := host["resolve_attempt"](id, row["run_id"]);loaded := load_run_state(entry["root"], entry["run_id"]);need(loaded["ok"], "child_missing");child := loaded["run_state"] + need(child["run_id"] == row["run_id"]&&reconcile_control_journal(child)["ok"], "child_history_unavailable") + if has_key(child, "node_execution_refusal") {admission = "refused_before_admission";work = "never_admitted"} + if has_key(child, "node_execution_admission") {admission = "consumed"} + if has_key(child, "node_input_binding")&&file_exists(child["run_dir"] + "/" + node_claim_path(child["node_input_binding"])) {admission = "consumed"} + if dict_get_or(child["steps"][0], "execution_result", null) != null {work = "result_recorded"} + if has_key(child, "parent_finalization") {work = "independently_finalized"} + } except err {admission = "unknown";work = "unknown"} + attempts = push(attempts, {"node_id":id, "run_id":row["run_id"], "ordinal":row["ordinal"], "reservation_id":row["reservation"]["candidate"]["candidate_id"], "accounting":phase, "admission":admission, "work":work, "terminal":terminal, "previous_terminal_ref":row["reservation"]["candidate"]["previous_terminal_ref"]}) + } + } else { + bound := has_key(dict_get_or(graph, "graph_node_bindings", {}), id);terminal := dict_get_or(dict_get_or(graph, "node_completions", {}), id, null) + if contract == "evaluation-result/v1" {evaluations = push(evaluations, {"node_id":id, "bound_instance":bound, "terminal_recorded":terminal != null})} + if contract == "intervention-decision/v2" {decisions = push(decisions, {"node_id":id, "bound_instance":bound, "request_recorded":has_key(dict_get_or(graph, "graph_reviews", {}), id), "terminal_recorded":terminal != null})} + } + } + return {"schema":"dispatch.attempt-accounting-report/v1alpha1", "run_id":graph["run_id"], "revision":graph["revision"], "journal":graph["control_journal"]["last_sha256"], "budget":accounting_budget(graph), "attempts":attempts, "evaluation_instances":evaluations, "decision_instances":decisions, "authority":"informational"} +} diff --git a/src/core/graph_transition.kujo b/src/core/graph_transition.kujo index 0d22eb8..d8b4860 100644 --- a/src/core/graph_transition.kujo +++ b/src/core/graph_transition.kujo @@ -1,3 +1,4 @@ +from src.core.graph_attempts import attempt_event, fold_attempt, attempt_history from src.core.graph_policy import policy_event, apply_policy_transition, policy_history # Pure graph-local projections. No participant callback, execution or scheduler. from src.core.utils import dict_get_or @@ -5,7 +6,7 @@ from src.core.portable_commitments import portable_json func demand(ok, reason) {if ok != true {throw(reason)}} export func heterogeneous_graph(state) {return dict_get_or(dict_get_or(dict_get_or(state, "workflow_definition", {}), "metadata", {}), "graph_outcome", "") == "dispatch.graph-outcome/v1alpha1"} export func graph_contract(step) {return dict_get_or(step["config"], "terminal_contract", "parent-finalization/v1alpha1")} -export func graph_event(kind) {return policy_event(kind)||contains(["graph_node_bound", "graph_review_requested", "graph_finalized"], kind)} +export func graph_event(kind) {return attempt_event(kind)||policy_event(kind)||contains(["graph_node_bound", "graph_review_requested", "graph_finalized"], kind)} export func graph_refs(state, refs) { for ref in refs { demand(type(ref) == "string"&®ex_match(ref, "^sha256:[0-9a-f]{64}$"), "graph_reference_invalid") @@ -16,6 +17,15 @@ export func graph_refs(state, refs) { } export func apply_graph_transition(state, kind, data) { demand(heterogeneous_graph(state)&&has_key(state, "graph_finalization") == 0, "graph_terminal_or_unsupported") + if attempt_event(kind) { + graph_refs(state, data["artifacts"]);c := data["candidate"];unsigned := {};for key in keys(c) {if key != "candidate_id" {unsigned[key] := c[key]}} + demand(c["candidate_id"] == sha256(portable_json(unsigned))&&c["revision"] == state["revision"]&&data["resulting_revision"] == state["revision"] + 1, "attempt_candidate_stale") + state = fold_attempt(state, kind, data) + if kind == "graph_attempt_retried" { + id := c["node_id"];for field in ["node_dispatches", "node_completions"] {next := {};for key in keys(dict_get_or(state, field, {})) {if key != id {next[key] := state[field][key]}};state[field] := next} + steps := state["steps"];for i in range(0, len(steps)) {if steps[i]["id"] == id {step := steps[i];step["status"] := "pending";step["output"] := null;steps[i] := step}};state["steps"] := steps;state["current_step_index"] := 0 + };state["status"] := "paused";return state + } if policy_event(kind) {graph_refs(state, data["artifacts"]);return apply_policy_transition(state, kind, data)} id := dict_get_or(data, "node_id", "") if kind == "graph_node_bound" { @@ -38,14 +48,14 @@ export func apply_graph_transition(state, kind, data) { return state } export func graph_history_projection(state, events) { - policy_history(state, events) + policy_history(state, events);attempt_history(state, events) bindings := {};reviews := {};finalized := null for event in events { kind := event["kind"] if graph_event(kind) { demand(finalized == null, "graph_event_after_terminal") data := event["details"]["data"] - if policy_event(kind) {graph_refs(state, data["artifacts"])} + if policy_event(kind)||attempt_event(kind) {graph_refs(state, data["artifacts"])} if kind == "graph_node_bound" {demand(has_key(bindings, data["node_id"]) == 0, "duplicate_graph_binding");bindings[data["node_id"]] := data;graph_refs(state, data["artifacts"])} if kind == "graph_review_requested" {reviews[data["node_id"]] := data} if kind == "graph_finalized" {finalized = data;graph_refs(state, data["artifacts"])} diff --git a/src/core/node_composition.kujo b/src/core/node_composition.kujo index fef2d20..7a3a41d 100644 --- a/src/core/node_composition.kujo +++ b/src/core/node_composition.kujo @@ -1,9 +1,12 @@ +from src.core.graph_attempts import accounting_enabled, program_contract, current_attempt, attempt_run, attempt_runs, attempt_limit, held_reservation, accounting_budget, attempt_terminal_schema +from src.core.parent_transition import parent_state_body +from src.core.portable_commitments import portable_json from src.core.graph_policy import policy_enabled, validate_static_policy, policy_ready, policy_dependencies, dependency_accepts, policy_controls, dispatch_budget # Installed run-backed step adapter. The existing runner owns dependency scheduling. from src.core.graph_transition import heterogeneous_graph, graph_contract from src.core.state import load_run_state, acquire_run_lock, release_run_lock, persist_run_state from src.core.assurance_state import assurance_protected, validate_assurance_anchor -from src.core.assurance_configuration import resolve_run_configuration +from src.core.assurance_configuration import resolve_run_configuration, resolve_run_authority from src.core.control_journal import reconcile_control_journal, append_control_event from src.core.parent_transition import validate_parent_artifacts, validate_parent_topology from src.core.node_transition import composition_graph, composition_node, node_reference, node_raw, node_claim_path, node_transition_details, apply_node_transition, validate_node_binding_bytes @@ -29,9 +32,10 @@ export func validate_composed_definition(state) { demand(step["type"] == "tool"&&(step["optional"] == false||heterogeneous_graph(state))&&step["parallel_safe"] == false&&step["idempotency_key"] == "", "node_step_unsupported") demand(contains(ids, step["id"]) == false, "duplicate_node");ids = push(ids, step["id"]) contract := graph_contract(step) + if contract == "program-attempt/v1alpha1" {demand(accounting_enabled(state), "attempt_accounting_required")} if heterogeneous_graph(state) { - demand(contains(["parent-finalization/v1alpha1", "evaluation-result/v1", "intervention-decision/v2"], contract), "terminal_contract_unsupported") - if contract != "parent-finalization/v1alpha1" { + demand(contains(["parent-finalization/v1alpha1", "program-attempt/v1alpha1", "evaluation-result/v1", "intervention-decision/v2"], contract), "terminal_contract_unsupported") + if program_contract(step) == false { demand(has_key(step["config"], "node_execution") == 0&&len(step["config"]["inputs"]) <= 8, "nonexecuting_node_contract_invalid") if contract == "evaluation-result/v1" {demand(len(step["config"]["inputs"]) == 1&&type(step["config"]["evaluator"]) == "dict", "evaluation_contract_invalid")} continue @@ -54,11 +58,12 @@ export func validate_composed_definition(state) { export func runtime(graph, options) { validate_composed_definition(graph);demand(reconcile_control_journal(graph)["ok"], "node_graph_recovery_required") checked := resolve_run_configuration(graph, options);demand(checked["ok"], "node_graph_authority_stale") - host := checked["installed"]["node_host"];demand(type(host["resolve"]) == "function"&&type(host["start"]) == "function", "node_host_required");return host + host := checked["installed"]["node_host"];if accounting_enabled(graph) {demand(type(dict_get_or(host, "resolve_attempt", null)) == "function", "attempt_host_required")};demand(type(host["resolve"]) == "function"&&type(host["start"]) == "function", "node_host_required");return host } -func endpoint(graph, id, host) { +export func endpoint(graph, id, host) { declared := spec(graph, id)["config"]["node_execution"];entry := host["resolve"](id) - demand(entry["run_id"] == declared["run_id"], "node_run_mismatch") + if accounting_enabled(graph) {entry = host["resolve_attempt"](id, attempt_run(graph, id))} + demand(entry["run_id"] == attempt_run(graph, id), "node_run_mismatch") loaded := load_run_state(entry["root"], entry["run_id"]);demand(loaded["ok"], "node_state_missing") state := loaded["run_state"];demand(composition_node(state)&&assurance_protected(state)&&reconcile_control_journal(state)["ok"], "node_state_invalid") demand(len(state["steps"]) == 1&&state["steps"][0]["id"] == declared["step_id"], "node_step_mismatch") @@ -117,6 +122,7 @@ func prepare(graph, id, host) { demand(total <= 4194304, "node_binding_limit") binding := {"schema":input_binding_schema(graph), "graph":{"run_id":graph["run_id"], "workflow_ref":"sha256:" + sha256(to_json(graph["workflow_definition"]))}, "node_id":id, "consumer":{"run_id":node["state"]["run_id"], "step_id":node["declaration"]["step_id"], "attempt_id":"1"}, "predecessors":predecessors, "inputs":inputs, "artifacts":refs} if policy_enabled(graph) {binding["policy"] := controls["controls"]} + if accounting_enabled(graph) {row := current_attempt(graph, id);ordinal := 1;previous := null;if row != null {ordinal = row["ordinal"];previous = row["reservation"]["candidate"]["previous_terminal_ref"]};binding["attempt"] := {"ordinal":ordinal, "previous_terminal_ref":previous};if row != null&&has_key(row["reservation"]["candidate"], "binding_ref") {demand(node_reference(binding) == row["reservation"]["candidate"]["binding_ref"], "reserved_inputs_changed")}} return {"binding":binding, "artifacts":unique, "node":node} } export func retain(state, raws) { @@ -194,7 +200,7 @@ export func advance_composed_step(graph, index, options) { loaded := load_run_state(graph["output_root"], graph["run_id"]);demand(loaded["ok"], "node_graph_missing");graph = loaded["run_state"] host := runtime(graph, options);id := graph["steps"][index]["id"] if policy_enabled(graph) {demand(policy_ready(graph, spec(graph, id)), "policy_dependency_blocked")} - if graph_contract(spec(graph, id)) != "parent-finalization/v1alpha1" { + if program_contract(spec(graph, id)) == false { checked := local_node_inputs(graph, id, host) if has_key(dict_get_or(graph, "graph_node_bindings", {}), id) == 0 { retain(graph, checked["artifacts"]) @@ -203,31 +209,39 @@ export func advance_composed_step(graph, index, options) { } else {demand(same(graph["graph_node_bindings"][id], checked["binding"]), "graph_input_immutable")} return {"ok":true, "paused":true, "reason":"node_terminal_evidence_required", "run_state":graph} } + if accounting_enabled(graph)&&has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0&&held_reservation(graph, id) == false { + selected := assess_attempt(graph, id, "reserve", host);raws := selected["artifacts"];retain(graph, raws) + c := attempt_candidate(graph, selected["data"]);refs := [];for raw in raws {refs = push(refs, "sha256:" + sha256(raw))} + graph = persist_node_transition(graph, "graph_attempt_reserved", {"candidate":c, "artifacts":refs, "actor_ref":null, "resulting_revision":graph["revision"] + 1}) + hook := dict_get_or(options, "node_boundary", null);if type(hook) == "function" {hook("after_attempt_reservation", id)} + } checked := prepare(graph, id, host) boundary := dict_get_or(options, "node_boundary", null) if type(boundary) == "function" {boundary("before_node_binding", id)} child := bind_locked(graph, id, checked["binding"], host) if type(boundary) == "function" {boundary("after_node_binding", id)} - if has_key(child, "parent_finalization") { + if has_key(child, "parent_finalization")||has_key(child, "node_execution_refusal") { terminal := node_terminal(graph, id, host, false);retain(graph, terminal["artifacts"]) references := [];for raw in terminal["artifacts"] {references = push(references, "sha256:" + sha256(raw))} graph = persist_node_transition(graph, "node_terminal_observed", {"node_id":id, "terminal":terminal["identity"], "artifacts":references}) return {"ok":true, "paused":false, "run_state":graph} } if has_key(child, "node_execution_admission") == 0&&file_exists(child["run_dir"] + "/" + node_claim_path(checked["binding"])) == false { - if policy_enabled(graph)&&has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0 {demand(dispatch_budget(graph)["exhausted"] == false, "graph_dispatch_budget_exhausted")} + if accounting_enabled(graph) {demand(resolve_run_authority(child, checked["node"]["entry"]["options"])["ok"], "attempt_authority_stale")} + if accounting_enabled(graph)&&has_key(dict_get_or(graph, "node_dispatches", {}), id) {return {"ok":true, "paused":true, "reason":"consumed_dispatch_not_redelivered", "run_state":graph}} + if policy_enabled(graph)&&held_reservation(graph, id) == false&&has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0 {demand(dispatch_budget(graph)["exhausted"] == false, "graph_dispatch_budget_exhausted")} if has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0 {graph = persist_node_transition(graph, "node_start_requested", {"node_id":id, "binding_ref":node_reference(checked["binding"]), "consumer":checked["binding"]["consumer"]})} if type(boundary) == "function" {boundary("after_node_start_requested", id)} result := host["start"](id, checked["binding"]) - demand(dict_get_or(result, "ok", false), "node_start_denied") + demand(dict_get_or(result, "ok", false)||dict_get_or(result, "refused_before_admission", false), "node_start_denied") } graph["status"] := "paused";steps := graph["steps"];step := steps[index];step["status"] := "paused";steps[index] := step;graph["steps"] := steps;graph["current_step_index"] := index graph = persist_run_state(graph) return {"ok":true, "paused":true, "reason":"node_requires_independent_finalization", "run_state":graph} } -func input_binding_schema(graph) {if policy_enabled(graph) {return "dispatch.node-input-binding/v1alpha3"};if heterogeneous_graph(graph) {return "dispatch.node-input-binding/v1alpha2"};return "dispatch.node-input-binding/v1alpha1"} -func node_input_edges(step) {if graph_contract(step) == "parent-finalization/v1alpha1" {return step["config"]["node_execution"]["inputs"]};return step["config"]["inputs"]} +func input_binding_schema(graph) {if accounting_enabled(graph) {return "dispatch.node-input-binding/v1alpha4"};if policy_enabled(graph) {return "dispatch.node-input-binding/v1alpha3"};if heterogeneous_graph(graph) {return "dispatch.node-input-binding/v1alpha2"};return "dispatch.node-input-binding/v1alpha1"} +func node_input_edges(step) {if program_contract(step) {return step["config"]["node_execution"]["inputs"]};return step["config"]["inputs"]} # Closed host-owned terminal variants. A descriptive kind is never consulted. export func node_terminal(graph, id, host, success) { step := spec(graph, id);contract := graph_contract(step) @@ -239,11 +253,17 @@ export func node_terminal(graph, id, host, success) { return {"identity":prior["terminal"], "receipt":receipt, "artifacts":raws} } } - if contract == "parent-finalization/v1alpha1" { - node := endpoint(graph, id, host);terminal := completed(node, success) + if program_contract(step) { + node := endpoint(graph, id, host) + if contract == "program-attempt/v1alpha1"&&has_key(node["state"], "node_execution_refusal") { + demand(success == false, "refused_node_not_successful");state := node["state"];receipt := state["node_execution_refusal"];binding := state["node_input_binding"] + demand(receipt["binding_ref"] == node_reference(binding)&&has_key(state, "node_execution_admission") == 0&&file_exists(state["run_dir"] + "/" + node_claim_path(binding)) == false, "refusal_consumption_conflict") + raw := portable_json(receipt);return {"identity":{"schema":attempt_terminal_schema(contract), "node_id":id, "contract":contract, "subject":binding["consumer"], "facts_ref":"sha256:" + sha256(raw), "finalized_revision":receipt["resulting_revision"], "outcome":"failed", "authority_ref":receipt["authority_ref"]}, "receipt":receipt, "artifacts":[raw, portable_json(binding)]} + } + terminal := completed(node, success) if heterogeneous_graph(graph) { old := terminal["identity"] - terminal["identity"] := {"schema":"dispatch.node-terminal/v1alpha1", "node_id":id, "contract":contract, "subject":old["subject"], "facts_ref":old["finalization_ref"], "finalized_revision":old["finalized_revision"], "outcome":old["outcome"], "authority_ref":"sha256:" + node["state"]["assurance_negotiation"]["config_revision"]} + terminal["identity"] := {"schema":attempt_terminal_schema(contract), "node_id":id, "contract":contract, "subject":old["subject"], "facts_ref":old["finalization_ref"], "finalized_revision":old["finalized_revision"], "outcome":old["outcome"], "authority_ref":"sha256:" + node["state"]["assurance_negotiation"]["config_revision"]} } return terminal } @@ -282,3 +302,46 @@ export func validate_node_outputs(graph, id, host) { for item in spec(graph, id)["config"]["node_execution"]["outputs"] {output(graph, id, item["name"], item["type_id"], host)} return true } + +export func attempt_candidate(graph, data) { + data["source_sha256"] := sha256(parent_state_body(graph));data["revision"] := graph["revision"];data["journal"] := graph["control_journal"]["last_sha256"] + data["graph"] := {"run_id":graph["run_id"], "workflow_ref":"sha256:" + sha256(to_json(graph["workflow_definition"]))} + data["authority_ref"] := "sha256:" + graph["assurance_negotiation"]["config_revision"];data["candidate_id"] := sha256(portable_json(data));return data +} +func logical_inputs(binding) {copy := {};for key in keys(binding) {if key != "consumer"&&key != "attempt" {copy[key] := binding[key]}};return copy} +export func never_dispatched_child(child) { + demand(child["steps"][0]["status"] == "pending"&&has_key(child, "node_execution_admission") == 0&&has_key(child, "node_execution_refusal") == 0&&has_key(child, "parent_finalization") == 0, "child_not_pristine") + demand(dict_get_or(child["steps"][0], "execution_result", null) == null, "child_result_exists") + if has_key(child, "node_input_binding") {demand(file_exists(child["run_dir"] + "/" + node_claim_path(child["node_input_binding"])) == false, "child_claim_exists")} + return true +} +export func assess_attempt(graph, id, action, host) { + demand(accounting_enabled(graph)&&program_contract(spec(graph, id))&&contains(["reserve", "release", "retry"], action), "attempt_operation_unsupported") + row := current_attempt(graph, id);node := endpoint(graph, id, host);child := node["state"] + demand(resolve_run_authority(child, node["entry"]["options"])["ok"], "attempt_authority_stale") + if action == "retry" {demand(resolve_run_configuration(child, node["entry"]["options"])["ok"], "retry_inputs_stale")} + ordinal := 1;previous := null;raws := [];reservation_id := null + if row != null {ordinal = row["ordinal"];previous = row["reservation"]["candidate"]["previous_terminal_ref"];reservation_id = row["reservation"]["candidate"]["candidate_id"]} + if action == "release" { + demand(row != null&&held_reservation(graph, id)&&row["terminal"] == null&&has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0, "reservation_release_unsafe");never_dispatched_child(child) + return {"data":{"schema":"dispatch.attempt-candidate/v1alpha1", "node_id":id, "action":action, "reservation_id":reservation_id, "child_source_sha256":sha256(parent_state_body(child))}, "artifacts":[], "child":child} + } + demand(accounting_budget(graph)["available"] > 0, "graph_attempt_budget_exhausted") + if action == "retry" { + demand(row != null&&row["dispatch"] != null&&row["terminal"] != null&&has_key(child, "node_execution_refusal")&&ordinal < attempt_limit(graph, id), "retry_not_safe") + verified := node_terminal(graph, id, host, false);demand(same(row["terminal"]["terminal"], verified["identity"])&&verified["receipt"]["reason"] == "required_resource_unavailable", "retry_refusal_required") + for step in graph["workflow_definition"]["steps"] {if contains(ancestors(graph, step["id"]), id) {demand(has_key(dict_get_or(graph, "node_dispatches", {}), step["id"]) == 0&&has_key(dict_get_or(graph, "graph_node_bindings", {}), step["id"]) == 0&&held_reservation(graph, step["id"]) == false, "retry_descendant_exists");if program_contract(step) {demand(has_key(endpoint(graph, step["id"], host)["state"], "node_input_binding") == 0, "retry_descendant_binding_exists")}}} + for key in keys(dict_get_or(graph, "branch_activations", {})) {demand(graph["branch_activations"][key]["candidate"]["source_terminal"]["node_id"] != id, "retry_branch_already_activated")} + for key in keys(dict_get_or(graph, "subgraph_finalizations", {})) {for fact in graph["subgraph_finalizations"][key]["candidate"]["nodes"] {demand(fact["node_id"] != id, "retry_group_already_finalized")}} + ordinal = ordinal + 1;previous = "sha256:" + sha256(portable_json(row["terminal"])) + raws = push(verified["artifacts"], portable_json(row["terminal"])) + } else {demand(has_key(dict_get_or(graph, "node_completions", {}), id) == 0, "attempt_node_terminal");demand(row == null||row["release"] != null, "attempt_already_reserved");never_dispatched_child(child)} + # Prepare the exact selected instance; old terminal facts remain untouched. + view := graph + if action == "retry" {history := dict_get_or(graph, "graph_attempts", {});rows := history[id];rows = push(rows, {"ordinal":ordinal, "run_id":attempt_runs(graph, id)[ordinal - 1], "reservation":{"candidate":{"previous_terminal_ref":previous}}});history[id] := rows;view["graph_attempts"] := history} + checked := prepare(view, id, host) + if action == "retry" {never_dispatched_child(checked["node"]["state"]);demand(same(logical_inputs(checked["binding"]), logical_inputs(child["node_input_binding"])), "retry_inputs_changed")} + binding_raw := portable_json(checked["binding"]);raws = push(raws, binding_raw) + for raw in checked["artifacts"] {raws = push(raws, raw)} + return {"data":{"schema":"dispatch.attempt-candidate/v1alpha1", "node_id":id, "action":action, "ordinal":ordinal, "run_id":checked["node"]["state"]["run_id"], "previous_terminal_ref":previous, "binding_ref":"sha256:" + sha256(binding_raw), "child_source_sha256":sha256(parent_state_body(checked["node"]["state"]))}, "artifacts":raws, "child":child} +} diff --git a/src/core/node_execution.kujo b/src/core/node_execution.kujo index 2c51696..07df53e 100644 --- a/src/core/node_execution.kujo +++ b/src/core/node_execution.kujo @@ -13,18 +13,28 @@ export func run_bound_node(workflow, state, tools, options, binding) { return current["run_id"] == state["run_id"]&¤t["node_execution_admission"]["binding_ref"] == node_reference(binding)&&read_file_beneath(current["run_dir"], node_claim_path(binding), 65536) == portable_json(binding) } admit := func(current) { - demand(composition_node(current)&&has_key(current, "node_execution_admission") == 0, "node_already_consumed") + demand(composition_node(current)&&has_key(current, "node_execution_refusal") == 0&&has_key(current, "node_execution_admission") == 0, "node_already_consumed") demand(to_json(current["node_input_binding"]) == to_json(binding), "node_binding_changed") demand(len(current["steps"]) == 1&¤t["steps"][0]["status"] == "pending", "node_not_pending") demand(len(keys(dict_get_or(current["workflow_definition"], "control", {}))) > 0&&has_key(current["workflow_definition"]["steps"][0]["config"], "parent_finalization"), "node_parent_contract_required") demand(resolve_run_configuration(current, options)["ok"], "node_authority_stale") validate_node_binding_bytes(current, binding) + hook := dict_get_or(options, "node_boundary", null);if type(hook) == "function" {hook("before_node_admission")} + configured := resolve_run_configuration(current, options);demand(configured["ok"], "node_authority_stale") + preflight := dict_get_or(configured["installed"], "node_preflight", null) + if binding["schema"] == "dispatch.node-input-binding/v1alpha4"&&type(preflight) == "function" { + fact := preflight(current);demand(type(fact) == "dict"&&contains(["available", "required_resource_unavailable"], dict_get_or(fact, "status", "")), "node_preflight_invalid") + if fact["status"] == "required_resource_unavailable" { + current = persist_node_transition(current, "node_execution_refused", {"schema":"dispatch.node-pre-admission-refusal/v1alpha1", "binding_ref":node_reference(binding), "consumer":binding["consumer"], "reason":fact["status"], "authority_ref":"sha256:" + current["assurance_negotiation"]["config_revision"], "resulting_revision":current["revision"] + 1}) + return {"ok":false, "refused_before_admission":true, "run_state":current, "error":{"code":"node_preflight_refused", "message":"Required local resource unavailable before admission.", "retryable":false}} + } + } # Same exclusive durable claim primitive as sequential effect admission: # never replace or reclaim after controller death. demand(write_file_atomic_beneath(current["run_dir"], node_claim_path(binding), portable_json(binding), false), "node_already_consumed") demand(sync_directory_beneath(current["run_dir"], "node-input")&&sync_directory_beneath(current["run_dir"], "."), "node_claim_sync_failed") current = persist_node_transition(current, "node_execution_admitted", {"binding_ref":node_reference(binding), "consumer":binding["consumer"]}) - hook := dict_get_or(options, "node_boundary", null);if type(hook) == "function" {hook("after_node_admission")} + if type(hook) == "function" {hook("after_node_admission")} demand(resolve_run_configuration(current, options)["ok"], "node_authority_stale") return {"ok":true, "run_state":current} } diff --git a/src/core/node_transition.kujo b/src/core/node_transition.kujo index a5c23b1..2d33380 100644 --- a/src/core/node_transition.kujo +++ b/src/core/node_transition.kujo @@ -1,3 +1,4 @@ +from src.core.graph_attempts import accounting_enabled, program_contract, attempt_run, fold_attempt, attempt_terminal_schema # Pure additive projections shared by the existing journal and retained recovery. from src.core.graph_transition import heterogeneous_graph, graph_contract, graph_event, apply_graph_transition, graph_history_projection from src.core.assurance_state import node_controller_features @@ -15,7 +16,11 @@ export func node_raw(state, reference) { } export func node_claim_path(binding) {return "node-input/" + substring(node_reference(binding), 7, 71) + ".claim"} export func validate_node_binding_bytes(state, binding) { - require(contains(["dispatch.node-input-binding/v1alpha1", "dispatch.node-input-binding/v1alpha2", "dispatch.node-input-binding/v1alpha3"], binding["schema"])&&binding["consumer"]["run_id"] == state["run_id"], "node_binding_subject_mismatch") + require(contains(["dispatch.node-input-binding/v1alpha1", "dispatch.node-input-binding/v1alpha2", "dispatch.node-input-binding/v1alpha3", "dispatch.node-input-binding/v1alpha4"], binding["schema"])&&binding["consumer"]["run_id"] == state["run_id"], "node_binding_subject_mismatch") + if binding["schema"] == "dispatch.node-input-binding/v1alpha4" { + attempt := binding["attempt"];require(type(attempt["ordinal"]) == "int"&&contains([1, 2], attempt["ordinal"]), "node_attempt_ordinal_invalid") + if attempt["ordinal"] == 1 {require(attempt["previous_terminal_ref"] == null, "initial_attempt_lineage_invalid")} else {require(type(attempt["previous_terminal_ref"]) == "string"&®ex_match(attempt["previous_terminal_ref"], "^sha256:[0-9a-f]{64}$"), "retry_lineage_missing")} + } require(len(binding["inputs"]) <= 8&&len(binding["predecessors"]) <= 8, "node_input_limit") for reference in binding["artifacts"] {node_raw(state, reference)} for input in binding["inputs"] { @@ -49,8 +54,13 @@ export func apply_node_transition(state, kind, details) { require(data["consumer"]["step_id"] == state["steps"][0]["id"]&&data["consumer"]["attempt_id"] == "1", "node_binding_subject_mismatch") validate_node_binding_bytes(state, data);state["node_input_binding"] := data state["required_features"] := node_controller_features(state, state["required_features"]) + } else if kind == "node_execution_refused" { + require(composition_node(state)&&has_key(state, "node_execution_refusal") == 0&&has_key(state, "node_execution_admission") == 0&&state["steps"][0]["status"] == "pending", "node_refusal_conflict") + binding := state["node_input_binding"];require(binding["schema"] == "dispatch.node-input-binding/v1alpha4"&&data["binding_ref"] == node_reference(binding)&&data["reason"] == "required_resource_unavailable"&&data["resulting_revision"] == state["revision"] + 1, "node_refusal_invalid") + require(file_exists(state["run_dir"] + "/" + node_claim_path(binding)) == false, "node_refusal_after_consumption") + state["node_execution_refusal"] := data;state["status"] := "paused" } else if kind == "node_execution_admitted" { - require(composition_node(state)&&has_key(state, "node_execution_admission") == 0&&state["steps"][0]["status"] == "pending", "node_already_admitted") + require(composition_node(state)&&has_key(state, "node_execution_refusal") == 0&&has_key(state, "node_execution_admission") == 0&&state["steps"][0]["status"] == "pending", "node_already_admitted") require(data["binding_ref"] == node_reference(state["node_input_binding"]), "node_admission_binding_mismatch") state["node_execution_admission"] := data;validate_node_claim(state) } else if kind == "node_start_requested" { @@ -58,7 +68,7 @@ export func apply_node_transition(state, kind, details) { dispatches := dict_get_or(state, "node_dispatches", {});id := data["node_id"] require(has_key(dispatches, id) == 0, "duplicate_node_dispatch") matched := false - for step in state["steps"] {if step["id"] == id {require(step["config"]["node_execution"]["run_id"] == data["consumer"]["run_id"]&&step["status"] == "pending", "node_dispatch_mismatch");matched = true}} + for step in state["steps"] {if step["id"] == id {require(attempt_run(state, id) == data["consumer"]["run_id"]&&step["status"] == "pending", "node_dispatch_mismatch");matched = true}} require(matched, "node_missing");dispatches[id] := data;state["node_dispatches"] := dispatches } else if kind == "node_terminal_observed" { require(composition_graph(state), "node_graph_required") @@ -68,9 +78,9 @@ export func apply_node_transition(state, kind, details) { for i in range(0, len(steps)) { step := steps[i] if step["id"] == id { - expected_run := state["run_id"];if graph_contract(step) == "parent-finalization/v1alpha1" {expected_run = step["config"]["node_execution"]["run_id"]} + expected_run := state["run_id"];if program_contract(step) {expected_run = attempt_run(state, id)} require(contains(["pending", "paused"], step["status"])&&expected_run == data["terminal"]["subject"]["run_id"], "node_terminal_subject_mismatch") - if heterogeneous_graph(state) {require(data["terminal"]["schema"] == "dispatch.node-terminal/v1alpha1"&&data["terminal"]["node_id"] == id&&data["terminal"]["contract"] == graph_contract(step)&&contains(["completed", "failed", "rejected", "cancelled"], data["terminal"]["outcome"]), "node_terminal_contract_mismatch")} + if heterogeneous_graph(state) {require(data["terminal"]["schema"] == attempt_terminal_schema(graph_contract(step))&&data["terminal"]["node_id"] == id&&data["terminal"]["contract"] == graph_contract(step)&&contains(["completed", "failed", "rejected", "cancelled"], data["terminal"]["outcome"]), "node_terminal_contract_mismatch")} step["status"] := data["terminal"]["outcome"];step["output"] := data["terminal"];steps[i] := step;state["current_step_index"] := i + 1;matched = true } } @@ -79,21 +89,25 @@ export func apply_node_transition(state, kind, details) { observed[id] := data;state["node_completions"] := observed;state["steps"] := steps usage := state["budget_usage"];usage["steps"] := usage["steps"] + 1;state["budget_usage"] := usage } else {throw("unsupported_node_transition")} - return state + state = fold_attempt(state, kind, data);return state } export func node_history_projection(state, events) { graph_history_projection(state, events) - binding := null;admission := null;completed := {};dispatches := {} + binding := null;admission := null;refusal := null;completed := {};dispatches := {} for event in events { kind := event["kind"] + if kind == "graph_attempt_retried" {id := event["details"]["data"]["candidate"]["node_id"];next := {};for key in keys(completed) {if key != id {next[key] := completed[key]}};completed = next;next = {};for key in keys(dispatches) {if key != id {next[key] := dispatches[key]}};dispatches = next} + if kind == "node_execution_refused" {require(refusal == null&&admission == null, "duplicate_node_refusal");refusal = event["details"]["data"]} if kind == "node_inputs_bound" {require(binding == null, "duplicate_node_binding");binding = event["details"]["data"]} - if kind == "node_execution_admitted" {require(admission == null, "duplicate_node_admission");admission = event["details"]["data"]} + if kind == "node_execution_admitted" {require(admission == null&&refusal == null, "duplicate_node_admission");admission = event["details"]["data"]} if kind == "node_start_requested" {data := event["details"]["data"];require(has_key(dispatches, data["node_id"]) == 0, "duplicate_node_dispatch");dispatches[data["node_id"]] := data} if kind == "node_terminal_observed" {data := event["details"]["data"];require(has_key(completed, data["node_id"]) == 0, "duplicate_node_terminal");completed[data["node_id"]] := data} } require(to_json(binding) == to_json(dict_get_or(state, "node_input_binding", null))&&to_json(admission) == to_json(dict_get_or(state, "node_execution_admission", null))&&to_json(completed) == to_json(dict_get_or(state, "node_completions", {})), "node_journal_state_mismatch") require(to_json(dispatches) == to_json(dict_get_or(state, "node_dispatches", {})), "node_dispatch_journal_mismatch") if binding != null {validate_node_binding_bytes(state, binding)} + require(to_json(refusal) == to_json(dict_get_or(state, "node_execution_refusal", null)), "node_refusal_history_mismatch") + if refusal != null {require(admission == null&&refusal["binding_ref"] == node_reference(binding)&&file_exists(state["run_dir"] + "/" + node_claim_path(binding)) == false, "refusal_consumption_conflict")} validate_node_claim(state) if composition_graph(state) { for step in state["steps"] {if contains(["completed", "skipped", "failed", "cancelled", "rejected"], step["status"]) {require(step["status"] != "skipped"&&has_key(completed, step["id"]), "node_terminal_authority_missing")}} diff --git a/src/core/retained_recovery.kujo b/src/core/retained_recovery.kujo index 557404d..7689c14 100644 --- a/src/core/retained_recovery.kujo +++ b/src/core/retained_recovery.kujo @@ -40,7 +40,7 @@ func event_check(state, event, sequence, previous) { func advance(state, event) { demand((state["status"] == "paused"&&dict_get_or(dict_get_or(state, "current_control_boundary", {}), "status", "") == "open")||has_key(state, "parent_finalization")||node_recovery_safe(state), "unsupported_active_state") demand(event["state_revision"] == state["revision"], "state_revision_divergence") - if graph_event(event["kind"])||contains(["node_inputs_bound", "node_execution_admitted", "node_start_requested", "node_terminal_observed"], event["kind"]) {state = apply_node_transition(state, event["kind"], event["details"])} + if graph_event(event["kind"])||contains(["node_inputs_bound", "node_execution_refused", "node_execution_admitted", "node_start_requested", "node_terminal_observed"], event["kind"]) {state = apply_node_transition(state, event["kind"], event["details"])} else if event["kind"] == "parent_finalized" {state = apply_parent_decision(state, event["details"])} else if event["kind"] == "effect_lifecycle_recorded" { before := dict_get_or(state, "effect_lifecycle", []);after := event["details"]["effect_lifecycle"] @@ -184,6 +184,7 @@ func analyze(state) { if has_key(reconstructed, "graph_finalization") {for ref in reconstructed["graph_finalization"]["artifacts"] {node_refs = push(node_refs, ref)}} for field in ["branch_activations", "subgraph_finalizations"] {for id in keys(dict_get_or(reconstructed, field, {})) {for ref in reconstructed[field][id]["artifacts"] {node_refs = push(node_refs, ref)}}} for id in keys(dict_get_or(reconstructed, "node_completions", {})) {for ref in reconstructed["node_completions"][id]["artifacts"] {node_refs = push(node_refs, ref)}} + for id in keys(dict_get_or(reconstructed, "graph_attempts", {})) {for row in reconstructed["graph_attempts"][id] {for field in ["reservation", "release", "terminal"] {if row[field] != null {for ref in row[field]["artifacts"] {node_refs = push(node_refs, ref)}}}}} for file in files { path := file["path"] if starts_with(path, "node-input/")&&ends_with(path, ".claim") { diff --git a/src/core/runner.kujo b/src/core/runner.kujo index 0a44844..a63e8d5 100644 --- a/src/core/runner.kujo +++ b/src/core/runner.kujo @@ -1,3 +1,4 @@ +from src.core.graph_attempts import program_contract, held_reservation from src.core.graph_policy import policy_enabled, policy_ready, dispatch_budget from src.core.node_composition import validate_composed_definition, advance_composed_step from src.core.node_transition import composition_graph @@ -1398,11 +1399,11 @@ func run_workflow_unlocked(workflow, run_state, tool_registry, options) { } if composition_graph(run_state) { - if policy_enabled(run_state)&&graph_contract(step) == "parent-finalization/v1alpha1"&&has_key(dict_get_or(run_state, "node_dispatches", {}), step["id"]) == 0&&dispatch_budget(run_state)["exhausted"] {index = index + 1;continue} + if policy_enabled(run_state)&&program_contract(step)&&held_reservation(run_state, step["id"]) == false&&has_key(dict_get_or(run_state, "node_dispatches", {}), step["id"]) == 0&&dispatch_budget(run_state)["exhausted"] {index = index + 1;continue} composed := advance_composed_step(run_state, index, options) if composed["ok"] == false {return composed} if composed["paused"] { - if heterogeneous_graph(run_state)&&graph_contract(step) != "parent-finalization/v1alpha1" {run_state = composed["run_state"];index = index + 1;continue} + if heterogeneous_graph(run_state)&&program_contract(step) == false {run_state = composed["run_state"];index = index + 1;continue} return composed } run_state = composed["run_state"] @@ -1845,7 +1846,7 @@ func run_workflow_impl(workflow, run_state, tool_registry, options, admission) { if configured["ok"] == false {result = configured} else if type(admission) == "function" { admitted := admission(run_state) - if admitted["ok"] == false {result = admitted} + if admitted["ok"] == false {result = admitted;if has_key(admitted, "run_state") {run_state = admitted["run_state"]}} else {result = run_workflow_unlocked(workflow, admitted["run_state"], tool_registry, options)} } else {result = run_workflow_unlocked(workflow, run_state, tool_registry, options)} } diff --git a/tests/go_participant_conformance.mjs b/tests/go_participant_conformance.mjs index e69ab10..4498dbb 100644 --- a/tests/go_participant_conformance.mjs +++ b/tests/go_participant_conformance.mjs @@ -13,12 +13,12 @@ for(const item of corpus.cases){const wire=item.wire.replaceAll('@RUNTIME@','go' const input=item.mode==='encode'?wire:JSON.stringify({wire_hex:Buffer.from(wire).toString('hex'),expected:JSON.parse(JSON.stringify(corpus.expected).replaceAll('@RUNTIME@','go'))}); const p=invoke(item.mode==='encode'?'encode':'match',input);assert.equal(p.status===0,item.accept,item.name);count++; } -const paths=['tests/vectors/commitments.json','tests/vectors/sqlite-commitments.json',(process.env.WORKCELL_ROOT||'../workcell')+'/tests/vectors/git-assurance-commitments.json',(process.env.ABILITY_ROOT||'../ability')+'/tests/vectors/application-assurance-commitments.json','tests/vectors/effect-set.json','tests/vectors/effect-selection.json','tests/vectors/effect-lifecycle.json','tests/vectors/parent-finalization.json','tests/vectors/node-composition.json','tests/vectors/heterogeneous-terminals.json','tests/vectors/static-graph-policy.json']; +const paths=['tests/vectors/commitments.json','tests/vectors/sqlite-commitments.json',(process.env.WORKCELL_ROOT||'../workcell')+'/tests/vectors/git-assurance-commitments.json',(process.env.ABILITY_ROOT||'../ability')+'/tests/vectors/application-assurance-commitments.json','tests/vectors/effect-set.json','tests/vectors/effect-selection.json','tests/vectors/effect-lifecycle.json','tests/vectors/parent-finalization.json','tests/vectors/node-composition.json','tests/vectors/heterogeneous-terminals.json','tests/vectors/static-graph-policy.json','tests/vectors/graph-attempts.json']; const vectors=paths.flatMap(path=>JSON.parse(readFileSync(path)).vectors); for(const v of vectors){assert.equal(invoke('hash',v.preimage_utf8).stdout,'sha256:'+v.sha256,v.name);if(v.recipe!=='exact_utf8')assert.equal(invoke('encode',JSON.stringify(v.input)).stdout,v.preimage_utf8,v.name);count++} // The new concepts must agree with the existing independent TypeScript and Python codecs. const {encode}=await import('../interop/typescript-participant/dist/codec.js'); -for(const v of ['tests/vectors/effect-set.json','tests/vectors/effect-selection.json','tests/vectors/effect-lifecycle.json','tests/vectors/parent-finalization.json','tests/vectors/node-composition.json','tests/vectors/heterogeneous-terminals.json','tests/vectors/static-graph-policy.json'].flatMap(p=>JSON.parse(readFileSync(p)).vectors)){assert.equal(encode(v.input),v.preimage_utf8);const py=spawnSync('interop/python-participant/.venv/bin/python',['-I','interop/python-participant/run.py','encode'],{input:JSON.stringify(v.input),encoding:'utf8'});assert.equal(py.status,0,py.stderr);assert.equal(py.stdout,v.preimage_utf8)} +for(const v of ['tests/vectors/effect-set.json','tests/vectors/effect-selection.json','tests/vectors/effect-lifecycle.json','tests/vectors/parent-finalization.json','tests/vectors/node-composition.json','tests/vectors/heterogeneous-terminals.json','tests/vectors/static-graph-policy.json','tests/vectors/graph-attempts.json'].flatMap(p=>JSON.parse(readFileSync(p)).vectors)){assert.equal(encode(v.input),v.preimage_utf8);const py=spawnSync('interop/python-participant/.venv/bin/python',['-I','interop/python-participant/run.py','encode'],{input:JSON.stringify(v.input),encoding:'utf8'});assert.equal(py.status,0,py.stderr);assert.equal(py.stdout,v.preimage_utf8)} const valid=corpus.cases.find(c=>c.name==='valid').wire.replaceAll('@RUNTIME@','go'); const messages=[{jsonrpc:'2.0',id:1,method:'initialize',params:{protocolVersion:'2024-11-05',capabilities:{},clientInfo:{name:'proof',version:'1'}}},{jsonrpc:'2.0',method:'notifications/initialized'},{jsonrpc:'2.0',id:2,method:'tools/list'},{jsonrpc:'2.0',id:3,method:'tools/call',params:{name:'record_handoff',arguments:{wire:valid}}},{jsonrpc:'2.0',id:4,method:'tools/call',params:{name:'record_handoff',arguments:{wire:valid+' '}}},{jsonrpc:'2.0',id:5,method:'execute',params:{}}]; const p=invoke('mcp',messages.map(m=>JSON.stringify(m)).join('\n')+'\n');assert.equal(p.status,0,p.stderr);const answers=p.stdout.trim().split('\n').map(JSON.parse);assert.equal(answers.length,5);assert.equal(answers[0].result.protocolVersion,'2024-11-05');assert.equal(answers[1].result.tools.length,1);assert.equal(answers[2].result.content[0].text,valid);assert.equal(answers[2].result.isError,false);assert.equal(answers[3].result.isError,true);assert.equal(answers[4].error.code,-32601); diff --git a/tests/graph_attempt_authority.mjs b/tests/graph_attempt_authority.mjs new file mode 100644 index 0000000..b420149 --- /dev/null +++ b/tests/graph_attempt_authority.mjs @@ -0,0 +1,7 @@ +import {setup,program,policy,run,pop,actor,assert,state,root,patch,join,fs} from './static_policy_helpers.mjs'; +const node={...program('B'),terminal_contract:'program-attempt/v1alpha1',max_attempts:2,on_unsuccessful:{action:'retry_same_node'}}; +const options={graph_policy:policy(),graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1'};const proofs=[]; +const revoked=setup('revoke-inside-apply',[node],options);const candidate=pop(revoked,'attempt','B','assess',{action:'reserve'});assert.equal(candidate.ok,true);const denied=pop(revoked,'attempt','B','apply',{action:'reserve',candidate:candidate.candidate,actor},{GRAPH_REVOKE:'before_attempt'});assert.equal(denied.ok,false);assert.equal(state(revoked).graph_attempts,undefined);proofs.push('operator revoked at final revalidation cannot reserve'); +const authority=setup('child-authority-change',[node],options);let selected=pop(authority,'attempt','B','assess',{action:'reserve'});assert.equal(pop(authority,'attempt','B','apply',{action:'reserve',candidate:selected.candidate,actor}).ok,true);patch(join(authority,'B/host.json'),c=>c.descriptor.verifier_version='changed');assert.equal(pop(authority,'attempt','B','assess',{action:'release'}).ok,false);assert.equal(run(authority,'drive').ok,false);assert.equal(state(authority).graph_attempts.B[0].dispatch,null);assert.equal(fs.existsSync(join(authority,'B/executions.log')),false);proofs.push('changed child authority cannot dispatch or release an old reservation'); +const execution=setup('failed-execution-not-refusal',[node],options);patch(join(execution,'B/host.json'),c=>c.fail_execution=true);run(execution,'drive');assert.ok(state(execution,'B').node_execution_admission);assert.equal(state(execution,'B').node_execution_refusal,undefined);assert.equal(pop(execution,'attempt','B','assess',{action:'retry'}).ok,false);assert.equal(pop(execution,'attempt','B','assess',{action:'release'}).ok,false);assert.equal(pop(execution,'accounting','graph').report.budget.consumed,1);proofs.push('ordinary execution failure is not a Dispatch pre-admission refusal'); +console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/graph_attempt_binding_safety.mjs b/tests/graph_attempt_binding_safety.mjs new file mode 100644 index 0000000..20e1870 --- /dev/null +++ b/tests/graph_attempt_binding_safety.mjs @@ -0,0 +1,14 @@ +import {fs,join,resolve,spawn,assert,kujo,root,env,write,fixture,run,state,setup,program,policy,gop,pop,actor,patch,op,command} from './static_policy_helpers.mjs'; +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)};let serial=0; +const node=id=>({...program(id),terminal_contract:'program-attempt/v1alpha1',max_attempts:2,on_unsuccessful:{action:'retry_same_node'}}); +const opts=limit=>({graph_policy:policy([],[],limit),graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1'}); +async function fresh(d,request={},extra={},marker=null,mode='policy-op',id='graph'){ + const file=join(d,'fresh-'+serial+++'.json');write(file,request); + return await new Promise((done,reject)=>{const p=spawn(kujo,['run',fixture,d,mode,id,file],{env:{...env,...extra}});let out='',err='';const timer=setTimeout(()=>p.kill('SIGKILL'),180000);p.stdout.on('data',b=>{out+=b;if(marker&&out.includes(marker))p.kill('SIGKILL')});p.stderr.on('data',b=>err+=b);p.on('close',(code,signal)=>{clearTimeout(timer);try{assert.equal(err,'');if(marker){assert.ok(out.includes(marker),out);assert.equal(signal,'SIGKILL');done(null)}else{assert.equal(code,0,out);done(JSON.parse(out))}}catch(e){reject(e)}})}) +} +function assess(d,id,action){const r=pop(d,'attempt',id,'assess',{action});assert.equal(r.ok,true,JSON.stringify(r));return {kind:'attempt',id,action,operation:'apply',candidate:r.candidate,actor}} +function repair(d,id='graph'){const p=run(d,'op',id,{operation:'recovery-plan'});assert.equal(p.ok,true,JSON.stringify(p));assert.ok(p.plan.repairs.length);const r=run(d,'op',id,{operation:'recovery-apply',plan:p.plan});assert.equal(r.ok,true,JSON.stringify(r));assert.equal(r.continuation,'not_authorized')} +// Install crash timing in an isolated copy before authority digests are anchored. +const original=process.cwd(),controllers=join(root,'controllers'),copy=join(controllers,'dispatch');fs.mkdirSync(copy,{recursive:true});fs.cpSync(resolve('src'),join(copy,'src'),{recursive:true});fs.mkdirSync(join(copy,'tests'));fs.copyFileSync(resolve(fixture),join(copy,fixture));for(const dir of ['schemas','examples'])fs.symlinkSync(resolve(dir),join(copy,dir));for(const name of ['workcell','eval'])fs.symlinkSync(resolve('../'+name),join(controllers,name)); +const journal=join(copy,'src/core/control_journal.kujo');let code=fs.readFileSync(journal,'utf8'),point=' append_file(path, line)';assert.ok(code.includes(point));fs.writeFileSync(journal,code.replace(point,' if env("ATTEMPT_RECORD_CRASH") == kind {print("CRASH:immutable-attempt-record");sleep(30000)}\n'+point));process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); +const d=setup('bound-descendant',[node('B'),{...program('D',['B']),accept_terminal:{B:['failed']}}],opts(3));patch(join(d,'B/host.json'),c=>c.require_resource=true);run(d,'drive');await fresh(d,{}, {NODE_TARGET:'D',NODE_CRASH:'before_node_binding'},'CRASH:before_node_binding','drive');assert.equal(pop(d,'attempt','B','assess',{action:'retry'}).ok,false);pass('downstream reservation blocks retry before child binding');const binding=run(d,'op','D',{operation:'inputs-assess'});assert.equal(binding.ok,true,JSON.stringify(binding));assert.equal(run(d,'op','D',{operation:'inputs-bind',binding:binding.binding}).ok,true);assert.equal(state(d).node_dispatches.D,undefined);assert.ok(state(d,'D').node_input_binding);assert.equal((await fresh(d,assess(d,'D','release'))).ok,true);const retry=pop(d,'attempt','B','assess',{action:'retry'});assert.equal(retry.ok,false,JSON.stringify(retry));pass('retry cannot retire a terminal already bound by an undispatched program descendant');process.chdir(original);console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/graph_attempt_contract_tests.kujo b/tests/graph_attempt_contract_tests.kujo new file mode 100644 index 0000000..b60f270 --- /dev/null +++ b/tests/graph_attempt_contract_tests.kujo @@ -0,0 +1,22 @@ +from src.core.graph_attempts import validate_accounting, accounting_budget, fold_attempt, attempt_history, current_attempt, accounting_enabled +func need(ok) {if ok != true {throw("attempt_contract_failed")}} +func base(limit) {return {"workflow_definition":{"metadata":{"graph_accounting":"dispatch.graph-attempt-accounting/v1alpha1", "graph_policy":{"budget":{"max_program_dispatches":limit}}}, "steps":[{"id":"B", "config":{"terminal_contract":"program-attempt/v1alpha1", "on_unsuccessful":{"action":"retry_same_node"}, "node_execution":{"run_id":"B1", "retry_run_id":"B2", "max_attempts":2}}}]}}} +func reservation(ordinal, prior) {return {"candidate":{"node_id":"B", "ordinal":ordinal, "run_id":"B" + to_string(ordinal), "previous_terminal_ref":prior, "candidate_id":"reservation-" + to_string(ordinal)}, "artifacts":[]}} +checks := 0;s := base(2);need(validate_accounting(s));need(accounting_budget(s)["available"] == 2);checks = checks + 1 +r := reservation(1, null);s = fold_attempt(s, "graph_attempt_reserved", r);need(accounting_budget(s)["reserved"] == 1&&accounting_budget(s)["consumed"] == 0);checks = checks + 1 +release := {"candidate":{"node_id":"B", "reservation_id":"reservation-1"}, "artifacts":[]};released := fold_attempt(s, "graph_reservation_released", release);need(accounting_budget(released)["available"] == 2&&accounting_budget(released)["released"] == 1);checks = checks + 1 +released = fold_attempt(released, "graph_attempt_reserved", r);need(len(released["graph_attempts"]["B"]) == 2&¤t_attempt(released, "B")["ordinal"] == 1);checks = checks + 1 +dispatch := {"node_id":"B", "consumer":{"run_id":"B1"}};s = fold_attempt(s, "node_start_requested", dispatch);need(accounting_budget(s)["consumed"] == 1&&accounting_budget(s)["reserved"] == 0);checks = checks + 1 +for kind in ["graph_reservation_released", "node_start_requested", "graph_attempt_reserved"] {data := r;if kind == "graph_reservation_released" {data = release};if kind == "node_start_requested" {data = dispatch};denied := false;try {fold_attempt(s, kind, data)} except err {denied = true};need(denied);checks = checks + 1} +denied := false;try {fold_attempt(s, "graph_attempt_retried", reservation(2, "missing"))} except err {denied = true};need(denied);checks = checks + 1 +# A journal-derived view cannot silently erase permanently consumed dispatch. +events := [{"kind":"graph_attempt_reserved", "details":{"data":r}}, {"kind":"node_start_requested", "details":{"data":dispatch}}];need(attempt_history(s, events));checks = checks + 1 +corrupt := s;corrupt["graph_attempts"] := {};denied = false;try {attempt_history(corrupt, events)} except err {denied = true};need(denied);checks = checks + 1 +empty := base(0);denied = false;try {fold_attempt(empty, "graph_attempt_reserved", r)} except err {denied = true};need(denied);checks = checks + 1 +for vector in parse_json(read_file("tests/vectors/graph-attempts.json"))["vectors"] {path := "schemas/node-input-binding-v1alpha4.schema.json";if vector["input"]["schema"] == "dispatch.node-terminal/v1alpha2" {path = "schemas/node-terminal-v1alpha2.schema.json"};need(json_schema_validate(vector["input"], parse_json(read_file(path)))["valid"]);checks = checks + 1} +# Historical observation-only journals need not carry a workflow definition. +legacy := {"run_id":"legacy", "revision":1, "steps":[{"id":"action", "control_attempt":1}]} +need(accounting_enabled(legacy) == false&&attempt_history(legacy, []));checks = checks + 1 +denied = false;try {fold_attempt(legacy, "graph_attempt_reserved", r)} except err {denied = true};need(denied);checks = checks + 1 +legacy["graph_attempts"] := {"B":[r]};denied = false;try {attempt_history(legacy, [])} except err {denied = true};need(denied);checks = checks + 1 +print(to_json({"ok":true, "checks":checks})) diff --git a/tests/graph_attempt_integration.mjs b/tests/graph_attempt_integration.mjs new file mode 100644 index 0000000..501ec9a --- /dev/null +++ b/tests/graph_attempt_integration.mjs @@ -0,0 +1,22 @@ +import Ajv from '../interop/typescript-participant/node_modules/ajv/dist/2020.js'; +import {setup,program,policy,run,pop,actor,assert,state,root,read,write,join,finishProgram,finishGraph,gop,edge,patch,fs} from './static_policy_helpers.mjs'; +const accounting='dispatch.graph-attempt-accounting/v1alpha1'; +const retry=(id,deps=[],inputs=[])=>({...program(id,deps,inputs),terminal_contract:'program-attempt/v1alpha1',max_attempts:2,on_unsuccessful:{action:'retry_same_node'}}); +const options=(limit=8)=>({graph_policy:policy([],[],limit),graph_accounting:accounting}); +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)}; +function apply(d,id,action){const a=pop(d,'attempt',id,'assess',{action});assert.equal(a.ok,true,JSON.stringify(a));const b=pop(d,'attempt',id,'apply',{action,candidate:a.candidate,actor});assert.equal(b.ok,true,JSON.stringify(b));assert.equal(b.continuation,'not_authorized');return b} +function drive(d){const r=run(d,'drive');assert.equal(r.ok,true,JSON.stringify(r));return r} +function refuse(d,id){patch(join(d,id,'host.json'),c=>c.require_resource=true);drive(d);drive(d);assert.ok(state(d,id).node_execution_refusal);assert.equal(state(d,id).node_execution_admission,undefined)} +const d=setup('safe-chain',[program('A'),retry('B',['A'],[edge('A')]),program('C',['B'],[edge('B')])],options(4)); +drive(d);finishProgram(d,'A');patch(join(d,'B/host.json'),c=>c.require_resource=true);drive(d);drive(d); +assert.equal(gop(d,'graph-assess').candidate.outcome,'blocked');const first=state(d,'B').node_input_binding;const receipt=state(d,'B').node_execution_refusal; +patch(join(d,'B-retry/host.json'),c=>c.require_resource=true);fs.writeFileSync(join(d,'B-retry/required-resource'),'available'); +apply(d,'B','retry');assert.equal(fs.existsSync(join(d,'B-retry/executions.log')),false);drive(d); +const second=state(d,'B-retry').node_input_binding;assert.notEqual(first.consumer.run_id,second.consumer.run_id);assert.deepEqual(first.inputs,second.inputs);assert.deepEqual(first.predecessors,second.predecessors);assert.deepEqual(first.policy,second.policy);assert.equal(second.attempt.ordinal,2);assert.ok(second.attempt.previous_terminal_ref); +finishProgram(d,'B-retry');drive(d);const validate=new Ajv().compile(read('schemas/node-input-binding-v1alpha4.schema.json'));assert.equal(validate(state(d,'C').node_input_binding),true,JSON.stringify(validate.errors));finishProgram(d,'C');drive(d);const assessed=gop(d,'graph-assess');assert.equal(assessed.ok,true,JSON.stringify(assessed));assert.equal(assessed.candidate.budget.consumed,4);assert.equal(assessed.candidate.budget.available,0);assert.ok(assessed.candidate.accounting_ref);finishGraph(d); +assert.deepEqual(state(d,'B').node_execution_refusal,receipt);assert.equal(fs.existsSync(join(d,'B/executions.log')),false);assert.equal(state(d).graph_attempts.B.length,2);assert.equal(state(d).graph_attempts.B[0].terminal.terminal.outcome,'failed');assert.equal(state(d).graph_attempts.B[1].terminal.terminal.outcome,'completed');pass('A to safely refused B1 to independent B2 to C; exact inputs, lineage and exhausted graph finalize'); +const exhausted=setup('node-ceiling',[retry('B')],options());refuse(exhausted,'B');apply(exhausted,'B','retry');refuse(exhausted,'B-retry');assert.equal(pop(exhausted,'attempt','B','assess',{action:'retry'}).ok,false);assert.equal(gop(exhausted,'graph-assess').candidate.outcome,'failed');finishGraph(exhausted);assert.equal(state(exhausted).graph_finalization.candidate.budget.consumed,2);pass('two refused attempts exhaust node ceiling; no third attempt and original failures retained'); +const budget=setup('graph-ceiling',[retry('B')],options(1));refuse(budget,'B');assert.equal(pop(budget,'attempt','B','assess',{action:'retry'}).ok,false);const blocked=gop(budget,'graph-assess');assert.equal(blocked.candidate.outcome,'blocked');assert.equal(blocked.candidate.budget.consumed,1);assert.equal(blocked.candidate.budget.available,0);pass('graph budget exhaustion blocks retry without refund or fabricated terminal failure'); +const revoked=setup('revoked-operator',[retry('B')],options());const candidate=pop(revoked,'attempt','B','assess',{action:'reserve'});patch(join(revoked,'host.json'),c=>c.operator_enabled=false);assert.equal(pop(revoked,'attempt','B','apply',{action:'reserve',candidate:candidate.candidate,actor}).ok,false);assert.equal(state(revoked).graph_attempts,undefined);pass('operator revocation denies reservation without consuming capacity'); +const unavailable=setup('missing-retry-artifact',[program('A'),retry('B',['A'],[edge('A')])],options());drive(unavailable);finishProgram(unavailable,'A');patch(join(unavailable,'B/host.json'),c=>c.require_resource=true);drive(unavailable);drive(unavailable);fs.appendFileSync(join(unavailable,'A/output.json'),'changed');assert.equal(pop(unavailable,'attempt','B','assess',{action:'retry'}).ok,false);assert.equal(state(unavailable).graph_attempts.B.length,1);pass('changed producer bytes cannot become a newer retry input'); +console.log(JSON.stringify({ok:true,root,checks:proofs.length,proofs})); diff --git a/tests/graph_attempt_policy.mjs b/tests/graph_attempt_policy.mjs new file mode 100644 index 0000000..c27b058 --- /dev/null +++ b/tests/graph_attempt_policy.mjs @@ -0,0 +1,9 @@ +import {setup,program,evaluator,human,policy,branch,routed,accepted,run,gop,finishProgram,finishEval,finishHuman,finishGraph,apply,assert,state,root,edge,pop,actor} from './static_policy_helpers.mjs'; +const opts=(p)=>({graph_policy:p,graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1'});const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)}; +const d=setup('branch-units',[program('A'),routed(evaluator('E','A'),'quality'),program('B',['E'],[edge('A')]),accepted(program('R',['E']),'E',['failed'])],opts(policy([branch('quality','E','evaluation_verdict',{pass:['B'],fail:['R']})],[],2))); +run(d,'drive');finishProgram(d,'A');run(d,'drive');finishEval(d,'E');apply(d,'branch','quality');assert.equal(gop(d,'graph-assess').candidate.budget.consumed,1);run(d,'drive');finishProgram(d,'B');run(d,'drive');finishGraph(d);const outcome=state(d).graph_finalization.candidate;assert.equal(outcome.budget.consumed,2);assert.equal(state(d).graph_attempts.R,undefined);assert.equal(state(d).graph_attempts.E,undefined);assert.equal(outcome.nodes.find(n=>n.node_id==='R').reason,'not_selected');pass('Eval branch activation consumes zero program units; inactive repair node has no attempt'); +const group={id:'SG',members:['B'],entry:['A'],policy:'required-success'}; +const s=setup('group-units',[program('A'),program('B',['A'],[edge('A')]),{...program('C',['B'],[edge('B')]),after_subgraphs:['SG']},human('H',['C'])],opts(policy([],[group],3))); +run(s,'drive');finishProgram(s,'A');run(s,'drive');finishProgram(s,'B');run(s,'drive');assert.equal(gop(s,'graph-assess').candidate.budget.consumed,2);apply(s,'subgraph','SG');assert.equal(gop(s,'graph-assess').candidate.budget.consumed,2);run(s,'drive');finishProgram(s,'C');run(s,'drive');finishHuman(s,'H');finishGraph(s);assert.equal(state(s).graph_finalization.candidate.budget.consumed,3);assert.equal(state(s).graph_attempts.H,undefined);pass('subgraph receipt adds no execution unit; human decision is separate from three member dispatches'); +const optional=setup('optional-reserved',[program('A',[],[],true)],opts(policy([],[],1)));const c=pop(optional,'attempt','A','assess',{action:'reserve'});assert.equal(c.ok,true,JSON.stringify(c));assert.equal(pop(optional,'attempt','A','apply',{action:'reserve',candidate:c.candidate,actor}).ok,true);assert.equal(gop(optional,'graph-assess').candidate.outcome,'blocked');assert.equal(gop(optional,'optional-cancel',{node_id:'A',actor}).ok,false);const release=pop(optional,'attempt','A','assess',{action:'release'});assert.equal(pop(optional,'attempt','A','apply',{action:'release',candidate:release.candidate,actor}).ok,true);assert.equal(gop(optional,'optional-cancel',{node_id:'A',actor}).ok,true);finishGraph(optional);assert.equal(state(optional).graph_finalization.candidate.budget.consumed,0);assert.equal(pop(optional,'attempt','A','assess',{action:'reserve'}).ok,false);pass('held optional reservation prevents graph sealing; release and cancellation remain explicit'); +console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/graph_attempt_recovery.mjs b/tests/graph_attempt_recovery.mjs new file mode 100644 index 0000000..7960005 --- /dev/null +++ b/tests/graph_attempt_recovery.mjs @@ -0,0 +1,33 @@ +import {fs,join,resolve,spawn,assert,kujo,root,env,write,fixture,run,state,setup,program,policy,gop,pop,actor,patch,op,command} from './static_policy_helpers.mjs'; +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)};let serial=0; +const node=id=>({...program(id),terminal_contract:'program-attempt/v1alpha1',max_attempts:2,on_unsuccessful:{action:'retry_same_node'}}); +const opts=limit=>({graph_policy:policy([],[],limit),graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1'}); +async function fresh(d,request={},extra={},marker=null,mode='policy-op',id='graph'){ + const file=join(d,'fresh-'+serial+++'.json');write(file,request); + return await new Promise((done,reject)=>{const p=spawn(kujo,['run',fixture,d,mode,id,file],{env:{...env,...extra}});let out='',err='';const timer=setTimeout(()=>p.kill('SIGKILL'),180000);p.stdout.on('data',b=>{out+=b;if(marker&&out.includes(marker))p.kill('SIGKILL')});p.stderr.on('data',b=>err+=b);p.on('close',(code,signal)=>{clearTimeout(timer);try{assert.equal(err,'');if(marker){assert.ok(out.includes(marker),out);assert.equal(signal,'SIGKILL');done(null)}else{assert.equal(code,0,out);done(JSON.parse(out))}}catch(e){reject(e)}})}) +} +function assess(d,id,action){const r=pop(d,'attempt',id,'assess',{action});assert.equal(r.ok,true,JSON.stringify(r));return {kind:'attempt',id,action,operation:'apply',candidate:r.candidate,actor}} +function repair(d,id='graph'){const p=run(d,'op',id,{operation:'recovery-plan'});assert.equal(p.ok,true,JSON.stringify(p));assert.ok(p.plan.repairs.length);const r=run(d,'op',id,{operation:'recovery-apply',plan:p.plan});assert.equal(r.ok,true,JSON.stringify(r));assert.equal(r.continuation,'not_authorized')} +// Install crash timing in an isolated copy before authority digests are anchored. +const original=process.cwd(),controllers=join(root,'controllers'),copy=join(controllers,'dispatch');fs.mkdirSync(copy,{recursive:true});fs.cpSync(resolve('src'),join(copy,'src'),{recursive:true});fs.mkdirSync(join(copy,'tests'));fs.copyFileSync(resolve(fixture),join(copy,fixture));for(const dir of ['schemas','examples'])fs.symlinkSync(resolve(dir),join(copy,dir));for(const name of ['workcell','eval'])fs.symlinkSync(resolve('../'+name),join(controllers,name)); +const journal=join(copy,'src/core/control_journal.kujo');let code=fs.readFileSync(journal,'utf8'),point=' append_file(path, line)';assert.ok(code.includes(point));fs.writeFileSync(journal,code.replace(point,' if env("ATTEMPT_RECORD_CRASH") == kind {print("CRASH:immutable-attempt-record");sleep(30000)}\n'+point));process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); +const r=setup('last-unit',[node('B'),node('C')],opts(1));const candidates=[assess(r,'B','reserve'),assess(r,'C','reserve')];const race=await Promise.all(candidates.map(c=>fresh(r,c)));assert.equal(race.filter(v=>v.ok).length,1,JSON.stringify(race));const winner=race[0].ok?'B':'C';assert.equal(gop(r,'graph-assess').candidate.budget.reserved,1);assert.equal(gop(r,'graph-assess').candidate.budget.available,0);pass('two fresh controllers reserve exactly one last graph unit'); +const release=assess(r,winner,'release');const releases=await Promise.all([fresh(r,release),fresh(r,release)]);assert.equal(releases.filter(v=>v.ok).length,1);assert.equal(gop(r,'graph-assess').candidate.budget.available,1);assert.equal(state(r).graph_attempts[winner].length,1);pass('release contention records one release and restores only never-dispatched capacity'); +const a=setup('reserve-crash',[node('B')],opts(2));await fresh(a,{}, {NODE_TARGET:'B',NODE_CRASH:'after_attempt_reservation'},'CRASH:after_attempt_reservation','drive');assert.equal(state(a).graph_attempts.B[0].dispatch,null);assert.equal(state(a,'B').node_input_binding,undefined);assert.equal((await fresh(a,assess(a,'B','release'))).ok,true);assert.equal(fs.existsSync(join(a,'B/executions.log')),false);pass('crash A: durable reservation before binding releases without phantom execution'); +const bound=setup('bound-undispatched-release',[node('B')],opts(2));await fresh(bound,{}, {NODE_TARGET:'B',NODE_CRASH:'after_node_binding'},'CRASH:after_node_binding','drive');assert.ok(state(bound,'B').node_input_binding);assert.equal(state(bound).graph_attempts.B[0].dispatch,null);assert.equal((await fresh(bound,assess(bound,'B','release'))).ok,true);assert.equal((await fresh(bound,{}, {},null,'start','B')).ok,false);assert.equal(fs.existsSync(join(bound,'B/executions.log')),false);pass('bound but undispatched reservation releases; its surviving input binding grants no admission'); +for(const boundary of ['before_child_load','before_node_admission','after_node_admission']){ + const d=setup(boundary,[node('B')],opts(2));await fresh(d,{}, {NODE_TARGET:'B',NODE_CRASH:'after_node_start_requested'},'CRASH:after_node_start_requested','drive'); + if(boundary!=='before_child_load')await fresh(d,{}, {NODE_CRASH:boundary},'CRASH:'+boundary,'start','B'); + assert.equal(gop(d,'graph-assess').candidate.budget.consumed,1);assert.equal(pop(d,'attempt','B','assess',{action:'release'}).ok,false);assert.equal(pop(d,'attempt','B','assess',{action:'retry'}).ok,false);assert.equal((await fresh(d,{}, {},null,'drive')).ok,true);assert.equal(fs.existsSync(join(d,'B/executions.log')),false);assert.equal(state(d).graph_attempts.B.length,1);pass('crash '+boundary+': consumed dispatch is not redelivered, released or retried'); +} +const retry=setup('retry-race',[node('B')],opts(2));patch(join(retry,'B/host.json'),c=>c.require_resource=true);run(retry,'drive');run(retry,'drive');const choice=assess(retry,'B','retry');const retries=await Promise.all([fresh(retry,choice),fresh(retry,choice)]);assert.equal(retries.filter(v=>v.ok).length,1,JSON.stringify(retries));assert.equal(state(retry).graph_attempts.B.length,2);assert.equal(state(retry).graph_attempts.B[1].ordinal,2);assert.equal(state(retry,'B-retry').node_execution_admission,undefined);pass('same-node retry and next-attempt creation race publishes one new reserved instance'); +const lost=setup('mutation-lost',[node('B')],opts(2));run(lost,'drive');assert.equal(op(lost,'B','refresh',{effect_id:'C'}).ok,true);assert.equal(op(lost,'B','select',{effect_id:'C'}).ok,true);const selected=run(lost,'op','B',{operation:'inspect'});await fresh(lost,{operation:'admit',expected:selected.cursor,attempt_id:selected.lifecycle.active},{NODE_CRASH:'after_mutation'},'CRASH:after_mutation','op','B');assert.equal(Number(command('sqlite3',[join(lost,'B/sink.db'),'SELECT count(*) FROM mutation_audit;'])),1);assert.equal(pop(lost,'attempt','B','assess',{action:'retry'}).ok,false);assert.equal(pop(lost,'attempt','B','assess',{action:'release'}).ok,false);assert.equal(gop(lost,'graph-assess').candidate.budget.consumed,1);assert.equal(op(lost,'B','verify',{attempt_id:selected.lifecycle.active}).ok,true);assert.equal(pop(lost,'attempt','B','assess',{action:'retry'}).ok,false);pass('crash E: real SQLite mutation reply lost; consumed accounting cannot authorize replay'); +for(const action of ['reserve','release','retry']){ + const d=setup('orphan-'+action,[node('B')],opts(2)); + if(action==='release'){const q=assess(d,'B','reserve');assert.equal((await fresh(d,q)).ok,true)} + if(action==='retry'){patch(join(d,'B/host.json'),c=>c.require_resource=true);run(d,'drive');run(d,'drive')} + const q=assess(d,'B',action),kind={reserve:'graph_attempt_reserved',release:'graph_reservation_released',retry:'graph_attempt_retried'}[action];await fresh(d,q,{ATTEMPT_RECORD_CRASH:kind},'CRASH:immutable-attempt-record');repair(d);const reloaded=state(d);assert.ok(reloaded.graph_attempts.B);assert.equal(reloaded.graph_finalization,undefined);assert.equal(fs.existsSync(join(d,'B-retry/executions.log')),false);assert.equal(gop(d,'graph-assess').ok,true);pass('orphan '+action+': immutable record/index gap repaired by fresh controller without execution'); +} +const terminalGap=setup('terminal-accounting-gap',[node('B')],opts(2));patch(join(terminalGap,'B/host.json'),c=>c.require_resource=true);run(terminalGap,'drive');assert.ok(state(terminalGap,'B').node_execution_refusal);await fresh(terminalGap,{}, {ATTEMPT_RECORD_CRASH:'node_terminal_observed'},'CRASH:immutable-attempt-record','drive');assert.equal(state(terminalGap).graph_attempts.B[0].terminal,null);repair(terminalGap);assert.equal(state(terminalGap).graph_attempts.B[0].terminal.terminal.outcome,'failed');assert.ok(state(terminalGap).graph_attempts.B[0].dispatch);assert.equal(state(terminalGap).graph_finalization,undefined);pass('crash F: durable terminal observation repairs stale accounting without refund or graph finalization'); +const refusalGap=setup('refusal-record-gap',[node('B')],opts(2));patch(join(refusalGap,'B/host.json'),c=>c.require_resource=true);await fresh(refusalGap,{}, {NODE_TARGET:'B',NODE_CRASH:'after_node_start_requested'},'CRASH:after_node_start_requested','drive');await fresh(refusalGap,{}, {ATTEMPT_RECORD_CRASH:'node_execution_refused'},'CRASH:immutable-attempt-record','start','B');repair(refusalGap,'B');assert.ok(state(refusalGap,'B').node_execution_refusal);assert.equal(state(refusalGap,'B').node_execution_admission,undefined);assert.equal((await fresh(refusalGap,{}, {},null,'start','B')).ok,false);run(refusalGap,'drive');assert.equal(state(refusalGap).graph_attempts.B[0].terminal.terminal.outcome,'failed');pass('orphan child refusal remains sealed through exact retained-host repair'); +process.chdir(original);console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/graph_attempt_smoke.mjs b/tests/graph_attempt_smoke.mjs new file mode 100644 index 0000000..188d64c --- /dev/null +++ b/tests/graph_attempt_smoke.mjs @@ -0,0 +1,16 @@ +import {setup,program,policy,run,pop,actor,assert,state,root,read,write,join,fs} from './static_policy_helpers.mjs'; +const node=(id)=>({...program(id),terminal_contract:'program-attempt/v1alpha1',max_attempts:2,on_unsuccessful:{action:'retry_same_node'}}); +const d=setup('reservation',[node('A')],{graph_policy:policy(),graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1'}); +function change(action){const a=pop(d,'attempt','A','assess',{action});assert.equal(a.ok,true,JSON.stringify(a));const b=pop(d,'attempt','A','apply',{action,candidate:a.candidate,actor});assert.equal(b.ok,true,JSON.stringify(b));return b} +change('reserve');assert.equal(state(d).graph_attempts.A.length,1); +change('release');assert.ok(state(d).graph_attempts.A[0].release); +change('reserve');assert.equal(state(d).graph_attempts.A.length,2); +const cfg=read(join(d,'A/host.json'));cfg.require_resource=true;write(join(d,'A/host.json'),cfg); +const next=read(join(d,'A-retry/host.json'));next.require_resource=true;write(join(d,'A-retry/host.json'),next);fs.writeFileSync(join(d,'A-retry/required-resource'),'available'); +let drive=run(d,'drive');assert.equal(drive.ok,true,JSON.stringify(drive));assert.ok(state(d,'A').node_execution_refusal);assert.equal(state(d,'A').node_execution_admission,undefined); +drive=run(d,'drive');assert.equal(drive.ok,true,JSON.stringify(drive));assert.equal(state(d).node_completions.A.terminal.outcome,'failed'); +change('retry');assert.equal(state(d).graph_attempts.A.at(-1).ordinal,2); +drive=run(d,'drive');assert.equal(drive.ok,true,JSON.stringify(drive));assert.ok(state(d,'A-retry').node_execution_admission); +assert.equal(state(d,'A').node_execution_admission,undefined); +const report=pop(d,"accounting","graph");assert.equal(report.ok,true,JSON.stringify(report));assert.equal(report.report.authority,"informational");assert.equal(report.report.budget.consumed,2);assert.equal(report.report.attempts.at(-1).admission,"consumed");assert.equal(report.report.attempts.find(a=>a.accounting==="released").accounting,"released"); +console.log(JSON.stringify({ok:true,root,checks:9})); diff --git a/tests/node_composition_fixture.kujo b/tests/node_composition_fixture.kujo index 26cb23b..e7a725b 100644 --- a/tests/node_composition_fixture.kujo +++ b/tests/node_composition_fixture.kujo @@ -28,7 +28,7 @@ func pointer(path) {return parse_json(read_file(path + "/pointer.json"))} func state(path) {p := pointer(path);loaded := load_run_state(path + "/runs", p["run_id"]);need(loaded["ok"]);return loaded["run_state"]} func inventory() { files := [] - for path in ["src/core/graph_outcome.kujo", "src/core/graph_transition.kujo", "src/core/node_transition.kujo", "src/core/node_composition.kujo", "src/core/node_execution.kujo", "src/core/runner.kujo", "src/core/assurance_state.kujo", "src/core/retained_recovery.kujo", "src/core/control_journal.kujo", "src/core/graph_policy.kujo", "src/core/graph_policy_operation.kujo", "src/core/state.kujo", "src/adapters/sqlite_continuation.kujo", "tests/node_composition_fixture.kujo"] {files = push(files, {"root":os_getcwd(), "path":path})} + for path in ["src/core/graph_attempts.kujo", "src/core/graph_outcome.kujo", "src/core/graph_transition.kujo", "src/core/node_transition.kujo", "src/core/node_composition.kujo", "src/core/node_execution.kujo", "src/core/runner.kujo", "src/core/assurance_state.kujo", "src/core/retained_recovery.kujo", "src/core/control_journal.kujo", "src/core/graph_policy.kujo", "src/core/graph_policy_operation.kujo", "src/core/assurance_configuration.kujo", "src/adapters/sqlite_continuation.kujo", "tests/node_composition_fixture.kujo"] {files = push(files, {"root":os_getcwd(), "path":path})} files = push(files, {"root":os_getcwd() + "/../workcell", "path":"src/evidence/retained_workspace.kujo"});return files } func descriptor(path) {return {"schema":"dispatch.assurance-configuration/v1beta1", "mode":"required", "fallback":"deny", "profile":"dispatch.sqlite-unique", "profile_version":"1beta1", "issuer":"sqlite-local", "mechanism":"sqlite_unique_transaction", "verifier_id":"node-host", "verifier_version":"1", "verifier_sha256":implementation_digest(inventory()), "authority_sha256":sha256(path)}} @@ -36,9 +36,11 @@ func graph_options() {return {"assurance_host":graph_host, "graph_boundary":func func graph_host(revision, current) { config := cfg(base) host := {"authorize_graph":func(actor, graph, intent) {return actor["id"] == "local-operator"&&actor["authenticated_by"] == "installed-local-host"&&actor["authorization"] == "graph-finalization"&&dict_get_or(cfg(base), "operator_enabled", true)}, "authorize_decision":func(decision, graph, binding) {return decision["actor"]["id"] == "local-operator"&&decision["actor"]["authenticated_by"] == "installed-local-host"&&decision["actor"]["authorization"] == "graph-review"&&dict_get_or(cfg(base), "operator_enabled", true)}, "read_evaluation":func(id, binding) {return read_file_beneath(base + "/" + id, "evaluation.json", 1048576)}, "resolve":func(id) {path := base + "/" + id;return {"root":path + "/runs", "run_id":pointer(path)["run_id"], "options":node_options(path)}}, "start":func(id, binding) { - command := spawn_process([env("KUJO_BIN"), "run", "tests/node_composition_fixture.kujo", base, "start", id], {"cwd":os_getcwd(), "inherit_env":true, "timeout_ms":120000, "max_output_bytes":1048576}) + selected := id;if pointer(base + "/" + id)["run_id"] != binding["consumer"]["run_id"] {selected = id + "-retry"} + command := spawn_process([env("KUJO_BIN"), "run", "tests/node_composition_fixture.kujo", base, "start", selected], {"cwd":os_getcwd(), "inherit_env":true, "timeout_ms":120000, "max_output_bytes":1048576}) need(command.success&&command.stderr == "");write_file(base + "/" + id + "/start-response.json", command.stdout, true);return parse_json(command.stdout) }} + host["resolve_attempt"] := func(id, run_id) {for suffix in [id, id + "-retry"] {path := base + "/" + suffix;if file_exists(path + "/pointer.json")&&pointer(path)["run_id"] == run_id {return {"root":path + "/runs", "run_id":run_id, "options":node_options(path)}}};throw("attempt_run_unavailable")} return {"status":dict_get_or(config, "status", "active"), "descriptor":config["descriptor"], "authority_sha256":config["descriptor"]["authority_sha256"], "implementation":inventory(), "verify":func(subject) {return null}, "node_host":host} } func preserved(path, selector) { @@ -58,7 +60,7 @@ func node_host(path, revision, current) { effect["read_artifact"] := func(reference) {return read_file_beneath(path, "artifacts/" + substring(reference, 7, 71) + ".json", 65536)} if has_key(config, "preservation_sources") {effect["preservation_binding"] := {"document_raw":read_file_beneath(path, "workcell/preservation.json", 65536), "environment_ref":"sha256:" + sha256(path), "resolve":func(selector) {return preserved(path, selector)}}} parent := {"evaluation_raw":dict_get_or(config, "evaluation_raw", ""), "authorize_decision":func(decision, current) {return decision["actor"]["id"] == "local-operator"&&dict_get_or(cfg(path), "operator_enabled", true)}, "read_output":func(reference) {need(reference == cfg(path)["output_ref"]);return {"metadata_raw":read_file_beneath(path, "output-evidence.json", 16384), "content_raw":read_file_beneath(path, "output.json", 1048576)}}} - return {"status":dict_get_or(config, "status", "active"), "descriptor":config["descriptor"], "authority_sha256":config["descriptor"]["authority_sha256"], "implementation":inventory(), "verify":func(subject) {return null}, "effect_set":effect, "continuation_adapter":sqlite_continuation_adapter, "parent_finalization":parent, "validate_node_inputs":func(current) {return validate_bound_node_inputs(current, state(base), graph_options())}} + return {"status":dict_get_or(config, "status", "active"), "descriptor":config["descriptor"], "authority_sha256":config["descriptor"]["authority_sha256"], "implementation":inventory(), "verify":func(subject) {return null}, "node_preflight":func(current) {if dict_get_or(cfg(path), "require_resource", false)&&file_exists(path + "/required-resource") == false {return {"status":"required_resource_unavailable"}};return {"status":"available"}}, "effect_set":effect, "continuation_adapter":sqlite_continuation_adapter, "parent_finalization":parent, "validate_node_inputs":func(current) {return validate_bound_node_inputs(current, state(base), graph_options())}} } func boundary(point) {if env("NODE_CRASH") == point {print("CRASH:" + point);sleep(30000)}} func node_options(path) {return {"assurance_host":func(revision, current) {return node_host(path, revision, current)}, "node_boundary":boundary, "effect_boundary":boundary, "finalization_boundary":boundary, "cancel_requested":dict_get_or(cfg(path), "cancel_requested", false), "tool_authorization_policy":func(input) {return {"allow":dict_get_or(cfg(path), "tool_allowed", true), "message":"Node-owned tool policy"}}}} @@ -74,12 +76,14 @@ func graph_workflow() { node_config := {"tool_name":"installed_node", "depends_on":node["depends_on"], "optional":dict_get_or(node, "optional", false), "kind":dict_get_or(node, "kind", "program")} contract := dict_get_or(node, "terminal_contract", "parent-finalization/v1alpha1") if has_key(node, "terminal_contract") {heterogeneous = true;node_config["terminal_contract"] := contract} - if contract == "parent-finalization/v1alpha1" {node_config["node_execution"] := {"schema":"dispatch.run-backed-node/v1alpha1", "run_id":pointer(base + "/" + node["id"])["run_id"], "step_id":"action", "inputs":node["inputs"], "outputs":outputs()}} + if contains(["parent-finalization/v1alpha1", "program-attempt/v1alpha1"], contract) {node_config["node_execution"] := {"schema":"dispatch.run-backed-node/v1alpha1", "run_id":pointer(base + "/" + node["id"])["run_id"], "step_id":"action", "inputs":node["inputs"], "outputs":outputs()}} else {node_config["inputs"] := node["inputs"];if contract == "evaluation-result/v1" {node_config["evaluator"] := {"name":"eval", "version":"2.0.0", "configuration_sha256":sha256(read_file(base + "/" + node["id"] + "/eval-config.json"))}}} + if has_key(node, "max_attempts") {execution := node_config["node_execution"];execution["max_attempts"] := node["max_attempts"];if node["max_attempts"] == 2 {execution["retry_run_id"] := pointer(base + "/" + node["id"] + "-retry")["run_id"]};node_config["node_execution"] := execution} for key in ["accept_terminal", "after_subgraphs", "on_unsuccessful"] {if has_key(node, key) {node_config[key] := node[key]}} steps = push(steps, create_step(node["id"], node["id"], "tool", node_config)) } metadata := {"node_composition":"dispatch.node-composition/v1alpha1"};if heterogeneous {metadata["graph_outcome"] := "dispatch.graph-outcome/v1alpha1"} + if has_key(definition, "graph_accounting") {metadata["graph_accounting"] := definition["graph_accounting"]} if has_key(definition, "graph_policy") {metadata["graph_policy"] := definition["graph_policy"]} return create_workflow({"id":"static-composition", "metadata":metadata, "name":"Static node DAG", "description":"Separate data and scheduling", "input_schema":{"type":"dict"}, "output_schema":{"type":"dict"}, "agents":{}, "tools":[], "steps":steps, "routing":{"enabled":false}, "control":dict_get_or(definition, "control", {"policy_id":"graph", "policy_version":"1", "policies":[]}), "default_retry_policy":{"max_attempts":1}, "approval_config":{"auto_approve":false}, "memory_config":{}, "budgets":{}, "max_parallel_steps":1}) } diff --git a/tests/node_composition_helpers.mjs b/tests/node_composition_helpers.mjs index 24b2d78..d37cbf9 100644 --- a/tests/node_composition_helpers.mjs +++ b/tests/node_composition_helpers.mjs @@ -13,7 +13,7 @@ function command(bin,args,extra={}){const p=spawnSync(bin,args,{env:{...env,...e const fixture='tests/node_composition_fixture.kujo';let serial=0; function run(d,mode,id='graph',request=null,extra={}){const args=['run',fixture,d,mode,id];if(request){const path=join(d,'request-'+serial+++'.json');write(path,request);args.push(path)}return JSON.parse(command(kujo,args,extra))} const state=(d,id='graph')=>{const dir=id==='graph'?d:join(d,id),p=read(join(dir,'pointer.json'));return JSON.parse(fs.readFileSync(join(p.run_dir,'state.json'),'utf8').split('\n').slice(1).join('\n'))}; -function setup(name,nodes,settings={}){const d=join(root,name);fs.mkdirSync(d);write(join(d,'graph.json'),{nodes,...settings});for(const {id,terminal_contract} of nodes){const path=join(d,id);fs.mkdirSync(path);if(terminal_contract&&terminal_contract!=="parent-finalization/v1alpha1"){write(join(path,"host.json"),{});write(join(path,"eval-config.json"),{suite:"node-"+id});continue;}fs.mkdirSync(join(path,'source'));command('git',['-C',join(path,'source'),'init','-q']);command('git',['-C',join(path,'source'),'config','user.name','Fixture']);command('git',['-C',join(path,'source'),'config','user.email','fixture@example.invalid']);fs.writeFileSync(join(path,'source','source'),'retained\n');command('git',['-C',join(path,'source'),'add','source']);command('git',['-C',join(path,'source'),'commit','-qm','initial']);const now=Math.floor(Date.now()/1000);write(join(path,'host.json'),{intent:{operation:'create',target_sha256:hash(path+'/sink.db'),scope_sha256:hash(d),key_sha256:hash(id),request_sha256:hash('result-'+id),precondition_sha256:hash('empty'),valid_from:now-10,valid_until:now+3500}});write(join(path,'eval-config.json'),{suite:'node-'+id});assert.equal(run(d,'init-node',id).ok,true);command('sqlite3',[join(path,'sink.db'),'CREATE TABLE mutation_audit(n INTEGER); CREATE TRIGGER observed_mutation BEFORE INSERT ON logical_effects BEGIN INSERT INTO mutation_audit VALUES(1); END;'])}assert.equal(run(d,'init-graph').ok,true);return d} +function setup(name,nodes,settings={}){const d=join(root,name);fs.mkdirSync(d);write(join(d,'graph.json'),{nodes,...settings});for(const {id,terminal_contract} of nodes.flatMap(n=>n.max_attempts===2?[n,{...n,id:n.id+"-retry",max_attempts:1}]:[n])){const path=join(d,id);fs.mkdirSync(path);if(terminal_contract&&!["parent-finalization/v1alpha1","program-attempt/v1alpha1"].includes(terminal_contract)){write(join(path,"host.json"),{});write(join(path,"eval-config.json"),{suite:"node-"+id});continue;}fs.mkdirSync(join(path,'source'));command('git',['-C',join(path,'source'),'init','-q']);command('git',['-C',join(path,'source'),'config','user.name','Fixture']);command('git',['-C',join(path,'source'),'config','user.email','fixture@example.invalid']);fs.writeFileSync(join(path,'source','source'),'retained\n');command('git',['-C',join(path,'source'),'add','source']);command('git',['-C',join(path,'source'),'commit','-qm','initial']);const now=Math.floor(Date.now()/1000);write(join(path,'host.json'),{intent:{operation:'create',target_sha256:hash(path+'/sink.db'),scope_sha256:hash(d),key_sha256:hash(id),request_sha256:hash('result-'+id),precondition_sha256:hash('empty'),valid_from:now-10,valid_until:now+3500}});write(join(path,'eval-config.json'),{suite:'node-'+id});assert.equal(run(d,'init-node',id).ok,true);command('sqlite3',[join(path,'sink.db'),'CREATE TABLE mutation_audit(n INTEGER); CREATE TRIGGER observed_mutation BEFORE INSERT ON logical_effects BEGIN INSERT INTO mutation_audit VALUES(1); END;'])}assert.equal(run(d,'init-graph').ok,true);return d} function op(d,id,operation,fields={}){const before=run(d,'op',id,{operation:'inspect'});assert.equal(before.ok,true,JSON.stringify(before));return run(d,'op',id,{operation,expected:before.cursor,...fields})} function complete(d,id){assert.equal(Number(command('sqlite3',[join(d,id,'sink.db'),'SELECT count(*) FROM mutation_audit;'])),0);assert.equal(op(d,id,'refresh',{effect_id:'C'}).ok,true);assert.equal(op(d,id,'select',{effect_id:'C'}).ok,true);const selected=run(d,'op',id,{operation:'inspect'});assert.equal(op(d,id,'admit',{attempt_id:selected.lifecycle.active}).ok,true);assert.equal(op(d,id,'refresh',{effect_id:'C'}).ok,true);assert.equal(Number(command('sqlite3',[join(d,id,'sink.db'),'SELECT count(*) FROM mutation_audit;'])),1)} function decision(d,id){const s=state(d,id);return {schema:'kujo.intervention-decision/v2',decision_id:'final-'+s.revision,request_id:s.human_intervention.request_id,boundary_id:s.current_control_boundary.boundary_id,expected_state_revision:s.revision,action:'approve_override',reason:'Accept verified node',decided_at:new Date().toISOString(),actor:{id:'local-operator',type:'human',authenticated_by:'installed-local-host',authorization:'parent-finalization'}}} diff --git a/tests/vectors/graph-attempts.json b/tests/vectors/graph-attempts.json new file mode 100644 index 0000000..4528dc1 --- /dev/null +++ b/tests/vectors/graph-attempts.json @@ -0,0 +1,230 @@ +{ + "schema": "dispatch.commitment-vectors/v1", + "algorithm": "sha256", + "encoding": "utf-8", + "output": "lowercase-hex-unprefixed", + "vectors": [ + { + "name": "attempt-binding-1", + "recipe": "portable_json", + "input": { + "schema": "dispatch.node-input-binding/v1alpha4", + "graph": { + "run_id": "graph", + "workflow_ref": "sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479" + }, + "node_id": "B", + "consumer": { + "run_id": "consumer-attempt-1", + "step_id": "action", + "attempt_id": "1" + }, + "predecessors": [ + { + "node_id": "H", + "terminal": { + "schema": "dispatch.node-terminal/v1alpha1", + "node_id": "H", + "contract": "intervention-decision/v2", + "subject": { + "run_id": "graph", + "step_id": "H", + "decision_instance": "1" + }, + "facts_ref": "sha256:1b0786ee4262f6b56d1c2e3d92537aff2dc1f37d0e1d061ada3cd4c1fd164bc6", + "finalized_revision": 19, + "outcome": "completed", + "authority_ref": "sha256:45a176d70438d20dd5125bbefd224dfe7fcc9e6fbaf45d7356a83b4ec3335e68" + } + } + ], + "inputs": [ + { + "producer_node": "A", + "producer_subject": { + "run_id": "producer", + "step_id": "action", + "attempt_id": "1" + }, + "result_ref": "sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b", + "finalization_ref": "sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e", + "finalized_revision": 17, + "output_name": "report", + "type_id": "kujo.example/node-summary/v1", + "schema_ref": "sha256:df0ad6e43880f09c90ebf95f19110178aba6890df0010ebda7485029e2b543b4", + "evidence_ref": "sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f", + "content_ref": "sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16", + "name": "input" + } + ], + "artifacts": [ + "sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e", + "sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b", + "sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f", + "sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16" + ], + "policy": { + "branches": [ + "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ], + "subgraphs": [ + "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + ] + }, + "attempt": { + "ordinal": 1, + "previous_terminal_ref": null + } + }, + "sha256": "280c0d64c5070d8bbff442b7709c20e7a270517aec55e0d240d9840d0ab3ff86", + "preimage_utf8": "{\"artifacts\":[\"sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e\",\"sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b\",\"sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f\",\"sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16\"],\"attempt\":{\"ordinal\":1,\"previous_terminal_ref\":null},\"consumer\":{\"attempt_id\":\"1\",\"run_id\":\"consumer-attempt-1\",\"step_id\":\"action\"},\"graph\":{\"run_id\":\"graph\",\"workflow_ref\":\"sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479\"},\"inputs\":[{\"content_ref\":\"sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16\",\"evidence_ref\":\"sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f\",\"finalization_ref\":\"sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e\",\"finalized_revision\":17,\"name\":\"input\",\"output_name\":\"report\",\"producer_node\":\"A\",\"producer_subject\":{\"attempt_id\":\"1\",\"run_id\":\"producer\",\"step_id\":\"action\"},\"result_ref\":\"sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b\",\"schema_ref\":\"sha256:df0ad6e43880f09c90ebf95f19110178aba6890df0010ebda7485029e2b543b4\",\"type_id\":\"kujo.example/node-summary/v1\"}],\"node_id\":\"B\",\"policy\":{\"branches\":[\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"],\"subgraphs\":[\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"]},\"predecessors\":[{\"node_id\":\"H\",\"terminal\":{\"authority_ref\":\"sha256:45a176d70438d20dd5125bbefd224dfe7fcc9e6fbaf45d7356a83b4ec3335e68\",\"contract\":\"intervention-decision/v2\",\"facts_ref\":\"sha256:1b0786ee4262f6b56d1c2e3d92537aff2dc1f37d0e1d061ada3cd4c1fd164bc6\",\"finalized_revision\":19,\"node_id\":\"H\",\"outcome\":\"completed\",\"schema\":\"dispatch.node-terminal/v1alpha1\",\"subject\":{\"decision_instance\":\"1\",\"run_id\":\"graph\",\"step_id\":\"H\"}}}],\"schema\":\"dispatch.node-input-binding/v1alpha4\"}" + }, + { + "name": "attempt-binding-2", + "recipe": "portable_json", + "input": { + "schema": "dispatch.node-input-binding/v1alpha4", + "graph": { + "run_id": "graph", + "workflow_ref": "sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479" + }, + "node_id": "B", + "consumer": { + "run_id": "consumer-attempt-2", + "step_id": "action", + "attempt_id": "1" + }, + "predecessors": [ + { + "node_id": "H", + "terminal": { + "schema": "dispatch.node-terminal/v1alpha1", + "node_id": "H", + "contract": "intervention-decision/v2", + "subject": { + "run_id": "graph", + "step_id": "H", + "decision_instance": "1" + }, + "facts_ref": "sha256:1b0786ee4262f6b56d1c2e3d92537aff2dc1f37d0e1d061ada3cd4c1fd164bc6", + "finalized_revision": 19, + "outcome": "completed", + "authority_ref": "sha256:45a176d70438d20dd5125bbefd224dfe7fcc9e6fbaf45d7356a83b4ec3335e68" + } + } + ], + "inputs": [ + { + "producer_node": "A", + "producer_subject": { + "run_id": "producer", + "step_id": "action", + "attempt_id": "1" + }, + "result_ref": "sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b", + "finalization_ref": "sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e", + "finalized_revision": 17, + "output_name": "report", + "type_id": "kujo.example/node-summary/v1", + "schema_ref": "sha256:df0ad6e43880f09c90ebf95f19110178aba6890df0010ebda7485029e2b543b4", + "evidence_ref": "sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f", + "content_ref": "sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16", + "name": "input" + } + ], + "artifacts": [ + "sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e", + "sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b", + "sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f", + "sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16" + ], + "policy": { + "branches": [ + "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ], + "subgraphs": [ + "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + ] + }, + "attempt": { + "ordinal": 2, + "previous_terminal_ref": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + }, + "sha256": "154331d5e72521a24eba884c934af888a75e171df3e8619bb3944b3e1ac0a1e7", + "preimage_utf8": "{\"artifacts\":[\"sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e\",\"sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b\",\"sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f\",\"sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16\"],\"attempt\":{\"ordinal\":2,\"previous_terminal_ref\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},\"consumer\":{\"attempt_id\":\"1\",\"run_id\":\"consumer-attempt-2\",\"step_id\":\"action\"},\"graph\":{\"run_id\":\"graph\",\"workflow_ref\":\"sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479\"},\"inputs\":[{\"content_ref\":\"sha256:4d7459b3eb4d7c8f99bbbf2baafb44db2dfdf2843ee16e956385a7dd0718bf16\",\"evidence_ref\":\"sha256:45447b7afbd5e544f7d0f1df0fccd26014d9850130abd3f020b89ff96b82079f\",\"finalization_ref\":\"sha256:9d344158ebdfdeba22837fcafdd28995e05b9c2c06df37fedd4dd7aa162fb89e\",\"finalized_revision\":17,\"name\":\"input\",\"output_name\":\"report\",\"producer_node\":\"A\",\"producer_subject\":{\"attempt_id\":\"1\",\"run_id\":\"producer\",\"step_id\":\"action\"},\"result_ref\":\"sha256:dab1f9f0f88f2131eea4a3df0415d3e492c2151ccdc9c9e16e340ce78796ec7b\",\"schema_ref\":\"sha256:df0ad6e43880f09c90ebf95f19110178aba6890df0010ebda7485029e2b543b4\",\"type_id\":\"kujo.example/node-summary/v1\"}],\"node_id\":\"B\",\"policy\":{\"branches\":[\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"],\"subgraphs\":[\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"]},\"predecessors\":[{\"node_id\":\"H\",\"terminal\":{\"authority_ref\":\"sha256:45a176d70438d20dd5125bbefd224dfe7fcc9e6fbaf45d7356a83b4ec3335e68\",\"contract\":\"intervention-decision/v2\",\"facts_ref\":\"sha256:1b0786ee4262f6b56d1c2e3d92537aff2dc1f37d0e1d061ada3cd4c1fd164bc6\",\"finalized_revision\":19,\"node_id\":\"H\",\"outcome\":\"completed\",\"schema\":\"dispatch.node-terminal/v1alpha1\",\"subject\":{\"decision_instance\":\"1\",\"run_id\":\"graph\",\"step_id\":\"H\"}}}],\"schema\":\"dispatch.node-input-binding/v1alpha4\"}" + }, + { + "name": "sealed-program-refusal", + "recipe": "portable_json", + "input": { + "schema": "dispatch.node-terminal/v1alpha2", + "node_id": "B", + "contract": "program-attempt/v1alpha1", + "subject": { + "run_id": "B1", + "step_id": "action", + "attempt_id": "1" + }, + "facts_ref": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "finalized_revision": 7, + "outcome": "failed", + "authority_ref": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + }, + "preimage_utf8": "{\"authority_ref\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"contract\":\"program-attempt/v1alpha1\",\"facts_ref\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"finalized_revision\":7,\"node_id\":\"B\",\"outcome\":\"failed\",\"schema\":\"dispatch.node-terminal/v1alpha2\",\"subject\":{\"attempt_id\":\"1\",\"run_id\":\"B1\",\"step_id\":\"action\"}}", + "sha256": "80ba4c53f44c47897759d3ff3a3bb99de72bcec05a0aa0f4e1ee2961c443493a" + }, + { + "name": "consumer-after-retry-terminal", + "recipe": "portable_json", + "input": { + "schema": "dispatch.node-input-binding/v1alpha4", + "graph": { + "run_id": "graph", + "workflow_ref": "sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479" + }, + "node_id": "C", + "consumer": { + "run_id": "C1", + "step_id": "action", + "attempt_id": "1" + }, + "predecessors": [ + { + "node_id": "B", + "terminal": { + "schema": "dispatch.node-terminal/v1alpha2", + "node_id": "B", + "contract": "program-attempt/v1alpha1", + "subject": { + "run_id": "B2", + "step_id": "action", + "attempt_id": "1" + }, + "facts_ref": "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd", + "finalized_revision": 19, + "outcome": "completed", + "authority_ref": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } + ], + "inputs": [], + "artifacts": [], + "policy": { + "branches": [ + "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ], + "subgraphs": [ + "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + ] + }, + "attempt": { + "ordinal": 1, + "previous_terminal_ref": null + } + }, + "preimage_utf8": "{\"artifacts\":[],\"attempt\":{\"ordinal\":1,\"previous_terminal_ref\":null},\"consumer\":{\"attempt_id\":\"1\",\"run_id\":\"C1\",\"step_id\":\"action\"},\"graph\":{\"run_id\":\"graph\",\"workflow_ref\":\"sha256:5bf0c8be1e4a38fb76f5a35d6ee5cf5964872d47128e917e9287f6f71ea3c479\"},\"inputs\":[],\"node_id\":\"C\",\"policy\":{\"branches\":[\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"],\"subgraphs\":[\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"]},\"predecessors\":[{\"node_id\":\"B\",\"terminal\":{\"authority_ref\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"contract\":\"program-attempt/v1alpha1\",\"facts_ref\":\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"finalized_revision\":19,\"node_id\":\"B\",\"outcome\":\"completed\",\"schema\":\"dispatch.node-terminal/v1alpha2\",\"subject\":{\"attempt_id\":\"1\",\"run_id\":\"B2\",\"step_id\":\"action\"}}}],\"schema\":\"dispatch.node-input-binding/v1alpha4\"}", + "sha256": "afb2a52d54e2b19f7bb0d6f1143ac288e31feaf700be59838b984c247ff562f0" + } + ] +}