Skip to content

feat(dev): scope Compose services to development sessions - #62

Merged
KnowSky404 merged 2 commits into
mainfrom
chore/local-dev-session-lifecycle
Nov 9, 2026
Merged

KnowSky404 merged 2 commits into
mainfrom
chore/local-dev-session-lifecycle

Conversation

@KnowSky404

Copy link
Copy Markdown
Owner

Local development previously left the application and backup sidecar running between tasks, with restart policies that could revive them after a Docker restart. Local Compose now runs as an explicit foreground session and tears down after verification while preserving the database, credentials, and backups.

  • make dev rebuilds, checks readiness, and owns the foreground session; INT, TERM, HUP, or service exit triggers cleanup.
  • make dev-check rebuilds, probes, and exits; make dev-stop recovers abandoned detached stacks. The default make target remains the unit checks.
  • Forced-exit recovery releases the runner lock even if a Compose child survives; the supported metrics override uses N2API_DEV_METRICS=1 make dev and is accepted by recovery checks.
  • All development restart policies are disabled. Cleanup is serialized across worktrees, rejects foreign/release Compose projects, removes containers/network/local application image and unused build cache, and preserves deploy_n2api-postgres.
  • The backup sidecar uses tmpfs instead of creating an unused anonymous data volume. Agent instructions, the repository refresh skill, and startup documentation use the same session lifecycle.

Validation passed:

  • make test-dev-artifacts
  • make test-ops
  • dev/ci/test-dev-artifacts.sh and dev/ci/test-dev-session.sh with temporary fixtures on NFS
  • bash -n dev/development/run.sh dev/ci/test-dev-session.sh dev/lib/test-resources.sh
  • dev/ci/verify-pinned-dependencies.sh
  • docker compose -f deploy/compose.yaml -f deploy/compose.metrics.yaml config --quiet
  • Compose JSON assertions for restart policies and the backup tmpfs; make -n; git diff origin/main --check
  • Real make dev-check and N2API_DEV_METRICS=1 ... make dev-check: no-cache build, healthy services, /livez, /readyz, /version, and bootstrap-page probes, followed by complete teardown and zero build cache
  • Real make dev-stop after teardown, proving idempotency

The original database system identifier and existing backup SHA256 checksums were preserved. No development containers or networks remain. Small ownership/permission-sensitive test fixtures used private local /tmp directories because the mounted NFS root-squashes UID and inherits setgid bits; those fixtures were removed, with logs kept remotely.

Local Codex review: codex review --base origin/main passed on 33348a74142b1d7b2d4cd19acb7ecb63bca0da13 with no actionable findings. The initial review findings about forced-exit lock recovery and the metrics override were reproduced, fixed, and verified before this final review.

No production change, release, or real-provider acceptance was performed. SIGKILL/host crashes require the documented make dev-stop recovery.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-09T04:01:30.642604Z 33348a7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@KnowSky404
KnowSky404 merged commit e07b451 into main Nov 9, 2026
17 checks passed
@KnowSky404
KnowSky404 deleted the chore/local-dev-session-lifecycle branch November 9, 2026 04:05
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.

1 participant