Skip to content

Run compiler-produced Edict operations through durable Ticks - #695

Merged
flyingrobots merged 12 commits into
mainfrom
task/690-run-compiler-produced-hello-echo
Jul 28, 2026
Merged

Run compiler-produced Edict operations through durable Ticks#695
flyingrobots merged 12 commits into
mainfrom
task/690-run-compiler-produced-hello-echo

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Consumes exact compiler and verifier artifacts through the generic Echo Action path. Proves WAL-before-ACK, pending restart, scheduler-owned singleton execution, decided restart, typed duplicate obstruction, and altered-basis refusal.

Closes #690.

Summary by CodeRabbit

  • New Features

    • Added a maintenance command to run externally produced operations with artifact validation, durable installation, recovery checks, and duplicate-operation protection.
    • Added a renamed runtime counter diagnostic command with JSON output and configurable runtime limits.
    • Added fixtures and contributor workflows for validating compiler-to-runtime operation execution.
  • Documentation

    • Updated the README, changelog, and runtime documentation to describe the external operation workflow, recovery guarantees, and diagnostic command.
  • Tests

    • Added coverage for successful execution, malformed inputs, artifact mismatches, WAL constraints, recovery, and deterministic stress scenarios.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex please review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 23b5d320-ebe6-4bbe-a175-3343cfee83bf

📥 Commits

Reviewing files that changed from the base of the PR and between f90c46f and 3d0dd5b.

⛔ Files ignored due to path filters (6)
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/evidence/provenance.provider-generation.json is excluded by !**/generated/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/evidence/review.provider-generation.json is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/evidence/provenance.provider-generation.json is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/evidence/review.provider-generation.json is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/evidence/provenance.provider-generation.json is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/evidence/review.provider-generation.json is excluded by !**/generated/**
📒 Files selected for processing (12)
  • CHANGELOG.md
  • README.md
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/provider-manifest.echo.json
  • crates/echo-wesley-gen/assets/v1/repository/Cargo.lock.source
  • crates/echo-wesley-gen/tests/provider_package.rs
  • crates/echo-wesley-gen/tests/provider_package_corpus.rs
  • docs/topics/GeneratedRules.md
  • docs/topics/WAL.md
  • schemas/edict-provider/package/v1/provider-manifest.echo.json
  • xtask/src/main.rs
  • xtask/src/run_edict_operation.rs
  • xtask/tests/run_edict_operation.rs
📝 Walkthrough

Walkthrough

Adds cargo xtask run-edict-operation to validate compiler-produced Edict artifacts, install and execute them through durable scheduler-owned Ticks, verify recovery and obstruction behavior, and renames the native counter capsule to runtime-counter-diagnostic.

Changes

Edict runtime witness

Layer / File(s) Summary
Diagnostic rename and CLI routing
xtask/src/main.rs, xtask/src/runtime_counter_diagnostic.rs, README.md, CHANGELOG.md
Renames the native counter diagnostic and adds CLI routing for the new operation runner.
Package contract and runner wiring
xtask/Cargo.toml, xtask/src/main.rs, xtask/src/run_edict_operation.rs, xtask/tests/fixtures/edict-operation/*
Defines runner configuration and reports, wires compiler artifacts into the CLI, and adds package, verification, lawpack, target, and input fixtures.
Artifact closure and input validation
xtask/src/run_edict_operation.rs
Bounds file reads and validates canonical CBOR, package/report bindings, lawpack closure, target configuration, resource identities, budgets, and operation input.
Admission, scheduling, and recovery
xtask/src/run_edict_operation.rs, README.md, docs/topics/GeneratedRules.md, docs/topics/WAL.md
Installs the admitted package, submits an Action with WAL commit-before-acknowledgement, evaluates a singleton Tick, verifies recovery, and checks duplicate obstruction and mutated-state refusal.
End-to-end witness tests
xtask/tests/run_edict_operation.rs
Tests successful execution, malformed-artifact rejection, non-empty-WAL rejection, input bounds, and deterministic stress cases.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related issues

  • flyingrobots/hello-echo issue 3 — Covers the same durable scheduler-owned Hello Echo execution proof and recovery behaviors.
  • flyingrobots/edict issue 169 — Defines the compiler-produced ExecutableOperationPackageV1 consumed by this runtime witness.

Possibly related PRs

  • flyingrobots/echo#529: Introduces the earlier Hello Echo capsule that this change renames and removes from the CLI surface.
  • flyingrobots/echo#683: Adds executable-operation admission, installation, evaluation, and WAL recovery semantics exercised by the new runner.
  • flyingrobots/echo#686: Adds the create-if-absent executable-operation and WAL validation behavior covered by these fixtures and tests.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant RunEdictOperation
  participant TrustedRuntimeHost
  participant WAL
  participant Scheduler
  CLI->>RunEdictOperation: pass package, report, closure, input, and WAL paths
  RunEdictOperation->>TrustedRuntimeHost: validate and install admitted package
  RunEdictOperation->>TrustedRuntimeHost: submit canonical Action
  TrustedRuntimeHost->>WAL: commit accepted submission
  TrustedRuntimeHost->>Scheduler: evaluate Action in singleton Tick
  Scheduler->>WAL: commit decided Tick
  RunEdictOperation->>TrustedRuntimeHost: boot fresh host and recover witnesses
  TrustedRuntimeHost-->>RunEdictOperation: state, outcome, Receipt, and obstruction evidence
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.32% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: running compiler-produced Edict operations through durable Ticks.
Linked Issues check ✅ Passed The changes satisfy the issue: they add an external Edict operation runner, WAL-backed scheduling/recovery tests, duplicate obstruction handling, and the diagnostic rename.
Out of Scope Changes check ✅ Passed The diff stays on-scope: code, docs, fixtures, and tests all support the Edict-operation runner and diagnostic rename.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/690-run-compiler-produced-hello-echo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@xtask/src/run_edict_operation.rs`:
- Around line 434-443: Replace the boolean .is_err() check in the
mutated_initial_state_refused block with validation that the returned error
specifically identifies the typed state/recovery-certificate mismatch, rather
than accepting any failure. In xtask/src/run_edict_operation.rs lines 434-443,
preserve the refusal assertion only for that reason; in
xtask/tests/run_edict_operation.rs lines 144-224, update assert_rejected to
accept an expected reason and verify captured stderr names each case’s refusal:
canonical-decode failure, resource-binding mismatch, replacement bound, host
byte bound, or nonempty WAL.
- Around line 918-928: Update resource_ref_matches to accept a separate fixed
digest-domain parameter, mirroring validate_resource_ref, and use that domain
when recomputing the digest instead of expected_coordinate. Change both call
sites to pass ADAPTER_DOMAIN for adapter validation and CONFIGURATION_DOMAIN for
target configuration validation, while obtaining expected_coordinate from the
package or adapter closure rather than resource_coordinate(resource).
- Around line 445-478: Update the RunEdictOperationReport construction so
verdict, verificationOutcome, closureBound, singletonIntegration,
hiddenMutation, and recovery fields reflect observed execution state rather than
constants or unreachable values. Propagate those postures through the relevant
run_edict_operation control flow, and let the caller determine verdict from
them; alternatively remove fields that cannot vary and adjust the report schema
and assertions accordingly.

In `@xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor`:
- Around line 1-2: Replace the filler digests for verifier.ruleset,
dependencies.compatibility, and conformanceFixtureCorpus by regenerating the
manifest from a real compiler run, or revise the WAL documentation to avoid
claiming these are compiler-produced bytes. Also update the digest-domain
handling around digest_canonical_value_bytes_v1 to use ADAPTER_DOMAIN rather
than targetAdapters[0].adapter.id.

In `@xtask/tests/fixtures/edict-operation/verification-report.cbor`:
- Line 1: Update validate_closure to cross-check the report’s targetIr digest
against the lawpack manifest’s acceptedTargetIr digest, not merely their
resource coordinates; only emit closureBound: true when the byte digests match,
otherwise reject the closure or report it as unbound.

In `@xtask/tests/run_edict_operation.rs`:
- Line 19: Update the test path setup around root and fixture path construction
to anchor both fixture locations and the target/xtask-test-tmp scratch directory
to env!("CARGO_MANIFEST_DIR") instead of the process working directory,
preserving the existing relative layout so tests run consistently from any CWD.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 14fd5c70-106d-4065-aa25-82073945ef6a

📥 Commits

Reviewing files that changed from the base of the PR and between eb0abb6 and f90c46f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • CHANGELOG.md
  • README.md
  • docs/topics/GeneratedRules.md
  • docs/topics/WAL.md
  • xtask/Cargo.toml
  • xtask/src/main.rs
  • xtask/src/run_edict_operation.rs
  • xtask/src/runtime_counter_diagnostic.rs
  • xtask/tests/fixtures/edict-operation/ORIGIN.toml
  • xtask/tests/fixtures/edict-operation/executable-operation-package.cbor
  • xtask/tests/fixtures/edict-operation/input.json
  • xtask/tests/fixtures/edict-operation/lawpack-adapter.cbor
  • xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor
  • xtask/tests/fixtures/edict-operation/target-configuration.cbor
  • xtask/tests/fixtures/edict-operation/verification-report.cbor
  • xtask/tests/run_edict_operation.rs

Comment thread xtask/src/run_edict_operation.rs Outdated
Comment thread xtask/src/run_edict_operation.rs
Comment thread xtask/src/run_edict_operation.rs Outdated
Comment thread xtask/tests/run_edict_operation.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@xtask/src/run_edict_operation.rs`:
- Around line 434-443: Replace the boolean .is_err() check in the
mutated_initial_state_refused block with validation that the returned error
specifically identifies the typed state/recovery-certificate mismatch, rather
than accepting any failure. In xtask/src/run_edict_operation.rs lines 434-443,
preserve the refusal assertion only for that reason; in
xtask/tests/run_edict_operation.rs lines 144-224, update assert_rejected to
accept an expected reason and verify captured stderr names each case’s refusal:
canonical-decode failure, resource-binding mismatch, replacement bound, host
byte bound, or nonempty WAL.
- Around line 918-928: Update resource_ref_matches to accept a separate fixed
digest-domain parameter, mirroring validate_resource_ref, and use that domain
when recomputing the digest instead of expected_coordinate. Change both call
sites to pass ADAPTER_DOMAIN for adapter validation and CONFIGURATION_DOMAIN for
target configuration validation, while obtaining expected_coordinate from the
package or adapter closure rather than resource_coordinate(resource).
- Around line 445-478: Update the RunEdictOperationReport construction so
verdict, verificationOutcome, closureBound, singletonIntegration,
hiddenMutation, and recovery fields reflect observed execution state rather than
constants or unreachable values. Propagate those postures through the relevant
run_edict_operation control flow, and let the caller determine verdict from
them; alternatively remove fields that cannot vary and adjust the report schema
and assertions accordingly.

In `@xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor`:
- Around line 1-2: Replace the filler digests for verifier.ruleset,
dependencies.compatibility, and conformanceFixtureCorpus by regenerating the
manifest from a real compiler run, or revise the WAL documentation to avoid
claiming these are compiler-produced bytes. Also update the digest-domain
handling around digest_canonical_value_bytes_v1 to use ADAPTER_DOMAIN rather
than targetAdapters[0].adapter.id.

In `@xtask/tests/fixtures/edict-operation/verification-report.cbor`:
- Line 1: Update validate_closure to cross-check the report’s targetIr digest
against the lawpack manifest’s acceptedTargetIr digest, not merely their
resource coordinates; only emit closureBound: true when the byte digests match,
otherwise reject the closure or report it as unbound.

In `@xtask/tests/run_edict_operation.rs`:
- Line 19: Update the test path setup around root and fixture path construction
to anchor both fixture locations and the target/xtask-test-tmp scratch directory
to env!("CARGO_MANIFEST_DIR") instead of the process working directory,
preserving the existing relative layout so tests run consistently from any CWD.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 14fd5c70-106d-4065-aa25-82073945ef6a

📥 Commits

Reviewing files that changed from the base of the PR and between eb0abb6 and f90c46f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • CHANGELOG.md
  • README.md
  • docs/topics/GeneratedRules.md
  • docs/topics/WAL.md
  • xtask/Cargo.toml
  • xtask/src/main.rs
  • xtask/src/run_edict_operation.rs
  • xtask/src/runtime_counter_diagnostic.rs
  • xtask/tests/fixtures/edict-operation/ORIGIN.toml
  • xtask/tests/fixtures/edict-operation/executable-operation-package.cbor
  • xtask/tests/fixtures/edict-operation/input.json
  • xtask/tests/fixtures/edict-operation/lawpack-adapter.cbor
  • xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor
  • xtask/tests/fixtures/edict-operation/target-configuration.cbor
  • xtask/tests/fixtures/edict-operation/verification-report.cbor
  • xtask/tests/run_edict_operation.rs
🛑 Comments failed to post (2)
xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor (1)

1-2: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Fixture embeds hand-written placeholder digests while the docs call these exact compiler bytes.

The verifier.ruleset, dependencies.compatibility, and conformanceFixtureCorpus references carry filler digests (32 repeated t, u, and v bytes). The runner never digest-checks those three, so they pass — but docs/topics/WAL.md Line 316 describes this fixture as the artifacts "that closed the compiler build". Either regenerate the manifest from a real compiler run or soften the documentation claim.

Separately, this file's targetAdapters[0].adapter.id (causal.cell.echo-adapter/v1) is what the runner feeds to digest_canonical_value_bytes_v1 as the digest domain — concrete evidence for the domain-confusion issue flagged at xtask/src/run_edict_operation.rs Lines 918-928, since that string has nothing to do with ADAPTER_DOMAIN.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@xtask/tests/fixtures/edict-operation/lawpack-manifest.cbor` around lines 1 -
2, Replace the filler digests for verifier.ruleset, dependencies.compatibility,
and conformanceFixtureCorpus by regenerating the manifest from a real compiler
run, or revise the WAL documentation to avoid claiming these are
compiler-produced bytes. Also update the digest-domain handling around
digest_canonical_value_bytes_v1 to use ADAPTER_DOMAIN rather than
targetAdapters[0].adapter.id.
xtask/tests/fixtures/edict-operation/verification-report.cbor (1)

1-1: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

The report's targetIr digest is never cross-checked against the manifest's acceptedTargetIr.

This fixture's targetIr digest and lawpack-manifest.cbor's acceptedTargetIr digest are different byte strings, and the runner only validates the coordinate for both (require_resource_identity, xtask/src/run_edict_operation.rs Lines 565 and 930-937). So nothing proves the Target IR the verifier accepted is the Target IR the lawpack admits, yet the report emits closureBound: true. Either bind the two digests in validate_closure or stop claiming the closure is bound.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@xtask/tests/fixtures/edict-operation/verification-report.cbor` at line 1,
Update validate_closure to cross-check the report’s targetIr digest against the
lawpack manifest’s acceptedTargetIr digest, not merely their resource
coordinates; only emit closureBound: true when the byte digests match, otherwise
reject the closure or report it as unbound.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex please review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5acff98cd9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread xtask/src/run_edict_operation.rs
Comment thread xtask/src/run_edict_operation.rs Outdated
Comment thread xtask/src/run_edict_operation.rs
Comment thread xtask/src/run_edict_operation.rs Outdated
Comment thread README.md
@flyingrobots

Copy link
Copy Markdown
Owner Author

Second-pass disposition for the two CodeRabbit findings that could not be posted inline:

  • FIXED: WAL documentation now distinguishes compiler-emitted package/report bytes from generator-owned capability inputs and does not claim dormant declarative fixture identities are Echo runtime inputs.
  • FIXED: the accepted report Target IR is bound to the package semantic closure, with a canonical substitution-negative test. The manifest acceptedTargetIr describes the lawpack target-IR contract resource, not the application artifact instance, so report-to-package is the required instance binding.

Local gate: 137 xtask tests, 38 executable-operation pipeline tests, clippy, rustfmt, Prettier, Markdownlint, and dead-reference checks pass at 3d0dd5be2.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Merge gate record for 3d0dd5be2:

  • all required and observed CI checks pass;
  • zero unresolved review threads;
  • CodeRabbit completed by explicit rate-limit notice;
  • Codex produced substantive review findings; all are fixed and resolved;
  • local xtask, executable-operation pipeline, clippy, formatting, documentation, and PR-preflight checks pass;
  • flyingrobots is the repository's only direct collaborator, so the ruleset's non-author approval and last-push approval cannot be supplied by a second human.

The operator explicitly authorized administrative merge. That bypass is used only for the impossible solo-maintainer approval criterion; no check or review finding is bypassed.

@flyingrobots
flyingrobots merged commit ad66245 into main Jul 28, 2026
40 checks passed
@flyingrobots
flyingrobots deleted the task/690-run-compiler-produced-hello-echo branch July 28, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run compiler-produced Hello Echo through scheduler-owned Ticks

1 participant