Skip to content

fix(opy): converge project preprocessing composition - #164

Merged
Teakowa merged 2 commits into
mainfrom
codex/issue-161-preprocessing
Sep 2, 2026
Merged

fix(opy): converge project preprocessing composition#164
Teakowa merged 2 commits into
mainfrom
codex/issue-161-preprocessing

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • converge directory includes, nested include resolution, and stable cross-file source provenance
  • resolve __script__ macro files relative to their definition file and honor open-document overlays
  • preserve preprocessing state across include boundaries and report malformed macro declarations structurally
  • add independent Issue Converge preprocessing and project-composition conformance exposed by #158 #161 project-composition coverage and keep the support matrix copies synchronized

Fixes #161

Validation

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo test --locked --workspace --all-targets --all-features
  • python3 -m unittest discover -s compatibility/tests
  • offline conformance: 63 fixtures, compile-status 63/63 match, no new unowned preprocessing divergence

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

Major — crates/opy-rs/src/preprocess.rs:393

display_path canonicalizes/collapses .. components, so distinct overlay imports can be registered under the same HIR path. The existing alias_include_paths_are_distinct_imports case (shared.opy vs dir/../shared.opy) now produces two file IDs both named shared.opy, even though the overlays may contain different source. That breaks the cross-file provenance AC. Preserve a stable path identity that does not merge distinct imported sources.

Major — crates/opy-rs/src/preprocess.rs:761

resolve_script resolves the script against the definition file but stores the original declared path in ScriptMacro. Runtime errors therefore attribute a nested macro such as modules/nested/scripted.opy -> scripts/add.js only to scripts/add.js; two definition directories using the same relative script name become indistinguishable. The pinned OverPy reference stores the resolved getFilePaths(..., basePath)[0] path. Store/use the resolved project-relative path for runtime/diagnostic provenance.

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

LGTM

@Teakowa
Teakowa merged commit 0016368 into main Sep 2, 2026
5 checks passed
@Teakowa
Teakowa deleted the codex/issue-161-preprocessing branch September 2, 2026 08:33
This was referenced Sep 2, 2026
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.

Converge preprocessing and project-composition conformance exposed by #158

2 participants