[codex] Add run-scoped isolation - #58
Merged
Merged
Conversation
Allow one running server to hold several fully isolated billing datasets so parallel test suites no longer have to restart the server or reset shared state between runs. Requests select a workspace with the X-Billtap-Workspace header or the workspace query parameter; unselected requests keep using the backward-compatible default workspace backed by the configured database_url. Named workspaces open their own SQLite database lazily under a workspaces/ directory and get an independent API handler, so customers, invoices, webhooks, idempotency keys, and test clocks are all isolated. GET /workspaces lists the known workspaces. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reflect the new isolated-workspace feature across the design docs and the product spec: testing isolation guidance, the storage architecture note, functional requirement FR-010, non-functional requirement NFR-008, the API contract Workspaces section, the data-model scoping note, and tasks T147. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/runs/<runId>/v1and/runs/<runId>/apirouting for isolated parallel billing runsbilltap seedScope
Verification
go test ./internal/server ./cmd/billtapgo test ./internal/apigo test ./...go run ./cmd/billtap compatibility scorecard --output-dir /tmp/billtap-compatibility-run-scopeCompatibility And Boundary Notes
Run-scoped routing reuses the existing isolated workspace store mechanism: unscoped calls use
default;/runs/<runId>maps to an isolated SQLite store, so duplicate Stripe object IDs, webhooks, test clocks, fixture state, and diagnostics stay separated. A future single-file row-levelrun_idschema migration remains possible and is documented in ADR 0004.Screenshots Or Evidence
No UI screenshots; this is server/API/CLI behavior covered by automated tests.