Skip to content

fix(ops): verify restart PID and served build SHA#81

Open
wizzoapp[bot] wants to merge 1 commit into
mainfrom
codex/p0-restart-delivery
Open

fix(ops): verify restart PID and served build SHA#81
wizzoapp[bot] wants to merge 1 commit into
mainfrom
codex/p0-restart-delivery

Conversation

@wizzoapp

@wizzoapp wizzoapp Bot commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • fix nightly restart env propagation so t3-daily-restart always receives service/origin/smoke/probe settings explicitly
  • stamp server build SHA into built artifacts via T3CODE_BUILD_SHA and expose it in the environment descriptor
  • add pinned verify-restart and fail/rollback unless MainPID changes and descriptor serverBuildSha matches the target commit

Refs ADA-76. Related narrower symptom: ADA-71.

Evidence

  • Scratch systemd unit with KillMode=control-group + TimeoutStopSec=2s: restart changed PID (3923300 -> 3923345), proving systemd itself is not silently no-oping.
  • Artifact stamp check: T3CODE_BUILD_SHA=dddd... vp run --filter t3 build:bundle; apps/server/dist/bin.mjs contains the injected 40-char SHA.
  • Factory gate passed: static checks + clean Codex gpt-5.5 autoreview.

Tests

  • ./scripts/ops/daily-restart/verify-restart.test.sh
  • ./scripts/ops/daily-restart/t3-nightly-cycle.test.sh
  • ./scripts/ops/daily-restart/t3-daily-restart.test.sh (102 passed)
  • vp test run src/environment/ServerEnvironment.test.ts --reporter verbose
  • vp run --filter t3 typecheck
  • vp check (0 errors; existing mobile unused-symbol warnings)

@wizzoapp wizzoapp Bot marked this pull request as ready for review July 6, 2026 07:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91711091ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/server/src/environment/ServerEnvironment.ts Outdated
adamfgr
adamfgr previously approved these changes Jul 6, 2026

@adamfgr adamfgr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-approved by wizzo-approve: all policy conditions verified against HEAD 9171109.

@wizzoapp wizzoapp Bot marked this pull request as draft July 6, 2026 09:10
@wizzoapp wizzoapp Bot force-pushed the codex/p0-restart-delivery branch from 9171109 to 89cd20f Compare July 6, 2026 09:11
@wizzoapp wizzoapp Bot marked this pull request as ready for review July 6, 2026 09:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89cd20f995

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +131 to +132
if [[ "$rc" -ne 0 || -z "$sha" ]]; then
last_reason="environment descriptor did not include serverBuildSha"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Separate descriptor fetch failures from missing build SHAs

When the descriptor request fails or returns non-JSON for the whole timeout, fetch_descriptor_sha exits nonzero but this branch reports the same CHECK restart FAIL environment descriptor did not include serverBuildSha text that t3-daily-restart treats as a legacy unstamped artifact. On a same-SHA restart where HTTP is still coming up or returning 5xx, this causes an unnecessary stop/rebuild retry instead of surfacing a restart/HTTP failure; distinguish the missing-serverBuildSha case from fetch/parse failures before allowing the legacy rebuild path.

Useful? React with 👍 / 👎.

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