Skip to content

Add Echo Target IR lowering - #67

Merged
flyingrobots merged 27 commits into
mainfrom
target-ir/echo-span-v0.9
Jun 28, 2026
Merged

Add Echo Target IR lowering#67
flyingrobots merged 27 commits into
mainfrom
target-ir/echo-span-v0.9

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • add the first edict_syntax Target IR lowering surface for echo.dpo@1 -> echo.span-ir/v1
  • emit deterministic in-memory Echo Span IR review artifacts for the supported effectful Core shape
  • reject non-Echo targets and unsupported Core nodes with stable TargetLoweringFailureKind values before producing artifacts
  • derive Target IR lowering facts from native TargetProfileFacts so lowerability evidence feeds the same Echo intrinsic selection
  • add the docs/topics/target-ir/ topic shelf and update roadmap/changelog signposts; git-warp is recorded as the next target after Echo

RED/GREEN

  • RED: cargo test -p edict-syntax --test target_ir failed on unresolved Target IR API
  • GREEN: cargo test -p edict-syntax --test target_ir
  • RED: cargo test -p edict-syntax --test target_ir lowerability_native_support_feeds_echo_target_lowering failed on missing TargetIrLoweringFacts::from_target_profile_facts
  • GREEN: cargo test -p edict-syntax --test target_ir lowerability_native_support_feeds_echo_target_lowering

Verification

  • cargo test -p edict-syntax --test target_ir
  • cargo xtask contract-check
  • markdownlint-cli2 CHANGELOG.md ROADMAP.md docs/topics/README.md docs/topics/target-ir/README.md docs/topics/target-ir/test-plan.md
  • cargo xtask verify

Boundaries

  • no Echo runtime execution
  • no admission workflow
  • no general target-lowering plugin dispatch
  • no git-warp lowering in this PR; gitwarp.ref_crdt@1 is next after Echo
  • no v2 chained or composite adapter resolution

Closes #66

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 30 minutes and 43 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

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

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb478b08-6055-49cb-b264-ed06aff8c4cb

📥 Commits

Reviewing files that changed from the base of the PR and between d6f9225 and b2671fe.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • crates/edict-syntax/src/lowerability.rs
  • crates/edict-syntax/src/target_ir.rs
  • crates/edict-syntax/tests/lowerability.rs
  • crates/edict-syntax/tests/target_ir.rs
  • docs/topics/lowerability/README.md
  • docs/topics/lowerability/test-plan.md
  • docs/topics/target-ir/README.md
  • docs/topics/target-ir/test-plan.md

Walkthrough

Introduces the first Target IR lowering surface in edict-syntax: a new target_ir module that emits deterministic echo.span-ir/v1 artifacts from supported Core shapes for echo.dpo@1. LowerabilityReport gains an operation_profile field. A 538-line test suite and full documentation/test-plan accompany the implementation.

Changes

Echo Target IR Lowering Pipeline

Layer / File(s) Summary
LowerabilityReport operation_profile extension
crates/edict-syntax/src/lowerability.rs, crates/edict-syntax/tests/lowerability.rs, docs/topics/lowerability/README.md, docs/topics/lowerability/test-plan.md
Adds operation_profile: String to LowerabilityReport, populates it in check_lowerability, adds a test assertion for the expected value, and expands the public-surface docs to reflect the new field.
Target IR data structures and artifact model
crates/edict-syntax/src/target_ir.rs (lines 1–145)
Defines ECHO_DPO_TARGET_PROFILE/ECHO_SPAN_IR_DOMAIN constants and all public data types: TargetIrLoweringFacts, TargetEffectLowering, TargetLoweringStatus, TargetLoweringFailureKind (12 variants), TargetLoweringFailure, TargetLoweringReport, TargetIrArtifact, TargetIrIntent, TargetIrStep.
lower_to_target_ir validation and lowering pipeline
crates/edict-syntax/src/target_ir.rs (lines 146–403)
Implements target-selection validation, Core ABI/capability checks, per-intent lowering (lower_intent), CoreNode dispatch (rejecting Let, mapping Effect to steps), effect-to-intrinsic resolution with structured diagnostics, and unsupported-report construction helpers.
Crate root wiring
crates/edict-syntax/src/lib.rs
Declares pub mod target_ir and re-exports all new types and constants; updates crate-level docs to mention Echo Target IR lowering and enumerate deferred responsibilities.
Target IR test suite
crates/edict-syntax/tests/target_ir.rs
538-line suite with fixture sources, Core/context/facts builders, 12 named tests covering successful lowering, native-lowerability bridging, semantic preservation (obstruction arms, intent results, chained bindings), and negative cases for every TargetLoweringFailureKind.
Docs, test plan, changelog, and roadmap
docs/topics/target-ir/*, docs/topics/README.md, CHANGELOG.md, ROADMAP.md
Adds Target IR topic chapter and test plan; inserts entry in the topics index; updates changelog with stable failure semantics; expands v0.9.0-alpha.1 roadmap milestone with concrete identifiers, scope bullets, and a git-warp non-goal.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • flyingrobots/edict#37: Introduced the typed lowerability.rs / check_lowerability / LowerabilityReport model that this PR directly extends with operation_profile and feeds into TargetIrLoweringFacts::from_lowerability_report.

Poem

echo.dpo@1 heard the call,
Spanned its IR down the hall.
CoreNode::Let? Rejected. Cold.
Twelve failure kinds, precisely told.
No runtime ran, no git-warp crept—
Just deterministic steps, perfectly kept. 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 79.07% 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
Title check ✅ Passed The title is concise and accurately names the main change: Echo Target IR lowering.
Description check ✅ Passed The description is directly related to the PR and summarizes the Target IR lowering work.
Linked Issues check ✅ Passed The implemented Target IR pipeline, docs, tests, and lowerability bridge align with #66's scope and exit criteria.
Out of Scope Changes check ✅ Passed No clear out-of-scope code changes are present; the docs, tests, and API updates all support the Echo Target IR slice.

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

@codex review please

@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: 1f3923da83

ℹ️ 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 crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026

@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: 1f3923da83

ℹ️ 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 crates/edict-syntax/src/target_ir.rs
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
Comment thread crates/edict-syntax/src/target_ir.rs
Comment thread crates/edict-syntax/src/target_ir.rs Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex second opinion requested on this self-discovered issue before I fix it.

ID Severity Source File Lines Issue Planned mitigation
SELF-001 P3 Self-audit/local gate crates/edict-syntax/src/target_ir.rs lower_to_target_ir cargo xtask verify fails Clippy too_many_lines after the review-feedback fixes expanded the function to 103 lines. Extract small helpers for target/profile validation or intent lowering without changing public behavior, then rerun focused target-IR tests and cargo xtask verify.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Activity Summary

ID Severity Source File Commit Outcome
1 P2 PR crates/edict-syntax/src/target_ir.rs 8177d39 Target IR facts now derive from selected native lowerability results instead of carrying unselected native effect support.
2 P2 PR crates/edict-syntax/src/target_ir.rs e43fd11 Echo Target IR steps preserve structured obstruction arms, not just failure keys.
3 P2 PR crates/edict-syntax/src/target_ir.rs fc3e93e Target IR intents preserve result expressions.
4 P2 PR crates/edict-syntax/src/target_ir.rs dcc1f75 Target IR steps preserve effect result bindings for data dependencies.
5 P2 PR crates/edict-syntax/src/target_ir.rs 8cd979f Target lowering validates operation-profile support before emitting artifacts.
6 P2 PR crates/edict-syntax/src/target_ir.rs c3f47b0 Empty target-step intents reject with NoTargetSteps instead of producing empty artifacts.
SELF-001 P3 Self crates/edict-syntax/src/target_ir.rs bdd3fb8 Split target-lowering helpers so cargo xtask verify passes Clippy without lint exceptions.

Verification after fixes:

  • cargo test -p edict-syntax --test target_ir
  • cargo xtask contract-check
  • markdownlint-cli2 CHANGELOG.md ROADMAP.md docs/topics/README.md docs/topics/target-ir/README.md docs/topics/target-ir/test-plan.md
  • cargo xtask verify

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex review please

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 28, 2026
@flyingrobots
flyingrobots deleted the target-ir/echo-span-v0.9 branch July 9, 2026 15:50
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.

v0.9: lower one supported Core effect shape into Echo Span IR

1 participant