Skip to content

Workspace tenancy WT4: stop boot-cloning CommonPlace - #200

Merged
Travis-Gilbert merged 1 commit into
mainfrom
feat/workspace-tenancy-wt4
Aug 6, 2026
Merged

Workspace tenancy WT4: stop boot-cloning CommonPlace#200
Travis-Gilbert merged 1 commit into
mainfrom
feat/workspace-tenancy-wt4

Conversation

@Travis-Gilbert

@Travis-Gilbert Travis-Gilbert commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Lands SPEC-COMMONPLACE-WORKSPACE-TENANCY-1.0 with PLAN, Verify-first, WT9 isolation decision, and EXECUTE-REPORT.
  • WT4: Entrypoint no longer clones; refuses WORKSPACE_REPO / WORKSPACE_REPO_URL; Studio opens /workspace/welcome.
  • WT8 first cut: node scripts/check-multitenant.mjs.
  • Scaffold @commonplace/workspace-tenancy path helpers.
  • Railway: WORKSPACE_DIR=/workspace/welcome (WORKSPACE_REPO already absent).

Not done (honest)

  • WT1–WT3 GitHub App / picker / token helper
  • WT5–WT7 shared-tree live proof, tenant graph keys, cascade
  • Full WT8 inventory burn-down

Test plan

  • node scripts/check-multitenant.mjs
  • pnpm --filter @commonplace/workspace-tenancy test
  • pnpm --filter theorem-vscode test
  • Workspace deploy SUCCESS; /IDE shows welcome README, not CommonPlace monorepo
  • Confirm no WORKSPACE_REPO on service (exits 78 if set)

Summary by CodeRabbit

  • New Features

    • Added workspace-aware tenancy support with isolated paths and lifecycle states.
    • Workspaces can be provisioned on demand, with repository checkouts created only when needed.
    • Added safeguards against invalid or path-traversal workspace identifiers.
  • Bug Fixes

    • IDE sessions now require an active workspace instead of using an implicit default.
  • Documentation

    • Added workspace-tenancy plans, specifications, verification guidance, and execution reports.
    • Documented isolation, repository access, storage behavior, and deployment considerations.
  • Validation

    • Added automated checks for multitenant configuration and workspace path handling.

Board SPEC-COMMONPLACE-WORKSPACE-TENANCY-1.0, record Verify-first, accept
single-instance isolation, refuse WORKSPACE_REPO at entrypoint, and add the
first gate:multitenant cut plus workspace path types.
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:53
@Travis-Gilbert
Travis-Gilbert merged commit 470f735 into main Aug 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Travis-Gilbert
Travis-Gilbert deleted the feat/workspace-tenancy-wt4 branch August 6, 2026 14:53
@ecc-tools

ecc-tools Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 27eefc02-bae8-454d-b32a-b9f7d4673b43

📥 Commits

Reviewing files that changed from the base of the PR and between 90457f5 and 30745f1.

📒 Files selected for processing (17)
  • .harness/checklists/workspace-tenancy--plan-local-20260806a.json
  • apps/theorem-vscode/src/agent/session-opener.ts
  • docs/plans/workspace-tenancy/DECISION-ISOLATION.md
  • docs/plans/workspace-tenancy/EXECUTE-REPORT.md
  • docs/plans/workspace-tenancy/PLAN.md
  • docs/plans/workspace-tenancy/SPEC-COMMONPLACE-WORKSPACE-TENANCY-1.0.md
  • docs/plans/workspace-tenancy/VERIFY-FIRST.md
  • packages/workspace-tenancy/package.json
  • packages/workspace-tenancy/src/index.ts
  • packages/workspace-tenancy/src/workspace.test.ts
  • packages/workspace-tenancy/src/workspace.ts
  • packages/workspace-tenancy/tsconfig.json
  • packages/workspace-tenancy/vitest.config.ts
  • packaging/workspace/Dockerfile
  • packaging/workspace/entrypoint.sh
  • packaging/workspace/railway.toml
  • scripts/check-multitenant.mjs

📝 Walkthrough

Walkthrough

The PR defines workspace-tenancy requirements and records execution status. It adds workspace identity and path utilities, removes boot-time repository cloning, requires explicit IDE workspace roots, defers substrate provisioning, and adds a multitenancy validation script.

Changes

Workspace Tenancy

Layer / File(s) Summary
Tenancy contracts and execution records
.harness/checklists/*, docs/plans/workspace-tenancy/*
Adds the tenancy specification, verification findings, isolation decision, execution report, checklist, and WT0–WT9 plan.
Workspace object and path package
packages/workspace-tenancy/*
Adds WorkspaceState, WorkspaceObject, and workspacePath. Tests reject empty and path-traversal workspace IDs.
Deferred checkout and session workspace enforcement
packaging/workspace/*, apps/theorem-vscode/src/agent/session-opener.ts
Replaces boot-time cloning with an empty welcome directory, rejects legacy repository variables, defers project provisioning, removes the default tenant, and requires a workspace root for IDE sessions.
Multitenancy validation gate
scripts/check-multitenant.mjs
Adds checks for legacy cloning, tenant defaults, embedded tokens, retired variables, and hardcoded repository paths.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workspace-tenancy-wt4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements WT4 of the workspace-tenancy spec by removing boot-time repo cloning from the workspace container and shifting the default IDE root to an empty /workspace/welcome, while scaffolding an initial WT8 “gate:multitenant” check and introducing a small @commonplace/workspace-tenancy types/helpers package to support per-workspace paths.

Changes:

  • Remove boot clone behavior and explicitly refuse WORKSPACE_REPO / WORKSPACE_REPO_URL in the workspace entrypoint; default to /workspace/welcome.
  • Update workspace container packaging/docs (Dockerfile + Railway notes) to eliminate single-tenant defaults.
  • Add an initial multitenancy gate script and a new @commonplace/workspace-tenancy package with workspacePath() + tests, plus accompanying WT0/WT9 docs.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/check-multitenant.mjs Adds a first-cut gate to detect reintroduced boot clone, repo envs, and /workspace/repo defaults.
packaging/workspace/railway.toml Updates deployment documentation to reflect WT4 retirement of repo-clone env vars.
packaging/workspace/entrypoint.sh Removes boot cloning, introduces /workspace/welcome, refuses WORKSPACE_REPO*, and defers substrate bootstrap.
packaging/workspace/Dockerfile Defaults the image to /workspace/welcome and removes baked-in tenant allowlist/env defaults.
packages/workspace-tenancy/vitest.config.ts Adds Vitest config for the new workspace-tenancy package.
packages/workspace-tenancy/tsconfig.json Adds TS config for the new workspace-tenancy package.
packages/workspace-tenancy/src/workspace.ts Introduces workspace object types and workspacePath() helper.
packages/workspace-tenancy/src/workspace.test.ts Adds tests for workspacePath() validation and output.
packages/workspace-tenancy/src/index.ts Adds a barrel export for the package.
packages/workspace-tenancy/package.json Defines the new internal package, scripts, and exports.
docs/plans/workspace-tenancy/VERIFY-FIRST.md Records verify-first findings that drive WT4/WT9 decisions.
docs/plans/workspace-tenancy/SPEC-COMMONPLACE-WORKSPACE-TENANCY-1.0.md Lands the workspace tenancy spec (WT1–WT9) and acceptance criteria.
docs/plans/workspace-tenancy/PLAN.md Adds the execution plan/checklist for the workspace-tenancy workstream.
docs/plans/workspace-tenancy/EXECUTE-REPORT.md Documents what was done vs. not done and the current deployment risk items.
docs/plans/workspace-tenancy/DECISION-ISOLATION.md Records the near-term isolation decision (WT9) and revisit triggers.
apps/theorem-vscode/src/agent/session-opener.ts Removes /workspace/repo fallback and requires an explicit workspace root.
.harness/checklists/workspace-tenancy--plan-local-20260806a.json Adds a harness checklist artifact for the plan’s deliverables and status.
Suppressed comments (1)

packaging/workspace/entrypoint.sh:125

  • The ${COMMONPLACE_SERVICE_ALLOWED_TENANTS:+...} expansion injects literal quotes into the env assignment (because the quotes are part of the expanded text), so the child process can receive a value like "Travis-Gilbert" or other unintended content. Since COMMONPLACE_SERVICE_ALLOWED_TENANTS is already exported/unset above, it doesn’t need to be conditionally re-specified here.
    COMMONPLACE_API_KEY="${COMMONPLACE_API_KEY}" \
    COMMONPLACE_DATA_DIR="${COMMONPLACE_DATA_DIR}" \
    COMMONPLACE_INSTANCE_ID="${COMMONPLACE_INSTANCE_ID}" \
    ${COMMONPLACE_SERVICE_ALLOWED_TENANTS:+COMMONPLACE_SERVICE_ALLOWED_TENANTS="${COMMONPLACE_SERVICE_ALLOWED_TENANTS}"} \
    setsid commonplace-api &

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fi
return 1
}
mkdir -p "${WORKSPACE_ROOT}" "${WELCOME_DIR}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants