Skip to content

docs(e2): F2.1 source-abstract fleet model + connector/source-adapter contract (#38)#41

Merged
gnanirahulnutakki merged 1 commit into
devfrom
docs/f2.1-source-adapter-contract
Jul 10, 2026
Merged

docs(e2): F2.1 source-abstract fleet model + connector/source-adapter contract (#38)#41
gnanirahulnutakki merged 1 commit into
devfrom
docs/f2.1-source-adapter-contract

Conversation

@gnanirahulnutakki

Copy link
Copy Markdown
Member

What

Design spec for F2.1 (#38) under epic E2 read federation (#20): the source-abstract fleet model and the connector / source-adapter contract — the seam every integration plugs into.

Adds one file: docs/specs/F2.1-source-adapter-contract.md. Spec/design only — no product Go. A builder session implements Slice 1 from it.

The interface design (summary)

7-verb contract → idiomatic Go, split by capability (not one fat interface):

Verb group Interface Who implements
discover · read · query Reader every source (day-0 read path)
diff Differ drift/GitOps sources
plan · execute · verify Planner / Executor / Verifier typed-action sources only (governed write path)
  • Capability enum + Registry with fail-safe registration: a connector must declare a capability and implement its interface — declared-but-unimplemented is a registration error; a read adapter can never be obtained as an Executor. One canonical connector per tool; closed three-kind taxonomy (read-adapter / brokered-read-through / typed-action, from E12).
  • Normalized source-abstract model in internal/fleet: ResourceRef, Evidence/Provenance, Fact, Query/Selector, extended Coverage (+Stale/Complete()), and the operational-graph shape (typed Relation edges) that makes cross-cluster correlation a first-class traversal.
  • execute/plan/verify map onto ADR-0004 (closed vocabulary, dry-run-first, PEP-only execution post-PDP). Never reachable from local mode.

First adapter — local-kubeconfig (Slice 1, #38 + #32): a Reader-only read adapter. Discover lists every kubeconfig context (surfacing unreachable, never fatal, exec-plugins run locally, creds never leave the machine); Query fans out across contexts concurrently with honest Coverage.

Stays additive: adding any W1–W4 connector = one new package + one Register call, zero changes above the seam. W1–W4 mapping table included.

Relationship to Slice 0 (does not redefine the foundation)

Slice-0's fleet.Source snapshot seam is kept verbatim. The connector contract sits beneath it; a one-way connector.AsSource(Reader) fleet.Source bridge (dependency direction kubeconfig → connector → fleet, no cycle) lets sith clusters consume a real connector by changing one injection line.

Notes for reviewers

  • Cross-doc links to SLICE-0-foundation.md, BUILD-SEQUENCE.md, CONVENTIONS.md resolve once the parallel Slice-0 / build-plan branch merges into dev (this spec layers on that seam PR).
  • Open decisions are recorded in §9 of the spec (Observed typing, graph-assembly ownership, reachability probe, ProtocolV granularity, local Workspace stamping, cross-source ResourceRef identity) — none block Slice 1.
  • Do not merge — opened into dev for review per the branch model.

Refs #38, #20

Design the seam every integration plugs into: the 7-verb connector
contract (discover/read/query/diff/plan/execute/verify) as idiomatic
Go, translated from the incident-derived corpus dataclasses.

- Capability-scoped interfaces (Reader/Differ/Planner/Executor/Verifier)
  so read-only sources implement only what they can do and the compiler
  proves what a connector supports.
- Capability enum + Registry with fail-safe registration (a declared
  capability must implement its interface) and capability-based lookup;
  one canonical connector per tool, closed three-kind taxonomy (E12).
- Normalized source-abstract model: ResourceRef, Evidence/Provenance,
  Fact, Query/Selector, Coverage, and the operational-graph shape
  (typed relations) that makes cross-cluster correlation first-class.
- First adapter: local-kubeconfig as a Reader-only read adapter
  (discover/read/query) — list contexts, fan out across contexts,
  surface unreachable, credentials never leave the machine.
- AsSource bridge keeps Slice-0's fleet.Source seam intact (no
  redefinition); Slice 1 swaps one injection line.
- W1-W4 additivity table: adding a connector is one package + one
  Register call, zero changes above the seam.

Spec-only; a builder implements Slice 1 (#38 + #32). Open decisions
recorded in the doc, not blocking.

Refs: #38, #20
Signed-off-by: Gnani Rahul <89947795+gnanirahulnutakki@users.noreply.github.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