Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/scripts/check-kujo-tool-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 < <(
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/ci-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/kujo-tool-artifacts-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

18 changes: 17 additions & 1 deletion .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion config/kujo-tool-artifacts.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@
*.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.
# /casefile.toml
# /fence.toml
# /.lens.toml
# /packwrite.toml

89 changes: 89 additions & 0 deletions docs/audits/resource-accounting.md
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 29 additions & 0 deletions docs/contracts/resources/crash-matrix.md
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading