Skip to content

feat(status): report how a component's own resources answered (behold#98) - #1300

Merged
lex00 merged 1 commit into
mainfrom
feature/behold98-resource-rollup
Aug 2, 2026
Merged

lex00 merged 1 commit into
mainfrom
feature/behold98-resource-rollup

Conversation

@lex00

@lex00 lex00 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

The chant half of behold#98, which cannot be done in behold alone — the rollup has to come from the side that owns observation semantics.

Why

ComponentStatusRow carries live (a boolean) and stack (CloudFormation-only). behold paints component status from stack, so on any substrate without a deploy object — floci-az and floci-gcp have none — there is nothing to paint from. That is behold#98's problem, and behold cannot solve it from what chant emits today.

What

mergeEvidence already collapses several entities' verdicts into one component answer. It now also reports the shape it collapsed, and ComponentStatusRow carries it:

resources?: { total: number; present: number; absent: number; unobserved: number }

Substrate-neutral because it aggregates observations, which every lexicon produces, rather than a provider-specific grouping object. It keeps #1089's distinction — a resource nobody could read counts as unobserved, never as absent, so a hole can never be painted as "gone".

Present for every component with live evidence, including the identity join where it is a rollup of one, so a consumer never branches on whether a live-name mapping was configured. stack is untouched and stays the richer enrichment where a substrate has one.

Tests

9496 across core and every lexicon, green. New cases pin the two that matter: a component with no deploy object still reports a paintable rollup, and a rollup and a stack coexist without either displacing the other. The existing exact-match evidence assertions gained the counts, which is the contract change made visible.

Next

behold#98's body needs the chant dependency named — it reads as behold-only work today. That edit follows once this lands, along with behold consuming resources in component-status.ts instead of branching on stack.

🤖 Generated with Claude Code

https://claude.ai/code/session_015RL2jfiURpWMntm9VFmeHk

…#98)

`ComponentStatusRow` could say a component was live, and — on AWS only — carry
the CloudFormation stack behind it. Everywhere else there is no deploy object
to read: floci-az and floci-gcp have no stack, so a consumer painting component
status off `stack` has nothing to paint from, which is what behold#98 is about.

The counts were already being computed and thrown away. `mergeEvidence`
collapses several entities' verdicts into one component answer; it now also
reports the shape it collapsed — total, present, absent, unobserved — and the
row carries it as `resources`. Substrate-neutral by construction, because it
aggregates observations rather than a provider grouping object, and it keeps
#1089's distinction: a resource nobody could read counts as a hole, never as an
absence.

Present for every component with evidence, including the identity join, where
it is a rollup of one. A consumer should not have to branch on whether a
live-name mapping happened to be configured.

`stack` stays exactly as it was — the richer, provider-native enrichment where
a substrate has one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RL2jfiURpWMntm9VFmeHk
@lex00
lex00 merged commit 5b110d0 into main Aug 2, 2026
5 checks passed
@lex00
lex00 deleted the feature/behold98-resource-rollup branch August 2, 2026 02:59
lex00 added a commit that referenced this pull request Aug 2, 2026
…t paints it (behold#100) (#1308)

* docs(floci-gaps): entry 4's fix is pushed to the fork

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

* fix(status): let a component's resource rollup reach the consumer that 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

* docs(fold-coverage): regenerate for the new canonical example

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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