Workspace support for bounded project reviews and SQLite development #4

Merged
arthur merged 2 commits from feat/project-delivery-loops into main 2026-09-14 13:26:18 +00:00
Owner

Companion to https://git.z3k.sh/z3k-tech/console/pulls/25

  • Advertise delivery-loops-v1 without breaking the existing projects-v1 polling contract.
  • Prepare fresh, detached review checkouts for all pinned project revisions. Never reset customer/builder work or reuse a builder session for review; disable the review origin's push URL.
  • Enforce the persisted per-run deadline locally, even when console is unavailable. Watchdog checks project pause/stop state through a lightweight endpoint, fences tmux session identity, and is re-armed after runner restarts. Recovery still spends a new launch allowance.
  • Add project-sqlite for opt-in MVP/dev databases on the Studio PVC, outside Git. Persistent dev file, separate card files shared across that card's repositories, empty independent-review files, read-only bounded query helper. Export SQLITE_PATH to agent/dev-server; preserve explicit repository configuration and existing data.
  • Build-time fixtures cover review isolation/pinned Git revisions, watchdog behaviour, SQLite persistence/isolation/read-only queries, and path guards.

Verification

PASS locally: PYTHONDONTWRITEBYTECODE=1 python3 -B -m unittest discover -s workspace -p test_delivery_loops.py; equivalent test_project_sqlite.py and test_project_workspaces.py suites; node workspace/test_card_brief.js; sh -n workspace/card-runner; sh -n workspace/dev-server; git diff --check.

The new suites run in the workspace Dockerfile as well. Full production amd64 image has not been built locally; no real provider-agent or production run is claimed. The existing workspace workflow triggers on main pushes only, not feature-branch PRs.

Rollout / limitations

Publish/roll this compatible runner before enabling the companion console features. Merging this PR publishes mutable workspace:1, which can roll existing Studios. Do not merge until that deployment is intended. No main branches or production resources were changed for this PR.

SQLite is Studio/dev only; no production/preview PVC configuration, data migration or backup is included. Limits are launches and time, not provider billing caps; shared workspace credentials mean review separation is not a hostile-agent sandbox. Reviews rely on structured independent-agent evidence. Console remains the owner of shipping approval and deployment verification.

Follow-up requested before merge: isolated worktrees + current-main validation

  • Builder worktrees remain private per card/repository. Rebase attempts and independent reviews now use fresh Git worktrees too, without resetting the builder's files. Review push configuration is worktree-local.
  • project-rebase prepares every repository before any push, preserves conflicts for inspection, and pushes only the card branch with explicit old-head force-with-lease. It stops on changed refs, paused/unavailable execution state, or the persisted deadline. Concurrent updates are not overwritten.
  • The console checks ancestry against the exact latest default revision, both when accepting validation and before shipping. Fast-forward-only merges preserve the validated commit and reject a divergent main at the forge. Repository branch protections remain authoritative.
  • Project settings choose human or independent-agent validation. Human review requires a signed-in member and evidence for every repository, with CSRF and stale-snapshot protection. Validation remains separate from shipping approval; explicit auto-deploy retains CI/preview gates.
  • Changed heads/bases clear approval and queue a new bounded run without resetting attempts. Partially shipped releases require human reconciliation. External manual forge merges are outside the console gate.

Verification: full Go suite passed against disposable PostgreSQL 17; go vet, templ generation and CSS build passed. Real local Git fixtures passed for private review worktrees, rebase conflicts, concurrent PR update leases, latest-main changes and paused/offline/expired execution. Human validation tests cover session/CSRF, all-repository evidence, stale main, separate approval and successful shipping. Desktop/mobile browser checks passed, using the browser-checking skill's local Chromium fallback because BrowserAct has no configured browser.

## Companion to https://git.z3k.sh/z3k-tech/console/pulls/25 - Advertise delivery-loops-v1 without breaking the existing projects-v1 polling contract. - Prepare fresh, detached review checkouts for all pinned project revisions. Never reset customer/builder work or reuse a builder session for review; disable the review origin's push URL. - Enforce the persisted per-run deadline locally, even when console is unavailable. Watchdog checks project pause/stop state through a lightweight endpoint, fences tmux session identity, and is re-armed after runner restarts. Recovery still spends a new launch allowance. - Add project-sqlite for opt-in MVP/dev databases on the Studio PVC, outside Git. Persistent dev file, separate card files shared across that card's repositories, empty independent-review files, read-only bounded query helper. Export SQLITE_PATH to agent/dev-server; preserve explicit repository configuration and existing data. - Build-time fixtures cover review isolation/pinned Git revisions, watchdog behaviour, SQLite persistence/isolation/read-only queries, and path guards. ## Verification PASS locally: PYTHONDONTWRITEBYTECODE=1 python3 -B -m unittest discover -s workspace -p test_delivery_loops.py; equivalent test_project_sqlite.py and test_project_workspaces.py suites; node workspace/test_card_brief.js; sh -n workspace/card-runner; sh -n workspace/dev-server; git diff --check. The new suites run in the workspace Dockerfile as well. Full production amd64 image has **not** been built locally; no real provider-agent or production run is claimed. The existing workspace workflow triggers on main pushes only, not feature-branch PRs. ## Rollout / limitations Publish/roll this compatible runner before enabling the companion console features. **Merging this PR publishes mutable workspace:1, which can roll existing Studios. Do not merge until that deployment is intended.** No main branches or production resources were changed for this PR. SQLite is Studio/dev only; no production/preview PVC configuration, data migration or backup is included. Limits are launches and time, not provider billing caps; shared workspace credentials mean review separation is not a hostile-agent sandbox. Reviews rely on structured independent-agent evidence. Console remains the owner of shipping approval and deployment verification. ## Follow-up requested before merge: isolated worktrees + current-main validation - Builder worktrees remain private per card/repository. Rebase attempts and independent reviews now use fresh Git worktrees too, without resetting the builder's files. Review push configuration is worktree-local. - project-rebase prepares every repository before any push, preserves conflicts for inspection, and pushes only the card branch with explicit old-head force-with-lease. It stops on changed refs, paused/unavailable execution state, or the persisted deadline. Concurrent updates are not overwritten. - The console checks ancestry against the exact latest default revision, both when accepting validation and before shipping. Fast-forward-only merges preserve the validated commit and reject a divergent main at the forge. Repository branch protections remain authoritative. - Project settings choose human or independent-agent validation. Human review requires a signed-in member and evidence for every repository, with CSRF and stale-snapshot protection. Validation remains separate from shipping approval; explicit auto-deploy retains CI/preview gates. - Changed heads/bases clear approval and queue a new bounded run without resetting attempts. Partially shipped releases require human reconciliation. External manual forge merges are outside the console gate. Verification: full Go suite passed against disposable PostgreSQL 17; go vet, templ generation and CSS build passed. Real local Git fixtures passed for private review worktrees, rebase conflicts, concurrent PR update leases, latest-main changes and paused/offline/expired execution. Human validation tests cover session/CSRF, all-repository evidence, stale main, separate approval and successful shipping. Desktop/mobile browser checks passed, using the browser-checking skill's local Chromium fallback because BrowserAct has no configured browser.
feat(workspace): rebase project PRs in isolated Git worktrees
All checks were successful
build-workspace / workspace (push) Successful in 37m52s
1337be48b9
arthur merged commit 1337be48b9 into main 2026-09-14 13:26:18 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
z3k-images/images!4
No description provided.