Skip to content

fix(lifecycle): observed nodes carry their own properties, stack exports stay on the stack (#1279) - #1821

Merged
lex00 merged 2 commits into
mainfrom
fix/1279-observed-node-own-properties
Aug 23, 2026
Merged

lex00 merged 2 commits into
mainfrom
fix/1279-observed-node-own-properties

Conversation

@lex00

@lex00 lex00 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What

The AWS describeResources copied the stack's CloudFormation outputs onto every resource's attributes. Every node in a stack carried the same expVpcId/expWebIp/... set, and a VPC's attrs were the stack's exports rather than its own CidrBlock/IsDefault.

Stack exports now travel once, on the observation envelope, keyed by stack. A node's attrs are the resource's own properties and nothing else. Same shape as #1267 gave snapshots.

Changes

  • ObservationResult.stackExports (core observation.ts), carried by normalizeObservation / mergeObservations and the observation() helper.
  • LiveObservation.stackExports; buildLiveGraphIr projects it onto GraphIR.exports as { name, value, stack }. IRExport gains optional value / stack.
  • sourceOverlayGraphs joins observed export values onto the declared exports by name and appends the stack-only ones.
  • LifecycleSnapshot.stackExports recorded by takeSnapshot and replayed by replay.ts, so --at and --live agree.
  • AWS describeResources stops copying outputs onto each resource and returns them under stackExports[stackName] (still scrubbed). describeOwnProperties unchanged in behaviour; its header comment no longer claims outputs are kept on the node.

Tests

  • lexicons/aws/src/lifecycle-integration.test.ts: a live-observed VPC exposes CidrBlock / IsDefault, carries no exp* keys, and the stack carries the (scrubbed) exports; through buildLiveGraphIr the exports land on ir.exports, not the node.
  • packages/core/src/graph-ir-live.test.ts: exports projection, omitted when none, and the source-overlay join.
  • properties.test.ts case reworded: prior attrs are kept, own property wins the name.

Full npx vitest run: 975 files, 12342 tests passing. Core tsc --noEmit clean.

Closes #1279

lex00 added 2 commits August 23, 2026 13:21
…rts stay on the stack (#1279)

The AWS observation copied the stack's CloudFormation outputs onto every
resource's `attributes`. A VPC came out carrying `expVpcId`, `expWebIp` and
twenty-odd other keys every member of the stack also carried, and a plain
`attr:` query on an observed node answered with the stack's exports rather
than the resource's properties. The per-resource describe from #1279's first
half already joined `CidrBlock`/`IsDefault` on top, but the exports stayed
underneath, on every node.

The outputs are the stack's. They now ride the observation envelope once,
under `stackExports`, keyed by the stack that publishes them and scrubbed the
same way they were before. `normalizeObservation`/`mergeObservations` carry
the field, `observe` passes it onto the `LiveObservation`, and
`buildLiveGraphIr` projects it onto the IR's `exports` with `value` and
`stack`, which is where the declared graph already keeps what a stack
publishes. `sourceOverlayGraphs` joins observed values onto the declared
exports by name. Snapshots record it beside `resources` and replay it back
through the same path, so a recorded estate and a live one agree.

A node's `attrs` are now that resource's own properties and nothing else.
Lexicons with no notion of a stack export are untouched.
@lex00
lex00 merged commit dfbdab3 into main Aug 23, 2026
5 checks passed
@lex00
lex00 deleted the fix/1279-observed-node-own-properties branch August 23, 2026 19:55
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.

Observed nodes carry the stack's exports as attributes, not their own properties

1 participant