Repository navigation
Description
Prerequisite for #1266.
What a snapshot records today
Identity and status per resource, plus the stack's CloudFormation exports:
"webServer": {
"type": "AWS::EC2::Instance",
"physicalId": "i-e392157f576caf855",
"status": "CREATE_COMPLETE",
"attributes": { "expAmiName": "...", "expDefaultSubnet1": "...", "expHttpPort": "80", ... }
}That attributes blob is the stack's exports and is identical for every resource in the stack — webServer, publicSubnet and webSecurityGroup all carry the same one. There are no per-resource properties: no subnet for an instance, no attached security groups, no MapPublicIpOnLaunch, no route-table associations, no ingress rules.
Why that blocks snapshot-backed search
chant's distinguishing answers are folds over topology. internetFacing resolves subnet → route table → internet gateway, including a default VPC's main-table association. effectiveIngress resolves rules across directly attached security groups and any reached through a launch template.
None of those inputs are in the snapshot. So search --at latest "kind:EC2::Instance attr:internetFacing=true" cannot be answered from a recorded observation, which is most of the value of #1266.
The machinery already exists
observeResourcesDeep and deepDiffForLexicon are implemented and wired into lifecycle diff --live — that is what "lexicons with a deep reader also report property-level drift" refers to. takeSnapshot only ever calls the thin describeResources path.
Proposal
Let a snapshot be taken at deep depth, and record which depth it was taken at.
chant lifecycle snapshot <env> --deep
- The snapshot records the normalized per-resource property trees the deep reader returns, alongside the identity it already keeps.
depthbecomes a field on the snapshot, surfaced inlifecycle showand in search's provenance line (Design: search reads observations from a source, and always says which one #1266), so a caller knows what the recorded observation can and cannot answer.- Thin stays the default. A deep read is more provider calls and a larger record; it should be asked for.
Deep observation already has the rules this needs — a reader that throws reports entities as NOT-OBSERVED with read-failed rather than vanishing (#1089), and secrets are masked before any property tree is rendered or committed (#1014). Both matter more for a snapshot than for a diff, because a snapshot is written to git and read back later.
Open question
Whether the fold results themselves (internetFacing, effectiveIngress) should be recorded, or only their inputs so folds re-run at query time. Recording inputs keeps the snapshot a record of observation rather than of computation, and means a fold improvement applies retroactively to old snapshots. That seems clearly right, but it makes a deep snapshot meaningfully larger.
Activity
feat(lifecycle): snapshot at deep depth, and say which depth it was (#…
feat(lifecycle): snapshot at deep depth, and say which depth it was (#…
fix(lifecycle): plan's held-properties pass is behind --deep, and cat…