workspace "Blackboard Governance SaaS Architecture" "Current estate, rationalized target architecture, and autoplan roadmap goal for Blackboard Governance SaaS: event truth to Proof Desk to Proof Packet v1, with Rook as the reference harness and BYO adapters as the scale path, based on the 2026-06-27 state." {
    model {
        martin = person "Martin / Product Lead" "Leads product direction, packaging, website narrative, and design-partner priorities."
        operator = person "InfraFabric Operator" "Runs Rook/Codex sessions, controlled writers, proof packet creation, and closeout."
        customerManager = person "Customer Manager / AI Platform Lead" "Reviews work evidence, scopes agent access, and decides whether to pilot or integrate the product."
        securityReviewer = person "Security / Audit Reviewer" "Checks proof packets, access logs, redaction posture, and claim boundaries."
        externalAgentDeveloper = person "External Harness Developer" "Integrates a non-Rook harness or agent platform through an adapter contract."
        aiAgent = person "Tool Agent / Subagent" "Performs bounded work inside Rook or a compatible harness and must leave recoverable evidence."

        customerSystems = softwareSystem "Customer Systems" "Ticketing, repositories, documents, logs, identity directories, provider logs, GRC/SIEM tools, and business systems that may become evidence sources." "External" {
            tags "External"
        }
        identityProvider = softwareSystem "Identity Provider / SSO" "Target OIDC/SAML and scoped service-token boundary for tenants, users, reviewers, and agents." "External" {
            tags "External, Security"
        }
        aiModelProviders = softwareSystem "AI Model Providers" "External model APIs or local model runtimes used by customer or InfraFabric harnesses. Provider logs are roadmap evidence sources, not currently assumed." "External" {
            tags "External"
        }
        reviewerBrowser = softwareSystem "Reviewer Browser / Static Proof Surface" "Public or login-gated browser surface for proof desks, proof packets, and receipt pages." "External" {
            tags "External"
        }
        martinLaptop = softwareSystem "Martin Laptop / WSL Agent Workstation" "Martin's Windows plus WSL operator machine with Codex/Claude launch wrappers, remote SSH MCP wrappers, OpenClaw/local services, and the operator link helper. Only the governed MCP/API portions are product candidates." "External" {
            tags "External, Operator Tooling"
        }
        mtl03Harness = softwareSystem "mtl-03 Remote Harness Host" "Remote operator/harness host with Hermes, Codex, Claude, switchboard MCP server, and local AI agent board listeners. Current internal estate, not yet a tenant-isolated product boundary." "External" {
            tags "External, Operator Tooling"
        }

        ifTraceProduct = softwareSystem "if.trace Receipt Surface" "Public receipt surface for hashes and signatures where present. Proves bytes and integrity, not semantic correctness." {
            tags "Current, Evidence"
            tracePage = container "Receipt Pages" "Public trace, pack, dossier, source, and hosted review pages." "Static/public pages" {
                tags "Current, Evidence"
            }
            receiptStore = container "Receipt Store" "Receipts, hashes, signatures, and published review bundle metadata." "Static/object artifacts" {
                tags "Current, Data Store, Evidence"
            }
        }

        rookHarness = softwareSystem "Rook Harness Stack" "Governed agent harness stack with Blackboard as proof/evidence plane, Rook as reference execution harness, Context as bounded continuity, Switchboard as control/wake plane, API as adapter front door, and Bus as preview transport backbone." {
            blackboardProofDesk = container "Module 1: Blackboard Proof Desk" "Reviewer and operator surface for reconstructing AI-assisted work from instruction to proof packet." "Audit UI + derived text/JSON views" {
                tags "Current, Evidence"
            }
            blackboardWriter = container "Blackboard Writer Front Door" "Controlled task/session/signal mutation path: templates, create/update, session bind, checkpoints, resume packets, evidence packs, and closeout." "if-cli + MCP via ifproxy" {
                tags "Current, Control Plane"

                taskWriter = component "Task Writer" "Creates, claims, updates, and closes tasks with acceptance, owner, result, and lineage fields." "Python CLI/MCP" {
                    tags "Current, Control Plane"
                }
                sessionBinder = component "Session Binder" "Binds stable agent_id plus rotating sid, who, status, task ids, working set, and notes." "Python CLI/MCP" {
                    tags "Current, Control Plane"
                }
                signalWriter = component "Signal Writer" "Emits blocker, debate, escalation, response, and resolution signals linked to tasks and sessions." "Python CLI" {
                    tags "Current, Control Plane"
                }
                checkpointWriter = component "Checkpoint / Resume Writer" "Writes typed checkpoints, resume packets, traps, next actions, and evidence refs for interruption-prone work." "MCP helpers" {
                    tags "Current, Evidence"
                }
                closeoutGate = component "Closeout Gate" "Requires artifact refs, verify commands, subagent/process closeout, and future-agent traps before task done." "CLI/MCP policy" {
                    tags "Current, Evidence"
                }
            }
            blackboardLedgers = container "Blackboard Append-Only Ledgers" "Task, session, and signal JSONL stores plus future tenant, principal, access-log, and proof-packet ledgers." "JSONL now; managed database target" {
                tags "Current, Data Store, Evidence"
            }
            blackboardRenderer = container "Blackboard Render / Search Pipeline" "Deterministic derived task, session, signal, and search views for reviewer and agent GET-first reads." "Renderer scripts + static publication" {
                tags "Current, Evidence"
            }
            chatRelay = container "Chat / WebSocket Relay" "Current `/chat/ws` live relay and fallback lane for presence, wake, nudge, browser/control traffic, and selected relay-side policy. Not the primary Blackboard search/write API." "Node.js WebSocket + HTTP relay" {
                tags "Current, Control Plane, API"
            }
            ifCli = container "if-cli Canonical Command Surface" "Current canonical remote-host agent command surface for module namespaces: if.rook, if.blackboard, if.context, if.switchboard, if.transport, if.gov, and if.security.secrets.detect. Help surfaces must stay current as modules are implemented." "Python CLI" {
                tags "Current, API, Control Plane"
            }
            mcpHttpBridge = container "if.transport MCP HTTP / Stdio Compatibility Engine" "Current request/response compatibility engine below if-cli/ifproxy for local and operator SSH-wrapped MCP clients. Direct use is adapter-internal or break-glass, not the product command surface." "stdio MCP + local HTTP bridge" {
                tags "Current, API"
            }
            proofPacketExporter = container "Proof Packet Exporter" "Builds external proof packets with task timeline, sessions, signals, evidence refs, receipts, confidence classes, redaction summary, and non-claims." "Planned service + current docs workflow" {
                tags "Planned, Evidence"
            }
            accessLog = container "Proof Access Log" "Records who accessed which proof surface, tenant/project scope, machine/IP metadata, timestamp, and reviewer purpose." "Planned audit log" {
                tags "Planned, Security, Evidence"
            }

            rookRuntime = container "if.rook Reference Harness" "Preview execution harness wrapping operator sessions with deterministic alias, arrival context, capability wiring, switchboard registration, five-lane workflow, and air-gap policy." "Codex/Rook scripts + arrival artifacts" {
                tags "Current, Control Plane"

                rookBootstrap = component "Rook Bootstrap" "Maps sid to alias, writes rook_session.env, registers switchboard contact, and renders arrival context." "Shell/Python" {
                    tags "Current, Control Plane"
                }
                arrivalSurfaces = component "Arrival Surfaces" "Capabilities, compliance, post-its, host guardrails, memory shadow/status, and switchboard self-test files." "Markdown/JSON artifacts" {
                    tags "Current, Evidence"
                }
                fiveLaneGate = component "Five-Lane Gate" "Claims, runtime, adversarial, ops, and reviewer lane artifacts plus arbitration and validation." "Python helper + JSON lanes" {
                    tags "Current, Evidence"
                }
                airgapPolicy = component "Air-Gap Policy" "Local-only evidence discipline, snapshot refs, and fail-closed lane behavior when zero egress is required." "Policy + scripts" {
                    tags "Current, Security"
                }
            }

            ifContext = container "if.context Continuity Layer" "Evidence-native continuity: artifacts, read plans, derived artifacts, memory lifecycle, bounded recall, and labelled untrusted context." "MCP via ifproxy + local ledgers" {
                tags "Current, Evidence"

                contextSearch = component "Bounded Search / Recall" "Shortlist-first retrieval with provenance and trust-tier fields." "MCP/local helper" {
                    tags "Current, Evidence"
                }
                readPlan = component "Read Plan / Derive Tools" "Emits read plans and derived artifacts with verification chains." "MCP tools" {
                    tags "Current, Evidence"
                }
                memoryLifecycle = component "Memory Lifecycle" "Propose, commit, tombstone, and label memory so recalled content is not hidden instruction authority." "MCP tools" {
                    tags "Current, Control Plane"
                }
            }

            ifSwitchboard = container "if.switchboard Control / Wake Plane" "Preview SIP-style control plane for session contacts, wake, retained inboxes, live-answer and queued coordination, and escalation." "SIP-style dispatcher + Redis/control runtime" {
                tags "Current, Control Plane"

                contactRegistry = component "Contact Registry" "Registers Rook/session endpoints and exposes profiles, rooms, and retained inbox metadata." "Switchboard state" {
                    tags "Current, Control Plane"
                }
                wakeDispatcher = component "Wake / Contact Dispatcher" "Sends wake/contact packets, retained messages, and coordination signals to session lanes." "MCP/dispatcher" {
                    tags "Current, Control Plane"
                }
                retainedInbox = component "Retained Inbox" "Stores call/contact packets for session or caller lanes until consumed by a supervised runtime." "Redis/filesystem artifacts" {
                    tags "Current, Data Store"
                }
            }

            ifApi = container "if.api Adapter Front Door" "Preview integration layer for authenticated module surfaces, adapters, future tenant-scoped API, and versioned partner contracts." "HTTP/MCP adapter layer" {
                tags "Current, API"
            }
            ifBus = container "if.bus Event Backbone" "Preview message/event backbone below API and Switchboard. Public docs exist; no public mutation endpoint contract is claimed." "Redis/NATS-style backbone, internal runtime" {
                tags "Current, Control Plane"
            }
            secretsBoundary = container "Secrets / Credential Path Boundary" "Host-scoped secret paths and future KMS/Vault integration. Docs and proof packets carry paths only, never secret values." "Filesystem now; KMS/Vault target" {
                tags "Current, Security"
            }
            maintenanceBridgeHelper = container "Operator Link Helper" "Laptop bridge helper that prints pasteable connection context and writes local receipts for file copy and maintenance sessions." "WSL shell helper + SSH tunnel" {
                tags "Current, Operator Tooling"
            }
        }

        target = softwareSystem "Target Governance SaaS Substrate" "Buyer-grade target architecture and roadmap goal for Blackboard Governance SaaS: event truth to Proof Desk to Proof Packet v1, with hosted Rook and BYO harness adapters as integration options. Roadmap source: /root/docs/5003-if-blackboard-rook-governance-saas-autoplan-roadmap-2026-06-27.md." {
            blackboardGovernanceEnsemble = container "Blackboard Governance Ensemble" "Buyer-facing product ensemble: reconstructable AI-agent work timelines, signed or hash-bound task events and updates, tenant-scoped provenance, confidence classes, redaction manifests, access logs, proof packets, and receipt binding. Internal modules are hidden behind this product boundary." "SaaS product facade" {
                tags "Target, Evidence, API"
            }
            gateway = container "CDN / WAF / API Gateway" "OIDC/SAML, tenant routing, partner keys, API versioning, rate limits, and edge audit controls." "Managed gateway" {
                tags "Target, API, Security"
            }
            apiDomainAuthFoothold = container "api.infrafabric.io / Google OAuth Foothold" "Observed current API-domain foothold: api.infrafabric.io routes through Caddy to a Python API backend; Google OAuth registration includes /user/oauth2/Google/callback for api.infrafabric.io; direct no-parameter probe returned JSON not_found, so gateway/backend callback handling and full OAuth round-trip remain verification gates." "Caddy + Python API + OAuth route contract" {
                tags "Current, API, Security"
            }
            blackboardApiService = container "Blackboard API Service" "Stateless HTTP write service for Blackboard tasks, sessions, signals, checkpoints, and evidence refs. Enforces idempotency keys, tenant scope, schema validation, and rate limits before any ledger append; replaces CLI/MCP writer as the customer runtime boundary." "FastAPI / Go HTTP service" {
                tags "Target, API, Control Plane"

                idempotencyFilter = component "Idempotency Filter" "Checks idempotency_key against a recent-window cache before allowing writes; duplicate keys within TTL return the original response." "Redis + middleware" {
                    tags "Target, Control Plane"
                }
                schemaValidator = component "Schema Validator" "Validates payloads against strict versioned JSON Schema before persistence; rejects unknown fields at the tenant boundary." "JSON Schema 2020-12 strict mode" {
                    tags "Target, API"
                }
                rateLimitEnforcer = component "Rate Limit Enforcer" "Per-tenant, per-principal, and per-agent token bucket with 80 percent warning, 100 percent reject, and tenant quota metrics." "Redis token bucket" {
                    tags "Target, Control Plane"
                }
                tenantScopeGate = component "Tenant Scope Gate" "Verifies tenant_id, workspace_id, and project_id from validated JWT claims and rejects cross-tenant references." "Middleware + RBAC check" {
                    tags "Target, Security"
                }
            }
            authBroker = container "Auth Broker / Token Service" "Keycloak or Ory Hydra target service for browser SSO via Google OIDC, SAML SP-initiated enterprise login, device/PKCE for if-cli, client_credentials for service accounts and BYO harnesses, managed MCP bearer tokens with aud=mcp.infrafabric.io, introspection, revocation under 30s, and zero-downtime JWKS rotation." "Keycloak 24 / Ory Hydra 2" {
                tags "Target, API, Security"

                tokenLifecycleAuditor = component "Token Lifecycle Auditor" "Appends token issuance, refresh, introspection, and revocation events to auth_event without raw tokens; records jti, sub, aud, iat, exp, client_id, tenant_id, scope, ip_hash, and user_agent_hash." "Event hook + PostgreSQL insert" {
                    tags "Target, Evidence, Security"
                }
                replayProtection = component "Replay Protection" "MCP bearer tokens carry jti; consumed jtis are held in Redis until token expiry, and replay returns 401 plus an abuse_signal event." "Redis + middleware" {
                    tags "Target, Security"
                }
                abuseDetection = component "Abuse Detection" "Rate-limits auth attempts per IP and client_id; emits suspicious_auth_pattern after 5 failures in 60s and blocks after 20 failures, with tenant-configurable thresholds." "Redis + rule engine" {
                    tags "Target, Security"
                }
            }
            tenantRbac = container "Tenant / Workspace / Project / RBAC Service" "Tenants, workspaces, projects, principals, reviewer roles, agent identities, policy scopes, and access decisions." "Stateless service + database" {
                tags "Target, Security"
            }
            adapterSdk = container "Harness Adapter SDK" "Versioned BYO harness event contract for session, task, checkpoint, signal, evidence, and closeout events with idempotency keys. External customer examples must use API/MCP/SDK paths without SSH." "SDK + API contracts" {
                tags "Target, API"
            }
            proofDeskService = container "Proof Desk Service" "Multi-tenant Blackboard read and reviewer workflow service. Serves request/response proof desk reads from projections, hydrates from event truth before proof claims, records access logs, and never writes canonical events directly except through authorized service contracts." "Stateless service" {
                tags "Target, Evidence"
            }
            sessionProvenance = container "Session Provenance Service" "Canonical tenant/workspace/project/principal/agent/session/client-app/host/transport/MCP-server/policy/receipt binding for cross-device work." "Stateless service + database tables" {
                tags "Target, Security, Evidence"
            }
            transportAttestation = container "Transport Attestation Service" "Classifies and records WebSocket, SSH, stdio MCP, HTTP MCP, remote MCP, VS Code Remote SSH, Cloudflare tunnel, and maintenance-bridge origins without trusting inbound headers. SSH-family transports are operator-only or break-glass, never external customer usage." "Policy service" {
                tags "Target, Security"
            }
            liveEventGateway = container "Live Event / WebSocket Gateway" "Tenant-aware subscription and notification plane for task updates, wake/contact, progress, and shared operator UI events." "Managed WebSocket gateway" {
                tags "Target, API, Control Plane"
            }
            managedLedgerDb = container "Managed Ledger Database" "Tenant-scoped PostgreSQL source of truth for tasks, sessions, signals, principals, access logs, policies, and proof packet metadata." "Managed PostgreSQL" {
                tags "Target, Data Store"
            }
            appendOnlyEventStore = container "Append-Only Event Store" "PostgreSQL 16 partitioned event tables for task, session, signal, evidence, access, auth, proof, lifecycle, and receipt events. Application role is INSERT-only; UPDATE, DELETE, and TRUNCATE are denied by privileges and fail-closed triggers. Partitioned by tenant_id and month, protected by RLS using app.current_tenant, logical replication feeds workers, WAL retention minimum 7 days, PITR target 5 minutes, and each event participates in a hash chain." "PostgreSQL 16 + RLS + logical replication" {
                tags "Target, Data Store, Evidence, Security"

                eventPartitionManager = component "Event Partition Manager" "Auto-creates monthly tenant partitions 30 days ahead, alerts on partition failure, and freeze-marks historical partitions for backup verification." "pg_partman + scheduled job" {
                    tags "Target, Data Store"
                }
                mutationDenyTrigger = component "Mutation Deny Trigger" "BEFORE UPDATE, DELETE, or TRUNCATE trigger raises SQLSTATE P0001 with audit context; disabling requires superuser plus recorded incident." "PL/pgSQL trigger" {
                    tags "Target, Security, Evidence"
                }
                replicationSlotMonitor = component "Replication Slot Monitor" "Alerts if logical replication lag exceeds 100MB or 60s, and drops the slot with incident evidence if lag exceeds 2GB to prevent WAL exhaustion." "PostgreSQL replication monitor" {
                    tags "Target, Control Plane"
                }
                eventHashChain = component "Event Hash Chain" "Stores sha256(prev_hash || event_payload) per row, publishes chain roots to if.trace on cadence, and exposes a reviewer verifier." "PostgreSQL function + Python verifier" {
                    tags "Target, Evidence, Security"
                }
            }
            eventSignatureIntegrityService = container "Event Signature / Integrity Service" "Signs or hash-binds task events, updates, checkpoints, evidence attachments, access decisions, redaction manifests, and proof packet exports according to tenant policy. Verifies event hash chains, stores signature metadata, rotates signing keys through KMS/Vault, and publishes receipt roots where policy requires." "Signing service + hash-chain verifier" {
                tags "Target, Evidence, Security"
            }
            projectionWorker = container "Projection Worker / Outbox Consumer" "Idempotent consumer of PostgreSQL logical replication. Processes events in tenant-partitioned order, updates projection tables with last_event_id guards, writes search documents to a transactional outbox, exposes /healthz with lag_seconds and last_processed_event_id, and targets projection lag p99 under 5s in normal load." "Python worker + PostgreSQL logical replication" {
                tags "Target, Control Plane, Evidence"

                lagAlertGate = component "Lag Alert Gate" "Alerts at projection lag over 30s; at lag over 5 minutes pauses new write acceptance and emits an incident event to prevent stale proof desk state being presented as current." "Prometheus alert + circuit breaker" {
                    tags "Target, Control Plane"
                }
                rebuildCoordinator = component "Rebuild Coordinator" "Rebuilds projections from event truth into shadow tables, validates row counts and last_event_id, atomically swaps tables, and receipts rebuild evidence to if.trace." "Python + PostgreSQL transactions" {
                    tags "Target, Evidence"
                }
                outboxPublisher = component "Outbox Publisher" "Writes search documents to an outbox table in the same transaction as projection updates; a relay publishes to the indexing queue for at-least-once delivery without dual-write inconsistency." "Transactional outbox + relay" {
                    tags "Target, Control Plane"
                }
            }
            currentStateProjections = container "Current-State Projections" "Rebuildable task_current, session_current, signal_thread_current, evidence_current, proof_packet_current, and tenant_search_scope tables derived from append-only events." "PostgreSQL projection tables" {
                tags "Target, Data Store, Evidence"
            }
            searchIndex = container "Meilisearch Search Index" "Rebuildable, access-filtered search index for fuzzy task/session/evidence discovery. Not authoritative, not proof, and never stores secrets/raw private evidence." "Meilisearch" {
                tags "Target, Data Store, API"
            }
            indexingQueue = container "Indexing Queue / Dead Letter" "Backpressure, retry, dead-letter, and per-tenant lag queue for projection and Meilisearch indexing work." "Managed queue / stream" {
                tags "Target, Control Plane"
            }
            objectStore = container "Evidence Object Store" "Artifacts, proof packets, exports, redaction reports, receipts, provider-log snapshots, and lifecycle policies." "S3-compatible object store" {
                tags "Target, Data Store, Evidence"
            }
            customerVault = container "Customer-Owned Evidence Vault" "Dedicated customer storage, KMS keys, retention, deletion, and export policy for enterprise deployments." "Customer cloud / dedicated bucket" {
                tags "Target, Data Store, Security"
            }
            mcpToolGateway = container "MCP Tool Gateway" "Scoped MCP tools for Blackboard, Context, Switchboard, and proof packet reads/writes with tool-level audit. This replaces SSH-wrapped MCP for external customers." "Managed MCP service" {
                tags "Target, API, Security"
            }
            switchboardService = container "Managed Switchboard Service" "Optional managed wake/contact/session-lane service for live coordination and retained inbox behavior." "Managed control service" {
                tags "Target, Control Plane"
            }
            busService = container "Managed Event Backbone" "Tenant-scoped event streams for adapter ingestion, switchboard events, and proof packet materialization." "Managed stream service" {
                tags "Target, Control Plane"
            }
            proofPacketService = container "Proof Packet Service" "Assembles, versions, verifies, and publishes proof packets as first-class database records. Packet v1 includes packet_id, tenant/workspace/project ids, task/session/signal ids, evidence refs with etags, event_id range and hash-chain root, confidence class, redaction summary, non-claims, reviewer access-log ids, receipt_id, assembled metadata, and schema_version. Assembly is deterministic by content hash, exported to object storage, receipted to if.trace, and access logged on every read." "Stateless service + PostgreSQL + S3" {
                tags "Target, Evidence"

                confidenceClassifier = component "Confidence Classifier" "Assigns deterministic claim confidence: verified, claimed, or inferred, based on artifact existence, hash match, receipt state, and human review evidence." "Python rule engine" {
                    tags "Target, Evidence"
                }
                redactionEngine = component "Redaction Engine" "Applies tenant redaction policy before external export, emits a redaction_manifest with policy version and timestamp, receipts the manifest, and keeps raw content out of external packets." "Python + policy config" {
                    tags "Target, Security, Evidence"
                }
                coherenceVerifier = component "Coherence Verifier" "Rejects packets unless event ids exist, hash-chain continuity holds, evidence refs resolve, and projection current state matches event truth." "Python verifier" {
                    tags "Target, Evidence"
                }
            }
            claimBoundaryEngine = container "Claim Boundary Engine" "Decides what Blackboard is allowed to say about work: verified, claimed, inferred, stale, missing, blocked, redacted, or explicitly not claimed. Prevents semantic overclaiming, requires human or domain verifier evidence for correctness claims, and gives Proof Desk and Proof Packet v1 their claim boundaries." "Rules service + verifier" {
                tags "Target, Evidence, Security"
            }
            tenantIsolationVerifier = container "Tenant Isolation Verifier" "Continuous conformance tests for cross-tenant isolation in CI and scheduled production probes against shadow tenant fixtures. Verifies API token isolation, PostgreSQL RLS, Meilisearch filter bypass resistance, replication consumer tenant partitioning, and object-store presigned URL boundaries; failures trigger incident and pause affected tenant writes." "pytest + scheduled probe runner" {
                tags "Target, Security, Evidence"
            }
            circuitBreakerRegistry = container "Circuit Breaker Registry" "Per-dependency circuit breakers for event store, search, object store, auth broker, and projection worker. Defines open and half-open thresholds, degraded fallbacks, write-pausing behavior, and Prometheus circuit-state gauges." "Resilience4j / Python resilience middleware" {
                tags "Target, Control Plane, Security"
            }
            dataLifecycleService = container "Data Lifecycle / Retention Service" "Enforces tenant retention, export, legal hold, and right-to-erasure policy. Soft delete excludes from projections, hard delete redacts PII while preserving structural event and hash-chain continuity, object/search/projection cleanup is coordinated, and all lifecycle operations append lifecycle_event records." "Python service + PostgreSQL + S3 lifecycle" {
                tags "Target, Security, Evidence"
            }
            apiVersioningContract = container "API Versioning Contract" "All product APIs are versioned from day one using /v1 and /v2 paths, OpenAPI 3.1, explicit breaking-change rules, 12-month sunset notice, deprecation headers, if-cli semver/API compatibility, and conformance tests across active API versions." "OpenAPI 3.1 + version middleware" {
                tags "Target, API"
            }
            degradationPlaybook = container "Graceful Degradation Specification" "Defines fail-closed and degraded behavior for dependency failures: projection-only search fallback, staleness headers for lag, write rejection when event store is unavailable, queued exports when object store is down, auth outage behavior, and incident_event emission for every transition." "Runbook + feature flags + alerts" {
                tags "Target, Control Plane, Evidence"
            }
            observability = container "Observability Stack" "OpenTelemetry collector, Prometheus, Grafana, and structured append-only audit warehouse. Runtime contract includes SLOs, error-budget burn alerts, SIEM/GRC exports, drift detection, and incident replay capability." "OTel + Prometheus + Grafana + ClickHouse" {
                tags "Target, Evidence"

                sloDefinitions = component "SLO Definitions" "Enforces SLOs: API write p99 under 500ms, proof desk read p99 under 1s, projection lag p99 under 5s, search lag p99 under 30s, auth token issuance p99 under 300ms, proof packet assembly p99 under 10s, append-only insert p99 under 100ms, with 2x and 10x burn alerts." "Prometheus recording rules" {
                    tags "Target, Evidence"
                }
                auditLogWarehouse = component "Audit Log Warehouse" "ClickHouse append-only audit tables with event_type, tenant_id, principal_id, agent_id, resource, action, outcome, ip_hash, user_agent_hash, trace_id, span_id, timestamp, two-year retention, and SIEM export." "ClickHouse + S3 export" {
                    tags "Target, Evidence, Security"
                }
                incidentReplayCapability = component "Incident Replay Capability" "Given tenant and time range, pulls events, replays projections locally, diffs production projection, identifies first divergence, and is tested quarterly." "Python replay tool + runbook" {
                    tags "Target, Evidence"
                }
                driftDetector = component "Drift Detector" "Compares projection counts, search document counts, and proof packet event ids against event truth; drift over 0.01 percent alerts and queues rebuild." "Python scheduled job + Prometheus gauge" {
                    tags "Target, Control Plane, Evidence"
                }
            }
            kmsVault = container "KMS / Vault" "Scoped keys, secret audit, short-lived tokens, signing keys, and receipt key rotation." "KMS/Vault" {
                tags "Target, Security"
            }
            ciCd = container "CI/CD / IaC" "Reproducible builds, migrations, publish gates, documentation, and environment promotion." "CI/CD + Terraform" {
                tags "Target, Control Plane"
            }
            architectureGovernance = container "Architecture Rationalization Program" "Roadmap owner for collapsing duplicate front doors, separating request/response from live WebSocket behavior, canonicalizing provenance, optimizing search/proof assembly, and removing operator-only transports from product claims." "Architecture governance + conformance tests" {
                tags "Target, Control Plane, Evidence"
            }
            r0TransportInventoryArtifact = container "R0 Transport Inventory Artifact" "Machine-readable inventory, validator, and boundary doc that freeze current WebSocket, SSH, MCP, HTTP, tunnel, and operator paths, plus if-cli namespace and no-customer-SSH gates. Source: /root/docs/data/if-blackboard-rook-transport-inventory.v1.json." "JSON + Python validator + Markdown contract" {
                tags "Roadmap, Evidence"
            }
            roadmapR0 = container "R0 Inventory And Freeze Current Boundary" "Roadmap goal: classify current WebSocket, SSH, stdio MCP, HTTP/MCP, remote harness, tunnel, and browser/control paths as product, operator-only, break-glass, legacy, or experimental." "Roadmap phase" {
                tags "Roadmap, Evidence"
            }
            roadmapR0_5 = container "R0.5 Real Infrastructure Baseline" "Roadmap goal: stand up single-tenant but real production-shaped substrate before hosted proof desk: PostgreSQL RLS append-only tables, auth broker with Google OIDC, Blackboard API service, projection worker, Meilisearch projection, SLOs, circuit breakers, and degradation policy." "Roadmap phase" {
                tags "Roadmap, Target, Security"
            }
            roadmapR1 = container "R1 Product Transport Contract" "Roadmap goal: make Blackboard governed request/response, WebSocket the live plane, MCP the scoped tool contract through dot namespaces/if-cli, if.transport compatibility only, and SSH operator-only with no external customer usage." "Roadmap phase" {
                tags "Roadmap, API"
            }
            roadmapR2 = container "R2 Canonical Provenance And Access Model" "Roadmap goal: bind tenant, workspace, principal, agent, sid/session, client app, host, runtime origin, transport, MCP server, policy hash, access log, and trace receipt ids." "Roadmap phase" {
                tags "Roadmap, Security, Evidence"
            }
            roadmapR2_5 = container "R2.5 Load And Isolation Testing" "Roadmap goal: prove the runtime substrate before design partners with 10K+ synthetic events across tenants, RLS/search/object-store isolation tests, projection lag SLO checks, and chaos tests for projection worker rebuild recovery." "Roadmap phase" {
                tags "Roadmap, Security, Evidence"
            }
            roadmapR3 = container "R3 Proof Packet And Trace Binding" "Roadmap goal: ship versioned proof packet schema, confidence classes, receipt policy, redaction reports, and coherence tests across ledgers, evidence, access, and trace." "Roadmap phase" {
                tags "Roadmap, Evidence"
            }
            roadmapR4 = container "R4 Blackboard Design-Partner Proof Desk" "Roadmap goal: first marketable design-partner offer for Blackboard Proof Desk, with hosted Rook only as the reference harness option, tenant/project proof views, milestone reports, confidence and claim-boundary views, access summaries, signed/hash-bound integrity status, and deterministic Proof Packet v1 exports." "Roadmap phase" {
                tags "Roadmap, Target, Evidence"
            }
            roadmapR5 = container "R5 BYO Harness Adapter" "Roadmap goal: external harness adapter event contract, SDK/reference client, idempotent ingest, conformance tests, and least-privilege MCP gateway." "Roadmap phase" {
                tags "Roadmap, API"
            }
            roadmapR6 = container "R6 Enterprise Secure SaaS" "Roadmap goal: SSO/RBAC, tenant-scoped keys, customer-owned evidence vault, SIEM/GRC exports, retention/redaction/deletion policy, and incident replay." "Roadmap phase" {
                tags "Roadmap, Security"
            }
        }

        martin -> rookHarness "Sets product direction and reviews architecture"
        martin -> architectureGovernance "Leads roadmap to rationalize and optimize the product architecture"
        martin -> roadmapR0 "Uses the roadmap and DSL as the goal source"
        operator -> ifCli "Runs remote-host agent/module commands"
        operator -> rookRuntime "Runs governed Rook/Codex sessions"
        operator -> blackboardWriter "Creates tasks, binds sessions, checkpoints, and closes out"
        operator -> proofPacketExporter "Assembles pilot proof packets"
        operator -> maintenanceBridgeHelper "Reads operator-only bridge context and receipts"
        operator -> martinLaptop "Copies finished docs and artifacts when bridge is open"
        operator -> mtl03Harness "Runs or observes remote harness sessions where applicable"
        customerManager -> blackboardProofDesk "Reviews task/session/signal proof and pilot status"
        securityReviewer -> blackboardProofDesk "Reviews proof desk, claim boundaries, and evidence sufficiency"
        externalAgentDeveloper -> adapterSdk "Implements BYO harness event contract"
        aiAgent -> rookRuntime "Runs inside reference harness"
        aiAgent -> blackboardWriter "Writes task progress through controlled front door"
        aiAgent -> ifContext "Requests bounded recall and read plans"
        aiAgent -> ifSwitchboard "Receives wake/contact messages through session lane"
        aiAgent -> mtl03Harness "May run from remote internal harness host"
        aiAgent -> gateway "Target: sends scoped tool/session events through managed edge"
        customerManager -> blackboardGovernanceEnsemble "Uses Blackboard Proof Desk, access-log, and proof packet workflows"
        securityReviewer -> blackboardGovernanceEnsemble "Reviews claim boundaries, redactions, signed/hash-bound updates, and proof packets"
        externalAgentDeveloper -> blackboardGovernanceEnsemble "Integrates through API, MCP, or SDK without learning internal module names"
        aiAgent -> blackboardGovernanceEnsemble "Emits governed work events through API, MCP, SDK, or hosted reference harness"

        reviewerBrowser -> blackboardProofDesk "Displays proof desk and derived reviewer views"
        reviewerBrowser -> blackboardGovernanceEnsemble "Displays buyer-facing Blackboard review workflows"
        reviewerBrowser -> tracePage "Displays public receipts and review bundles"
        customerSystems -> adapterSdk "Target: sends evidence refs, provider logs, tickets, commits, and system events"
        identityProvider -> gateway "Target: authenticates tenants, users, reviewers, and agents"
        identityProvider -> apiDomainAuthFoothold "Current: Google OAuth redirect allowlist includes api.infrafabric.io/user/oauth2/Google/callback and sibling callback domains"
        aiModelProviders -> rookRuntime "Provides model execution where configured"
        martinLaptop -> maintenanceBridgeHelper "Opens operator bridge and receives copied docs/artifacts"
        martinLaptop -> ifCli "Current operator-only wrappers invoke if-cli through SSH; not a customer path"
        martinLaptop -> blackboardWriter "Current: uses remote SSH MCP wrappers through ifproxy/iftransport for Blackboard writes and reads"
        martinLaptop -> mcpHttpBridge "Current: reaches request/response MCP front doors through SSH-wrapped stdio/HTTP paths"
        martinLaptop -> chatRelay "May use `/chat/ws` live coordination where a browser/control client is configured"
        mtl03Harness -> ifSwitchboard "Current: runs switchboard MCP server/processes for remote harness coordination"
        mtl03Harness -> chatRelay "Current or target: live coordination should be explicit and instrumented before product claims"

        taskWriter -> blackboardLedgers "Appends task events"
        sessionBinder -> blackboardLedgers "Appends session events"
        signalWriter -> blackboardLedgers "Appends signal events"
        checkpointWriter -> blackboardLedgers "Appends checkpoints and evidence refs"
        closeoutGate -> blackboardLedgers "Appends final task result and traps"
        ifCli -> rookRuntime "Exposes if.rook lifecycle and arrival context namespace"
        ifCli -> blackboardWriter "Exposes if.blackboard command/MCP namespace"
        ifCli -> ifContext "Exposes if.context command/MCP namespace"
        ifCli -> ifSwitchboard "Exposes if.switchboard command/MCP namespace"
        ifCli -> mcpHttpBridge "Delegates MCP stdio to if.transport compatibility engine"
        blackboardWriter -> blackboardLedgers "Appends canonical task, session, signal, checkpoint, and closeout events"
        blackboardWriter -> mcpHttpBridge "Current front-door path for local and SSH-wrapped MCP request/response calls"
        mcpHttpBridge -> ifApi "Posts governed module calls over local HTTP/MCP adapters"
        chatRelay -> ifSwitchboard "Provides live coordination fallback for presence, wake, nudge, and browser/control traffic"
        chatRelay -> ifApi "Shares relay/API boundary for selected MCP and HTTP routes"
        chatRelay -> ifBus "Target: live events should enter the event backbone with tenant scope"
        chatRelay -> ifTraceProduct "Target: high-value live control events should be receipted when policy requires"
        blackboardLedgers -> blackboardRenderer "Feeds deterministic derived views"
        blackboardRenderer -> blackboardProofDesk "Publishes task/session/signal/search views"
        blackboardProofDesk -> reviewerBrowser "Serves proof desk views and proof packets"
        proofPacketExporter -> blackboardLedgers "Reads canonical task/session/signal history"
        proofPacketExporter -> ifContext "Reads bounded evidence context and derived artifact refs"
        proofPacketExporter -> ifTraceProduct "Publishes receipts for exported artifacts"
        proofPacketExporter -> blackboardProofDesk "Publishes proof packets and confidence classes"
        blackboardProofDesk -> accessLog "Target: records proof view and export access"

        rookBootstrap -> arrivalSurfaces "Writes current session capability and policy context"
        rookBootstrap -> ifSwitchboard "Registers session contact"
        fiveLaneGate -> blackboardLedgers "Stores review summary refs through closeout"
        airgapPolicy -> blackboardLedgers "Records local-only evidence attestations when used"
        rookRuntime -> blackboardWriter "Requires active task before durable writes"
        rookRuntime -> ifContext "Uses bounded recall and post-it continuity"
        rookRuntime -> ifSwitchboard "Uses wake/contact path as default coordination"
        rookRuntime -> maintenanceBridgeHelper "Operator-only bridge context and copy receipts"
        maintenanceBridgeHelper -> martinLaptop "Uses SSH tunnel and Windows/WSL path receipt"

        contextSearch -> readPlan "Feeds bounded source shortlist where useful"
        readPlan -> memoryLifecycle "Provides derived evidence candidates without hidden authority"
        ifContext -> blackboardWriter "Feeds context refs and resume notes without mutating task truth"

        contactRegistry -> wakeDispatcher "Resolves session contacts"
        wakeDispatcher -> retainedInbox "Stores retained packets when target is not live"
        ifSwitchboard -> ifApi "Uses canonical ingress and adapter boundary"
        ifSwitchboard -> ifBus "Uses transport/backbone layer"
        ifSwitchboard -> blackboardWriter "Records durable evidence through signals/tasks"

        ifApi -> ifContext "Backs authenticated Context MCP surface"
        ifApi -> blackboardWriter "Backs authenticated Blackboard MCP surface"
        ifApi -> ifSwitchboard "Backs Switchboard front door where applicable"
        ifBus -> ifSwitchboard "Carries preview transport/backbone events"
        secretsBoundary -> blackboardWriter "Provides credential paths only"
        secretsBoundary -> ifApi "Provides scoped auth material via path-bound secret store"
        tracePage -> receiptStore "Reads receipt metadata"

        customerManager -> gateway "Target: accesses tenant proof desk"
        securityReviewer -> gateway "Target: reviews proof packets and access logs"
        externalAgentDeveloper -> gateway "Target: sends adapter events"
        aiAgent -> mcpToolGateway "Target: uses scoped MCP tools"
        apiDomainAuthFoothold -> gateway "Migration mapping: preserve API-domain ingress and callback inventory behind managed gateway"
        apiDomainAuthFoothold -> authBroker "Migration mapping: consolidate registered Google callbacks and app-specific OAuth gates into one broker"
        blackboardGovernanceEnsemble -> gateway "Presents one buyer-facing HTTPS, MCP, and WebSocket product boundary"
        blackboardGovernanceEnsemble -> proofDeskService "Surfaces work timelines, evidence, confidence, redaction, export, and access-log workflows"
        blackboardGovernanceEnsemble -> proofPacketService "Exports deterministic Proof Packet v1 artifacts"
        blackboardGovernanceEnsemble -> claimBoundaryEngine "Explains what is verified, claimed, inferred, stale, missing, redacted, or not claimed"
        blackboardGovernanceEnsemble -> eventSignatureIntegrityService "Shows signed or hash-bound event and packet integrity according to policy"
        blackboardGovernanceEnsemble -> mcpToolGateway "Offers scoped agent tools as one integration option"
        blackboardGovernanceEnsemble -> liveEventGateway "Offers subscriptions, progress, wake/contact, and shared UI events as live-only behavior"
        gateway -> tenantRbac "Authenticates and authorizes tenant/workspace/project access"
        gateway -> authBroker "Delegates browser login, callback handling, token validation, token exchange, and revocation"
        gateway -> apiVersioningContract "Enforces API version routes, deprecation headers, and compatibility policy"
        gateway -> blackboardApiService "Routes canonical Blackboard write requests after edge policy and auth"
        gateway -> proofDeskService "Routes proof desk reads and writes"
        gateway -> mcpToolGateway "Routes scoped MCP calls"
        gateway -> adapterSdk "Routes BYO harness events"
        gateway -> liveEventGateway "Routes tenant-aware WebSocket subscriptions and live control events"
        authBroker -> identityProvider "Redirects to and validates OIDC/SAML/Google identity provider flows"
        authBroker -> tenantRbac "Maps issuer, client, user, service account, and agent claims to tenant/workspace/project scopes"
        authBroker -> appendOnlyEventStore "Appends authentication, token, revocation, and authorization-decision events where policy requires"
        authBroker -> observability "Emits login, callback, token, revocation, and abuse-signal audit events"
        authBroker -> kmsVault "Uses signing keys, verifier keys, rotation policy, and secret references"
        blackboardApiService -> authBroker "Validates access token, token lifecycle state, and replay policy"
        blackboardApiService -> tenantRbac "Enforces tenant, workspace, project, principal, and agent scopes"
        blackboardApiService -> eventSignatureIntegrityService "Requests signature or hash binding for accepted events and updates"
        blackboardApiService -> appendOnlyEventStore "Appends validated immutable Blackboard events with idempotency guard"
        blackboardApiService -> circuitBreakerRegistry "Honors write-path circuit states and fail-closed dependency policy"
        blackboardApiService -> observability "Emits write latency, rate-limit, idempotency, quota, and rejection metrics"
        proofDeskService -> appendOnlyEventStore "Appends immutable task, session, signal, evidence, access, proof, and receipt events"
        proofDeskService -> currentStateProjections "Reads current task/session/signal/proof state derived from events"
        proofDeskService -> searchIndex "Queries rebuildable search index for discovery, then hydrates authoritative records"
        proofDeskService -> managedLedgerDb "Reads tenant metadata and database-managed proof state"
        proofDeskService -> sessionProvenance "Reads canonical session/device/transport provenance for reviewer timelines"
        proofDeskService -> objectStore "Reads/writes artifacts, proof packets, and redaction reports"
        proofDeskService -> claimBoundaryEngine "Requests allowed claim labels before review, export, or buyer-visible proof statements"
        proofDeskService -> eventSignatureIntegrityService "Verifies signed or hash-bound event integrity for timeline display"
        proofDeskService -> proofPacketService "Delegates deterministic packet assembly, verification, redaction, and publication"
        proofDeskService -> circuitBreakerRegistry "Uses dependency circuit states to serve degraded reads or block stale proof actions"
        proofDeskService -> ifTraceProduct "Publishes receipts for exported proof packets"
        proofDeskService -> observability "Emits proof-generation and access audit events"
        sessionProvenance -> appendOnlyEventStore "Appends provenance and policy binding events"
        sessionProvenance -> managedLedgerDb "Persists provenance bindings and policy decision ids"
        sessionProvenance -> transportAttestation "Requests transport classification and trust boundary checks"
        sessionProvenance -> ifTraceProduct "Publishes receipts for high-value provenance batches where policy requires"
        transportAttestation -> observability "Emits transport audit and anomaly events"
        transportAttestation -> kmsVault "Uses scoped verifier keys and policy secrets"
        adapterSdk -> tenantRbac "Checks tenant, principal, agent, and policy scope"
        adapterSdk -> authBroker "Uses OAuth-style client/service-account credentials and token introspection"
        adapterSdk -> appendOnlyEventStore "Writes idempotent harness events"
        adapterSdk -> sessionProvenance "Attaches host, client app, transport, and MCP-server metadata to events"
        adapterSdk -> objectStore "Writes or references evidence artifacts"
        adapterSdk -> busService "Publishes scoped event stream messages"
        mcpToolGateway -> proofDeskService "Executes scoped Blackboard/Context/Switchboard tools"
        mcpToolGateway -> authBroker "Validates managed MCP bearer token, audience, expiry, replay handle, and scopes"
        mcpToolGateway -> sessionProvenance "Records tool caller, host, transport, and policy hash"
        liveEventGateway -> switchboardService "Delivers wake/contact and live session events"
        liveEventGateway -> proofDeskService "Publishes live proof-desk task updates"
        liveEventGateway -> busService "Writes tenant-scoped live event stream messages"
        liveEventGateway -> ifTraceProduct "Publishes receipts for high-value live events where policy requires"
        switchboardService -> busService "Uses managed event backbone"
        switchboardService -> proofDeskService "Records wake/contact evidence"
        appendOnlyEventStore -> projectionWorker "Feeds committed events through outbox/logical stream"
        appendOnlyEventStore -> eventSignatureIntegrityService "Feeds event hash-chain verification and signature checks"
        appendOnlyEventStore -> ifTraceProduct "Publishes hash-chain roots and high-value event receipts on policy cadence"
        eventSignatureIntegrityService -> appendOnlyEventStore "Stores signature, hash-chain, and verification metadata with event truth"
        eventSignatureIntegrityService -> kmsVault "Uses signing keys, verification keys, key ids, and rotation policy"
        eventSignatureIntegrityService -> ifTraceProduct "Publishes receipt roots and signature-bound artifacts where policy requires"
        eventSignatureIntegrityService -> observability "Emits signing, verification, key-rotation, and integrity-failure evidence"
        projectionWorker -> currentStateProjections "Updates rebuildable current-state tables with last_event_id/hash"
        projectionWorker -> indexingQueue "Queues safe redacted search documents and rebuild jobs"
        projectionWorker -> searchIndex "Runs full rebuild/backfill jobs when projections or indexes drift"
        projectionWorker -> circuitBreakerRegistry "Opens lag-related circuits and pauses write acceptance when stale-state risk is too high"
        indexingQueue -> searchIndex "Indexes access-filtered search documents with retry and dead-letter handling"
        indexingQueue -> observability "Emits queue depth, retry, dead-letter, and lag metrics"
        currentStateProjections -> searchIndex "Feeds rebuildable search documents; search is not source of truth"
        currentStateProjections -> observability "Exports projection lag and rebuild status"
        searchIndex -> observability "Exports indexing task status and search health"
        managedLedgerDb -> appendOnlyEventStore "Hosts immutable event tables and partitioning strategy"
        managedLedgerDb -> currentStateProjections "Hosts rebuildable projection tables"
        managedLedgerDb -> observability "Exports audit and health metadata"
        proofPacketService -> appendOnlyEventStore "Verifies event ids, hash-chain continuity, auth/access events, and lifecycle state before assembly"
        proofPacketService -> currentStateProjections "Checks projection current state against event truth before publishing"
        proofPacketService -> claimBoundaryEngine "Requires claim-boundary decision before packet export"
        proofPacketService -> eventSignatureIntegrityService "Signs or hash-binds packet and redaction manifests according to policy"
        proofPacketService -> objectStore "Writes deterministic proof packet exports, manifests, and redaction reports"
        proofPacketService -> ifTraceProduct "Publishes receipt for packet and redaction manifest"
        proofPacketService -> observability "Emits assembly latency, coherence rejection, and packet access evidence"
        claimBoundaryEngine -> appendOnlyEventStore "Reads event truth, access decisions, hash-chain state, and review events"
        claimBoundaryEngine -> currentStateProjections "Checks visible state and staleness before allowing proof statements"
        claimBoundaryEngine -> objectStore "Verifies evidence refs, hashes, etags, redaction reports, and packet artifacts"
        claimBoundaryEngine -> eventSignatureIntegrityService "Checks signatures, hash roots, and receipt bindings before integrity claims"
        claimBoundaryEngine -> tenantRbac "Checks reviewer role, approval authority, and policy scope for human-reviewed claims"
        claimBoundaryEngine -> observability "Emits overclaim denials, claim decisions, and verifier evidence"
        tenantIsolationVerifier -> gateway "Runs API cross-tenant access probes"
        tenantIsolationVerifier -> appendOnlyEventStore "Runs RLS and event partition isolation probes"
        tenantIsolationVerifier -> searchIndex "Runs Meilisearch tenant-filter bypass probes"
        tenantIsolationVerifier -> objectStore "Runs presigned URL tenant-boundary probes"
        tenantIsolationVerifier -> projectionWorker "Verifies replication/projection tenant partition enforcement"
        tenantIsolationVerifier -> observability "Emits conformance evidence and incident events on failure"
        circuitBreakerRegistry -> observability "Exports all circuit states and threshold transitions as metrics and incident evidence"
        dataLifecycleService -> appendOnlyEventStore "Appends lifecycle events and redaction/tombstone records without breaking hash-chain continuity"
        dataLifecycleService -> currentStateProjections "Removes or redacts lifecycle-controlled records from projections"
        dataLifecycleService -> searchIndex "Deletes or redacts lifecycle-controlled search documents"
        dataLifecycleService -> objectStore "Applies retention, legal hold, export, and redaction policy to evidence objects"
        dataLifecycleService -> observability "Emits lifecycle audit and export SLA evidence"
        apiVersioningContract -> blackboardApiService "Constrains request and response schemas by active API version"
        apiVersioningContract -> adapterSdk "Constrains SDK compatibility and conformance tests by active API version"
        apiVersioningContract -> mcpToolGateway "Constrains managed MCP tool contracts and sunset policy"
        apiVersioningContract -> ifCli "Constrains if-cli semantic version support for API N and N-1"
        degradationPlaybook -> circuitBreakerRegistry "Defines dependency failure modes, staleness headers, write blocking, queuing, and recovery transitions"
        degradationPlaybook -> blackboardApiService "Requires fail-closed writes when event store or auth guarantees are unavailable"
        degradationPlaybook -> proofPacketService "Blocks proof packet assembly when projection or evidence state is stale"
        degradationPlaybook -> observability "Emits incident_event on every degradation mode transition"
        objectStore -> customerVault "Enterprise option: stores customer-owned evidence"
        tenantRbac -> kmsVault "Uses scoped secrets and signing keys"
        ciCd -> proofDeskService "Builds and deploys services"
        ciCd -> blackboardApiService "Builds and deploys canonical write service"
        ciCd -> authBroker "Deploys auth broker, callback configuration, JWKS rotation, and token tests"
        ciCd -> managedLedgerDb "Runs migrations with gates"
        ciCd -> appendOnlyEventStore "Applies insert-only roles, mutation-deny triggers, and partition migrations"
        ciCd -> projectionWorker "Deploys projection/index rebuild workers and backfill jobs"
        ciCd -> eventSignatureIntegrityService "Deploys signing, hash-chain verification, and key-rotation tests"
        ciCd -> proofPacketService "Deploys proof packet schema, verifier, and redaction gates"
        ciCd -> claimBoundaryEngine "Deploys claim-boundary rules and overclaim regression tests"
        ciCd -> tenantIsolationVerifier "Runs tenant isolation conformance in CI and scheduled probes"
        ciCd -> apiVersioningContract "Runs conformance across all active API versions"
        ciCd -> gateway "Publishes API and docs routes"
        architectureGovernance -> gateway "Standardizes public ingress and API versioning"
        architectureGovernance -> blackboardGovernanceEnsemble "Collapses buyer narrative around Blackboard as one proof governance ensemble"
        architectureGovernance -> authBroker "Consolidates Google OAuth callbacks, SSO, service-account tokens, if-cli auth, and managed MCP authorization"
        architectureGovernance -> blackboardApiService "Requires stateless idempotent HTTP writes instead of CLI wrappers for customer runtime"
        architectureGovernance -> proofDeskService "Defines canonical Blackboard request/response operations and proof-desk coherence tests"
        architectureGovernance -> appendOnlyEventStore "Defines immutable event-store contract for thousands of users"
        architectureGovernance -> eventSignatureIntegrityService "Requires signed or hash-bound task/update integrity according to policy"
        architectureGovernance -> projectionWorker "Defines projection rebuild, backfill, and lag SLO gates"
        architectureGovernance -> searchIndex "Defines Meilisearch as rebuildable UX index, never authority"
        architectureGovernance -> proofPacketService "Makes proof packets first-class deterministic runtime objects"
        architectureGovernance -> claimBoundaryEngine "Makes claim boundaries product-visible and prevents semantic overclaiming"
        architectureGovernance -> tenantIsolationVerifier "Requires cross-tenant isolation probes before hosted pilots"
        architectureGovernance -> circuitBreakerRegistry "Defines dependency thresholds and fail-closed/degraded behavior"
        architectureGovernance -> dataLifecycleService "Defines retention, export, erasure, legal hold, and tombstone policy"
        architectureGovernance -> apiVersioningContract "Defines stable API versioning and sunset policy"
        architectureGovernance -> degradationPlaybook "Defines explicit degraded-mode behavior for every critical dependency"
        architectureGovernance -> liveEventGateway "Moves `/chat/ws` style behavior into tenant-aware live subscriptions and notifications"
        architectureGovernance -> mcpToolGateway "Collapses local and SSH-wrapped MCP paths into scoped managed MCP tools"
        architectureGovernance -> sessionProvenance "Requires canonical tenant, principal, agent, host, client-app, transport, and receipt binding"
        architectureGovernance -> transportAttestation "Defines product, operator-only, break-glass, legacy, and experimental transport classifications"
        architectureGovernance -> ifTraceProduct "Requires receipts for high-value proof, provenance, export, and control events"
        architectureGovernance -> observability "Requires drift/coherence tests, SLOs, and incident replay evidence"
        architectureGovernance -> ifCli "Makes if-cli the canonical command surface and keeps -h surfaces current"
        architectureGovernance -> roadmapR0 "Starts by freezing and classifying the current boundary"
        architectureGovernance -> r0TransportInventoryArtifact "Owns validator and freeze artifact"
        r0TransportInventoryArtifact -> transportAttestation "Defines current transport classes and product/operator boundaries"
        r0TransportInventoryArtifact -> sessionProvenance "Supplies transport_inventory_id input for R2 provenance"
        r0TransportInventoryArtifact -> ifCli "Freezes dot namespace and compatibility boundary for current module commands"
        roadmapR0 -> roadmapR0_5 "Feeds the real infrastructure baseline"
        roadmapR0 -> r0TransportInventoryArtifact "Produces validated inventory and R1 boundary contract"
        roadmapR0 -> ifCli "Inventories and smokes namespace-aware help surfaces"
        roadmapR0_5 -> roadmapR1 "Unlocks product transport contract on real runtime infrastructure"
        roadmapR0_5 -> authBroker "Stands up Google/OIDC auth broker baseline"
        roadmapR0_5 -> blackboardApiService "Stands up canonical idempotent HTTP write path"
        roadmapR0_5 -> appendOnlyEventStore "Stands up PostgreSQL RLS append-only event store"
        roadmapR0_5 -> eventSignatureIntegrityService "Adds policy-driven event signing or hash-binding to the baseline"
        roadmapR0_5 -> projectionWorker "Replaces renderer script with projection worker and outbox"
        roadmapR0_5 -> searchIndex "Stands up rebuildable Meilisearch projection"
        roadmapR0_5 -> circuitBreakerRegistry "Defines runtime circuit breakers before external pilots"
        roadmapR0_5 -> degradationPlaybook "Defines fail-closed and degraded-mode behavior"
        r0TransportInventoryArtifact -> roadmapR0_5 "Feeds baseline migration from current operator topology"
        r0TransportInventoryArtifact -> roadmapR1 "Feeds product transport contract and non-product exclusions"
        roadmapR1 -> roadmapR2 "Requires provenance for every product transport"
        roadmapR1 -> ifCli "Defines if-cli as current conceptual command surface"
        roadmapR2 -> roadmapR2_5 "Feeds load, isolation, and chaos validation"
        roadmapR2_5 -> tenantIsolationVerifier "Runs cross-tenant CI and production shadow probes"
        roadmapR2_5 -> observability "Requires projection lag, SLO, and incident evidence under load"
        roadmapR2_5 -> circuitBreakerRegistry "Chaos-tests projection-worker and dependency failure behavior"
        roadmapR2_5 -> roadmapR3 "Only validated runtime state feeds proof packet work"
        roadmapR3 -> roadmapR4 "Unlocks first hosted design-partner proof desk"
        roadmapR3 -> proofPacketService "Implements deterministic proof packet service and coherence verifier"
        roadmapR4 -> roadmapR5 "Creates the evidence and API basis for BYO harness adapters after runtime gates pass"
        roadmapR5 -> roadmapR6 "Unlocks enterprise secure SaaS posture"
        roadmapR0 -> chatRelay "Inventories current WebSocket live relay"
        roadmapR0 -> mcpHttpBridge "Inventories current local and SSH-wrapped MCP bridge"
        roadmapR0 -> martinLaptop "Inventories Martin WSL/Codex/Claude operator workstation"
        roadmapR0 -> mtl03Harness "Inventories remote internal harness host"
        roadmapR1 -> gateway "Defines one public ingress and API versioning boundary"
        roadmapR1 -> blackboardGovernanceEnsemble "Defines Blackboard as the public product surface instead of internal module taxonomy"
        roadmapR1 -> authBroker "Defines conventional SaaS auth as the customer entry path"
        roadmapR1 -> liveEventGateway "Defines WebSocket as subscription/progress/wake plane"
        roadmapR1 -> mcpToolGateway "Defines managed scoped MCP tool contract"
        roadmapR2 -> sessionProvenance "Implements canonical cross-device provenance"
        roadmapR2 -> authBroker "Binds issuer, client id, audience, scopes, expiry, replay handle, and authorization decision ids to durable events"
        roadmapR2 -> appendOnlyEventStore "Implements append-only tenant event truth"
        roadmapR2 -> currentStateProjections "Builds rebuildable current task/session/signal state"
        roadmapR2 -> searchIndex "Adds access-filtered Meilisearch projection for fast discovery"
        roadmapR2 -> indexingQueue "Adds backpressure, retry, dead-letter, and lag metrics for indexing"
        roadmapR2 -> transportAttestation "Implements transport classification and trust checks"
        roadmapR2 -> tenantRbac "Requires tenant/workspace/principal/agent policy decisions"
        roadmapR3 -> proofDeskService "Requires proof packet schema and confidence classes"
        roadmapR3 -> appendOnlyEventStore "Proof packets reference event ids and hash chains"
        roadmapR3 -> eventSignatureIntegrityService "Signs or hash-binds packet manifests, redactions, and high-value events"
        roadmapR3 -> claimBoundaryEngine "Classifies packet claims and blocks unsupported correctness claims"
        roadmapR3 -> currentStateProjections "Proof packets verify projections against event truth"
        roadmapR3 -> ifTraceProduct "Requires receipts for packets, exports, redactions, provenance batches, and high-value control events"
        roadmapR3 -> observability "Requires coherence tests and incident evidence"
        roadmapR4 -> proofDeskService "Ships hosted partner proof desk"
        roadmapR4 -> blackboardGovernanceEnsemble "Presents design-partner pilot as Blackboard Governance SaaS"
        roadmapR4 -> tenantIsolationVerifier "Hosted pilots require passing isolation probes"
        roadmapR4 -> observability "Hosted pilots require SLO dashboards and incident replay"
        roadmapR4 -> objectStore "Stores proof packets, reports, and redaction manifests"
        roadmapR5 -> adapterSdk "Ships BYO harness event contract and reference client"
        roadmapR5 -> authBroker "Ships OAuth-style service-account onboarding without SSH"
        roadmapR5 -> mcpToolGateway "Exposes least-privilege agent tools"
        roadmapR5 -> busService "Carries tenant-scoped adapter and live events"
        roadmapR6 -> customerVault "Adds customer-owned evidence option"
        roadmapR6 -> kmsVault "Adds tenant-scoped keys, signing keys, and scoped secrets"
        roadmapR6 -> authBroker "Adds enterprise SSO, revocation, token rotation, and managed MCP authorization posture"
        roadmapR6 -> dataLifecycleService "Adds retention, deletion, legal hold, export, and erasure controls"
        roadmapR6 -> apiVersioningContract "Maintains long-lived API stability and sunset policy"
        roadmapR6 -> degradationPlaybook "Requires documented graceful degradation for enterprise review"
        roadmapR6 -> observability "Adds SIEM/GRC export and incident replay"
        roadmapR6 -> projectionWorker "Adds large-tenant rebuild/backfill operations and load-test gates"
        roadmapR6 -> searchIndex "Adds scale-tested tenant search with rebuild and disaster recovery"
        roadmapR6 -> tenantRbac "Adds enterprise SSO/RBAC posture"
        roadmapR6 -> customerManager "Buyer gets secure proof desk, export, and governance posture"

        blackboardProofDesk -> blackboardGovernanceEnsemble "Migration mapping: current proof desk becomes one buyer-facing Blackboard product ensemble"
        blackboardProofDesk -> proofDeskService "Migration mapping: proof desk becomes multi-tenant service"
        blackboardWriter -> blackboardApiService "Migration mapping: CLI/MCP controlled writer becomes stateless idempotent HTTP write service"
        blackboardWriter -> adapterSdk "Migration mapping: controlled writer becomes versioned adapter/API"
        blackboardLedgers -> appendOnlyEventStore "Migration mapping: JSONL ledgers become immutable tenant-scoped event tables"
        blackboardLedgers -> eventSignatureIntegrityService "Migration mapping: event hash-chain and signature policy becomes explicit integrity service"
        blackboardRenderer -> currentStateProjections "Migration mapping: derived views become rebuildable projections"
        blackboardRenderer -> searchIndex "Migration mapping: search/read UX moves to rebuildable Meilisearch index"
        blackboardRenderer -> projectionWorker "Migration mapping: renderer script becomes projection worker and transactional outbox"
        proofPacketExporter -> objectStore "Migration mapping: proof packets stored under lifecycle policy"
        proofPacketExporter -> proofPacketService "Migration mapping: planned exporter becomes first-class deterministic proof packet service"
        proofPacketExporter -> claimBoundaryEngine "Migration mapping: confidence classes and non-claims become an explicit claim-boundary gate"
        accessLog -> observability "Migration mapping: proof access logs enter audit/SLO stack"
        ifCli -> mcpToolGateway "Migration mapping: current command surface targets managed scoped MCP/API surfaces"
        ifCli -> authBroker "Target: obtains short-lived scoped tokens through brokered human/device or service-account flow"
        rookRuntime -> mcpToolGateway "Migration mapping: hosted Rook uses scoped tool gateway"
        ifContext -> mcpToolGateway "Migration mapping: Context tools become scoped managed MCP tools"
        ifSwitchboard -> switchboardService "Migration mapping: Switchboard becomes optional managed coordination service"
        ifApi -> gateway "Migration mapping: API front door becomes managed gateway"
        ifApi -> authBroker "Migration mapping: API-domain OAuth routes become broker-managed callbacks and token flows"
        ifBus -> busService "Migration mapping: internal event backbone becomes managed stream service"
        chatRelay -> liveEventGateway "Migration mapping: `/chat/ws` becomes tenant-aware live event gateway"
        mcpHttpBridge -> mcpToolGateway "Migration mapping: local/SSH MCP bridges become managed scoped MCP tools"
        secretsBoundary -> kmsVault "Migration mapping: host secrets become KMS/Vault-backed scoped tokens"
        sessionProvenance -> proofDeskService "Target proof desk depends on canonical provenance service"
        transportAttestation -> sessionProvenance "Target transport checks feed canonical provenance"

        deploymentEnvironment "Current InfraFabric Topology" {
            deploymentNode "mtl-01" "Current Proxmox/product-control host for Rook sessions, Blackboard ledgers, renderers, switchboard/context front doors, edge publication, and operator tooling." "Proxmox host" {
                containerInstance blackboardProofDesk
                containerInstance blackboardWriter
                containerInstance blackboardLedgers
                containerInstance blackboardRenderer
                containerInstance chatRelay
                containerInstance ifCli
                containerInstance mcpHttpBridge
                containerInstance proofPacketExporter
                containerInstance rookRuntime
                containerInstance ifContext
                containerInstance ifSwitchboard
                containerInstance ifApi
                containerInstance ifBus
                containerInstance secretsBoundary
                containerInstance maintenanceBridgeHelper
            }
            deploymentNode "Public Review Edge" "Public/auditable static or app surfaces for receipts, proof desk views, and reviewer pages." "Caddy/static/app edge" {
                containerInstance tracePage
                containerInstance receiptStore
                containerInstance blackboardProofDesk
            }
            deploymentNode "Martin Laptop" "Windows/WSL operator machine receiving docs/artifacts through link bridge when open." "Windows + WSL" {
                containerInstance maintenanceBridgeHelper
            }
        }

        deploymentEnvironment "Target Production Topology" {
            deploymentNode "Edge Layer" "Globally distributed CDN and WAF; all customer traffic enters here." "Cloudflare / AWS CloudFront" {
                containerInstance gateway
            }
            deploymentNode "Auth Cluster" "Dedicated auth and tenant policy services with database isolation from the application tier." "2+ replicas, dedicated PostgreSQL" {
                containerInstance authBroker
                containerInstance tenantRbac
                containerInstance kmsVault
            }
            deploymentNode "Application Tier" "Stateless horizontally scaled application services across multiple availability zones." "Kubernetes / ECS, 3+ AZ" {
                containerInstance blackboardGovernanceEnsemble
                containerInstance proofDeskService
                containerInstance blackboardApiService
                containerInstance sessionProvenance
                containerInstance transportAttestation
                containerInstance mcpToolGateway
                containerInstance adapterSdk
                containerInstance proofPacketService
                containerInstance claimBoundaryEngine
                containerInstance eventSignatureIntegrityService
                containerInstance switchboardService
                containerInstance tenantIsolationVerifier
                containerInstance apiVersioningContract
                containerInstance dataLifecycleService
                containerInstance degradationPlaybook
                containerInstance circuitBreakerRegistry
            }
            deploymentNode "Live Event Tier" "Dedicated WebSocket and pub/sub fan-out infrastructure, separate from request/response APIs." "Dedicated node group + Redis pub/sub" {
                containerInstance liveEventGateway
                containerInstance busService
            }
            deploymentNode "Data Tier - Primary Region" "Primary database cluster for immutable events and rebuildable current-state tables." "PostgreSQL 16, 3-node HA, synchronous standby" {
                containerInstance managedLedgerDb
                containerInstance appendOnlyEventStore
                containerInstance currentStateProjections
            }
            deploymentNode "Data Tier - Search" "Rebuildable search cluster; never the proof authority." "Meilisearch 1.x" {
                containerInstance searchIndex
            }
            deploymentNode "Worker Tier" "Background processing for projections, indexing, rebuilds, and backfills." "Kubernetes jobs + Redis queues" {
                containerInstance projectionWorker
                containerInstance indexingQueue
            }
            deploymentNode "Object Storage" "Multi-region evidence and proof packet object storage." "S3 + DR replication" {
                containerInstance objectStore
                containerInstance customerVault
            }
            deploymentNode "Observability Cluster" "Dedicated observability plane separated from application runtime." "Separate account / VPC" {
                containerInstance observability
            }
            deploymentNode "Receipt Surface" "Public immutable receipt surface for if.trace artifacts." "Cloudflare Pages / static" {
                containerInstance tracePage
                containerInstance receiptStore
            }
        }
    }

    views {
        systemContext rookHarness "SystemContext" "Who uses the Rook harness stack, which external systems it touches, and where the proof desk sits." {
            include martin operator customerManager securityReviewer externalAgentDeveloper aiAgent customerSystems identityProvider aiModelProviders reviewerBrowser martinLaptop mtl03Harness ifTraceProduct rookHarness
            autoLayout lr
        }

        container rookHarness "CurrentContainers" "Current Rook harness stack with Blackboard as Module 1 plus Rook, Context, Switchboard, API, Bus, secrets boundary, and operator bridge." {
            include blackboardProofDesk blackboardWriter blackboardLedgers blackboardRenderer chatRelay ifCli mcpHttpBridge proofPacketExporter accessLog rookRuntime ifContext ifSwitchboard ifApi ifBus secretsBoundary maintenanceBridgeHelper ifTraceProduct customerSystems identityProvider aiModelProviders reviewerBrowser martinLaptop mtl03Harness
            autoLayout lr
        }

        component blackboardWriter "BlackboardWriterComponents" "Controlled Blackboard writer lanes for task, session, signal, checkpoint, and closeout operations." {
            include *
            autoLayout lr
        }

        component rookRuntime "RookHarnessComponents" "Rook bootstrap, arrival surfaces, five-lane gate, and air-gap policy." {
            include *
            autoLayout lr
        }

        component ifContext "ContextComponents" "Context bounded recall, read plans, derived artifacts, and memory lifecycle controls." {
            include *
            autoLayout lr
        }

        component ifSwitchboard "SwitchboardComponents" "Switchboard contact registry, wake/contact dispatcher, and retained inbox." {
            include *
            autoLayout lr
        }

        deployment rookHarness "Current InfraFabric Topology" "CurrentDeployment" "Current host deployment: mtl-01 product/control, public review edge, and Martin laptop maintenance bridge." {
            include *
            autoLayout lr
        }

        deployment target "Target Production Topology" "TargetProductionDeployment" "Production-grade target topology separating edge, auth, app, live event, data, search, worker, object storage, observability, and receipt planes." {
            include *
            autoLayout lr
        }

        container target "TargetSaaS" "Target Blackboard-first governance SaaS substrate for tenants, proof packets, BYO harness adapters, evidence storage, receipts, and observability." {
            include *
            autoLayout lr
        }

        container target "RationalizedBuyerRuntime" "Buyer-readable Blackboard Governance SaaS runtime: event truth to Proof Desk to Proof Packet v1, with signed or hash-bound updates and explicit claim boundaries." {
            include customerManager securityReviewer externalAgentDeveloper aiAgent reviewerBrowser identityProvider blackboardGovernanceEnsemble gateway authBroker tenantRbac blackboardApiService appendOnlyEventStore eventSignatureIntegrityService projectionWorker currentStateProjections searchIndex proofDeskService claimBoundaryEngine proofPacketService objectStore ifTraceProduct observability
            autoLayout lr
        }

        container target "AutoplanRoadmapGoal" "Roadmap goal R0-R6 with explicit R0.5 runtime baseline and R2.5 load/isolation validation before hosted design-partner SaaS." {
            include roadmapR0 roadmapR0_5 r0TransportInventoryArtifact roadmapR1 roadmapR2 roadmapR2_5 roadmapR3 roadmapR4 roadmapR5 roadmapR6 architectureGovernance blackboardGovernanceEnsemble gateway apiDomainAuthFoothold authBroker blackboardApiService proofDeskService liveEventGateway mcpToolGateway sessionProvenance transportAttestation adapterSdk appendOnlyEventStore eventSignatureIntegrityService projectionWorker currentStateProjections searchIndex indexingQueue proofPacketService claimBoundaryEngine tenantIsolationVerifier circuitBreakerRegistry dataLifecycleService apiVersioningContract degradationPlaybook ifTraceProduct customerVault kmsVault observability
            autoLayout lr
        }

        container target "ScaleSearchAppendOnlyStore" "Scale architecture for thousands of users: immutable PostgreSQL event truth, rebuildable projections, Meilisearch search cache, queue/backpressure, and proof hydration from authority." {
            include gateway authBroker blackboardApiService proofDeskService adapterSdk appendOnlyEventStore eventSignatureIntegrityService projectionWorker currentStateProjections searchIndex indexingQueue managedLedgerDb tenantRbac sessionProvenance transportAttestation claimBoundaryEngine observability ifTraceProduct objectStore circuitBreakerRegistry degradationPlaybook
            autoLayout lr
        }

        container target "EliteRuntimeHardening" "Elite SaaS runtime contracts added from review feedback: write service, hardened event store, projection/outbox, auth broker, isolation probes, first-class proof packets, SLOs, circuit breakers, lifecycle, versioning, degradation, and production topology." {
            include blackboardGovernanceEnsemble gateway blackboardApiService authBroker tenantRbac appendOnlyEventStore eventSignatureIntegrityService projectionWorker currentStateProjections searchIndex indexingQueue proofDeskService claimBoundaryEngine proofPacketService tenantIsolationVerifier observability circuitBreakerRegistry dataLifecycleService apiVersioningContract degradationPlaybook objectStore customerVault kmsVault ifTraceProduct
            autoLayout lr
        }

        container rookHarness "MigrationMapping" "Non-runtime migration map from current harness components to target SaaS substrate." {
            include blackboardProofDesk blackboardWriter blackboardLedgers blackboardRenderer chatRelay ifCli mcpHttpBridge proofPacketExporter accessLog rookRuntime ifContext ifSwitchboard ifApi ifBus secretsBoundary blackboardGovernanceEnsemble proofDeskService blackboardApiService adapterSdk managedLedgerDb appendOnlyEventStore eventSignatureIntegrityService projectionWorker currentStateProjections searchIndex indexingQueue objectStore observability mcpToolGateway proofPacketService claimBoundaryEngine switchboardService gateway apiDomainAuthFoothold authBroker liveEventGateway sessionProvenance transportAttestation architectureGovernance r0TransportInventoryArtifact roadmapR0 roadmapR0_5 roadmapR1 roadmapR2 roadmapR2_5 roadmapR3 roadmapR4 roadmapR5 roadmapR6 busService kmsVault tenantIsolationVerifier circuitBreakerRegistry dataLifecycleService apiVersioningContract degradationPlaybook
            autoLayout lr
        }

        dynamic rookHarness "AgentWorkToProofPacketFlow" "Current hosted Rook flow from agent work to Blackboard proof packet." {
            operator -> ifCli "Runs if-cli rook session-start"
            ifCli -> rookRuntime "Delegates to if.rook runtime helper"
            rookRuntime -> blackboardWriter "Requires active task and session bind"
            aiAgent -> ifContext "Requests bounded recall"
            aiAgent -> blackboardWriter "Writes checkpoint and evidence refs"
            rookRuntime -> ifSwitchboard "Uses wake/contact for coordination"
            ifSwitchboard -> blackboardWriter "Records durable signals"
            blackboardWriter -> blackboardLedgers "Appends task/session/signal/checkpoint events"
            blackboardLedgers -> blackboardRenderer "Renders derived views"
            proofPacketExporter -> blackboardLedgers "Builds task timeline"
            proofPacketExporter -> ifTraceProduct "Binds exported artifacts where receipts exist"
            blackboardProofDesk -> reviewerBrowser "Serves reviewer proof view"
            autoLayout lr
        }

        dynamic target "EventTruthToProofPacketV1Flow" "Rationalized Blackboard Governance SaaS flow: signed/hash-bound event truth to Proof Desk to Proof Packet v1 with explicit claim boundaries." {
            customerManager -> blackboardGovernanceEnsemble "Opens Blackboard Proof Desk workflow"
            aiAgent -> blackboardGovernanceEnsemble "Emits governed task/update/evidence event"
            blackboardGovernanceEnsemble -> gateway "Uses product HTTPS, MCP, or live-subscription boundary"
            gateway -> authBroker "Validates human, service-account, or agent token"
            gateway -> blackboardApiService "Routes versioned event write"
            blackboardApiService -> tenantRbac "Checks tenant, workspace, project, principal, agent, and scope"
            blackboardApiService -> eventSignatureIntegrityService "Signs or hash-binds accepted event according to policy"
            blackboardApiService -> appendOnlyEventStore "Appends immutable event with idempotency key"
            appendOnlyEventStore -> projectionWorker "Streams committed event"
            projectionWorker -> currentStateProjections "Updates rebuildable current state"
            projectionWorker -> searchIndex "Refreshes disposable search projection"
            proofDeskService -> searchIndex "Discovers relevant records"
            proofDeskService -> currentStateProjections "Builds reviewer timeline"
            proofDeskService -> claimBoundaryEngine "Asks what the timeline and packet may claim"
            claimBoundaryEngine -> appendOnlyEventStore "Checks event truth and access decisions"
            claimBoundaryEngine -> eventSignatureIntegrityService "Checks signatures, hash roots, and receipt bindings"
            securityReviewer -> blackboardGovernanceEnsemble "Reviews confidence, redaction, and non-claims"
            proofDeskService -> proofPacketService "Requests deterministic packet assembly"
            proofPacketService -> claimBoundaryEngine "Applies final claim-boundary decision"
            proofPacketService -> eventSignatureIntegrityService "Signs or hash-binds packet and manifests"
            proofPacketService -> objectStore "Publishes packet and redaction manifest"
            eventSignatureIntegrityService -> ifTraceProduct "Publishes receipt roots where policy requires"
            proofPacketService -> observability "Emits access, assembly, and coherence evidence"
            autoLayout lr
        }

        dynamic target "BYOHarnessAdapterFlow" "Target BYO harness adapter flow for external agent platforms." {
            externalAgentDeveloper -> adapterSdk "Implements event contract"
            aiAgent -> gateway "Sends scoped session/task/evidence events"
            gateway -> tenantRbac "Authenticates principal and agent"
            adapterSdk -> sessionProvenance "Binds tenant, principal, agent, host, client app, and transport"
            sessionProvenance -> transportAttestation "Classifies transport without trusting inbound headers"
            adapterSdk -> appendOnlyEventStore "Appends idempotent task/session/signal/evidence events"
            appendOnlyEventStore -> projectionWorker "Publishes committed events"
            projectionWorker -> currentStateProjections "Updates task/session/signal current state"
            projectionWorker -> indexingQueue "Queues redacted search documents"
            indexingQueue -> searchIndex "Indexes search projection"
            adapterSdk -> objectStore "Stores or references evidence"
            adapterSdk -> busService "Publishes scoped event"
            proofDeskService -> searchIndex "Finds tasks quickly, then hydrates from authority"
            proofDeskService -> currentStateProjections "Builds current proof timeline"
            proofDeskService -> appendOnlyEventStore "Verifies event ids and hash chain"
            proofDeskService -> claimBoundaryEngine "Labels verified, claimed, inferred, stale, missing, and non-claims"
            proofDeskService -> objectStore "Builds proof packet export"
            proofDeskService -> ifTraceProduct "Publishes receipt for export"
            autoLayout lr
        }

        dynamic target "SaaSAuthAndMCPOnboardingFlow" "Target enterprise SaaS auth flow: registered Google/OIDC callbacks, service-account tokens, managed MCP authorization, tenant/RBAC binding, and audit evidence." {
            customerManager -> gateway "Starts browser login or proof desk access"
            gateway -> authBroker "Handles login, callback, token validation, and revocation"
            authBroker -> identityProvider "Uses registered Google/OIDC/SAML redirect"
            identityProvider -> gateway "Returns assertion/callback through managed ingress"
            authBroker -> tenantRbac "Maps identity/client to tenant, workspace, project, roles, and scopes"
            authBroker -> appendOnlyEventStore "Records auth decision and token lifecycle event when policy requires"
            externalAgentDeveloper -> gateway "Registers service account or BYO harness client"
            gateway -> adapterSdk "Routes client onboarding to SDK/API contract"
            adapterSdk -> authBroker "Validates client/service-account token"
            aiAgent -> mcpToolGateway "Calls managed MCP tool with scoped token"
            mcpToolGateway -> authBroker "Validates bearer token, audience, expiry, replay handle, and tool scope"
            mcpToolGateway -> proofDeskService "Runs authorized Blackboard/Context/Switchboard operation"
            proofDeskService -> appendOnlyEventStore "Appends durable task/session/evidence/access event"
            proofDeskService -> observability "Emits access audit and authorization correlation id"
            autoLayout lr
        }

        dynamic target "ScaleSearchProjectionFlow" "Thousands-of-users search and proof flow: immutable events feed projections and Meilisearch, while proof reads hydrate from PostgreSQL authority." {
            gateway -> proofDeskService "Accepts tenant-scoped request/response write or search"
            proofDeskService -> appendOnlyEventStore "Appends immutable event"
            appendOnlyEventStore -> projectionWorker "Streams committed event"
            projectionWorker -> currentStateProjections "Updates rebuildable projection"
            projectionWorker -> indexingQueue "Enqueues redacted searchable document"
            indexingQueue -> searchIndex "Indexes asynchronously with retry/dead-letter"
            proofDeskService -> searchIndex "Searches disposable index"
            proofDeskService -> currentStateProjections "Hydrates visible current state"
            proofDeskService -> appendOnlyEventStore "Checks event truth before proof/export claims"
            proofDeskService -> observability "Emits projection/index lag and request audit"
            autoLayout lr
        }

        dynamic target "EliteRuntimeWriteToProofFlow" "Target hardened runtime flow: idempotent write, auth/RBAC, append-only event truth, projection/outbox, search hydration, proof packet coherence, receipt, and audit." {
            aiAgent -> gateway "Submits tenant-scoped write or MCP operation"
            gateway -> authBroker "Validates token and callback/session state"
            gateway -> blackboardApiService "Routes versioned Blackboard write request"
            blackboardApiService -> authBroker "Checks token lifecycle and replay"
            blackboardApiService -> tenantRbac "Checks tenant, project, principal, agent, and scope"
            blackboardApiService -> eventSignatureIntegrityService "Signs or hash-binds accepted event"
            blackboardApiService -> appendOnlyEventStore "Appends immutable event with idempotency key"
            appendOnlyEventStore -> projectionWorker "Streams event through logical replication"
            projectionWorker -> currentStateProjections "Updates guarded current-state projection"
            projectionWorker -> indexingQueue "Publishes redacted search document through outbox"
            indexingQueue -> searchIndex "Indexes rebuildable search projection"
            proofDeskService -> searchIndex "Discovers candidate records"
            proofDeskService -> appendOnlyEventStore "Hydrates and verifies event truth"
            proofDeskService -> claimBoundaryEngine "Checks allowed claims before review/export"
            proofDeskService -> proofPacketService "Requests deterministic packet assembly"
            proofPacketService -> currentStateProjections "Checks current state against event truth"
            proofPacketService -> claimBoundaryEngine "Applies confidence, redaction, non-claim, and correctness boundary rules"
            proofPacketService -> eventSignatureIntegrityService "Signs or hash-binds packet and redaction manifests"
            proofPacketService -> objectStore "Publishes packet and manifests"
            proofPacketService -> ifTraceProduct "Receipts packet and redaction manifest"
            proofPacketService -> observability "Emits coherence and access evidence"
            autoLayout lr
        }

        dynamic rookHarness "CurrentTransportTracebackFlow" "Current cross-device transport split: Blackboard request/response over MCP/HTTP or SSH wrappers, and WebSocket for live coordination fallback." {
            operator -> martinLaptop "Starts Codex/Claude wrappers or opens link"
            martinLaptop -> ifCli "Operator-only SSH wrapper invokes remote if-cli mcp if.*"
            ifCli -> mcpHttpBridge "Delegates to if.transport compatibility engine"
            mcpHttpBridge -> ifApi "Posts Blackboard/Context module calls"
            ifApi -> blackboardWriter "Routes governed Blackboard module call"
            martinLaptop -> chatRelay "May use `wss://infrafabric.io/chat/ws` for live coordination"
            chatRelay -> ifSwitchboard "Carries presence/wake/nudge style traffic"
            mtl03Harness -> ifSwitchboard "Uses local switchboard MCP server/processes"
            blackboardWriter -> blackboardLedgers "Appends durable task/session/signal events"
            proofPacketExporter -> ifTraceProduct "Receipts exported proof artifacts where policy requires"
            autoLayout lr
        }

        dynamic target "RationalizationOptimizationRoadmapFlow" "Roadmap from today's mixed operator/harness transports to a cleaner SaaS contract." {
            martin -> architectureGovernance "Sets product simplification priority"
            architectureGovernance -> blackboardGovernanceEnsemble "Collapses product story into Blackboard"
            architectureGovernance -> gateway "One public ingress and versioned API boundary"
            architectureGovernance -> proofDeskService "Blackboard request/response for search, writes, exports, and access logs"
            architectureGovernance -> eventSignatureIntegrityService "Requires signed or hash-bound event/update integrity"
            architectureGovernance -> claimBoundaryEngine "Requires product-visible claim boundaries"
            architectureGovernance -> liveEventGateway "WebSocket for subscriptions, wake/contact, progress, and shared UI"
            architectureGovernance -> mcpToolGateway "Managed scoped MCP tools instead of scattered wrappers"
            architectureGovernance -> sessionProvenance "Canonical cross-device provenance"
            architectureGovernance -> transportAttestation "Explicit product/operator/break-glass transport classes"
            architectureGovernance -> ifTraceProduct "Receipts high-value packets, provenance batches, exports, and control events"
            autoLayout lr
        }

        dynamic target "AutoplanRoadmapExecutionFlow" "Autoplan roadmap execution: roadmap and DSL are the goal source from current estate to enterprise secure SaaS." {
            martin -> roadmapR0 "Approves roadmap + DSL as goal source"
            roadmapR0 -> r0TransportInventoryArtifact "Freezes known current transport boundary"
            roadmapR0 -> roadmapR0_5 "Adds real runtime substrate before product claims"
            r0TransportInventoryArtifact -> roadmapR0_5 "Classified transports feed baseline migration"
            roadmapR0_5 -> blackboardApiService "Replaces CLI writer with service write path"
            roadmapR0_5 -> appendOnlyEventStore "Replaces JSONL truth with PostgreSQL RLS events"
            roadmapR0_5 -> eventSignatureIntegrityService "Adds policy-driven event signing/hash-binding"
            roadmapR0_5 -> projectionWorker "Replaces renderer script with projection/outbox"
            roadmapR0_5 -> roadmapR1 "Baseline unlocks product transport contract"
            roadmapR1 -> blackboardGovernanceEnsemble "Presents one buyer-facing Blackboard product"
            roadmapR1 -> roadmapR2 "Transport contract requires provenance"
            roadmapR1 -> authBroker "Customer auth becomes OIDC/OAuth brokered API/MCP, not SSH"
            roadmapR2 -> appendOnlyEventStore "Builds immutable event truth for thousands of users"
            roadmapR2 -> authBroker "Binds issuer/client/scope/decision ids into provenance"
            appendOnlyEventStore -> projectionWorker "Feeds rebuildable projections and search"
            projectionWorker -> searchIndex "Maintains Meilisearch as disposable UX index"
            roadmapR2 -> roadmapR2_5 "Requires load, isolation, and chaos validation"
            roadmapR2_5 -> tenantIsolationVerifier "Runs cross-tenant conformance probes"
            roadmapR2_5 -> circuitBreakerRegistry "Verifies failure thresholds and write-pausing behavior"
            roadmapR2_5 -> roadmapR3 "Validated runtime feeds proof packets and trace policy"
            roadmapR3 -> proofPacketService "Makes proof packet a first-class runtime object"
            roadmapR3 -> claimBoundaryEngine "Adds confidence, redaction, non-claim, and correctness boundaries"
            roadmapR3 -> eventSignatureIntegrityService "Signs/hash-binds packet and high-value proof artifacts"
            roadmapR3 -> roadmapR4 "Trace-bound packets unlock hosted proof desk pilot"
            roadmapR4 -> blackboardGovernanceEnsemble "Ships design-partner pilot as Blackboard Governance SaaS"
            roadmapR4 -> roadmapR5 "Pilot learning hardens BYO harness adapter"
            roadmapR5 -> authBroker "BYO harness uses service-account onboarding and short-lived tokens"
            roadmapR5 -> roadmapR6 "Adapter + controls unlock enterprise SaaS"
            roadmapR6 -> authBroker "Completes SSO, revocation, token rotation, and managed MCP authorization"
            roadmapR6 -> customerManager "Buyer gets secure proof desk, export, and governance posture"
            autoLayout lr
        }

        dynamic rookHarness "MaintenanceBridgeCopyFlow" "Operator-only flow for copying finished docs back to Martin laptop when link is open." {
            operator -> maintenanceBridgeHelper "Reads pasteable bridge context and local receipt"
            maintenanceBridgeHelper -> martinLaptop "Uses SSH tunnel on 127.0.0.1:22043"
            operator -> martinLaptop "Copies numbered docs to Windows Downloads path"
            blackboardWriter -> blackboardLedgers "Records copy verification in task closeout"
            autoLayout lr
        }

        styles {
            element "Person" {
                shape Person
                background #0b0c0c
                color #ffffff
            }
            element "External" {
                background #f3f2f1
                color #0b0c0c
                stroke #505a5f
            }
            element "Current" {
                background #ffffff
                color #0b0c0c
                stroke #1d70b8
            }
            element "Target" {
                background #e8f5e9
                color #0b0c0c
                stroke #00703c
            }
            element "Planned" {
                background #fff4d6
                color #0b0c0c
                stroke #b58800
            }
            element "Data Store" {
                background #fff7bf
                color #0b0c0c
                stroke #856404
                shape Cylinder
            }
            element "Control Plane" {
                background #eaf4fb
                color #0b0c0c
                stroke #1d70b8
            }
            element "API" {
                background #eaf4fb
                color #0b0c0c
                stroke #5694ca
            }
            element "Security" {
                background #f6d7d7
                color #0b0c0c
                stroke #942514
            }
            element "Evidence" {
                background #f3f2f1
                color #0b0c0c
                stroke #505a5f
            }
            element "Operator Tooling" {
                background #f0f4ff
                color #0b0c0c
                stroke #4c2c92
            }
            element "Roadmap" {
                background #fef7ff
                color #0b0c0c
                stroke #912b88
            }
            element "Software System" {
                background #1d70b8
                color #ffffff
            }
            element "Container" {
                background #ffffff
                color #0b0c0c
                stroke #1d70b8
            }
        }
    }
}
