Repository navigation
Description
Summary
A lexicon's observation surface is maintained beside it, in five hand-written
tables, instead of being derived from it. The AWS lexicon can synthesize 61
resource kinds and can observe between 4 and 18 of them depending on which
question you ask:
| table | kinds | answers |
|---|---|---|
reference-catalog.ts |
18 | what points at what |
dependencies.ts |
8 | what the estate relies on |
ambient.ts |
4 | what exists that nothing declared |
properties.ts |
4 | a resource's own attributes |
deep-observe.ts |
4 | property-level reads |
Nothing keeps these in step with each other or with the registry, so a kind
chant can deploy is very often a kind chant cannot answer questions about —
and there is no signal when that happens. Each table was added for a specific
need on a specific day, which is exactly how the gap gets to 61-vs-18 without
anyone deciding it should.
What this cost, concretely
"Which of my security groups are unused" is, in AWS's own terms, a question
about network interfaces: a group is in use exactly when an ENI attaches it.
Nobody writes an ENI — EC2 creates one per instance — so it appeared in no
observation path at all. Declared: no. Referenced: no, an instance does not name
its interface. Ambient: no, because the ambient scan is bounded by the kinds the
project declares, and no project declares an ENI.
An agent asked that question queried kind:EC2::NetworkInterface, got nothing,
and rebuilt the attachment map from 29 raw provider calls — over half the
account reads in that benchmark run. The tool had deployed the estate and could
not answer a question about it.
Fixed for ENIs in 2273695 by widening the ambient bound with an IMPLIED map.
That map has exactly one entry, which is the point of this issue: the same shape
is everywhere. EBS volumes for instances. ENIs for load balancers and RDS. Log
groups for Lambda. Target-group attachments. Every one is a resource you are
accountable for, that you never wrote, and that chant currently cannot see.
Proposal
One registry per lexicon, three policies over it, enforced by the generator.
1. Observation metadata joins the registry
The registry is already generated from the provider spec and already knows all
61 kinds. Each entry gains what is needed to read the kind back:
{
kind: "AWS::EC2::NetworkInterface",
list: { argv: ["ec2", "describe-network-interfaces"], key: "NetworkInterfaces" },
id: "NetworkInterfaceId",
references: [
{ path: "Groups[].GroupId", target: "AWS::EC2::SecurityGroup" },
{ path: "Attachment.InstanceId", target: "AWS::EC2::Instance" },
],
impliedBy: ["AWS::EC2::Instance"],
}ambientKinds(), canDescribe(), referenceCatalog and the dependency reader
all become views over this instead of five lists that drift.
2. Three recording policies
- declared — what the project wrote. Always recorded.
- implied — vendor-created children of declared resources (
impliedBy).
Should default on: EC2 creates an ENI whether or not you asked, and
questions about your estate are questions about it. - ambient — anything else in the account. Opt-in behind
--ambient,
because that is a scan of resources that are not yours.
This is the bound the ENI fix widened by implication rather than abandoning, and
it generalises: still nothing about the account at large unless asked.
3. The contract enforces it
LexiconPlugin.coverage({ minOverall }) already exists and is already a
threshold the build can fail on. Today it measures one axis — how much of the
provider spec the lexicon can synthesize. It should measure two:
coverage: synthesis 61/61 (100%) observation 18/61 (30%)
A lexicon that claims a kind it cannot read back is incomplete, and the
generator is the place that knows. Options, in increasing strictness:
- Report both axes; no gate. Makes the gap visible, which today it is not.
minObservationthreshold alongsideminOverall.- A kind cannot be published without at least an
idand alist.
Suggest starting at (1) and (2) — (3) is a large migration and the number should
be watched before it is enforced.
Why the generator specifically
Because the alternative is what we have. Five tables maintained by hand, each
correct on the day it was written, none of them checked against the 61 kinds the
lexicon already declares. The generator is the only component that sees the
whole spec, so it is the only one that can say "you deploy this and cannot read
it back" — and a lexicon contract that can state the capability is a contract
that can require it.
Scope
- Observation metadata in the generated registry (
list,id,
references,impliedBy) -
ambient.ts/properties.ts/dependencies.ts/reference-catalog.ts
become views over it -
impliedByrecording, defaulting on -
coverage()reports the observation axis -
minObservationthreshold - Backfill the implied set for the common AWS cases (EBS volumes, ELB/RDS
interfaces, Lambda log groups, target-group attachments)
Refs #1278, #1279. Follows 2273695 (ENIs), which is the one-entry version of
this.
Boundary with the other read-path epics (2026-08-01): this epic owns
breadth — which kinds are legible at all. #1014 owns depth — how much of one
resource is legible and how the noise comes off. #1202 owns the interface they
meet at. The division is stated once, in #1014. The live instance of the overlap
is #1269: the AWS deep reader works and can only be pointed at four kinds, which
blocks D·aws (#1207) in the CC lane.
Goal: eliminate hand-maintained anything
The proposal above still leaves per-kind observation metadata written by hand —
it just moves it into one file instead of five. That is an improvement and not
the goal. The goal is that no human writes per-kind observation metadata at
all, the same way no human writes the 61 synthesis entries today.
The machine-readable sources exist:
CloudFormation resource provider schemas already declare what observation
needs, per kind:
primaryIdentifier— the id field, which is whatproperties.tsand
ambient.tshand-write asid:handlers.read/handlers.list— whether the kind can be read back at all,
and with what permissions. A kind with nolisthandler is a kind that
honestly cannot be enumerated, and saying so is better than omitting it
silently.readOnlyProperties— what only exists after deploy, which is exactly the
setdescribeOwnPropertiesgoes and fetches.relationshipRef— reference targets, where present. Sparse today, so
references likely stay partly derived from the spec's property types (a
property whose type is aRefto another resource type is an edge), with
hand-written rules as the shrinking remainder rather than the default.
Cloud Control API reads any kind with a registered schema through one
generic call — no per-kind argv at all. deep-observe.ts already uses it. Where
Cloud Control is available, the list/argv table disappears entirely rather
than being generated; the per-service describe-* path becomes the fallback for
kinds and endpoints Cloud Control does not cover.
impliedBy is the one axis with no obvious machine-readable source — the
CFN schemas do not say "creating an instance creates a network interface". It
may be derivable from readOnlyProperties that carry another kind's identifier
(an instance's NetworkInterfaces[].NetworkInterfaceId implies ENIs exist), and
that is worth trying before accepting a hand-written map. If a hand-written
remainder survives anywhere, this is the likeliest place — and it should be
small, explicit, and covered by the coverage number so it stays visible.
What this changes about the plan
The registry entry stops being a thing anyone authors and becomes a thing the
generator emits, exactly like the synthesis entries. The coverage gate then
measures something real: not "did someone remember to add this kind to five
tables" but "does the provider publish enough about this kind for us to read it
back, and are we using what it publishes".
Any table that survives should have to justify why it is not derivable.
Activity
feat(observe): record which resources the provider created
lex00 commentedon Aug 24, 2026
Closing: the observation-surface-from-the-lexicon arc is complete — the contract work landed across the closed children, and #1269 (the last one: deep reader coverage for the EC2 topology types the folds need) merged in #1869.
feat(search): negate a term, and make a miss teach (INTENTIUS#1280, I…
feat(search): "nothing points at this" is a query, not a mistake