Skip to content

feat(core): fold cross-file references into lexicon package exports (Azure/GCP pseudo-params, action constants) #1063

Closed

Description

@lex00

Second-largest remaining fold blocker after #1044, and currently untracked. Measured on main a0e7ffe9 (after #1020 shipped).

The gap

#1020 resolves cross-file identifiers through project files only — isProjectFileSpecifier in fold-import.ts skips bare package specifiers. So an identifier imported from a lexicon package still fails with unresolved identifier, even when what it names is plain static data.

Remaining unresolved identifier blockers on the corpus, by name:

name blocks what it is
config 11 project-file const (deeper chains #1020 doesn't reach)
Azure 11 azure pseudo-parameter namespace
GCP 8 gcp pseudo-parameter namespace
process 5 correctly rejected — leave alone
S3Actions 2 aws action constants
CI 2 gitlab constants
GCP_PROJECT_ID, shared 2 misc

Why this is tractable

The lexicons already emit exactly the shape fold handles. lexicons/azure/src/pseudo.ts:63:

export const Azure = {
  ResourceGroupName, ResourceGroupLocation, ResourceGroupId,
  SubscriptionId, TenantId, DeploymentName,
} as const;

That is a plain const object literal — structurally identical to a project-file const that folds today. AWS declares AWS the same way. This is not a code-generation problem; the generators are already producing foldable source. The blocker is purely the resolver's scope.

Scope

  • Extend cross-file resolution to bare specifiers that resolve into an active lexicon package, reusing feat(core): fold — resolve identifiers across the module graph #1020's existing machinery (the per-build memo, one-instance-per-export identity guarantee, cycle detection).
  • Keep the boundary tight: resolve only into packages already loaded as lexicons for this build. Do not walk arbitrary node_modules.
  • process and anything else environment-dependent must keep failing. That rejection is the point of the subset, not a gap.

Watch out for

Expected value

~25 corpus entries are blocked by cross-file alone, and 4 more by cross-file plus call-as-a-value. With #1044 (~45 entries), these two together take fold coverage from today's 21/98 to roughly 91/98.

Acceptance

  • A lexicon-exported const (pseudo-parameter namespace, action constants) resolves and folds when referenced as a value.
  • process.env and environment-dependent references still reject, with tests.
  • EXPECTED_FOLD updated; before/after entry counts reported; no entry that folds today regresses.
  • No regression in suite runtime — verify with a repeat-run harness, not a single pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions