{
  "$schema": "./sandbox-v1-evaluation-plan.schema.json",
  "plan_version": 1,
  "generated_from": {
    "release_notes": "docs/releases/V1-RELEASE-NOTES.md",
    "release_notes_commit": "673b1cdc",
    "guideline": {
      "normative": "docs/plans/sandbox-v1-cutover-contracts.md",
      "adr_log": "docs/plans/sandbox-v1-decisions.md",
      "reference": "docs/plans/sandbox-v1-scaffold.md",
      "source_ref": "vendored from branch docs/sandbox-v1-cutover-contracts @ f7e7a18d (issue #489, closed 2026-10-26); canonical on the v1-sandbox track until the develop integration PR (ADR-SV1-010) merges",
      "skills": [
        "sandbox-next",
        "sandbox-migrate-to-next"
      ],
      "invariants": {
        "C1": "Migration is staging-only, gated by the trusted WORKER_PLATFORM binding.",
        "C2": "The reserved `client` slug is migrate-only excluded.",
        "C3": "One bounded phase per delivery; continuation is written before ack; expectedPhase is a hint.",
        "C4": "Per-tenant R2 lease: create-only acquire, etag-CAS takeover, owner-scoped release, fail closed.",
        "C5": "Write-ahead conversion intent is the point of no return; no automatic legacy fallback.",
        "C6": "Absent != unknown; only an explicit absent state permits pre-write behavior.",
        "C7": "The SandboxV1 DO owns the v1 conversion and its restore; the Worker never runs them in a request context.",
        "C8": "Verify = stable pointer equals the committed record AND a real readiness probe.",
        "C9": "The reaper is enqueue-only and never addresses a container.",
        "C10": "Canonical tenant identity comes only from trusted Worker env (tenantSlugFromEnv)."
      }
    }
  },
  "branch": {
    "name": "v1-sandbox",
    "base": "origin/develop",
    "base_commit": "07312136",
    "worktree": "/home/varo/development/elixir/phoenix/fouria-v1-sandbox",
    "independent_track": true,
    "strategy": "Long-lived migration track. Never merge into develop from this branch. Merge origin/develop into v1-sandbox at least once per milestone and before every staging deploy; resolve conflicts in favour of develop for non-migration code.",
    "sync_command": "bun run plan:sandbox-v1:sync",
    "changeset": "Every PR to v1-sandbox carries a changeset (`bun run changeset`, or `--empty` for docs/CI/tests)."
  },
  "staging": {
    "lerma_client": {
      "slug": "client-sandbox-v1",
      "id": 20,
      "instances": 2
    },
    "hostnames": {
      "dev": "staging-client-sandbox-v1-dev.fouria.io",
      "production": "staging-client-sandbox-v1.fouria.io"
    },
    "reserved_client_slug": "client",
    "authority": "WORKER_PLATFORM === \"staging\" (trusted binding, contract C1)",
    "note": "Hostnames are derived from the staging platform + environment axes; resolve the two instances from Lerma before running a milestone. The reserved `client` slug never migrates (contract C2)."
  },
  "domains": [
    {
      "id": "openclaw-management",
      "label": "OpenClaw Management",
      "purpose": "Tenant runtime, gateway lifecycle, agents, channels, automation, knowledge, tooling, provisioning and release."
    },
    {
      "id": "persistence",
      "label": "Persistence",
      "purpose": "Conversion, snapshots, restore, retention, recovery points, durable jobs and queue coordination."
    },
    {
      "id": "billing",
      "label": "Billing",
      "purpose": "Billable-action emission, credits/plans/freeze semantics, cost observability and development expense."
    },
    {
      "id": "security",
      "label": "Security",
      "purpose": "Edge authentication, identity, tenant isolation, secrets, no-content boundary, owner operations and audit."
    }
  ],
  "protocol": {
    "description": "Every milestone executes the same five steps, in order. A milestone is not complete until step 5 has produced an observation record.",
    "steps": [
      {
        "step": 1,
        "id": "prerequisites",
        "action": "Read the milestone prerequisites, apply the find/replace map, and record the expected result before touching code.",
        "required_output": "prerequisites.md section in the milestone PR (read list, find/replace table, expected result)."
      },
      {
        "step": 2,
        "id": "e2e_suitability",
        "action": "Evaluate whether the current E2E suites are suitable for the v1 runtime; classify each as suitable, partial or unsuitable and list the gap.",
        "required_output": "e2e-suitability.md section with verdict, existing suites, gaps and required new tests."
      },
      {
        "step": 3,
        "id": "execute",
        "action": "Implement the migration slice according to the contract, the new e2e suite and the updated docs. TDD: red test first.",
        "required_output": "One PR per slice (S1..S7), <=600 production LOC, changeset, docs updated."
      },
      {
        "step": 4,
        "id": "verify",
        "action": "Verify with the milestone e2e suite plus the mandatory repository checks. No milestone advances on a skipped test.",
        "required_output": "Green CI + local e2e log attached to the PR."
      },
      {
        "step": 5,
        "id": "staging",
        "action": "Deploy to the staging client `client-sandbox-v1` (id 20), observe the listed logs/metrics for the observation window, and record the result.",
        "required_output": "staging-observation.md with deploy id, commit, instance slugs, log queries, metrics and abort/keep decision."
      }
    ],
    "definition_of_done": [
      "All invariants owned by the milestone have a behavior-backed proof (not a grep assertion).",
      "The milestone feature list is fully covered by the e2e suite or explicitly recorded as a known gap.",
      "No legacy path is reachable after the conversion intent is present (C5).",
      "The staging observation window produced no unexplained error, restart loop, or data-loss signal.",
      "Docs and business-rules corpus are updated in the same PR."
    ]
  },
  "milestones": [
    {
      "id": "M0",
      "domain": null,
      "title": "Migration control plane and staging lane",
      "slices": [
        "S0"
      ],
      "invariants": [
        "C1",
        "C2",
        "C3",
        "C4",
        "C5",
        "C6",
        "C7",
        "C8",
        "C9",
        "C10"
      ],
      "prerequisites": {
        "read": [
          "docs/plans/sandbox-v1-cutover-contracts.md (all invariants)",
          "docs/plans/sandbox-v1-decisions.md (ADR-SV1-001..009)",
          "docs/plans/sandbox-v1-scaffold.md (remaining blockers 1-5)",
          "docs/releases/V1-RELEASE-NOTES.md sections 4, 8, 9 and 12",
          "docs/TESTING.md (cloud/local e2e, backup suite, UI suite)",
          "docs/ENV-VARIABLES.md (SANDBOX_RUNTIME, WORKER_PLATFORM)",
          "apps/fouria/docs/WORKER-DEVELOPMENT.md (runtime selector, sandbox DO)"
        ],
        "find_replace": [
          {
            "file": "scripts/sync-v1-sandbox.sh",
            "find": "(missing)",
            "replace": "Add the develop -> v1-sandbox sync script (fetch + merge, fail closed on conflicts)."
          },
          {
            "file": ".github/workflows/staging-validation.yml",
            "find": "github.ref_name == 'sandbox-v1-validation'",
            "replace": "Replace the hardcoded guard with the validation_branch input (github.ref_name == inputs.validation_branch); the publisher requires VALIDATION_BRANCH and no longer hardcodes a branch."
          },
          {
            "file": "package.json",
            "find": "(missing plan scripts)",
            "replace": "Add plan:sandbox-v1, plan:sandbox-v1:check and plan:sandbox-v1:sync scripts."
          }
        ],
        "expected_result": "v1-sandbox worktree is clean and independent; sync is one command; the staging lane can publish and promote only to client-sandbox-v1; the evaluation plan validates against its schema; a baseline run of the existing suites is recorded."
      },
      "e2e_suitability": {
        "verdict": "unsuitable",
        "existing": [
          "apps/fouria/test/e2e/** (41 cloud/local cctr files)",
          "apps/fouria/test/e2e-backup/** (6 backup scenarios)",
          "apps/fouria/test/business-rules/** (15 corpora)",
          "apps/fouria/test/ui/** (Playwright, mocked API)",
          "apps/lerma/test/** (provisioning, billing, observability)"
        ],
        "gaps": [
          "No v1 runtime selection scenario; the existing suites assume the legacy Sandbox class.",
          "No conversion-intent, lease, reaper or queue-topology coverage.",
          "No v1 backup/restore scenario (DirectoryBackup records).",
          "No staging lane restricted to v1-sandbox + client-sandbox-v1."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/00_runtime_selection.txt",
          "apps/fouria/test/e2e-v1/_setup.txt and _teardown.txt",
          "apps/fouria/test/business-rules/sandbox-v1-cutover.txt",
          "A baseline artifact recording the develop suites and their pass/fail state."
        ]
      },
      "execute": {
        "docs": [
          "docs/plans/sandbox-v1-evaluation-plan.md",
          "docs/TESTING.md",
          "docs/ENV-VARIABLES.md"
        ],
        "steps": [
          "Create the worktree and branch from origin/develop (done).",
          "Add the sync script and document the merge cadence.",
          "Clone the frozen staging-validation lane into a v1-sandbox lane; never edit the frozen lane.",
          "Resolve the two client-sandbox-v1 instances in Lerma and record their hostnames.",
          "Run the baseline suites and store the artifact."
        ]
      },
      "verify": {
        "commands": [
          "bun scripts/validate-sandbox-v1-plan.mjs",
          "bun run format:check && bun run lint && bun run typecheck && bun run test",
          "cctr apps/fouria/test/business-rules/"
        ],
        "acceptance": [
          "The plan validates: 166 implemented features, each assigned exactly once.",
          "The sync script merges origin/develop without touching develop.",
          "A validate-only staging dispatch reaches the read-only preflight and performs no POST."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20), both instances",
        "deploy": [
          "Dispatch the v1-sandbox staging lane with a blank confirm_target (read-only preflight).",
          "Resolve and record the dev and production instance slugs, versions and health."
        ],
        "observe": [
          "Lerma instance page: both instances present, version, status.",
          "Workers Observability: no new errors attributable to the lane.",
          "Tenant /api/health and /healthz baseline snapshots."
        ],
        "abort_criteria": [
          "Any request to the reserved `client` slug.",
          "Any production host or non-staging WORKER_PLATFORM.",
          "Any mutation during a validate-only dispatch."
        ]
      },
      "features": []
    },
    {
      "id": "SEC-1",
      "domain": "security",
      "title": "Authority, identity and platform gate",
      "slices": [
        "S1"
      ],
      "invariants": [
        "C1",
        "C2",
        "C10"
      ],
      "prerequisites": {
        "read": [
          "contract C1, C2, C10",
          "apps/fouria/src/sandbox-tenant.ts and sandbox-tenant.test.ts",
          "apps/fouria/src/sandbox-runtime.ts and sandbox-contract.ts",
          "apps/fouria/src/index.ts (/control action switch)",
          "workers/fouria-dispatch/src/** (tenant resolution and route gate)",
          "apps/lerma/lib/lerma/provisioning/tenant_provisioner.ex (resource vars)",
          "apps/fouria/wrangler.jsonc (vars, migrations, bindings)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/sandbox-runtime.ts",
            "find": "ACTIVE_SANDBOX_RUNTIME = 'legacy' / pending guard",
            "replace": "Select v1 from the per-tenant conversion intent, never from the hostname, DEV_MODE, SANDBOX_RUNTIME or an X-FourIA-* header."
          },
          {
            "file": "apps/fouria/src/sandbox-tenant.ts",
            "find": "sanitizeCustomerSlug does not reject 'default'",
            "replace": "Reject 'default' in the shared sanitizer so CUSTOMER_SLUG, WORKER_NAME and WORKER_URL all inherit it."
          },
          {
            "file": "apps/fouria/src/index.ts",
            "find": "/control action switch without a migrate action",
            "replace": "Add the migrate action with canMigrate(env) (WORKER_PLATFORM === staging) and the reserved `client` refusal; do not short-circuit identity resolution."
          },
          {
            "file": "apps/lerma/lib/lerma/provisioning/tenant_provisioner.ex",
            "find": "tenant vars without WORKER_PLATFORM / cutover flag",
            "replace": "Provision WORKER_PLATFORM (trusted, non-secret) and SANDBOX_V1_CUTOVER (default off) for every tenant; staging only may migrate."
          }
        ],
        "expected_result": "A migrate request outside staging, or for `client`, is refused before any write/lease/DO/container addressing. A null tenant slug refuses read/addressing/enqueue. Unselected tenants stay byte-identically on legacy."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/business-rules/rbac.txt",
          "apps/fouria/test/business-rules/tenant-isolation.txt",
          "apps/fouria/test/e2e/a_rbac_*.txt",
          "apps/fouria/test/e2e/provision_and_dispatch.txt",
          "apps/lerma/test/lerma/cloudflare/access_policy_test.exs"
        ],
        "gaps": [
          "No WORKER_PLATFORM gate test (absent/empty/whitespace/production/dev/STAGING).",
          "No reserved `client` migrate refusal test that also proves freeze/backup still work.",
          "No `default` slug case for CUSTOMER_SLUG or WORKER_URL.",
          "No observed-refusal assertion (no R2 write, no DO call)."
        ],
        "required": [
          "apps/fouria/src/sandbox-migration/platform.test.ts",
          "apps/fouria/src/sandbox-tenant.test.ts (default cases)",
          "apps/fouria/test/business-rules/sandbox-v1-cutover.txt",
          "apps/fouria/test/e2e-v1/00_runtime_selection.txt"
        ]
      },
      "execute": {
        "docs": [
          "docs/plans/sandbox-v1-cutover-contracts.md (C1, C2, C10)",
          "docs/ENV-VARIABLES.md"
        ],
        "steps": [
          "Write the red tests for the platform gate, reserved slug and default slug.",
          "Add canMigrate(env) and wire both the /control entry and the DO-side handler to it.",
          "Extend the shared slug sanitizer and add the CUSTOMER_SLUG/WORKER_URL cases.",
          "Provision WORKER_PLATFORM and the cutover flag from Lerma."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- sandbox-migration/platform sandbox-tenant sandbox-runtime",
          "cctr apps/fouria/test/business-rules/sandbox-v1-cutover.txt",
          "bun run typecheck && bun run lint && bun run format:check"
        ],
        "acceptance": [
          "Absent/empty/whitespace/production/dev/STAGING all refuse migrate with no write.",
          "Host: staging-<slug> and X-FourIA-Role: root do not enable migration.",
          "`client` refuses migrate only; freeze/unfreeze/backup/checkpoint keep their status and effects.",
          "Every resolver branch returns null for `default` and the refusal is observed."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance only",
        "deploy": [
          "Publish the S1 bundle/image from v1-sandbox and promote the dev instance only.",
          "Keep SANDBOX_V1_CUTOVER off for the production instance."
        ],
        "observe": [
          "Worker log: sandbox.migration.refused with reason platform-not-staging / reserved-client / slug-unresolved.",
          "No R2 write and no SandboxV1 DO request for a refused migrate.",
          "Freeze/backup still succeed on the dev instance."
        ],
        "abort_criteria": [
          "Any migrate accepted outside staging or for `client`.",
          "Any legacy tenant behavior change while the cutover flag is off."
        ]
      },
      "features": [
        "C-02",
        "C-03",
        "C-05",
        "O-01",
        "O-02",
        "O-05",
        "O-20",
        "O-27",
        "O-28",
        "O-29",
        "O-30",
        "O-31",
        "O-69",
        "O-70",
        "O-86",
        "O-87",
        "O-88",
        "O-93",
        "O-98"
      ]
    },
    {
      "id": "SEC-2",
      "domain": "security",
      "title": "Isolation, secrets and the no-content boundary",
      "slices": [
        "S1",
        "S2",
        "S3"
      ],
      "invariants": [
        "C6",
        "C10"
      ],
      "prerequisites": {
        "read": [
          "contract C6, C10",
          "apps/fouria/src/sandbox-tenant.ts and the sandbox-* bridges",
          "apps/fouria/src/auth/** (JWT, JWKS, middleware, RBAC)",
          "apps/fouria/src/utils/logging.ts (safeHeaderLog)",
          "apps/fouria/src/gateway/env.ts and secrets.ts",
          "docs/plans/r2-encryption-at-rest.md"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/sandbox-v1.ts",
            "find": "no outboundByHost bridge registration",
            "replace": "Register leads/docs/software/otel/cdp outbound handlers on the v1 DO using tenantSlugFromEnv, never ctx.containerId."
          },
          {
            "file": "apps/fouria/src/sandbox-*-bridge.ts",
            "find": "ctx.containerId-derived tenant scope",
            "replace": "Resolve the tenant from trusted env; return a structured 503/500 instead of resetting the socket."
          },
          {
            "file": "apps/fouria/src/gateway/env.ts",
            "find": "container env built for the legacy launch",
            "replace": "Keep the same env contract for the v1 launch; never place BACKUP_ENCRYPTION_KEY or provider credentials in container env."
          }
        ],
        "expected_result": "No bridge can cross tenants; unreadable bindings fail closed with structured JSON; logs remain metadata-only; secrets never enter config files or container env beyond the documented launch contract."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/a_rbac_*.txt",
          "apps/fouria/test/e2e/k_secrets_store.txt",
          "apps/fouria/test/e2e/o_leads_proxy.txt",
          "apps/fouria/test/e2e/ad_observability_canary.txt",
          "apps/fouria/test/business-rules/tenant-isolation.txt",
          "apps/fouria/test/business-rules/secrets-r2-storage.txt"
        ],
        "gaps": [
          "No v1 outbound bridge test (tenant scoping, unreadable binding, ECONNRESET).",
          "No assertion that the v1 DO does not use ctx.containerId as tenant identity.",
          "No v1 CDP/OTLP/software bridge routing test."
        ],
        "required": [
          "apps/fouria/src/sandbox-v1-outbound.test.ts",
          "apps/fouria/src/sandbox-*-bridge.test.ts (v1 variants)",
          "apps/fouria/test/e2e-v1/04_channels_and_rpc_ws.txt"
        ]
      },
      "execute": {
        "docs": [
          "docs/plans/sandbox-v1-cutover-contracts.md (C6, C10)",
          "docs/ENV-VARIABLES.md",
          "docs/TESTING.md"
        ],
        "steps": [
          "Write red tests for bridge tenant scoping and fail-closed bindings.",
          "Register the v1 outbound handlers and route every bridge through tenantSlugFromEnv.",
          "Verify the secrets contract on the v1 launch path.",
          "Add the no-content assertions to the observability suite."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- sandbox-v1-outbound sandbox-leads-bridge sandbox-docs-bridge sandbox-otel-bridge sandbox-cdp-bridge",
          "cctr apps/fouria/test/business-rules/tenant-isolation.txt",
          "bun run --cwd apps/fouria test:ui"
        ],
        "acceptance": [
          "A sandbox path can only reach its own <slug>/ prefix.",
          "An unreadable R2 binding returns structured JSON, not ECONNRESET.",
          "No credential appears in logs, config includes or container env."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance with the v1 bridges enabled."
        ],
        "observe": [
          "Bridge requests resolve to client-sandbox-v1, never openclaw/default.",
          "No ECONNRESET or unhandled bridge exception in Workers Logs.",
          "No secret value in the log stream (spot-check the redaction allowlist)."
        ],
        "abort_criteria": [
          "Any cross-tenant path resolution.",
          "Any credential in a log line or config file.",
          "Any bridge 500 storm."
        ]
      },
      "features": [
        "C-01",
        "C-10",
        "C-22",
        "C-36",
        "C-76",
        "O-12",
        "O-21",
        "O-24",
        "O-55",
        "O-57",
        "O-66",
        "O-89",
        "O-90",
        "O-91",
        "O-92",
        "O-95",
        "O-96"
      ]
    },
    {
      "id": "SEC-3",
      "domain": "security",
      "title": "Owner operations, audit and rollout park",
      "slices": [
        "S4",
        "S6"
      ],
      "invariants": [
        "C5",
        "C7",
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C5, C7, C8",
          "apps/fouria/src/tenant-park.ts and maintenance.ts",
          "apps/fouria/src/gateway/process.ts (stopGateway, freeze)",
          "apps/fouria/src/gateway/session-drain.ts",
          "apps/lerma/lib/lerma/provisioning/** (@upgrade_pipeline)",
          "apps/fouria/docs/OPERATOR-GUIDE.md section 2.5"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/gateway/process.ts",
            "find": "stopGateway that destroys or recreates the container",
            "replace": "Make stopGateway process-scoped only: no destroy, no recreate, no durable-storage write."
          },
          {
            "file": "apps/fouria/src/tenant-park.ts",
            "find": "park/resume assumes the legacy container",
            "replace": "Park/resume on v1: drain, snapshot, write-block, replace, resume, restore session modes."
          },
          {
            "file": "apps/fouria/src/persistence.ts",
            "find": "freeze/backup/checkpoint do not consult the conversion intent",
            "replace": "Refuse legacy after the point of no return; abort is operator-driven and audited."
          }
        ],
        "expected_result": "stopGateway leaves the container addressable; park blocks writes and resume restores service; freeze/backup/checkpoint refuse legacy after intent; the operator surface reports pointer, record validation and readiness as distinct fields."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/ac_gateway_startup_concurrency.txt",
          "apps/fouria/test/e2e/zz_gateway_hard_restart.txt",
          "apps/fouria/test/e2e/a_rbac_root_isolation.txt",
          "apps/fouria/test/e2e-backup/zzz_persistence_lifecycle.txt",
          "apps/fouria/test/business-rules/operational-modes.txt",
          "apps/lerma/test/lerma/cloudflare/containers_test.exs"
        ],
        "gaps": [
          "No v1 stopGateway assertion (no destroy, container still addressable).",
          "No v1 park/resume test with session-mode restore.",
          "No operator surface test for pointer vs readiness."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/05_freeze_and_control.txt",
          "apps/fouria/test/e2e-v1/07_canary_gates.txt",
          "apps/lerma/test/lerma_web/live/instance_live_test.exs (v1 status fields)"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/OPERATOR-GUIDE.md",
          "docs/plans/sandbox-v1-cutover-contracts.md (C5, C7, C8)"
        ],
        "steps": [
          "Write the red stopGateway/park tests.",
          "Make stopGateway process-scoped and park/resume v1-aware.",
          "Gate freeze/backup/checkpoint on the conversion intent.",
          "Expose pointer, record validation and readiness separately in Lerma."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- tenant-park session-drain maintenance gateway/process",
          "bun run --cwd apps/fouria test:e2e:backup",
          "mix test apps/lerma/test/lerma_web/live/instance_live_test.exs"
        ],
        "acceptance": [
          "stopGateway performs no destroy and leaves the container addressable.",
          "Park refuses mutating admin/debug requests with 409 TENANT_PARKED; reads stay available.",
          "Resume restores service and the recorded session modes.",
          "A failed park un-arms the write lock and restores service."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev, then production instance",
        "deploy": [
          "Promote the dev instance; run a park/resume drill.",
          "Only after the drill passes, promote the production instance."
        ],
        "observe": [
          "Lerma upgrade run: checkpoint-park -> dispatch_deploy -> resume, no skipped park.",
          "Tenant log: sessionsDrained, parked, resumed; no duplicate gateway owner.",
          "Telegram parked notice delivered once per message (if a bot is configured)."
        ],
        "abort_criteria": [
          "A park that destroys or replaces the container.",
          "A resume that does not restore readiness.",
          "Any write accepted while parked."
        ]
      },
      "features": [
        "C-75",
        "O-09",
        "O-32",
        "O-33",
        "O-63",
        "O-94"
      ]
    },
    {
      "id": "PER-1",
      "domain": "persistence",
      "title": "Conversion intent and legacy data migration",
      "slices": [
        "S2"
      ],
      "invariants": [
        "C4",
        "C5",
        "C6",
        "C7",
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C4-C8",
          "apps/fouria/src/persistence.ts (restoreIfNeeded, restoreBackupById, stable-backup.json)",
          "apps/fouria/src/sandbox-v1.ts (backupDirectory/restoreDirectory)",
          "apps/fouria/src/crypto/** (F4E1 legacy and directory-backup encryption)",
          "docs/plans/sandbox-v1-scaffold.md (remaining blockers 1-5)",
          "docs/plans/legacy-sandbox-zero-data-loss.md"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/sandbox-migration/intent.ts",
            "find": "(missing)",
            "replace": "Add the write-ahead intent record with a tri-state reader (absent/present/unknown) and a single requiresV1 predicate."
          },
          {
            "file": "apps/fouria/src/sandbox-migration/lease.ts",
            "find": "(missing)",
            "replace": "Add the per-tenant R2 lease: create-only acquire, etag-CAS takeover, owner-scoped renew/release, fail-closed parse."
          },
          {
            "file": "apps/fouria/src/sandbox-v1.ts",
            "find": "no convertToV1",
            "replace": "Add the DO-owned legacy .sqsh -> DirectoryBackup conversion and target restore; the Worker must never call the primitives."
          },
          {
            "file": "apps/fouria/src/persistence.ts",
            "find": "legacy restore path without an intent check",
            "replace": "Refuse legacy routing/serving/gateway-start after the intent is present or unreadable; recovery is operator-driven."
          }
        ],
        "expected_result": "The intent is written before the first destructive step; all six C5 surfaces refuse legacy after it; unknown never reads as absent; conversion and target restore run in the SandboxV1 DO."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e-backup/zzz_backup_cold_restore.txt",
          "apps/fouria/test/e2e-backup/zzz_backup_restore_skip_setup.txt",
          "apps/fouria/test/e2e-backup/zzz_backup_semantics.txt",
          "apps/fouria/test/e2e-backup/zz_reprovision_guard.txt",
          "apps/fouria/test/business-rules/backup-encryption.txt",
          "apps/fouria/test/business-rules/operational-modes.txt"
        ],
        "gaps": [
          "No conversion-intent test and no tri-state (absent/present/unknown) test.",
          "No legacy .sqsh -> DirectoryBackup conversion test.",
          "No observed no-fallback test on all six C5 surfaces."
        ],
        "required": [
          "apps/fouria/src/sandbox-migration/intent.test.ts",
          "apps/fouria/src/sandbox-migration/lease.test.ts",
          "apps/fouria/src/sandbox-v1/conversion.test.ts",
          "apps/fouria/test/e2e-v1/01_fresh_boot_and_migration.txt",
          "apps/fouria/test/e2e-v1/06_backup_restore_retention.txt",
          "apps/fouria/test/business-rules/sandbox-v1-persistence.txt"
        ]
      },
      "execute": {
        "docs": [
          "docs/plans/sandbox-v1-cutover-contracts.md (C4-C8)",
          "apps/fouria/docs/WORKER-DEVELOPMENT.md"
        ],
        "steps": [
          "Write red tests for intent tri-state, lease CAS, and conversion.",
          "Implement intent + lease + state reader.",
          "Implement convertToV1 and the target restore in the DO.",
          "Wire the six C5 surfaces to requiresV1."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- sandbox-migration sandbox-v1",
          "cctr apps/fouria/test/business-rules/sandbox-v1-persistence.txt",
          "bun run --cwd apps/fouria test:e2e:backup"
        ],
        "acceptance": [
          "404 -> absent; 200 null/truncated/missing-field/thrown fetch -> unknown; unknown refuses.",
          "The intent is durable before the first destructive step.",
          "No automatic legacy fallback on any of the six surfaces.",
          "The Worker call graph never calls the conversion/restore primitives."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance (first non-production conversion target)",
        "deploy": [
          "Take a verified checkpoint of the dev instance.",
          "Run the migrate action with the staging gate; conversion runs in the SandboxV1 DO."
        ],
        "observe": [
          "Log: conversion phases, stable pointer id, record validation.",
          "R2: legacy archive retained; DirectoryBackup record committed; intent record present.",
          "No legacy request served after the intent."
        ],
        "abort_criteria": [
          "Intent present but legacy still serving.",
          "A conversion write outside the DO.",
          "An unreadable intent read as absent."
        ]
      },
      "features": [
        "C-55",
        "C-56",
        "C-57",
        "C-58",
        "C-64",
        "C-65",
        "C-66",
        "O-41",
        "O-43",
        "O-44",
        "O-45",
        "O-51"
      ]
    },
    {
      "id": "PER-2",
      "domain": "persistence",
      "title": "Snapshots, restore and retention on the v1 record format",
      "slices": [
        "S2",
        "S4"
      ],
      "invariants": [
        "C6",
        "C7",
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C6-C8",
          "apps/fouria/src/persistence.ts (snapshot orchestration, retention, idle/deprovision)",
          "apps/fouria/src/sandbox-v1.ts (backupDirectory/restoreDirectory/deleteDirectoryBackup)",
          "apps/fouria/src/crypto/directory-backup-encryption.ts (prior art on the lane)",
          "apps/fouria/src/activity/scheduler.ts and backup-watch/**",
          "docs/plans/persistent-workspace-phase1.md"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/persistence.ts",
            "find": "sandbox.createBackup() / sandbox.restoreBackup() on the v1 path",
            "replace": "Use SandboxV1.backupDirectory/restoreDirectory; commit the catalog entry immediately; prune v1 records by retention."
          },
          {
            "file": "apps/fouria/start-openclaw.sh",
            "find": "setup restore assumes the legacy .sqsh archive",
            "replace": "Restore the v1 DirectoryBackup before gateway launch; OPENCLAW_RESTORED still skips the setup body."
          },
          {
            "file": "apps/fouria/src/sandbox-do.ts",
            "find": "onActivityExpired always archives the legacy format",
            "replace": "On v1, reuse a recent DirectoryBackup inside the idle window; snapshot the native workspace on eviction when enabled."
          }
        ],
        "expected_result": "Snapshot/restore/retention parity on v1; F4E1 at rest; cold boot restores the v1 record; idle sleep does not re-archive unchanged state; deprovision fails closed without a committed record."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e-backup/zzz_backup_semantics.txt",
          "apps/fouria/test/e2e-backup/zzz_persistence_lifecycle.txt",
          "apps/fouria/test/e2e-backup/zzz_software_binaries_restore.txt",
          "scripts/software-restore-smoke.sh",
          "apps/fouria/test/business-rules/backup-encryption.txt"
        ],
        "gaps": [
          "No v1 DirectoryBackup create/list/restore/retention scenario.",
          "No v1 restore-before-gateway assertion.",
          "No v1 idle-window reuse test.",
          "No native workspace snapshot on the durable_object policy."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/06_backup_restore_retention.txt",
          "apps/fouria/test/e2e-v1/03_passive_health_and_wake.txt",
          "apps/fouria/src/sandbox-v1/backup.test.ts (prior art: lane)"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/WORKER-DEVELOPMENT.md",
          "apps/fouria/docs/OPERATOR-GUIDE.md",
          "docs/plans/persistent-workspace-phase1.md"
        ],
        "steps": [
          "Write red tests for v1 backup/restore/retention.",
          "Wire backupDirectory/restoreDirectory/deleteDirectoryBackup into the scheduler.",
          "Restore the v1 record before the gateway launch.",
          "Enable and test the native workspace snapshot on the durable_object policy."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- persistence sandbox-v1",
          "bun run --cwd apps/fouria test:e2e:backup",
          "bun run test:software:smoke"
        ],
        "acceptance": [
          "A v1 snapshot is encrypted at rest and restorable after a container replacement.",
          "Retention keeps exactly the configured number of v1 records.",
          "An idle expiry with a recent record stops without a new archive.",
          "A failed snapshot never destroys the container."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; run snapshot -> destroy -> restore."
        ],
        "observe": [
          "R2: backups/v1 records + .meta.json; ciphertext only when the key is set.",
          "Tenant: cold boot restores the record, OPENCLAW_RESTORED receipt present.",
          "No legacy .sqsh written for the v1 tenant."
        ],
        "abort_criteria": [
          "A restore that yields a configless gateway.",
          "A plaintext archive with BACKUP_ENCRYPTION_REQUIRED=true.",
          "An idle loop that re-archives the same state."
        ]
      },
      "features": [
        "C-59",
        "C-67",
        "O-07",
        "O-42",
        "O-47",
        "O-68"
      ]
    },
    {
      "id": "PER-3",
      "domain": "persistence",
      "title": "Durable jobs, lease usage and queue coordination",
      "slices": [
        "S5"
      ],
      "invariants": [
        "C3",
        "C4",
        "C9"
      ],
      "prerequisites": {
        "read": [
          "contract C3, C4 (usage), C9",
          "ADR-SV1-004 (one central Dispatch consumer; tenants are producers)",
          "apps/fouria/src/activity/** (scheduler, boot/backup/restore/maintenance jobs)",
          "workers/fouria-dispatch/src/** (control queue, cron fan-out)",
          "apps/fouria/wrangler.jsonc and workers/fouria-dispatch/wrangler.jsonc (queues)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/wrangler.jsonc",
            "find": "no migration queue producer",
            "replace": "Add the migration queue producer only; never a tenant-side consumer."
          },
          {
            "file": "workers/fouria-dispatch/src/**",
            "find": "no migration consumer",
            "replace": "Add the single central consumer; each delivery performs one bounded phase and writes the continuation before ack."
          },
          {
            "file": "apps/fouria/src/sandbox-migration/reaper.ts",
            "find": "(missing)",
            "replace": "Add the enqueue-only reaper invoked from the ActivityScheduler alarm; it must never address a container/DO."
          }
        ],
        "expected_result": "One phase per delivery, continuation before ack, expectedPhase is a hint; every lease caller uses the primitive; the reaper only enqueues."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/p_tasks_queue.txt",
          "apps/fouria/test/e2e/p_scheduled_cron.txt",
          "apps/fouria/test/e2e/o_opencode_credits_task.txt",
          "workers/fouria-dispatch/test/unit/control.test.ts",
          "workers/fouria-dispatch/test/unit/cron-fanout.test.ts",
          "apps/fouria/test/business-rules/operational-modes.txt"
        ],
        "gaps": [
          "No migration queue/consumer test.",
          "No continuation-before-ack assertion.",
          "No reaper enqueue-only assertion.",
          "No phase-mismatch recovery test."
        ],
        "required": [
          "apps/fouria/src/sandbox-migration/reaper.test.ts",
          "workers/fouria-dispatch/test/integration/migration-consumer.test.ts",
          "apps/fouria/test/e2e-v1/02_concurrency_and_serving_owner.txt",
          "apps/fouria/test/e2e-v1/07_canary_gates.txt"
        ]
      },
      "execute": {
        "docs": [
          "docs/plans/sandbox-v1-decisions.md (ADR-SV1-004)",
          "docs/plans/sandbox-v1-cutover-contracts.md (C3, C4, C9)"
        ],
        "steps": [
          "Write red tests for phase ordering, mismatch recovery and reaper effects.",
          "Add the producer + central consumer.",
          "Implement the durable continuation before ack.",
          "Route every lease call through the primitive and add the enqueue-only reaper."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd workers/fouria-dispatch test",
          "bun run --cwd apps/fouria test -- activity sandbox-migration",
          "cctr apps/fouria/test/business-rules/operational-modes.txt"
        ],
        "acceptance": [
          "A delivery performs exactly one phase and writes the continuation before ack.",
          "A phase mismatch re-reads and never advances twice.",
          "The reaper only enqueues (no env.Sandbox / env.SandboxV1 / container access).",
          "No tenant Worker declares a migration consumer."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance with the migration queue enabled."
        ],
        "observe": [
          "Queue metrics: one delivery per phase, no duplicate conversion.",
          "Log: continuation-before-ack, expectedPhase mismatch path.",
          "Reaper: enqueue events only; no container wake."
        ],
        "abort_criteria": [
          "Any delivery that loops phases.",
          "Any reaper that addresses a container/DO.",
          "Any duplicate phase advance."
        ]
      },
      "features": [
        "C-41",
        "O-46",
        "O-67"
      ]
    },
    {
      "id": "BIL-1",
      "domain": "billing",
      "title": "Billable-action emission and OTel transport",
      "slices": [
        "S3",
        "S4"
      ],
      "invariants": [
        "C3",
        "C7"
      ],
      "prerequisites": {
        "read": [
          "apps/fouria/src/billable-actions.ts",
          "apps/fouria/src/otel-traces.ts and otel-ingest.ts",
          "apps/fouria/src/sandbox-otel-bridge.ts",
          "apps/fouria/src/dev-mode.ts (isBillableEventsEnabled)",
          "apps/lerma/lib/lerma/billing_consumption.ex and billing_reconcile.ex",
          "docs/plans/sandbox-v1-cutover-contracts.md (C3, C7)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/sandbox-v1.ts",
            "find": "no otel.internal outbound handler",
            "replace": "Register the OTLP bridge on the v1 DO; keep OTEL_SHARED_SECRET as the inner credential."
          },
          {
            "file": "apps/fouria/src/otel-traces.ts",
            "find": "emission assumes the legacy container span shape",
            "replace": "Accept v1 spans; keep the action_key + trace-level precedence; never store content."
          },
          {
            "file": "apps/fouria/src/routes/otel.ts",
            "find": "billable gate tied to the legacy runtime",
            "replace": "Keep isBillableEventsEnabled: production always emits, staging always emits, dev opts in with BILLABLE_EVENTS."
          }
        ],
        "expected_result": "v1 spans reach the same ingest path through the bridge; billable-action rows are idempotent; staging emits; no content is stored."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/p_otel_billing_queue.txt",
          "apps/fouria/test/e2e/l_cli_billing.txt",
          "apps/fouria/test/business-rules/pricing.txt",
          "apps/fouria/test/business-rules/cost-tracking.txt",
          "apps/lerma/test/lerma/billing_consumption_test.exs"
        ],
        "gaps": [
          "No v1 OTLP bridge emission test.",
          "No v1 span -> billable-action idempotency test.",
          "No staging-emits assertion on the v1 runtime."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/04_channels_and_rpc_ws.txt",
          "apps/fouria/src/sandbox-v1-outbound.test.ts (otel)",
          "apps/fouria/test/business-rules/sandbox-v1-billing.txt"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/cost-observability.md",
          "docs/TESTING.md",
          "docs/plans/sandbox-v1-cutover-contracts.md (C3, C7)"
        ],
        "steps": [
          "Write red tests for the v1 OTLP bridge and idempotency.",
          "Register the bridge and route the exporter to otel.internal.",
          "Verify the staging/dev/production emission matrix.",
          "Add the no-content assertion."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- otel sandbox-otel-bridge billable",
          "cctr apps/fouria/test/business-rules/pricing.txt",
          "bun run --cwd apps/fouria test:e2e:cli"
        ],
        "acceptance": [
          "A v1 span produces exactly one billable-action row per action_key.",
          "Staging always emits; production always emits; dev only with BILLABLE_EVENTS.",
          "No message content, prompt, or credential is stored."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance with the OTel bridge and billable events enabled."
        ],
        "observe": [
          "AE: billable-action rows for client-sandbox-v1 with the expected action_key.",
          "Lerma: credit ledger ingest, no duplicate action.",
          "Logs: no content fields, no 403 from the AE query token."
        ],
        "abort_criteria": [
          "Duplicate billing for one action_key.",
          "A content payload in the OTLP ingest.",
          "A silent emission gap on staging."
        ]
      },
      "features": [
        "C-25",
        "C-73",
        "C-74",
        "C-77",
        "C-79",
        "C-80",
        "C-88",
        "O-58",
        "O-74",
        "O-75",
        "O-80"
      ]
    },
    {
      "id": "BIL-2",
      "domain": "billing",
      "title": "Credits, plans and freeze semantics",
      "slices": [
        "S4"
      ],
      "invariants": [
        "C5",
        "C7"
      ],
      "prerequisites": {
        "read": [
          "contract C5, C7",
          "apps/lerma/lib/lerma/credits.ex, billing_plans.ex, billing_restock.ex, billing_notifications.ex",
          "apps/fouria/src/billing-freeze.ts and tenant-park.ts",
          "docs/VISION.md (pricing is the public target; each client is contracted)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/billing-freeze.ts",
            "find": "freeze implemented as a destructive container stop",
            "replace": "Keep freeze as an explicit lifecycle operation on v1; never reachable from stopGateway."
          },
          {
            "file": "apps/lerma/lib/lerma/credits.ex",
            "find": "credit ledger assumptions tied to the legacy runtime",
            "replace": "Preserve the ledger; verify the same action_key/restock/autobuy behavior from v1 events."
          },
          {
            "file": "apps/lerma/lib/lerma/billing_notifications.ex",
            "find": "low-credit notification without a v1 trigger",
            "replace": "Keep the threshold + one-notification-per-episode behavior on the v1 emission path."
          }
        ],
        "expected_result": "Credits/plans/restock/autobuy/freeze keep their semantics on v1; freeze blocks only new billable actions; AI cost stays separate from credits."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/l_cli_billing.txt",
          "apps/fouria/test/business-rules/billing-freeze.txt",
          "apps/fouria/test/business-rules/credits-and-plans.txt",
          "apps/lerma/test/lerma/billing_restock_test.exs",
          "apps/lerma/test/lerma/credits_test.exs"
        ],
        "gaps": [
          "No v1 freeze/unfreeze test.",
          "No v1 restock/autobuy test.",
          "No assertion that freeze never destroys the container on v1."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/05_freeze_and_control.txt",
          "apps/fouria/test/business-rules/sandbox-v1-billing.txt"
        ]
      },
      "execute": {
        "docs": [
          "docs/VISION.md",
          "apps/fouria/docs/WORKER-DEVELOPMENT.md",
          "apps/lerma/README.md"
        ],
        "steps": [
          "Write red tests for freeze/unfreeze and restock on v1.",
          "Make billing freeze v1-aware without changing its semantics.",
          "Verify the low-credit/autobuy path from v1 events."
        ]
      },
      "verify": {
        "commands": [
          "mix test apps/lerma/test/lerma/credits_test.exs apps/lerma/test/lerma/billing_restock_test.exs",
          "cctr apps/fouria/test/business-rules/billing-freeze.txt",
          "bun run --cwd apps/fouria test -- billing-freeze"
        ],
        "acceptance": [
          "Freeze blocks only new billable actions; in-flight work completes.",
          "Unfreeze resumes without a container replacement.",
          "Restock is monthly, non-accumulative and idempotent per UTC day."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; run a freeze -> message -> unfreeze drill."
        ],
        "observe": [
          "Lerma credit ledger: one consumption per completed action, none for the frozen attempt.",
          "Tenant: gateway stays up while frozen; no destroy.",
          "Email: low-credit notification once per episode."
        ],
        "abort_criteria": [
          "A freeze that destroys the container.",
          "A double consumption or a consumption on failure.",
          "A restock that accumulates."
        ]
      },
      "features": [
        "C-08",
        "C-78",
        "C-81",
        "C-82",
        "C-83",
        "C-84",
        "O-72",
        "O-73",
        "O-76",
        "O-77",
        "O-78",
        "O-83"
      ]
    },
    {
      "id": "BIL-3",
      "domain": "billing",
      "title": "Cost observability and development expense",
      "slices": [
        "S6"
      ],
      "invariants": [
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C8",
          "apps/fouria/src/metrics.ts and cost-summary.ts",
          "apps/fouria/src/gateway/memory.ts",
          "apps/lerma/lib/lerma/development_expense.ex and analytics/**",
          "docs/plans/persistent-workspace-phase0.md"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/metrics.ts",
            "find": "container-active / r2-operation events sourced from the legacy SDK",
            "replace": "Emit the same event shapes from v1 lifecycle/backup events; keep the AE dataset."
          },
          {
            "file": "apps/fouria/src/gateway/memory.ts",
            "find": "RSS sampling via the legacy exec handle",
            "replace": "Sample through the v1 process API; keep the 75% cgroup threshold and the 60s throttle."
          },
          {
            "file": "apps/lerma/lib/lerma/development_expense.ex",
            "find": "per-client rollup only",
            "replace": "Attribute development cost per instance with a dedicated OpenCode Go key; never emit a billable-action and never consume credits."
          }
        ],
        "expected_result": "Per-tenant infrastructure/AI cost and per-instance development cost are visible on v1; dev cost never enters billing; AE event shapes stay stable."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/ad_observability_canary.txt",
          "apps/fouria/test/business-rules/cost-tracking.txt",
          "apps/fouria/test/business-rules/dev-expense.txt",
          "apps/lerma/test/lerma/development_expense_test.exs",
          "apps/lerma/test/lerma_web/live/instance_live_test.exs"
        ],
        "gaps": [
          "No v1 AE event assertion (container-active, r2-operation, gateway-resources, persistence-*).",
          "No per-instance OpenCode key attribution test.",
          "No assertion that dev cost never appears in billable-action."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/03_passive_health_and_wake.txt",
          "apps/fouria/test/business-rules/sandbox-v1-cost.txt"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/cost-observability.md",
          "docs/plans/persistent-workspace-phase0.md",
          "docs/ENV-VARIABLES.md"
        ],
        "steps": [
          "Write red tests for the v1 AE event shapes.",
          "Move the event sources to the v1 lifecycle/backup/process APIs.",
          "Add per-instance development-cost attribution.",
          "Verify the cost views in Lerma."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- metrics cost-summary gateway/memory",
          "cctr apps/fouria/test/business-rules/cost-tracking.txt",
          "mix test apps/lerma/test/lerma/development_expense_test.exs"
        ],
        "acceptance": [
          "Every v1 tenant emits container-active, r2-operation, gateway-resources and persistence-* rows.",
          "Dev cost is queryable per instance and absent from billable-action/credits.",
          "The cost summary widget renders a non-zero rollup when rows exist."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; generate one message and one snapshot."
        ],
        "observe": [
          "AE: rows for client-sandbox-v1 with the expected event names.",
          "Lerma: instance uptime/cost widget, development expense per instance.",
          "No dev-cost row in billable-action."
        ],
        "abort_criteria": [
          "A missing AE event family on v1.",
          "Dev cost appearing in credits or an invoice.",
          "A cost summary 403/zero with rows present."
        ]
      },
      "features": [
        "C-20",
        "C-26",
        "O-49",
        "O-79"
      ]
    },
    {
      "id": "OCM-1",
      "domain": "openclaw-management",
      "title": "Serving parity: proxy, health and admin RPC",
      "slices": [
        "S1",
        "S2",
        "S3"
      ],
      "invariants": [
        "C7",
        "C8",
        "C10"
      ],
      "prerequisites": {
        "read": [
          "contract C7, C8, C10",
          "apps/fouria/src/index.ts (proxy, header rebuild, WS)",
          "apps/fouria/src/routes/public.ts (health, startup ws, healthz)",
          "apps/fouria/src/gateway/health-probes.ts",
          "apps/fouria/src/gateway/admin-rpc.ts and gateway-rpc.ts",
          "apps/fouria/src/sandbox-contract.ts"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/sandbox-contract.ts",
            "find": "acquireSandbox always returns the legacy stub",
            "replace": "Return the SandboxV1 stub when the tenant is converted; fail closed on an unknown runtime."
          },
          {
            "file": "apps/fouria/src/index.ts",
            "find": "containerFetch / wsConnect on the proxy path",
            "replace": "Use the v1 container fetch/WS transport; rebuild the same X-FourIA-* headers."
          },
          {
            "file": "apps/fouria/src/routes/public.ts",
            "find": "health reads the legacy process list and isRuntimeActive",
            "replace": "Use the v1 process API and lifecycle read; keep 503-until-ready and passive sleeping semantics."
          }
        ],
        "expected_result": "HTTP and WebSocket parity over the v1 DO; /api/health keeps 503-until-ready and passive sleeping; /healthz stays sub-second and non-waking; admin RPC and gateway WS methods work."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/aa_health_gate.txt",
          "apps/fouria/test/e2e/ab_gateway_ws_origin.txt",
          "apps/fouria/test/e2e/ac_gateway_startup_concurrency.txt",
          "apps/fouria/test/e2e/b_cli_devices.txt",
          "apps/fouria/test/e2e/ad_observability_canary.txt"
        ],
        "gaps": [
          "No v1 HTTP proxy parity scenario.",
          "No v1 WebSocket proxy parity scenario.",
          "No v1 admin RPC / gateway WS method test.",
          "No v1 passive health/non-waking test."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/00_runtime_selection.txt",
          "apps/fouria/test/e2e-v1/02_concurrency_and_serving_owner.txt",
          "apps/fouria/test/e2e-v1/03_passive_health_and_wake.txt",
          "apps/fouria/test/e2e-v1/04_channels_and_rpc_ws.txt"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/WORKER-DEVELOPMENT.md",
          "docs/WORKER-HEALTH.md",
          "docs/plans/sandbox-v1-cutover-contracts.md (C7, C8)"
        ],
        "steps": [
          "Write red tests for proxy/health parity.",
          "Implement the v1 acquisition and transport.",
          "Rebuild headers and WS forwarding.",
          "Verify readiness uses the existing shared probe, not a second definition."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- index public health-probes admin-rpc gateway-rpc",
          "cctr apps/fouria/test/e2e-v1/00_runtime_selection.txt",
          "bun run --cwd apps/fouria test:ui"
        ],
        "acceptance": [
          "HTTP and WS requests reach the v1 gateway with the same identity headers.",
          "Health is 503 until ready; passive reports sleeping without waking; /healthz is sub-second.",
          "Admin RPC and WS-only methods behave identically to legacy."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; open the Control UI and the admin SPA."
        ],
        "observe": [
          "Requests: 200s on the proxy, no 502/503 after readiness.",
          "WS: connected, no handshake loop, no duplicate session metric.",
          "/api/health, /api/health-ws, /healthz latency and status."
        ],
        "abort_criteria": [
          "A proxy 5xx storm after readiness.",
          "A health probe that wakes a sleeping tenant.",
          "A WS handshake that never completes."
        ]
      },
      "features": [
        "C-16",
        "C-17",
        "C-18",
        "C-19",
        "C-69",
        "C-70",
        "C-71",
        "C-72",
        "O-52",
        "O-53",
        "O-54",
        "O-56",
        "O-103"
      ]
    },
    {
      "id": "OCM-2",
      "domain": "openclaw-management",
      "title": "Gateway lifecycle, boot and repair",
      "slices": [
        "S2",
        "S4"
      ],
      "invariants": [
        "C5",
        "C7",
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C5, C7, C8",
          "apps/fouria/src/gateway/process.ts (ensureGateway, soft reload, kill)",
          "apps/fouria/src/post-restore.ts",
          "apps/fouria/src/gateway/state-db.ts",
          "apps/fouria/src/gateway/memory.ts",
          "apps/fouria/start-openclaw.sh (start/setup/post-start)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/gateway/process.ts",
            "find": "ensureGateway launches start-openclaw.sh against the legacy sandbox",
            "replace": "Launch through the v1 DO; the DO owns the owner restart; keep the single-owner startup lock and the early-exit watch."
          },
          {
            "file": "apps/fouria/start-openclaw.sh",
            "find": "setup restores only the legacy archive",
            "replace": "Restore the v1 DirectoryBackup before launch; keep the OPENCLAW_RESTORED skip path."
          },
          {
            "file": "apps/fouria/src/gateway/state-db.ts",
            "find": "doctor-repair assumes the legacy process handle",
            "replace": "Keep the detection/queue semantics; run doctor --fix through the v1 exec adapter."
          }
        ],
        "expected_result": "Cold boot restores the v1 record then launches; corrupt state DB queues doctor --fix and relaunches; stuck boot is detected; memory is sampled; exactly one gateway owner."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/ac_gateway_startup_concurrency.txt",
          "apps/fouria/test/e2e/n_gateway_soft_reload.txt",
          "apps/fouria/test/e2e/zz_gateway_hard_restart.txt",
          "apps/fouria/test/e2e/aa_health_gate.txt",
          "apps/fouria/test/business-rules/operational-modes.txt"
        ],
        "gaps": [
          "No v1 cold boot with restore.",
          "No v1 doctor-repair/relaunch scenario.",
          "No v1 single-owner concurrency scenario.",
          "No v1 memory sampling assertion."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/01_fresh_boot_and_migration.txt",
          "apps/fouria/test/e2e-v1/02_concurrency_and_serving_owner.txt",
          "apps/fouria/test/e2e-v1/03_passive_health_and_wake.txt"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/WORKER-DEVELOPMENT.md",
          "apps/fouria/docs/OPERATOR-GUIDE.md"
        ],
        "steps": [
          "Write red tests for the v1 boot/repair/owner path.",
          "Wire ensureGateway to the v1 DO and the v1 restore.",
          "Keep the state-DB repair and early-exit detection.",
          "Verify memory sampling through the v1 process API."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- gateway/process gateway/state-db gateway/memory",
          "bun run --cwd apps/fouria test:gateway:boot",
          "cctr apps/fouria/test/e2e-v1/01_fresh_boot_and_migration.txt"
        ],
        "acceptance": [
          "A restored v1 tenant boots without re-onboarding.",
          "A corrupt state DB produces doctor-repair then a relaunch.",
          "A non-zero early exit fails fast; a zero exit does not fail a healthy boot.",
          "Exactly one gateway owner exists."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; cold boot, restart, and repair drill."
        ],
        "observe": [
          "/api/startup/ws phases: probe -> restore -> launch -> port-wait.",
          "/debug/gateway-logs: one owner, no duplicate launch, no SQLite offline-maintenance error.",
          "Memory sample present after 60s."
        ],
        "abort_criteria": [
          "A boot loop with no phase progress.",
          "A duplicate gateway owner.",
          "A repair that never relaunches."
        ]
      },
      "features": [
        "O-50",
        "O-59",
        "O-60",
        "O-61",
        "O-62",
        "O-100",
        "O-101"
      ]
    },
    {
      "id": "OCM-3",
      "domain": "openclaw-management",
      "title": "Agents, channels, automation, knowledge and tooling",
      "slices": [
        "S2",
        "S3"
      ],
      "invariants": [
        "C7",
        "C8",
        "C10"
      ],
      "prerequisites": {
        "read": [
          "contract C7, C8, C10",
          "apps/fouria/src/routes/api/** (agents, channels, integrations, automation, knowledge, software)",
          "apps/fouria/src/telegram-ingress/**",
          "packages/moltlazy/src/config/** and agents/**",
          "apps/fouria/src/sandbox-* bridges (leads/docs/software/cdp)"
        ],
        "find_replace": [
          {
            "file": "apps/fouria/src/telegram-ingress/**",
            "find": "wake path assumes the legacy sandbox",
            "replace": "Wake through the v1 DO; keep the per-tenant queue, parked notice and at-least-once delivery."
          },
          {
            "file": "apps/fouria/src/activity/scheduler.ts",
            "find": "wake/heal calls the legacy sandbox",
            "replace": "Wake/heal through the v1 acquisition boundary; keep the alarm and interval gating."
          },
          {
            "file": "apps/fouria/src/sandbox-cdp-bridge.ts",
            "find": "CDP bridge registered only on the legacy sandbox",
            "replace": "Register on the v1 DO; keep the Browser Rendering credential out of the container."
          }
        ],
        "expected_result": "Agents, channels, integrations, automation, knowledge, skills, software, browser and MCP work on v1; the Telegram parked notice still arrives; notifications still fire."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/d_cli_channels.txt",
          "apps/fouria/test/e2e/h_cli_knowledge.txt",
          "apps/fouria/test/e2e/i_cli_cron.txt",
          "apps/fouria/test/e2e/j_cli_integrations.txt",
          "apps/fouria/test/e2e/q_telegram_webhook.txt",
          "apps/fouria/test/e2e/r_browser_*.txt",
          "apps/fouria/test/e2e/zzz_software_provisioning.txt"
        ],
        "gaps": [
          "No v1 agent CRUD/bindings test.",
          "No v1 Telegram ingress wake test.",
          "No v1 software provisioning restore test.",
          "No v1 browser CDP test."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/04_channels_and_rpc_ws.txt",
          "apps/fouria/test/e2e-v1/06_backup_restore_retention.txt (software)",
          "apps/fouria/test/business-rules/sandbox-v1-agents.txt"
        ]
      },
      "execute": {
        "docs": [
          "apps/fouria/docs/WORKER-DEVELOPMENT.md",
          "packages/moltlazy/AGENTS.md",
          "docs/OPENCLAW-PLUGINS.md"
        ],
        "steps": [
          "Write red tests for agent/channel/automation parity.",
          "Route the gateway API and CLI fallbacks through the v1 proxy.",
          "Move ingress/automation wake to the v1 boundary.",
          "Verify software, browser and MCP bridges."
        ]
      },
      "verify": {
        "commands": [
          "bun run --cwd apps/fouria test -- routes/api telegram-ingress activity",
          "bun run --cwd apps/fouria test:e2e:agent",
          "bun run --cwd apps/fouria test:ui"
        ],
        "acceptance": [
          "Agent CRUD, model selection, bindings and persona files work.",
          "A Telegram message wakes a sleeping v1 tenant and is delivered exactly once.",
          "Declared software survives a container replacement.",
          "Browser CDP and MCP tools work through the v1 bridges."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20) dev instance",
        "deploy": [
          "Promote the dev instance; create an agent, bind Telegram, run an automation."
        ],
        "observe": [
          "Agent CRUD + Control UI chat: no 5xx.",
          "Telegram: queued -> delivered; parked notice when parked.",
          "Automation: scheduled run fires; wake-ahead alarm present.",
          "Software report: packages installed after restore."
        ],
        "abort_criteria": [
          "A channel that connects but never delivers.",
          "An automation that never fires.",
          "A software package lost after a restore."
        ]
      },
      "features": [
        "C-11",
        "C-12",
        "C-13",
        "C-15",
        "C-21",
        "C-23",
        "C-24",
        "C-28",
        "C-32",
        "C-34",
        "C-35",
        "C-37",
        "C-38",
        "C-39",
        "C-40",
        "C-42",
        "C-43",
        "C-44",
        "C-45",
        "C-46",
        "C-49",
        "C-50",
        "C-51",
        "C-52",
        "C-53",
        "C-54",
        "C-89",
        "C-90",
        "O-102"
      ]
    },
    {
      "id": "OCM-4",
      "domain": "openclaw-management",
      "title": "Provisioning, rollout, promotion and release",
      "slices": [
        "S4",
        "S6"
      ],
      "invariants": [
        "C1",
        "C5",
        "C8"
      ],
      "prerequisites": {
        "read": [
          "contract C1, C5, C8",
          "apps/lerma/lib/lerma/provisioning/** and cloudflare/**",
          "apps/lerma/lib/lerma/instances.ex and applications.ex",
          "apps/fouria/src/services/promotion/**",
          ".github/workflows/{test,deploy-fouria,deploy-dashboard,promote-staging,release}.yml",
          "docs/plans/sandbox-v1-decisions.md (ADR-SV1-004)"
        ],
        "find_replace": [
          {
            "file": "apps/lerma/lib/lerma/cloudflare/containers.ex",
            "find": "legacy container entry only",
            "replace": "Add the durable_object container entry (image Dockerfile.v1, instance_type, max_instances) and the SandboxV1 binding; keep the legacy entry."
          },
          {
            "file": "apps/lerma/lib/lerma/provisioning/tenant_provisioner.ex",
            "find": "no v1 cutover vars/bindings",
            "replace": "Provision WORKER_PLATFORM, SANDBOX_V1_CUTOVER and the v1 container entry for approved staging tenants only."
          },
          {
            "file": ".github/workflows/staging-validation.yml",
            "find": "branch guard sandbox-v1-validation",
            "replace": "Parameterize the guard via the validation_branch input and the publisher via VALIDATION_BRANCH; no branch is hardcoded."
          }
        ],
        "expected_result": "A v1 tenant provisions atomically; rollout parks/resumes; dev -> production promotion works; release artifacts stay traceable; no production cutover."
      },
      "e2e_suitability": {
        "verdict": "partial",
        "existing": [
          "apps/fouria/test/e2e/provision_and_dispatch.txt",
          "apps/fouria/test/e2e-backup/zz_reprovision_guard.txt",
          "apps/fouria/test/e2e/y_production_profile.txt",
          "apps/lerma/test/lerma/provisioning/tenant_provisioner_pipeline_test.exs",
          "apps/lerma/test/lerma/cloudflare/dispatch_namespace_test.exs",
          ".github/scripts/staging-validation.test.ts"
        ],
        "gaps": [
          "No v1 provisioning pipeline test.",
          "No v1 container entry/binding assertion.",
          "No v1-sandbox staging lane test.",
          "No v1 promotion test."
        ],
        "required": [
          "apps/fouria/test/e2e-v1/01_fresh_boot_and_migration.txt",
          "apps/fouria/test/e2e-v1/07_canary_gates.txt",
          "apps/lerma/test/lerma/provisioning/tenant_provisioner_v1_test.exs"
        ]
      },
      "execute": {
        "docs": [
          "apps/lerma/README.md",
          "docs/CLOUD-ARCHITECTURE.md",
          "docs/VERSIONING.md"
        ],
        "steps": [
          "Write red tests for the v1 container entry and bindings.",
          "Provision WORKER_PLATFORM + cutover flag + v1 image for staging only.",
          "Add the v1-sandbox staging lane.",
          "Verify rollout park/resume and dev -> production promotion."
        ]
      },
      "verify": {
        "commands": [
          "mix test apps/lerma/test/lerma/provisioning/tenant_provisioner_pipeline_test.exs",
          "bun run --cwd apps/fouria test:e2e:cli",
          "bun run test:all"
        ],
        "acceptance": [
          "A v1 instance provisions with the durable_object policy and the SandboxV1 binding.",
          "Rollout parks before replacement and resumes after.",
          "Promotion stages in R2 and applies on the production instance.",
          "Release artifacts are traceable to a commit."
        ]
      },
      "staging": {
        "target": "client-sandbox-v1 (id 20), dev then production instance",
        "deploy": [
          "Publish the v1-sandbox bundle + image, then promote the dev instance.",
          "After the dev milestone gate passes, promote the production instance."
        ],
        "observe": [
          "Lerma: provision/upgrade run history, instance version convergence.",
          "Tenant: boot to readiness; no image-pull error.",
          "Release: bundle/image digest matches the promoted SHA."
        ],
        "abort_criteria": [
          "An image the runtime cannot pull.",
          "A rollout that skips the park.",
          "A promotion that applies to the wrong tenant."
        ]
      },
      "features": [
        "C-04",
        "O-03",
        "O-04",
        "O-06",
        "O-08",
        "O-10",
        "O-11",
        "O-13",
        "O-14",
        "O-15",
        "O-17",
        "O-18",
        "O-19",
        "O-22",
        "O-23",
        "O-25",
        "O-26",
        "O-34",
        "O-35",
        "O-37",
        "O-39",
        "O-40",
        "O-104",
        "O-105",
        "O-106",
        "O-107",
        "O-108"
      ]
    }
  ],
  "features": [
    {
      "id": "C-01",
      "title": "As an invited client user, I receive an email invitation and can review/accept/reject it **without** a FourIA login (public `/invitations/*`, outside Access).",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Public invitation flow is outside Access and independent of the sandbox runtime.",
      "release_notes": "SHA-256 token hash, 7-day expiry, background delivery, accept/reject controller. V2 needs an equivalent invite flow (not Cloudflare Access-specific)."
    },
    {
      "id": "C-02",
      "title": "As a client user, I sign in through the platform identity provider (Cloudflare Access today: email OTP, Google, GitHub) and land on my tenant dashboard.",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "IdP/Access sign-in is edge-only.",
      "release_notes": "Per-instance Access app + group. V2 must replace Access with an OIDC/ingress auth layer and preserve per-tenant AUD isolation."
    },
    {
      "id": "C-03",
      "title": "As a client ADMIN, I see the full admin navigation; as BASE_USER I see a read-only subset; ROOT sees diagnostics only.",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Role filtering must be re-proven per role on the v1 dashboard path.",
      "release_notes": "Role-filtered SPA nav + API gates (`requireWriteRole`, `DIAGNOSTICS_PATHS`)."
    },
    {
      "id": "C-04",
      "title": "As a client, I have a **dev** instance for building and a **production** instance for serving, on separate hostnames.",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Dev/prod hostname split is Lerma + dispatch routing.",
      "release_notes": "`{slug}-dev.fouria.io` vs `{slug}.fouria.io`; dev is routable while the client is still `draft`."
    },
    {
      "id": "C-05",
      "title": "As a Paso4 ROOT operator, I can preview a dev instance \"as ADMIN\" (strict downgrade) to support the client.",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Strict-downgrade view-as is edge/auth logic.",
      "release_notes": "Dev-only `X-Mock-Role` cookie; never escalates; tenant slug pinned."
    },
    {
      "id": "C-08",
      "title": "As a client ADMIN, I see my profile, plan, usage, and team on the Account page.",
      "status": "🟡",
      "source_section": "5.1 Access, identity, and team",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Account page reads Lerma data; no runtime coupling.",
      "release_notes": "Profile + plan card exist; team card shows only the current user; billing uses legacy flat tiers (see C-09)."
    },
    {
      "id": "C-10",
      "title": "As a client, I can read the platform docs and privacy policy.",
      "status": "✅",
      "source_section": "5.1 Access, identity, and team",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "docs",
      "reason": "Static docs surface.",
      "release_notes": "`fouria.io` (Access-protected) + public articles; docs site is Zola."
    },
    {
      "id": "C-11",
      "title": "As a client ADMIN, I create an agent with a name, emoji/avatar, identity, and persona files (`SOUL.md`, `AGENTS.md`, `IDENTITY.md`, `USER.md`).",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Agent CRUD is gateway config/API; re-prove through the v1 proxy.",
      "release_notes": "`POST/PUT/DELETE /api/admin/agents`, persona read/write, workspace seeding."
    },
    {
      "id": "C-12",
      "title": "I choose the agent's primary model and fallbacks from a live model catalogue.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Model catalogue comes from the gateway; re-prove on v1.",
      "release_notes": "Model selector + `PUT /:id/model`; catalogue from OpenClaw."
    },
    {
      "id": "C-13",
      "title": "I connect an agent to channels (bindings), and can see/change its bindings.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Bindings are gateway config/CLI; re-prove on v1.",
      "release_notes": "`GET/POST/DELETE /:id/bindings`; admin RPC/CLI fallback."
    },
    {
      "id": "C-15",
      "title": "I run multi-agent systems, including sub-agent spawning and per-agent workspaces.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Multi-agent runtime is OpenClaw; the platform only seeds config.",
      "release_notes": "OpenClaw runtime (`maxSpawnDepth: 2`, `maxConcurrent: 3`), workspace per agent; platform only configures/seeds."
    },
    {
      "id": "C-16",
      "title": "I chat with agents through the OpenClaw Control UI / WebChat.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "rewrite",
      "impact": "gateway-api",
      "reason": "Control UI/WebChat is served through the proxy; the v1 transport is new.",
      "release_notes": "Gateway proxy (HTTP + WebSocket) at the tenant origin; device pairing required."
    },
    {
      "id": "C-17",
      "title": "I approve or reject device pairing requests, individually or in bulk, in real time.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Device pairing is gateway RPC; re-prove over the v1 WS transport.",
      "release_notes": "`GET /api/admin/devices/ws`, approve/reject/approve-all, notification bell."
    },
    {
      "id": "C-18",
      "title": "I manage sessions/conversations (history, reset, compaction) from the UI.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Session management is OpenClaw; the platform sets budgets.",
      "release_notes": "Mostly OpenClaw Control UI; the platform sets session scope, maintenance and compaction budgets."
    },
    {
      "id": "C-19",
      "title": "I set session permission modes / tool policies / exec approvals.",
      "status": "✅",
      "source_section": "5.2 Agent building and runtime",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Permission modes/tool policy are OpenClaw config.",
      "release_notes": "OpenClaw config + permissions; dashboard config editor can patch them."
    },
    {
      "id": "C-20",
      "title": "I see agent activity/usage per agent.",
      "status": "🟡",
      "source_section": "5.2 Agent building and runtime",
      "domain": "billing",
      "milestone": "BIL-3",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Per-agent usage is derived from emitted spans; re-verify on v1.",
      "release_notes": "Usage widget is tenant-wide; per-agent analytics is not a product surface (cost rows carry agent ids via spans only where emitted)."
    },
    {
      "id": "C-21",
      "title": "As a client, my agents call LLMs through the platform-managed Cloudflare AI Gateway with unified billing.",
      "status": "✅",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "AI Gateway provider path is OpenClaw/plugin config.",
      "release_notes": "`CLOUDFLARE_AI_GATEWAY_API_KEY` + account/gateway ids; `cloudflare-unified-billing` plugin from ClawHub."
    },
    {
      "id": "C-22",
      "title": "As a client, I bring my own provider API keys (BYOK) and pay the provider directly.",
      "status": "✅",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "BYOK secrets are stored in R2 and injected at boot.",
      "release_notes": "Supported: a client can store its own provider credentials as encrypted secrets from the ADMIN panel (vault/env overrides) and the runtime uses them. No dedicated key-validation UI or per-agent key routing."
    },
    {
      "id": "C-23",
      "title": "As a client, I point agents at my own self-hosted / OpenAI-compatible endpoint.",
      "status": "🟡",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Custom providers are OpenClaw config, not platform-provisioned.",
      "release_notes": "Possible through OpenClaw `models.providers` config; not managed/provisioned by FourIA."
    },
    {
      "id": "C-24",
      "title": "As a client, I see and select from all supported models (Anthropic, OpenAI, Gemini, DeepSeek, Qwen, etc.).",
      "status": "✅",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Model catalogue is OpenClaw-owned.",
      "release_notes": "Whatever the gateway/plugins expose; model catalogue is OpenClaw's."
    },
    {
      "id": "C-25",
      "title": "As a client, I get a per-model/per-provider cost breakdown.",
      "status": "✅",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Per-model cost comes from AI Gateway/span data; re-verify on v1.",
      "release_notes": "`ai-query` AE rows + AI Gateway logs; Lerma development-expense/cost views."
    },
    {
      "id": "C-26",
      "title": "As an operator, I attribute AI spend to a user identity through an Access-protected custom AI Gateway domain.",
      "status": "🟡",
      "source_section": "5.3 Models, BYOK, and AI routing",
      "domain": "billing",
      "milestone": "BIL-3",
      "disposition": "verify",
      "impact": "observability",
      "reason": "AI spend attribution is a gateway/edge configuration.",
      "release_notes": "`CF_AI_GATEWAY_CUSTOM_DOMAIN` + `CF_ACCESS_TOKEN` env vars; manual configuration."
    },
    {
      "id": "C-28",
      "title": "I connect a Telegram bot (token + DM policy) and my users can DM the agent.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "gateway-api",
      "reason": "Telegram ingress wake path must use the v1 lifecycle; delivery logic is preserved.",
      "release_notes": "Plus **managed webhook ingress** with cold-start wake, multi-account, per-tenant queue, parked-instance notice."
    },
    {
      "id": "C-32",
      "title": "I control who can reach the bot (pairing / allowlist / open / disabled) and group mention gating.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Channel access control is OpenClaw config.",
      "release_notes": "Per-channel policy fields; OpenClaw access control."
    },
    {
      "id": "C-34",
      "title": "I enable/disable and configure integrations (Microsoft Graph, memory plugins, webhooks, CRM/email connectors), bind them to agents, and see connected state.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Integrations are OpenClaw config/plugins; re-prove on v1.",
      "release_notes": "`GET /api/admin/integrations`, toggle, configure; plugin install is a prerequisite."
    },
    {
      "id": "C-35",
      "title": "I probe channel/account status.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Channel probe is gateway RPC.",
      "release_notes": "`GET /api/admin/channels/probe`, `/accounts`; meaningful for the supported Telegram channel."
    },
    {
      "id": "C-36",
      "title": "I manage per-instance channel credentials without exposing them to the model.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "rewrite",
      "impact": "edge-auth",
      "reason": "Channel credentials are injected into the v1 launch env; keep them out of the model.",
      "release_notes": "F4E1-encrypted dynamic secrets in R2; env overrides applied at boot."
    },
    {
      "id": "C-37",
      "title": "I get a direct notice if my instance is parked for maintenance while I message it.",
      "status": "✅",
      "source_section": "5.4 Channels and integrations",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Parked notice is sent by the ingress; re-prove with the v1 park path.",
      "release_notes": "Telegram-only, sent by the ingress, not the model."
    },
    {
      "id": "C-38",
      "title": "I create scheduled automations (cron) for an agent, with prompts/payloads, and run them on demand.",
      "status": "✅",
      "source_section": "5.5 Automation and eventing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Automations are OpenClaw cron; the ActivityScheduler wake path changes.",
      "release_notes": "OpenClaw automations + `/api/admin/automation` editor; schedules trigger the `ActivityScheduler` wake."
    },
    {
      "id": "C-39",
      "title": "I use event/webhook triggers (inbound webhooks, Gmail PubSub, IMAP, MCP events) to wake an agent.",
      "status": "🟡",
      "source_section": "5.5 Automation and eventing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Event triggers are OpenClaw hooks/webhooks.",
      "release_notes": "Available through OpenClaw hooks/webhooks/plugins; not all are surfaced in the FourIA UI."
    },
    {
      "id": "C-40",
      "title": "I get heartbeats and background consolidation (dreaming) on a schedule.",
      "status": "✅",
      "source_section": "5.5 Automation and eventing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Heartbeats/dreaming are OpenClaw automation jobs.",
      "release_notes": "Heartbeats are automation jobs; dev builder heartbeat reconciled to 12 h/isolated/light context. Dreaming status/toggle/config exposed."
    },
    {
      "id": "C-41",
      "title": "I can rely on a durable task buffer for platform-triggered jobs (e.g. OpenCode credits check).",
      "status": "🧭",
      "source_section": "5.5 Automation and eventing",
      "domain": "persistence",
      "milestone": "PER-3",
      "disposition": "rewrite",
      "impact": "queue",
      "reason": "Durable task buffer must use the v1 lifecycle and the central queue discipline.",
      "release_notes": "`TASKS` queue + consumer; currently only the internal `opencode-credits-check` automation."
    },
    {
      "id": "C-42",
      "title": "I can run automation workflows with approvals/human gates.",
      "status": "🟡",
      "source_section": "5.5 Automation and eventing",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Approvals are OpenClaw workflows, not a platformized flow.",
      "release_notes": "Available through OpenClaw (Lobster/approvals) but not a FourIA productized flow."
    },
    {
      "id": "C-43",
      "title": "I enable a knowledge graph / memory wiki for an agent and browse its tree and entries.",
      "status": "🟡",
      "source_section": "5.6 Knowledge, memory, and the Digital Twin",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Knowledge graph is OpenClaw config + CLI.",
      "release_notes": "`knowledgeGraph` feature flag; UI supports **tree + entry read + init** only. Editing/compile/lint/apply remain CLI/OpenClaw."
    },
    {
      "id": "C-44",
      "title": "I use vector/LanceDB memory and memory search.",
      "status": "🟡",
      "source_section": "5.6 Knowledge, memory, and the Digital Twin",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "LanceDB memory is an OpenClaw plugin.",
      "release_notes": "`memory-lancedb` plugin + config; memory search is disabled by default in the managed config."
    },
    {
      "id": "C-45",
      "title": "My agent remembers across sessions and consolidates memory (dreaming).",
      "status": "✅",
      "source_section": "5.6 Knowledge, memory, and the Digital Twin",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Cross-session memory/dreaming is OpenClaw runtime.",
      "release_notes": "OpenClaw memory + dreaming; session-store budgets bound it."
    },
    {
      "id": "C-46",
      "title": "I sync my knowledge vault with Obsidian.",
      "status": "🟡",
      "source_section": "5.6 Knowledge, memory, and the Digital Twin",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "outbound",
      "reason": "Obsidian sync uses the tunnel/port; the v1 container networking must be re-proven.",
      "release_notes": "`obsidian-sync` skill + Cloudflare Tunnel to port 18790; per-instance manual token, not a managed connector."
    },
    {
      "id": "C-49",
      "title": "I install skills from ClawHub and make them available to specific agents.",
      "status": "✅",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "ClawHub skills are OpenClaw installs.",
      "release_notes": "OpenClaw skills; per-agent allowlists; the image/skills catalogue includes `cloudflare-browser`, `obsidian-sync`, `github`, and the `gog`/`goplaces` binaries example."
    },
    {
      "id": "C-50",
      "title": "I add a per-agent workspace skill (highest-precedence, agent-private).",
      "status": "✅",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Workspace skills are files seeded by moltlazy.",
      "release_notes": "E.g. the dev-only `fouria-product-build` skill."
    },
    {
      "id": "C-51",
      "title": "I declare software my skills need (binaries, apt/npm/plugins) and have it reinstalled after upgrades/sleep.",
      "status": "✅",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "outbound",
      "reason": "Declared software provisioning uses the sandbox exec + R2 bridge; adapt to v1.",
      "release_notes": "`softwareProvisioning` flag + manifest (opt-in per customer); check/install/verify loop; on-demand reconcile; progress + report UI."
    },
    {
      "id": "C-52",
      "title": "I use browser automation (CDP) from an agent.",
      "status": "✅",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "outbound",
      "reason": "Browser CDP uses the cdp.internal bridge; register it on the v1 DO.",
      "release_notes": "`BROWSER` binding + `/cdp/*` proxy with a CDP secret; **experimental** on the current runtime."
    },
    {
      "id": "C-53",
      "title": "I connect custom MCP servers / use MCP tools.",
      "status": "🟡",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "MCP servers are OpenClaw config/plugins.",
      "release_notes": "Available through OpenClaw config/plugins; public MCP tool access is post-beta."
    },
    {
      "id": "C-54",
      "title": "I run shell commands in a sandbox and approve dangerous operations.",
      "status": "✅",
      "source_section": "5.7 Skills, software, and tooling",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "container-exec",
      "reason": "Shell exec/approvals use the container process API; adapt to v1.",
      "release_notes": "OpenClaw exec/sandbox + approvals; platform does not expose a separate shell to tenants."
    },
    {
      "id": "C-55",
      "title": "My agent state, sessions, memory, config, and workspace are automatically backed up, encrypted at rest.",
      "status": "✅",
      "source_section": "5.8 Storage, persistence, and S3",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Automatic backups must use DirectoryBackup records on v1.",
      "release_notes": "F4E1 AES-256-GCM chunked archive in per-tenant R2 (`fouria-backup-*`), retention 3, scheduled + idle/deprovision snapshots."
    },
    {
      "id": "C-56",
      "title": "I can create a snapshot now, list history, and restore a chosen archive.",
      "status": "✅",
      "source_section": "5.8 Storage, persistence, and S3",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Snapshot/list/restore must use the v1 record format.",
      "release_notes": "Backups page (ADMIN), async durable jobs, \"set as recovery point\" option, recovery-point badge."
    },
    {
      "id": "C-57",
      "title": "I can see which snapshot a cold boot will restore.",
      "status": "✅",
      "source_section": "5.8 Storage, persistence, and S3",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Recovery point must name the v1 committed record.",
      "release_notes": "Stable recovery point + restore target surfaced on the loading page and Backups page."
    },
    {
      "id": "C-58",
      "title": "I can version and diff gateway configuration.",
      "status": "✅",
      "source_section": "5.8 Storage, persistence, and S3",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "verify",
      "impact": "backup",
      "reason": "Config versions live in R2; re-verify after a v1 restore.",
      "release_notes": "`configs/` versions + `ConfigVersionsTable`/`DiffTool`; restored config becomes stable."
    },
    {
      "id": "C-59",
      "title": "I can store client documents (proposals, PDFs, sheets) and browse them.",
      "status": "🧭",
      "source_section": "5.8 Storage, persistence, and S3",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Client docs are R2 objects; no container coupling.",
      "release_notes": "**Dev-only operator surface** (Lerma client profile + tenant `/_admin/docs`): R2 docs, markdown/PDF/CSV/image preview, upload, git-like versioning/rollback, docs backups."
    },
    {
      "id": "C-64",
      "title": "I can trigger a manual backup and watch its progress.",
      "status": "✅",
      "source_section": "5.9 Backups and recovery (customer-visible)",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Manual backup progress must be driven by the v1 durable job.",
      "release_notes": "Durable job + WS/HTTP status + notification bell."
    },
    {
      "id": "C-65",
      "title": "I can restore an older backup without it being overwritten by the next boot.",
      "status": "✅",
      "source_section": "5.9 Backups and recovery (customer-visible)",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Restoring an older archive must restore a v1 record and force-promote it.",
      "release_notes": "Explicit restore force-promotes to the recovery point (or not, with `setCurrent=0`), writers quiesced, no remount loop."
    },
    {
      "id": "C-66",
      "title": "Backups survive container replacement and idle-sleep.",
      "status": "✅",
      "source_section": "5.9 Backups and recovery (customer-visible)",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Backups must survive a v1 container replacement.",
      "release_notes": "Restore runs before launch; `OPENCLAW_RESTORED` skips re-onboarding."
    },
    {
      "id": "C-67",
      "title": "A failed backup never tears down my container.",
      "status": "✅",
      "source_section": "5.9 Backups and recovery (customer-visible)",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "verify",
      "impact": "backup",
      "reason": "Fail-closed deprovision must keep its behavior on v1.",
      "release_notes": "Deprovision/freeze are fail-closed on snapshot failure."
    },
    {
      "id": "C-69",
      "title": "I see the live health of my instance (gateway up/starting/sleeping), boot progress, and boot logs.",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "rewrite",
      "impact": "observability",
      "reason": "Health/boot progress reads the legacy process API; adapt to v1.",
      "release_notes": "`/api/health`, `/api/health-ws`, `/healthz`, `/api/startup/ws`, CRT-style loading page + slow-step/repair notices."
    },
    {
      "id": "C-70",
      "title": "I see the status of Cloudflare components (AI Gateway, Worker, R2, Access).",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Cloudflare component status is Worker-local.",
      "release_notes": "`/api/health-components` + home widget (role-dependent)."
    },
    {
      "id": "C-71",
      "title": "I see backup history, config versions, and software provisioning status on the home page.",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Home widgets aggregate existing endpoints.",
      "release_notes": "Home widgets."
    },
    {
      "id": "C-72",
      "title": "I see activity and task audit logs, with filters and pagination.",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Audit logs use gateway WS RPC; re-prove on v1.",
      "release_notes": "OpenClaw audit ledger over Gateway WS RPC (`audit.activity.list`) + tasks table."
    },
    {
      "id": "C-73",
      "title": "I see my credit spend and action log.",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Credit spend widget reads the AE summary; re-verify on v1.",
      "release_notes": "Usage & Billing widget (`/api/admin/costs/v2/summary`), production/plan-gated."
    },
    {
      "id": "C-74",
      "title": "I see token/model cost detail per conversation.",
      "status": "🟡",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Token/model detail is OpenClaw usage; platform aggregates only.",
      "release_notes": "OpenClaw usage/Control UI; platform aggregates only."
    },
    {
      "id": "C-75",
      "title": "I see platform operator actions on my tenant (who froze/upgraded/restored).",
      "status": "🟡",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Operator action history is Lerma data; re-verify the v1 events.",
      "release_notes": "Lerma deployment/run history + health events are operator-visible; no tenant-facing platform audit feed. **V2 audit: TBD** (T-06)."
    },
    {
      "id": "C-76",
      "title": "My message content is never logged.",
      "status": "✅",
      "source_section": "5.10 Observability and audit (customer-visible)",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "observability",
      "reason": "No-content policy must be re-proven on the v1 OTLP path.",
      "release_notes": "No-logs policy; observability stores metadata only; AI Gateway handles PII masking."
    },
    {
      "id": "C-77",
      "title": "I am billed per **completed** action (message or automation) at the credit weight my plan assigns. Failures consume nothing.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Success-only consumption is Lerma ledger logic.",
      "release_notes": "Success-only consumption; semantic action types."
    },
    {
      "id": "C-78",
      "title": "I get the credit allowance my plan assigns (Tarjetero closed pricing = 5,000 credits) and can see my balance.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Credit allowance/balance is Lerma data.",
      "release_notes": "Billing plan template + pool; `restock_day` monthly non-accumulative reset. VISION remains the public target; each client's allowance is contracted separately."
    },
    {
      "id": "C-79",
      "title": "Priced actions match my business (e.g. `telegram_query`, `queue_reevaluation`, `signal_analysis`, `email_draft`, `review_analysis`, plus 0-credit fixed actions).",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Semantic action pricing is Lerma configuration.",
      "release_notes": "Per-plan action rows with `action_type` + `match_rule`; most-specific rule wins."
    },
    {
      "id": "C-80",
      "title": "The same business unit is never double-billed across retries/traces.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "action_key idempotency is Lerma ledger logic.",
      "release_notes": "`action_key` idempotency; trace-level precedence (`email_draft`/`review_analysis` suppress `telegram_query`)."
    },
    {
      "id": "C-81",
      "title": "I can buy extra credit packs / top up.",
      "status": "🟡",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Credit packages are ROOT-configurable; no self-serve flow.",
      "release_notes": "Credit packages are ROOT-configurable in the data model; no self-serve purchase flow. Top-ups will go through the V2 Payment Service (T-05)."
    },
    {
      "id": "C-82",
      "title": "I get a low-credit email before I run out.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Low-credit email is Lerma notification logic.",
      "release_notes": "Threshold (`notify_threshold_pct`, default 20 %), one notification per episode."
    },
    {
      "id": "C-83",
      "title": "Autobuy tops me up when balance goes negative.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Autobuy is Lerma credit logic.",
      "release_notes": "Package + cap; failure is `:autobuy_failed`."
    },
    {
      "id": "C-84",
      "title": "I get a grace margin before/after zero, and service freezes only for new billable actions.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Grace/freeze thresholds are Lerma + the freeze flag.",
      "release_notes": "`overrun_margin_credits`, `freeze_grace_credits`; durable R2 freeze flag; in-flight completes; basic service continues."
    },
    {
      "id": "C-88",
      "title": "AI costs are billed separately from credits.",
      "status": "✅",
      "source_section": "5.11 Billing and plan (customer-visible)",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Credits vs AI cost separation is a Lerma invariant.",
      "release_notes": "Credits vs cost tracking are separate by design."
    },
    {
      "id": "C-89",
      "title": "I get in-app notifications for device pairing, Telegram queue, backups, maintenance jobs.",
      "status": "✅",
      "source_section": "5.12 Notifications and support",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "In-app notifications depend on v1 device/ingress/backup events.",
      "release_notes": "Notification bell + WebSocket providers; survives navigation."
    },
    {
      "id": "C-90",
      "title": "I get email notifications for invitations and low credits.",
      "status": "✅",
      "source_section": "5.12 Notifications and support",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Email delivery is Lerma/Cloudflare Email Service.",
      "release_notes": "Cloudflare Email Service + Swoosh; background delivery with PubSub outcome."
    },
    {
      "id": "O-01",
      "title": "Create a client (name, slug, partner optional, billing plan/template).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Client creation is Lerma.",
      "release_notes": "Lerma `ClientLive.New`, slug uniqueness, template assignment."
    },
    {
      "id": "O-02",
      "title": "Invite client users and assign them to specific instances with a role; resend/reject/delete; sync accepted users to Access groups.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Invitations/Access groups are Lerma + edge.",
      "release_notes": "Invitations, `client_user_instances`, Access group reconciliation; `invited`/`rejected` excluded."
    },
    {
      "id": "O-03",
      "title": "Provision a **dev** instance for a client (lazy/dev-first flow).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Dev provisioning must add the v1 container entry for approved staging tenants.",
      "release_notes": "Pipeline runs while the client is `draft`; dev instance is routable independently."
    },
    {
      "id": "O-04",
      "title": "Provision a **production** instance (requires billing plan; client → `production`).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Production provisioning stays legacy until a production cutover is approved.",
      "release_notes": "`{:error, :billing_plan_required}` otherwise."
    },
    {
      "id": "O-05",
      "title": "Provision a **Paso4-exclusive** internal instance (no client, no billing, `@paso4.io` only).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Paso4 scope is Lerma + dispatch email-domain checks.",
      "release_notes": "`scope: \"paso4\"`, domain-scoped Access group, `paso4-dev` agent roster, Dispatch email-domain re-check."
    },
    {
      "id": "O-06",
      "title": "Cancel an in-flight provisioning run and roll back completed steps in reverse order.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Rollback must also tear down the v1 container entry/DO on a failed v1 provision.",
      "release_notes": "Best-effort cleanup per resource; pipeline events streamed to UI."
    },
    {
      "id": "O-07",
      "title": "Deprovision an instance (snapshot first, then destroy).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Deprovision must snapshot a v1 record before destroy.",
      "release_notes": "Fail-closed snapshot; non-prod may delete Cloudflare resources, production is protected."
    },
    {
      "id": "O-08",
      "title": "Deprovision/archive a client (all instances, Access, gateways, buckets).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Client archive must clean the v1 resources too.",
      "release_notes": "Best-effort per resource; client → `archived`."
    },
    {
      "id": "O-09",
      "title": "Freeze/unfreeze (billing protection), start/stop, restart an instance.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Freeze/start/stop/restart must use the v1 lifecycle; freeze stays destructive by design.",
      "release_notes": "Freeze = `sandbox.destroy()` after snapshot; billing freeze is a separate customer flag."
    },
    {
      "id": "O-10",
      "title": "Change an instance's type (resize).",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Resize replaces the container; the v1 rollout path must restore the v1 record.",
      "release_notes": "Cloudflare rollout (`full_auto` + `target_configuration`) replaces the container → restore."
    },
    {
      "id": "O-11",
      "title": "Reassign an instance to another AI Gateway.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "AI Gateway reassignment is a Worker binding redeploy.",
      "release_notes": "Redeploys the worker binding; shared pool entries have `max_instances`."
    },
    {
      "id": "O-12",
      "title": "Manage per-instance env vars/secrets; reveal gateway token; toggle debug routes.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Env/secrets/debug-route injection must be re-proven on the v1 launch.",
      "release_notes": "Lerma instance Tools; secrets as `secret_text`, env overrides in R2."
    },
    {
      "id": "O-13",
      "title": "Deploy a specific release version to an instance, and view deployment history.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Release deploy must resolve the v1 image + bundle pair.",
      "release_notes": "`fetch_bundle` from GitHub release / registry image; deployments modal + run history."
    },
    {
      "id": "O-14",
      "title": "Upgrade all instances of a client/application.",
      "status": "🟡",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Fleet upgrade is partial; keep per-instance and re-verify v1.",
      "release_notes": "`upgrade_all_instances_async` exists; fleet cohort/abort policy is **not** implemented (V2 T-08, definition TBD)."
    },
    {
      "id": "O-15",
      "title": "Bootstrap the reserved staging tenant.",
      "status": "✅",
      "source_section": "6.1 Tenant lifecycle and onboarding",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Staging tenant bootstrap is Lerma.",
      "release_notes": "`Lerma.StagingTenant` idempotent rename/seed (no-op in production)."
    },
    {
      "id": "O-17",
      "title": "Provision an instance atomically: AI gateway → Access app/group → R2 bucket → bundle fetch → Telegram queue → worker deploy → consumer → tags → instance record → cache invalidation → production transition.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "rewrite",
      "impact": "control-plane",
      "reason": "Atomic provisioning must include the v1 container entry + SandboxV1 binding.",
      "release_notes": "`@pipeline` in `TenantProvisioner`; reverse-order rollback."
    },
    {
      "id": "O-18",
      "title": "Keep the AI Gateway catalogue authoritative in Cloudflare and apply local policy overrides.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "AI Gateway catalogue is Lerma.",
      "release_notes": "`AiGateways` merges Cloudflare catalog with `max_instances`/`enabled`/`environment`; least-loaded selection; `:no_ai_gateway_capacity`."
    },
    {
      "id": "O-19",
      "title": "Authenticated gateways by default, with explicit BYOK opt-out.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Authenticated gateways are Lerma policy.",
      "release_notes": "`authentication: true` unless an entry opts out; `reconcile_all_authentication/0` repairs drift."
    },
    {
      "id": "O-20",
      "title": "Create/destroy per-instance Access apps + groups; path-scoped health app with no role requirement.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Access apps/groups are Lerma/Cloudflare.",
      "release_notes": "`AccessPolicy`; ROOT group for operators; health app allows any authenticated user + service token."
    },
    {
      "id": "O-21",
      "title": "Create a per-instance R2 bucket and resolve S3 credentials (shared or per-instance scoped token).",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "R2 bucket/S3 creds stay for legacy; v1 DirectoryBackup uses the binding.",
      "release_notes": "Mandatory; `R2_TOKEN_STRATEGY` = `auto` / `shared` / `per_instance`; rollout on provisioning, backfilled on upgrade."
    },
    {
      "id": "O-22",
      "title": "Deploy the tenant Worker into a dispatch namespace, with correct DO migrations and container enablement.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "rewrite",
      "impact": "control-plane",
      "reason": "DO migrations + container enablement must add SandboxV1 (durable_object).",
      "release_notes": "Full container entry on every update; `10074` migrated-class retry; `new_sqlite_classes` set."
    },
    {
      "id": "O-23",
      "title": "Tag workers for observability and bulk operations.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Worker tags are Lerma.",
      "release_notes": "`worker_tags` step."
    },
    {
      "id": "O-24",
      "title": "Invalidate the dispatch KV cache after changes.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "KV invalidation is dispatch.",
      "release_notes": "`/_invalidate/:slug` (bearer-protected)."
    },
    {
      "id": "O-25",
      "title": "Manage the deployable-application catalogue (registry namespace, release/unstable channels, logo, instances).",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Applications catalogue is Lerma.",
      "release_notes": "Lerma Applications pages; instances always linked to an application."
    },
    {
      "id": "O-26",
      "title": "Roll out image versions through release channels.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Release channels must carry both runtime images and the matching shim.",
      "release_notes": "CI publishes `unstable-<sha>`; release promotes to `<tag>/latest`; Lerma deploys by version."
    },
    {
      "id": "O-27",
      "title": "Route tenants on `*.fouria.io` with platform + environment axes.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Hostname routing is dispatch.",
      "release_notes": "`{slug}`, `{slug}-dev`, `staging-{slug}`, `staging-{slug}-dev`; `dash`/`dev-dash` bypass; `hooks` ingress."
    },
    {
      "id": "O-28",
      "title": "Resolve the tenant from hostname with a KV cache and Supabase fallback; forward role + billing metadata.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Tenant resolution is dispatch.",
      "release_notes": "60 s KV TTL; `X-FourIA-Role`, `X-FourIA-Metadata`."
    },
    {
      "id": "O-29",
      "title": "Apply the operational route gate.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "The route gate must not gate on a health-derived error; re-verify v1.",
      "release_notes": "`draft`/`suspended`/`archived` rejected; `provisioning`/`frozen`/`stopped` → 503; ROOT exempt; health `error` never gates."
    },
    {
      "id": "O-30",
      "title": "Provide a Telegram ingress host outside Access.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Telegram ingress host is dispatch.",
      "release_notes": "`hooks.fouria.io/v1/<slug>/<account>`; secret auth; freeze policy; per-tenant queue."
    },
    {
      "id": "O-31",
      "title": "Keep staging and production isolated.",
      "status": "✅",
      "source_section": "6.2 Provisioning pipeline and resources",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Environment isolation is infrastructure.",
      "release_notes": "Separate Supabase, dispatch namespaces, buckets/gateways suffix, queues."
    },
    {
      "id": "O-32",
      "title": "Upgrade a running tenant with zero data loss: checkpoint-park → replace image → resume.",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Zero-loss rollout must park/resume the v1 container and restore the v1 record.",
      "release_notes": "Fail-closed checkpoint (sleeping instance exempt); session drain to read-only; Telegram parked notice; TTL backstop."
    },
    {
      "id": "O-33",
      "title": "Roll back a failed upgrade without destroying the tenant.",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Upgrade rollback must preserve the v1 DO/bucket and resume safely.",
      "release_notes": "Upgrade rollback preserves script/container/DOs/bucket; resume best-effort on error paths."
    },
    {
      "id": "O-34",
      "title": "Promote a build from develop to staging, then from staging to production.",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Build promotion must carry the v1 image + bundle pair.",
      "release_notes": "GitHub Actions (`deploy-fouria`, `deploy-dashboard`, `promote-staging`); release promotes already-built artifacts instead of rebuilding."
    },
    {
      "id": "O-35",
      "title": "Push a built agent workflow from dev to production.",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Agent-workflow promotion uses the private R2 transport; re-verify on v1.",
      "release_notes": "Full promotable manifest (config + agents + workspace; **no** runtime state), private R2 stage/pull, checkpoint + soft reload. No public import route."
    },
    {
      "id": "O-37",
      "title": "Promote a client's built agent workflow from its **dev** instance to its **production** instance (the V1 GitFlow).",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Client dev -> production promotion is preserved; re-verify the apply-on-boot path.",
      "release_notes": "Full promotable manifest (config + agents + workspace; no runtime state), private R2 stage/pull (production applies on boot), checkpoint + soft reload; the built-in promotion path."
    },
    {
      "id": "O-39",
      "title": "Keep client agent definitions in a private, reviewable repo separate from the platform.",
      "status": "🟡",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Dev workspaces/client docs are R2 objects.",
      "release_notes": "Dev-only `fouria-builder` workspaces + client-docs R2; no per-client git repo in the platform."
    },
    {
      "id": "O-40",
      "title": "Migrate OpenClaw versions safely.",
      "status": "✅",
      "source_section": "6.3 Deployments, upgrades, and GitFlow",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "OpenClaw version migration is single-sourced; re-verify the v1 image.",
      "release_notes": "`catalog.openclaw` single source of truth; migration skill; CI validates `openclaw config validate`; plugin repo tracks the same release."
    },
    {
      "id": "O-41",
      "title": "Encrypt every snapshot at rest (AES-256-GCM, chunked, per-object HKDF).",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "F4E1 must wrap the v1 DirectoryBackup record, not only .sqsh.",
      "release_notes": "F4E1; `BACKUP_ENCRYPTION_REQUIRED` fail-closed; legacy plaintext restorable."
    },
    {
      "id": "O-42",
      "title": "Schedule snapshots for every running tenant from the Dispatch cron, without waking sleepers.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Scheduled snapshots must create v1 records without waking sleepers.",
      "release_notes": "15 min prod / hourly staging; non-waking `isRuntimeActive`; queue fan-out + per-tenant jitter."
    },
    {
      "id": "O-43",
      "title": "Keep a bounded, self-healing backup catalogue.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "The catalogue must track v1 records with the same crash-consistent commit.",
      "release_notes": "Retention 3; crash-consistent commit; pure reads; explicit reconcile; `POST /storage/reconcile`."
    },
    {
      "id": "O-44",
      "title": "Snapshot before deprovision/freeze, and never destroy without a committed archive.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Deprovision/freeze must require a committed v1 record.",
      "release_notes": "Fail-closed; `stopIfIdle` re-check; recent-snapshot reuse inside the idle window."
    },
    {
      "id": "O-45",
      "title": "Restore from a recovery point on cold boot, or explicitly from an older archive.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Cold boot/explicit restore must use the v1 record + pointer.",
      "release_notes": "Recovery-point promotion, maintenance window, writer quiesce, post-restore config capture, no remount loop."
    },
    {
      "id": "O-46",
      "title": "Run backups/restores as durable jobs with progress and status.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-3",
      "disposition": "rewrite",
      "impact": "queue",
      "reason": "Backup/restore jobs must run the v1 phases under the durable job state machine.",
      "release_notes": "`ActivityScheduler` jobs, WebSocket status, step budgets, lease renewal."
    },
    {
      "id": "O-47",
      "title": "Avoid re-archiving an unchanged tenant.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Change-aware skip must understand v1 records.",
      "release_notes": "Change detection + optional watch (flags default **off**); interval floor."
    },
    {
      "id": "O-49",
      "title": "Measure persistence cost/latency before reworking the policy.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "billing",
      "milestone": "BIL-3",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Persistence telemetry must be emitted from v1 phases.",
      "release_notes": "Phase 0 events: `persistence-snapshot`, `persistence-restore`, `backup-change-window`."
    },
    {
      "id": "O-50",
      "title": "Recover a corrupt OpenClaw state DB automatically.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "rewrite",
      "impact": "container-exec",
      "reason": "Doctor/SQLite repair must run through the v1 exec adapter.",
      "release_notes": "Detect malformed SQLite → queue `doctor --fix` → re-queue boot; loading page shows repair."
    },
    {
      "id": "O-51",
      "title": "Restore legacy `.clawdbot`/`/root` layouts.",
      "status": "✅",
      "source_section": "6.4 Persistence and disaster recovery",
      "domain": "persistence",
      "milestone": "PER-1",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Legacy .clawdbot//root import is part of the v1 conversion.",
      "release_notes": "Symlink-preserving tar bridge, prefix migration."
    },
    {
      "id": "O-52",
      "title": "Get a single health contract for gateway readiness/liveness/startup.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "rewrite",
      "impact": "gateway-api",
      "reason": "Health contract must read the v1 lifecycle/process API.",
      "release_notes": "`/api/health` (503 until ready), passive `?passive=1` (sleeping), `/healthz` (sub-second, non-waking), `/api/status` legacy alias."
    },
    {
      "id": "O-53",
      "title": "Probe tenants without waking them.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "rewrite",
      "impact": "gateway-api",
      "reason": "Non-waking probe must use the v1 lifecycle read.",
      "release_notes": "Lerma `HealthMonitor` → `?passive=1`; `sleeping` = 200; probes never write the backup catalogue."
    },
    {
      "id": "O-54",
      "title": "Track instance uptime and state transitions.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Uptime events are Lerma; re-verify the v1 transition source.",
      "release_notes": "`instance_health_events` (one row per transition), time-weighted uptime, 24 h graph."
    },
    {
      "id": "O-55",
      "title": "Receive worker logs/traces without storing content.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Sanitized OTLP ingest is transport-independent; re-verify the v1 bridge.",
      "release_notes": "Cloudflare Observability destinations → `POST /api/ingest/otel/v1/{logs,traces}`; allowlist parser; dedupe; 90-day retention."
    },
    {
      "id": "O-56",
      "title": "Compute invocation uptime/failure ratios from traces.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Uptime ratios come from pushed root spans.",
      "release_notes": "Request-weighted, root spans only; \"unknown\" when no events."
    },
    {
      "id": "O-57",
      "title": "Capture sanitized alert batches from the tail Worker.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Tail-worker alert batches are transport-independent.",
      "release_notes": "`fouria-tail` → Lerma `/api/ingest/worker-events`."
    },
    {
      "id": "O-58",
      "title": "See per-tenant infrastructure/AI cost.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Per-tenant cost comes from AE rows; re-verify the v1 event families.",
      "release_notes": "AE events: `ai-query`, `container-active`, `r2-operation`, `cron-trigger`, `ws-session`, `billable-action`, `gateway-resources`, `persistence-*`, `workspace-snapshot`, `backup-change-window`."
    },
    {
      "id": "O-59",
      "title": "Diagnose gateway memory.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "rewrite",
      "impact": "observability",
      "reason": "Gateway memory sampling must use the v1 process API.",
      "release_notes": "RSS/threads on health + AE; dev watchdog at 75 % cgroup; instance-aware threshold."
    },
    {
      "id": "O-60",
      "title": "Diagnose a stuck/looping boot.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "rewrite",
      "impact": "container-exec",
      "reason": "Stuck-boot detection must use the v1 phase tracker/process API.",
      "release_notes": "Phase tracker (`probe→restore→launch→port-wait`), late-ready adoption, stuck reset/kill/reprovision, slow-step notice, boot terminal."
    },
    {
      "id": "O-61",
      "title": "Repair a tenant without the gateway running.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "rewrite",
      "impact": "container-exec",
      "reason": "Repair without the gateway must run doctor through the v1 exec adapter.",
      "release_notes": "Doctor/SQLite durable jobs, \"Repair Environment\" bar, config editor availability, rescue container, reprovision."
    },
    {
      "id": "O-62",
      "title": "Recover from a destroyed/stale container.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "rewrite",
      "impact": "container-lifecycle",
      "reason": "Stale/orphan recovery must recreate the v1 container application.",
      "release_notes": "Stale 500 + admission-error classification, grace window, `POST /debug/reprovision`, orphan recovery."
    },
    {
      "id": "O-63",
      "title": "Inspect and control a tenant from `/debug/*`.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Debug routes are ROOT-only; re-verify every diagnostic against v1.",
      "release_notes": "ROOT-only, `DEBUG_ROUTES=true`: processes, logs, CLI, container config, lock, sqlite integrity, restart/rescue/destroy."
    },
    {
      "id": "O-66",
      "title": "Correlate a Worker error to its container process / Ray ID.",
      "status": "✅",
      "source_section": "6.5 Health, observability, and incident response",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Structured events + redaction are runtime-independent.",
      "release_notes": "Structured events, `safeHeaderLog` (credential-free), process ids, Ray IDs."
    },
    {
      "id": "O-67",
      "title": "Fan out scheduled work to the whole fleet without truncation.",
      "status": "✅",
      "source_section": "6.6 Fleet operations and scale",
      "domain": "persistence",
      "milestone": "PER-3",
      "disposition": "rewrite",
      "impact": "queue",
      "reason": "Fleet fan-out must not truncate or wake sleepers on v1.",
      "release_notes": "Paginated KV sweep, `CONTROL_QUEUE` batches of 100, per-tenant FNV-1a jitter, bounded direct fallback (8)."
    },
    {
      "id": "O-68",
      "title": "Run periodic backups without waking sleeping tenants.",
      "status": "✅",
      "source_section": "6.6 Fleet operations and scale",
      "domain": "persistence",
      "milestone": "PER-2",
      "disposition": "rewrite",
      "impact": "backup",
      "reason": "Periodic backups must use the v1 lifecycle read + record format.",
      "release_notes": "Non-waking read, skip `not-running`."
    },
    {
      "id": "O-69",
      "title": "Operate multiple environments/namespaces.",
      "status": "✅",
      "source_section": "6.6 Fleet operations and scale",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Environment/namespace separation is infrastructure.",
      "release_notes": "staging/production Supabase, namespaces, buckets, gateways, queues."
    },
    {
      "id": "O-70",
      "title": "Scale beyond current Cloudflare limits.",
      "status": "🟡",
      "source_section": "6.6 Fleet operations and scale",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Scale limits must be re-checked for the v1 container policy.",
      "release_notes": "Limits: KV 1,000 keys/page; subrequest budgets; 10/20 AI gateways per account; container app `max_instances` 3 (base/staging) / 5 (production) in the template; single `WEUR` region; one container and one state-DB writer per tenant. No fleet aggregate."
    },
    {
      "id": "O-72",
      "title": "Define reusable billing-plan templates and per-client plans.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Billing templates are Lerma.",
      "release_notes": "Templates + actions; assign template; margins derived from base; `restock_day`, `notify_threshold_pct`, autobuy."
    },
    {
      "id": "O-73",
      "title": "Price semantic actions and match rules per client.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Action pricing/match rules are Lerma.",
      "release_notes": "`BillingPlanAction` + `match_rule` (channel/agent/tool/skill/harness/trigger/outcome/span/action_key)."
    },
    {
      "id": "O-74",
      "title": "Ingest billable actions reliably.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "billing",
      "reason": "Ingest reliability must be re-proven from v1 spans.",
      "release_notes": "OTel traces → `billable-action` AE rows → `BILLING_QUEUE`; `/api/credits/v1/ingest`; drain cron."
    },
    {
      "id": "O-75",
      "title": "Reconcile AE against the credit ledger.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "billing",
      "reason": "AE/ledger reconcile must be re-proven on v1 emission.",
      "release_notes": "`BillingReconcile` watermarks, 15 min loop, retryable vs permanent skips."
    },
    {
      "id": "O-76",
      "title": "Restock monthly (non-accumulative).",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Monthly restock is Lerma scheduler logic.",
      "release_notes": "Daily scheduler keyed on `restock_day`, idempotent per UTC day."
    },
    {
      "id": "O-77",
      "title": "Notify low credit / autobuy / freeze.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Low-credit/autobuy/freeze notifications are Lerma.",
      "release_notes": "Email, package purchase + cap, freeze signal at grace threshold."
    },
    {
      "id": "O-78",
      "title": "Manage credit pools, packages, transactions (purchase/consume/expire/refund).",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "Credit pools/packages/transactions are Lerma.",
      "release_notes": "`Credits` context."
    },
    {
      "id": "O-79",
      "title": "Calculate the **development cost associated with each tenant**, separately from billable events.",
      "status": "🟡",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-3",
      "disposition": "verify",
      "impact": "billing",
      "reason": "Dev cost must move to per-instance OpenCode key attribution.",
      "release_notes": "V1 has `Lerma.DevelopmentExpense` (dev/staging non-billable infra + AI, per client + global rollup). **V2 requirement (T-11):** attribute **OpenCode Go** usage with a dedicated **API key per instance** and compute dev cost per tenant from that; **no OpenClaw OTEL dependency**. Never a billable event, never credits."
    },
    {
      "id": "O-80",
      "title": "Query cost analytics.",
      "status": "✅",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-1",
      "disposition": "verify",
      "impact": "observability",
      "reason": "Cost analytics queries must see v1 rows.",
      "release_notes": "`/analytics/v1/costs/:customer`, `/analytics/v1/query`, `/analytics/v1/workflow/:id`; cost calculator constants."
    },
    {
      "id": "O-83",
      "title": "One billing system.",
      "status": "🟡",
      "source_section": "6.7 Billing operations and cost",
      "domain": "billing",
      "milestone": "BIL-2",
      "disposition": "preserve",
      "impact": "billing",
      "reason": "The legacy Stripe tiers are deprecated; Lerma is the single owner.",
      "release_notes": "**V1 has two.** The legacy Stripe flat tiers in the tenant Worker are deprecated and will be removed; the Lerma credit-plan system is the single V2 source of truth (T-05)."
    },
    {
      "id": "O-86",
      "title": "Every request is authenticated at the edge with a per-tenant audience.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Access JWT/AUD verification is edge-only.",
      "release_notes": "Access JWT + JWKS; apex AUD resolution; ROOT group; staging ROOT-only."
    },
    {
      "id": "O-87",
      "title": "Enforce RBAC and cross-tenant isolation.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "RBAC/cross-tenant isolation is edge + route gates.",
      "release_notes": "ROOT/ADMIN/BASE_USER; `canAccessCustomer`; tenant slug pinned; bridges scoped to slug. **V2 may add customizable permission sets** on top of these roles (T-12)."
    },
    {
      "id": "O-88",
      "title": "Keep ROOT out of customer content.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "ROOT diagnostics-only restriction is route gating.",
      "release_notes": "ROOT restricted to `DIAGNOSTICS_PATHS`; releases/commits ADMIN-only; dev view-as is strict downgrade."
    },
    {
      "id": "O-89",
      "title": "Keep secrets out of config and logs.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Secret-free config/SecretRef must be re-proven on the v1 launch.",
      "release_notes": "`secret_text` + F4E1 R2; secret-free `$include`; gateway token env SecretRef; header redaction."
    },
    {
      "id": "O-90",
      "title": "Encrypt data at rest and in transit.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "F4E1 at rest must cover v1 records and configs.",
      "release_notes": "TLS edge→origin; F4E1 archives/configs/secrets; optional required mode."
    },
    {
      "id": "O-91",
      "title": "Keep AI providers away from customer data.",
      "status": "🟡",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "AI Gateway PII/no-logs policy is gateway configuration.",
      "release_notes": "AI Gateway native PII filtering + no-logs policy; depends on gateway configuration, not platform-enforced redaction."
    },
    {
      "id": "O-92",
      "title": "Isolate tenants across storage, compute, metrics, queues, DOs.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Per-tenant isolation must be re-proven across v1 DO/bucket/queue.",
      "release_notes": "Per-tenant bucket, worker, container app, DOs, AE dataset rows, queues, namespace."
    },
    {
      "id": "O-93",
      "title": "Distinguish billing freeze from tenant suspension.",
      "status": "✅",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Billing freeze vs suspension is a Lerma + route-gate distinction.",
      "release_notes": "Freeze blocks new billable actions only; suspension denies everything."
    },
    {
      "id": "O-94",
      "title": "Audit operator actions immutably.",
      "status": "🟡",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-3",
      "disposition": "verify",
      "impact": "edge-auth",
      "reason": "Operator audit is partial; re-verify v1 actions are recorded.",
      "release_notes": "Not a complete V1 capability. **V2 requirement, definition TBD**, gated on a retention policy and a Terms/Privacy review (T-06). Today: deployment/run events, health events, structured logs, AE."
    },
    {
      "id": "O-95",
      "title": "Rate-limit abuse.",
      "status": "🟡",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Rate limits are edge/ingress.",
      "release_notes": "Auth pre-check, Telegram ingress secret + rate limit, plan CPU/subrequest limits; no global API rate limiter."
    },
    {
      "id": "O-96",
      "title": "Rotate credentials.",
      "status": "🟡",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-2",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Credential rotation is manual, runtime-independent.",
      "release_notes": "Manual: `mix lerma.r2_token`, gateway token reveal, secret update; no scheduled rotation."
    },
    {
      "id": "O-98",
      "title": "Provide custom domains / per-tenant hostnames and TLS.",
      "status": "🟡",
      "source_section": "6.8 Security, isolation, and compliance",
      "domain": "security",
      "milestone": "SEC-1",
      "disposition": "preserve",
      "impact": "edge-auth",
      "reason": "Custom domains/TLS are routing, not runtime.",
      "release_notes": "V1 uses `{slug}.fouria.io` (+ `-dev`, `staging-`). **V2 requirement (T-03):** everything is routed through **`fouria.io`**, `/_admin` is removed, and the worker UI + RBAC are ported into the Elixir app. Production does not expose the OpenClaw Control UI; dev keeps it reachable via the corporate VPN."
    },
    {
      "id": "O-100",
      "title": "Generate and own OpenClaw config deterministically at boot.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Moltlazy config generation is runtime-independent; re-verify the v1 boot.",
      "release_notes": "`moltlazy patch`: gateway/session/tools/logging `$include`, inline gateway/agents, feature-gated memory/plugins/channels, workspace seeding; idempotent, secret-free, `--only`."
    },
    {
      "id": "O-101",
      "title": "Control features per customer.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-2",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "Feature flags are env/bindings; re-verify the v1 launch consumes them.",
      "release_notes": "`MOLTLAZY_FEATURE_FLAGS` JSON binding: `knowledgeGraph`, `unifiedBilling`, `softwareProvisioning`, `channelsTelegram/Discord/Slack`, `microsoftGraph`, `agents`, `agentTenant`. The Discord/Slack flags exist but are **not** a V1 channel support contract."
    },
    {
      "id": "O-102",
      "title": "Ship software dependencies that survive container replacement.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-3",
      "disposition": "rewrite",
      "impact": "outbound",
      "reason": "Software dependencies must be re-provisioned after a v1 replacement.",
      "release_notes": "Declared manifest + `moltlazy software provision`; progress/report; on-demand reconcile."
    },
    {
      "id": "O-103",
      "title": "Have a typed RPC client for OpenClaw.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-1",
      "disposition": "verify",
      "impact": "gateway-api",
      "reason": "The typed RPC client is transport-independent; re-verify over v1.",
      "release_notes": "`moltlazy/sdk` over the admin HTTP API (Worker prefers RPC, CLI fallback); official gateway client for WS-only methods."
    },
    {
      "id": "O-104",
      "title": "Write tests first, with business rules as an executable corpus.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Business-rules corpus is repository tooling.",
      "release_notes": "Vitest + cctr business-rules corpus (pricing, RBAC, tenancy, operational modes, cost schema, dashboard contract, agent visibility, backups, secrets); `cctr apps/fouria/test/business-rules/`."
    },
    {
      "id": "O-105",
      "title": "Run E2E against real infrastructure.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "E2E must add the v1 suite and staging lane.",
      "release_notes": "Cloud cctr (deploy/destroy), local Docker cctr, Playwright UI, gateway boot smoke, software restore smoke, agent-push pair, backup suite."
    },
    {
      "id": "O-106",
      "title": "Keep releases traceable.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Release traceability is CI.",
      "release_notes": "Changesets (semver) + CalVer for Fouria/dispatch/tail; changelogs generated from conventional commits; OpenClaw version single-sourced."
    },
    {
      "id": "O-107",
      "title": "Keep docs current.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "preserve",
      "impact": "control-plane",
      "reason": "Docs covenant is repository process.",
      "release_notes": "Documentation covenant; docs site synced from repo; AGENTS.md changelogs."
    },
    {
      "id": "O-108",
      "title": "Detect regressions before release.",
      "status": "✅",
      "source_section": "6.9 Developer workflow and engineering quality",
      "domain": "openclaw-management",
      "milestone": "OCM-4",
      "disposition": "verify",
      "impact": "control-plane",
      "reason": "Regression detection must include the v1 gate.",
      "release_notes": "`bun run format:check && lint && typecheck && test`; `mix check && mix license_audit`; CI gates staging promotion."
    }
  ],
  "deprecations": [
    {
      "id": "DEP-1",
      "item": "SANDBOX_RUNTIME pending guard and the legacy-only acquireSandbox()",
      "replaces_with": "Per-tenant conversion intent (C5) + SandboxV1 acquisition.",
      "phase": "S1/S2",
      "reason": "The flag selects an intent but cannot serve v1; the intent record is the authority."
    },
    {
      "id": "DEP-2",
      "item": "Legacy .sqsh archive creation for v1 tenants",
      "replaces_with": "DirectoryBackup records + F4E1 sidecar.",
      "phase": "S2",
      "reason": "The v1 runtime has no createBackup()/restoreBackup(); legacy archives are imported during conversion only."
    },
    {
      "id": "DEP-3",
      "item": "sandbox.createBackup() / sandbox.restoreBackup() on the v1 path",
      "replaces_with": "SandboxV1.backupDirectory / restoreDirectory / deleteDirectoryBackup.",
      "phase": "S2/S4",
      "reason": "The v1 SDK surface is directory-based."
    },
    {
      "id": "DEP-4",
      "item": "containerFetch / wsConnect on the v1 path",
      "replaces_with": "ctx.container fetch/WS transport inside SandboxV1.",
      "phase": "S2/S3",
      "reason": "The v1 DO owns the container; the Worker must not drive it directly."
    },
    {
      "id": "DEP-5",
      "item": "Legacy listProcesses / getProcess / exec handle shape on the v1 path",
      "replaces_with": "SandboxV1 exec/process API + process registry.",
      "phase": "S2/S4",
      "reason": "Handles are container-scoped and argv-based in v1."
    },
    {
      "id": "DEP-6",
      "item": "isRuntimeActive / destroy / stop legacy lifecycle on the v1 path",
      "replaces_with": "SandboxV1 lifecycle reads and process-scoped stop.",
      "phase": "S2/S4",
      "reason": "The v1 container is owned by the DO; stopGateway must never destroy it."
    },
    {
      "id": "DEP-7",
      "item": "stageLegacyRootsForBackup bridge for v1 tenants",
      "replaces_with": "One-time conversion into a DirectoryBackup record.",
      "phase": "S2",
      "reason": "The symlink-preserving tar bridge is legacy-only; running it on every v1 boot reintroduces the slow path."
    },
    {
      "id": "DEP-8",
      "item": "R2 presigned-URL configuration as the only backup transport",
      "replaces_with": "DirectoryBackup over the BACKUP_BUCKET binding (presigned config kept for legacy).",
      "phase": "S2",
      "reason": "The v1 surface uses the binding; presigned URLs are legacy SDK plumbing."
    },
    {
      "id": "DEP-9",
      "item": "TenantSandbox (sandbox-do.ts) as the single runtime implementation",
      "replaces_with": "TenantSandboxV1 alongside the legacy class (no deletion, contract §6).",
      "phase": "S2",
      "reason": "The legacy class must keep serving unselected tenants byte-identically."
    },
    {
      "id": "DEP-10",
      "item": "Workspace snapshot unsupported on the default container policy",
      "replaces_with": "Native snapshotWorkspace() on the durable_object policy.",
      "phase": "S2",
      "reason": "v1 is the runtime where the capability is real; the flag can be enabled."
    },
    {
      "id": "DEP-11",
      "item": "BackupWatch / scheduler adapters bound to the legacy SDK",
      "replaces_with": "v1-aware adapters preserving the same job state machine.",
      "phase": "S4/S5",
      "reason": "The durable job logic is preserved; only the sandbox adapter changes."
    },
    {
      "id": "DEP-12",
      "item": "container-active / r2-operation / gateway-resources metric sources tied to legacy calls",
      "replaces_with": "Equivalent v1 lifecycle/backup/process events with the same AE shape.",
      "phase": "S4/S6",
      "reason": "Cost observability must survive the runtime cutover."
    },
    {
      "id": "DEP-13",
      "item": "S3 credential strategy (R2_TOKEN_STRATEGY) as a requirement for v1 backups",
      "replaces_with": "BACKUP_BUCKET binding; the S3 strategy remains for legacy.",
      "phase": "S2",
      "reason": "The v1 DirectoryBackup path does not need per-instance S3 credentials."
    },
    {
      "id": "DEP-14",
      "item": "Dockerfile.v1 shim pinned independently of the Worker package",
      "replaces_with": "Shim tag derived from the installed @cloudflare/sandbox version.",
      "phase": "S0/S4",
      "reason": "Worker package and image must be the same v1 line (sandbox-next hard rule)."
    },
    {
      "id": "DEP-15",
      "item": "Legacy default container scheduling policy for v1 tenants",
      "replaces_with": "durable_object policy + SandboxV1 container application.",
      "phase": "S4",
      "reason": "The v1 DO requires a durable_object container application."
    }
  ],
  "out_of_scope": [
    {
      "id": "C-06",
      "title": "As a client ADMIN, I manage my team from the tenant dashboard (invite, role, remove, resend).",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-07",
      "title": "As a client, I organize agents and users into departments, and BASE_USERs only see global agents + their department.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-09",
      "title": "As a client, I can subscribe/upgrade and pay.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-14",
      "title": "I browse an agent roster split into \"company-wide\" and \"department\" agents.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-27",
      "title": "As a client, my BYOL choices reduce my invoice (storage/LLM/gateway discounts).",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-29",
      "title": "I connect Discord and Slack (bot/app tokens, DM policy) and receive messages there.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-30",
      "title": "I connect WhatsApp / Signal / Matrix / iMessage.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-31",
      "title": "I connect Microsoft Teams / Google Chat.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-33",
      "title": "I connect multiple accounts of the same channel to one instance (multi-account).",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-47",
      "title": "I get the **FourIA Digital Twin** (LLM Wiki: ingest/lint/query, contradiction detection, exports).",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-48",
      "title": "I visualize the knowledge graph.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-60",
      "title": "I can reach my data through a generic **S3-compatible API** (buckets, objects, presigned URLs).",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-61",
      "title": "I can bring my own S3/R2 bucket and have FourIA use it instead of the provided R2.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-62",
      "title": "I can export all my data at any time.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-63",
      "title": "My workspace is snapshotted natively for fast restore (Tier 1).",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-68",
      "title": "I get an RPO/RTO guarantee.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-85",
      "title": "I receive invoices / downloadable billing history.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-86",
      "title": "Reader users are free and unlimited; builder seats are plan-limited.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "C-87",
      "title": "I get BYOL discounts.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "C-91",
      "title": "I can request support / see incidents in the product.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-16",
      "title": "Offer partners a scoped, white-label dashboard with branding.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "O-36",
      "title": "Inspect the tenant workflow's git history (commit tree, branches, tags, releases).",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "O-38",
      "title": "Get a post-rollout readiness gate and fleet cohort/abort policy.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-48",
      "title": "Capture a native workspace snapshot on eviction for fast restore.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "O-64",
      "title": "Get a fleet-level observability aggregate.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-65",
      "title": "Have queue dead-letter handling.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-71",
      "title": "Run an automated fleet upgrade with cohorts and abort.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-81",
      "title": "Keep billing durable across isolates.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-82",
      "title": "Enforce plan limits / builder seats.",
      "status": "🧪",
      "reason": "Scaffold / feature-flagged off / not production-usable in V1; not part of the migration baseline."
    },
    {
      "id": "O-84",
      "title": "Collect payment.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-85",
      "title": "Export invoices/credit statements.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-97",
      "title": "Offer customer-managed encryption keys.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-99",
      "title": "Meet a compliance/SLA bar.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-109",
      "title": "Understand the whole fleet's health in one place.",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    },
    {
      "id": "O-110",
      "title": "Have Git-based client workflow versioning (branch/review/merge/rollback).",
      "status": "❌",
      "reason": "Not in V1; documented vision or explicitly post-beta."
    }
  ],
  "summary": {
    "implemented_features": 166,
    "by_status": {
      "✅": 141,
      "🟡": 23,
      "🧭": 2
    },
    "by_domain": {
      "security": 42,
      "openclaw-management": 76,
      "billing": 27,
      "persistence": 21
    },
    "by_disposition": {
      "preserve": 52,
      "verify": 73,
      "rewrite": 41
    },
    "by_impact": {
      "edge-auth": 29,
      "control-plane": 33,
      "docs": 1,
      "gateway-api": 33,
      "observability": 18,
      "queue": 3,
      "outbound": 4,
      "container-exec": 4,
      "backup": 17,
      "billing": 18,
      "container-lifecycle": 6
    },
    "milestones": 14,
    "out_of_scope_features": 35
  }
}
