Skip to content

feat: resource ownership graph (petgraph) — Phase 1#52

Merged
avrabe merged 1 commit into
mainfrom
feat/resource-ownership-graph
Mar 21, 2026
Merged

feat: resource ownership graph (petgraph) — Phase 1#52
avrabe merged 1 commit into
mainfrom
feat/resource-ownership-graph

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Mar 21, 2026

Adds ResourceGraph with O(1) ownership queries. No behavior change. 73/73 pass.

Adds ResourceGraph built from resolved_imports and parsed components.
Provides O(1) queries: defines_resource(), resource_definer(),
is_reexporter(). No behavior change — graph built alongside existing code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe force-pushed the feat/resource-ownership-graph branch from 8c78709 to 3c0885c Compare March 21, 2026 17:01
@avrabe avrabe merged commit 825ac65 into main Mar 21, 2026
3 checks passed
@avrabe avrabe deleted the feat/resource-ownership-graph branch March 21, 2026 17:11
avrabe added a commit that referenced this pull request May 19, 2026
Two related fixes for the LS-N verification gate's coverage of
LS-CP-4 ("DWARF passthrough emits address-incorrect debug info").

1. `meld-core/tests/dwarf_strip.rs` already had three tests pinning
   Phase 1.5's Strip-default policy (the mitigation LS-CP-4 calls
   for): `default_strips_dwarf`, `passthrough_preserves_dwarf`,
   `default_is_strip`. The gate didn't see them because the names
   don't match the `ls_cp_4_*` convention. Adds three convention
   aliases that delegate to the existing test bodies — same pattern
   as the five aliases in PR #161.

2. `tools/run_ls_verification.py` was invoking `cargo test --lib`,
   which excludes integration tests under `<package>/tests/`. Drops
   the `--lib` filter so both lib and integration-test binaries
   participate. Each cargo target prints its own `test result:`
   line; the parser already sums across multiple matches, so this
   is a one-line change with no other plumbing impact.

Gate result moves from 16/19 verified (3 missing: LS-CP-4, LS-A-8,
LS-A-9) to 17/19 verified (2 missing: LS-A-8, LS-A-9). The
remaining two need net-new tests, not aliases — surveyed in task
#52, scoped at ~1-2h (LS-A-9) and ~2-4h (LS-A-8).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
avrabe added a commit that referenced this pull request May 19, 2026
The async-callback adapter at lines 3992-3998 of `fact.rs`
dispatches `[waitable-set-poll]` on `WAIT (2)` OR `POLL (3)` via
an `I32Const(WAIT) + I32Eq + LocalGet + I32Const(POLL) + I32Eq +
I32Or` instruction skeleton. A previous version of that branch
matched only `WAIT`, silently treating `POLL` as YIELD which sent
`(EVENT_NONE, 0, 0)` to `[callback]` and dropped any event the
host had ready (LS-A-9). The fix landed without a regression test;
the LS-N verification gate surfaced this gap as the next-to-last
missing entry.

Adds `ls_a_9_callback_adapter_dispatches_both_wait_and_poll`,
which:

1. Builds a minimal `MergedModule` fixture with the prerequisites
   the callback emitter requires:
   - One `() -> i32` lift function
   - The `[callback]<export_name>` companion export
   - A `[waitable-set-poll]` host import
2. Drives `generate_async_callback_adapter` to produce the adapter
3. Scans the emitted function body for the byte sequence
   `0x41 0x02 0x46 0x20` (i32.const WAIT(2) / i32.eq / local.get)
   followed by `0x41 0x03 0x46 0x72` (i32.const POLL(3) / i32.eq /
   i32.or), in order

Pin-by-substring is robust against unrelated body changes (locals
layout, surrounding control flow); a regression that drops the
POLL arm or reorders the comparisons would fail this test.

Gate verdict moves from 17/19 verified to **18/19**; remaining
missing entry is LS-A-8 (inner-list rep_func selection — surveyed
in task #52 at ~2-4h scope).

This is the **first PR to touch a Tier-5 source file** since the
mythos-auto.yml plumbing fixes (#164), so it also serves as the
auto-runner's first true end-to-end matrix-scan smoke test.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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