diff --git a/.github/scripts/check-kujo-tool-artifacts.sh b/.github/scripts/check-kujo-tool-artifacts.sh index c980bef..f315966 100755 --- a/.github/scripts/check-kujo-tool-artifacts.sh +++ b/.github/scripts/check-kujo-tool-artifacts.sh @@ -55,7 +55,10 @@ git -C "$matcher_dir" init -q violations=() while IFS= read -r -d '' changed_path; do - if match="$(git -C "$matcher_dir" check-ignore --no-index -v -- "$changed_path" 2>/dev/null)"; then + # Verbose check-ignore also exits zero for a matching negation. Ask the quiet + # predicate first so explicit reviewed evidence exceptions retain Git semantics. + if git -C "$matcher_dir" check-ignore --no-index -q -- "$changed_path"; then + match="$(git -C "$matcher_dir" check-ignore --no-index -v -- "$changed_path")" violations+=("$changed_path ($match)") fi done < <( diff --git a/.github/workflows/ci-gate.yml b/.github/workflows/ci-gate.yml index 41dbdfd..b760ec4 100644 --- a/.github/workflows/ci-gate.yml +++ b/.github/workflows/ci-gate.yml @@ -24,7 +24,7 @@ jobs: matrix: os: [ubuntu-latest, macos-14] runs-on: ${{ matrix.os }} - timeout-minutes: 180 + timeout-minutes: 360 env: DISPATCH_OFFLINE_FIXTURE: "true" # Bump deliberately after compatibility verification and record the @@ -184,8 +184,28 @@ jobs: - name: Configure controlled MCP fixture run: echo "MCP_ROOT=$GITHUB_WORKSPACE/.ci/mcp-wave-d" >> "$GITHUB_ENV" + - name: Checkout retained-host Workcell graph fixture + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + repository: kujolang/workcell + ref: 0f9595b79872d2500f0bb35a8cf6227171fd7eeb + path: .ci/workcell-wave-f + + - name: Checkout exact Eval graph contract + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + repository: kujolang/eval + ref: 6a5ab09e5c24cc1a842b374afccb64da40db2874 + path: .ci/eval-wave-f + + - name: Prepare bounded graph fixture module layout + run: | + bash tests/ci_graph_layout_tests.sh + bash scripts/prepare_graph_fixture_layout.sh + - name: Run Dispatch release gate - timeout-minutes: 45 + # Full static graph, real-process crash and resource proofs run serially. + timeout-minutes: 300 run: bash scripts/run_release_gate.sh - name: Run pinned AI SDK release gate diff --git a/.github/workflows/kujo-tool-artifacts-guard.yml b/.github/workflows/kujo-tool-artifacts-guard.yml index 7d41908..de5317b 100644 --- a/.github/workflows/kujo-tool-artifacts-guard.yml +++ b/.github/workflows/kujo-tool-artifacts-guard.yml @@ -15,9 +15,10 @@ jobs: uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 with: fetch-depth: 0 + - name: Verify artifact policy exceptions stay bounded + run: bash tests/artifact_policy_tests.sh - name: Verify ignore coverage and pushed commits env: BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} run: bash .github/scripts/check-kujo-tool-artifacts.sh - diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 9d3a39c..e0bf1f5 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -19,7 +19,7 @@ jobs: matrix: os: [ubuntu-latest, macos-14] runs-on: ${{ matrix.os }} - timeout-minutes: 120 + timeout-minutes: 360 env: DISPATCH_OFFLINE_FIXTURE: "true" RUSTUP_TOOLCHAIN: "1.96.0" @@ -91,6 +91,22 @@ jobs: git clone --filter=blob:none https://github.com/kujolang/kennel.git .release/kennel-wave-d git -C .release/kennel-wave-d checkout --detach 093d44dddcebebd99bd8987e3efcb7e044dc45a7 "$KUJO_BIN" run .release/kennel-wave-d/kennel.kujo --interpreter -- install --project-dir "$GITHUB_WORKSPACE/.release/agents-sdk-wave-d" + - name: Checkout retained-host Workcell graph fixture + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + repository: kujolang/workcell + ref: 0f9595b79872d2500f0bb35a8cf6227171fd7eeb + path: .release/workcell-wave-f + - name: Checkout exact Eval graph contract + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + repository: kujolang/eval + ref: 6a5ab09e5c24cc1a842b374afccb64da40db2874 + path: .release/eval-wave-f + - name: Prepare bounded graph fixture module layout + run: | + bash tests/ci_graph_layout_tests.sh + DISPATCH_GRAPH_FIXTURE_ROOT="$GITHUB_WORKSPACE/.release" bash scripts/prepare_graph_fixture_layout.sh - name: Verify exact tagged source env: AI_SDK_PATH: ${{ github.workspace }}/.release/ai-sdk diff --git a/.gitignore b/.gitignore index a09891a..eee75db 100644 --- a/.gitignore +++ b/.gitignore @@ -195,3 +195,6 @@ tests/tmp/* /.ci/participant-sdk-build/ /.ci/participant-distribution/ + +# Reviewed, hash-inventoried proof evidence; ordinary runtime logs stay ignored. +!docs/evidence/resource-accounting/*.log diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e793e1..abad761 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 — sourced resources and Eval budgets + +- Add opt-in graph/node Eval ceilings with locked reservations, durable dispatch + consumption, exact-input evaluator retries and retained response reconciliation. +- Add atomic bounded program/Eval reservation plans for ready active paths, reusing + existing graph and child locks. Inactive paths and group receipts consume no units. +- Retain existing runtime and SDK usage artifacts with explicit source classes, + unknown coverage and optional fail-closed provider-usage prerequisites. No hard + token/time/currency budget or pricing is inferred from post-hoc measurements. +- Preserve consumed work across crashes, contention and retained-host repair. + See [resource contracts](docs/contracts/resources/protocol.md). + ## Unreleased — explicit graph attempt accounting - Add opt-in durable reservations, permanent dispatch consumption and explicit safe diff --git a/README.md b/README.md index ee65f64..9c03116 100644 --- a/README.md +++ b/README.md @@ -761,3 +761,7 @@ protected parent after verifying effects, outputs, evaluation and operator revie See [the bounded contract](docs/contracts/parent-finalization/protocol.md) and [Wave F crosswalk](docs/contracts/parent-finalization/wave-f-crosswalk.md). Finalization does not schedule work, replay effects or change participant authority. + +Experimental sourced resource accounting and bounded Eval reservation planning are +documented in [the resource contract](docs/contracts/resources/protocol.md). Existing +runtime/provider artifacts remain observations; Dispatch owns budget authority. diff --git a/config/kujo-tool-artifacts.gitignore b/config/kujo-tool-artifacts.gitignore index 381ec5a..c3a0069 100644 --- a/config/kujo-tool-artifacts.gitignore +++ b/config/kujo-tool-artifacts.gitignore @@ -134,6 +134,8 @@ *.tmp-* *.bak *.log +# Reviewed, hash-inventoried proof evidence; ordinary runtime logs stay ignored. +!docs/evidence/resource-accounting/*.log # Optional local config files created by init commands. Uncomment in repos where # these are developer-local rather than shared project configuration. @@ -141,4 +143,3 @@ # /fence.toml # /.lens.toml # /packwrite.toml - diff --git a/docs/audits/resource-accounting.md b/docs/audits/resource-accounting.md new file mode 100644 index 0000000..e337def --- /dev/null +++ b/docs/audits/resource-accounting.md @@ -0,0 +1,89 @@ +# Sourced resource accounting and bounded Eval budgets + +This is an experimental trusted retained-host extension of Dispatch's existing graph +journal, run lock, source-bound host configuration, DAG and recovery path. The +[decision](../contracts/resources/decision.md) records the pre-implementation source +ownership audit; the [protocol](../contracts/resources/protocol.md) and +[crash matrix](../contracts/resources/crash-matrix.md) define the bounded contract. +Validation status and exact source/toolchain pins belong in the accompanying evidence. + +## Verified source + +The [validation record](../evidence/resource-accounting/validation.json) covers +Dispatch `2577c60ff7ef79992f34b4627799f488cf5edcd6`: all 87 focused canonical suites, +24 shards (101 tests), command-surface checks and 3/3 release workloads passed. +New coverage includes 20 native assertions and 19 process integration proof groups. +The first canonical run failed because isolated recovery copies omitted the new +source-bound evaluator worker; that failure, its correction and the full successful +rerun are retained. No failing run is presented as passing. + +Kujo documentation source `51369e42b38efb4479af440c8370ac8a4fea3a7a` passed formatting, +the locked release build and 13 contract tests; two existing artifact-dependent +tests remained explicitly ignored. Concurrent primary Kujo runtime edits were not +incorporated. The evidence includes commands, warnings, source pins and verified +SHA-256 inventories. Hosted canonical success is not claimed by these local results. +Post-push artifact CI exposed the generic log-ignore rule rejecting intentionally +retained evidence. A narrow policy exception and three guard tests now preserve +reviewed logs while rejecting ordinary output. Kujo's separate release-state check +fails because the existing `v1.7.0` tag conflicts with unchanged `v1.6.0` stable +installation defaults; that release-owned mismatch is recorded, not hidden or +folded into this resource tranche. See `hosted_followup` in the validation record. +Hosted Kujo Clippy also reports Rust 1.99 atomic API deprecations in three unchanged +runtime files; the local documentation/build validation used Rust 1.96. This separate +runtime/MSRV issue is retained with its exact job evidence and was not silently fixed +inside the protected concurrent work. + +## Implementation and authority + +Program attempts retain their existing unit and identities. First-class Eval nodes +now have separate reservations, permanently consumed dispatches and exact result +resolution. The evaluator runs in a separate process using actual Eval result +semantics. An exclusive retained claim precedes evaluation. Only a conclusive local +infrastructure failure permits an explicitly selected second Eval attempt over the +same bound subject. It never reruns the subject program or reuses an effect admission. + +The planner accepts explicit ready nodes and checks program/Eval capacity together. +Applying its exact candidate under existing graph/child locks commits one immutable +reservation event. It does not select a branch, schedule nodes or invoke work. Human +decisions, branch activations and subgraph receipts are separate facts, not extra +program dispatches. Inactive paths receive no reservation. + +Runtime reports and SDK context ledgers remain source artifacts. Dispatch binds them +to exact consumed attempts and retains their raw bytes/digests. Reported, estimated, +observed and unknown quantities remain separate; incomplete totals are null with +explicit known subtotals and missing coverage. No provider adapter, telemetry collector +or monetary calculator is duplicated. Numeric token/time enforcement is deferred; +post-hoc measurements cannot promise safe worst-case future reservations. A closed +source-availability prerequisite can block new work when prior provider usage is +missing or incomplete. This is not a token ceiling. + +## Boundary review + +| Gap | Change possible | Guard | +| --- | --- | --- | +| Assessment → reservation | Revision, journal, graph definition, inputs, operator, capacity | Locked exact candidate recomputation and current host authorization | +| Reservation → Eval dispatch | Producer identity, evaluator config, source availability, authority | Exact binding and live evaluator identity; current host validation; source guard | +| Dispatch → evaluator work | Controller death, duplicate worker delivery, evaluator config | Permanently consumed dispatch; exclusive retained claim; worker config recheck | +| Work → result recording | Reply loss, wrong result, missing claim | Exact attempt/binding/subject/evidence/evaluator validation; no implicit retry | +| Measurement assessment → publication | Source replacement, operator revocation | Digest-bound candidate and final locked source/authority revalidation | +| Journal → accounting projection | Lost append/state publication, corrupt bytes | Existing immutable lineage repair, digest checks and replayed accounting projection | +| Resource exhaustion → completion | No capacity for new work | Resolution and terminal publication do not require a new reservation | + +The installed adapter owns truthful attribution and conclusive process termination. +A hash alone cannot certify provider truth, disjoint observations or malicious +participants. Imported historical Eval evidence is not retroactively counted as an +invocation. New source/control records stay host-local; historical participant wire, +alpha/beta and portable commitment bytes are unchanged. + +## Next major phase + +Recommend bounded human adoption and operator usability: exercise one installed +end-to-end workflow with an inspect/plan/apply interface and sourced adapter evidence. +The current core contracts are explicit, but an operator still needs installed host +hooks to connect them. That is a more useful next test than adding counters or loops. +Use the resulting evidence to decide whether typed Wave E source/context lineage is +then the weakest boundary. Remote trust and machine migration remain independent. + +No dynamic topology, general retries, distributed resource authority, pricing, +mixed profiles, compensation, exactly-once, universal rollback, stable SDK or new +language syntax is claimed. diff --git a/docs/contracts/resources/crash-matrix.md b/docs/contracts/resources/crash-matrix.md new file mode 100644 index 0000000..1d76037 --- /dev/null +++ b/docs/contracts/resources/crash-matrix.md @@ -0,0 +1,29 @@ +# Resource crash, recovery and contention proof matrix + +| Boundary | Durable fact | Allowed next action | Prohibited | +| --- | --- | --- | --- | +| Assessed plan, no apply | Informational candidate only | Reassess | Treat candidate as capacity or admission | +| Reservation committed before dispatch | Held exact Eval/program capacity | Explicit release if never dispatched | Infer work or auto-resume | +| Immutable reservation, index missing | Source-bound orphan control record | Existing mechanical reconciliation | Invent another reservation | +| Eval dispatch before worker | Permanently consumed Eval unit | Exact readback if evidence exists, otherwise remain unknown | Refund or redeliver from silence | +| Worker admitted | Exclusive retained claim | Finish the same invocation | Invoke worker twice | +| Worker result produced, reply lost | Consumed dispatch/claim; host retains exact attempt response | Independent result readback, ordinary terminal decision | Re-execute evaluator or producer | +| Conclusive worker infrastructure failure | Consumed failed Eval attempt | Explicit new bounded attempt with same input | Reuse old identity, rerun subject program | +| Eval fail verdict | Exact completed evaluation judgment | Existing fail/branch/review policy | Reclassify judgment as infrastructure retry | +| Measurement retained, journal append lost | Exact source bytes and immutable observation record | Reconstruct source projection | Fabricate zeros, alter provenance class | +| Source artifact/hash corruption | Invalid evidence | Fail closed / operator investigation | Enforce policy from unverified bytes | +| Usage missing or estimated-only | Unknown reported usage | Supply missing exact evidence; review | Assume zero or promote estimate | +| All capacity consumed, work resolved | Exact results and receipts | Record sources, finalize nodes/graph | Reject truthful completion because no new capacity exists | + +Two fresh controllers use the existing run lock for final program capacity, final +Eval capacity, competing plans, and release. Candidates bind exact state, revision, +journal, workflow, operator and installed source authority. No test-only global mutex +or secondary scheduler lock supplies correctness. Plans for unselected branches +reject. Subgraph member reservations count by dimension, with no charge for receipts. + +Claims are retained under `eval-admissions/`. A missing claim for a completed Eval +or conflicting claim bytes fails reload. A consumed dispatch without a claim still +counts as consumed: absence of an acknowledgement is not permission to dispatch again. + +The validation record identifies which cases have run and their source pins. This +matrix is a contract, not a substitute for the executable test results. diff --git a/docs/contracts/resources/decision.md b/docs/contracts/resources/decision.md new file mode 100644 index 0000000..f812100 --- /dev/null +++ b/docs/contracts/resources/decision.md @@ -0,0 +1,65 @@ +# Sourced resources and bounded Eval work: design crosswalk + +Starts at Dispatch b724f369ab4101a46ea0d5493cc41fc3d0fa3b9c. Kujo's concurrent +runtime and editor changes are outside this work; validation uses the retained +pinned runtime and isolated documentation checkout. + +| Dimension | Existing source | Classification / enforcement decision | +| --- | --- | --- | +| Program attempts | Dispatch graph attempt journal | Authoritative durable dispatch count; existing ceiling/reservation remains | +| Eval attempts | No existing graph dispatch: read_evaluation only imports results | Add explicit opt-in reservation and dispatch, under the existing graph lock, separate from program execution | +| Human decisions | Revision-bound intervention evidence | Decision instances, not program or Eval resource units | +| Process wall time | Kujo runtime-measurements/v1 wall_ns | Observed process interval, not graph elapsed time; observational only | +| CPU | Runtime cpu_seconds | Observed process CPU delta excluding children, nullable; no inferred CPU from wall | +| RSS | Runtime process_peak_rss_bytes | Observed process-lifetime peak, nullable; never summed as memory allocation | +| Runtime/task counters | Runtime counters; independent snapshot | Observed bounded counters, some inclusive; no timing enforcement | +| Provider input/output tokens | Agents SDK context-ledger/v1 provider_usage with usage_source=provider | Provider-reported; preserve null; do not use SDK budget defaults | +| Estimated tokens | Context ledger component estimated_tokens | Estimated, separate from provider usage; no promotion to reported | +| Monetary cost | RunLedger nullable amounts; SDK tracing may default currency | Unknown here: no scoped source with required currency assurance; no pricing | +| Watchdog projection | runtime_measurements_adapter binds original bytes by SHA256 | Observation transport, no Dispatch authority | +| RunLedger | Receipt/usage/cost reporting | Aggregation, no reservation or admission authority | + +## Bounded implementation decision + +Use a new opt-in internal resource policy, not new participant wire bytes. Retain +exact source artifacts through existing node-input content addresses and journal +control records. Installed source-bound host callbacks bind each artifact to an +exact consumed program or Eval attempt. A hash proves integrity, not truthful +attribution; trusted installed collection owns that binding. Missing source stays +unknown and may be supplied later. A recorded source cannot silently change. + +Eval reservations hold a distinct graph capacity unit. Durable Eval dispatch +consumes it before invoking a source-bound installed evaluator, once. Reply loss +stays consumed/unknown. A separately recorded infrastructure failure permits an +explicit bounded new evaluation of the same immutable inputs; ordinary fail +verdict and missing reply do not. No underlying program/action is repeated. + +Plans list explicit dependency-ready active nodes and capacity in both dimensions. +They are informational until exact revalidation and operator authorization under +the existing lock. An atomic reservation event may hold several program/Eval slots; +it neither runs work nor creates a second scheduler. Inactive and unselected paths +hold nothing. Subgraph members count individually; receipts add no execution unit. + +Process measurements and reported/estimated usage remain separate observations. +No hard token or wall-time ceilings are claimed: post-hoc provider usage supplies +no safe worst-case pre-admission reservation bound. An optional closed policy can +require complete provider usage for every prior consumed attempt before permitting +new work. Unavailable or estimated-only facts then block, including held work at +final dispatch. Results, measurements, release and terminal publication remain +possible at exhaustion. Recovery folds existing immutable records; it never +refunds consumed dispatch, invents measurements or finalizes a graph. + +## Implementation discoveries + +The existing implementation manifest admitted at most 16 files. The source-bound +resource controller needs 21 (including the reused schema and installed evaluator +worker). The bounded host manifest now admits at most 32 regular files, each still +limited to 1 MiB. Its ordered hash algorithm and every existing <=16-file digest are +unchanged. This is a local verifier-inventory bound, not a participant wire change. + +The runtime schema includes `maxProperties` and `uniqueItems`, which Kujo's native +schema subset does not implement. The original upstream schema is embedded as JSON +bytes; those two constraints are enforced explicitly by the consumer while the +existing validator handles its supported subset. Interoperable numeric bounds remain +stricter than the producer's u64 range; counters beyond exact cross-consumer range +reject instead of rounding. No runtime edit is required. diff --git a/docs/contracts/resources/protocol.md b/docs/contracts/resources/protocol.md new file mode 100644 index 0000000..b690460 --- /dev/null +++ b/docs/contracts/resources/protocol.md @@ -0,0 +1,173 @@ +# Sourced resources, Eval budgets and reservation planning + +Experimental static graph contract on retained trusted local storage. Dispatch owns +resource authority. This extends its existing graph journal, lock, installed host +and retained-host reconciliation; it introduces neither a scheduler nor billing. + +## Opt-in and units + +The anchored workflow declares `metadata.graph_resources`: + +```json +{"schema":"dispatch.graph-resources/v1alpha1","max_eval_attempts":4,"require_provider_usage":false} +``` + +It also opts into existing graph attempt accounting and static graph policy. +The graph ceiling is 0–8 Eval dispatches. Each evaluation node may declare +`config.max_eval_attempts` as 1 (default) or 2. Configuration is immutable under the +existing anchored definition. Participants cannot change limits or required work. +A program dispatch, Eval dispatch, human decision and group receipt are distinct. +The existing program-attempt ledger and ceiling are reused unchanged. + +Eval rows retain their ordinal, unique attempt ID, exact input-binding reference, +reservation, release, consumed dispatch and resolution. Dispatch consumption occurs +before the installed evaluator callback. A crash or missing reply does not refund it. +An exclusive retained worker claim prevents accidental second worker invocation. +The callback receives the exact binding and attempt identity. It must be an installed, +source-bound evaluation-only adapter; it must not rerun the subject program or admit +its external effects. An evaluator process can produce knowledge, not graph authority. + +A successful evaluator response is validated against the exact producer subject, +result and artifact digests, and anchored evaluator identity. Its bytes are retained. +A separate node terminal operation applies existing Eval control policy; an Eval +result alone does not finalize the node or graph. Failure verdicts remain judgments, +not infrastructure failures. The sole new retry class is an installed adapter's +conclusive terminated infrastructure failure. Retry is explicit, bounded and retains +the same inputs, old consumption and old response. Missing replies and uncertain +termination remain unknown and cannot use that retry path. There is no Eval backoff, +retry queue, general replay or underlying program rerun. + +## Sources and classification + +An installed host resolves one retained source per consumed attempt and source kind. +The observation candidate binds subject (program/Eval, node, execution identity), raw +artifact SHA-256, current state, journal and installed authority. Operator publication +revalidates under the existing graph lock and retains the raw bytes as existing +content-addressed artifacts. Repeated observations cannot double count. A recorded +source is immutable; absent sources may be supplied later. Runtime and model facts +must be attributed to distinct process/model invocations by the installed collector; +hashing alone cannot prove source truth or non-overlap. This is trusted-host evidence, +not malicious-source verification. + +- Runtime: existing `kujo.runtime-measurements/v1`, observed process wall interval, + nullable process CPU delta and lifetime peak RSS, and independently sampled counters. +- Model: existing SDK `kujo.context-ledger/v1`. Only `usage_source=provider` supplies + provider-reported input/output tokens. Missing fields remain null. Fixture or + unavailable source labels cannot promote numeric fields into reported usage. +- Estimates: component token estimates and their named estimator remain separate. +- Unknown: missing artifact, missing provider fields, CPU/RSS unavailable, and monetary + cost. Known partial sums explicitly report their unknown attempt coverage. + +The report does not sum RSS. Sum of observed process wall intervals is labelled as +such: it is neither graph elapsed time nor CPU. Nested/inclusive runtime counters are +not added as independent durations. Collection may describe a prefix of detached work. +Neither time, tokens nor monetary cost has a hard numeric ceiling in this slice: +post-hoc observations do not provide trustworthy worst-case admission reservations. +No provider pricing, currency default, inferred cost or conversion is introduced. + +The optional `require_provider_usage` policy requires complete provider input/output +usage for every previously consumed program/Eval attempt before *new* reservations +or dispatch. Missing, partial or estimated-only usage blocks; zero must be an actual +reported value. This deliberately strict policy is unsuitable for adapters unable to +supply that evidence. It does not block result/measurement recording, release, Eval +resolution or terminal publication for already-consumed work. + +## Operator API and plans + +The installed controller calls `resource_operation(root, run_id, request, options)`. +`operation=report` returns `dispatch.resource-report/v1alpha1`, an informational, +revision/journal-bound view with program and Eval ledgers, source classes, exact +artifact references, per-attempt readings and known sums with unknown coverage. +A report or plan grants no authority. + +`operation=assess` with `action=reserve,nodes=[...]` proposes a bounded set of up to +eight explicit active, dependency-ready program/Eval nodes. It checks both dimensions +as a set. It does not choose nodes, activate branches or allocate inactive paths. +`operation=apply` repeats the request with the exact candidate and installed-authorized +actor. Graph lock, relevant child locks, source revalidation and existing journal +publication precede a single reservation transition. The plan never executes work. +Program nodes still use ordinary independent admission and effect policy. + +Eval `release`, `dispatch` and `resolve` use separate assess/apply requests with +`node_id`. Release requires the current row never to have dispatched. Dispatch +consumes before the callback, even if work subsequently fails. Resolve reads exact +retained response evidence through the installed adapter after a lost controller +reply; it never invokes evaluation. `observe` binds a consumed `subject` and +`source_kind` (`runtime` or `model`). Missing source yields an explicit unknown error, +never a fabricated zero artifact. All applies record operator attribution. + +The graph outcome binds exact Eval/resource history as a digest, in addition to the +existing program ledger. Held capacity and unresolved consumed evaluations prevent +sealing. Exhaustion blocks new work, not recording or finalizing consumed work. +Optional work, inactive branches and subgraph receipts cannot erase consumption. + +## Authority table + +| Step | Information producer | Validator / authority | Durable prerequisite | +| --- | --- | --- | --- | +| Source measurement | Runtime / SDK / installed adapter | Dispatch validates identity, bounds and bytes | Exact consumed subject and source artifact | +| Reservation plan | Controller assessment | Informational only | Current anchored graph and journal | +| Reservation commit | Authorized local operator | Dispatch graph and child locks | Exact revalidated plan, immutable record | +| Eval dispatch | Installed controller | Dispatch lock / consumed row | Held reservation, current inputs and authority | +| Eval work | Installed evaluation-only worker | One-use retained claim | Exact consumed dispatch | +| Eval result | Eval | Dispatch exact subject/input/evaluator validation | Retained response and result | +| Eval terminal | Existing control policy | Dispatch | Consumed completed Eval result | +| Graph terminal | Existing graph policy | Dispatch | Required terminal facts and resolved reservations | +| Recovery | Operator | Existing retained-host reconciliation | Exact immutable lineage, never invented facts | +| Reporting | Watchdog / RunLedger may consume references | No budget authority | No new external integration required | + +## Boundaries + +No hard runtime/token/currency enforcement, inferred prices, automatic uncertain +retry, mutable ceiling extension, general quota service, dynamic topology, distributed +reservations, remote trust, machine-loss recovery, mixed profiles, compensation, +exactly-once, universal rollback, stable SDK or new Kujo syntax. Host-local source +references and control events suffice; no participant wire format or historical +portable vectors change. Late observation after a sealed graph requires an external +historical report; graph terminal authority is not silently rewritten. + +## Installed host surface + +The source-bound `node_host` additionally supplies: + +- `evaluation_identity(node_id)`: live evaluator name/version/configuration digest; + it must equal the anchored node contract before reservation and dispatch. +- `start_evaluation(node_id, binding, attempt_id)`: one bounded local invocation. + A worker reloads the graph and calls `claim_evaluation` once before evaluating. +- `read_evaluation_attempt(node_id, binding, attempt_id)`: read-only exact response + recovery; it must never invoke the evaluator. +- `read_resource_source(subject, source_kind)`: `{subject, source_kind, raw}` for the + exact consumed invocation, or null when unavailable. Provider logic stays outside + Dispatch; source labels are interpreted by the closed artifact adapters. + +An Eval response binds `attempt_id` and `binding_ref`. `status=completed` carries +`evaluation_raw`; `status=infrastructure_failed` carries a bounded reason backed by +conclusive local termination. Timeouts, cancellation or truncated protocol replies +must remain unknown. A completed response without its retained worker claim rejects +before publication. Runtime/model source callbacks may not substitute a different +invocation or aggregate overlapping measurements as disjoint work. + +These are installed trusted-host hooks, not public participant APIs or permission +to execute outside Dispatch. The fixture runs a separate restricted-purpose evaluator +process using the real Eval result contract and existing runtime collector. It does +not certify arbitrary effect-producing Eval command suites as safely retryable. + +The Eval ceiling covers first-class Dispatch-managed evaluator invocations in this +opt-in graph. Historical imported evaluation receipts and parent evaluation evidence +are not retroactively counted as dispatched processes. Their existing authority +contracts remain unchanged; this is not a claim to meter all external Eval activity. + +`complete` in a reported-token subtotal means that every consumed attempt in this +bounded ledger has the two required fields from its installed source. It is not +proof that arbitrary uninstrumented model calls were discovered. The installed +adapter must map the supported attempt to one non-overlapping source invocation; +multiple providers/calls without an exact supported aggregate remain outside this +slice. SDK ledger scope stays `adapter_messages_and_tools`, not universal program +usage. This is another reason these post-hoc subtotals do not enforce numeric token +ceilings. + +A retained [operator report example](../../evidence/resource-accounting/resource-report-example.json) +comes from the offline SDK-backed source-policy proof: one program consumed, one +reserved, 41 reported input and 7 reported output tokens, 16 estimated component +tokens, and unknown process wall time/cost. It is informational evidence, not a +reservation or execution ticket. diff --git a/docs/evidence/resource-accounting/artifact-policy-fixed.txt b/docs/evidence/resource-accounting/artifact-policy-fixed.txt new file mode 100644 index 0000000..7f2ae8e --- /dev/null +++ b/docs/evidence/resource-accounting/artifact-policy-fixed.txt @@ -0,0 +1,2 @@ +[tool-artifacts] OK: all source rules are present and no pushed commit contains a listed artifact +Artifact policy: 3 checks passed. diff --git a/docs/evidence/resource-accounting/artifact-policy-history.txt b/docs/evidence/resource-accounting/artifact-policy-history.txt new file mode 100644 index 0000000..398b14b --- /dev/null +++ b/docs/evidence/resource-accounting/artifact-policy-history.txt @@ -0,0 +1 @@ +[tool-artifacts] OK: all source rules are present and no pushed commit contains a listed artifact diff --git a/docs/evidence/resource-accounting/artifact-policy.txt b/docs/evidence/resource-accounting/artifact-policy.txt new file mode 100644 index 0000000..d987086 --- /dev/null +++ b/docs/evidence/resource-accounting/artifact-policy.txt @@ -0,0 +1,5 @@ +The following paths are ignored by one of your .gitignore files: +docs/evidence/resource-accounting/proof.log +hint: Use -f if you really want to add them. +hint: Turn this message off by running +hint: "git config advice.addIgnoredFile false" diff --git a/docs/evidence/resource-accounting/baseline.log b/docs/evidence/resource-accounting/baseline.log new file mode 100644 index 0000000..9a0ccc2 --- /dev/null +++ b/docs/evidence/resource-accounting/baseline.log @@ -0,0 +1,10 @@ +{"checks":19,"ok":true} +{"checks":14,"ok":true} +{"checks":10,"ok":true} +{"checks":12,"ok":true} +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-uCG5A2","checks":9} +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-agmAQG"} +{"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-x0LZDl"} diff --git a/docs/evidence/resource-accounting/canonical-1.log b/docs/evidence/resource-accounting/canonical-1.log new file mode 100644 index 0000000..caa41ca --- /dev/null +++ b/docs/evidence/resource-accounting/canonical-1.log @@ -0,0 +1,55 @@ +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 failed (exit 1). Full evidence: tests/tmp/dispatch-test-shards/logs/static_policy_recovery.log +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: read_file_beneath[target_open_failed]: cannot open target 'tests/resource_eval_worker.kujo': No such file or directory (os error 2) + --> 0:0 + +Call stack: + 0 at descriptor + + + +4 !== 0 + + at command (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:12:149) + at run (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:14:205) + at setup (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:16:1287) + at branchRun (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/static_policy_recovery.mjs:10:102) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/static_policy_recovery.mjs:11: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 diff --git a/docs/evidence/resource-accounting/canonical-2.log b/docs/evidence/resource-accounting/canonical-2.log new file mode 100644 index 0000000..e6244f9 --- /dev/null +++ b/docs/evidence/resource-accounting/canonical-2.log @@ -0,0 +1,160 @@ +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 +resource_contracts passed. Evidence: tests/tmp/dispatch-test-shards/logs/resource_contracts.log +resource_limits passed. Evidence: tests/tmp/dispatch-test-shards/logs/resource_limits.log +resource_integration passed. Evidence: tests/tmp/dispatch-test-shards/logs/resource_integration.log +resource_policy passed. Evidence: tests/tmp/dispatch-test-shards/logs/resource_policy.log +resource_recovery passed. Evidence: tests/tmp/dispatch-test-shards/logs/resource_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 11s +Evidence: tests/tmp/v1.1-evidence/evidence.json +Dispatch release gate passed. diff --git a/docs/evidence/resource-accounting/canonical-suites.txt b/docs/evidence/resource-accounting/canonical-suites.txt new file mode 100644 index 0000000..37b09c1 --- /dev/null +++ b/docs/evidence/resource-accounting/canonical-suites.txt @@ -0,0 +1,1196 @@ +### ability_assurance.log +check passed: examples/application-assurance/gateway.kujo +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/ability/tests/tmp/application-assurance-1790870433208","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":3,"in_progress":2,"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-1790870433208"} + +### 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-resource-accounting/tests/tmp/beta-migration-1790870248258","proofs":[{"family":"sqlite","scenario":"alpha","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"82a441f2a51426238fdac5ea837bf25be4ccb5b89a313c91a3bbbf5d5229873f"},{"family":"sqlite","scenario":"beta","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"db6557168576e2e116dd3006b47550defeee46f11d65501e5d2890f44624af64"},{"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":"4de028db4e6f67b90cb8c165194f87bf1128fac308afa43805b8fd1170e38fbe"},{"family":"git","scenario":"beta","portable_identity_checks":0,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"71823248468ba8b4778e8610632b7d8356c944214443b92b8c148261c87bfe76"},{"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":"d29c282154479dbdf13e32eaaf3ea447db682de312385b3ab044fd4cf8b6aa40"},{"family":"ability","scenario":"beta","portable_identity_checks":2,"required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"0130af61bde03437cc15ca063283670da8d457cfd66f9db958c9a07ce178f85e"},{"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 (1680ms) + ✓ evaluation failure can fail the workflow without failing the action (1177ms) + ✓ evaluation warning can continue (2062ms) + ✓ descendant boundary drains an unrelated DAG branch before pausing (3213ms) + ✓ evaluation result cannot issue an orchestration action (289ms) + ✓ portable evaluation result resolves through workflow policy (297ms) + ✓ provider preservation and reexecution contracts cross policy without coupling (1872ms) + ✓ revision-bound intervention resumes without rerunning the producer (253ms) + ✓ retry evaluation creates an explicit new pending attempt (239ms) + ✓ stale intervention decision is rejected (234ms) + ✓ unsafe retry is rejected without an idempotency contract (235ms) + ✓ retry clean refuses to emulate a provider snapshot (243ms) + ✓ retry clean prepares a fresh provider-backed attempt (243ms) + ✓ retry clean still rejects unsafe external effects (237ms) + +Tests: 14 total, 14 passed, 0 failed +Time: 12670ms +============================================================ + +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 (213ms) + ✓ state persistence saves and reloads run (443ms) + ✓ dispatch blocks unsafe config paths without opt in (423ms) + ✓ dispatch unknown command prints usage snapshot (423ms) + ✓ invalid step output is not committed to the idempotency cache (680ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 2289ms +============================================================ + +All tests passed! ✨ + +### dispatch-10.log + +============================================================ +Test Results +============================================================ + ✓ tool registry rejects invalid sources directories (189ms) + ✓ plugin registration injects custom tool and agent (214ms) + ✓ high volume run index listing remains deterministic (10134ms) + ✓ native atomic file writes content and leaves no temp residue (174ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 10790ms +============================================================ + +All tests passed! ✨ + +### dispatch-11.log + +============================================================ +Test Results +============================================================ + ✓ retry behavior succeeds after transient failures (188ms) + ✓ runner executes workflow and writes final report (12303ms) + ✓ trace truncation preserves limits and summary metadata (158ms) + ✓ signed bundle supports key id rotation via a trusted key set (1072ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 13803ms +============================================================ + +All tests passed! ✨ + +### dispatch-12.log + +============================================================ +Test Results +============================================================ + ✓ retry delay supports deterministic jitter (150ms) + ✓ report payload and markdown include lifecycle metadata (12742ms) + ✓ dispatch runs json exposes filtered and page catalogs (2729ms) + ✓ idempotency key reuses cached output instead of re-executing (858ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 16566ms +============================================================ + +All tests passed! ✨ + +### dispatch-13.log + +============================================================ +Test Results +============================================================ + ✓ approval decision handling supports approve reject and pause (149ms) + ✓ run listing filters and catalog support automation workflows (980ms) + ✓ workflow config file supports parsing and cli override precedence (13745ms) + ✓ dispatch blocks unsafe webhook sink paths and supports cancel-after-step (2798ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 17760ms +============================================================ + +All tests passed! ✨ + +### dispatch-14.log + +============================================================ +Test Results +============================================================ + ✓ approval rejects invalid simulated decision values (149ms) + ✓ cleanup command supports dry-run and apply pruning (1516ms) + ✓ tool policy parsing and enforcement supports allow deny normalization (151ms) + ✓ crud reliability report includes purpose-built reliability sections (201ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2103ms +============================================================ + +All tests passed! ✨ + +### dispatch-15.log + +============================================================ +Test Results +============================================================ + ✓ decision normalization matrix supports shared CLI and approval logic (170ms) + ✓ run pagination handles larger catalogs (5391ms) + ✓ policy profile aliases resolve and explicit lists override profile defaults (178ms) + ✓ declarative workflow loader validates and builds workflows from a spec (281ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 6103ms +============================================================ + +All tests passed! ✨ + +### dispatch-16.log + +============================================================ +Test Results +============================================================ + ✓ cli args parser handles flags and positionals with schema (184ms) + ✓ dependency scheduling supports parallel-ready DAG steps (1870ms) + ✓ policy profile aliases work via config and cli override (14163ms) + ✓ built-in sample plugin injects a tool and agent handler and observes events (2141ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 18453ms +============================================================ + +All tests passed! ✨ + +### dispatch-17.log + +============================================================ +Test Results +============================================================ + ✓ cli args parser returns missing value and unknown flag errors (183ms) + ✓ summarize run reports artifact availability (17267ms) + ✓ dispatch runs supports workflow filter (1748ms) + ✓ engine invokes a registered event hook for lifecycle events (13803ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 33104ms +============================================================ + +All tests passed! ✨ + +### dispatch-18.log + +============================================================ +Test Results +============================================================ + ✓ cli args parser enforces required flags (185ms) + ✓ request changes pause can be resumed to completion (15746ms) + ✓ show inspect and doctor json envelopes are consistent (1916ms) + ✓ newly created run is registered in the catalog index while running (556ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 18526ms +============================================================ + +All tests passed! ✨ + +### dispatch-19.log + +============================================================ +Test Results +============================================================ + ✓ step schema validation enforces input and output contracts (2955ms) + ✓ rejected approval ends workflow with failure (9787ms) + ✓ dispatch run tags persist and runs supports tags filter (2043ms) + ✓ dispatch CLI supports structured input, workflow-file, and plugin flags (28296ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 43188ms +============================================================ + +All tests passed! ✨ + +### dispatch-2.log + +============================================================ +Test Results +============================================================ + ✓ workflow template selection supports known and unknown IDs (289ms) + ✓ run locks are process-owned and remain on disk for crash recovery (506ms) + ✓ dispatch blocks oversized config files (5027ms) + ✓ long run stress fixture keeps traces bounded (23428ms) + ✓ final report metadata reflects the completed run (15064ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 44428ms +============================================================ + +All tests passed! ✨ + +### dispatch-20.log + +============================================================ +Test Results +============================================================ + ✓ step timeout and cancellation handling update run lifecycle (1439ms) + ✓ persisted artifacts redact sensitive values (675ms) + ✓ tool authorization policy supports deny and allow outcomes (1517ms) + ✓ run identifiers cannot escape the configured output root (196ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3936ms +============================================================ + +All tests passed! ✨ + +### dispatch-21.log + +============================================================ +Test Results +============================================================ + ✓ lifecycle hooks emit callback and webhook sink events (1044ms) + ✓ redaction preserves non-secret token metrics (190ms) + ✓ run export and import support round trip bundles (1340ms) + ✓ bundle import requires a valid state artifact (195ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2879ms +============================================================ + +All tests passed! ✨ + +### dispatch-22.log + +============================================================ +Test Results +============================================================ + ✓ doctor write persists repaired state changes (1048ms) + ✓ report artifacts redact sensitive fields (575ms) + ✓ signed bundle verification supports deterministic pass and fail paths (1388ms) + ✓ partial run indexes fall back to a complete state scan (817ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 3939ms +============================================================ + +All tests passed! ✨ + +### dispatch-23.log + +============================================================ +Test Results +============================================================ + ✓ load run state fails safely on malformed json (677ms) + ✓ output root validation blocks dangerous paths and allows safe relative roots (241ms) + ✓ cli negative path matrix returns deterministic errors (1101ms) + ✓ doctor does not mark pending steps completed from index alone (437ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2560ms +============================================================ + +All tests passed! ✨ + +### dispatch-24.log + +============================================================ +Test Results +============================================================ + ✓ dispatch runs rejects invalid numeric flags (450ms) + ✓ dispatch blocks unsafe output roots without opt in (493ms) + ✓ dispatch help usage snapshot remains compatible (994ms) + ✓ truncated trace payload previews redact sensitive values (251ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2286ms +============================================================ + +All tests passed! ✨ + +### dispatch-3.log + +============================================================ +Test Results +============================================================ + ✓ workflow template introspection exposes summary metadata (461ms) + ✓ load run state backfills missing contract schema metadata (512ms) + ✓ canonical source path helpers enforce root boundaries (177ms) + ✓ corruption matrix covers malformed and missing artifact scenarios (582ms) + ✓ persisted declarative workflow definitions can resume (3192ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 5048ms +============================================================ + +All tests passed! ✨ + +### dispatch-4.log + +============================================================ +Test Results +============================================================ + ✓ templates command supports text and json output (1458ms) + ✓ state repair can recover inconsistent running metadata (550ms) + ✓ doctor and cleanup persist mutation audit artifacts (2759ms) + ✓ optional tool step is skipped instead of failing the run when denied by policy (16381ms) + ✓ resume applies requested trace limits to persisted traces (11267ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 32572ms +============================================================ + +All tests passed! ✨ + +### dispatch-5.log + +============================================================ +Test Results +============================================================ + ✓ crud reliability workflow template runs with fixture tools (15260ms) + ✓ trace generation creates events and final status (180ms) + ✓ strict mutation mode blocks destructive commands unless confirmed (1982ms) + ✓ approval handoff template completes offline and avoids the flaky tool (6963ms) + ✓ resume decision rejects a mismatched approval decision id (5830ms) + +Tests: 5 total, 5 passed, 0 failed +Time: 30337ms +============================================================ + +All tests passed! ✨ + +### dispatch-6.log + +============================================================ +Test Results +============================================================ + ✓ tool registry registers and executes tools (172ms) + ✓ trace markdown includes event counts and timeline (167ms) + ✓ src import smoke fixture runs successfully (534ms) + ✓ workflow template registry exposes the approval handoff template (346ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 1304ms +============================================================ + +All tests passed! ✨ + +### dispatch-7.log + +============================================================ +Test Results +============================================================ + ✓ module-level source tool handler returns search results (177ms) + ✓ handoff creation includes required fields (144ms) + ✓ mutation audit rotation keeps active log bounded and rolls over (222ms) + ✓ webhook sink option appends lifecycle events as jsonl (7088ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 7710ms +============================================================ + +All tests passed! ✨ + +### dispatch-8.log + +============================================================ +Test Results +============================================================ + ✓ tool payload adapters support custom mapping (150ms) + ✓ agent registry dispatch executes mapped and custom handlers (270ms) + ✓ doctor incremental mode supports recent count and explicit run IDs (1461ms) + ✓ report title reflects the workflow name (159ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2116ms +============================================================ + +All tests passed! ✨ + +### dispatch-9.log + +============================================================ +Test Results +============================================================ + ✓ local source lookup blocks unsafe source ids (154ms) + ✓ agent registry dispatch reports unknown handler mapping (197ms) + ✓ run index is created and scanner fallback works when index is malformed (680ms) + ✓ signed bundle uses a cryptographic sha256 mac and rejects wrong keys (1092ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 2206ms +============================================================ + +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-resource-accounting/tests/tmp/effect-assurance-1790870338978/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-S9AjYI","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-BlRqpm","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:28cb6c322842596cb63fb0f154434b7e867a4544932ab9f1d37a1a1b254c23cf","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:51e056f8e0a51495f954212cca7a0fe8df2cfd55387e78fa35eea52b1b0224e8","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:29cfa410c59d66690517812e685e1cc0790a84e87d7a84f670fddac27c6922e8","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:28cb6c322842596cb63fb0f154434b7e867a4544932ab9f1d37a1a1b254c23cf","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:51e056f8e0a51495f954212cca7a0fe8df2cfd55387e78fa35eea52b1b0224e8","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:29cfa410c59d66690517812e685e1cc0790a84e87d7a84f670fddac27c6922e8","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:28cb6c322842596cb63fb0f154434b7e867a4544932ab9f1d37a1a1b254c23cf","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:51e056f8e0a51495f954212cca7a0fe8df2cfd55387e78fa35eea52b1b0224e8","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:29cfa410c59d66690517812e685e1cc0790a84e87d7a84f670fddac27c6922e8","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 (2371ms) + ✓ execution failure enters review without running descendants or retrying effects (1379ms) + ✓ execution failure with no matching policy stops by default (983ms) + ✓ evaluator crash maps to error review without declaring a quality failure (1341ms) + ✓ a passed evaluation continues through the same neutral policy path (1681ms) + ✓ accepting a failed action continues without replaying its effect (2320ms) + +Tests: 6 total, 6 passed, 0 failed +Time: 10224ms +============================================================ + +All tests passed! ✨ + +### failure_gate_safety.log + +============================================================ +Test Results +============================================================ + ✓ submitted idempotency key does not authorize replay (93ms) + ✓ observed unknown partial effects override a pure configuration (90ms) + ✓ sink enforced idempotency needs an evidence reference (95ms) + ✓ destroyed workspace cannot be retried in place (107ms) + ✓ retained filesystem permits a declared same workspace adapter (106ms) + ✓ an evaluator decision cannot target an unrelated action (98ms) + ✓ terminal states reject continuation (161ms) + ✓ evaluation crash is indeterminate rather than failed quality (101ms) + ✓ negative checks and unknown contract versions fail closed (102ms) + ✓ policy outcome is producer neutral and deterministic (360ms) + ✓ evidence cannot promote itself to policy authority (111ms) + ✓ journal detects orphan append and tampered history (172ms) + ✓ expired preservation cannot authorize same workspace replay (110ms) + ✓ null idempotency metadata is not enforcement evidence (91ms) + ✓ continuation source cannot contradict its action (109ms) + ✓ tampered control history is detected even when JSON is valid (142ms) + ✓ an atomic event beyond an absent journal requires recovery (99ms) + ✓ review requests explain unavailable replay without granting new actions (122ms) + ✓ policy action availability work is bounded and duplicate actions reject (170ms) + ✓ compensation metadata does not prove external reversal or admit replay (90ms) + +Tests: 20 total, 20 passed, 0 failed +Time: 2741ms +============================================================ + +All tests passed! ✨ + +### git_participant_after.log +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/tmp/git-participant-1790869973764","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":"a08f6e9bf8897cbc32a6ac505ab6e219b60801c3ecf1a152bd7b5940093304f6","fallback":"deny","mode":"required","policy_sha256":"282092f3f0ee3b4ed58044a1f569e1b68a8938c9efe02d378140744934e46374","profile":"workcell.git-cas","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"}} + +### git_participant_before.log +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/tmp/git-participant-1790870019254","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":"3c65b3fed90e1ab99e1c819cfd5ee4a50a9fec26175c5288180979d6f290458e","fallback":"deny","mode":"required","policy_sha256":"104e8efbb72aed493e1936c8e1f30a14df0b5fb31f410487bf4efbfeca9316b4","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-TX7077"} + +### 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-gyI5Jy"} + +### 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-UngA3q","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-4pardd"} + +### 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-FM4rvC"} + +### graph_attempt_smoke.log +{"ok":true,"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-DNV6VN","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 (475ms) + ✓ workflow loader rejects non-object steps with structured errors (132ms) + ✓ webhook sink appends preserve exact existing JSONL framing (110ms) + ✓ exhausted model token envelope blocks the next model round (96ms) + ✓ streaming rejects step ids that escape the run directory (90ms) + ✓ redaction preserves nested shapes and leaves the original data untouched (108ms) + ✓ library run creation rejects forbidden output roots before writing (164ms) + ✓ unrouted built-in agents propagate live model failures (118ms) + +Tests: 8 total, 8 passed, 0 failed +Time: 1384ms +============================================================ + +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-MyHzOZ/heterogeneous-success","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-MyHzOZ/evaluation-failure","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-MyHzOZ/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-62Axyk"} + +### heterogeneous_vectors.log +{"checker":"kujo","ok":true,"vectors":7} + +### http_application_error.log +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/tmp/http-ability-1790870126465","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":"5cbfea9b3437e325a004e57be1e7185a8406e6db6999768d51c6c80bec91760d","fallback":"deny","mode":"required","policy_sha256":"ed510bfb0dc3074632c13fcbc5189460366ef6f5fc930c55fb61ccdecbbcbf9c","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-resource-accounting/tests/tmp/http-ability-1790870062005","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":"634cbdbd0a94fb1fe35cd75ca5fbdb17b64a40986d8b403c9e5271230c5672dd","fallback":"deny","mode":"required","policy_sha256":"0ac27acdc3b6d8815f439dacbcf1348386f01af56965ec688876e893b31f17e7","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-resource-accounting/tests/tmp/http-ability-1790870095623","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":"9a0c6a5b4f30c8dc32ba2ba0ac667870b0f771bc1eed0f294d77e46a6fcec245","fallback":"deny","mode":"required","policy_sha256":"ab2a5d278ba6d3d4f8b3e5859d382ffab3496d0c0e17f13f5d226eab6158b620","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-resource-accounting/tests/tmp/mcp-ability-1790870166190","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":"249d33ceee8b04c46cee3dc8df1b80507e8035a82415281504e0aef4f38c959c","fallback":"deny","mode":"required","policy_sha256":"aa5114128e293980d4f39e115d69fb76d97f7ea3d6c7369d9b72fe48513f1346","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"ca1ce6a4d3140dfb56e9280d1887891f4be1192979180a70ce83676d29e4ce85","second_result_sha256":"2f4408f91e7bedfde0585d4f2562026d95f972500df973799ddbefcf9abb577d"} + +### mcp_stdio_loss.log +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/tmp/mcp-ability-1790870201250","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":"e4b30b16bbe0411af9d5ec2bc5c8b013af69a2f00b97a7306183e2e3a15d5781","fallback":"deny","mode":"required","policy_sha256":"f82ab96c21e7087c6c24c6bf2d7186c49503c9b51d5d902d671da89fb1d60206","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"2aa7b9070a0430c56b3f52b039fd6cdb2f6cb34819227aa55d5beba2efbd830d","second_result_sha256":"87aef78c7e39713ca3eb5e820c092c9f1159b0fd19cd2f352c75665ba61113f0"} + +### node_composition.log +ROOT /var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-ovZQYo/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-ovZQYo","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-x2JuGP","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-nmXdVw","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 (191ms) + ✓ retry backoff fails closed when it would cross the execution deadline (147ms) + ✓ unbounded custom tools are rejected before hard-deadline execution (715ms) + ✓ webhook delivery accepts only 2xx responses (166ms) + ✓ network callbacks require exact HTTPS allowlists and signing (168ms) + ✓ workflow loader validates budgets and bounded parallel controls (226ms) + ✓ workflow max steps budget fails closed before the next step (886ms) + ✓ webhook outbox summarizes latest durable delivery state (150ms) + ✓ OpenTelemetry artifact is valid OTLP JSON with correlated ids (144ms) + +Tests: 9 total, 9 passed, 0 failed +Time: 2965ms +============================================================ + +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-xM91UE","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-resource-accounting/tests/tmp/persisted-negotiation-1790869675995","proofs":[{"scenario":"required-fresh-controller-weaker-default","ok":true,"revision":"88deb119164fd54516dcf931e686f24d3538420a0384266ca26c4e3463946f00"},{"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-resource-accounting/tests/tmp/persisted-adapters-1790869916782","proofs":[{"family":"sqlite","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"6bfbbf66e8d03980d363b63986ef6778be2d60cdcb645c9587b518704d45c93a"},{"family":"git","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"95fac0e132517a8741ecbc628778d2c50c959139ca2debbe69512f47256f3e13"},{"family":"ability","required":true,"fresh_controller":true,"checkpoint":true,"descendant":true,"logical_effects":1,"config_revision":"4d2e0641924119e2ee04b400d271dd26d823b9a9ea03815b5e807df233226ec5"}],"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 (13844ms) + ✓ policy precedence uses config profile when cli is absent (12288ms) + ✓ policy and config controls honor cli over config over env (2847ms) + +Tests: 3 total, 3 passed, 0 failed +Time: 29011ms +============================================================ + +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-oxRp2r","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-resource-accounting/tests/tmp/python-1790869426572680000", "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-resource-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 1.347s + +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.534s + +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 + +### resource_contracts.log +{"checks":17,"ok":true} + +### resource_integration.log +PASS Eval output and reservation do not authorize terminal completion or execution +PASS terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program +PASS Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked +PASS real isolated evaluator runtime report retained with process scope and exact digest +PASS actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate +PASS duplicate accounting cannot add usage twice; corrupt retained measurement fails closed +{"ok":true,"checks":6,"proofs":["Eval output and reservation do not authorize terminal completion or execution","terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program","Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked","real isolated evaluator runtime report retained with process scope and exact digest","actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate","duplicate accounting cannot add usage twice; corrupt retained measurement fails closed"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-IBwhxc"} + +### resource_limits.log +{"checks":3,"ok":true} + +### resource_policy.log +PASS fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization +PASS mixed program/Eval plan is atomic, over-capacity plan reserves nothing, subgraph receipt grants no extra units +PASS missing provider usage blocks ordinary program progression and explicit planning without inventing zero +PASS source changes invalidate an observation candidate; exact provider-sourced facts allow later reservation +{"ok":true,"checks":4,"proofs":["fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization","mixed program/Eval plan is atomic, over-capacity plan reserves nothing, subgraph receipt grants no extra units","missing provider usage blocks ordinary program progression and explicit planning without inventing zero","source changes invalidate an observation candidate; exact provider-sourced facts allow later reservation"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-2j3J9q"} + +### resource_recovery.log +PASS fresh controllers cannot oversubscribe final program slot through resource plans +PASS fresh controllers race for last Eval slot with exact source/revision-bound plans +PASS two fresh releases publish one historical release without double refund +PASS same future Eval reservation publishes once under contention +PASS crash after committed reservation permits explicit release only before dispatch +PASS Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected +PASS immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization +PASS orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered +PASS fresh selected-branch contenders cannot share final capacity or reserve inactive work +{"ok":true,"checks":9,"proofs":["fresh controllers cannot oversubscribe final program slot through resource plans","fresh controllers race for last Eval slot with exact source/revision-bound plans","two fresh releases publish one historical release without double refund","same future Eval reservation publishes once under contention","crash after committed reservation permits explicit release only before dispatch","Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected","immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization","orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered","fresh selected-branch contenders cannot share final capacity or reserve inactive work"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-HX6T64"} + +### 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-EJpSwn"} + +### retrieval_preferences.log + +============================================================ +Test Results +============================================================ + ✓ step run and workflow preference precedence preserves explicit clearing (147ms) + ✓ loaded workflow delivers run preference to tool and preserves it through disk reload (1235ms) + ✓ retry and approval resume preserve run selection and a later explicit clear (2525ms) + +Tests: 3 total, 3 passed, 0 failed +Time: 3971ms +============================================================ + +All tests passed! ✨ + +### review_checkpoint.log + +============================================================ +Test Results +============================================================ + ✓ checkpoint publication is immutable repeatable and leaves authority unchanged (1666ms) + ✓ missing or altered checkpoint bytes never authorize continuation (1667ms) + ✓ checkpoint refuses changed revision or in-flight work (1770ms) + ✓ orphan and torn journal prohibit checkpoint publication (2477ms) + +Tests: 4 total, 4 passed, 0 failed +Time: 7671ms +============================================================ + +All tests passed! ✨ + +### routing.log + +============================================================ +Test Results +============================================================ + ✓ legacy static routing preserves requested agent model (167ms) + ✓ quality first routing applies capability and quality floor (241ms) + ✓ provider cost latency tool and schema constraints reject incompatible routes (361ms) + ✓ deterministic tie break and decision id ignore candidate declaration order (293ms) + ✓ agent substitution requires execution compatibility (216ms) + ✓ no route error includes candidate evaluations (171ms) + ✓ effective agent clone changes model without mutating source (137ms) + ✓ deterministic evaluation supports accepted and configured failure outcomes (189ms) + ✓ failure classifier separates retry fallback and terminal failures (145ms) + ✓ runner persists route before execution and records explicit fallback (1706ms) + ✓ plugin style compatible agent participates in deterministic selection (220ms) + ✓ context reliability risk and output schema constraints are hard filters (205ms) + ✓ routing rejects unknown constrained risk incompatible schemas and unsupported policy modes (233ms) + ✓ cost latency and balanced objectives produce deterministic distinct choices (594ms) + ✓ AI SDK catalog metadata is authoritative over agent candidate claims (163ms) + ✓ upgrade and reroute overrides enforce their distinct semantics (368ms) + ✓ runner records same-route retry separately from fallback (1341ms) + ✓ persisted decision is reused and sensitive route fields are redacted (2097ms) + ✓ declarative loader preserves workflow agent and step routing contracts (207ms) + ✓ model catalog references reject absolute and traversal paths by default (155ms) + ✓ narrower policy layers cannot weaken broader routing constraints (170ms) + ✓ strict routing validation rejects unknown fields and providers (155ms) + ✓ generic model handler executes a declarative routed agent (1288ms) + ✓ cost-bounded live routes reject missing authoritative pricing (1106ms) + ✓ cost budgets reserve growing context when output pricing is explicitly zero (1138ms) + ✓ generic model handler executes only model-requested tools with bounded idempotent replay (200ms) + ✓ generic model handler fails closed when tool authorization denies a request (190ms) + ✓ built-in deterministic agent handlers enforce tool authorization (145ms) + ✓ generic model handler decrements the total token envelope across rounds (163ms) + ✓ generic model handler persists incremental stream events (171ms) + ✓ route evaluation pauses for native human review and resumes stored output (1727ms) + +Tests: 31 total, 31 passed, 0 failed +Time: 16269ms +============================================================ + +All tests passed! ✨ + +### sdk_ability.log +{"root":"/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/tmp/sdk-ability-1790870227545","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":"4d11670ea2709e311eeaef063390f472c3060b9d6fa04286c9db4627cccfb774","fallback":"deny","mode":"required","policy_sha256":"3cc2fcffc2e144df12162d494636684bcf373ea4017bd89864431c4ea9c8adb1","profile":"ability.application-gateway","profile_version":"1beta1","schema":"dispatch.assurance-negotiation/v1beta1"},"first_result_sha256":"8af80cc1ec2372dcd23fdf32119db1948fc9b0e49c1a885c675a8e9f8f84e70e","second_result_sha256":"0501787c8257517f37c4ce7102613cb2bcead72553fae5b60742c69d88954c90"} + +### sdk_adapter.log + +============================================================ +Test Results +============================================================ + ✓ custom providers cannot select arbitrary process secret variables (11ms) + ✓ parse json from output supports trailing json line (7ms) + ✓ parse error details are redacted by default (7ms) + ✓ parse error details include raw output when debug enabled (7ms) + ✓ execution error message redacts stderr by default (6ms) + ✓ execution error message includes stderr when debug enabled (7ms) + ✓ bridge spawn command is direct argv without shell wrapper (6ms) + ✓ bridge timeout is configurable with a safe default (8ms) + ✓ bridge payload carries route provenance and structured output policy (16ms) + ✓ offline fixture model calls return in process without bridge execution (8ms) + +Tests: 10 total, 10 passed, 0 failed +Time: 95ms +============================================================ + +All tests passed! ✨ + +### sequential_effects.log +{"ok":true,"roots":["/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-ZOFJYf","/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/sequential-effects-eqCkE2"],"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 (643ms) + +Tests: 1 total, 1 passed, 0 failed +Time: 650ms +============================================================ + +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-SvMh9j"} + +### 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-resource-accounting/tests/tmp/typescript-1790869498509","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-resource-accounting/tests/tmp/typescript-1790869546402","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 (11.367501ms) +✔ deny run_id (0.830521ms) +✔ deny step_id (0.497818ms) +✔ deny attempt_id (0.552026ms) +✔ deny effect_id (0.745808ms) +✔ deny execution_result_ref (0.856705ms) +✔ deny assurance_ref (0.734978ms) +✔ deny swapped refs (0.671452ms) +✔ deny malformed ref ../../secret (0.505719ms) +✔ deny malformed ref https://example.invalid (0.642591ms) +✔ deny malformed ref sha256:ZZ (0.555226ms) +✔ deny namespace (0.50282ms) +✔ deny invocation_id (1.323482ms) +✔ deny bad identifier (1.198779ms) +✔ deny bad identifier (0.674613ms) +✔ deny missing extension (0.360512ms) +✔ deny unknown extension (0.542296ms) +✔ deny duplicate extensions (0.552086ms) +✔ deny nested value (0.425488ms) +✔ deny oversize (0.529804ms) +✔ deny reported is not commit (0.360699ms) +✔ deny knowledge mismatch (0.507337ms) +✔ wire canonical identity rejects whitespace/reordering/duplicates/invalid UTF8 (1.35483ms) +✔ untrusted profile (0.28269ms) +✔ untrusted repo (0.150332ms) +✔ untrusted config_revision (0.115746ms) +✔ untrusted dispatch_run_id (0.108438ms) +✔ untrusted dispatch_step_id (0.108992ms) +✔ untrusted dispatch_attempt_id (0.12919ms) +✔ untrusted dispatch_effect_id (0.103467ms) +✔ untrusted assurance_ref (0.235617ms) +✔ untrusted trusted_root (0.112723ms) +✔ untrusted verifier (0.139191ms) +✔ untrusted principal (0.106842ms) +✔ standalone requires host, no fabricated authority (0.294393ms) +✔ extension identifier cannot contain newline call_id (0.445551ms) +✔ extension identifier cannot contain newline process_instance_id (0.4082ms) +✔ null effect extension is supported without fake effect facts (0.468019ms) +✔ closed shape rejects joined-key collisions and inherited members (0.259477ms) +✔ codec errors never echo malformed private input (0.619784ms) +✔ published portable vectors independently reproduced (11.076984ms) +✔ packaged assets retain exact published hashes (4.856181ms) +✔ independent package runs away from all ecosystem checkouts and rejects schema substitution (2328.113099ms) +✔ direct process without host cannot invent admission (359.320801ms) +{"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 (498.701375ms) +ℹ tests 45 +ℹ suites 0 +ℹ pass 45 +ℹ fail 0 +ℹ cancelled 0 +ℹ skipped 0 +ℹ todo 0 +ℹ duration_ms 3230.458939 diff --git a/docs/evidence/resource-accounting/ci-layout-fixed.json b/docs/evidence/resource-accounting/ci-layout-fixed.json new file mode 100644 index 0000000..8bf4738 --- /dev/null +++ b/docs/evidence/resource-accounting/ci-layout-fixed.json @@ -0,0 +1,9 @@ +{ + "baseline_reproduction": "ci-layout-reproduction.json", + "helper": "scripts/prepare_graph_fixture_layout.sh", + "module_exit": 0, + "module_output": "graph modules available\n", + "sdk_exit": 0, + "sdk_input_tokens": 41, + "scope": "Local exact CI alias layout with archived reviewed source pins; GitHub-hosted jobs not executed here." +} diff --git a/docs/evidence/resource-accounting/ci-layout-reproduction.json b/docs/evidence/resource-accounting/ci-layout-reproduction.json new file mode 100644 index 0000000..b65b72d --- /dev/null +++ b/docs/evidence/resource-accounting/ci-layout-reproduction.json @@ -0,0 +1,16 @@ +{ + "baseline": "b724f369ab4101a46ea0d5493cc41fc3d0fa3b9c", + "command": [ + "/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified", + "run", + "tests/parent_finalization_fixture.kujo", + "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/dispatch-ci-layout-M0ptSu/fixture", + "init" + ], + "cwd": "/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/dispatch-ci-layout-M0ptSu/dispatch", + "layout": ".ci/workcell exists; sibling workcell and Eval do not, matching declared CI checkout layout", + "exit": 4, + "stdout": "", + "stderr": "[KUJOVM001] [vm] Runtime Error: Module not found: workcell.src.evidence.preservation; Check that 'workcell.src.evidence.preservation' 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.\n --> 0:0\n = help: Check that the module exists as .kujo or as a dotted src/... path under the package root.\n\n", + "note": "Local reproduction of a pre-existing workflow prerequisite gap, not execution of GitHub Actions." +} diff --git a/docs/evidence/resource-accounting/ci-layout-tests.log b/docs/evidence/resource-accounting/ci-layout-tests.log new file mode 100644 index 0000000..4322527 --- /dev/null +++ b/docs/evidence/resource-accounting/ci-layout-tests.log @@ -0,0 +1,5 @@ +PASS complete layout and exact idempotent reuse +PASS tagged release layout uses the explicit source root +PASS existing checkout is preserved and rejected +PASS conflicting alias is preserved and rejected +PASS missing dependency source rejects diff --git a/docs/evidence/resource-accounting/ci-workflow-syntax.log b/docs/evidence/resource-accounting/ci-workflow-syntax.log new file mode 100644 index 0000000..0145d07 --- /dev/null +++ b/docs/evidence/resource-accounting/ci-workflow-syntax.log @@ -0,0 +1,2 @@ +PASS YAML parse: .github/workflows/ci-gate.yml +PASS YAML parse: .github/workflows/release-artifacts.yml diff --git a/docs/evidence/resource-accounting/commands.md b/docs/evidence/resource-accounting/commands.md new file mode 100644 index 0000000..79ac68e --- /dev/null +++ b/docs/evidence/resource-accounting/commands.md @@ -0,0 +1,54 @@ +# Validation commands + +All Dispatch commands run from dispatch-resource-accounting with +KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified +and DISPATCH_OFFLINE_FIXTURE=true. No live model provider is called. + +Baseline (before implementation): +- kujo-verified run tests/graph_attempt_contract_tests.kujo (19) +- kujo-verified run tests/static_policy_contract_tests.kujo (14) +- kujo-verified run tests/heterogeneous_contract_tests.kujo (10) +- kujo-verified run tests/node_contract_tests.kujo (12) +- node tests/graph_attempt_smoke.mjs (9) +- node tests/graph_attempt_policy.mjs (3) +- node tests/graph_attempt_authority.mjs (3) + +Focused final commands: +- kujo-verified run tests/resource_contract_tests.kujo +- kujo-verified run tests/resource_limits_tests.kujo +- node tests/resource_integration.mjs +- node tests/resource_policy.mjs +- node tests/resource_recovery.mjs + +Dependencies: +- npm --prefix interop/typescript-participant ci --ignore-scripts +- bash interop/python-participant/bootstrap.sh + +Canonical command: +- KUJO_BIN= DISPATCH_OFFLINE_FIXTURE=true bash scripts/run_release_gate.sh + +Kujo isolated docs checkout (source e65bb57): +- cargo fmt --check +- cargo build --release --locked +- cargo test --release --locked --test architecture_docs_contract --test workflow_control_contracts --test readme_contracts + +Development logs retain failures and corrections. Status is recorded separately; +listing a command here does not claim it passed. + +Additional prerequisite and correction checks: +- bash tests/ci_graph_layout_tests.sh (5 checks) +- Ruby YAML.load_file for .github/workflows/ci-gate.yml and .github/workflows/release-artifacts.yml +- node tests/static_policy_recovery.mjs (9 proof groups) +- node tests/node_composition_recovery.mjs (5 proof groups) +- node tests/graph_attempt_binding_safety.mjs (2 proof groups) +- node tests/graph_attempt_recovery.mjs (14 proof groups) +- node tests/heterogeneous_recovery.mjs (8 proof groups) + +The first canonical invocation failed at an isolated fixture-copy omission. The five +copy sites were corrected and all 38 focused proof groups passed before a complete +canonical restart. canonical-1.log and failed-canonical-1-suites.log preserve the +original failure; canonical-2.log is the independent full rerun. + +Dispatch canonical rerun source: 2577c60ff7ef79992f34b4627799f488cf5edcd6. +Kujo docs/build source: 51369e42b38efb4479af440c8370ac8a4fea3a7a. +Hosted GitHub Actions was not executed as part of these local checks. diff --git a/docs/evidence/resource-accounting/development.md b/docs/evidence/resource-accounting/development.md new file mode 100644 index 0000000..66496db --- /dev/null +++ b/docs/evidence/resource-accounting/development.md @@ -0,0 +1,66 @@ +# Development failures and corrections + +- Initial native resource unit fixture used nested index assignment. VM reported + `Stack underflow`; interpreter diagnosis was `Complex index assignment not yet + supported`. Rewrote the fixture using explicit dictionary copy/update. No runtime + edits. 17 checks then passed. +- `integration-1.log`: source inventory exceeded the historical 16-file verifier + bound (`assurance_verifier_invalid`). The new source-bound controller requires + 21 files. Raised only this bounded host manifest limit to 32; historical ordered + hashes remain unchanged. Dedicated 16/32/33-entry checks pass. +- `integration-2.log`: three real Eval proof groups passed, then source observation + rejected `resource_subject_not_consumed`. Array `contains` is not deep object + equality. Replaced with exact serialized subject comparison. +- First embedded runtime schema generation parsed u64 maximum through JavaScript + Number and produced an overflowing Kujo literal (18446744073709552000). Replaced + generation with unchanged JSON source bytes decoded at runtime. +- Native schema validation then rejected unsupported `maxProperties`; its supported + subset also lacks `uniqueItems`. Preserved original schema and enforced those two + constraints explicitly. The other constraints use the existing validator. +- `integration-4.log` was an accidental follow-on start after the native prerequisite + failed (shell did not yet use set -e). Stopped that development run explicitly; + it is interrupted, not a pass. Subsequent scripts use fail-fast shell handling. +- `integration-5.log`: all six resource/Eval/runtime/SDK proof groups passed after + corrections. Tests use offline provider-response fixtures through the real SDK + extraction surface; they do not claim live provider billing certification. + +- `policy-1.log`: subgraph plan was requested before the graph had observed its + producer terminal state. Existing readiness correctly rejected it. The proof now + places the evaluator before the program in static order, drives the existing DAG + to publish the predecessor and pause for Eval, then reserves both ready members. + No readiness rule was weakened. `policy-2` began before this correction. +- `policy-2.log` reproduced the same pre-observation readiness rejection while the + corrected third run was being prepared. Both failures are retained. +- `policy-3.log`: ordinary DAG drive intentionally continues past waiting Eval + nodes, so it had already reserved B. Duplicate reservation correctly rejected. + The proof now uses an existing authorized human prerequisite for B/E/F. Finalizing + that prerequisite makes them ready without dispatching them, allowing an explicit + mixed plan. No source scheduling change or test-only locking is introduced. + +- Source review found a pre-existing CI layout gap: the canonical parent/graph + fixtures require sibling Workcell/Eval repositories, but CI only provided + .ci/workcell and no Eval checkout. A baseline archive reproduced missing-module + exit 4. CI now provisions exact graph-fixture pins and guarded sibling aliases. + The first reproduction archive exceeded Node default maxBuffer; reran using + git archive --output, retaining the actual diagnostic separately. +- The first fixed-layout probe used symlinks to repositories outside its temporary + module search root and was correctly rejected by Kujo import containment. Replaced + those test sources with exact git archives inside the CI checkout layout; Workcell, + Eval and real SDK usage extraction then passed. Guarded alias tests also pass. +- A maintenance edit initially put a GitHub expression inside a JavaScript template + literal without escaping it; Node rejected the script before any edit. Rewrote + the insertion as literal lines, reran five layout checks and parsed both YAML + workflows. No failed maintenance command is treated as a passing test. +- The expanded serial canonical gate now includes 111 suite groups and real process + crash proofs. CI previously limited that step to 45 minutes. Increased only the + validation workflow deadline (300-minute gate, 360-minute jobs); graph/resource + ceilings are unchanged. Hosted elapsed time is not certified by local validation. +- Final focused runs passed: integration-7 (6 groups, including live evaluator + configuration and final operator-revocation rejection), policy-4 (4 groups), + recovery-2 (9 groups), and 20 native resource/manifest assertions. Canonical + verification uses the committed final tests, including both precomputed contenders. +- `canonical-1.log` stopped at static_policy_recovery: isolated controller copies + omitted the newly source-bound resource_eval_worker.kujo. Corrected all five + existing node-fixture copy sites. This changes test dependency packaging, not + production authority. The failed canonical run and every completed suite log are + retained; a complete rerun is required. diff --git a/docs/evidence/resource-accounting/failed-canonical-1-suites.log b/docs/evidence/resource-accounting/failed-canonical-1-suites.log new file mode 100644 index 0000000..6708b10 --- /dev/null +++ b/docs/evidence/resource-accounting/failed-canonical-1-suites.log @@ -0,0 +1,131 @@ +### 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-2rYG1w","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 +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: read_file_beneath[target_open_failed]: cannot open target 'tests/resource_eval_worker.kujo': No such file or directory (os error 2) + --> 0:0 + +Call stack: + 0 at descriptor + + + +4 !== 0 + + at command (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:12:149) + at run (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:14:205) + at setup (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:16:1287) + at branchRun (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/static_policy_recovery.mjs:10:102) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/static_policy_recovery.mjs:11: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 + +### 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/resource-accounting/fixed-graph_attempt_binding_safety.log b/docs/evidence/resource-accounting/fixed-graph_attempt_binding_safety.log new file mode 100644 index 0000000..c88809a --- /dev/null +++ b/docs/evidence/resource-accounting/fixed-graph_attempt_binding_safety.log @@ -0,0 +1,3 @@ +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-kv3swk"} diff --git a/docs/evidence/resource-accounting/fixed-graph_attempt_recovery.log b/docs/evidence/resource-accounting/fixed-graph_attempt_recovery.log new file mode 100644 index 0000000..8515bb0 --- /dev/null +++ b/docs/evidence/resource-accounting/fixed-graph_attempt_recovery.log @@ -0,0 +1,15 @@ +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-T5eS33"} diff --git a/docs/evidence/resource-accounting/fixed-heterogeneous_recovery.log b/docs/evidence/resource-accounting/fixed-heterogeneous_recovery.log new file mode 100644 index 0000000..2e0a460 --- /dev/null +++ b/docs/evidence/resource-accounting/fixed-heterogeneous_recovery.log @@ -0,0 +1,9 @@ +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-1lYuRQ"} diff --git a/docs/evidence/resource-accounting/fixed-node_composition_recovery.log b/docs/evidence/resource-accounting/fixed-node_composition_recovery.log new file mode 100644 index 0000000..9033fa7 --- /dev/null +++ b/docs/evidence/resource-accounting/fixed-node_composition_recovery.log @@ -0,0 +1,7 @@ +{"contention":[{"ok":false,"reason":"run_lock_timeout"},{"ok":true,"reason":"node_requires_independent_finalization"}],"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-ChMoHd","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"]} diff --git a/docs/evidence/resource-accounting/fixed-static_policy_recovery.log b/docs/evidence/resource-accounting/fixed-static_policy_recovery.log new file mode 100644 index 0000000..2019997 --- /dev/null +++ b/docs/evidence/resource-accounting/fixed-static_policy_recovery.log @@ -0,0 +1,10 @@ +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-tBAfRg"} diff --git a/docs/evidence/resource-accounting/hosted-artifact-failure.txt b/docs/evidence/resource-accounting/hosted-artifact-failure.txt new file mode 100644 index 0000000..4d3bebf --- /dev/null +++ b/docs/evidence/resource-accounting/hosted-artifact-failure.txt @@ -0,0 +1,39 @@ +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5321039Z ##[group]Run bash .github/scripts/check-kujo-tool-artifacts.sh +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5323167Z bash .github/scripts/check-kujo-tool-artifacts.sh +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5602852Z shell: /usr/bin/bash -e {0} +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5604107Z env: +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5605218Z BASE_SHA: b724f369ab4101a46ea0d5493cc41fc3d0fa3b9c +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5606905Z HEAD_SHA: 2fed0fc195e0b22071743bb4b0b4f1e978e44949 +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.5608389Z ##[endgroup] +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8701952Z [tool-artifacts] ERROR: pushed commits contain ignored Kujo tool artifacts +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8707237Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/baseline.log (.gitignore:136:*.log docs/evidence/resource-accounting/baseline.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8712387Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/canonical-1.log (.gitignore:136:*.log docs/evidence/resource-accounting/canonical-1.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8717314Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/canonical-2.log (.gitignore:136:*.log docs/evidence/resource-accounting/canonical-2.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8722682Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/ci-layout-tests.log (.gitignore:136:*.log docs/evidence/resource-accounting/ci-layout-tests.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8730352Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/ci-workflow-syntax.log (.gitignore:136:*.log docs/evidence/resource-accounting/ci-workflow-syntax.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8736069Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/failed-canonical-1-suites.log (.gitignore:136:*.log docs/evidence/resource-accounting/failed-canonical-1-suites.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8742423Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/fixed-graph_attempt_binding_safety.log (.gitignore:136:*.log docs/evidence/resource-accounting/fixed-graph_attempt_binding_safety.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8748515Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/fixed-graph_attempt_recovery.log (.gitignore:136:*.log docs/evidence/resource-accounting/fixed-graph_attempt_recovery.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8754633Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/fixed-heterogeneous_recovery.log (.gitignore:136:*.log docs/evidence/resource-accounting/fixed-heterogeneous_recovery.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8760864Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/fixed-node_composition_recovery.log (.gitignore:136:*.log docs/evidence/resource-accounting/fixed-node_composition_recovery.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8767239Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/fixed-static_policy_recovery.log (.gitignore:136:*.log docs/evidence/resource-accounting/fixed-static_policy_recovery.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8772894Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-1.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-1.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8777793Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-2.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-2.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8782914Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-3.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-3.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8787696Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-4.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-4.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8792664Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-5.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-5.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8797396Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-6.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-6.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8802401Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/integration-7.log (.gitignore:136:*.log docs/evidence/resource-accounting/integration-7.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8807254Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/kujo-build.log (.gitignore:136:*.log docs/evidence/resource-accounting/kujo-build.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8812250Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/kujo-contracts.log (.gitignore:136:*.log docs/evidence/resource-accounting/kujo-contracts.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8817063Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/kujo-fmt-final.log (.gitignore:136:*.log docs/evidence/resource-accounting/kujo-fmt-final.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8821822Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/kujo-fmt.log (.gitignore:136:*.log docs/evidence/resource-accounting/kujo-fmt.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8826218Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/policy-1.log (.gitignore:136:*.log docs/evidence/resource-accounting/policy-1.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8830830Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/policy-2.log (.gitignore:136:*.log docs/evidence/resource-accounting/policy-2.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8835197Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/policy-3.log (.gitignore:136:*.log docs/evidence/resource-accounting/policy-3.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8839729Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/policy-4.log (.gitignore:136:*.log docs/evidence/resource-accounting/policy-4.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8844207Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/python-install.log (.gitignore:136:*.log docs/evidence/resource-accounting/python-install.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8848870Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/recovery-1.log (.gitignore:136:*.log docs/evidence/resource-accounting/recovery-1.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8853256Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/recovery-2.log (.gitignore:136:*.log docs/evidence/resource-accounting/recovery-2.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8857831Z [tool-artifacts] Artifact path: docs/evidence/resource-accounting/typescript-install.log (.gitignore:136:*.log docs/evidence/resource-accounting/typescript-install.log) +tool-artifacts Verify ignore coverage and pushed commits 2026-10-01T16:17:28.8873756Z ##[error]Process completed with exit code 1. diff --git a/docs/evidence/resource-accounting/hosted-kujo-clippy-excerpt.txt b/docs/evidence/resource-accounting/hosted-kujo-clippy-excerpt.txt new file mode 100644 index 0000000..ae9fdae --- /dev/null +++ b/docs/evidence/resource-accounting/hosted-kujo-clippy-excerpt.txt @@ -0,0 +1,11 @@ +2026-10-01T16:17:38.7803327Z stable-x86_64-unknown-linux-gnu updated - rustc 1.99.0 (b940084d7 2026-09-28) (from rustc 1.98.1 (48a229cea 2026-09-01)) +2026-10-01T16:17:38.8167502Z stable-x86_64-unknown-linux-gnu unchanged - rustc 1.99.0 (b940084d7 2026-09-28) +2026-10-01T16:17:38.9725315Z rustc 1.99.0 (b940084d7 2026-09-28) +2026-10-01T16:20:11.8274068Z error: use of deprecated method `std::sync::atomic::Atomic::::fetch_update`: renamed to `try_update` for consistency +2026-10-01T16:20:11.8275187Z --> src/benchmarks/runtime_measurements.rs:73:53 +2026-10-01T16:20:12.7080650Z error: use of deprecated method `std::sync::atomic::Atomic::::fetch_update`: renamed to `try_update` for consistency +2026-10-01T16:20:12.7084528Z --> src/interpreter/native_functions/pdf.rs:39:10 +2026-10-01T16:20:12.9297883Z error: use of deprecated method `std::sync::atomic::Atomic::::fetch_update`: renamed to `try_update` for consistency +2026-10-01T16:20:12.9298766Z --> src/interpreter/tasks.rs:72:10 +2026-10-01T16:20:16.6368921Z error: could not compile `kujolang` (lib) due to 3 previous errors +2026-10-01T16:20:18.8131795Z error: could not compile `kujolang` (lib test) due to 3 previous errors diff --git a/docs/evidence/resource-accounting/hosted-kujo-release-failure.txt b/docs/evidence/resource-accounting/hosted-kujo-release-failure.txt new file mode 100644 index 0000000..9f3a372 --- /dev/null +++ b/docs/evidence/resource-accounting/hosted-kujo-release-failure.txt @@ -0,0 +1,8 @@ +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.7982010Z ##[group]Run bash .github/scripts/check-release-state.sh +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.7982636Z bash .github/scripts/check-release-state.sh +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8159119Z shell: /usr/bin/bash -e {0} +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8159582Z ##[endgroup] +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8305002Z [release-state] README.md matches Cargo.toml version: 1.7.0 +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8346355Z [release-state] ERROR: README.md does not identify latest stable tag v1.7.0 +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8347242Z [release-state] Expected to find: latest published stable release tag is `v1.7.0` +release-state Validate Cargo and release-status docs consistency 2026-10-01T16:17:21.8358044Z ##[error]Process completed with exit code 1. diff --git a/docs/evidence/resource-accounting/integration-1.log b/docs/evidence/resource-accounting/integration-1.log new file mode 100644 index 0000000..0d31197 --- /dev/null +++ b/docs/evidence/resource-accounting/integration-1.log @@ -0,0 +1,30 @@ +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: assurance_verifier_invalid + --> 0:0 + +Call stack: + 0 at descriptor + + + +4 !== 0 + + at command (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:12:149) + at run (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:14:205) + at setup (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:16:1287) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_integration.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 diff --git a/docs/evidence/resource-accounting/integration-2.log b/docs/evidence/resource-accounting/integration-2.log new file mode 100644 index 0000000..ab53d5b --- /dev/null +++ b/docs/evidence/resource-accounting/integration-2.log @@ -0,0 +1,25 @@ +PASS Eval output and reservation do not authorize terminal completion or execution +PASS terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program +PASS Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","ok":false,"reason":"Error { line: 0, message: resource_subject_not_consumed, stack: [, inspect_action, need] }"} + +false !== true + + at rapply (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_helpers.mjs:5:90) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_integration.mjs:11:24 + 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 diff --git a/docs/evidence/resource-accounting/integration-3.log b/docs/evidence/resource-accounting/integration-3.log new file mode 100644 index 0000000..4042b96 --- /dev/null +++ b/docs/evidence/resource-accounting/integration-3.log @@ -0,0 +1,27 @@ +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: [KUJOVM001] [vm] Runtime Error: Failed to evaluate module 'src.core.resource_operation': Failed to evaluate module 'src.core.resource_ledger': Failed to evaluate module 'src.core.resource_facts': Failed to tokenize module 'src.core.runtime_resource_schema': 3:710: Numeric literal overflow: 18446744073709552000 + --> 0:0 + + + +4 !== 0 + + at command (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:12:149) + at run (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:14:205) + at setup (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/node_composition_helpers.mjs:16:1287) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_integration.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 diff --git a/docs/evidence/resource-accounting/integration-4.log b/docs/evidence/resource-accounting/integration-4.log new file mode 100644 index 0000000..e69de29 diff --git a/docs/evidence/resource-accounting/integration-5.log b/docs/evidence/resource-accounting/integration-5.log new file mode 100644 index 0000000..c5236e3 --- /dev/null +++ b/docs/evidence/resource-accounting/integration-5.log @@ -0,0 +1,7 @@ +PASS Eval output and reservation do not authorize terminal completion or execution +PASS terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program +PASS Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked +PASS real isolated evaluator runtime report retained with process scope and exact digest +PASS actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate +PASS duplicate accounting cannot add usage twice; corrupt retained measurement fails closed +{"ok":true,"checks":6,"proofs":["Eval output and reservation do not authorize terminal completion or execution","terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program","Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked","real isolated evaluator runtime report retained with process scope and exact digest","actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate","duplicate accounting cannot add usage twice; corrupt retained measurement fails closed"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-leHs1I"} diff --git a/docs/evidence/resource-accounting/integration-6.log b/docs/evidence/resource-accounting/integration-6.log new file mode 100644 index 0000000..cac0673 --- /dev/null +++ b/docs/evidence/resource-accounting/integration-6.log @@ -0,0 +1,7 @@ +PASS Eval output and reservation do not authorize terminal completion or execution +PASS terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program +PASS Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked +PASS real isolated evaluator runtime report retained with process scope and exact digest +PASS actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate +PASS duplicate accounting cannot add usage twice; corrupt retained measurement fails closed +{"ok":true,"checks":6,"proofs":["Eval output and reservation do not authorize terminal completion or execution","terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program","Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked","real isolated evaluator runtime report retained with process scope and exact digest","actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate","duplicate accounting cannot add usage twice; corrupt retained measurement fails closed"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-Wo8I20"} diff --git a/docs/evidence/resource-accounting/integration-7.log b/docs/evidence/resource-accounting/integration-7.log new file mode 100644 index 0000000..dceaaa1 --- /dev/null +++ b/docs/evidence/resource-accounting/integration-7.log @@ -0,0 +1,7 @@ +PASS Eval output and reservation do not authorize terminal completion or execution +PASS terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program +PASS Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked +PASS real isolated evaluator runtime report retained with process scope and exact digest +PASS actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate +PASS duplicate accounting cannot add usage twice; corrupt retained measurement fails closed +{"ok":true,"checks":6,"proofs":["Eval output and reservation do not authorize terminal completion or execution","terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program","Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked","real isolated evaluator runtime report retained with process scope and exact digest","actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate","duplicate accounting cannot add usage twice; corrupt retained measurement fails closed"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-NC6Bl3"} diff --git a/docs/evidence/resource-accounting/kujo-build-artifact.json b/docs/evidence/resource-accounting/kujo-build-artifact.json new file mode 100644 index 0000000..667e2cf --- /dev/null +++ b/docs/evidence/resource-accounting/kujo-build-artifact.json @@ -0,0 +1,9 @@ +{ + "source_commit": "51369e42b38efb4479af440c8370ac8a4fea3a7a", + "base": "e65bb57b39814daa1552762778d2b051fbcf7013", + "command": "cargo build --release --locked", + "exit": 0, + "binary_sha256": "e94323ac307a7fff1df0d081798e6a58b0ab6e6f1c77bd112bd13d641c090005", + "cargo_lock_sha256": "ddf95c41b0bbc82550a56ca5bc3576de8f79928a562eb17cdc7aad80297febf5", + "note": "Isolated current-main source plus documentation only. Dispatch canonical uses its retained compatible 1.6 binary, not concurrent primary artifacts." +} diff --git a/docs/evidence/resource-accounting/kujo-build.log b/docs/evidence/resource-accounting/kujo-build.log new file mode 100644 index 0000000..64120f1 --- /dev/null +++ b/docs/evidence/resource-accounting/kujo-build.log @@ -0,0 +1,500 @@ + Compiling proc-macro2 v1.0.107 + Compiling unicode-ident v1.0.24 + Compiling quote v1.0.47 + Compiling libc v0.2.189 + Compiling cfg-if v1.0.4 + Compiling serde v1.0.229 + Compiling serde_core v1.0.229 + Compiling version_check v0.9.5 + Compiling find-msvc-tools v0.1.11 + Compiling shlex v2.0.1 + Compiling bitflags v2.13.1 + Compiling typenum v1.20.1 + Compiling pkg-config v0.3.34 + Compiling memchr v2.8.3 + Compiling autocfg v1.5.1 + Compiling vcpkg v0.2.15 + Compiling portable-atomic v1.15.0 + Compiling log v0.4.34 + Compiling equivalent v1.0.2 + Compiling generic-array v0.14.7 + Compiling critical-section v1.2.0 + Compiling num-traits v0.2.19 + Compiling bytes v1.12.1 + Compiling foldhash v0.2.0 + Compiling allocator-api2 v0.2.21 + Compiling pin-project-lite v0.2.17 + Compiling rand_core v0.10.1 + Compiling getrandom v0.4.3 + Compiling core-foundation-sys v0.8.7 + Compiling zerocopy v0.8.56 + Compiling syn v3.0.4 + Compiling syn v2.0.119 + Compiling jobserver v0.1.35 + Compiling hashbrown v0.17.1 + Compiling futures-core v0.3.34 + Compiling once_cell v1.21.4 + Compiling stable_deref_trait v1.2.1 + Compiling simd-adler32 v0.3.10 + Compiling cc v1.4.4 + Compiling hybrid-array v0.4.14 + Compiling itoa v1.0.18 + Compiling futures-sink v0.3.34 + Compiling tinyvec_macros v0.1.1 + Compiling tinyvec v1.12.0 + Compiling adler2 v2.0.1 + Compiling getrandom v0.2.17 + Compiling socket2 v0.6.5 + Compiling rand_core v0.6.4 + Compiling mio v1.2.2 + Compiling getrandom v0.3.4 + Compiling slab v0.4.12 + Compiling crc32fast v1.5.1 + Compiling indexmap v2.14.1 + Compiling crypto-common v0.2.2 + Compiling futures-channel v0.3.34 + Compiling crypto-common v0.1.7 + Compiling cpufeatures v0.3.1 + Compiling subtle v2.6.1 + Compiling crossbeam-utils v0.8.22 + Compiling futures-io v0.3.34 + Compiling percent-encoding v2.3.2 + Compiling futures-task v0.3.34 + Compiling base64 v0.22.1 + Compiling miniz_oxide v0.9.1 + Compiling writeable v0.6.4 + Compiling litemap v0.8.3 + Compiling thiserror v2.0.20 + Compiling rustix v1.1.4 + Compiling parking_lot_core v0.9.12 + Compiling zlib-rs v0.6.7 + Compiling chacha20 v0.10.2 + Compiling errno v0.3.14 + Compiling libz-sys v1.1.29 + Compiling ahash v0.8.12 + Compiling icu_properties_data v2.3.0 + Compiling rustc-hash v2.1.3 + Compiling cmov v0.5.4 + Compiling scopeguard v1.2.0 + Compiling icu_normalizer_data v2.3.0 + Compiling utf8_iter v1.0.4 + Compiling siphasher v1.0.3 + Compiling lock_api v0.4.14 + Compiling rand v0.10.2 + Compiling ctutils v0.4.2 + Compiling block-buffer v0.12.1 + Compiling crossbeam-epoch v0.9.20 + Compiling byteorder v1.5.0 + Compiling fst v0.4.7 + Compiling const-oid v0.10.2 + Compiling block-buffer v0.10.4 + Compiling digest v0.11.3 + Compiling cranelift-isle v0.113.1 + Compiling cpufeatures v0.2.17 + Compiling semver v1.0.28 + Compiling digest v0.10.7 + Compiling openssl-src v300.6.1+3.6.3 + Compiling unicode-normalization v0.1.25 + Compiling tracing-core v0.1.36 + Compiling rustc_version v0.4.1 + Compiling proc-macro2-diagnostics v0.10.1 + Compiling unicode-bidi v0.3.18 + Compiling libm v0.2.16 + Compiling cranelift-codegen-shared v0.113.1 + Compiling pathfinder_simd v0.5.6 + Compiling openssl-sys v0.9.117 + Compiling cranelift-codegen-meta v0.113.1 + Compiling phf_shared v0.13.1 + Compiling tracing v0.1.44 + Compiling form_urlencoded v1.2.2 + Compiling http v1.5.0 + Compiling iana-time-zone v0.1.65 + Compiling target-lexicon v0.12.16 + Compiling unicode-properties v0.1.4 + Compiling bumpalo v3.20.3 + Compiling either v1.18.0 + Compiling crossbeam-deque v0.8.7 + Compiling zmij v1.0.23 + Compiling cranelift-bitset v0.113.1 + Compiling fastrand v2.5.0 + Compiling yansi v1.0.1 + Compiling cranelift-entity v0.113.1 + Compiling flate2 v1.1.10 + Compiling synstructure v0.13.2 + Compiling phf_generator v0.13.1 + Compiling stringprep v0.1.5 + Compiling chrono v0.4.45 + Compiling sha2 v0.11.0 + Compiling md-5 v0.11.0 + Compiling inout v0.1.4 + Compiling serde_derive v1.0.229 + Compiling tokio-macros v2.7.2 + Compiling zerovec-derive v0.11.6 + Compiling displaydoc v0.2.7 + Compiling zerocopy-derive v0.8.56 + Compiling zerofrom-derive v0.1.7 + Compiling yoke-derive v0.8.2 + Compiling tokio v1.53.1 + Compiling futures-macro v0.3.34 + Compiling zeroize_derive v1.5.0 + Compiling thiserror-impl v2.0.20 + Compiling zerofrom v0.1.8 + Compiling yoke v0.8.3 + Compiling zeroize v1.9.0 + Compiling cranelift-codegen v0.113.1 + Compiling block-padding v0.4.2 + Compiling futures-util v0.3.34 + Compiling zerovec v0.11.8 + Compiling zerotrie v0.2.5 + Compiling core-foundation v0.10.1 + Compiling security-framework-sys v2.17.0 + Compiling encoding_rs v0.8.35 + Compiling arbitrary v1.4.2 + Compiling num-conv v0.2.2 + Compiling unicode-joining-type v1.0.0 + Compiling powerfmt v0.2.0 + Compiling tinystr v0.8.4 + Compiling potential_utf v0.1.6 + Compiling icu_collections v2.3.0 + Compiling slice-group-by v0.3.1 + Compiling icu_locale_core v2.3.0 + Compiling rayon-core v1.13.0 + Compiling system-configuration-sys v0.6.0 + Compiling unicode-canonical-combining-class v1.0.0 + Compiling unicode-general-category v1.1.0 + Compiling alloc-no-stdlib v2.0.4 + Compiling serde_json v1.0.151 + Compiling heck v0.4.1 + Compiling time-core v0.1.9 + Compiling fnv v1.0.7 + Compiling deranged v0.5.8 + Compiling cranelift-control v0.113.1 + Compiling ouroboros_macro v0.18.5 + Compiling alloc-stdlib v0.2.4 + Compiling icu_provider v2.3.1 + Compiling smallvec v1.15.2 + Compiling ipnet v2.12.1 + Compiling icu_normalizer v2.3.0 + Compiling icu_properties v2.3.0 + Compiling parking_lot v0.12.5 + Compiling time v0.3.55 + Compiling security-framework v3.7.0 + Compiling inout v0.2.2 + Compiling enumflags2_derive v0.7.12 + Compiling cipher v0.4.4 + Compiling http-body v1.1.0 + Compiling idna_adapter v1.2.2 + Compiling idna v1.1.0 + Compiling cranelift-bforest v0.113.1 + Compiling phf v0.13.1 + Compiling gimli v0.31.1 + Compiling zstd-sys v2.0.16+zstd.1.5.7 + Compiling cmake v0.1.58 + Compiling url v2.5.8 + Compiling uuid v1.26.0 + Compiling tokio-util v0.7.19 + Compiling strsim v0.11.1 + Compiling io-lifetimes v3.0.1 + Compiling hashbrown v0.14.5 + Compiling aliasable v0.1.3 + Compiling io-lifetimes v2.0.4 + Compiling bytemuck v1.25.2 + Compiling httparse v1.10.1 + Compiling ident_case v1.0.1 + Compiling fs_extra v1.3.0 + Compiling dunce v1.0.5 + Compiling static_assertions v1.1.0 + Compiling winnow v1.0.4 + Compiling ouroboros v0.18.5 + Compiling regalloc2 v0.10.2 + Compiling aws-lc-sys v0.44.0 + Compiling proc-macro-utils v0.10.0 + Compiling darling_core v0.23.0 + Compiling pathfinder_geometry v0.5.1 + Compiling hyphenation_commons v0.8.4 + Compiling enumflags2 v0.7.12 + Compiling toml_parser v1.1.3+spec-1.1.0 + Compiling cipher v0.5.2 + Compiling brotli-decompressor v5.0.3 + Compiling bincode v1.3.3 + Compiling async-trait v0.1.92 + Compiling phf_codegen v0.13.1 + Compiling string_cache_codegen v0.6.1 + Compiling hmac v0.13.0 + Compiling ring v0.17.14 + Compiling core-foundation v0.9.4 + Compiling pulp v0.22.3 (/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-resource-accounting/vendor/pulp-0.22.3) + Compiling slotmap v1.1.1 + Compiling objc2-core-foundation v0.3.2 + Compiling utf8parse v0.2.2 + Compiling heck v0.5.0 + Compiling try-lock v0.2.5 + Compiling openssl v0.10.81 + Compiling foreign-types-shared v0.1.1 + Compiling pocket-resources v0.3.2 + Compiling tower-service v0.3.3 + Compiling atomic-waker v1.1.2 + Compiling anyhow v1.0.104 + Compiling glyph-names v0.2.0 + Compiling ucd-trie v0.1.7 + Compiling native-tls v0.2.18 + Compiling fallible-iterator v0.2.0 + Compiling toml_datetime v1.1.1+spec-1.1.0 + Compiling io-extras v0.19.0 + Compiling new_debug_unreachable v1.0.6 + Compiling toml_edit v0.25.13+spec-1.1.0 + Compiling tempfile v3.27.0 + Compiling allsorts-azul v0.17.2 + Compiling objc2-system-configuration v0.3.2 + Compiling postgres-protocol v0.6.12 + Compiling hyphenation v0.8.4 + Compiling h2 v0.4.19 + Compiling foreign-types v0.3.2 + Compiling darling_macro v0.23.0 + Compiling system-configuration v0.7.0 + Compiling want v0.3.1 + Compiling web_atoms v0.2.6 + Compiling num-integer v0.1.47 + Compiling manyhow-macros v0.11.4 + Compiling num-complex v0.4.6 + Compiling half v2.7.1 + Compiling rustls-pki-types v1.15.1 + Compiling openssl-macros v0.1.1 + Compiling sha2 v0.10.9 + Compiling miniz_oxide v0.8.9 + Compiling mmapio v0.9.1 + Compiling aho-corasick v1.1.5 + Compiling raw-cpuid v11.6.0 + Compiling untrusted v0.9.0 + Compiling cap-primitives v4.0.2 + Compiling regex-syntax v0.8.11 + Compiling xmlparser v0.13.6 + Compiling azul-simplecss v0.2.1 + Compiling pastey v0.2.3 + Compiling cfg_aliases v0.1.1 + Compiling zstd-safe v7.2.4 + Compiling ryu v1.0.23 + Compiling reborrow v0.5.5 + Compiling pulp-wasm-simd-flag v0.1.1 + Compiling quick-error v2.0.1 + Compiling weezl v0.1.12 + Compiling zune-core v0.5.3 + Compiling precomputed-hash v0.1.1 + Compiling rustversion v1.0.23 + Compiling string_cache v0.9.0 + Compiling zune-jpeg v0.5.15 + Compiling nix v0.28.0 + Compiling regex-automata v0.4.18 + Compiling azul-css v0.0.16 + Compiling hyper v1.11.1 + Compiling manyhow v0.11.4 + Compiling fs-set-times v0.20.3 + Compiling num-bigint v0.4.8 + Compiling proc-macro-crate v3.5.0 + Compiling postgres-types v0.2.14 + Compiling darling v0.23.0 + Compiling whoami v2.1.3 + Compiling anstyle-parse v1.0.0 + Compiling rayon v1.12.0 + Compiling prefix-trie v0.8.4 + Compiling sha1 v0.10.7 + Compiling libsqlite3-sys v0.28.0 + Compiling universal-hash v0.5.1 + Compiling lru v0.18.3 + Compiling fdeflate v0.3.7 + Compiling zune-inflate v0.2.54 + Compiling sync_wrapper v1.0.2 + Compiling opaque-debug v0.3.1 + Compiling linked-hash-map v0.5.6 + Compiling jiff-core v0.1.1 + Compiling unicase v2.9.0 + Compiling fax v0.2.7 + Compiling bit_field v0.10.3 + Compiling tower-layer v0.3.3 + Compiling lebe v0.5.3 + Compiling data-encoding v2.11.1 + Compiling byteorder-lite v0.1.0 + Compiling grid v1.0.1 + Compiling cap-std v4.0.2 + Compiling gl-context-loader v0.1.10 + Compiling color_quant v1.1.0 + Compiling anstyle v1.0.14 + Compiling arrayvec v0.7.8 + Compiling pxfm v0.1.30 + Compiling colorchoice v1.0.5 + Compiling mysql_common v0.37.3 + Compiling termcolor v1.4.1 + Compiling anstyle-query v1.1.5 + Compiling cpubits v0.1.1 + Compiling is_terminal_polyfill v1.70.2 + Compiling aws-lc-rs v1.18.0 + Compiling ambient-authority v0.0.2 + Compiling tokio-openssl v0.6.5 + Compiling maybe-owned v0.3.4 + Compiling unicode-segmentation v1.13.3 + Compiling mysql-common-derive v0.32.2 + Compiling anstream v1.0.0 + Compiling aes v0.9.3 + Compiling taffy v0.10.1 + Compiling jiff v0.2.37 + Compiling gif v0.14.2 + Compiling image-webp v0.2.4 + Compiling hickory-proto v0.26.1 + Compiling exr v1.74.2 + Compiling moxcms v0.8.1 + Compiling tower v0.5.3 + Compiling tiff v0.11.3 + Compiling mime_guess v2.0.5 + Compiling png v0.18.1 + Compiling lru-cache v0.1.2 + Compiling polyval v0.6.2 + Compiling tokio-postgres v0.7.18 + Compiling tokio-native-tls v0.3.1 + Compiling regex v1.13.1 + Compiling hyper-util v0.1.20 + Compiling tendril v0.5.1 + Compiling cbc v0.2.1 + Compiling ecb v0.2.1 + Compiling qoi v0.4.1 + Compiling ppv-lite86 v0.2.21 + Compiling http-body-util v0.1.5 + Compiling aes v0.8.4 + Compiling nibble_vec v0.1.0 + Compiling toml_datetime v0.6.11 + Compiling serde_spanned v0.6.9 + Compiling hmac v0.12.1 + Compiling phf_shared v0.12.1 + Compiling crossbeam-channel v0.5.16 + Compiling btoi v0.5.0 + Compiling mach2 v0.4.3 + Compiling roxmltree v0.21.1 + Compiling nom v8.0.0 + Compiling keyring-core v1.0.0 + Compiling saturating v0.1.0 + Compiling bitflags v1.3.2 + Compiling toml_write v0.1.2 + Compiling chrono-tz v0.10.4 + Compiling libbz2-rs-sys v0.2.5 + Compiling untrusted v0.7.1 + Compiling winnow v0.7.15 + Compiling endian-type v0.1.2 + Compiling cap-fs-ext v4.0.2 + Compiling xmlwriter v0.1.0 + Compiling weezl v0.2.1 + Compiling rangemap v1.8.0 + Compiling clap_lex v1.1.0 + Compiling mime v0.3.17 + Compiling tagptr v0.2.0 + Compiling regex-lite v0.1.9 + Compiling moka v0.12.16 + Compiling toml_edit v0.22.27 + Compiling clap_builder v4.6.6 + Compiling lopdf v0.44.0 + Compiling radix_trie v0.2.1 + Compiling bzip2 v0.6.1 + Compiling region v3.0.2 + Compiling apple-native-keyring-store v1.0.2 + Compiling hyper-tls v0.6.0 + Compiling phf v0.12.1 + Compiling pbkdf2 v0.12.2 + Compiling rand_chacha v0.3.1 + Compiling image v0.25.10 + Compiling rust-fontconfig v5.0.0 + Compiling markup5ever v0.39.0 + Compiling arc-swap v1.9.2 + Compiling ghash v0.5.1 + Compiling hickory-net v0.26.1 + Compiling tower-http v0.6.11 + Compiling zstd v0.13.3 + Compiling cranelift-module v0.113.1 + Compiling cranelift-native v0.113.1 + Compiling cranelift-frontend v0.113.1 + Compiling wasmtime-jit-icache-coherence v26.0.1 + Compiling serde_urlencoded v0.7.1 + Compiling lzma-rust2 v0.15.8 + Compiling clap_derive v4.6.4 + Compiling hashlink v0.9.1 + Compiling cfb v0.7.3 + Compiling ctr v0.9.2 + Compiling blowfish v0.9.1 + Compiling futures-executor v0.3.34 + Compiling fd-lock v4.0.4 + Compiling zopfli v0.8.3 + Compiling keyed_priority_queue v0.4.2 + Compiling crossbeam-queue v0.3.13 + Compiling aead v0.5.2 + Compiling rtoolbox v0.0.6 + Compiling filetime v0.2.29 + Compiling csv-core v0.1.13 + Compiling unsafe-libyaml v0.2.11 + Compiling fallible-streaming-iterator v0.1.9 + Compiling constant_time_eq v0.3.1 + Compiling signature v2.2.0 + Compiling lazy_static v1.5.0 + Compiling deflate64 v0.1.12 + Compiling chunked_transfer v1.5.0 + Compiling typed-path v0.12.3 + Compiling unicode-width v0.1.14 + Compiling httpdate v1.0.3 + Compiling resolv-conf v0.7.6 + Compiling fallible-iterator v0.3.0 + Compiling twox-hash v2.1.4 + Compiling home v0.5.12 + Compiling ascii v1.1.0 + Compiling ppmd-rust v1.4.0 + Compiling rustyline v14.0.0 + Compiling mysql_async v0.37.1 + Compiling hickory-resolver v0.26.1 + Compiling serde_yaml v0.9.34+deprecated + Compiling zip v7.2.0 + Compiling colored v2.2.0 + Compiling csv v1.4.0 + Compiling tar v0.4.46 + Compiling rpassword v7.5.4 + Compiling aes-gcm v0.10.3 + Compiling futures v0.3.34 + Compiling bcrypt v0.15.1 + Compiling clap v4.6.6 + Compiling infer v0.16.0 + Compiling reqwest v0.12.28 + Compiling cranelift v0.113.1 + Compiling cranelift-jit v0.113.1 + Compiling html5ever v0.39.0 + Compiling rand v0.8.8 + Compiling toml v0.8.23 + Compiling keyring v4.1.6 + Compiling postgres v0.19.14 + Compiling azul-core v0.0.16 + Compiling tokio-stream v0.1.19 + Compiling md-5 v0.10.6 + Compiling fs2 v0.4.3 + Compiling quick-xml v0.42.0 + Compiling urlencoding v2.1.3 + Compiling base64 v0.21.7 + Compiling same-file v1.0.6 + Compiling nohash-hasher v0.2.0 + Compiling rusqlite v0.31.0 + Compiling jsonwebtoken v10.4.0 + Compiling azul-layout v0.0.16 + Compiling tiny_http v0.12.0 (/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-resource-accounting/vendor/tiny_http-0.12.0) +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 + + Compiling postgres-openssl v0.5.3 +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) + Compiling printpdf v0.12.8 + Compiling kujolang v1.7.0 (/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-resource-accounting) + Finished `release` profile [optimized] target(s) in 49m 22s diff --git a/docs/evidence/resource-accounting/kujo-contracts.log b/docs/evidence/resource-accounting/kujo-contracts.log new file mode 100644 index 0000000..052a512 --- /dev/null +++ b/docs/evidence/resource-accounting/kujo-contracts.log @@ -0,0 +1,153 @@ + Blocking waiting for file lock on build directory + Compiling serde_core v1.0.229 + Compiling serde v1.0.229 + Compiling ahash v0.8.12 + Compiling either v1.18.0 + Compiling num-conv v0.2.2 + Compiling time-core v0.1.9 + Compiling regex-automata v0.4.18 + Compiling anyhow v1.0.104 + Compiling num-rational v0.4.2 + Compiling num-iter v0.1.46 + Compiling plotters-backend v0.3.7 + Compiling ciborium-io v0.2.2 + Compiling bit-vec v0.6.3 +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) + Compiling ciborium-ll v0.2.2 + Compiling cast v0.3.0 + Compiling walkdir v2.5.0 + Compiling iso8601 v0.6.6 + Compiling time-macros v0.2.32 + Compiling rayon v1.12.0 + Compiling itertools v0.10.5 + Compiling bit-set v0.5.3 + Compiling plotters-svg v0.3.7 + Compiling is-terminal v0.4.17 + Compiling num-cmp v0.1.0 + Compiling plotters v0.3.7 + Compiling anes v0.1.6 + Compiling wasmtime-jit-icache-coherence v26.0.1 + Compiling num v0.4.3 + Compiling oorandom v11.1.5 + Compiling fraction v0.15.4 + Compiling bytecount v0.6.9 + Compiling time v0.3.55 + Compiling criterion-plot v0.5.0 + Compiling serde_json v1.0.151 + Compiling csv v1.4.0 + Compiling smallvec v1.15.2 + Compiling ipnet v2.12.1 + Compiling bincode v1.3.3 + Compiling hyphenation_commons v0.8.4 + Compiling serde_spanned v0.6.9 + Compiling toml_datetime v0.6.11 + Compiling serde_urlencoded v0.7.1 + Compiling serde_yaml v0.9.34+deprecated + Compiling regex v1.13.1 + Compiling parking_lot_core v0.9.12 + Compiling icu_normalizer v2.3.0 + Compiling hashbrown v0.14.5 + Compiling hyper v1.11.1 + Compiling parking_lot v0.12.5 + Compiling prefix-trie v0.8.4 + Compiling idna_adapter v1.2.2 + Compiling string_cache v0.9.0 + Compiling idna v1.1.0 + Compiling web_atoms v0.2.6 + Compiling tokio-postgres v0.7.18 + Compiling regalloc2 v0.10.2 + Compiling hyphenation v0.8.4 + Compiling cap-primitives v4.0.2 + Compiling nibble_vec v0.1.0 + Compiling exr v1.74.2 + Compiling radix_trie v0.2.1 + Compiling url v2.5.8 + Compiling hyper-util v0.1.20 + Compiling markup5ever v0.39.0 + Compiling cap-std v4.0.2 + Compiling hickory-proto v0.26.1 + Compiling tower-http v0.6.11 + Compiling azul-layout v0.0.16 + Compiling cranelift-codegen v0.113.1 + Compiling hashlink v0.9.1 + Compiling moka v0.12.16 + Compiling hyper-tls v0.6.0 + Compiling mysql_common v0.37.3 + Compiling lopdf v0.44.0 + Compiling toml_edit v0.22.27 + Compiling reqwest v0.12.28 + Compiling postgres-openssl v0.5.3 + Compiling postgres v0.19.14 + Compiling rusqlite v0.31.0 + Compiling hickory-net v0.26.1 + Compiling image v0.25.10 + Compiling mysql_async v0.37.1 + Compiling hickory-resolver v0.26.1 + Compiling toml v0.8.23 + Compiling cap-fs-ext v4.0.2 + Compiling html5ever v0.39.0 + Compiling rustyline v14.0.0 + Compiling jsonwebtoken v10.4.0 + Compiling zip v7.2.0 + Compiling tinytemplate v1.2.1 + Compiling fancy-regex v0.13.0 + Compiling ciborium v0.2.2 + Compiling jsonschema v0.18.3 + Compiling criterion v0.5.1 + Compiling cranelift-native v0.113.1 + Compiling cranelift-frontend v0.113.1 + Compiling cranelift-module v0.113.1 + Compiling cranelift-jit v0.113.1 + Compiling cranelift v0.113.1 + Compiling printpdf v0.12.8 + Compiling kujolang v1.7.0 (/Users/robertdevore/2026/Kujolang/kujo-repos/kujo-resource-accounting) + Finished `release` profile [optimized] target(s) in 66m 27s + Running tests/architecture_docs_contract.rs (target/release/deps/architecture_docs_contract-1ca474a0cabf10f0) + +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.03s + + Running tests/readme_contracts.rs (target/release/deps/readme_contracts-cb4a79fea93848c9) + +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-6576866eab9dbf37) + +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/resource-accounting/kujo-fmt-final.log b/docs/evidence/resource-accounting/kujo-fmt-final.log new file mode 100644 index 0000000..e69de29 diff --git a/docs/evidence/resource-accounting/kujo-fmt.log b/docs/evidence/resource-accounting/kujo-fmt.log new file mode 100644 index 0000000..e69de29 diff --git a/docs/evidence/resource-accounting/kujo-release-state.txt b/docs/evidence/resource-accounting/kujo-release-state.txt new file mode 100644 index 0000000..dd1eecf --- /dev/null +++ b/docs/evidence/resource-accounting/kujo-release-state.txt @@ -0,0 +1,3 @@ +[release-state] README.md matches Cargo.toml version: 1.7.0 +[release-state] ERROR: README.md does not identify latest stable tag v1.7.0 +[release-state] Expected to find: latest published stable release tag is `v1.7.0` diff --git a/docs/evidence/resource-accounting/policy-1.log b/docs/evidence/resource-accounting/policy-1.log new file mode 100644 index 0000000..9759cac --- /dev/null +++ b/docs/evidence/resource-accounting/policy-1.log @@ -0,0 +1,23 @@ +PASS fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","ok":false,"reason":"Error { line: 0, message: reservation_path_not_ready, stack: [, inspect_action, plan, need] }"} + +false !== true + + at rapply (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_helpers.mjs:5:90) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_policy.mjs:7:37 + 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 diff --git a/docs/evidence/resource-accounting/policy-2.log b/docs/evidence/resource-accounting/policy-2.log new file mode 100644 index 0000000..16ef463 --- /dev/null +++ b/docs/evidence/resource-accounting/policy-2.log @@ -0,0 +1,23 @@ +PASS fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","ok":false,"reason":"Error { line: 0, message: reservation_path_not_ready, stack: [, inspect_action, plan, need] }"} + +false !== true + + at rapply (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_helpers.mjs:5:90) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_policy.mjs:7:204 + 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 diff --git a/docs/evidence/resource-accounting/policy-3.log b/docs/evidence/resource-accounting/policy-3.log new file mode 100644 index 0000000..5c3861f --- /dev/null +++ b/docs/evidence/resource-accounting/policy-3.log @@ -0,0 +1,23 @@ +PASS fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization +node:internal/modules/run_main:107 + triggerUncaughtException( + ^ + +AssertionError [ERR_ASSERTION]: {"authority":"informational","ok":false,"reason":"Error { line: 0, message: attempt_already_reserved, stack: [, inspect_action, plan, assess_attempt, demand] }"} + +false !== true + + at rapply (file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_helpers.mjs:5:90) + at file:///Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/tests/resource_policy.mjs:7:219 + 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 diff --git a/docs/evidence/resource-accounting/policy-4.log b/docs/evidence/resource-accounting/policy-4.log new file mode 100644 index 0000000..fbe5841 --- /dev/null +++ b/docs/evidence/resource-accounting/policy-4.log @@ -0,0 +1,5 @@ +PASS fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization +PASS mixed program/Eval plan is atomic, over-capacity plan reserves nothing, subgraph receipt grants no extra units +PASS missing provider usage blocks ordinary program progression and explicit planning without inventing zero +PASS source changes invalidate an observation candidate; exact provider-sourced facts allow later reservation +{"ok":true,"checks":4,"proofs":["fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization","mixed program/Eval plan is atomic, over-capacity plan reserves nothing, subgraph receipt grants no extra units","missing provider usage blocks ordinary program progression and explicit planning without inventing zero","source changes invalidate an observation candidate; exact provider-sourced facts allow later reservation"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-d67VqJ"} diff --git a/docs/evidence/resource-accounting/python-install.log b/docs/evidence/resource-accounting/python-install.log new file mode 100644 index 0000000..7e10b11 --- /dev/null +++ b/docs/evidence/resource-accounting/python-install.log @@ -0,0 +1,30 @@ +Collecting attrs==26.1.0 + Using cached attrs-26.1.0-py3-none-any.whl (67 kB) +Collecting jsonschema==4.23.0 + Using cached jsonschema-4.23.0-py3-none-any.whl (88 kB) +Collecting jsonschema-specifications==2025.9.1 + Using cached jsonschema_specifications-2025.9.1-py3-none-any.whl (18 kB) +Collecting referencing==0.37.0 + Using cached referencing-0.37.0-py3-none-any.whl (26 kB) +Collecting rpds-py==0.30.0 + Using cached rpds_py-0.30.0-cp310-cp310-macosx_10_12_x86_64.whl (370 kB) +Collecting typing-extensions==4.16.0 + Using cached typing_extensions-4.16.0-py3-none-any.whl (45 kB) +Saved ./wheelhouse/attrs-26.1.0-py3-none-any.whl +Saved ./wheelhouse/jsonschema-4.23.0-py3-none-any.whl +Saved ./wheelhouse/jsonschema_specifications-2025.9.1-py3-none-any.whl +Saved ./wheelhouse/referencing-0.37.0-py3-none-any.whl +Saved ./wheelhouse/rpds_py-0.30.0-cp310-cp310-macosx_10_12_x86_64.whl +Saved ./wheelhouse/typing_extensions-4.16.0-py3-none-any.whl +Successfully downloaded attrs jsonschema jsonschema-specifications referencing rpds-py typing-extensions +WARNING: You are using pip version 22.0.4; however, version 26.2.1 is available. +You should consider upgrading via the '/Users/robertdevore/2026/Kujolang/kujo-repos/dispatch-resource-accounting/interop/python-participant/.venv/bin/python -m pip install --upgrade pip' command. +Looking in links: wheelhouse +Processing ./wheelhouse/attrs-26.1.0-py3-none-any.whl +Processing ./wheelhouse/jsonschema-4.23.0-py3-none-any.whl +Processing ./wheelhouse/jsonschema_specifications-2025.9.1-py3-none-any.whl +Processing ./wheelhouse/referencing-0.37.0-py3-none-any.whl +Processing ./wheelhouse/rpds_py-0.30.0-cp310-cp310-macosx_10_12_x86_64.whl +Processing ./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 diff --git a/docs/evidence/resource-accounting/recovery-1.log b/docs/evidence/resource-accounting/recovery-1.log new file mode 100644 index 0000000..fcacfd2 --- /dev/null +++ b/docs/evidence/resource-accounting/recovery-1.log @@ -0,0 +1,8 @@ +PASS fresh controllers cannot oversubscribe final program slot through resource plans +PASS fresh controllers race for last Eval slot with exact source/revision-bound plans +PASS two fresh releases publish one historical release without double refund +PASS crash after committed reservation permits explicit release only before dispatch +PASS Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected +PASS immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization +PASS orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered +{"ok":true,"checks":7,"proofs":["fresh controllers cannot oversubscribe final program slot through resource plans","fresh controllers race for last Eval slot with exact source/revision-bound plans","two fresh releases publish one historical release without double refund","crash after committed reservation permits explicit release only before dispatch","Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected","immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization","orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-vsXBB0"} diff --git a/docs/evidence/resource-accounting/recovery-2.log b/docs/evidence/resource-accounting/recovery-2.log new file mode 100644 index 0000000..5d32eab --- /dev/null +++ b/docs/evidence/resource-accounting/recovery-2.log @@ -0,0 +1,10 @@ +PASS fresh controllers cannot oversubscribe final program slot through resource plans +PASS fresh controllers race for last Eval slot with exact source/revision-bound plans +PASS two fresh releases publish one historical release without double refund +PASS same future Eval reservation publishes once under contention +PASS crash after committed reservation permits explicit release only before dispatch +PASS Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected +PASS immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization +PASS orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered +PASS fresh selected-branch contenders cannot share final capacity or reserve inactive work +{"ok":true,"checks":9,"proofs":["fresh controllers cannot oversubscribe final program slot through resource plans","fresh controllers race for last Eval slot with exact source/revision-bound plans","two fresh releases publish one historical release without double refund","same future Eval reservation publishes once under contention","crash after committed reservation permits explicit release only before dispatch","Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected","immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization","orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered","fresh selected-branch contenders cannot share final capacity or reserve inactive work"],"root":"/var/folders/wb/0cck3lgd08n55g_8ly9qmf_00000gn/T/node-composition-POWTCN"} diff --git a/docs/evidence/resource-accounting/repository-pins.json b/docs/evidence/resource-accounting/repository-pins.json new file mode 100644 index 0000000..aa49a18 --- /dev/null +++ b/docs/evidence/resource-accounting/repository-pins.json @@ -0,0 +1,34 @@ +{ + "dispatch-resource-accounting": { + "commit": "cdc0cea9013c9e352604b541c901e266bf1b2392", + "status": "M CHANGELOG.md\n M README.md\n M docs/contracts/resources/decision.md\n M scripts/run_release_gate.sh\n M tests/node_composition_fixture.kujo\n?? docs/audits/resource-accounting.md\n?? docs/contracts/resources/crash-matrix.md\n?? docs/contracts/resources/protocol.md\n?? tests/resource_contract_tests.kujo\n?? tests/resource_eval_worker.kujo\n?? tests/resource_helpers.mjs\n?? tests/resource_integration.mjs\n?? tests/resource_limits_tests.kujo\n?? tests/resource_model_fixture.kujo\n?? tests/resource_policy.mjs\n?? tests/resource_recovery.mjs" + }, + "kujo-resource-accounting": { + "commit": "e65bb57b39814daa1552762778d2b051fbcf7013", + "status": "M ROADMAP.md\n M docs/NEXT_PHASE_ARCHITECTURE.md\n?? docs/WAVE_F_RESOURCE_ACCOUNTING.md" + }, + "workcell": { + "commit": "0f9595b79872d2500f0bb35a8cf6227171fd7eeb", + "status": "" + }, + "eval": { + "commit": "6a5ab09e5c24cc1a842b374afccb64da40db2874", + "status": "" + }, + "agents-sdk": { + "commit": "5a9d5525e511a293b743b1c44d9ef270fd491f9f", + "status": "?? docs/MAINTENANCE_AGENT.md\n?? maintenance_agent.kujo\n?? src/maintenance/\n?? tests/maintenance_agent_tests.kujo" + }, + "watchdog": { + "commit": "fafea3abb594638e442127496ca6ac4c9bcd5390", + "status": "M watchdog_proxy_config.json" + }, + "runledger": { + "commit": "97cb607a062efeecc7fcdc4e4a4e0308f90d45fe", + "status": "" + }, + "ability": { + "commit": "bcbecb49b147023877e83d5f2ea647dfede030b5", + "status": "" + } +} diff --git a/docs/evidence/resource-accounting/resource-report-example.json b/docs/evidence/resource-accounting/resource-report-example.json new file mode 100644 index 0000000..c2d788c --- /dev/null +++ b/docs/evidence/resource-accounting/resource-report-example.json @@ -0,0 +1,115 @@ +{ + "ok": true, + "report": { + "authority": "informational", + "eval_attempts": {}, + "evaluations": { + "available": 0, + "consumed": 0, + "limit": 0, + "released": 0, + "reserved": 0, + "unit": "eval_dispatches" + }, + "journal": "793f84e0723b573e994beaab1c7987a6b6186281f9805ffdabb115178b18fae3", + "monetary_cost": { + "class": "unknown", + "value": null + }, + "programs": { + "available": 0, + "consumed": 1, + "exhausted": true, + "limit": 2, + "nodes": [ + { + "consumed": 1, + "limit": 1, + "node_id": "A", + "remaining": 0, + "reserved": 0 + }, + { + "consumed": 0, + "limit": 1, + "node_id": "B", + "remaining": 0, + "reserved": 1 + } + ], + "on_exhaustion": "block", + "released": 0, + "reserved": 1, + "unit": "program_dispatches", + "used": 1 + }, + "readings": [ + { + "facts": { + "class": "unknown" + }, + "source_kind": "runtime", + "source_ref": null, + "subject": { + "attempt_id": "run-1790857023932-6252", + "kind": "program", + "node_id": "A" + } + }, + { + "facts": { + "class": "provider_reported", + "estimated": { + "class": "estimated", + "component_tokens": 16, + "scope": "adapter_components" + }, + "monetary_cost": null, + "reported": { + "input_tokens": 41, + "output_tokens": 7 + } + }, + "source_kind": "model", + "source_ref": "sha256:e7bf8f68066444cad56a3f3c63ee89ebcdda427e2128a76359f13a8a4f1696d2", + "subject": { + "attempt_id": "run-1790857023932-6252", + "kind": "program", + "node_id": "A" + } + } + ], + "revision": 8, + "run_id": "run-1790857028144-7732", + "schema": "dispatch.resource-report/v1alpha1", + "totals": { + "estimated_component_tokens": { + "class": "estimated", + "known_sum": 16, + "total": 16, + "unknown_attempts": 0 + }, + "process_wall_ns": { + "class": "observed", + "known_sum": 0, + "scope": "sum_of_process_intervals_not_graph_elapsed_or_cpu", + "total": null, + "unknown_attempts": 1 + }, + "reported_input_tokens": { + "class": "provider_reported", + "complete": true, + "known_sum": 41, + "total": 41, + "unknown_attempts": 0 + }, + "reported_output_tokens": { + "class": "provider_reported", + "complete": true, + "known_sum": 7, + "total": 7, + "unknown_attempts": 0 + } + } + } +} diff --git a/docs/evidence/resource-accounting/source-artifacts.json b/docs/evidence/resource-accounting/source-artifacts.json new file mode 100644 index 0000000..d2f04c4 --- /dev/null +++ b/docs/evidence/resource-accounting/source-artifacts.json @@ -0,0 +1,94 @@ +{ + "inventoried_commit": "2577c60ff7ef79992f34b4627799f488cf5edcd6", + "ci_validation_commit": "5d706f8322c9de03fde8a864b7a1a247b3d370f3", + "canonical_application_source_commit": "2577c60ff7ef79992f34b4627799f488cf5edcd6", + "source": { + ".github/workflows/ci-gate.yml": "4e87577e1a331a0368de6d57967dd521c0765f46b342b222330479e5b9fb9d79", + ".github/workflows/release-artifacts.yml": "0131769b458c243761644e7344783211b303fc3e99e27f69adb0a563e4ecf304", + "schemas/graph-resources-v1alpha1.schema.json": "37ad25c10183a52e6ebac44479bb3993509210a1157d6c1b779c861180b952fc", + "scripts/prepare_graph_fixture_layout.sh": "c7c87347261b7494eccc134cb3c0722f01b21c702a14655cdae54045782c0b87", + "scripts/run_release_gate.sh": "65745cd9282c7b4a7eb0b106f1d2aabd80a061711e3e01174976fa956da5f0d0", + "src/core/assurance_configuration.kujo": "075bff265ec149f65480bef4d94b7218c5bf1e01bc5923fc68213564d3261214", + "src/core/assurance_state.kujo": "beeea005482f047740cd5d28b1e199fa9c70db9a682a202670653ba2bb29fe1b", + "src/core/graph_attempts.kujo": "942c017023ad90803945950f12d200d03a8580a456f103a95807562df1a3674d", + "src/core/graph_outcome.kujo": "29971e2166ce45dcb4d751efd478f593416b390aa272c59c68a1bda8d2a5215f", + "src/core/graph_transition.kujo": "57f57a3c033ee540dc0ac588139fb3d91985e2d17d440b06b2a5884886a18613", + "src/core/node_composition.kujo": "f66224bf257a363e43c966e795bad304988e40df9c4494b0be940dee77c9bfc2", + "src/core/resource_facts.kujo": "01523c6c8bde1f3e8fc39b9a59a207acebb90a85a7ff1f359116e04582a746b6", + "src/core/resource_ledger.kujo": "347d04398fe8981805ada311e484189300cec71e46bb599ac2ab76eb2b1f8212", + "src/core/resource_operation.kujo": "74e09f7a85a60e26a199e94138e90b5353416d018f9075d35ee47f8dec4fa229", + "src/core/retained_recovery.kujo": "1e3b496780f42fb0bbae4fe6f9db1b43c9dc36beabcfa5788c429f17bb798d40", + "src/core/runtime_resource_schema.kujo": "f50665435d49c347e06592c2f6b6cee4c2bb86215bb0971ec5c1c15ccda997bd", + "tests/ci_graph_layout_tests.sh": "ef180371d927efc577835823e222f40f5e71f551b31892e23ba1327173484bfd", + "tests/graph_attempt_binding_safety.mjs": "6b0edf1229d61ce7b1acd07e4a2813ef00bc7b6a1b3266d49d7c32456c8bd749", + "tests/graph_attempt_recovery.mjs": "362ca945f20e420e6c202cd15230068f989c73e628fc9dab6267309a963e4f74", + "tests/heterogeneous_recovery.mjs": "ee42848b24843747dffd8966b934af90ec6f7fd4904e57e6a3d9c9f6aeb66cef", + "tests/node_composition_fixture.kujo": "0276b4ed244c02a1d329f27c7c08891911eecb7574b2c6708b67cb44f6c36a95", + "tests/node_composition_recovery.mjs": "4763a3c39b485f6877d5c1899908c38f0cd157a335413214f06647ef2d52faa1", + "tests/resource_contract_tests.kujo": "0bf1378931606bfc26091ce0c7fefc8f735c3cf82558d76ac833b24360be8c54", + "tests/resource_eval_worker.kujo": "29c60b54fb9cae327c2c3429024dc78c4b120116a5a20153cd970f5f6c4e9bec", + "tests/resource_helpers.mjs": "e09b0551e55ef99d716c618be5bf2c6db5be7961bac153cd59e4234a4eaf456b", + "tests/resource_integration.mjs": "9edf2dcb427f17827ee7f5c9cffece1cb411aa68f5b784e02a7f3e8b8b249715", + "tests/resource_limits_tests.kujo": "1c63510f9fccf14f4da146d12fa243bfa8bf9002911f532ed7c759402ef78e65", + "tests/resource_model_fixture.kujo": "aa3abcaaf6ceca9f5a6d8fe923cfc1ce38828b3150d1dd3430437e50c9595c9d", + "tests/resource_policy.mjs": "ce13ab3f472491950f6eb993f40a75990f45de22d6f029c4a67ba4b83739d76d", + "tests/resource_recovery.mjs": "1907374566032992a5a7546e1069534f5bbbfde67e094c18b6c07fb691c6aefa", + "tests/static_policy_recovery.mjs": "726f947842154ce5f7bc62f3afa347138989b3fada1cdc20517393fd17c3a4d0", + ".gitignore": "d47f1dd147747f637fc56ab8f6f445062e50e5f9942baa8066c3bc8e3c3f02a4", + "config/kujo-tool-artifacts.gitignore": "eef2a74bf335dc4a6f8e86d698bba9f6a1026a0879e9783b3d4975243824af49", + ".github/scripts/check-kujo-tool-artifacts.sh": "4864632e435c4c58b02e23295d9b284a9286344bab497c05aff279e16af574b0", + ".github/workflows/kujo-tool-artifacts-guard.yml": "adf787fc8fa26440062178fe3493fb112a0bc468cd66358fcec328afa7ee1d9e", + "tests/artifact_policy_tests.sh": "82c97a56530a14c8b2ff7e0cb3fd836e5775fa55935e14460737bc55cfb63efb" + }, + "evidence": { + "artifact-policy-fixed.txt": "5e08659b4551ebe0958da351f5a4634713a2a6431b16b72994239ec58a3e9fae", + "artifact-policy-history.txt": "75d153e90713501fb9afe40a3897b847218126e2adbe4d3112644f0c62ff79a7", + "artifact-policy.txt": "01d532d47066ed42e879fdc80c0a55acc440f8d0d57909a69d69747c230fa852", + "baseline.log": "8d5cf865c18040263e58be61803cbd8fb569ec08d81d7577d9f9bedb72036056", + "canonical-1.log": "1607b5e4959decda511cd968a89eb4c0fc6931e931e6175fb00d61a5c4660357", + "canonical-2.log": "571a691f9e687d2713df27ac4585d3f0afccfba0021cb4a74de348d939e5700e", + "canonical-suites.txt": "7b479cd0bcab36362ac708039b4044a3a01e4be4de71bdd51cb4691e5df5bc55", + "ci-layout-fixed.json": "82476f6d03da0a838c30efb9dd30e7e4ef1e0e3e1c27fdcd2aee221eae78deb5", + "ci-layout-reproduction.json": "96237f7c17a3a7f10cbb748028f443dc0fc3a25c639439c1b2b579f9150da5d0", + "ci-layout-tests.log": "009e787cc853cc12087c8bd9a1b2a2ef21fc9abbd14fabbb596017a42031b9e8", + "ci-workflow-syntax.log": "13f92c74868d434a3cf498ce3888a3cf5a5530e1e34fd529776c8b4102b43afd", + "commands.md": "d81859c6b0f1e065f3171c8c3773cd8783fb1da9b638371ce3b5cfa75bc941f7", + "development.md": "e690d3ea7c96247a5b0861e67bca2c371b878feb07d79dc539d0fd42e9e0ea0c", + "failed-canonical-1-suites.log": "ddd44bbc7c94d4049ae367e8a24e624c7f9ecbab5e281cf12a821d4fce48268b", + "fixed-graph_attempt_binding_safety.log": "bc6b867b014d824f08890a4b1331a830c45dbe1347a6c8f292256de3400367ba", + "fixed-graph_attempt_recovery.log": "2add4fc49bc07a5fd1d5f4ff43139589d2ca1b586191a65dddef3181d8cbd93b", + "fixed-heterogeneous_recovery.log": "cb319385c46d64ea86d6e7267f8877afef8f76ca4de08d49b7b8577ac877d4e8", + "fixed-node_composition_recovery.log": "7157b255d49f26ca0cbe0e3a1b54bdfe726ff9543e1a75221dcf91709b943fe8", + "fixed-static_policy_recovery.log": "033b85ef87b81fb7914025df78e4cc585a53d3bb93c32e030a4101c57acfcd83", + "hosted-artifact-failure.txt": "d07d1ced6506c58d08b5bfcfe8b1f5a441793573beca57361a4b5440f34f6884", + "hosted-kujo-clippy-excerpt.txt": "527f49b9ea4030db9c5ed807f0229ccc1be96937708b8d36dbb5523e0e7892e3", + "hosted-kujo-release-failure.txt": "880654f13bd93dea0147a0b4dd5bd18ac9f7dad8e47ed2dca762f9dfc02eb866", + "integration-1.log": "bb3b4320f3a98e2fd2ae828ee8a0f3a98122be7990858d040bb4752f3437c12d", + "integration-2.log": "c826f60246045e2668b017956b58bfa840d92ff37dfd9761896ffe6c29132b9a", + "integration-3.log": "4cdf8eb19b1882aa8be542c4b2925d9e92826ef2decfd899a464c01d2fb6324d", + "integration-4.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "integration-5.log": "23a22128b9d31e2568be49f7260df603895305bc11d4dd889e4675741e14bd09", + "integration-6.log": "eb4144a4efed09d18b2488512eee6aae0c8ef50017c6c9c5bc2e1b3eeef08f23", + "integration-7.log": "3005c9321242ac47238cb679221876ca1a7bb0f1a9beee73611769407a0c25bd", + "kujo-build-artifact.json": "450a4178161cd96fb4dac3a44f4042d7fc22fe6ab4880ae60d337fff7738de11", + "kujo-build.log": "c6b47e1f042f6246bd539cbefdbaca9f21d811e6bf7bf1ea82d64ea8d6889c3f", + "kujo-contracts.log": "50b4520152b6530a30ad8d1c4737d3c117f3dd706b1c37d5ffb46063969c52d7", + "kujo-fmt-final.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "kujo-fmt.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "kujo-release-state.txt": "db1cbeec8f5cb6150d98f2b80d8867f69b1fb30c38a7f340245f9efbe9f0bee2", + "policy-1.log": "9f641618054e5c6ade1b23de0b3ddc45382cfbab9b063c56b81cff4c7b6e2ea6", + "policy-2.log": "7f0425d69d0d3e7fcd60df46e87d75db0af23b7df4b79f0e6f96190457eacae6", + "policy-3.log": "66970103aab53152f66d6fb8e826cf9b85dad6af0ee44e4fc7331ccb9469fd71", + "policy-4.log": "56e8e0d1e8607c2e7b703b87c4ccf10d7497f307a346d8edd05d285c914728e3", + "python-install.log": "662453b84d533b9dfab6d0607e7eb15158158ac775cdd450f2032f476e6407b4", + "recovery-1.log": "d382ea76d8c3c121ff84fd4eee0f497e2f1e089da32bda5983d8a8cfecd4800a", + "recovery-2.log": "304f9397bd2789dd24785a700e26fa16d638ea41e522a004b13f9340fce5c594", + "repository-pins.json": "4e78e244fdfc1b627ae2a7319c94cdd42aca4ad4e6893f0a7c7e96e42fdac803", + "resource-report-example.json": "baad69702a4658b7a8543be2b8fe2b68c8327dbe17cea4e816362724bc135d3a", + "tested-dispatch-commit.txt": "ebc16df5fe0232b0acc52f12ab1ccff4989f734473cc980917f03d43150d048a", + "tested-kujo-commit.txt": "4615ef03960ce42240913dc2657e4855abe81bad44e26d0d9d17f2fa003cb3e7", + "typescript-install.log": "5fb6a018720b50a08ec27efef21afc861a3b21c56407a234992e62ca8d7693fa", + "validation.json": "c4ed732c337c50310549481c3fb11ba0c69b8ee640fb2839bb5785c4c52da9fc" + }, + "post_gate_packaging_commit": "1745f7a106e8525883611ee664087b983f12ab05" +} diff --git a/docs/evidence/resource-accounting/tested-dispatch-commit.txt b/docs/evidence/resource-accounting/tested-dispatch-commit.txt new file mode 100644 index 0000000..8fcf047 --- /dev/null +++ b/docs/evidence/resource-accounting/tested-dispatch-commit.txt @@ -0,0 +1 @@ +2577c60ff7ef79992f34b4627799f488cf5edcd6 diff --git a/docs/evidence/resource-accounting/tested-kujo-commit.txt b/docs/evidence/resource-accounting/tested-kujo-commit.txt new file mode 100644 index 0000000..67e2925 --- /dev/null +++ b/docs/evidence/resource-accounting/tested-kujo-commit.txt @@ -0,0 +1 @@ +51369e42b38efb4479af440c8370ac8a4fea3a7a diff --git a/docs/evidence/resource-accounting/typescript-install.log b/docs/evidence/resource-accounting/typescript-install.log new file mode 100644 index 0000000..0cbebd9 --- /dev/null +++ b/docs/evidence/resource-accounting/typescript-install.log @@ -0,0 +1,8 @@ +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. + +added 8 packages, and audited 9 packages in 2s + +2 packages are looking for funding + run `npm fund` for details + +found 0 vulnerabilities diff --git a/docs/evidence/resource-accounting/validation.json b/docs/evidence/resource-accounting/validation.json new file mode 100644 index 0000000..e2ac53d --- /dev/null +++ b/docs/evidence/resource-accounting/validation.json @@ -0,0 +1,288 @@ +{ + "schema": "dispatch.resource-accounting-validation/v1alpha1", + "verified": true, + "starting_commits": { + "dispatch": "b724f369ab4101a46ea0d5493cc41fc3d0fa3b9c", + "kujo": "e65bb57b39814daa1552762778d2b051fbcf7013" + }, + "scope": "experimental static retained trusted-host graphs; installed local resource/Eval API", + "baseline": { + "passed_checks": 70, + "failed": 0, + "log": "baseline.log" + }, + "new_native_assertions": 20, + "new_integration_proof_groups": 19, + "portable_changes": "none; historical vectors and participant bytes unchanged", + "skips": [ + { + "test": "actual_cross_component_failure_evidence_conforms", + "reason": "Existing ignored test needs local failure-gate handoff artifacts" + }, + { + "test": "actual_workspace_reexecution_artifacts_match_shared_schemas", + "reason": "Existing ignored test needs fixture artifacts" + }, + { + "gate": "Unrelated full Kujo runtime suite", + "reason": "Documentation-only isolated change; requested compatible format, contracts and locked release build passed" + } + ], + "boundaries": [ + "no hard numeric token/runtime/currency ceiling", + "no provider pricing or inferred monetary cost", + "no malicious-source or overlapping-invocation verification", + "Eval budget covers only first-class Dispatch-managed invocations", + "no automatic retry of uncertain work", + "no remote trust, distributed reservations, machine-loss recovery, dynamic topology, mixed profiles, compensation, exactly-once, universal rollback, public SDK or language syntax changes" + ], + "concurrent_work_preserved": [ + "Kujo src/main.rs", + "Kujo src/compiler.rs", + "Kujo src/jit.rs", + "Kujo tests/jit_execution_contract.rs", + "Kujo benchmarks/cross-language/kujo-go-runtime/README.md", + "Kujo benchmarks/cross-language/kujo-go-runtime/run.sh", + "Kujo VS Code lockfile (independently committed in starting main)", + "Agents SDK untracked maintenance work", + "Watchdog watchdog_proxy_config.json" + ], + "next_major_phase": "bounded human adoption and operator inspect/plan/apply usability over one installed workflow; use evidence to prioritize typed Wave E lineage", + "tested_source_commits": { + "dispatch": "2577c60ff7ef79992f34b4627799f488cf5edcd6", + "kujo": "51369e42b38efb4479af440c8370ac8a4fea3a7a" + }, + "canonical": { + "command": "KUJO_BIN=/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified DISPATCH_OFFLINE_FIXTURE=true bash scripts/run_release_gate.sh", + "exit": 0, + "log": "canonical-2.log", + "focused_suites": 87, + "shards": 24, + "shard_tests_passed": 101, + "shard_tests_failed": 0, + "all_suite_invocations_passed": 111, + "command_surface": "VM and interpreter passed", + "release_workloads": { + "schema_version": "1.0", + "dispatch_commit": "2577c60ff7ef79992f34b4627799f488cf5edcd6", + "fixture": true, + "requested_runs": 3, + "completed_runs": 3, + "duration_seconds": 11, + "generated_at_epoch": 1790871121 + }, + "suite_names": [ + "typescript_build", + "preservation_binding", + "parent_finalization", + "static_policy_contracts", + "static_policy_integration", + "static_subgraph_integration", + "static_policy_edges", + "static_policy_recovery", + "resource_contracts", + "resource_limits", + "resource_integration", + "resource_policy", + "resource_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" + ] + }, + "kujo": { + "command_log": "commands.md", + "format": "passed", + "locked_release_build": "passed", + "contracts": { + "passed": 13, + "failed": 0, + "ignored": 2 + }, + "artifact": "kujo-build-artifact.json" + }, + "warnings": [ + "Existing tiny_http unused SequentialWriter and dead MustBeShareDummy warnings in isolated Kujo build/contracts", + "npm unknown user config python warning", + "Python bootstrap pip version notice", + "git diff --check reports trailing blank lines in two retained raw logs (failed-canonical-1-suites.log and kujo-contracts.log); raw bytes preserved, source/docs check excluding raw logs passes" + ], + "development_failures": { + "canonical_1": { + "exit": 1, + "cause": "Isolated recovery fixture source copies omitted newly bound evaluator worker", + "correction_commit": "2577c60ff7ef79992f34b4627799f488cf5edcd6", + "focused_reverification": { + "passed_groups": 38, + "failed": 0 + }, + "full_rerun": "canonical-2.log" + }, + "details": "development.md", + "ci_layout": { + "baseline_missing_import_exit": 4, + "corrected": "ci-layout-fixed.json", + "layout_checks": 5, + "yaml_checks": 2, + "hosted_ci_not_run": true + } + }, + "toolchain": { + "runtime": { + "version": "1.6.0", + "path": "/Users/robertdevore/2026/Kujolang/validation/graph-attempt-accounting/kujo-verified", + "sha256": "dbddb62bba1f08682a1c9b5cc74fa5a94fe9e1b2320b26b61fb857b82db71ad3" + }, + "rustc": "1.96.0 (ac68faa20 2026-05-25)", + "cargo": "1.96.0 (30a34c682 2026-05-25)", + "node": "26.7.0", + "npm": "11.19.0", + "python": "3.10.5", + "go": "1.25.3 darwin/amd64", + "host": "Darwin x86_64" + }, + "source_ownership": { + "related_repository_pins": "repository-pins.json", + "note": "Related-repository file inventories record the development checkpoint. Starting and final tested commits are explicit above. No related repository was modified.", + "concurrent_kujo_main_at_completion": "5926176f24886b024fc929ae5c8ee49a2e8469bc", + "concurrent_kujo_note": "Unrelated runtime/benchmark edits advanced main independently. They were neither incorporated nor modified; Kujo validation covers the isolated documentation source pin." + }, + "evidence_hashes": "source-artifacts.json", + "resulting_commits": "This evidence commit and the pushed heads are recorded in the PRs and consolidated Strata handoff; no self-referential commit hash is embedded.", + "verification_scope": "Full local Dispatch canonical gate and isolated compatible Kujo checks. This does not mean all hosted GitHub checks pass.", + "hosted_followup": { + "dispatch_artifact_guard": { + "original_run": "https://github.com/kujolang/dispatch/actions/runs/36890841402", + "original_status": "failed: committed evidence matched generic log ignore", + "fix_commit": "1745f7a106e8525883611ee664087b983f12ab05", + "fix": "Narrow reviewed-evidence exception; quiet Git ignore predicate honors negation while preserving ordinary log rejection", + "local_checks": 3, + "full_pushed_history_guard": "passed", + "workflow_yaml": "passed", + "initial_followup_failure": "Exception first appeared before a later duplicate *.log rule; moved to end. Original artifact-policy.txt retained.", + "hosted_after_fix": "passed on e0d83a764968efe98c1f0facb0ad271b5ad625be" + }, + "kujo_release_state": { + "run": "https://github.com/kujolang/kujo/actions/runs/36890843345", + "status": "failed; reproduced locally", + "cause": "v1.7.0 tag exists but unchanged stable docs/install defaults declare v1.6.0", + "baseline": "e65bb57b39814daa1552762778d2b051fbcf7013", + "unchanged_files": [ + "README.md", + "Cargo.toml", + "install.sh", + "INSTALLATION.md", + ".github/actions/setup-kujo/action.yml", + ".github/scripts/check-release-state.sh" + ], + "ownership": "Separate release reconciliation; concurrent files preserved", + "capture": "cap_f1cfeb80-17b6-4724-a0b5-6c1193e003ea", + "signal": "sig_4c70588c-1cc7-4905-a35e-d9a1cdcb198b" + }, + "other_hosted_checks": "Pending at publication; no hosted canonical success claimed", + "kujo_clippy": { + "status": "failed", + "toolchain": "Rust 1.99.0", + "reason": "Atomic::fetch_update deprecation under -D warnings in three unchanged runtime files", + "job": "https://github.com/kujolang/kujo/actions/runs/36890843386/job/110465770503", + "capture": "cap_df13cc5e-ed4b-4d8a-93f0-722a574bfa5f", + "signal": "sig_19025086-bbcc-44ca-b742-cdc8534de972", + "scope": "Independent runtime/MSRV repair; protected concurrent work preserved" + } + } +} diff --git a/schemas/graph-resources-v1alpha1.schema.json b/schemas/graph-resources-v1alpha1.schema.json new file mode 100644 index 0000000..ddca3e8 --- /dev/null +++ b/schemas/graph-resources-v1alpha1.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "dispatch.graph-resources/v1alpha1", + "title": "Host-owned bounded graph resource policy (experimental)", + "type": "object", + "additionalProperties": false, + "required": ["schema", "max_eval_attempts", "require_provider_usage"], + "properties": { + "schema": {"const": "dispatch.graph-resources/v1alpha1"}, + "max_eval_attempts": {"type": "integer", "minimum": 0, "maximum": 8}, + "require_provider_usage": {"type": "boolean"} + } +} diff --git a/scripts/prepare_graph_fixture_layout.sh b/scripts/prepare_graph_fixture_layout.sh new file mode 100755 index 0000000..95ed15a --- /dev/null +++ b/scripts/prepare_graph_fixture_layout.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# CI/release aliases for the existing bounded graph fixtures. Never replace a checkout. +set -euo pipefail +workspace="${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is required}" +source_base="${DISPATCH_GRAPH_FIXTURE_ROOT:-$workspace/.ci}" +for mapping in 'workcell:workcell-wave-f' 'eval:eval-wave-f' 'agents-sdk:agents-sdk-wave-d'; do + name="${mapping%%:*}" + source_dir="$source_base/${mapping#*:}" + alias_path="$workspace/../$name" + test -d "$source_dir/src" + if [[ -e "$alias_path" || -L "$alias_path" ]]; then + if [[ ! -L "$alias_path" || "$(readlink "$alias_path")" != "$source_dir" ]]; then + echo "Refusing to replace existing graph fixture path: $alias_path" >&2 + exit 1 + fi + else + ln -s "$source_dir" "$alias_path" + fi +done diff --git a/scripts/run_release_gate.sh b/scripts/run_release_gate.sh index 6619ae8..65d9d53 100755 --- a/scripts/run_release_gate.sh +++ b/scripts/run_release_gate.sh @@ -94,6 +94,11 @@ 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 resource_contracts "$KUJO_BIN" run tests/resource_contract_tests.kujo +run_suite resource_limits "$KUJO_BIN" run tests/resource_limits_tests.kujo +run_suite resource_integration env KUJO_BIN="$KUJO_BIN" node tests/resource_integration.mjs +run_suite resource_policy env KUJO_BIN="$KUJO_BIN" node tests/resource_policy.mjs +run_suite resource_recovery env KUJO_BIN="$KUJO_BIN" node tests/resource_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 diff --git a/src/core/assurance_configuration.kujo b/src/core/assurance_configuration.kujo index bae1989..f178486 100644 --- a/src/core/assurance_configuration.kujo +++ b/src/core/assurance_configuration.kujo @@ -22,7 +22,7 @@ export func configuration_revision(descriptor) { } # Host-owned bounded source manifest; paths never come from a producer or sidecar. export func implementation_digest(files) { - if type(files) != "array"||len(files) < 1||len(files) > 16 {throw("assurance_verifier_invalid")} + if type(files) != "array"||len(files) < 1||len(files) > 32 {throw("assurance_verifier_invalid")} hashes := [] for file in files {hashes = push(hashes, sha256(read_file_beneath(file["root"], file["path"], 1048576)))} return sha256(to_json(hashes)) diff --git a/src/core/assurance_state.kujo b/src/core/assurance_state.kujo index 1db6906..c4f40bb 100644 --- a/src/core/assurance_state.kujo +++ b/src/core/assurance_state.kujo @@ -34,13 +34,14 @@ 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", "graph-attempt-accounting/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", "graph-resources/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", "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")} + if has_key(metadata, "graph_resources") {features = push(features, "graph-resources/v1alpha1")} return features } export func encode_authoritative_state(state) { diff --git a/src/core/graph_attempts.kujo b/src/core/graph_attempts.kujo index 899cc99..da2c4fc 100644 --- a/src/core/graph_attempts.kujo +++ b/src/core/graph_attempts.kujo @@ -91,7 +91,7 @@ export func fold_attempt(state, kind, data) { } 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"])}} + for event in events {if event["kind"] == "graph_resources_reserved" {for item in event["details"]["data"]["candidate"]["programs"] {ref := item["record_ref"];raw := read_file_beneath(state["run_dir"], "node-input/" + substring(ref, 7, 71) + ".raw", 1048576);need("sha256:" + sha256(raw) == ref, "resource_artifact_corrupt");view = fold_attempt(view, "graph_attempt_reserved", parse_json(raw))}};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 } diff --git a/src/core/graph_outcome.kujo b/src/core/graph_outcome.kujo index c66253f..96901e3 100644 --- a/src/core/graph_outcome.kujo +++ b/src/core/graph_outcome.kujo @@ -1,3 +1,4 @@ +from src.core.resource_ledger import resources_enabled, eval_budget, eval_current, resource_raw 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. @@ -35,7 +36,8 @@ func local_facts(graph, id, decision, host) { contract := graph_contract(step);outcome := "completed";fact := null;policy := null if contract == "evaluation-result/v1" { input := binding["inputs"][0] - raw := host["read_evaluation"](id, binding);demand(type(raw) == "string"&&byte_length(raw) <= 1048576, "evaluation_limit") + raw := "" + if resources_enabled(graph) {row := eval_current(graph, id);demand(row != null&&row["dispatch"] != null&&row["resolution"] != null&&row["resolution"]["candidate"]["outcome"] == "completed"&&row["binding_ref"] == binding_ref, "eval_consumed_result_required");raw = resource_raw(graph, row["resolution"]["candidate"]["result_ref"])} else {raw = host["read_evaluation"](id, binding)};demand(type(raw) == "string"&&byte_length(raw) <= 1048576, "evaluation_limit") evaluation := parse_json(raw);demand(validate_evaluation_result(evaluation)["ok"], "evaluation_invalid") demand(same(evaluation["subject"], input["producer_subject"])&&same(evaluation["input_evidence_ids"], [input["result_ref"], input["content_ref"]]), "stale_evaluation_subject") demand(same(evaluation["evaluator"], step["config"]["evaluator"]), "evaluator_identity_mismatch") @@ -56,6 +58,7 @@ func local_facts(graph, id, decision, host) { fact = "sha256:" + sha256(to_json(decision));raws = push(push(raws, to_json(decision)), to_json(review)) } data := {"schema":"dispatch.node-terminal-candidate/v1alpha1", "node_id":id, "subject":subject(graph, id), "contract":contract, "binding_ref":binding_ref, "fact_ref":fact, "policy_ref":null, "outcome":outcome} + if contract == "evaluation-result/v1"&&resources_enabled(graph) {data["eval_attempt_id"] := eval_current(graph, id)["attempt_id"]} if policy != null {data["policy_ref"] := "sha256:" + sha256(to_json(policy))} return {"candidate":candidate(graph, data), "artifacts":raws} } @@ -121,12 +124,17 @@ export func scoped_outcome_facts(graph, host, scope) { } } if accounting_enabled(graph)&&accounting_budget(graph)["reserved"] > 0 {policy_block = true} + if resources_enabled(graph) { + if eval_budget(graph)["reserved"] > 0 {policy_block = true} + for id in keys(dict_get_or(graph, "eval_attempts", {})) {for row in graph["eval_attempts"][id] {if row["dispatch"] != null&&row["resolution"] == null {inflight = 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)} + if resources_enabled(graph) {raw := to_json({"eval_attempts":dict_get_or(graph, "eval_attempts", {}), "sources":dict_get_or(graph, "resource_sources", {})});data["resources_ref"] := "sha256:" + sha256(raw);data["eval_budget"] := eval_budget(graph);raws = push(raws, raw)} return {"candidate":candidate(graph, data), "artifacts":raws} } func review_request(graph, id, host) { diff --git a/src/core/graph_transition.kujo b/src/core/graph_transition.kujo index d8b4860..5830411 100644 --- a/src/core/graph_transition.kujo +++ b/src/core/graph_transition.kujo @@ -1,3 +1,4 @@ +from src.core.resource_ledger import resource_event, fold_resource, resource_history, resource_raw 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. @@ -6,7 +7,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 attempt_event(kind)||policy_event(kind)||contains(["graph_node_bound", "graph_review_requested", "graph_finalized"], kind)} +export func graph_event(kind) {return resource_event(kind)||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") @@ -17,6 +18,13 @@ 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 resource_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, "resource_candidate_stale") + if kind == "graph_resources_reserved" {for item in c["programs"] {record := parse_json(resource_raw(state, item["record_ref"]));state = fold_attempt(state, "graph_attempt_reserved", record)}} + if kind == "graph_resources_reserved" {bindings := dict_get_or(state, "graph_node_bindings", {});for item in c["evaluations"] {id := item["node_id"];binding := parse_json(resource_raw(state, item["binding_ref"]));demand(binding["node_id"] == id&&binding["graph"]["run_id"] == state["run_id"], "resource_binding_subject_mismatch");if has_key(bindings, id) {demand(to_json(bindings[id]) == to_json(binding), "resource_binding_changed")};bindings[id] := binding};state["graph_node_bindings"] := bindings} + state = fold_resource(state, kind, data);state["status"] := "paused";return state + } 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") @@ -48,7 +56,7 @@ export func apply_graph_transition(state, kind, data) { return state } export func graph_history_projection(state, events) { - policy_history(state, events);attempt_history(state, events) + policy_history(state, events);attempt_history(state, events);resource_history(state, events) bindings := {};reviews := {};finalized := null for event in events { kind := event["kind"] @@ -56,6 +64,7 @@ export func graph_history_projection(state, events) { demand(finalized == null, "graph_event_after_terminal") data := event["details"]["data"] if policy_event(kind)||attempt_event(kind) {graph_refs(state, data["artifacts"])} + if kind == "graph_resources_reserved" {for item in data["candidate"]["evaluations"] {id := item["node_id"];binding := parse_json(resource_raw(state, item["binding_ref"]));if has_key(bindings, id) {demand(to_json(bindings[id]) == to_json(binding), "resource_binding_changed")};bindings[id] := binding}} 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 7a3a41d..6312fba 100644 --- a/src/core/node_composition.kujo +++ b/src/core/node_composition.kujo @@ -1,3 +1,4 @@ +from src.core.resource_ledger import validate_resources, resource_guard 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 @@ -24,7 +25,7 @@ func ancestors(state, id) { } export func validate_composed_definition(state) { demand(composition_graph(state)&&assurance_protected(state)&&validate_assurance_anchor(state), "node_graph_authority_required") - validate_parent_topology(state);validate_static_policy(state) + validate_parent_topology(state);validate_static_policy(state);validate_resources(state) definition := state["workflow_definition"];steps := definition["steps"] demand(len(steps) > 0&&len(steps) <= 8&&definition["max_parallel_steps"] == 1, "node_graph_limit") ids := [];runs := [] @@ -230,7 +231,7 @@ export func advance_composed_step(graph, index, options) { 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 has_key(dict_get_or(graph, "node_dispatches", {}), id) == 0 {resource_guard(graph);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)||dict_get_or(result, "refused_before_admission", false), "node_start_denied") @@ -326,7 +327,7 @@ export func assess_attempt(graph, id, action, host) { 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") + resource_guard(graph);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") diff --git a/src/core/resource_facts.kujo b/src/core/resource_facts.kujo new file mode 100644 index 0000000..86d2e5a --- /dev/null +++ b/src/core/resource_facts.kujo @@ -0,0 +1,32 @@ +from src.core.runtime_resource_schema import runtime_resource_schema +# Host-local projections of existing artifacts, never provider adapters or collectors. +from src.core.utils import dict_get_or +func need(ok, reason) {if ok != true {throw(reason)}} +func number(value) {return (type(value) == "int"||type(value) == "float")&&value >= 0&&value <= 9007199254740991} +func count(value) {return type(value) == "int"&&number(value)} +func nullable(value) {need(value == null||count(value), "resource_count_invalid");return value} +export func resource_source_facts(kind, raw) { + need(type(raw) == "string"&&byte_length(raw) <= 65536, "resource_source_limit") + source := parse_json(raw) + if kind == "runtime" { + need(byte_length(raw) <= 8192&&len(keys(source)) <= 32&&json_schema_validate(source, runtime_resource_schema())["valid"], "runtime_source_schema_invalid") + need(source["schema"] == "kujo.runtime-measurements/v1"&&source["scope"] == "process"&&source["runtime"] == "vm"&&source["snapshot_consistency"] == "independent_counters"&&source["waited_for_detached"] == false, "runtime_source_invalid") + need(count(source["wall_ns"])&&len(keys(source["counters"])) <= 64, "runtime_count_invalid") + for key in keys(source["counters"]) {need(count(source["counters"][key]), "runtime_count_invalid")} + seen := [];for item in source["unsupported"] {need(contains(seen, item) == false, "runtime_unsupported_duplicate");seen = push(seen, item)} + cpu := source["cpu_seconds"];need(cpu == null||number(cpu), "runtime_cpu_invalid") + return {"class":"observed", "scope":"process", "wall_ns":source["wall_ns"], "cpu_seconds":cpu, "process_peak_rss_bytes":nullable(source["process_peak_rss_bytes"]), "counters":source["counters"], "hard_policy_eligible":false} + } + need(kind == "model"&&source["serialization_version"] == "kujo.context-ledger/v1"&&source["content_mode"] == "off"&&source["accounting_scope"] == "adapter_messages_and_tools", "model_source_invalid") + reported := {"input_tokens":null, "output_tokens":null};classification := "unknown" + if source["usage_source"] == "provider" { + classification = "provider_reported";usage := source["provider_usage"] + reported = {"input_tokens":nullable(dict_get_or(usage, "input_tokens", null)), "output_tokens":nullable(dict_get_or(usage, "output_tokens", null))} + } + estimated := null;need(len(source["components"]) <= 256, "resource_component_limit") + for component in source["components"] { + need(component["estimator"] == "kujo.weighted-characters/v1"&&count(component["estimated_tokens"]), "resource_estimate_invalid") + if estimated == null {estimated = 0};estimated = estimated + component["estimated_tokens"];need(count(estimated), "resource_sum_overflow") + } + return {"class":classification, "reported":reported, "estimated":{"class":"estimated", "component_tokens":estimated, "scope":"adapter_components"}, "monetary_cost":null} +} diff --git a/src/core/resource_ledger.kujo b/src/core/resource_ledger.kujo new file mode 100644 index 0000000..e813679 --- /dev/null +++ b/src/core/resource_ledger.kujo @@ -0,0 +1,128 @@ +# Pure resource history. Existing Dispatch journal and graph lock own transitions. +from src.core.utils import dict_get_or, ensure_dir +from src.core.resource_facts import resource_source_facts +func need(ok, reason) {if ok != true {throw(reason)}} +export func resources_policy(state) {return dict_get_or(dict_get_or(dict_get_or(state, "workflow_definition", {}), "metadata", {}), "graph_resources", null)} +export func resources_enabled(state) {return resources_policy(state) != null} +export func resource_step(state, id) {for step in state["workflow_definition"]["steps"] {if step["id"] == id {return step}};throw("resource_node_missing")} +export func eval_limit(state, id) {return dict_get_or(resource_step(state, id)["config"], "max_eval_attempts", 1)} +export func eval_current(state, id) {rows := dict_get_or(dict_get_or(state, "eval_attempts", {}), id, []);if len(rows) == 0 {return null};return rows[len(rows) - 1]} +export func validate_resources(state) { + if resources_enabled(state) == false {return true} + p := resources_policy(state) + need(p["schema"] == "dispatch.graph-resources/v1alpha1"&&state["workflow_definition"]["metadata"]["graph_accounting"] == "dispatch.graph-attempt-accounting/v1alpha1", "resource_policy_unsupported") + need(type(p["max_eval_attempts"]) == "int"&&p["max_eval_attempts"] >= 0&&p["max_eval_attempts"] <= 8&&type(p["require_provider_usage"]) == "bool"&&len(keys(p)) == 3, "resource_policy_invalid") + for step in state["workflow_definition"]["steps"] {if dict_get_or(step["config"], "terminal_contract", "") == "evaluation-result/v1" {n := eval_limit(state, step["id"]);need(type(n) == "int"&&n >= 1&&n <= 2, "eval_attempt_limit_invalid")}} + return true +} +export func eval_budget(state) { + consumed := 0;reserved := 0;released := 0 + for id in keys(dict_get_or(state, "eval_attempts", {})) {for row in state["eval_attempts"][id] { + if row["dispatch"] != null {consumed = consumed + 1} else if row["release"] != null {released = released + 1} else {reserved = reserved + 1} + }} + limit := resources_policy(state)["max_eval_attempts"];need(consumed + reserved <= limit, "eval_budget_oversubscribed") + return {"unit":"eval_dispatches", "limit":limit, "consumed":consumed, "reserved":reserved, "released":released, "available":limit - consumed - reserved} +} +export func resource_event(kind) {return contains(["graph_resources_reserved", "graph_eval_released", "graph_eval_dispatched", "graph_eval_resolved", "graph_resource_observed"], kind)} +export func resource_raw(state, ref) { + need(type(ref) == "string"&®ex_match(ref, "^sha256:[0-9a-f]{64}$"), "resource_ref_invalid") + raw := read_file_beneath(state["run_dir"], "node-input/" + substring(ref, 7, 71) + ".raw", 1048576) + need("sha256:" + sha256(raw) == ref, "resource_artifact_corrupt");return raw +} +export func resource_key(subject, kind) {return sha256(to_json({"subject":subject, "kind":kind}))} +export func resource_subjects(state) { + subjects := [] + for id in keys(dict_get_or(state, "graph_attempts", {})) {for row in state["graph_attempts"][id] {if row["dispatch"] != null {subjects = push(subjects, {"kind":"program", "node_id":id, "attempt_id":row["run_id"]})}}} + for id in keys(dict_get_or(state, "eval_attempts", {})) {for row in state["eval_attempts"][id] {if row["dispatch"] != null {subjects = push(subjects, {"kind":"eval", "node_id":id, "attempt_id":row["attempt_id"]})}}} + return subjects +} +export func resource_readings(state) { + readings := [];sources := dict_get_or(state, "resource_sources", {}) + for subject in resource_subjects(state) {for kind in ["runtime", "model"] { + entry := dict_get_or(sources, resource_key(subject, kind), null);fact := {"class":"unknown"};ref := null + if entry != null {ref = entry["candidate"]["source_ref"];fact = resource_source_facts(kind, resource_raw(state, ref))} + readings = push(readings, {"subject":subject, "source_kind":kind, "source_ref":ref, "facts":fact}) + }} + return readings +} +export func resource_guard(state) { + if resources_enabled(state) == false {return true} + readings := resource_readings(state) + if resources_policy(state)["require_provider_usage"] {for reading in readings {if reading["source_kind"] == "model" { + fact := reading["facts"];need(fact["class"] == "provider_reported"&&fact["reported"]["input_tokens"] != null&&fact["reported"]["output_tokens"] != null, "required_provider_usage_unknown") + }}} + return true +} +export func fold_resource(state, kind, data) { + need(resources_enabled(state), "resource_policy_required");c := data["candidate"] + refs := dict_get_or(state, "resource_artifacts", []);for ref in dict_get_or(data, "artifacts", []) {resource_raw(state, ref);if contains(refs, ref) == false {refs = push(refs, ref)}};state["resource_artifacts"] := refs + if kind == "graph_resource_observed" { + sources := dict_get_or(state, "resource_sources", {});key := resource_key(c["subject"], c["source_kind"]) + need(has_key(sources, key) == 0, "resource_source_already_recorded") + resource_source_facts(c["source_kind"], resource_raw(state, c["source_ref"]));sources[key] := data;state["resource_sources"] := sources;return state + } + history := dict_get_or(state, "eval_attempts", {}) + if kind == "graph_resources_reserved" { + for item in c["evaluations"] { + id := item["node_id"];rows := dict_get_or(history, id, []);row := eval_current(state, id);ordinal := 1 + if row != null { + ordinal = row["ordinal"] + if row["release"] == null {need(row["resolution"] != null&&row["resolution"]["candidate"]["outcome"] == "infrastructure_failed", "eval_retry_unsafe");ordinal = ordinal + 1} + need(item["binding_ref"] == row["binding_ref"], "eval_retry_input_changed") + } + need(ordinal <= eval_limit(state, id)&&item["ordinal"] == ordinal&&len(rows) < 16, "eval_attempt_limit") + need(eval_budget(state)["available"] > 0, "eval_budget_exhausted") + row = {"attempt_id":sha256(c["candidate_id"] + ":" + id), "ordinal":ordinal, "binding_ref":item["binding_ref"], "reservation":data, "dispatch":null, "release":null, "resolution":null} + rows = push(rows, row);history[id] := rows;state["eval_attempts"] := history + } + return state + } + id := c["node_id"];rows := history[id];row := rows[len(rows) - 1] + need(row["attempt_id"] == c["attempt_id"]&&row["release"] == null, "eval_attempt_stale") + if kind == "graph_eval_released" {need(row["dispatch"] == null&&row["resolution"] == null, "eval_release_unsafe");row["release"] := data} + else if kind == "graph_eval_dispatched" {need(row["dispatch"] == null&&row["resolution"] == null, "eval_already_consumed");row["dispatch"] := data} + else { + need(kind == "graph_eval_resolved"&&row["dispatch"] != null&&row["resolution"] == null&&contains(["completed", "infrastructure_failed"], c["outcome"]), "eval_resolution_conflict") + resource_raw(state, c["response_ref"]);row["resolution"] := data + } + rows[len(rows) - 1] := row;history[id] := rows;state["eval_attempts"] := history;eval_budget(state);return state +} +export func resource_history(state, events) { + view := {"workflow_definition":dict_get_or(state, "workflow_definition", {}), "run_dir":dict_get_or(state, "run_dir", "")} + for event in events {if resource_event(event["kind"]) {view = fold_resource(view, event["kind"], event["details"]["data"])}} + for key in ["eval_attempts", "resource_sources"] {need(to_json(dict_get_or(view, key, {})) == to_json(dict_get_or(state, key, {})), "resource_history_mismatch")} + for id in keys(dict_get_or(view, "eval_attempts", {})) {for row in view["eval_attempts"][id] {path := "eval-admissions/" + row["attempt_id"] + ".claim";exists := file_exists(state["run_dir"] + "/" + path);if exists {need(row["dispatch"] != null&&row["release"] == null&&resource_claim_bytes(id, row) == read_file_beneath(state["run_dir"], path, 8192), "eval_claim_corrupt")};if row["resolution"] != null&&row["resolution"]["candidate"]["outcome"] == "completed" {need(exists, "eval_claim_missing")}}} + need(to_json(dict_get_or(view, "resource_artifacts", [])) == to_json(dict_get_or(state, "resource_artifacts", [])), "resource_artifacts_history_mismatch") + return true +} + +export func resource_totals(state) { + input := 0;output := 0;estimated := 0;unknown_input := 0;unknown_output := 0;unknown_estimate := 0;wall := 0;unknown_wall := 0 + for reading in resource_readings(state) { + fact := reading["facts"] + if reading["source_kind"] == "runtime" {if fact["class"] == "unknown" {unknown_wall = unknown_wall + 1} else {wall = wall + fact["wall_ns"]}} + else { + usage := dict_get_or(fact, "reported", {});a := dict_get_or(usage, "input_tokens", null);b := dict_get_or(usage, "output_tokens", null);e := dict_get_or(dict_get_or(fact, "estimated", {}), "component_tokens", null) + if a == null {unknown_input = unknown_input + 1} else {input = input + a} + if b == null {unknown_output = unknown_output + 1} else {output = output + b} + if e == null {unknown_estimate = unknown_estimate + 1} else {estimated = estimated + e} + } + } + for n in [input, output, estimated, wall] {need(n >= 0&&n <= 9007199254740991, "resource_sum_overflow")} + input_total := null;output_total := null;estimate_total := null;wall_total := null + if unknown_input == 0 {input_total = input};if unknown_output == 0 {output_total = output};if unknown_estimate == 0 {estimate_total = estimated};if unknown_wall == 0 {wall_total = wall} + return {"reported_input_tokens":{"class":"provider_reported", "total":input_total, "known_sum":input, "unknown_attempts":unknown_input, "complete":unknown_input == 0}, "reported_output_tokens":{"class":"provider_reported", "total":output_total, "known_sum":output, "unknown_attempts":unknown_output, "complete":unknown_output == 0}, "estimated_component_tokens":{"class":"estimated", "total":estimate_total, "known_sum":estimated, "unknown_attempts":unknown_estimate}, "process_wall_ns":{"class":"observed", "total":wall_total, "known_sum":wall, "unknown_attempts":unknown_wall, "scope":"sum_of_process_intervals_not_graph_elapsed_or_cpu"}} +} + +# Installed evaluator workers call once after reloading the consumed dispatch. +# Exclusive retained claim closes accidental duplicate worker invocation too. +export func claim_evaluation(graph, id, attempt_id) { + row := eval_current(graph, id) + need(row != null&&row["attempt_id"] == attempt_id&&row["dispatch"] != null&&row["release"] == null&&row["resolution"] == null, "eval_dispatch_required") + path := "eval-admissions/" + attempt_id + ".claim" + ensure_dir(graph["run_dir"] + "/eval-admissions") + write_file_atomic_beneath(graph["run_dir"], path, resource_claim_bytes(id, row), false) + sync_directory_beneath(graph["run_dir"], "eval-admissions");return true +} + +func resource_claim_bytes(id, row) {return to_json({"node_id":id, "attempt_id":row["attempt_id"], "binding_ref":row["binding_ref"]})} diff --git a/src/core/resource_operation.kujo b/src/core/resource_operation.kujo new file mode 100644 index 0000000..ea8fd9b --- /dev/null +++ b/src/core/resource_operation.kujo @@ -0,0 +1,121 @@ +# Installed local API. Planning, reservation, dispatch and terminal authority differ. +from src.core.resource_ledger import resources_enabled, eval_budget, eval_current, eval_limit, resource_guard, resource_readings, resource_subjects, resource_key, resource_raw, resource_totals +from src.core.resource_facts import resource_source_facts +from src.core.graph_attempts import program_contract, accounting_budget +from src.core.graph_policy import policy_ready +from src.core.graph_outcome import candidate, authorize +from src.core.node_composition import runtime, spec, assess_attempt, endpoint, local_node_inputs, retain, persist_node_transition +from src.core.node_transition import node_reference +from src.core.state import load_run_state, acquire_run_lock, release_run_lock +from src.core.control import validate_evaluation_result +from src.core.portable_commitments import portable_json +from src.core.utils import dict_get_or +func need(ok, reason) {if ok != true {throw(reason)}} +func same(a, b) {return to_json(a) == to_json(b)} +func eval_binding(graph, id, host) { + need(spec(graph, id)["config"]["terminal_contract"] == "evaluation-result/v1"&&policy_ready(graph, spec(graph, id))&&has_key(dict_get_or(graph, "node_completions", {}), id) == 0, "eval_not_eligible") + need(type(dict_get_or(host, "evaluation_identity", null)) == "function"&&same(host["evaluation_identity"](id), spec(graph, id)["config"]["evaluator"]), "eval_configuration_stale") + current := local_node_inputs(graph, id, host);binding := dict_get_or(dict_get_or(graph, "graph_node_bindings", {}), id, current["binding"]) + need(same(current["binding"], binding), "eval_input_stale");return binding +} +func plan(graph, request, host) { + resource_guard(graph);ids := request["nodes"];need(type(ids) == "array"&&len(ids) > 0&&len(ids) <= 8, "reservation_plan_limit") + programs := [];evaluations := [];raws := [];seen := [];program_count := 0;eval_count := 0 + for id in ids { + need(contains(seen, id) == false, "reservation_plan_duplicate");seen = push(seen, id) + step := spec(graph, id);need(policy_ready(graph, step), "reservation_path_not_ready") + if program_contract(step) { + checked := assess_attempt(graph, id, "reserve", host);record := {"candidate":candidate(graph, checked["data"]), "artifacts":[]} + for raw in checked["artifacts"] {raws = push(raws, raw);record["artifacts"] := push(record["artifacts"], "sha256:" + sha256(raw))} + raw := to_json(record);raws = push(raws, raw);programs = push(programs, {"node_id":id, "record_ref":"sha256:" + sha256(raw)});program_count = program_count + 1 + } else { + binding := eval_binding(graph, id, host);ref := node_reference(binding);row := eval_current(graph, id);ordinal := 1 + if row != null { + ordinal = row["ordinal"];need(row["binding_ref"] == ref, "eval_retry_input_changed") + if row["release"] == null {need(row["resolution"] != null&&row["resolution"]["candidate"]["outcome"] == "infrastructure_failed", "eval_retry_unsafe");ordinal = ordinal + 1} + } + need(ordinal <= eval_limit(graph, id), "eval_attempt_limit") + for raw in local_node_inputs(graph, id, host)["artifacts"] {raws = push(raws, raw)} + evaluations = push(evaluations, {"node_id":id, "ordinal":ordinal, "binding_ref":ref});raws = push(raws, portable_json(binding));eval_count = eval_count + 1 + } + } + budget := accounting_budget(graph);evals := eval_budget(graph) + need(program_count <= budget["available"], "program_plan_capacity");need(eval_count <= evals["available"], "eval_plan_capacity") + data := {"schema":"dispatch.resource-plan/v1alpha1", "programs":programs, "evaluations":evaluations, "program_units":program_count, "eval_units":eval_count} + return {"candidate":candidate(graph, data), "artifacts":raws} +} +func inspect_action(graph, request, host) { + action := request["action"] + if action == "reserve" {return plan(graph, request, host)} + if action == "observe" { + subject := request["subject"];found := false;for existing in resource_subjects(graph) {if same(existing, subject) {found = true}};need(found, "resource_subject_not_consumed") + kind := request["source_kind"];need(contains(["runtime", "model"], kind), "resource_kind_invalid") + need(has_key(dict_get_or(graph, "resource_sources", {}), resource_key(subject, kind)) == 0, "resource_source_already_recorded") + need(type(dict_get_or(host, "read_resource_source", null)) == "function", "resource_source_unavailable") + source := host["read_resource_source"](subject, kind) + need(source != null, "resource_source_unknown");need(same(source["subject"], subject)&&source["source_kind"] == kind, "resource_source_subject_mismatch") + raw := source["raw"];resource_source_facts(kind, raw) + return {"candidate":candidate(graph, {"schema":"dispatch.resource-observation/v1alpha1", "subject":subject, "source_kind":kind, "source_ref":"sha256:" + sha256(raw)}), "artifacts":[raw]} + } + id := request["node_id"];binding := eval_binding(graph, id, host);row := eval_current(graph, id) + need(row != null&&row["binding_ref"] == node_reference(binding)&&row["release"] == null, "eval_reservation_required") + if action == "resolve" {need(type(dict_get_or(host, "read_evaluation_attempt", null)) == "function", "eval_readback_unavailable");return resolution_facts(graph, id, host["read_evaluation_attempt"](id, binding, row["attempt_id"]), host)} + if action == "dispatch" {resource_guard(graph);need(row["dispatch"] == null&&row["resolution"] == null&&type(dict_get_or(host, "start_evaluation", null)) == "function", "eval_already_consumed_or_unavailable")} + else {need(action == "release"&&row["dispatch"] == null&&row["resolution"] == null, "eval_release_unsafe")} + return {"candidate":candidate(graph, {"schema":"dispatch.eval-action/v1alpha1", "node_id":id, "attempt_id":row["attempt_id"], "action":action, "binding_ref":row["binding_ref"]}), "artifacts":[]} +} +func persist(graph, kind, checked, actor) { + actor_raw := to_json(actor);raws := push(checked["artifacts"], actor_raw);retain(graph, raws);refs := [] + for raw in raws {refs = push(refs, "sha256:" + sha256(raw))} + return persist_node_transition(graph, kind, {"candidate":checked["candidate"], "actor_ref":"sha256:" + sha256(actor_raw), "artifacts":refs, "resulting_revision":graph["revision"] + 1}) +} +func resolution_facts(graph, id, response, host) { + row := eval_current(graph, id);binding := eval_binding(graph, id, host) + need(row["dispatch"] != null&&row["resolution"] == null&&row["binding_ref"] == node_reference(binding), "eval_resolution_not_pending") + need(response["attempt_id"] == row["attempt_id"]&&response["binding_ref"] == row["binding_ref"]&&contains(["completed", "infrastructure_failed"], response["status"]), "eval_response_identity_mismatch") + raws := [];result_ref := null + if response["status"] == "completed" { + claim := read_file_beneath(graph["run_dir"], "eval-admissions/" + row["attempt_id"] + ".claim", 8192);need(claim == to_json({"node_id":id, "attempt_id":row["attempt_id"], "binding_ref":row["binding_ref"]}), "eval_claim_missing_or_corrupt") + raw := response["evaluation_raw"];need(type(raw) == "string"&&byte_length(raw) <= 1048576, "evaluation_limit");evaluation := parse_json(raw);input := binding["inputs"][0] + need(validate_evaluation_result(evaluation)["ok"]&&same(evaluation["subject"], input["producer_subject"])&&same(evaluation["input_evidence_ids"], [input["result_ref"], input["content_ref"]])&&same(evaluation["evaluator"], spec(graph, id)["config"]["evaluator"]), "eval_result_identity_mismatch") + result_ref = "sha256:" + sha256(raw);raws = push(raws, raw) + } else {need(type(response["reason"]) == "string"&&len(response["reason"]) > 0&&len(response["reason"]) <= 256, "eval_infrastructure_evidence_required")} + # Only the installed invocation/readback adapter can produce this exact response. + response_raw := to_json(response);need(byte_length(response_raw) <= 1048576, "eval_response_limit");raws = push(raws, response_raw) + checked := {"candidate":candidate(graph, {"schema":"dispatch.eval-resolution/v1alpha1", "node_id":id, "attempt_id":row["attempt_id"], "binding_ref":row["binding_ref"], "outcome":response["status"], "result_ref":result_ref, "response_ref":"sha256:" + sha256(response_raw)}), "artifacts":raws} + return checked +} +export func resource_operation(root, run_id, request, options) { + loaded := load_run_state(root, run_id);if loaded["ok"] == false {return loaded} + lock := null;children := [];answer := {"ok":false};apply := request["operation"] == "apply" + 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(resources_enabled(graph), "resource_policy_required");host := runtime(graph, options) + if request["operation"] == "report" { + answer = {"ok":true, "report":{"schema":"dispatch.resource-report/v1alpha1", "run_id":run_id, "revision":graph["revision"], "journal":graph["control_journal"]["last_sha256"], "programs":accounting_budget(graph), "evaluations":eval_budget(graph), "eval_attempts":dict_get_or(graph, "eval_attempts", {}), "readings":resource_readings(graph), "totals":resource_totals(graph), "monetary_cost":{"class":"unknown", "value":null}, "authority":"informational"}} + } else { + need(has_key(graph, "graph_finalization") == 0, "resource_graph_terminal") + if apply&&request["action"] == "reserve" {for id in request["nodes"] {if program_contract(spec(graph, id)) {child := acquire_run_lock(endpoint(graph, id, host)["state"]);need(child["ok"], "resource_child_locked");children = push(children, child)}}} + checked := inspect_action(graph, request, host) + if apply { + need(same(checked["candidate"], request["candidate"]), "stale_resource_plan");authorize(host, request["actor"], graph, checked["candidate"]) + hook := dict_get_or(options, "graph_boundary", null);if type(hook) == "function" {hook("before_resource")} + retain(graph, checked["artifacts"]);graph = load_run_state(root, run_id)["run_state"];host = runtime(graph, options);latest := inspect_action(graph, request, host) + need(same(latest["candidate"], request["candidate"]), "stale_resource_plan");authorize(host, request["actor"], graph, latest["candidate"]) + action := request["action"];kind := "graph_resources_reserved";if action == "release" {kind = "graph_eval_released"};if action == "dispatch" {kind = "graph_eval_dispatched"};if action == "observe" {kind = "graph_resource_observed"};if action == "resolve" {kind = "graph_eval_resolved"} + graph = persist(graph, kind, latest, request["actor"]) + if type(hook) == "function" {hook("after_" + kind)} + if action == "dispatch" { + id := request["node_id"];host = runtime(graph, options);binding := eval_binding(graph, id, host);row := eval_current(graph, id) + response := host["start_evaluation"](id, binding, row["attempt_id"]) + if type(hook) == "function" {hook("after_eval_work")} + graph = load_run_state(root, run_id)["run_state"];host = runtime(graph, options) + graph = persist(graph, "graph_eval_resolved", resolution_facts(graph, id, response, host), request["actor"]) + if type(hook) == "function" {hook("after_eval_resolution")} + } + answer = {"ok":true, "revision":graph["revision"], "continuation":"not_authorized"} + } else {need(request["operation"] == "assess", "resource_operation_invalid");answer = {"ok":true, "candidate":checked["candidate"], "authority":"informational"}} + } + } except err {answer = {"ok":false, "reason":to_string(err), "authority":"informational"}} + for child in children {release_run_lock(child)};if lock != null {release_run_lock(lock)};return answer +} diff --git a/src/core/retained_recovery.kujo b/src/core/retained_recovery.kujo index 7689c14..4cb292b 100644 --- a/src/core/retained_recovery.kujo +++ b/src/core/retained_recovery.kujo @@ -179,7 +179,7 @@ func analyze(state) { } } node_binding := dict_get_or(reconstructed, "node_input_binding", null) - node_refs := [];if node_binding != null {node_refs = node_binding["artifacts"]} + node_refs := dict_get_or(reconstructed, "resource_artifacts", []);if node_binding != null {node_refs = node_binding["artifacts"]} for id in keys(dict_get_or(reconstructed, "graph_node_bindings", {})) {for ref in reconstructed["graph_node_bindings"][id]["artifacts"] {node_refs = push(node_refs, ref)}} 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)}}} diff --git a/src/core/runtime_resource_schema.kujo b/src/core/runtime_resource_schema.kujo new file mode 100644 index 0000000..d32c5b4 --- /dev/null +++ b/src/core/runtime_resource_schema.kujo @@ -0,0 +1,8 @@ +# Kujo e65bb57 runtime-measurements/v1 schema embedded for cwd-independent validation. +# The runtime validator lacks maxProperties/uniqueItems; resource_facts enforces them. +func supported_schema(value) { + if type(value) == "dict" {result := {};for key in keys(value) {if key != "maxProperties"&&key != "uniqueItems" {result[key] := supported_schema(value[key])}};return result} + if type(value) == "array" {result := [];for item in value {result = push(result, supported_schema(item))};return result} + return value +} +export func runtime_resource_schema() {return supported_schema(parse_json("{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://kujolang.ai/schemas/runtime-measurements/v1.json\",\n \"title\": \"Kujo runtime measurements v1\",\n \"type\": \"object\",\n \"required\": [\n \"schema\",\n \"scope\",\n \"runtime\",\n \"runtime_version\",\n \"outcome\",\n \"wall_ns\",\n \"counters\",\n \"snapshot_consistency\",\n \"waited_for_detached\",\n \"unsupported\",\n \"cpu_seconds\",\n \"process_peak_rss_bytes\"\n ],\n \"properties\": {\n \"schema\": {\n \"const\": \"kujo.runtime-measurements/v1\"\n },\n \"scope\": {\n \"const\": \"process\"\n },\n \"runtime\": {\n \"const\": \"vm\"\n },\n \"runtime_version\": {\n \"type\": \"string\",\n \"maxLength\": 64\n },\n \"outcome\": {\n \"enum\": [\n \"success\",\n \"runtime_error\",\n \"compile_error\",\n \"internal_error\"\n ]\n },\n \"wall_ns\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"counters\": {\n \"type\": \"object\",\n \"maxProperties\": 64,\n \"required\": [\n \"vm_entries\",\n \"vm_inclusive_wall_ns\",\n \"vm_call_opcodes\",\n \"vm_return_opcodes\",\n \"vm_native_call_opcodes\",\n \"scheduler_rounds\",\n \"vm_closures_created\",\n \"vm_capture_cells_created\",\n \"vm_capture_value_shallow_bytes\",\n \"vm_generator_states_created\",\n \"vm_generator_state_drops\",\n \"vm_generator_state_shallow_bytes\",\n \"vm_generator_resume_attempts\",\n \"tasks_admitted\",\n \"tasks_admission_rejected\",\n \"tasks_started\",\n \"task_bodies_exited\",\n \"task_completions_published\",\n \"task_cancellations_published\",\n \"task_queue_wall_ns\",\n \"detached_tasks_observed\",\n \"promise_polls\",\n \"promise_pending_polls\",\n \"promise_ready_polls\",\n \"jit_compile_entries\",\n \"jit_compile_inclusive_wall_ns\",\n \"jit_cache_lookup_hits\",\n \"jit_cache_lookup_misses\",\n \"jit_type_guard_passes\",\n \"jit_type_guard_failures\"\n ],\n \"properties\": {\n \"vm_entries\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_inclusive_wall_ns\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_call_opcodes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_return_opcodes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_native_call_opcodes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"scheduler_rounds\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_closures_created\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_capture_cells_created\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_capture_value_shallow_bytes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_generator_states_created\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_generator_state_drops\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_generator_state_shallow_bytes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"vm_generator_resume_attempts\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"tasks_admitted\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"tasks_admission_rejected\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"tasks_started\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"task_bodies_exited\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"task_completions_published\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"task_cancellations_published\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"task_queue_wall_ns\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"detached_tasks_observed\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"promise_polls\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"promise_pending_polls\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"promise_ready_polls\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_compile_entries\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_compile_inclusive_wall_ns\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_cache_lookup_hits\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_cache_lookup_misses\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_type_guard_passes\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n },\n \"jit_type_guard_failures\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n }\n },\n \"additionalProperties\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 18446744073709551615\n }\n },\n \"snapshot_consistency\": {\n \"const\": \"independent_counters\"\n },\n \"waited_for_detached\": {\n \"const\": false\n },\n \"unsupported\": {\n \"type\": \"array\",\n \"maxItems\": 32,\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"maxLength\": 64\n }\n },\n \"cpu_seconds\": {\n \"type\": [\n \"number\",\n \"null\"\n ],\n \"minimum\": 0\n },\n \"process_peak_rss_bytes\": {\n \"type\": [\n \"integer\",\n \"null\"\n ],\n \"minimum\": 0\n }\n },\n \"maxProperties\": 32\n}\n"))} diff --git a/tests/artifact_policy_tests.sh b/tests/artifact_policy_tests.sh new file mode 100644 index 0000000..4891466 --- /dev/null +++ b/tests/artifact_policy_tests.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail +source_root="$(cd "$(dirname "$0")/.." && pwd)" +fixture="$(mktemp -d)" +trap 'rm -rf "$fixture"' EXIT +mkdir -p "$fixture/.github/scripts" "$fixture/config" "$fixture/docs/evidence/resource-accounting" +cp "$source_root/.github/scripts/check-kujo-tool-artifacts.sh" "$fixture/.github/scripts/" +cp "$source_root/config/kujo-tool-artifacts.gitignore" "$fixture/config/" +cp "$source_root/.gitignore" "$fixture/.gitignore" +git -C "$fixture" init -q +git -C "$fixture" config user.name fixture +git -C "$fixture" config user.email fixture@example.invalid +git -C "$fixture" add . +git -C "$fixture" commit -qm initial +base="$(git -C "$fixture" rev-parse HEAD)" +printf 'retained proof\n' > "$fixture/docs/evidence/resource-accounting/proof.log" +git -C "$fixture" add docs/evidence/resource-accounting/proof.log +git -C "$fixture" commit -qm evidence +bash "$fixture/.github/scripts/check-kujo-tool-artifacts.sh" "$base" HEAD +# Both source-rule coverage and accidental output detection remain enforced. +sed '/^!docs\/evidence\/resource-accounting\/\*\.log$/d' "$fixture/.gitignore" > "$fixture/reduced" +mv "$fixture/reduced" "$fixture/.gitignore" +if bash "$fixture/.github/scripts/check-kujo-tool-artifacts.sh" "$base" HEAD > "$fixture/coverage.txt" 2>&1; then exit 1; fi +grep -q 'missing rules' "$fixture/coverage.txt" +cp "$source_root/.gitignore" "$fixture/.gitignore" +printf 'ordinary output\n' > "$fixture/runtime.log" +git -C "$fixture" add -f runtime.log +git -C "$fixture" commit -qm accidental +if bash "$fixture/.github/scripts/check-kujo-tool-artifacts.sh" "$base" HEAD > "$fixture/guard.txt" 2>&1; then exit 1; fi +grep -q 'Artifact path: runtime.log' "$fixture/guard.txt" +printf 'Artifact policy: 3 checks passed.\n' diff --git a/tests/ci_graph_layout_tests.sh b/tests/ci_graph_layout_tests.sh new file mode 100755 index 0000000..5fe6748 --- /dev/null +++ b/tests/ci_graph_layout_tests.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail +script="$(cd "$(dirname "$0")/.." && pwd)/scripts/prepare_graph_fixture_layout.sh" +fixture_root="$(mktemp -d "${TMPDIR:-/tmp}/dispatch-ci-layout-test.XXXXXX")" +trap 'rm -rf "$fixture_root"' EXIT +workspace="$fixture_root/dispatch" +mkdir -p "$workspace/.ci/workcell-wave-f/src" "$workspace/.ci/eval-wave-f/src" "$workspace/.ci/agents-sdk-wave-d/src" +GITHUB_WORKSPACE="$workspace" bash "$script" +for name in workcell eval agents-sdk; do test -L "$fixture_root/$name"; done +GITHUB_WORKSPACE="$workspace" bash "$script" +echo 'PASS complete layout and exact idempotent reuse' +release_workspace="$fixture_root/tag/dispatch" +mkdir -p "$release_workspace/.release/workcell-wave-f/src" "$release_workspace/.release/eval-wave-f/src" "$release_workspace/.release/agents-sdk-wave-d/src" +GITHUB_WORKSPACE="$release_workspace" DISPATCH_GRAPH_FIXTURE_ROOT="$release_workspace/.release" bash "$script" +test "$(readlink "$fixture_root/tag/eval")" = "$release_workspace/.release/eval-wave-f" +echo 'PASS tagged release layout uses the explicit source root' +rm "$fixture_root/workcell" +mkdir "$fixture_root/workcell" +printf 'preserve\n' > "$fixture_root/workcell/user-file" +if GITHUB_WORKSPACE="$workspace" bash "$script" >"$fixture_root/refusal" 2>&1; then exit 1; fi +test "$(cat "$fixture_root/workcell/user-file")" = preserve +echo 'PASS existing checkout is preserved and rejected' +rm "$fixture_root/workcell/user-file" +rmdir "$fixture_root/workcell" +ln -s "$workspace/.ci/eval-wave-f" "$fixture_root/workcell" +if GITHUB_WORKSPACE="$workspace" bash "$script" >"$fixture_root/refusal" 2>&1; then exit 1; fi +test "$(readlink "$fixture_root/workcell")" = "$workspace/.ci/eval-wave-f" +echo 'PASS conflicting alias is preserved and rejected' +rm "$fixture_root/workcell" +rmdir "$workspace/.ci/workcell-wave-f/src" +if GITHUB_WORKSPACE="$workspace" bash "$script" >"$fixture_root/refusal" 2>&1; then exit 1; fi +test ! -e "$fixture_root/workcell" +echo 'PASS missing dependency source rejects' diff --git a/tests/graph_attempt_binding_safety.mjs b/tests/graph_attempt_binding_safety.mjs index 20e1870..daa6805 100644 --- a/tests/graph_attempt_binding_safety.mjs +++ b/tests/graph_attempt_binding_safety.mjs @@ -9,6 +9,6 @@ async function fresh(d,request={},extra={},marker=null,mode='policy-op',id='grap 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 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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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_recovery.mjs b/tests/graph_attempt_recovery.mjs index 7960005..9aa8ca9 100644 --- a/tests/graph_attempt_recovery.mjs +++ b/tests/graph_attempt_recovery.mjs @@ -9,7 +9,7 @@ async function fresh(d,request={},extra={},marker=null,mode='policy-op',id='grap 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 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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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'); diff --git a/tests/heterogeneous_recovery.mjs b/tests/heterogeneous_recovery.mjs index e8e131c..b269058 100644 --- a/tests/heterogeneous_recovery.mjs +++ b/tests/heterogeneous_recovery.mjs @@ -4,7 +4,7 @@ function request(d,value){const p=join(d,'fresh-request-'+serial+++'.json');writ async function child(d,req,extra={},marker=null,mode='graph-op'){const path=request(d,req);return await new Promise((done,reject)=>{const p=spawn(kujo,['run',fixture,d,mode,'graph',path],{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 repair(d){const p=run(d,'op','graph',{operation:'recovery-plan'});assert.equal(p.ok,true,JSON.stringify(p));assert.ok(p.plan.repairs.length,JSON.stringify(p));const a=run(d,'op','graph',{operation:'recovery-apply',plan:p.plan});assert.equal(a.ok,true,JSON.stringify(a));assert.equal(a.continuation,'not_authorized');return a} // A private pinned source copy stops between actual immutable publication and index append. -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 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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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');const point=' append_file(path, line)';assert.ok(code.includes(point));code=code.replace(point,' if env("GRAPH_RECORD_CRASH") == kind {print("CRASH:immutable-graph-record");sleep(30000)}\n'+point);fs.writeFileSync(journal,code);process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); const d=setup('heterogeneous-recovery',[program('A'),evaluator('E','A'),human('H',['A'],[edge('A')])]);run(d,'drive');finishProgram(d,'A');run(d,'drive');run(d,'evaluate','E');const ea=gop(d,'node-assess',{node_id:'E'});assert.equal(ea.ok,true,JSON.stringify(ea)); await child(d,{operation:'node-finalize',node_id:'E',candidate:ea.candidate},{NODE_CRASH:'after_terminal'},'CRASH:after_terminal');assert.equal(state(d).node_completions.E.terminal.outcome,'completed');assert.equal(gop(d,'graph-assess').candidate.outcome,'blocked');pass('Eval terminal reply loss survives a fresh controller without a fake execution'); diff --git a/tests/node_composition_fixture.kujo b/tests/node_composition_fixture.kujo index e7a725b..22a9e6a 100644 --- a/tests/node_composition_fixture.kujo +++ b/tests/node_composition_fixture.kujo @@ -1,3 +1,4 @@ +from src.core.resource_operation import resource_operation from src.core.graph_policy_operation import graph_policy_operation from src.core.graph_outcome import graph_terminal_operation from src.core.node_transition import node_raw @@ -28,7 +29,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_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})} + for path in ["src/core/runtime_resource_schema.kujo", "src/core/resource_ledger.kujo", "src/core/resource_facts.kujo", "src/core/resource_operation.kujo", "tests/resource_eval_worker.kujo", "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)}} @@ -40,6 +41,18 @@ func graph_host(revision, current) { 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["evaluation_identity"] := func(id) {return {"name":"eval", "version":"2.0.0", "configuration_sha256":sha256(read_file_beneath(base + "/" + id, "eval-config.json", 65536))}} + host["start_evaluation"] := func(id, binding, attempt) { + path := base + "/" + id + result := spawn_process([env("KUJO_BIN"), "run", "--measurements", path + "/resource-" + attempt + "-runtime.json", "tests/resource_eval_worker.kujo", base, id, attempt], {"cwd":os_getcwd(), "inherit_env":true, "timeout_ms":120000, "max_output_bytes":1048576}) + response := {"attempt_id":attempt, "binding_ref":"sha256:" + sha256(portable_json(binding)), "status":"completed", "evaluation_raw":result.stdout} + if result.timed_out||result.cancelled||result.stdout_truncated||result.stderr_truncated {throw("eval_termination_uncertain")} + if result.success == false {response = {"attempt_id":attempt, "binding_ref":"sha256:" + sha256(portable_json(binding)), "status":"infrastructure_failed", "reason":"installed evaluator worker terminated with an infrastructure error"}} + if dict_get_or(cfg(path), "wrong_subject", false)&&result.success {evaluation := parse_json(result.stdout);evaluation["subject"] := {"run_id":"wrong"};response["evaluation_raw"] := to_json(evaluation)} + write_file_atomic_beneath(path, "response-" + attempt + ".json", to_json(response), false);return response + } + host["read_evaluation_attempt"] := func(id, binding, attempt) {return parse_json(read_file_beneath(base + "/" + id, "response-" + attempt + ".json", 1048576))} + host["read_resource_source"] := func(subject, kind) {path := base + "/" + subject["node_id"];relative := "resource-" + subject["attempt_id"] + "-" + kind + ".json";if file_exists(path + "/" + relative) == false {return null};return {"subject":subject, "source_kind":kind, "raw":read_file_beneath(path, relative, 65536)}} 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} } @@ -79,10 +92,11 @@ func graph_workflow() { 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]}} + for key in ["max_eval_attempts", "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_resources") {metadata["graph_resources"] := definition["graph_resources"]} 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}) @@ -131,6 +145,8 @@ if mode == "init-node" { config := {"descriptor":descriptor(base)};write_file(base + "/host.json", to_json(config), true) created := create_negotiated_run(graph_workflow(), {}, base + "/runs", {}, config["descriptor"], graph_host);need(created["ok"]) write_file(base + "/pointer.json", to_json({"run_id":created["run_state"]["run_id"], "run_dir":created["run_state"]["run_dir"]}), true);print(to_json({"ok":true})) +} else if mode == "resource-op" { + request := parse_json(read_file(arguments[3]));print(to_json(resource_operation(base + "/runs", pointer(base)["run_id"], request, graph_options()))) } else if mode == "policy-op" { request := parse_json(read_file(arguments[3]));print(to_json(graph_policy_operation(base + "/runs", pointer(base)["run_id"], request, graph_options()))) } else if mode == "graph-op" { diff --git a/tests/node_composition_recovery.mjs b/tests/node_composition_recovery.mjs index 7cd304f..b9e3f78 100644 --- a/tests/node_composition_recovery.mjs +++ b/tests/node_composition_recovery.mjs @@ -20,7 +20,7 @@ assert.equal(state(raced,'B').parent_finalization,undefined);fs.writeFileSync(pa const orphan=setup('unreferenced-content',[two[0]]),a=state(orphan,'A');fs.mkdirSync(join(a.run_dir,'node-input'));const raw='{"unreferenced":true}';fs.writeFileSync(join(a.run_dir,'node-input',hash(raw)+'.raw'),raw);const assessed=run(orphan,'op','A',{operation:'recovery-plan'});assert.equal(assessed.ok,true,JSON.stringify(assessed));assert.equal(assessed.plan.repairs.length,0);assert.equal(state(orphan,'A').node_input_binding,undefined);record('raw output orphan cannot synthesize a binding'); // Kill the real immutable-record write in a disposable pinned controller copy. // Production contains no environment-controlled journal corruption hook. -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 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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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'),point=' append_file(path, line)';let source=fs.readFileSync(journal,'utf8');assert.ok(source.includes(point));source=source.replace(point,' if env("NODE_RECORD_CRASH") == kind {print("CRASH:immutable-node-record");sleep(30000)}\n'+point);fs.writeFileSync(journal,source);process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); for(const kind of ['node_inputs_bound','node_terminal_observed']){ const d=prepare('immutable-'+kind);let args; diff --git a/tests/resource_contract_tests.kujo b/tests/resource_contract_tests.kujo new file mode 100644 index 0000000..b14dd0c --- /dev/null +++ b/tests/resource_contract_tests.kujo @@ -0,0 +1,29 @@ +from src.core.runtime_resource_schema import runtime_resource_schema +from src.core.resource_ledger import validate_resources, eval_budget, fold_resource, eval_current, resource_guard +from src.core.resource_facts import resource_source_facts +checks := 0 +func check(ok) {if ok != true {throw("resource_contract_failed")};checks = checks + 1} +func rejects(callback) {caught := false;try {callback()} except err {caught = true};check(caught)} +func graph() {return {"workflow_definition":{"metadata":{"graph_accounting":"dispatch.graph-attempt-accounting/v1alpha1", "graph_resources":{"schema":"dispatch.graph-resources/v1alpha1", "max_eval_attempts":1, "require_provider_usage":false}}, "steps":[{"id":"E", "config":{"terminal_contract":"evaluation-result/v1", "max_eval_attempts":2}}, {"id":"F", "config":{"terminal_contract":"evaluation-result/v1"}}]}}} +func reservation(id, candidate_id) {return {"candidate":{"candidate_id":candidate_id, "evaluations":[{"node_id":id, "ordinal":1, "binding_ref":"exact-input"}]}}} +g := graph();check(validate_resources(g));check(eval_budget(g)["available"] == 1) +g = fold_resource(g, "graph_resources_reserved", reservation("E", "r1"));check(eval_budget(g)["reserved"] == 1&&eval_budget(g)["consumed"] == 0) +rejects(func() {fold_resource(g, "graph_resources_reserved", reservation("F", "r2"))}) +row := eval_current(g, "E");action := {"candidate":{"node_id":"E", "attempt_id":row["attempt_id"]}} +released := fold_resource(g, "graph_eval_released", action);check(eval_budget(released)["available"] == 1&&eval_budget(released)["released"] == 1) +rejects(func() {fold_resource(released, "graph_eval_dispatched", action)}) +g = fold_resource(g, "graph_eval_dispatched", action);check(eval_budget(g)["consumed"] == 1&&eval_budget(g)["reserved"] == 0) +rejects(func() {fold_resource(g, "graph_eval_dispatched", action)}) +rejects(func() {fold_resource(g, "graph_eval_released", action)}) +rejects(func() {fold_resource(g, "graph_resources_reserved", reservation("E", "r3"))}) +model := {"serialization_version":"kujo.context-ledger/v1", "content_mode":"off", "accounting_scope":"adapter_messages_and_tools", "usage_source":"provider", "provider_usage":{"input_tokens":10, "output_tokens":null}, "components":[{"estimated_tokens":8, "estimator":"kujo.weighted-characters/v1"}]} +fact := resource_source_facts("model", to_json(model));check(fact["class"] == "provider_reported"&&fact["reported"]["output_tokens"] == null&&fact["estimated"]["component_tokens"] == 8) +model["usage_source"] := "fixture";fact = resource_source_facts("model", to_json(model));check(fact["class"] == "unknown"&&fact["reported"]["input_tokens"] == null&&fact["estimated"]["class"] == "estimated") +model["usage_source"] := "provider";model["provider_usage"] := {"input_tokens":-1};rejects(func() {resource_source_facts("model", to_json(model))}) +strict := graph();p := strict["workflow_definition"]["metadata"]["graph_resources"];p["require_provider_usage"] := true;definition := strict["workflow_definition"];metadata := definition["metadata"];metadata["graph_resources"] := p;definition["metadata"] := metadata;strict["workflow_definition"] := definition +strict["graph_attempts"] := {"B":[{"run_id":"B1", "dispatch":{}}]};rejects(func() {resource_guard(strict)}) +runtime := {"schema":"kujo.runtime-measurements/v1", "scope":"process", "runtime":"vm", "snapshot_consistency":"independent_counters", "waited_for_detached":false, "wall_ns":123, "cpu_seconds":null, "process_peak_rss_bytes":null, "counters":{"vm_entries":2}} +counters := {};for key in runtime_resource_schema()["properties"]["counters"]["required"] {counters[key] := 0};runtime["counters"] := counters;runtime["runtime_version"] := "fixture";runtime["outcome"] := "success";runtime["unsupported"] := [];fact = resource_source_facts("runtime", to_json(runtime));check(fact["cpu_seconds"] == null&&fact["process_peak_rss_bytes"] == null&&fact["hard_policy_eligible"] == false) +runtime["wall_ns"] := -1;rejects(func() {resource_source_facts("runtime", to_json(runtime))}) +invalid := graph();definition = invalid["workflow_definition"];metadata = definition["metadata"];p = metadata["graph_resources"];p["max_eval_attempts"] := 9;metadata["graph_resources"] := p;definition["metadata"] := metadata;invalid["workflow_definition"] := definition;rejects(func() {validate_resources(invalid)}) +print(to_json({"ok":true, "checks":checks})) diff --git a/tests/resource_eval_worker.kujo b/tests/resource_eval_worker.kujo new file mode 100644 index 0000000..55514b5 --- /dev/null +++ b/tests/resource_eval_worker.kujo @@ -0,0 +1,17 @@ +from src.core.state import load_run_state +from src.core.resource_ledger import claim_evaluation +from src.core.node_transition import node_raw +from src.core.utils import dict_get_or +from eval.src.control_contracts import build_evaluation_result +arguments := args();base := arguments[0];id := arguments[1];attempt := arguments[2] +pointer := parse_json(read_file(base + "/pointer.json"));loaded := load_run_state(base + "/runs", pointer["run_id"]) +if loaded["ok"] == false {throw("eval_graph_missing")};graph := loaded["run_state"] +for step in graph["workflow_definition"]["steps"] {if step["id"] == id {if step["config"]["evaluator"]["configuration_sha256"] != sha256(read_file_beneath(base + "/" + id, "eval-config.json", 65536)) {throw("eval_configuration_stale")}}} +claim_evaluation(graph, id, attempt) +binding := graph["graph_node_bindings"][id];input := binding["inputs"][0];root := base + "/" + id +host := parse_json(read_file(root + "/host.json"));append_file(root + "/eval-executions.log", attempt + "\n") +if dict_get_or(host, "infrastructure_fail", false) {throw("fixture_evaluator_infrastructure_failure")} +value := parse_json(node_raw(graph, input["content_ref"]));failed := 0;if value["value"] != dict_get_or(host, "expected_value", 1) {failed = 1} +stamp := current_timestamp() +result := build_evaluation_result({"passed":1 - failed, "failed":failed}, root + "/eval-config.json", {"subject":input["producer_subject"], "input_evidence_ids":[input["result_ref"], input["content_ref"]]}, stamp, current_timestamp(), []) +print(to_json(result)) diff --git a/tests/resource_helpers.mjs b/tests/resource_helpers.mjs new file mode 100644 index 0000000..7463829 --- /dev/null +++ b/tests/resource_helpers.mjs @@ -0,0 +1,14 @@ +export * from './static_policy_helpers.mjs'; +import {run,actor,assert,state} from './static_policy_helpers.mjs'; +export const resourceOptions=(p,evals=4,required=false)=>({graph_policy:p,graph_accounting:'dispatch.graph-attempt-accounting/v1alpha1',graph_resources:{schema:'dispatch.graph-resources/v1alpha1',max_eval_attempts:evals,require_provider_usage:required}}); +export const rop=(d,action,fields={},operation='assess',extra={})=>run(d,'resource-op','graph',{operation,action,...fields},extra); +export function rapply(d,action,fields={},extra={}) {const a=rop(d,action,fields);assert.equal(a.ok,true,JSON.stringify(a));const r=rop(d,action,{...fields,candidate:a.candidate,actor},'apply',extra);assert.equal(r.ok,true,JSON.stringify(r));return r} +export const report=d=>rop(d,'report',{},'report'); +export const evalRow=(d,id)=>state(d).eval_attempts[id].at(-1); +export const subject=(d,id,kind='eval')=>({kind,node_id:id,attempt_id:kind==='eval'?evalRow(d,id).attempt_id:state(d,id).run_id}); +export function sealEval(d,id){const a=run(d,'graph-op','graph',{operation:'node-assess',node_id:id});assert.equal(a.ok,true,JSON.stringify(a));const r=run(d,'graph-op','graph',{operation:'node-finalize',node_id:id,candidate:a.candidate});assert.equal(r.ok,true,JSON.stringify(r));return r} + +import {fs,join,spawn,kujo,env,fixture,write} from './static_policy_helpers.mjs'; +let serial=0; +export async function fresh(d,request,extra={},marker=null){const path=join(d,'resource-fresh-'+serial+++'.json');write(path,request);return await new Promise((done,reject)=>{const p=spawn(kujo,['run',fixture,d,'resource-op','graph',path],{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)}})})} +export function request(d,action,fields={}){const a=rop(d,action,fields);assert.equal(a.ok,true,JSON.stringify(a));return {operation:'apply',action,...fields,candidate:a.candidate,actor}} diff --git a/tests/resource_integration.mjs b/tests/resource_integration.mjs new file mode 100644 index 0000000..2873b47 --- /dev/null +++ b/tests/resource_integration.mjs @@ -0,0 +1,16 @@ +import {setup,program,evaluator,policy,resourceOptions,run,finishProgram,sealEval,rop,rapply,report,evalRow,subject,state,assert,patch,join,write,fs,spawnSync,kujo,resolve,env,command,gop,root} from './resource_helpers.mjs'; +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)}; +const d=setup('eval-budget',[program('A'),{...evaluator('E','A'),max_eval_attempts:2},evaluator('F','A')],resourceOptions(policy([],[],1),2)); +run(d,'drive');finishProgram(d,'A');run(d,'drive'); +// Binding is informational: an externally produced Eval file cannot bypass dispatch. +run(d,'evaluate','E');assert.equal(gop(d,'node-assess',{node_id:'E'}).ok,false); +const planned=rop(d,'reserve',{nodes:['E']});assert.equal(planned.ok,true);const configPath=join(d,'E/eval-config.json'), configBytes=fs.readFileSync(configPath);fs.writeFileSync(configPath,'{"changed":true}');assert.equal(rop(d,'reserve',{nodes:['E']}).ok,false);fs.writeFileSync(configPath,configBytes); +const revoked=rop(d,'reserve',{nodes:['E'],candidate:planned.candidate,actor:{id:'local-operator',type:'human',authenticated_by:'installed-local-host',authorization:'graph-finalization'}},'apply',{GRAPH_REVOKE:'before_resource'});assert.equal(revoked.ok,false);assert.equal(report(d).report.evaluations.reserved,0);patch(join(d,'host.json'),c=>c.operator_enabled=true); +rapply(d,'reserve',{nodes:['E']});assert.equal(report(d).report.evaluations.reserved,1);assert.equal(fs.existsSync(join(d,'E/eval-executions.log')),false);pass('Eval output and reservation do not authorize terminal completion or execution'); +patch(join(d,'E/host.json'),c=>c.infrastructure_fail=true);rapply(d,'dispatch',{node_id:'E'});assert.equal(evalRow(d,'E').resolution.candidate.outcome,'infrastructure_failed');assert.equal(rop(d,'release',{node_id:'E'}).ok,false);const first=evalRow(d,'E'); +patch(join(d,'E/host.json'),c=>c.infrastructure_fail=false);rapply(d,'reserve',{nodes:['E']});assert.notEqual(evalRow(d,'E').attempt_id,first.attempt_id);assert.equal(evalRow(d,'E').binding_ref,first.binding_ref);rapply(d,'dispatch',{node_id:'E'});sealEval(d,'E');assert.equal(state(d).eval_attempts.E.length,2);assert.equal(fs.readFileSync(join(d,'A/executions.log'),'utf8').trim().split('\n').length,1);pass('terminated evaluator infrastructure failure retries exact result with a new Eval identity without rerunning program'); +run(d,'drive');assert.equal(rop(d,'reserve',{nodes:['F']}).ok,false);assert.equal(report(d).report.evaluations.consumed,2);assert.equal(report(d).report.evaluations.available,0);assert.equal(gop(d,'graph-assess').candidate.outcome,'blocked');assert.equal(fs.existsSync(join(d,'F/eval-executions.log')),false);pass('Eval exhaustion denies new work but permits consumed Eval finalization; required remainder stays blocked'); +const e=subject(d,'E');rapply(d,'observe',{subject:e,source_kind:'runtime'});const runtime=report(d).report.readings.find(r=>r.subject.attempt_id===e.attempt_id&&r.source_kind==='runtime');assert.equal(runtime.facts.class,'observed');assert.ok(runtime.facts.wall_ns>0);assert.equal(runtime.facts.hard_policy_eligible,false);pass('real isolated evaluator runtime report retained with process scope and exact digest'); +const generated=spawnSync(kujo,['run',resolve('tests/resource_model_fixture.kujo')],{cwd:resolve('../agents-sdk'),env:{...env,KUJO_MODULE_PATH:resolve('../agents-sdk')},encoding:'utf8'});assert.equal(generated.status,0,generated.stdout+generated.stderr);const model=JSON.parse(generated.stdout);write(join(d,'E',`resource-${e.attempt_id}-model.json`),model);rapply(d,'observe',{subject:e,source_kind:'model'});const usage=report(d).report.readings.find(r=>r.subject.attempt_id===e.attempt_id&&r.source_kind==='model');assert.equal(usage.facts.reported.input_tokens,41);assert.equal(usage.facts.reported.output_tokens,7);assert.equal(usage.facts.estimated.class,'estimated');assert.ok(usage.facts.estimated.component_tokens>0);assert.equal(report(d).report.monetary_cost.value,null);assert.ok(report(d).report.totals.reported_input_tokens.unknown_attempts>0);assert.equal(report(d).report.totals.reported_input_tokens.total,null);pass('actual SDK context-ledger projection keeps offline reported fixture, estimates and unknown attempt coverage separate'); +assert.equal(rop(d,'observe',{subject:e,source_kind:'model'}).ok,false);const fact=state(d).resource_sources;assert.ok(Object.keys(fact).length===2);const runtimeFile=join(state(d).run_dir,'node-input',runtime.source_ref.slice(7)+'.raw');const before=fs.readFileSync(runtimeFile);fs.writeFileSync(runtimeFile,'corrupt');assert.equal(report(d).ok,false);fs.writeFileSync(runtimeFile,before);assert.equal(report(d).ok,true);pass('duplicate accounting cannot add usage twice; corrupt retained measurement fails closed'); +console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/resource_limits_tests.kujo b/tests/resource_limits_tests.kujo new file mode 100644 index 0000000..89feb8f --- /dev/null +++ b/tests/resource_limits_tests.kujo @@ -0,0 +1,10 @@ +from src.core.assurance_configuration import implementation_digest +from src.core.resource_ledger import validate_resources +func need(ok) {if ok != true {throw("resource_limit_failed")}} +files := [];for i in range(0, 32) {files = push(files, {"root":os_getcwd(), "path":"src/core/resource_facts.kujo"})} +need(len(implementation_digest(files)) == 64) +denied := false;try {implementation_digest(push(files, files[0]))} except err {denied = true};need(denied) +# Existing ordered manifests retain their exact historical digest algorithm. +old := [];hashes := [];for i in range(0, 16) {old = push(old, files[i]);hashes = push(hashes, sha256(read_file("src/core/resource_facts.kujo")))} +need(implementation_digest(old) == sha256(to_json(hashes))) +print(to_json({"ok":true, "checks":3})) diff --git a/tests/resource_model_fixture.kujo b/tests/resource_model_fixture.kujo new file mode 100644 index 0000000..5df0957 --- /dev/null +++ b/tests/resource_model_fixture.kujo @@ -0,0 +1,4 @@ +from src.agents.context.ledger import context_ledger +# Offline provider-response fixture through the actual SDK extraction surface. +receipt := context_ledger([{"role":"user", "content":"bounded fixture"}], [], {"provider":"fixture-provider", "model":"fixture-model", "output_text":"fixture", "usage":{"usage_source":"provider", "input_tokens":41, "output_tokens":7}}, {}) +print(to_json(receipt)) diff --git a/tests/resource_policy.mjs b/tests/resource_policy.mjs new file mode 100644 index 0000000..cf03fe9 --- /dev/null +++ b/tests/resource_policy.mjs @@ -0,0 +1,11 @@ +import {setup,program,evaluator,human,finishHuman,policy,branch,routed,accepted,resourceOptions,run,finishProgram,sealEval,rop,rapply,report,subject,state,assert,patch,join,write,fs,spawnSync,kujo,resolve,env,gop,apply,finishGraph,edge,root} from './resource_helpers.mjs'; +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)}; +const d=setup('branch',[program('A'),routed(evaluator('E','A'),'quality'),program('B',['E'],[edge('A')]),accepted(program('R',['E'],[edge('A')]),'E',['failed'])],resourceOptions(policy([branch('quality','E','evaluation_verdict',{pass:['B'],fail:['R']})],[],2),1)); +run(d,'drive');finishProgram(d,'A');run(d,'drive');assert.equal(rop(d,'reserve',{nodes:['R']}).ok,false);patch(join(d,'E/host.json'),x=>x.expected_value=99);rapply(d,'reserve',{nodes:['E']});rapply(d,'dispatch',{node_id:'E'});sealEval(d,'E');assert.equal(rop(d,'reserve',{nodes:['R']}).ok,false);apply(d,'branch','quality');assert.equal(rop(d,'reserve',{nodes:['B']}).ok,false);rapply(d,'reserve',{nodes:['R']});assert.equal(report(d).report.programs.reserved,1);assert.equal(state(d).graph_attempts.B,undefined);run(d,'drive');finishProgram(d,'R');run(d,'drive');finishGraph(d);assert.equal(report(d).report.programs.consumed,2);assert.equal(report(d).report.evaluations.consumed,1);assert.equal(state(d).graph_finalization.candidate.nodes.find(x=>x.node_id==='B').reason,'not_selected');pass('fail-selected repair consumes program/Eval resources; inactive pass branch consumes nothing; zero capacity still permits graph finalization'); +const group={id:'SG',entry:['H'],members:['B','E'],policy:'required-success'}; +const s=setup('group',[program('A'),human('H',['A']),{...evaluator('E','A'),depends_on:['A','H']},program('B',['A','H'],[edge('A')]),{...evaluator('F','A'),depends_on:['A','H'],optional:true},{...program('C',['B','E'],[edge('B')]),after_subgraphs:['SG']}],resourceOptions(policy([],[group],3),1)); +run(s,'drive');finishProgram(s,'A');run(s,'drive');finishHuman(s,'H');assert.equal(rop(s,'reserve',{nodes:['B','E','F']}).ok,false);assert.equal(report(s).report.programs.reserved,0);assert.equal(report(s).report.evaluations.reserved,0);rapply(s,'reserve',{nodes:['B','E']});assert.equal(rop(s,'reserve',{nodes:['C']}).ok,false);rapply(s,'dispatch',{node_id:'E'});sealEval(s,'E');assert.equal(rop(s,'reserve',{nodes:['F']}).ok,false);run(s,'drive');finishProgram(s,'B');run(s,'drive');assert.equal(rop(s,'reserve',{nodes:['C']}).ok,false);apply(s,'subgraph','SG');rapply(s,'reserve',{nodes:['C']});assert.equal(report(s).report.programs.consumed,2);assert.equal(report(s).report.programs.reserved,1);assert.equal(report(s).report.evaluations.consumed,1);run(s,'drive');finishProgram(s,'C');run(s,'drive');finishGraph(s);pass('mixed program/Eval plan is atomic, over-capacity plan reserves nothing, subgraph receipt grants no extra units'); +const u=setup('unknown',[program('A'),program('B',['A'],[edge('A')])],resourceOptions(policy([],[],2),0,true)); +run(u,'drive');finishProgram(u,'A');run(u,'drive');assert.equal(state(u).node_dispatches.B,undefined);assert.equal(rop(u,'reserve',{nodes:['B']}).ok,false);assert.equal(rop(u,'observe',{subject:subject(u,'A','program'),source_kind:'model'}).ok,false);pass('missing provider usage blocks ordinary program progression and explicit planning without inventing zero'); +const generated=spawnSync(kujo,['run',resolve('tests/resource_model_fixture.kujo')],{cwd:resolve('../agents-sdk'),env:{...env,KUJO_MODULE_PATH:resolve('../agents-sdk')},encoding:'utf8'});assert.equal(generated.status,0,generated.stderr);const model=JSON.parse(generated.stdout),who=subject(u,'A','program'),path=join(u,'A',`resource-${who.attempt_id}-model.json`);write(path,{...model,usage_source:'estimated'});const old=rop(u,'observe',{subject:who,source_kind:'model'});assert.equal(old.ok,true);write(path,model);assert.equal(rop(u,'observe',{subject:who,source_kind:'model',candidate:old.candidate,actor:{id:'local-operator',type:'human',authenticated_by:'installed-local-host',authorization:'graph-finalization'}},'apply').ok,false);rapply(u,'observe',{subject:who,source_kind:'model'});rapply(u,'reserve',{nodes:['B']});assert.equal(report(u).report.totals.reported_input_tokens.known_sum,41);pass('source changes invalidate an observation candidate; exact provider-sourced facts allow later reservation'); +console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/resource_recovery.mjs b/tests/resource_recovery.mjs new file mode 100644 index 0000000..eda6c53 --- /dev/null +++ b/tests/resource_recovery.mjs @@ -0,0 +1,14 @@ +import {fs,join,resolve,assert,root,env,fixture,setup,program,evaluator,policy,resourceOptions,run,finishProgram,sealEval,rop,rapply,report,evalRow,subject,state,request,fresh,actor,gop,write,spawnSync,kujo,patch,branch,routed,accepted,apply} from './resource_helpers.mjs'; +const proofs=[];const pass=x=>{proofs.push(x);console.log('PASS '+x)}; +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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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("RESOURCE_RECORD_CRASH") == kind {print("CRASH:resource-record");sleep(30000)}\n'+point));process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); +function repair(d){const p=run(d,'op','graph',{operation:'recovery-plan'});assert.equal(p.ok,true,JSON.stringify(p));assert.ok(p.plan.repairs.length,JSON.stringify(p));const r=run(d,'op','graph',{operation:'recovery-apply',plan:p.plan});assert.equal(r.ok,true,JSON.stringify(r));assert.equal(r.continuation,'not_authorized');return r} +const p=setup('program-contention',[program('B'),program('C')],resourceOptions(policy([],[],1),0));const programPlans=[request(p,'reserve',{nodes:['B']}),request(p,'reserve',{nodes:['C']})];const race=await Promise.all(programPlans.map(c=>fresh(p,c)));assert.equal(race.filter(x=>x.ok).length,1,JSON.stringify(race));assert.equal(report(p).report.programs.reserved,1);assert.equal(report(p).report.programs.consumed,0);assert.equal(fs.existsSync(join(p,'B/executions.log')),false);assert.equal(fs.existsSync(join(p,'C/executions.log')),false);pass('fresh controllers cannot oversubscribe final program slot through resource plans'); +const d=setup('eval-contention',[program('A'),evaluator('E','A'),evaluator('F','A'),evaluator('G','A')],resourceOptions(policy([],[],1),2));run(d,'drive');finishProgram(d,'A');run(d,'drive');rapply(d,'reserve',{nodes:['E']});const choices=[request(d,'reserve',{nodes:['F']}),request(d,'reserve',{nodes:['G']})];const outcomes=await Promise.all(choices.map(c=>fresh(d,c)));assert.equal(outcomes.filter(x=>x.ok).length,1,JSON.stringify(outcomes));const winner=outcomes[0].ok?'F':'G';assert.equal(report(d).report.evaluations.reserved,2);pass('fresh controllers race for last Eval slot with exact source/revision-bound plans'); +const release=request(d,'release',{node_id:winner});const releases=await Promise.all([fresh(d,release),fresh(d,release)]);assert.equal(releases.filter(x=>x.ok).length,1);assert.equal(report(d).report.evaluations.reserved,1);pass('two fresh releases publish one historical release without double refund'); +rapply(d,'release',{node_id:'E'});const samePlan=request(d,'reserve',{nodes:['E']});const sameRace=await Promise.all([fresh(d,samePlan),fresh(d,samePlan)]);assert.equal(sameRace.filter(x=>x.ok).length,1);rapply(d,'release',{node_id:'E'});pass('same future Eval reservation publishes once under contention');await fresh(d,request(d,'reserve',{nodes:['E']}),{NODE_CRASH:'after_graph_resources_reserved'},'CRASH:after_graph_resources_reserved');assert.equal(fs.existsSync(join(d,'E/eval-executions.log')),false);rapply(d,'release',{node_id:'E'});assert.equal(report(d).report.evaluations.consumed,0);pass('crash after committed reservation permits explicit release only before dispatch'); +rapply(d,'reserve',{nodes:['E']});await fresh(d,request(d,'dispatch',{node_id:'E'}),{NODE_CRASH:'after_eval_work'},'CRASH:after_eval_work');const e=evalRow(d,'E');assert.ok(e.dispatch);assert.equal(e.resolution,null);assert.equal(rop(d,'release',{node_id:'E'}).ok,false);assert.equal(rop(d,'reserve',{nodes:['E']}).ok,false);assert.equal(report(d).report.evaluations.consumed,1);assert.equal(gop(d,'graph-assess').candidate.outcome,'blocked');const responsePath=join(d,'E',`response-${e.attempt_id}.json`),responseBytes=fs.readFileSync(responsePath),wrong=JSON.parse(responseBytes);const wrongResult=JSON.parse(wrong.evaluation_raw);wrongResult.subject.run_id='wrong-result';wrong.evaluation_raw=JSON.stringify(wrongResult);write(responsePath,wrong);assert.equal(rop(d,'resolve',{node_id:'E'}).ok,false);fs.writeFileSync(responsePath,responseBytes);rapply(d,'resolve',{node_id:'E'});sealEval(d,'E');assert.equal(fs.readFileSync(join(d,'E/eval-executions.log'),'utf8').trim().split('\n').length,1);const duplicate=spawnSync(kujo,['run','tests/resource_eval_worker.kujo',d,'E',e.attempt_id],{env,encoding:'utf8'});assert.notEqual(duplicate.status,0);assert.equal(fs.readFileSync(join(d,'E/eval-executions.log'),'utf8').trim().split('\n').length,1);pass('Eval work with lost reply stays consumed; independent exact readback resolves without rerun, duplicate worker rejected'); +const observation=request(d,'observe',{subject:subject(d,'E'),source_kind:'runtime'});await fresh(d,observation,{RESOURCE_RECORD_CRASH:'graph_resource_observed'},'CRASH:resource-record');assert.equal(report(d).ok,false);repair(d);const observed=report(d);assert.equal(observed.ok,true,JSON.stringify(observed));assert.equal(observed.report.evaluations.consumed,1);assert.ok(observed.report.readings.some(x=>x.source_kind==='runtime'&&x.facts.class==='observed'));assert.equal(state(d).graph_finalization,undefined);pass('immutable sourced measurement/index publication gap reconstructs exact evidence and consumption without finalization'); +const remaining=winner;await fresh(d,request(d,'reserve',{nodes:[remaining]}),{RESOURCE_RECORD_CRASH:'graph_resources_reserved'},'CRASH:resource-record');repair(d);assert.equal(report(d).report.evaluations.reserved,1);await fresh(d,request(d,'dispatch',{node_id:remaining}),{NODE_CRASH:'after_graph_eval_dispatched'},'CRASH:after_graph_eval_dispatched');assert.equal(report(d).report.evaluations.consumed,2);assert.equal(rop(d,'release',{node_id:remaining}).ok,false);assert.equal(rop(d,'dispatch',{node_id:remaining}).ok,false);assert.equal(rop(d,'resolve',{node_id:remaining}).ok,false);assert.equal(fs.existsSync(join(d,remaining,'eval-executions.log')),false);pass('orphan reservation repairs; dispatch-before-worker crash is consumed and cannot be refunded or redelivered'); +const b=setup('branch-contention',[program('A'),routed(evaluator('E','A'),'quality'),program('B',['E']),accepted(program('R',['E']),'E',['failed']),accepted(program('S',['E'],[],true),'E',['failed'])],resourceOptions(policy([branch('quality','E','evaluation_verdict',{pass:['B'],fail:['R','S']})],[],2),1));run(b,'drive');finishProgram(b,'A');run(b,'drive');patch(join(b,'E/host.json'),x=>x.expected_value=99);rapply(b,'reserve',{nodes:['E']});rapply(b,'dispatch',{node_id:'E'});sealEval(b,'E');apply(b,'branch','quality');assert.equal(rop(b,'reserve',{nodes:['B']}).ok,false);const branchPlans=[request(b,'reserve',{nodes:['R']}),request(b,'reserve',{nodes:['S']})];const branchRace=await Promise.all(branchPlans.map(c=>fresh(b,c)));assert.equal(branchRace.filter(x=>x.ok).length,1);assert.equal(report(b).report.programs.reserved,1);assert.equal(state(b).graph_attempts.B,undefined);pass('fresh selected-branch contenders cannot share final capacity or reserve inactive work'); +process.chdir(original);console.log(JSON.stringify({ok:true,checks:proofs.length,proofs,root})); diff --git a/tests/retained_recovery_integration.mjs b/tests/retained_recovery_integration.mjs index fe7b8ff..d6086c8 100644 --- a/tests/retained_recovery_integration.mjs +++ b/tests/retained_recovery_integration.mjs @@ -40,7 +40,15 @@ for(const name of ['orphan-control','exact-duplicate','cancel-tail','rebind-tail const d=setup('sqlite',name);assert.equal(refresh(d).ok,true);assert.equal(select(d).ok,true); const before=fs.readFileSync(statePath(d),'utf8'); if(name==='cancel-tail'){assert.equal(active(d,'cancel',{reason:'operator_cancelled'}).ok,true);fs.writeFileSync(statePath(d),before);repair(d);assert.equal(active(d,'admit').ok,false)} - else if(name==='rebind-tail'){assert.equal(refresh(d).ok,true);const basis=fs.readFileSync(statePath(d),'utf8');assert.equal(active(d,'rebind').ok,true);fs.writeFileSync(statePath(d),basis);repair(d);assert.equal(inspect(d).lifecycle.attempts[inspect(d).lifecycle.active].rebindings.length,1)} + else if(name==='rebind-tail'){ + // Same-second refreshes correctly deduplicate identical evidence. Give the + // renewed observation an explicitly different validity window before rebind. + const cfg=read(join(d,'host.json'));cfg.evidence_seconds=600;write(join(d,'host.json'),cfg); + const refreshed=refresh(d);assert.equal(refreshed.ok,true,JSON.stringify(refreshed)); + assert.notEqual(refreshed.lifecycle.basis_ref,refreshed.lifecycle.attempts[refreshed.lifecycle.active].basis_ref); + const basis=fs.readFileSync(statePath(d),'utf8'),rebound=active(d,'rebind');assert.equal(rebound.ok,true,JSON.stringify(rebound)); + fs.writeFileSync(statePath(d),basis);repair(d);assert.equal(inspect(d).lifecycle.attempts[inspect(d).lifecycle.active].rebindings.length,1) + } else if(['orphan-control','exact-duplicate','stale-plan','revoked','expired','missing-workspace'].includes(name)){ damage(d,dir=>{const p=join(dir,'control-events.jsonl'),lines=fs.readFileSync(p,'utf8').trim().split('\n');if(name==='exact-duplicate')lines.push(lines.at(-1));else lines.pop();fs.writeFileSync(p,lines.join('\n'))}); if(name==='stale-plan'){const plan=recovery(d);damage(d,dir=>fs.writeFileSync(join(dir,'effect-lifecycle','unexpected.claim'),'bad'));assert.equal(recovery(d,'apply',plan.plan).ok,false)} diff --git a/tests/static_policy_recovery.mjs b/tests/static_policy_recovery.mjs index 61b18fa..d19b17c 100644 --- a/tests/static_policy_recovery.mjs +++ b/tests/static_policy_recovery.mjs @@ -5,7 +5,7 @@ async function fresh(d,request={},extra={},marker=null,mode='policy-op',id='grap 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 repair(d){const p=run(d,'op','graph',{operation:'recovery-plan'});assert.equal(p.ok,true,JSON.stringify(p));assert.ok(p.plan.repairs.length);const r=run(d,'op','graph',{operation:'recovery-apply',plan:p.plan});assert.equal(r.ok,true,JSON.stringify(r));assert.equal(r.continuation,'not_authorized')} -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 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'));for(const file of [fixture,'tests/resource_eval_worker.kujo'])fs.copyFileSync(resolve(file),join(copy,file));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("POLICY_RECORD_CRASH") == kind {print("CRASH:immutable-policy-record");sleep(30000)}\n'+point));process.chdir(copy);env.KUJO_MODULE_PATH=[copy,resolve(original,'..'),resolve(original,'../workcell'),resolve(original,'../eval')].join(':'); function branchRun(name,programs=false){const b=programs?program('B',['H']):human('B',['H']);const d=setup(name,[routed(human('H',[]),'choice'),b,accepted(human('S',['H']),'H',['rejected'])],{graph_policy:policy([branch('choice','H','human_action',{approve_override:['B'],abort:['S']})])});run(d,'drive');finishHuman(d,'H');return d} const d=branchRun('branch-race-and-consumption',true);let a=pop(d,'branch','choice');await fresh(d,{kind:'branch',id:'choice',operation:'apply',candidate:a.candidate,actor},{NODE_CRASH:'before_branch'},'CRASH:before_branch');assert.equal(state(d).branch_activations,undefined);const rp=run(d,'op','graph',{operation:'recovery-plan'});assert.equal(rp.plan.repairs.length,0);assert.equal(state(d).branch_activations,undefined);pass('condition fact and crash before activation do not let recovery invent a path');