Skip to content

Lower compiler-produced Edict operations generically - #692

Merged
flyingrobots merged 11 commits into
mainfrom
james/generic-edict-operation-lowering
Jul 28, 2026
Merged

Lower compiler-produced Edict operations generically#692
flyingrobots merged 11 commits into
mainfrom
james/generic-edict-operation-lowering

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Lower compiler-produced Edict operations through generic provider components and an independent verifier. Pin the checked provider package and exact Edict host witness.

Closes #691.

@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: 56 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: 7b20f2ed-5b8f-47c8-bf42-f06adbb8ee8d

📥 Commits

Reviewing files that changed from the base of the PR and between 4295d71 and 5917d6e.

⛔ Files ignored due to path filters (29)
  • Cargo.lock is excluded by !**/*.lock
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/components/lowerer.echo-dpo.component.wasm is excluded by !**/*.wasm
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/components/verifier.echo-dpo.component.wasm is excluded by !**/*.wasm
  • 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/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/primary/authority-facts.echo-dpo.cbor is excluded by !**/generated/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/primary/authority-facts.echo-lawpack.cbor is excluded by !**/generated/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/primary/lawpack.echo-dpo.cbor is excluded by !**/generated/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/primary/schema.echo-provider-artifacts.cddl is excluded by !**/generated/**
  • crates/echo-wesley-gen/assets/v1/edict-provider/package/v1/generated/primary/target-profile.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/components/v1/lowerer.echo-dpo.component.wasm is excluded by !**/*.wasm
  • schemas/edict-provider/components/v1/verifier.echo-dpo.component.wasm is excluded by !**/*.wasm
  • 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/generated/v1/primary/authority-facts.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/primary/authority-facts.echo-lawpack.cbor is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/primary/lawpack.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/primary/schema.echo-provider-artifacts.cddl is excluded by !**/generated/**
  • schemas/edict-provider/generated/v1/primary/target-profile.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/components/lowerer.echo-dpo.component.wasm is excluded by !**/*.wasm
  • schemas/edict-provider/package/v1/components/verifier.echo-dpo.component.wasm is excluded by !**/*.wasm
  • 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/**
  • schemas/edict-provider/package/v1/generated/primary/authority-facts.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/primary/authority-facts.echo-lawpack.cbor is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/primary/lawpack.echo-dpo.cbor is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/primary/schema.echo-provider-artifacts.cddl is excluded by !**/generated/**
  • schemas/edict-provider/package/v1/generated/primary/target-profile.echo-dpo.cbor is excluded by !**/generated/**
  • tests/edict-provider-host-v1/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (52)
  • CHANGELOG.md
  • crates/echo-edict-provider-lowerer/Cargo.toml
  • crates/echo-edict-provider-lowerer/README.md
  • crates/echo-edict-provider-lowerer/resources/authority-facts.echo-dpo.cbor
  • crates/echo-edict-provider-lowerer/resources/authority-facts.echo-lawpack.cbor
  • crates/echo-edict-provider-lowerer/resources/lawpack.echo-dpo.cbor
  • crates/echo-edict-provider-lowerer/resources/target-profile.echo-dpo.cbor
  • crates/echo-edict-provider-lowerer/src/executable_operation.rs
  • crates/echo-edict-provider-lowerer/src/lib.rs
  • crates/echo-edict-provider-lowerer/tests/executable_operation_package.rs
  • crates/echo-edict-provider-lowerer/tests/fixtures/generated_echo_dpo.rs
  • crates/echo-edict-provider-lowerer/tests/lowerer_contract.rs
  • crates/echo-edict-provider-verifier/Cargo.toml
  • crates/echo-edict-provider-verifier/README.md
  • crates/echo-edict-provider-verifier/resources/authority-facts.echo-dpo.cbor
  • crates/echo-edict-provider-verifier/resources/authority-facts.echo-lawpack.cbor
  • crates/echo-edict-provider-verifier/resources/lawpack.echo-dpo.cbor
  • crates/echo-edict-provider-verifier/resources/target-profile.echo-dpo.cbor
  • crates/echo-edict-provider-verifier/src/executable_operation.rs
  • crates/echo-edict-provider-verifier/src/lib.rs
  • crates/echo-edict-provider-verifier/src/semantic_resources.rs
  • crates/echo-edict-provider-verifier/tests/executable_operation_package.rs
  • crates/echo-edict-provider-verifier/tests/verifier_contract.rs
  • crates/echo-wesley-gen/README.md
  • crates/echo-wesley-gen/assets/v1/edict-provider/contracts/v1/edict-provider-contracts.cddl
  • crates/echo-wesley-gen/assets/v1/edict-provider/contracts/v1/manifest.json
  • crates/echo-wesley-gen/assets/v1/edict-provider/echo-provider-semantics-v1.json
  • 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/src/provider_artifacts.rs
  • crates/echo-wesley-gen/src/provider_contract_pack.rs
  • crates/echo-wesley-gen/src/provider_package.rs
  • crates/echo-wesley-gen/src/provider_semantics.rs
  • crates/echo-wesley-gen/tests/provider_contract_pack.rs
  • crates/echo-wesley-gen/tests/provider_package.rs
  • crates/echo-wesley-gen/tests/provider_package_corpus.rs
  • crates/echo-wesley-gen/tests/provider_semantic_source.rs
  • docs/architecture/application-contract-hosting.md
  • docs/topics/GeneratedRules.md
  • schemas/edict-provider/README.md
  • schemas/edict-provider/components/v1/README.md
  • schemas/edict-provider/contracts/v1/edict-provider-contracts.cddl
  • schemas/edict-provider/contracts/v1/manifest.json
  • schemas/edict-provider/echo-provider-semantics-v1.json
  • schemas/edict-provider/package/README.md
  • schemas/edict-provider/package/v1/provider-manifest.echo.json
  • tests/edict-provider-host-v1/Cargo.toml
  • tests/edict-provider-host-v1/fixtures/provider-conformance-v1/ORIGIN.toml
  • tests/edict-provider-host-v1/fixtures/provider-conformance-v1/canonicalization-profile.json
  • tests/edict-provider-host-v1/tests/host_contract.rs
  • tests/edict-provider-host-v1/tests/package_contract.rs
  • xtask/src/provider_lowerer_component.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch james/generic-edict-operation-lowering

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.

@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.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Merge gate: CI is fully green; no bot-authored review threads exist; CodeRabbit is rate-limited; Codex acknowledged the current head and produced no findings within the bounded review window. Echo main is unprotected and no collaborator approval is required, so criteria 1–4 substitute for human approval.

@flyingrobots
flyingrobots merged commit eb0abb6 into main Jul 28, 2026
40 checks passed
@flyingrobots
flyingrobots deleted the james/generic-edict-operation-lowering branch July 28, 2026 16:52

@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: 5917d6e0bc

ℹ️ 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 on lines +504 to +505
if text_field(step, "targetIntrinsic") != Some(TARGET_INTRINSIC)
|| as_text(failure) != Some(PRECONDITION_MISMATCH)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify the complete Target IR relation

When a schema-valid Target IR changes its effect, input, result, constraints, budget, requirements, binding, or obstructionArms while retaining this intrinsic and failure coordinate, this check still accepts it. The expected package later copies the supplied Target IR digest, so a package emitted for that altered IR compares equal and receives an accepted verifier report even though the IR may no longer implement the supplied Core/adapter relation. Independently compare all semantically relevant target-intent and step fields before certifying the package.

Useful? React with 👍 / 👎.

Comment on lines +593 to +594
"application_schema_coordinate",
canonical_text(&closure.exports.artifact.reference.coordinate),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bind the actual application schema

Every generic package labels the selected lawpack-exports artifact as its application schema. That artifact is the portable lawpack export surface, not the arbitrary application's public contract schema, and no application-schema artifact is otherwise supplied or checked. The emitted application_schema_coordinate and identity therefore attest the wrong artifact, so admission and invocation evidence cannot bind the public input/output contract that the package claims to own.

Useful? React with 👍 / 👎.

Comment on lines +378 to +382
if core_effect
.strip_prefix(lawpack_coordinate)
.is_some_and(|suffix| suffix.starts_with('.') && suffix.len() > 1)
{
return Ok(core_effect.to_owned());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate the source import before resolving effects

When compiler-produced Core contains the fully qualified lawpack effect coordinate, this early return bypasses source inspection entirely. Because validate_source checks only UTF-8 and coordinate equality, arbitrary source bytes can be substituted under that coordinate and the emitted package will bind their digest; the verifier follows the same shortcut and accepts the false source-to-Core/package relation. Require the exact digest-locked lawpack import from parsed source or corroborate the equivalent compiler-owned Core import before returning.

Useful? React with 👍 / 👎.

const GENERATOR_COORDINATE_V1: &str = "echo-wesley-gen.provider-artifact-generator@1";
const EXPECTED_ARTIFACT_COUNT: usize = 10;
const EXPECTED_SCHEMA_BINDING_COUNT: usize = 24;
const EXPECTED_SCHEMA_BINDING_COUNT: usize = 30;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the canonical schema-binding count

This increases the package closure to 30 schema bindings, but docs/architecture/application-contract-hosting.md still describes the package identity as containing 24 bindings and decomposes that obsolete count. That stale canonical description can cause reviewers or external package implementations to construct the wrong identity preimage; update the owning architecture document alongside the generated/package documentation.

AGENTS.md reference: AGENTS.md:L144-L150

Useful? React with 👍 / 👎.

Comment on lines +323 to +327
let selected = adapters
.iter()
.find(|candidate| {
required_map(candidate, "acceptedTargetProfile", "lawpack.echo-operation")
.is_ok_and(|reference| resource_ref_matches(reference, target_profile))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject duplicate adapters for the selected profile

When a schema-valid lawpack contains multiple targetAdapters entries for the same exact target profile, this selects the first instead of rejecting the ambiguous lawpack. The CDDL represents these entries as an array and does not enforce selector uniqueness, while this generic route does not run the semantic-source validator that normally rejects duplicate selectors. Conflicting adapters can therefore be hidden behind array order and both the lowerer and copied verifier logic will certify whichever entry appears first; require exactly one matching selector.

Useful? React with 👍 / 👎.

Comment on lines +114 to +115
The refreshed 230,285-byte checked lowerer component has SHA-256
`9575ca8c843f3dfe4e5550ecdc40a8a8584c1aa7012b5b6f6a76e3f05f1b68f3` and has

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Publish the promoted component identities

This README publishes a 230,285-byte lowerer with digest 9575ca…, but the checked component in this revision is 230,297 bytes with SHA-256 f800df20…; the verifier README and component README likewise retain the obsolete 247,754-byte/d87f3d… identity instead of the checked 247,766-byte/edbef0fe… artifact. Anyone following these audit pins will reject the repository artifacts or authenticate obsolete bytes, so synchronize all component identity documentation with the promoted files.

AGENTS.md reference: AGENTS.md:L144-L150

Useful? React with 👍 / 👎.

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.

Accept adapter-lowered target obstruction coordinates

1 participant