Skip to content

Slice 1: topology.json v0 schema types (#7) - #14

Merged
nkcoder merged 1 commit into
mainfrom
slice-1/schema
Jul 12, 2026
Merged

Slice 1: topology.json v0 schema types (#7)#14
nkcoder merged 1 commit into
mainfrom
slice-1/schema

Conversation

@nkcoder

@nkcoder nkcoder commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Closes #7. The topology.json v0 schema — the contract between scan and render/explain/diff — designed from the real testenv dump.

Decisions (see internal/topology/doc.go)

  • ENI ownership: raw signals, classify later. Store attachment (instanceId/instanceOwnerId/requesterId/requesterManaged) + interfaceType + description; classifying an ENI to its logical resource (instance/ALB/RDS/endpoint) is a heuristic, so it lives in the aggregation layer, not the snapshot.
  • Routes normalized to {destination{kind,value}, target{kind,id}, state} — deterministic union; unmapped targets → TargetUnknown (flagged honestly, not dropped).
  • SG rules flattened to atomic {direction, protocol, fromPort, toPort, peer{kind,value}} — the rung-1 engine`s evaluation unit.
  • Envelope: arrays + schemaVersion; tags as map[string]string; IPv6 stored not reasoned; vpcEndpoints included.

Follow-ups (not this PR)

Verified

  • go build, go vet, golangci-lint all clean.

Curated-generous snapshot model designed from real scanned data:
- ENI stores raw ownership signals (attachment/description/interfaceType);
  logical-resource classification deferred to the aggregation layer
- Routes normalized to {destination, target, state}; unknown targets preserved
- SG rules flattened to atomic {direction, protocol, ports, peer}
- Arrays + schemaVersion envelope; tags as maps; vpcEndpoints included

Closes #7
@nkcoder
nkcoder merged commit aeabfd1 into main Jul 12, 2026
1 check passed
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.

Design topology.json v0 schema (curated-generous, versioned)

1 participant