Skip to content

Strategy: spec solution-shared context git remote #99

Description

@pewpewpotato

Problem

We need a signed strategic/architecture spec for solution-scoped shared context: N code repos → one context git remote, without a second VCS.

Who it’s for

Agents (MCP), humans reviewing context on GitHub, multi-repo solution teams.

Normative baseline (signed + amended 2026-09-19)

# Constraint
G1 Overlapping agent edits → human-reviewed PR; no silent overwrite
G2 Every agent write → short-lived branch + PR (amended — not push-to-working-branch)
G3 Migration = best-effort one-shot .spl → context git; no dual-run; no Rack wire-compat
G4 Assets: Git LFS above 512 KiB default (configurable); text/JSON/TOML stay plain git with warn above ~1 MiB
L1 Binding: explicit bind file in each code repo → shared context remote; MCP refuses writes until bound; no auto-discovery
L2 Onboarding: spl context init --remote <url> creates layout/schema, seeds CodeRepository from binds
L3 Projection: rebuild from git on every MCP/process start; local only; never committed
L4 Identity: node IDs namespaced by code repo; files stay flat under nodes/ / edges/
L5 Auth: stock git credentials only
L6 Export keep/drop: keep nodes, edges, schema, assets; drop packs, Rack remotes, reflogs, merge leases, projections; lossy OK

Architecture (normative)

Direction

Git is the sole durable SoT for solution context. Spool is the MCP/CLI tool that validates mutations, writes human-diffable files, commits via stock git, and rebuilds a local projection for fast query. Rack and .spl-as-SoT are out of the happy path.

Solution model

  • One context git remote per solution; N code repos bind to it
  • Graph is solution-flat (cross-repo edges first-class)
  • Provenance via repo-namespaced IDs + CodeRepository nodes — not path-siloed trees

Binding

Explicit file in each code repo, e.g. .spool/context.toml:

solution_id = "my-solution"
remote = "https://github.com/org/my-solution-context.git"
protected_branch = "main"

Unbound → mutations fail closed. No auto-discovery.

Context repo layout

/
  schema.toml
  nodes/<id>.json
  edges/<id>.json
  assets/<hash>[/name]
  README.md

Not in repo: projection DBs, .spl packs, Rack config, reflogs, merge leases.

Write plane

  1. Validate mutation batch
  2. Apply as JSON/assets
  3. Short-lived branch → commit (one batch = one commit) → open PR to protected branch
  4. Overlaps → humans resolve via PR

Projection

Rebuild from current git checkout on every MCP/process start. Local cache only — never committed/pushed/remoted. Git wins on correctness.

Onboarding

spl context init --remote <url>: ensure remote reachable, create layout/schema if empty, seed CodeRepository from binds, ready for first MCP write (branch+PR).

Assets

Default LFS 512 KiB (configurable). Text/JSON/TOML plain git; warn ~>1 MiB.

Migration (one-shot)

Keep nodes/edges/schema/assets; drop packs/Rack remotes/reflogs/merge leases/projections. Named export/migrate-once (not sync). Lossy OK.

Non-goals

Spool-as-VCS; Rack wire-compat; per-code-repo context remotes; path-siloed graphs; syncing projections; Spool-specific auth/protocol; replacing git for source code.

Acceptance criteria

  • Spec documents one context remote per solution and explicit bind (no auto-discovery; refuse unbound writes)
  • Spec defines layout (nodes/, edges/, schema/, assets/) and repo-namespaced IDs with flat files
  • Spec states projection rebuild-on-process-start (local only, never SoT)
  • Spec records gates G1–G4 as amended (esp. every write = branch+PR)
  • Explicit non-goals listed above

Downstream

Issue Uses this
#100 MCP write path, PR-every-write, projection rebuild-on-start
#104 Bind file + retire .spl/Rack SoT
#102 Export keep/drop
#103 LFS defaults
#101 Docs/stop-list messaging

Owner

Spool Architect

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions