{
  "schema_version": "0.1",
  "brainstorm_id": "BR-2026-07-15-substrate-capability-parity",
  "title": "Synchronize PRD Plugin with the shipped AI-Collab Substrate",
  "created_at": "2026-07-15",
  "author_agent": "AGENT-CODEX",
  "source_session": "WFR-022",
  "status": "approved",
  "context": "REQ-099 asks for a complete source-backed comparison of the shipped AI-Collab Substrate against PRD Plugin 0.15.5 and an implementation-ready synchronization plan. AUD-SUBSTRATE-PARITY-2026-07-15 found 24 capability groups, no fully aligned end-to-end integration, four high gaps, and an absent runtime command despite adapter claims.",
  "goals": [
    {"id": "BR-REQ-015", "summary": "Maintain a versioned inventory of every shipped Substrate capability and its PRD integration classification."},
    {"id": "BR-REQ-016", "summary": "Provide one executable AI-Collab bridge for discovery, read operations, bounded execution requests, result validation and deterministic resume."},
    {"id": "BR-REQ-017", "summary": "Negotiate runtime version, identity, workspace/repository scope, capabilities and availability before any Substrate-dependent workflow step."},
    {"id": "BR-REQ-018", "summary": "Map relevant Substrate capabilities into deterministic PRD workflow actions with explicit configuration, timeouts and fallbacks."},
    {"id": "BR-REQ-019", "summary": "Use the shipped Knowledge Hub for federated LLM-wiki search, freshness and optional HTML browsing while retaining Markdown as canonical repo truth."},
    {"id": "BR-REQ-020", "summary": "Use Substrate memory, code/docs recall, context packs and skillbooks before raw repository re-derivation when the capability is active."},
    {"id": "BR-REQ-021", "summary": "Bind PRD goals, tracking branches and evidence to Substrate goals, work capsules and worker execution without creating a second project-truth authority."},
    {"id": "BR-REQ-022", "summary": "Complete impact-scoped verification with runtime impact, structural, test mapping and fingerprint-bound execution results."},
    {"id": "BR-REQ-023", "summary": "Use App Server visual evidence and specialist Research/Autoheal/Improve cases only from matching workflows and consent scopes."},
    {"id": "BR-REQ-024", "summary": "Use runtime diagnostics, freshness and tool/model telemetry to expose latency and health without silently changing user configuration."},
    {"id": "BR-REQ-025", "summary": "Ship synchronized config, tools, hooks, skills, workflow definitions, installer migration, downstream templates, tests, documentation and release enforcement."},
    {"id": "BR-REQ-026", "summary": "Give every PRD-enabled repository a versioned services JSON declaring the services and capabilities it consumes and provides, their required/optional intent, contract versions, visibility, and fallbacks."}
  ],
  "non_goals": [
    "Reimplement AI-Collab indexing, memory, routing, App Server, Tool Hub, model serving or goal engines inside PRD Plugin.",
    "Make every Substrate capability mandatory or enabled by default.",
    "Allow Substrate or an LLM to write canonical PRD JSON directly.",
    "Copy all runtime conversations, telemetry or workspace exports into repository truth.",
    "Treat administrative, destructive, deployment or cross-repository actions as implicitly authorized."
  ],
  "decisions": [
    {"id": "BR-DEC-011", "summary": "PRD owns policy, canonical records, IDs and validation; AI-Collab owns runtime execution, indexing, routing, models and hosted applications."},
    {"id": "BR-DEC-012", "summary": "Extend the existing adapter into a bidirectional request/result bridge instead of creating another server, index or transport."},
    {"id": "BR-DEC-013", "summary": "Use a versioned capability catalog with required, optional and discover-only classifications so every shipped feature is considered without forcing irrelevant integrations."},
    {"id": "BR-DEC-014", "summary": "Use Tool Hub/Conduit as the runtime call surface and keep PRD workflow actions allowlisted and declarative."},
    {"id": "BR-DEC-015", "summary": "Keep wiki Markdown canonical; Substrate indexing and HTML are derived browsing/retrieval views."},
    {"id": "BR-DEC-016", "summary": "Bind cross-system objects with stable repo-qualified IDs and idempotency keys; never synchronize through uncontrolled bidirectional file mutation."},
    {"id": "BR-DEC-017", "summary": "Default to safe local fallback when optional runtime capabilities are unavailable; fail closed only when the selected policy explicitly requires the runtime result."},
    {"id": "BR-DEC-018", "summary": "Store repository service declarations in canonical .prd_plugin/services.json, preserve user-owned entries during updates, and advertise the validated manifest through the Substrate handshake."}
  ],
  "open_questions": [],
  "risks": [
    {"id": "BR-RISK-013", "summary": "Cross-repository knowledge or state leaks outside workspace authorization.", "mitigation": "Use the Substrate authorization resolver and fail-closed repo/workspace bindings in every request."},
    {"id": "BR-RISK-014", "summary": "PRD and Substrate become competing sources of truth.", "mitigation": "One-way canonical projection, linked runtime receipts, and PRD MCP-only canonical mutation."},
    {"id": "BR-RISK-015", "summary": "Retries duplicate work capsules, goals, messages or model execution.", "mitigation": "Stable idempotency keys, request hashes, outcome reconciliation and no speculative replay."},
    {"id": "BR-RISK-016", "summary": "Runtime outages block local repository work.", "mitigation": "Per-capability fallback policy and local deterministic paths for all non-required integrations."},
    {"id": "BR-RISK-017", "summary": "Substrate ships new tools and PRD silently drifts again.", "mitigation": "Machine-readable capability parity manifest and release audit against the discovered runtime catalog."},
    {"id": "BR-RISK-018", "summary": "Always-on recall, telemetry or model calls increase latency and token cost.", "mitigation": "Intent-based activation, bounded results, caching, profiles and measured telemetry."},
    {"id": "BR-RISK-019", "summary": "Runtime agents bypass explicit-user subagent consent or PRD tracking-branch rules.", "mitigation": "Consent capability in the request contract and server-enforced worker environment/branch constraints."},
    {"id": "BR-RISK-020", "summary": "A broad synchronization release is hard to verify and roll back.", "mitigation": "Six independently gateable phases with feature toggles, contract tests and compatibility fixtures."},
    {"id": "BR-RISK-021", "summary": "Repository service declarations become stale, ambiguous, or overwritten by plugin updates.", "mitigation": "Typed CRUD, schema and semantic audit, capability/contract validation, additive installer migration, ownership metadata, and drift checks against effective runtime use."}
  ],
  "candidate_tracking_updates": ["REQ-099", "REQ-100", "TRK-111", "TRK-112"],
  "candidate_health_findings": ["PAR-H-001", "PAR-H-002", "PAR-H-003", "PAR-H-004"],
  "source_audit": "docs/audits/substrate-capability-parity-2026-07-15.json",
  "next_recommended_artifact": "PRD-009"
}
