Mnemose architecture and functional state review
Baseline review: 2026-10-04. Remediation review: 2026-10-05. Baseline: root e44887b, app-store
280a4f0b078ff2ebb34e3dfb22d832b7616643b8, plus the current website worktree.
Baseline verdict: Mnemose has substantial working application code, but the reviewed
Worker deployment path does not yet support the full claim of a bounded,
autonomous cloud-infrastructure operator. Several safety controls and successful
responses do not correspond to enforced restrictions or completed effects.
This supersedes the August 19 audit. That audit incorrectly describes the current pillar screens as entirely mocked: they now have real GraphQL/REST integrations, D1 persistence, and runtime components. The more serious remaining problems are behind those interfaces. A successful request, persisted configuration, or emitted event is not evidence that a cloud operation happened.
Scope and confidence
The review traced the console router and pillar views into the default Worker HTTP, queue, and scheduled entry points; GraphQL and REST authorization; agent, sandbox and kernel Durable Objects; cloud adapters; command/report handlers; vendored compute providers; MCP shims; persistence and release configuration. Evidence references point to the reviewed source, not to comments alone.
This is a broad source architecture review, not an exhaustive security audit or production certification. No deployed application was probed, no secret files were read, and no cloud configuration was changed. External Access policies, current deployed SHA, applied migrations, billing configuration and customer provider credentials remain unverified. Findings about public routes describe code-level exposure; an independently configured edge policy may reduce exposure but does not repair application authorization.
The machine-readable functional gap inventory retains 35 original findings: 10 P0, 20 P1, 4 P2, 1 P3. After this remediation, 10 are locally resolved, 22 mitigated, and 3 open. Each includes evidence, reachability, impact, disposition, concrete scope, dependencies and acceptance conditions. P0 denotes an engineering release blocker for the affected capability, not a measured vulnerability severity score.
Current remediation and remaining work
This session implemented application authorization, durable database command execution, truthful runtime failures and capability-aware console controls. These changes are locally verified source changes; the deployed SHA, resources and provider outcomes have not been verified. A resolved entry closes its scoped local fix or removal. A mitigated entry still has unmet original acceptance work. The inventory preserves baseline evidence and adds current remediation evidence; it never replaces an original acceptance contract with a weaker one.
| Area | Current behavior | Remaining acceptance work |
|---|---|---|
| Identity and private artifacts | Verified tenant/roles guard REST and DO proxies; agent ownership is unique and immutable; project grants stay scoped; R2 download capabilities validate exact key and expiry. | Rotate any shipped shared credential; verify production Access and bindings. Membership and suspension require further review. |
| Command execution | Registered ownership, environment, project-agent, invite and harness commands apply real D1 effects. Effect/history/log/outbox commit together; retries retain one event ID. | Provider, report, GraphQL app and kernel-session effect commands reject before enqueueing. Direct-write notification gaps and legacy projection durability remain. |
| Sandbox execution and controls | Missing backends and unknown tools fail. Policies use one strict shape; editors require an acknowledgment; live restrictions cannot silently report applied. CF teardown reconstructs a handle by durable ID. | Pinned CF SDK cannot enforce host/port egress; restricted provisioning fails. Dynamic Workers is disabled. Verify a supported backend and process-level network denial, crash reconciliation and actual teardown. |
| Agent review and tools | Durable run authority survives reconstruction; approval reevaluates policy and requires an administrator. Tools need executable bindings. An effect with no saved outcome is explicitly unknown and cannot be repeated automatically. | Reconcile indeterminate external effects manually. Complete desired nonbuiltin executors and policy parity through sandbox/MCP paths. |
| Console and keys | Unprobed app health is Unknown; fleet placeholder and unsupported controls are removed. Software AES-GCM retains versioned/legacy ciphertext across rotation and rejects another key’s ciphertext. | Installation/provider outcomes remain unproved. Automatic key rotation is unavailable; reconcile legacy rotation metadata. Software keys do not imply HSM custody; KV consistency and concurrent mutations require serialization. |
| Release and recurring work | Migrations precede Worker deployment; production identity is required; browser dev credentials are removed; smoke uses an Access token. Disconnected cron triggers and fake scheduler/workflow success are removed. | Smoke is still post-deploy. Rehearse staging promotion/rollback and configure Access variables, smoke secret and tenant. Implement real due jobs and TTL revocation before enabling recurrence. |
The three entries without a sufficient mitigation remain F26 (deployed WebSocket/subscription fan-out), F30 (kernel MCP shim contract), and F32 (subscription-to-agent recruitment). Cloud inventory, escalation, remediation, report generation and containment enforcement also remain unavailable or incomplete, even where their false-success paths are mitigated. The platform does not yet make good on the full autonomous cloud-operator claim.
The following detailed defect descriptions, claims matrix and console coverage record the October 4 baseline, not a claim that repaired code still behaves that way. Current state and residual work are in the table above and inventory.
Baseline release-blocking findings
- Public execution boundaries are incomplete (F02–F03). The Worker forwards sandbox requests without authentication. Sandbox HTTP methods omit the optional tenant check. Kernel requests select a DO using an unverified tenant header and expose enrollment, revocation and ACL mutation. Agent requests authenticate but select a DO solely by caller-provided agent ID; status, transcript, cancellation and approval handlers do not verify agent ownership or approver role.
- Development authentication is built into the release path (F01). CI embeds the shared dev credential into console assets and deploys the Pages production branch; the Worker deploy uses the default development environment. If this build has shipped, the credential must be treated as disclosed and rotated. The verified production JWT implementation itself is real; deployment bypasses its intended boundary.
- Authorization differs by transport and scope (F05–F07). REST checks a
userRoleproperty that authentication never returns, allowing missing roles through. Tenant-wide role resolution includes project-scoped grants. Project queries also retain PostgreSQL JSONB syntax that cannot execute on D1. - The command bus asserts outcomes without executing them (F08–F09). The deployed consumer writes a generic event derived from the command name and acknowledges the message. It does not invoke the domain dispatcher. Queue deduplication and publication are also not atomic or retry-safe. Direct-write CRUD and direct DO calls are exceptions; this is not a claim that every API is broken.
- Network controls are not an enforced contract (F14–F17). The CF Sandbox adapter discards its start specification. UI policy fields differ from the domain and DO formats; an airgap payload defaults to deny-all in the domain but allow-all in runtime normalization. The resolver returns success even if the live policy update fails. Command-text host detection does not constrain arbitrary processes.
- Private report downloads lack a code-level boundary (F04). The R2 proxy checks neither identity nor download capability. The adapter creates expiring tokens for a separate URL, but no corresponding token consumer was found.
Baseline claims versus implemented outcomes
| Claim or expectation | Current evidence | Assessment and required proof |
|---|---|---|
| Agent recruited at subscription creation | Subscription handler inserts tenant and event; runtime exists separately | Incomplete. Demonstrate subscription → tenant → delegated provider → configured agent → verified first job (F32). |
| Agent operates delegated cloud resources | Inventory/IAM handlers exist; deployed queue does not dispatch them; CF credential/IaaS adapters cannot implement GCP/AWS operations | Unsupported through reviewed queued path. Choose supported customer providers and prove an external effect (F08, F11). |
| Temporary elevated authority expires | Request/approval schemas and TTL records exist; grant handler can mark approved before provider success; scheduler is disconnected | Not established. Verify provider grant and durable revocation independently (F23, F34). |
| Tools respect operator policy | Permission matrix and evaluator exist; runtime uses separate harness rules; many attached tools lack executors | Partial. Test denial through every execution transport, including approval resume (F18–F19). |
| Sandboxes constrain execution | Real CF Sandbox adapter and tenant checks exist on some GraphQL paths | Partial and unsafe to assume universally. Close public proxy, policy application, simulation and lifecycle gaps (F02, F12–F17, F27). |
| Agent resumes safely after review | Pending approval is durable; sandbox pointer is in memory; resume drops run options | Incomplete. Evict the DO while paused, then resume with identical authority and configuration (F35). |
| Security scanning and remediation work | Remediation forms and job records exist; command paths are disconnected; security report summarizes job history | Not proof of scanning or remediation. Seed a finding, detect it through a supported provider, approve the change and verify external resolution. |
| Reports provide management evidence | Formatting/query code exists; cost report is a placeholder; queue and download paths are incomplete | Partial. Generate an actual requested-period report, verify bytes and authorization, handle failures and link expiry (F04, F24). |
| Activity can be reconstructed | Event IDs, transcripts and D1/DO persistence exist | Partial. Generic events, publication gaps and sandbox audit trimming to 100 entries prevent treating this as a complete durable audit trail (F09). |
| Realtime GraphQL/WS and MCP expose platform functionality | GraphQL is mounted; console uses graphql-ws; Worker lacks upgrade wiring; pubsub is isolate-local; MCP shims have unmatched contracts | Partial. Test deployed transport, replay and per-tool parity (F26, F30). |
| Recurring operations maintain the platform | Cron expressions are configured; handler compares symbolic names; inventory/report implementations remain incomplete | Broken through configured cron path (F34). |
The current marketing copy usefully labels the animation as illustrative and qualifies several containment claims. Preserve that honesty. Do not promote a qualified description into a stronger guarantee merely because its linked package exists.
Baseline console coverage and wiring/removal scope
The current router sends / and /dashboard to Studio, and /fleet to Sandboxes.
Old Dashboard and Fleet source files are not evidence of reachable deployed views.
The following assessment concerns current source wiring, not a live deployment
verification.
| Visible surface | What is real now | Remaining work |
|---|---|---|
| Studio workbench, transcript, live steps, HITL | Session/runtime requests, transcript display, model integration and pending approval handling | Bind ownership/approver authority; persist run context; bind advertised tool executors; prove completed external effects (F03, F18–F19, F35). |
| Models, routes, provider configuration and call/spend displays | GraphQL configuration, provider routing and telemetry paths | Retain. Verify configured provider credentials, error/fallback behavior and billing accuracy in staging; do not label configuration alone as provider health. |
| Sandbox list/create/terminal/files | GraphQL/DO creation, real execution adapter path and file APIs | Remove implicit simulation; expose backend capability limits, enforce policy and durable termination (F12–F17, F27–F28). |
| Sandbox Network Policy inspector | Mutation call exists | Replace stale egress/allow/deny/TLS fields with canonical supported policy; display applied state; remove unsupported controls (F15–F17). |
| Sandbox deception/data-source editors | Mutations and backend state exist | Check mutation errors, verify effective state and tripwire outcomes; never show Saved on rejected requests (F16). |
| Sandbox fleet tab | Explicit Coming soon placeholder | Remove until available, or scope a durable fleet lifecycle with per-member outcomes (F29). |
| Observability: traces, token charts, honeypot alerts | API reads and D1 persistence exist; August missing-pipeline conclusion is obsolete | Retain. Prove records survive isolate eviction and retention; test a real sandbox tripwire end to end. |
| Evaluations: launcher, runs, scorecards | Model/harness execution and D1-backed evaluation storage exist | Retain. Validate benchmark provenance, backend capability and run completeness; simulated sandbox success must not become evidence of real execution. |
| Store browse/install/detail/permissions | GraphQL catalog and database APIs exist; vendored modules mount at boot | App health is fabricated; queued lifecycle does not reach handler; REST catalog differs; policy editing is not execution enforcement (F08, F18, F20–F21). |
| Cloud projects and resource inventory | Database records, delegation/bootstrap requests and queries | Choose supported providers, restore actual dispatch and verified inventory; disable unsupported actions meanwhile (F08, F10–F11, F22). |
| IAM bindings and escalation | DB role records, request UI and role guards | Repair scope isolation/dialect; verify grant and TTL revocation rather than approval metadata (F06–F07, F23). |
| Provisioning and remediation | Real mutation/queue calls and job records | No completion claim until actual runner/provider execution is wired. The alternative dispatcher also skips ProvisionResource/RemediateFinding as out-of-process work; routing must be demonstrated (F08, F11). |
| Reports | Real buildReport mutation and job query | Wire dispatch/download; remove unsupported cost option or mark unavailable; distinguish remediation history from security posture (F04, F08, F24). |
| Encryption keys | UI and KMS resolvers exist | Missing inline adapter methods block operations; real CF KMS rotation also requires repair before adoption (F10, F25). |
| Tenants/users/ownership/settings | Direct database operations and query paths | Retain useful CRUD. Verify suspension enforcement, membership scope and transport parity; setting suspendedAt alone is not access revocation. |
| Installed SEO application | Vendored gateway mounting and database port exist | The source contains a mock SERP factory, but this review did not find a non-test call into that factory. Treat upstream ranking execution as unproven; do not label current UI data fabricated on that evidence alone. |
Input placeholders, fixture data inside tests, graph physics simulations and Cloudflare DO objects called “stubs” were excluded from the mock inventory.
Finding index
Detailed scopes and acceptance conditions are in the inventory.
| ID | Priority | Finding | Status | Evidence |
|---|---|---|---|---|
| F01 | P0 | Development credential embedded in production-branch console build | mitigated | .github/workflows/ci.yml:193 |
| F02 | P0 | Sandbox and kernel HTTP proxies bypass authentication | resolved | services/gateway/src/audit-authorization.test.ts:94 |
| F03 | P0 | Agent runtime proxy authenticates identity but does not bind agent ownership | resolved | services/gateway/src/do/agent-runtime-do.ts:294 |
| F04 | P0 | Report download proxy has no authorization or token validation | resolved | services/gateway/src/audit-authorization.test.ts:94 |
| F05 | P0 | REST tool and app role checks fail open | resolved | services/gateway/src/router/tools-apps.ts:26 |
| F06 | P0 | Project-scoped grants are treated as tenant-wide roles | resolved | services/gateway/src/auth/authorization.ts:40 |
| F07 | P1 | Project role queries use PostgreSQL syntax against SQLite | resolved | services/gateway/src/auth/authorization.ts:54 |
| F08 | P0 | Deployed queue consumer fabricates completion events instead of dispatching handlers | mitigated | services/gateway/src/command-dispatch.ts:5 |
| F09 | P1 | Queue writes and publication are not retry-safe | mitigated | services/gateway/src/audit-execution.test.ts:356 |
| F10 | P1 | Gateway platform object is an unsafe cast over incomplete adapters | mitigated | services/gateway/src/platform.ts:20 |
| F11 | P1 | Customer cloud inventory and IAM lack a functioning provider path | mitigated | services/commands/bootstrap-cloud-project/src/index.ts:37 |
| F12 | P1 | Sandbox and MicroVM fallbacks return simulated success | mitigated | packages/sandbox-execution/src/adapters/microvm.ts:41 |
| F13 | P1 | Unknown sandbox tools are echoed as successful execution | mitigated | services/gateway/src/do/sandbox-do.ts:1055 |
| F14 | P0 | Cloudflare Sandbox adapter discards the requested execution specification | mitigated | app-store/apps/cf-sandbox-provider/adapter.ts:56 |
| F15 | P0 | Network inspector sends a policy shape inconsistent with the domain and runtime | mitigated | packages/domain/src/schemas/sandbox.ts:130 |
| F16 | P1 | Policy editors display Saved without checking mutation errors | mitigated | apps/console/src/views/sandboxes/NetworkPolicyInspector.tsx:41 |
| F17 | P0 | Policy mutation reports success after live runtime update fails | mitigated | services/gateway/src/do/sandbox-do.ts:223 |
| F18 | P1 | Tool permission registry and runtime enforcement are disconnected | mitigated | services/gateway/src/do/agent-runtime-do.ts:717 |
| F19 | P1 | Attached non-builtin tools have no production runtime executor binding | mitigated | services/gateway/src/do/agent-runtime-do.ts:560 |
| F20 | P1 | App health is unconditionally healthy | resolved | services/gateway/src/schema/apps.ts:373 |
| F21 | P2 | REST app catalog returns hardcoded integration cards | mitigated | services/gateway/src/router/tools-apps.ts:28 |
| F22 | P1 | Organization bootstrap emits success with a placeholder service account | resolved | services/commands/bootstrap-organization/src/index.ts:43 |
| F23 | P1 | Escalation approval commits before grant and can emit an unperformed binding | mitigated | services/commands/approve-iam-escalation/src/index.ts:37 |
| F24 | P2 | Report content and delivery are incomplete | mitigated | services/gateway/src/command-dispatch.ts:18 |
| F25 | P1 | CF KMS rotation discards material required to decrypt older ciphertext | mitigated | packages/cloud-adapters/src/cf/kms.test.ts:59 |
| F26 | P1 | GraphQL subscription transport and event fan-out do not match deployment | open | baseline source |
| F27 | P1 | CF Sandbox cleanup depends on ephemeral adapter memory | mitigated | services/gateway/src/audit-execution.test.ts:127 |
| F28 | P1 | Dynamic Workers adapter ignores provided code and loses execution handles | mitigated | app-store/apps/dynamic-workers-provider/adapter.ts:1 |
| F29 | P3 | Fleet management tab is an explicit placeholder | resolved | apps/console/src/views/sandboxes/index.tsx:21 |
| F30 | P1 | Kernel MCP command shim uses an unmatched HTTP queue contract | open | baseline source |
| F31 | P1 | Release smoke checks run after deployment and do not establish external outcomes | mitigated | .github/workflows/ci.yml:233 |
| F32 | P2 | Subscription registration does not establish autonomous operator recruitment | open | baseline source |
| F33 | P2 | Architecture documentation conflates intended and deployed behavior | mitigated | docs/architecture.md:5 |
| F34 | P1 | Cron routing does not match configured expressions and jobs remain stubs | mitigated | wrangler.toml:143 |
| F35 | P1 | Approval resume loses tenant, harness, model and sandbox execution context | resolved | services/gateway/src/do/audit-agent-approval.test.ts:123 |
Architectural decisions required
One production execution path. Keep direct writes for ordinary configuration CRUD where ADR 0010 permits them. Use durable jobs for external effects. Each job needs a stable operation ID, validated input, explicit authorization, effect receipt, terminal state, retry policy and observable failure. Do not mechanically route everything through the older dispatcher: it has its own skipped operations and retry defects.
Separate hosting from customer providers. Cloudflare is the host platform; that does not implement customer AWS/GCP control planes. Host R2/KV/Queues adapters and customer cloud credentials/IaaS adapters need separate ownership and capability contracts. Either support a provider with end-to-end evidence or remove its active controls. The typed gateway composition now makes unsupported ports explicit; customer-provider contracts still need end-to-end proof.
One authorization boundary per actual operation. Reuse verified identity and role/scope decisions across GraphQL, REST, DO proxies and MCP. Never rely on a previous UI check, UUID secrecy, CORS, or an optional caller argument. Approval must bind an actor, tenant, exact action, policy revision and expiry, and must be revalidated when execution resumes.
Desired configuration is not effective state. This matters most for sandbox network/tool limits. Backends must declare supported capabilities, apply a parsed policy, acknowledge its revision and fail closed when required restrictions cannot be enforced. The UI should show requested, applying, effective or failed states.
Make unsupported behavior explicit. Unknown execution tools, unavailable providers, missing runners and unprobed health should produce unsupported, unavailable or unknown states. Production fallbacks must never manufacture a successful effect. Restrict simulation to explicit demo/test configurations.
Persist continuity, not just records. Durable storage of a transcript does not preserve run authority, execution handles or exactly-once effects. Persist run context and operation progress; use idempotent provider APIs and reconciliation. Use an outbox for database-to-queue boundaries rather than promising impossible atomicity across independent services.
Original acceptance backlog
| Order | Work package | Findings | Exit condition |
|---|---|---|---|
| 0 | Close exposed transport and identity boundaries | F01–F07 | Negative tests at exported Worker ingress pass for anonymous, viewer, roleless and cross-tenant actors; any shipped shared credential is rotated. |
| 1 | Make UI and runtime claims truthful | F12–F17, F20–F21, F29 | No implicit simulation, fake tool success, fake health, false Saved or unsupported safety controls. |
| 2 | Restore durable command execution | F08–F10, F22, F34 | Real handler dispatch, durable outcomes, retry/outbox proof, explicit unsupported operations and working cron routing. |
| 3 | Prove one supported cloud-operator workflow | F11, F23–F24, F32 | Recruit/configure agent, discover a seeded resource, authorize one change, verify effect, revoke authority, generate evidence. |
| 4 | Complete runtime and agent continuity | F18–F19, F25, F27–F28, F35 | Enforced tool policy, bound executors, restart-safe execution/termination and version-safe encryption. |
| 5 | Align transports, release gates and claims | F26, F30–F31, F33 | Deployed realtime/MCP parity; staging outcome tests gate promotion; capability documentation reflects proof. |
These are dependency-ordered scopes, not calendar estimates. Keep dangerous or unsupported features unavailable while their prerequisites are incomplete. The inventory gives each task a concrete acceptance contract so work can be delegated without equating “API wired” with “feature done.”
Validation and limitations
Remediation regression coverage exercises the exported Worker, real SQLite role rows and command transactions, publication failure/replay, batch rollback, versioned and legacy key material, unsupported adapters, UI mutation failures, and reconstructed approval context/receipts. All seven required monorepo gates passed: build, type-check, test, lint, docs:check, docs:lint and docs:governance. The full suite passed 2,121 tests with one skipped; lint reported zero errors and 661 warnings. Schema and compiled-doc drift checks, inventory/catalog validation and Worker dry-run packaging also passed. Website verification passed 15 state/motion tests, five content tests, three docs-theme output tests and desktop/mobile browser checks for passive input, finite transitions, reduced motion, WebGL fallback, search, navigation and theme switching. These are local proofs; actual external provider outcomes remain unverified.
The following diagnostic results describe the original baseline review.
The review ran the existing focused gateway suites for queue projections, authorization, CF Access, sandbox schema and tools/apps REST: 66 tests passed. That does not invalidate the findings: many tests use mocked fluent database results, call narrower entry points, or check accepted envelopes instead of external effects. The console anti-mock rule detects sample constants and selected useState seeds; it does not detect backend fabricated success.
Six temporary local diagnostic tests reproduced anonymous sandbox forwarding, header-selected kernel forwarding, unauthenticated report download, conflicting airgap normalization, failure to decrypt pre-rotation ciphertext, and cron non-dispatch. These exercised the actual exported Worker with synthetic bindings, the policy normalizer/domain schema and CF KMS. A separate SQLite execution confirmed that the project-scope JSONB expression fails. The temporary tests were removed from the normal suite because assertions expecting defects must not become acceptance tests that preserve those defects.
These are local reproductions, not attacks against deployed infrastructure. Synthetic bindings prove dispatch and missing guards, not actual customer data exposure. The inventory source-reference validator passes. The baseline review itself did not modify production behavior. The subsequent remediation changes runtime behavior and adds committed regression tests.
Required closure proof must include:
- Authentication, tenant isolation and role enforcement at every deployed ingress.
- Real D1 SQL for scoped authorization and migrations, not fluent mocks alone.
- Queue redelivery/crash injection around each persistence and publish boundary.
- A provider effect independently read back after an accepted command.
- Sandbox network denial using arbitrary processes, not only a curl string check.
- DO eviction between provision/execute/terminate and pause/approve/resume.
- Report bytes, provenance, tenant access and download expiry.
- Realtime producer/consumer separation and reconnection.
Observe operation ID, tenant, actor, backend, policy revision, requested/applied state, attempt count, provider receipt and terminal error throughout each run. Alert on missing backend, policy-apply failure, queue age/DLQ, stuck jobs, revocation overdue, orphan sandbox and cron dispatch failure. Do not log credential values or raw sensitive payloads to obtain this evidence.
Further review remains necessary for production Access configuration, complete membership/suspension enforcement, customer provider credentials, billing entitlements, model cost reconciliation, memory/vector tenant isolation, prompt/tool data exfiltration, retention/deletion and backup restoration. No claim of platform-wide production readiness is made by this review.