Skip to content

fix: strip $N suffix from resource name in resource tracking maps#86

Merged
avrabe merged 1 commit intomainfrom
fix/resource-name-suffix-stripping
Apr 2, 2026
Merged

fix: strip $N suffix from resource name in resource tracking maps#86
avrabe merged 1 commit intomainfrom
fix/resource-name-suffix-stripping

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

  • Strip $N multi-memory dedup suffix from resource names when recording in resource_rep_by_component and resource_new_by_component maps
  • Without this, the adapter generator looks up (5, "float") but the map contains (5, "float$5"), causing fallback to the wrong component's import
  • This is one of several layers needed for 3-component resource chain support

Debugging findings

The adapter function body for the runner→intermediate call currently references canon resource.rep 21 (comp 0's type) instead of canon resource.rep 36 (comp 5's type). The $N suffix stripping fixes the map lookup, but the adapter code generation (fact.rs) also needs work — the adapter call signature doesn't match the canonical function type for some adapters. This is the next layer to investigate.

Part of #69.

Test plan

  • 276 tests pass, 0 failures
  • No regressions

🤖 Generated with Claude Code

The merger adds $N suffixes to deduplicated import field names in
multi-memory mode (e.g., [resource-rep]float$5). The resource_rep/new
_by_component maps must store the bare resource name ("float") so the
adapter generator can look up by (component_idx, resource_name).

Without this, the adapter falls back to the wrong component's import,
causing resource type mismatch at runtime.

Part of #69.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 2a5746b into main Apr 2, 2026
4 checks passed
@avrabe avrabe deleted the fix/resource-name-suffix-stripping branch April 2, 2026 18:14
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