Repository navigation
docs(witan-infra): write the witan-infra spec and ADR 0013 - #694
blarghmatey wants to merge 3 commits into
Conversation
witan-infra (a third witan layer mapping running infrastructure) had a task plan from August but no spec, and its gating spikes had not run. They ran on 2026-11-19 against all 330 Pulumi stacks and omnigraph 0.15.0, and this writes the spec from their results, plus ADR 0013 for the one decision with real alternatives: one graph with the fixed id `infra`. The spikes changed the plan in several places: edges carry properties in 0.15, so the write path merges first and deletes second instead of leaving an empty window; collectors write per-source sightings and the reconciler projects objects from them, so two collectors cannot null each other's fields; attribution moves to the reconciler and runs over the whole graph each run; the schema uses no enums; and an unbound graph turns out to be read-open, not default-deny. The inventory of plaintext credentials the secret-handling spike found in IaC state is deliberately left out of this public repo. Claude-Session: https://claude.ai/code/session_01FGZebE22D7F3QQjRpu6AUr
There was a problem hiding this comment.
Summary
Documents the proposed witan-infra layer and its single fixed graph.
- Adds: the witan-infra design spec covering graph schema, collectors, attribution, coverage, security, and phased delivery.
- Adds: ADR 0013 choosing one
infragraph with a fixed identifier. - Changes: the documentation navigation to include the witan-infra spec and ADR 0013.
Details for reviewers
Risks
- The preferred batch key-delete query is untested; Phase 2 must use the verified run-stamped fallback if it fails.
- State access can expose plaintext credentials because the inventory found credentials outside secret wrappers.
- The spec leaves graph-read permissions,
code_impactintegration, and the MITODL service set unresolved.
Core files: docs/internals/design/witan-infra-spec.md, mcp/servers/witan/docs/adr/0013-one-infra-graph-with-a-fixed-id.md, docs/explanation/decisions/0013-one-infra-graph-with-a-fixed-id.md
Unchanged
- The design remains proposed and does not add the witan-infra implementation.
- The spec keeps three owner decisions open with recommendations.
Summary of 8ee0dbc · React 👍 or 👎 on my comments to tune what I raise · Commands · Review config
There was a problem hiding this comment.
Status: Needs Changes 🔧
Blocking Issues:
- Fence sighting writes as well as deletes so expired runs cannot overwrite newer state.
- Replace wildcard stack-output value rules with exact, validated allowlist entries.
- Use authorized reads rather than export for the impact traversal fallback.
- Spec's chunked-delete fencing is unimplementable with current change_many API
📌 Reviewed up to the latest commit · ⏱️ Review completed in 4 minutes
- 🔄 re-review this PR
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical flaws let expired runs overwrite newer sightings, conflate dependencies across environments, and cause authorized impact queries to fail when the fallback requires forbidden export access.
6 open issues
Service dependency edges conflate environments · New Expired runs can overwrite newer sightings · New Impact fallback requires an unauthorized export action · New AWS tag allowlist drops attribution tags · New Route fields are missing from collected observations · New Impact queries lack an environment filter · New
What changed in this PR
This documentation-only PR defines witan-infra as a planned third layer joining running infrastructure to witan’s code and memory layers, informed by the November gating spikes.
Changes:
- Adds the design spec covering collectors, identity, secret filtering, reconciliation, tools, authorization, and implementation phases.
- Proposes ADR 0013: one estate-wide
infragraph with a dedicated authorization bundle. - Publishes the mirrored ADR and adds navigation entries for both documents.
| File | Description |
|---|---|
zensical.toml |
Adds navigation links for the spec and ADR. |
mcp/servers/witan/docs/adr/0013-one-infra-graph-with-a-fixed-id.md |
Defines the proposed single-graph topology and its tradeoffs. |
docs/internals/design/witan-infra-spec.md |
Specifies the infrastructure layer’s design and delivery plan. |
docs/explanation/decisions/0013-one-infra-graph-with-a-fixed-id.md |
Mirrors the ADR into the documentation site. |
Review effort: Balanced
Review on #694 found holes the first draft left open. A run that loses its lease could still overwrite a newer run's sightings through an unfenced merge, so sightings now carry the lease epoch and a scope whose sightings disagree with its latest complete run is re-collected. Chunked deletes cannot be fenced with today's change_many, so Phase 2 makes it return its commit id. The allowlist dropped the tags the attribution ladder reads and every route field, and kept stack output values by key suffix; it now keeps configured tag keys and reviewed Ingress/ApisixRoute route fields, and stack output values only for reviewed (project, key) pairs. The unbounded impact walk used export, which readers are denied, so it reads instead. Observed service edges carry the environments they were seen in, infra_impact takes an environment, and the recall seed spells out the `:entity` suffix _resolve_topic needs. Claude-Session: https://claude.ai/code/session_01FGZebE22D7F3QQjRpu6AUr
…t each other The owner settled the first open decision: the code_impact deployment block is filled through a ResultEnricher protocol and entry-point group in witan_core, so neither server package depends on the other. The spec now states it as decided under the enrichment section, with the two rejected options and why. Claude-Session: https://claude.ai/code/session_01FGZebE22D7F3QQjRpu6AUr


What are the relevant tickets?
N/A (witan task tk-write-the-witan-infra-design-spec-docs-design-wi-3ef30c, project wp-witan-infra-digital-twin-of-running-infrastructu-544088)
Description (What does it do?)
witan-infra, a planned third witan layer that maps running infrastructure (IaC state, Kubernetes, trace topology, cloud inventory) and joins it to the code and memory layers, had an August task plan but no spec, and its gating spikes had not run. They ran on 2026-11-19 against all 330 Pulumi stacks and omnigraph 0.15.0. This adds the spec written from their results and ADR 0013, which keeps the whole estate in one graph with the fixed id
infra.Where the spikes changed the August plan:
Sightingrows and the reconciler projects objects from them, so two collectors describing one object cannot null each other's fields.infraalways gets its own bundle.Two decisions are left open in the spec, each with a recommendation: who may read the
infragraph, and the MITODL service set. A third is settled: witan-code and witan-infra never import each other, and thecode_impactdeployment block is filled through an entry-point enricher inwitan_core.Implementation details
The spec lives with the other specs in
docs/internals/design/(the task title still saysdocs/design/). The ADR is inmcp/servers/witan/docs/adr/and mirrored intodocs/explanation/decisions/byjust docs-gen; both are added to thezensical.tomlnav. The merge-then-reap write was checked on a local omnigraph 0.15.0 store and is recorded as witan memorypat-merge-then-reap-replace-a-graph-slice-on-omnigra-29430c. The key-based delete the reconciler prefers (delete … where <key> in $keyswith a list parameter) is untested at batch size; the spec makes that Phase 2's first test, with the run-stamped form as the verified fallback.The secret-handling spike also inventoried plaintext credentials sitting in IaC state outside any secret wrapper. That inventory is deliberately not in this public repo.
How can this be tested?
Docs only.
just docs-checkandjust docs-buildpass, and markdownlint passes on both files. An independent reviewer checked the spec's numbers and code anchors against the spike findings and the code atorigin/main, then re-checked the rewritten write path; the second pass's findings (miss counting on skipped stacks, the scope of the diff delete, leftover bookkeeping fields, fencing the deletes on the lease) were fixed after it and have not been re-reviewed. Reviewers: the write path (section 10) and the open decisions (section 16) are where judgement is needed.https://claude.ai/code/session_01FGZebE22D7F3QQjRpu6AUr