[APPS][Connections Part 9] Trace imported connection ID values#365
[APPS][Connections Part 9] Trace imported connection ID values#365sdkennedy2 wants to merge 1 commit into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98a8c40d8f
ℹ️ 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".
| return sources.map((source, index) => { | ||
| const resolvedId = staticDependencies[index] ?? resolvedBySource.get(source) ?? source; | ||
| resolvedBySource.set(source, resolvedId); |
There was a problem hiding this comment.
Preserve dependency alignment when sources repeat
When a module imports/re-exports the same source more than once before another source, this index-based pairing shifts every later resolution because Rollup exposes importedIds/importedIdResolutions once per unique source. For example import './a'; import './a'; import { HTTP_ID } from './ids'; produces dependencies [a, ids], but this maps the second ./a to ids and leaves ./ids unresolved as the literal string, so imported connection IDs from ./ids fail as outside the collected graph. Reuse the cached resolution for a source before consuming the next dependency index, or build the mapping directly from Rollup's source order.
Useful? React with 👍 / 👎.

Motivation
The backend connection ID stack can already find action-catalog calls in reachable backend helper modules, but it still fails closed when the
connectionIdvalue is imported from another local module. Real apps commonly keep connection IDs in sharedconnectionsoridsmodules, so the manifest analysis needs to trace those imported static values without changing graph collection or reachability traversal.Changes
This PR adds graph-aware import/export value tracing on top of the existing reachable module graph extraction. Module graph records now preserve enough resolved static import information for value tracing to map AST import/export source literals back to collected module records.
The connection ID resolver keeps the same same-module behavior by default, but graph extraction now passes an optional imported-value resolver. That resolver follows named imports, local export aliases, aliased re-exports, import/export relays, and unambiguous
export *chains back to static exported constants or object roots. Imported object roots reuse the existing static object member resolver, so patterns like this are handled demand-first from an action-catalog call site:The implementation keeps the analysis conservative. Missing exports, mutable or reassigned exports, default and namespace imports, ambiguous star exports, import/export cycles, and unsupported object shapes still fail closed instead of silently producing an incomplete allowlist.
QA Instructions
Validated the apps plugin with typecheck, focused lint, focused AST/module graph tests, and the full apps plugin unit slice:
Blast Radius
This affects High Code Apps backend connection ID manifest analysis for backend builds and dev backend execution. It only changes static analysis for app-local backend modules collected through the backend module graph; unsupported shapes continue to fail closed.
Documentation