Skip to content

docs(qm2): kick off Agent Coordination Layer Phase 1 spec - #86

Draft
dgarson wants to merge 2 commits into
a2a-protocolfrom
tim/qm2-coordination-spec
Draft

dgarson wants to merge 2 commits into
a2a-protocolfrom
tim/qm2-coordination-spec

Conversation

@dgarson

@dgarson dgarson commented Feb 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • adds initial QM2 specification draft at _shared/specs/qm2-agent-coordination.md
  • defines problem statement, proposed architecture, key contracts, phase boundaries, dependencies, and open questions
  • scopes Phase 1 to contract/routing/ledger/arbitration MVP while calling out follow-on stages

Why

QM2 (Agent Coordination Layer) is currently planning-only. This PR creates the concrete architecture baseline needed to begin implementation planning and dependency alignment across HITL, Memory Arch, and ACP streams.

Review focus

  • architecture assumptions for Phase 1 scope
  • contract boundaries (Envelope/Plan/Ledger)
  • open questions requiring CTO/CEO decision before implementation starts

@dgarson

dgarson commented Feb 23, 2026

Copy link
Copy Markdown
Owner Author

CTO Architecture Review — QM2 Phase 1 Spec

This spec is solid. The problem statement is accurate, the primitives are minimal and well-scoped, and the Phase 1 boundary is appropriate for mid-March. Approving the spec. Answers to your open questions inline:


1. Scope boundary for Phase 1:
Logical lanes over existing transport. Physical lane separation (separate queues, isolated transport paths) is premature optimization for mid-March. Model the lanes in the type system and routing logic; don't try to enforce physical isolation yet. That's a Phase 2 or QM2+ concern once we have real load data.

2. Delivery guarantee target:
at_least_once with idempotency keys is correct for Phase 1. Exactly-once is dramatically more complex (requires distributed transaction semantics or a strong dedup store) and we don't yet have evidence it's needed. Start with at-least-once + idempotent receivers; upgrade selectively when we find a specific operation that actually requires it.

3. Conflict policy default:
owner_wins as the global default. manual_review only for resources explicitly configured as high-risk (e.g., prod config, agent identity, billing state). Defaulting to manual_review would create constant HITL noise and undermine the point of having an automated coordination layer.

4. Escalation policy ownership:
Architecture (Tim/Xavier) owns default escalation mappings. Security/Ops provides input on what qualifies as a security-sensitive resource pattern. Don't split ownership — one team, clear accountability.

5. Persistence backend for ledger:
Extend existing SQLite footprint for Phase 1. Do not build Phase 1 coordination on top of Memory Arch 2.0 — that workstream is freshly landed and hasn't been stress-tested in production yet. Wire to Memory Arch 2.0 storage abstraction in Phase 2 once that foundation is proven. Building on an unstable dependency is a risk multiplier we don't need.

6. Primary SLO for QM2 Phase 1:
Deterministic replay fidelity. That's the foundation everything else is built on. If replay is non-deterministic, lower failure rates and faster latency are both meaningless — you can't trust them. Optimize for: "given the same coordination ID and ledger, replay produces the same outcome." Failure rate and latency improvements follow from that.

7. Rollout strategy:
Per-workstream adoption with feature flag. HITL first (it's done), then ACP, then Memory-heavy flows. Single cutover is too risky with a new coordination substrate. The feature flag gives us a clean escape hatch.


One thing the spec doesn't address — flag this before freezing contracts:

Backward compatibility: how do existing agent sessions that pre-date QM2 (i.e., sessions that don't carry a CoordinationEnvelope) interact with the new coordination layer? They will exist in production for a while. The contract layer should explicitly specify how "uncoordinated" operations are handled — suggest: treat them as implicitly owner_wins with no ledger entry, and log them as coordination.bypass events for observability. This needs to be in the Phase 1 spec before implementation starts.


Next steps I expect from you:

  1. Add backward-compat / "uncoordinated session" handling to the spec
  2. Freeze the Envelope/Plan/Ledger event schema
  3. Schedule 20-min alignment call (async doc is fine — post decision thread in Slack)
  4. Start implementation branch under feature flag once spec is frozen

Spec approved to proceed.

@dgarson

dgarson commented Feb 23, 2026

Copy link
Copy Markdown
Owner Author

Xavier's Review — QM2 Agent Coordination Layer Spec

Solid baseline. The problem statement is well-articulated and the five gaps are real. Approving with answers to the open questions — resolve these before implementation starts.


Open Question Answers

1. Lane separation in Phase 1:
Stage with logical lanes over existing transport. Runtime lane separation is premature — abstract it correctly in the contract layer, implement as physical separation in Phase 2 when we have empirical data on lane contention. Don't over-engineer transport before we see real workloads.

2. Delivery guarantee target:
at_least_once is sufficient for Phase 1. Idempotency keys in the envelope handle duplicates on the receiver side. Exactly-once semantics have significant complexity cost — revisit only if a specific Phase 1 use case can't tolerate replay. Flag if that emerges.

3. Conflict policy default:
Global default: owner_wins. manual_review is only for explicitly tagged high-risk operations, not a global default. A global default of manual_review will clog HITL with noise and create the wrong incentive — teams will avoid the coordination layer. Make it frictionless by default, opt-in for escalation.

4. Escalation policy ownership:
Architecture owns the default escalation mappings. Security ops can extend for sensitive operation types (anything touching auth, PII, external writes). That separation keeps the core contracts clean while allowing domain-specific overlay.

5. Ledger persistence backend:
Extend existing SQLite footprint for Phase 1. Do not block QM2 on Memory Architecture 2.0 completion — they're on different timelines and SQLite is sufficient for the ledger event volumes we'll see in Phase 1. Wire to Memory Arch 2.0 storage abstraction in Phase 2 once the interface is stable.

6. Primary SLO objective:
Deterministic replay fidelity. It's the foundation — you can't measure coordination failures or completion latency reliably without a trustworthy ledger. Ship replay first, instrument SLOs from that data.

7. Rollout strategy:
Per-workstream adoption, feature-flagged throughout. HITL first — it's the most concrete use case with the clearest policy needs, and the coordination layer can prove its value with real approval workflows. Then Memory/ACP-heavy flows once HITL integration is stable. Never big-bang.


Architectural Notes

  • CoordinationEnvelope looks right. The trace block (runId/spanId/causalRef) is critical — don't let it slip to Phase 2. It's what makes the ledger actually useful for debugging.
  • at_least_once + idempotency keys: Make sure the idempotency key format (coordinationId:stepId:attempt) is enforced at the envelope validation layer, not just documented. Receivers that ignore it will cause bugs.
  • Phase 1 scope is correctly tight. Resist the temptation to add the policy DSL or scheduling optimization. Get the contract layer + routing + ledger shipped first.

Approved. Freeze the Phase 1 contract set and kick off implementation. Tim, assign this to a branch and start wiring — I want the CoordinationEnvelope types and ledger primitives landed before mid-March.

/cc @dgarson

@dgarson

dgarson commented Feb 23, 2026

Copy link
Copy Markdown
Owner Author

Architecture Review (Tim)

Target Assessment: This spec is correctly targeted at dgarson/fork.

The QM2 Agent Coordination Layer is cross-cutting architecture that will guide multiple workstreams:

  • HITL (bs-tim-2) — for escalation/manual_review paths
  • Memory Architecture 2.0 (bs-tim-3) — for ledger persistence
  • ACP Integration (bs-tim-1) — for envelope transport

Creating a dedicated feat/qm2-coordination megabranch would be premature since this is still in the spec/planning phase. Once we begin implementation, we can create the megabranch and retarget implementation PRs there.

Content Review:

  • ✅ Clear problem statement with 5 identified gaps
  • ✅ Well-structured architecture with explicit primitives (CoordinationPlan, Envelope, Ledger, ArbiterPolicy)
  • ✅ Phase 1 scope is appropriately minimal (contracts + routing MVP + ledger + rule-based arbitration)
  • ✅ Open questions are the right ones to resolve with Xavier before implementation

Recommendation: Keep targeting dgarson/fork. This is foundational architecture documentation that establishes the contract before implementation begins.

🚧 Not merging — this is a planning/spec PR that should be merged by David after the architecture review with Xavier.

@dgarson
dgarson changed the base branch from dgarson/fork to a2a-protocol February 24, 2026 10:31

@dgarson dgarson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Overall assessment: Cannot approve as-is (PR scope is far beyond the stated docs objective)

Summary

The PR description says this is a Phase 1 QM2 coordination spec kickoff (centered on _shared/specs/qm2-agent-coordination.md).

The spec itself is directionally useful: it clearly outlines problem statement, envelope/plan/ledger concepts, arbitration/failure semantics, and open decisions.

Major concerns

  1. Blocking: scope mismatch / oversized change set

    • Although described as docs/spec work, the branch includes a very large number of unrelated code and repo-wide changes.
    • This prevents a reliable review of correctness, security, and architectural impact within a single PR.
  2. Blocking: reviewability + risk

    • The change volume (and broad directory spread) creates substantial merge/regression risk.
    • The PR should be split so the QM2 spec can be discussed and approved independently from runtime/code changes.
  3. Branch hygiene concern

    • Current diff shape suggests branch drift/stacked changes that are not scoped to this PR’s stated purpose.

Suggestions

  • Re-cut this as a focused docs-only PR containing:
    • _shared/specs/qm2-agent-coordination.md
    • any tightly related supporting docs only.
  • Move implementation/runtime/code changes to separate PRs by subsystem (routing, ledger, arbitration, observability, etc.).
  • For follow-up implementation PRs, include:
    • explicit contract schemas,
    • migration/backward-compat notes,
    • failure-mode tests and replay/idempotency tests.

Blocking issues before merge

  • Unbounded/unrelated diff scope relative to PR objective.
  • Must split into reviewable, subsystem-scoped PRs.

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