Session Git — Concurrent Lanes (Spec & Rollout Plan)

Normative model for multiple sessions sharing branches; supersedes rigid one-session-one-branch wording in SAGP v1.2 §2 where it conflicts.

Session Git — Concurrent Lanes

1. Purpose

Align written process, tooling, and day-to-day practice. SAGP v1.2 still reads as one session → one branch (session-{N}). In production, teams routinely run 2–4 concurrent sessions on the same branch (often a range name such as session-264-269_new). That is valid; the doc and some checks were wrong, not the workflow.

This document is the authoritative spec for branch/session semantics. SAGP v1.3 (sessions-git-protocol.mdc) incorporates these rules by reference.


2. Problem statement

Issue Impact
INIT steps say “expected branch = session-{N}” False failures in MCP preflight / agent confusion
“One branch per session” Contradicts shared long-lived range branches
“Never commit to another session’s branch” Misread as “one session per branch” instead of “don’t land unrelated work without attribution”

What was always correct: [S{N}.{sub}] commit tags, explicit git add <files>, stash naming, and not working directly on main.


3. Target model (normative)

3.1 Definitions

3.2 Rules (replace rigid §2 branch rules)

  1. Many sessions MAY share one branch. Prefer one stable lane over spawning redundant session-{N} branches when work is tightly coupled or concurrent.
  2. Branch name = coarse scope, not ownership. It answers: “Which line of history / integration bucket?” not “who owns every commit.”
  3. Commit message = fine-grained ownership. Every commit MUST remain tagged with [S{N}.{sub}] for the session that owns that change.
  4. Preflight / MCP “synced” means: current branch plausibly relates to the enforced session (e.g. range token includes N; optional cross-check against that session’s manifest gitBranch if present). It does not mean HEAD must equal only session-{N}.
  5. Do not mix unrelated work without tagging. If you touch files for session B while on a lane also used for session A, split commits or clear [S{B}.{sub}] on those commits — same as today; the rule is attribution, not branch exclusivity.
  6. main — unchanged: no direct commits; merge via PR or controlled merge policy.

3.2a Boundary: what changes vs what does not

Stays the same Changes only here
sessions/manifests/S{N}.json — one file per session, session-scoped data only (schema, fields, progress as today) How Git is used: shared lanes, range branches, MCP branch policy, INIT wording
Sub-session records may still include gitBranch as today (audit of which lane that sub-session used) Conflict avoidance = attribution ([S{N}.{sub}]), explicit git add, not “one branch per session”

No new manifest fields are required for concurrent lanes. No aggregating multiple sessions into one manifest.

3.3 Naming conventions (flexible, not exhaustive)

Pattern Use when
session-{N} Single-session lane or legacy; still allowed
session-{A}-{B} / session-{A}-{B}_{suffix} Range / multi-session lane (common case: shared integration line for several sessions)

Dropped from this spec: integrate/{N}-{M} disposable branches. Range lanes already act as the integration line for concurrent work; merging to main is the remaining integration step (PR / policy). If someone ever needs a throwaway pre-main combine, they can use any local branch name—no separate convention required.

Non-goals: Mandating a single global pattern for all repos; teams may keep local variants if attribution rules hold.

3.4 Manifests (sessions/manifests/S{N}.json)

3.5 PRs and merges to main (resolved)

Decision: Yes — merge-related metadata must preserve session traceability.

  1. PR title — Include at least one [S{N}.{sub}] tag (typically the primary session driving the PR). If several sessions share the lane with similar weight, use one tag in the title and list the rest in the description (e.g. “Also: [S268.2][S267.1]”).
  2. Merge commit message (merge commits, or squash subject/body) — Include [S{N}.{sub}] for every session that contributed material commits in that PR, or a single line such as Sessions: S269.3, S268.2, S267.1 so git log remains grep-friendly.
  3. Squash-merge — Default squash subject should carry the lead session tag; squash body should list other [S*] tags copied from commits if multiple sessions are in the branch.

This keeps main history searchable by session tag without changing manifest layout.

3.6 Release notes / changelog (resolved)

Approach: Prefer automation from Git, not new manifest fields.

  1. Technical “what merged” — git log on main with session tags ([S\d+(?:\.\d+)?\]) is the canonical list; scripts can group by session number.
  2. User-facing changelog — Generate draft bullets from tagged merge/PR lines, then edit for readability; optional deep links to docs/english/sessions/... or manifest titles read as reference (manifests stay per-session; they are not merged into a mega-file).
  3. No requirement to mirror every commit in manifests; manifests remain session journals, not release registers.

4. Tooling expectations

Layer Behavior
Git Source of truth for objects; branch is a pointer; tags in messages are authoritative for session attribution.
MCP preflight Default multi-session branch policy (range-aware); MCP_GIT_BRANCH_POLICY=strict only if you want legacy session-{N}-only matching.
Git gateway / safe_commit Same matcher as preflight; still enforces [S{N}.{sub}] and explicit file lists.
CI (future) Optional: verify commit messages match regex ^\[S\d+(?:\.\d+)?\] on protected branches.

5. Non-goals


6. Rollout plan

Phase 0 — Decisions (owner: you / tech lead)

Phase 1 — Documentation (high priority)

Phase 2 — Tooling polish (optional)

Phase 3 — Agent / human training

Phase 4 — Cleanup


7. Success criteria


8. Resolved decisions (formerly open questions)

Topic Decision
PR / merge tagging Yes — see §3.5 (titles + merge/squash messages carry [S{N}.{sub}] or an explicit session list).
Release / changelog §3.6 — derive from Git (main log + tags); user-facing text is edited drafts; manifests stay per-session journals, not release databases.

9. Revision history

Version Date Notes
1.0 draft 2026-03-25 Initial spec + plan
1.1 draft 2026-03-25 Removed integrate/{N}-{M}; range lanes + merge to main replace that pattern
1.2 draft 2026-03-25 §3.2a manifest boundary; §3.5–3.6 PR/changelog; no manifest schema changes; Phase 2 retargeted
1.3 2026-03-25 active — merged into SAGP v1.3, AGENTS.md, CLAUDE.md