Skip to content

feat(warp-core): carry proven-range facts through authored effect programs - #934

Open
flyingrobots wants to merge 2 commits into
mainfrom
feat/effect-program-proofs
Open

flyingrobots wants to merge 2 commits into
mainfrom
feat/effect-program-proofs

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

Authored effect programs were prepared with an empty proof, so a runtime core.bytes.slice or core.integer.subtract inside an effect program needed literal operands. Jim's flat ReplaceRange needs isUtf8(slice(text, 0, at)) with a runtime at inside its edit. Preparation now follows Edict's proven-range rules (edict-syntax/src/target_ir/totality.rs), implemented independently in Echo:

  • Input constraints dominate the whole body. Each is checked without facts, then all of them prove later nodes.
  • An unsigned let proven below its width carries that ceiling to later nodes (counts, literals, sums, or a constraint such as at <= 10).
  • Addition bounds use dominating facts comparing the term with a constant (term <= c, term == c, either side), as Edict's do. This also applies to conjunct prefixes inside helper predicates.
  • Earlier conjuncts of one all prove later ones (unchanged).
  • A require proves nothing after it, matching Edict: it ends evaluation on failure but is not a dominating fact.

Only warp-core changes. The provider lowerer and verifier don't judge effect-program bodies yet, so no component promotion is needed.

Tests (tests/edict_effect_package_tests/proven_ranges.rs, 9)

  • An input constraint at <= len(text) proves a runtime prefix slice; without it, or with the constraint on another operand, the program is refused at preparation.
  • A require guard before the slice does not prove it (refused).
  • A let count carries its ceiling: count + (u64::MAX - 64) accepted, - 63 refused.
  • An input constraint bounds a let and later additions: at <= 10 accepts + (u64::MAX - 10), refuses - 9; at == 10 and 10 == at do the same.
  • Runtime: Jim's conjunction at <= len(text) && isUtf8(slice(text, 0, at)) on "hé" accepts offsets 0, 1, 3 and takes the authored app.BadOffset obstruction for 2 (inside é), 4 and u64::MAX; the same check outside its conjunction is refused before it runs.

The three positive cases failed before the change.

Test plan

  • cargo test -p warp-core --features native_rule_bootstrap,trusted_runtime,host_test,delta_validate (114 suites)
  • cargo clippy -p warp-core --all-targets with those features, -D warnings (Rust 1.96.0, the pinned toolchain)
  • scripts/ban-globals.sh, scripts/ban-nondeterminism.sh
  • Pre-commit and pre-push hooks

…grams

Effect programs were judged with an empty proof, so a runtime slice or
subtraction needed literal operands and Jim's isUtf8(slice(text, 0, at))
could not run inside an edit. Preparation now follows Edict's rules: the
intent's input constraints dominate the whole body, an unsigned let
proven below its width carries that ceiling to later nodes, and an
addition bound also uses a dominating fact comparing its term with a
constant. Earlier conjuncts of one all still prove later ones. A require
proves nothing after it, as in Edict.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: flyingrobots/echo/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 186b207d-0433-4d1f-bd14-58d91ec306ca
📥 Commits

Reviewing files that changed from the base of the PR and between 9c32e0b and 1443e3e.

📒 Files selected for processing: 7
  • CHANGELOG.md
  • crates/warp-core/src/edict_effects/instruction_relation.rs
  • crates/warp-core/src/edict_pure/functions.rs
  • crates/warp-core/src/edict_pure/proven_order.rs
  • crates/warp-core/tests/edict_effect_package_tests.rs
  • crates/warp-core/tests/edict_effect_package_tests/proven_ranges.rs
  • docs/topics/GeneratedRules.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T14:19:51.998338Z 1443e3e New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant