singularity-forge/web/app/api
Mikael Hugo 8c945550fa
Some checks are pending
sf self-deploy / build, test, and publish server image (push) Waiting to run
sf self-deploy / deploy test and probe (push) Blocked by required conditions
sf self-deploy / promote prod (push) Blocked by required conditions
feat: operational glue for upgrade-safety chain
Bundles the working-tree state into one coherent commit covering the
upgrade-safety glue that complements today's earlier landings
(orphan-recovery, sf-db single-connection, drain-timer-not-unref'd,
forceShutdown drain, shutdown-state.ts, instrumentation.ts,
shutdown-signal.js, gate-deadlock-classifier).

Modified:
  docker/Dockerfile.source-server — image build tweaks for the source-
    server variant used by the in-container upgrader.
  docker/docker-compose.vega.yaml — env passthroughs for host-side dirs
    (SF_SOURCE_HOST_ROOT, SF_WORKSPACE_HOST_DIR, SF_WORKSPACES_HOST_DIR,
    SF_HOME_HOST_DIR), docker socket mount, group_add for docker GID,
    and SF_RPC_SHUTDOWN_GRACE_MS=600000 matching the 10-min drain.
  scripts/run-vega-source-server.mjs — substantial rework supporting
    the in-container upgrade flow.
  scripts/upgrade-vega-source-server.mjs — buildEnv() + dockerBuildEnv()
    helpers, probeBind via SF_VEGA_PROBE_HOST, containerExists()
    pre-check before drainContainer, stop timeout now matches the
    10-min RPC grace via SF_VEGA_DRAIN_STOP_TIME (default 610s).
  src/web/project-discovery-service.ts — calls
    recoverProjectRuntimeQueues() on each of the 3 discovery paths
    (root monorepo, per-entry, nested SF projects). Closes the
    cloud-volume mtime-lag window codex flagged.
  web/app/api/ready/route.ts — calls recoverProjectRuntimeQueues() on
    every readiness probe, and now also reads shutdown-state so the
    probe returns 503 while draining.
  web/components/sf/projects-view.tsx — UI wiring for the upgrade
    trigger.
  web/pages/api/projects.ts — backend API addition for the project
    enumeration that feeds projects-view.
  docs/specs/sf-self-deploy.md — docs update for the new flow.
  package.json — script alias.

Added:
  scripts/build-web-host.mjs — new build helper for the standalone web
    host artifact consumed by the upgrade flow.
  src/resources/extensions/sf/tests/auto-shutdown-signal.test.mjs —
    unit test for the cooperative-shutdown signal module (registers /
    requests / snapshot).
  src/web/project-runtime-recovery.ts — thin wrapper around
    recoverOrphanedFeedbackDrains for per-project use from web routes.
  web/app/api/drain/route.ts — explicit drain endpoint for operator-
    triggered queue flush.
  web/app/api/server-upgrade/route.ts — auth-gated endpoint that
    spawns the in-container upgrader via docker socket; passes through
    host-dir env so the upgrader knows real bind-mount paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 22:57:26 +02:00
..
boot style: format repository with biome 2026-05-05 14:31:16 +02:00
bridge-terminal style: format repository with biome 2026-05-05 14:31:16 +02:00
browse-directories chore: formatter / linter touch-up (230 files) 2026-05-16 21:19:53 +02:00
captures chore: commit current workspace state 2026-05-05 14:46:18 +02:00
cleanup chore: commit current workspace state 2026-05-05 14:46:18 +02:00
dev-mode feat: make sf server the operator entrypoint 2026-05-17 17:23:46 +02:00
doctor chore: commit current workspace state 2026-05-05 14:46:18 +02:00
drain feat: operational glue for upgrade-safety chain 2026-05-17 22:57:26 +02:00
experimental chore: commit current workspace state 2026-05-05 14:46:18 +02:00
export-data chore: commit current workspace state 2026-05-05 14:46:18 +02:00
files chore: commit current workspace state 2026-05-05 14:46:18 +02:00
forensics chore: commit current workspace state 2026-05-05 14:46:18 +02:00
git chore: commit current workspace state 2026-05-05 14:46:18 +02:00
healthz fix(rpc, web): integrate drain into forceShutdown + healthz-503 on shutdown 2026-05-17 22:35:50 +02:00
history chore: commit current workspace state 2026-05-05 14:46:18 +02:00
hooks chore: commit current workspace state 2026-05-05 14:46:18 +02:00
inspect chore: commit current workspace state 2026-05-05 14:46:18 +02:00
knowledge chore: commit current workspace state 2026-05-05 14:46:18 +02:00
live-state chore: commit current workspace state 2026-05-05 14:46:18 +02:00
notifications chore: commit current workspace state 2026-05-05 14:46:18 +02:00
onboarding chore: commit current workspace state 2026-05-05 14:46:18 +02:00
preferences fix: use shared sf webserver project config 2026-05-17 22:09:28 +02:00
ready feat: operational glue for upgrade-safety chain 2026-05-17 22:57:26 +02:00
recovery chore: commit current workspace state 2026-05-05 14:46:18 +02:00
remote-questions chore: commit current workspace state 2026-05-05 14:46:18 +02:00
server-upgrade feat: operational glue for upgrade-safety chain 2026-05-17 22:57:26 +02:00
session chore: commit current workspace state 2026-05-05 14:46:18 +02:00
settings-data chore: commit current workspace state 2026-05-05 14:46:18 +02:00
shutdown chore: commit current workspace state 2026-05-05 14:46:18 +02:00
skill-health chore: commit current workspace state 2026-05-05 14:46:18 +02:00
steer chore: commit current workspace state 2026-05-05 14:46:18 +02:00
swarms remove A2A; swarm enrollment + status projection + web swarms view; headless refactor 2026-05-17 16:04:06 +02:00
switch-root fix: use shared sf webserver project config 2026-05-17 22:09:28 +02:00
terminal fix(security): resolve 7 findings from full-repo code review 2026-05-15 02:18:43 +02:00
undo chore: commit current workspace state 2026-05-05 14:46:18 +02:00
update style: format repository with biome 2026-05-05 14:31:16 +02:00
version feat: add source-mounted sf server self-deploy 2026-05-17 22:00:01 +02:00
visualizer chore: commit current workspace state 2026-05-05 14:46:18 +02:00