Skip to content

fix(status): let a component's resource rollup reach the consumer that paints it (behold#100) - #1308

Merged
lex00 merged 3 commits into
mainfrom
fix/100-component-status-rollup-reaches-consumers
Aug 2, 2026
Merged

lex00 merged 3 commits into
mainfrom
fix/100-component-status-rollup-reaches-consumers

Conversation

@lex00

@lex00 lex00 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Unblocks behold#100 (B·aws), the next slot in the CC AWS lane (#1198).

#1300 added resources to ComponentStatusRow. behold#98 shipped its consumer against floci-az / floci-gcp rows, where the field was present. On AWS it never arrived — three independent drops, each sufficient on its own.

The three drops

1. mergeLiveEvidence silently dropped it. The merge rebuilds the evidence object field by field, and rollup was not named. The stack overlay runs wherever a lexicon implements describeStackStatus — AWS and only AWS — so the counts were computed and then discarded on exactly the substrate the rollup was meant to be verified against.

2. The --json projection never emitted it. StatusJsonRow carries live, unobserved and stack, but not resources. That projection is the only surface a consumer sees, so even a surviving rollup stopped at the CLI boundary.

3. The counts were wrong anyway. describeResources defaults to the single-stack convention — the stack named after the environment. A component project deploys whatever its own cfn-deploy names, so every declared resource came back absent and a healthy ten-resource estate reported present: 0. The change set now reads each component's own cfn-deploy stacks (the same ones observeComponentStacks already reads), with config.stacks as the declared override, merged through mergeObservations.

Verified

Against Floci on examples/cc-aws-canonical, added here:

{ "component": "cc-canonical", "live": true,
  "stack": { "name": "cc-canonical", "status": "CREATE_COMPLETE", "healthy": true },
  "resources": { "total": 10, "present": 10, "absent": 0, "unobserved": 0 } }

Before this branch: no resources key at all. With only fixes 1 and 2: present: 0 over a healthy estate.

What this does not buy, stated so nobody reads more into it

On AWS the counts inherit describe-stack-resources, so they report CloudFormation's per-resource inventory rather than independently observed existence. Terminating a stack's EC2 instance out of band leaves it listed CREATE_COMPLETE and the rollup still reports it present — checked on the emulator, not assumed. Making the rollup a live existence check is #1269/#1271's per-type reader registry applied to the thin path, which #1198 already records as carried.

The example

examples/cc-aws-canonical is the estate this was proved on and the vehicle #1208's round-trip needs: VPC / subnet / EC2 / SG across two source directories, one component owning all ten resources via liveNames. Its README records why stacks and sourceDir are load-bearing rather than decorative, and the two limits above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FBkcXzqjyY1YKWdaDFuqKs

lex00 and others added 2 commits August 2, 2026 12:18
The branch existed only on one machine, which the entry did not say — and the
image these lanes depend on was built from it. It is now on lex00/floci as
`fix/cfn-security-group-rules-and-tags`, ready for a PR to floci-io/floci.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RL2jfiURpWMntm9VFmeHk
…t paints it (behold#100)

#1300 added `resources` to `ComponentStatusRow` — how many of a component's own
resources came back, the substrate-neutral answer for a substrate with no deploy
object to read. behold#98 shipped its consumer against floci-az/floci-gcp rows
and the field was there. On AWS it never arrived, for three separate reasons,
each of which alone was enough to lose it.

`mergeLiveEvidence` rebuilds the evidence object field by field, and `rollup`
was not one of the fields it named. The stack overlay runs wherever a lexicon
implements `describeStackStatus`, which is AWS and only AWS, so the counts were
computed and then discarded on exactly the substrate the rollup was meant to be
verified against.

`chant components status --json` projects the row field by field too, and
carries `live`, `unobserved` and `stack` but not `resources`. That projection is
the only surface a consumer sees, so even a surviving rollup stopped at the CLI
boundary.

The counts were also wrong. `describeResources` defaults to the single-stack
convention — the stack named after the environment — which is not what a
component project deploys: the stack is whatever its own `cfn-deploy` names. Every
declared resource came back absent, so a healthy ten-resource estate reported
`present: 0`. The change set now reads each component's own `cfn-deploy` stacks
(the same ones `observeComponentStacks` already reads), with `config.stacks` as
the declared override, merged via `mergeObservations`.

Verified against Floci on the canonical example added here: `{ total: 10,
present: 10, absent: 0, unobserved: 0 }` alongside a `CREATE_COMPLETE` stack.

Worth stating, because the field invites more confidence than it has earned: on
AWS these counts inherit `describe-stack-resources`, so they report
CloudFormation's per-resource inventory, not independently observed existence.
Terminating a stack's instance out of band leaves it listed `CREATE_COMPLETE`
and the rollup still reports it present. Making it a live check is #1269/#1271's
per-type reader registry applied to the thin path.

`examples/cc-aws-canonical` is the estate all of this was proved on — VPC /
subnet / EC2 / SG, one component owning all ten resources via `liveNames` — and
is the vehicle #1208's round-trip needs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBkcXzqjyY1YKWdaDFuqKs
Adding examples/cc-aws-canonical grows the corpus 101 -> 102, and it lands in
the run-fallback group: `output(vpc.VpcId, "VpcId")` passes a same-file
resource reference to an authoring helper, which the folder does not represent
yet and reports as such. A documented limitation, not a fault in the example, so
the count moves rather than the source.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBkcXzqjyY1YKWdaDFuqKs
@lex00
lex00 merged commit 66e62af into main Aug 2, 2026
6 checks passed
@lex00
lex00 deleted the fix/100-component-status-rollup-reaches-consumers branch August 2, 2026 19:52
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