ForgeLayer

Production foundation and activation plan

Production Architecture Plan

Foundation implemented - production activation blocked.

ForgeLayer now has server-owned identity and workspace interfaces, membership and role enforcement, a tenant-scoped durable schema, an RLS migration, append-only Ledger controls, and safe product APIs. Local isolated validation passed for Auth, 61/61 RLS assertions, workspace switching, and durable restart behavior. Production adapters remain inactive, production validation is unavailable, and production activation is blocked.

Keep production blocked while reviewing an approved production target, operational controls, and a separate production validation plan; do not treat localhost validation as production evidence.

Current product truth

Implemented foundation, inactive production runtime

These states are deliberately distinct. Local isolated validation passed, but it does not activate or validate the production runtime.
Foundation Implemented

Trusted identity foundation

Server-owned authenticated identity, session, membership, role, and current-workspace interfaces are implemented.

Foundation Implemented

Durable schema foundation

Workspace-scoped control-plane tables, tenant references, and append-only Ledger controls are defined.

Adapter Inactive

Production adapters

Concrete Supabase session and user-context Postgres adapters passed isolated local validation; production adapters are not configured or active.

Local Validation Passed

Local migration replay

Migrations 001-003 replayed successfully against isolated local Postgres only; no remote or production migration was applied.

Local Validation Passed

Local isolated integration

Local Supabase Auth, 61/61 database-backed RLS assertions, workspace switching, tenant isolation, and durable reload/restart behavior passed.

Hosted Staging Pending

Hosted staging validation

Explicit hosted staging mode and operator safeguards exist, but no hosted project has been contacted or validated.

Production Validation Unavailable

Production validation

Production Auth, RLS execution, workspace switching, durability, monitoring, recovery, and token operations remain unvalidated.

Production Activation Blocked

Production activation

Production authentication and persistence remain unavailable until the isolated integration and operational gates are complete.

Workspace boundary

Security and RLS requirements

The trusted identity, membership, role, tenant-schema, and RLS migration foundations are implemented, but production adapters are inactive. Migrations 001-003, local Supabase Auth, 61/61 pgTAP RLS assertions, tenant isolation, workspace switching, and durability passed against isolated localhost only. Hosted staging configuration is inactive and hosted staging validation is pending; no hosted Supabase project has been contacted. No migration was applied to a remote or production database, and local validation is not production validation. Service-role writes for webhooks must stay server-side only, must not expose secrets, and must write only safe summaries by default. Raw diffs, raw repo rules, raw prompts, tokens, private keys, webhook payloads, provider errors, and stack traces remain excluded unless a future explicit privacy model allows otherwise.

Blocked until activation gates pass

What stays blocked

  • Production persistent Agent Work Records before the real adapter and RLS integration tests pass.
  • Raw prompt persistence before explicit privacy and retention controls.
  • Billing before auth, workspace roles, and plan enforcement are ready.
  • No live agent execution or autonomous workflows before approval gates and audit logs.
  • GitHub posting by default or auto-merge behavior.

Entity model

Implemented foundations and future data boundaries

users

Users

foundation_only

Represent authenticated people who can belong to workspaces.

Supabase Auth and the server identity interface passed isolated local validation; production remains inactive and production integration is unvalidated.

workspaces

Workspaces

foundation_only

Group repositories, review runs, ledger records, and members under one tenant boundary.

Workspace schema, server resolution, switching, and restart durability passed isolated local validation; production durability is unvalidated.

workspace_members

Workspace Members

foundation_only

Map users to workspaces with owner, admin, reviewer, and viewer roles.

Membership and role enforcement passed the isolated local runtime and 61/61 pgTAP assertions; production RLS remains unexecuted.

github_installations

GitHub Installations

existing

Track GitHub App installations associated with a workspace.

Installation tokens must never be stored or exposed.

repositories

Repositories

existing

Track approved repositories connected through the GitHub App.

Repository rows should remain tied to allowlisted installations and workspaces.

review_runs

Review Runs

existing

Store safe summaries for GitHub webhook reviews and MergeGuard decisions.

Current storage excludes raw diffs, raw repo rules, raw prompts, tokens, and webhook payloads by default.

agent_work_records

Agent Work Records

foundation_only

Persist draft/proposed/completed AI-agent work records with evidence, risks, approvals, and blocked actions.

Currently derived locally and not production-persisted. The implemented identity/schema foundation still requires active adapters and real RLS validation.

ledger_entries

Ledger Entries

foundation_only

Provide the unified AI Work Ledger timeline across review runs, agent work records, approvals, prompts, and evidence.

Current ledger entries are derived/foundation-only except stored review-run summaries.

prompt_records

Prompt Records

planned

Track prompt-analysis metadata, safety scores, rewrites, and test outcomes without raw prompt exposure by default.

Raw prompt persistence should remain off until explicit product and privacy controls exist.

approval_records

Approval Records

foundation_only

Record human approvals, rejections, required checks, and merge-readiness decisions.

Approval control records have a tenant-scoped schema foundation; production identity, adapter, and database behavior remain unavailable.

test_evidence

Test Evidence

planned

Attach safe evidence that required tests, builds, security checks, and manual reviews occurred.

Evidence should store summaries and artifact references, not secret logs.

audit_events

Audit Events

foundation_only

Capture security-relevant state changes, posting decisions, approvals, and future agent-control events.

Append-only workspace Ledger event controls are defined and statically checked; production retention and database behavior remain unverified.

billing_customers

Billing Customers

future

Future billing/customer mapping for paid workspaces.

Billing remains future-only and must not be added before private beta demand is validated.

Remaining activation work

Integration and operational gates

No production adapter should be enabled until these checks are completed and independently reviewed.
  1. 01Review and approve a separate production Supabase target and activation plan.
  2. 02Review Migration 003 for production application without reusing local validation as production evidence.
  3. 03Repeat cross-workspace and role-specific RLS tests against the approved production-like target.
  4. 04Validate the production server session and user-context Postgres adapter configuration.
  5. 05Review CSRF, session rotation, expiry, and sign-out behavior.
  6. 06Add membership administration and workspace-switching validation.
  7. 07Define retention, deletion, backup, recovery, monitoring, and incident response.
  8. 08Complete an independent security review before production activation.

Migration phases

Safe path from private beta to production

phase_1_private_beta_demo

Private beta demo

planned

Keep the current demo and GitHub review-run loop stable while reviewers validate the workflow.

phase_2_workspace_auth

Workspace auth activation

planned

Activate and integration-test the implemented identity, membership, role, and workspace-resolution foundation.

phase_3_persistent_records

Durable records activation

planned

Activate reviewed Postgres repositories over the implemented tenant schema after Migration 003 and RLS pass isolated integration tests.

phase_4_github_app_production

GitHub App production

planned

Move from selected private beta repos to a controlled production GitHub App install flow.

phase_5_billing_and_teams

Billing and teams

planned

Add paid plans, team limits, and workspace billing only after beta demand is proven.

phase_6_agent_execution_controls_future

Agent execution controls

planned

Future-only controls for live agent execution, command access, repo access, approval gates, and audit logs.