GEN-26: keep counter daily across deploys and restarts #62

Merged
backmeupplz merged 2 commits from fix/daily-counter-restarts into master 2026-09-22 23:45:19 +00:00
backmeupplz commented 2026-09-22 23:08:50 +00:00 (Migrated from github.com)

Scope

GEN-KANEO-26 — Keep borodutch.com counter daily across deployments and restarts. User messages20716/20733: deployments restarted the former one-minute boot count; persist the 24h successful-publication gate without changing source totals, history, metrics, cache or math.

Rework at 1aac4d5db1

  • Replace SIGKILL-persistent wx file with a process-lifetime kernel flock on the same shared-volume lock path. The lock's child holds it until the Node process closes stdin, including process death; the file stays in place and must not be unlinked. Concurrent API/manual and same-version rolling publishers exclude each other; a lost lock during an active collection fail-stops the Node process. Verified /bin/flock in the running production container (read-only metadata probe); local macOS tests use Python stdlib fcntl.flock with matching OS semantics, not a new production binary dependency.
  • Validate publishedAt against exact UTC ISO milliseconds/calendar semantics. Future publishedAt never triggers an early scan. Bound each actual setTimeout to 2^31−1ms and re-evaluate the persisted timestamp on wake, preventing the Node overflow 1ms loop. Invalid dates fail closed to existing 1h retry; last good state remains unchanged.
  • Keep one-minute startup minimum, 24h after last successful publication, one-hour failure retry, existing atomic result/history and unchanged sources.

Local validation (not CI)

yarn test --runInBand --silent: 14 suites/92 tests passed; yarn build-ts and git diff --check passed. Real child SIGKILL→restart→one due collection; live holder blocks manual/API run; normal failure releases lock; actual fake-timer entrypoint traverses oversized future timestamp and calendar-invalid Feb30 without early count or busy loop. No production counter, shadow scan or deploy invoked. Repository has no configured CI workflow; these are local results, not CI green.

Release and mixed-version gate

First rollout from the old wx implementation must drain the old API process and verify no old collector is running before starting the new scheduler. A former in-flight wx file is not a kernel lock, so mixed-version rolling overlap cannot safely co-publish. Once all processes run this version, shared kernel locks allow overlap. Keep the persisted volume/settings and do not remove .collection.lock after the upgrade. Parent owns independent rereview at this exact head, merge, deploy and live next-due/unchanged-snapshot verification. Natural 24h cycle is pending; last live publishedAt=2026-09-22T22:58:25.174Z implies next due 2026-09-23T22:58:25.174Z (15:58:25 PDT). Historical shadow untouched.

## Scope GEN-KANEO-26 — Keep borodutch.com counter daily across deployments and restarts. User messages20716/20733: deployments restarted the former one-minute boot count; persist the 24h successful-publication gate without changing source totals, history, metrics, cache or math. ## Rework at 1aac4d5db1d35d6712247f7200250eca3ffcb939 - Replace SIGKILL-persistent `wx` file with a process-lifetime kernel `flock` on the same shared-volume lock path. The lock's child holds it until the Node process closes stdin, including process death; the file stays in place and must not be unlinked. Concurrent API/manual and same-version rolling publishers exclude each other; a lost lock during an active collection fail-stops the Node process. Verified `/bin/flock` in the running production container (read-only metadata probe); local macOS tests use Python stdlib `fcntl.flock` with matching OS semantics, not a new production binary dependency. - Validate publishedAt against exact UTC ISO milliseconds/calendar semantics. Future publishedAt never triggers an early scan. Bound each actual `setTimeout` to 2^31−1ms and re-evaluate the persisted timestamp on wake, preventing the Node overflow 1ms loop. Invalid dates fail closed to existing 1h retry; last good state remains unchanged. - Keep one-minute startup minimum, 24h after last successful publication, one-hour failure retry, existing atomic result/history and unchanged sources. ## Local validation (not CI) `yarn test --runInBand --silent`: 14 suites/92 tests passed; `yarn build-ts` and `git diff --check` passed. Real child SIGKILL→restart→one due collection; live holder blocks manual/API run; normal failure releases lock; actual fake-timer entrypoint traverses oversized future timestamp and calendar-invalid Feb30 without early count or busy loop. No production counter, shadow scan or deploy invoked. Repository has no configured CI workflow; these are local results, not CI green. ## Release and mixed-version gate **First rollout from the old `wx` implementation must drain the old API process and verify no old collector is running before starting the new scheduler.** A former in-flight `wx` file is not a kernel lock, so mixed-version rolling overlap cannot safely co-publish. Once all processes run this version, shared kernel locks allow overlap. Keep the persisted volume/settings and do not remove `.collection.lock` after the upgrade. Parent owns independent rereview at this exact head, merge, deploy and live next-due/unchanged-snapshot verification. Natural 24h cycle is pending; last live publishedAt=2026-09-22T22:58:25.174Z implies next due 2026-09-23T22:58:25.174Z (15:58:25 PDT). Historical shadow untouched.
backmeupplz commented 2026-09-22 23:44:08 +00:00 (Migrated from github.com)

Independent source review / production release gate

GEN-KANEO-26 — Keep borodutch.com counter daily across deployments and restarts. Independent GPT-6 Sol review of PR #62 exact head 1aac4d5db1d35d6712247f7200250eca3ffcb939 against 99ab5c93d9a8515e6864820f0901e915925bb4df: source PASS; no blocking code findings. 14 suites / 92 tests, TypeScript build and diff check passed; actual Linux image kernel lock test proved live-holder exclusion, SIGKILL release and restart callback without deleting the lock inode. Controlled scheduler validation includes manual/API serialization, last-good, failure retry, strict dates and long timers. GitHub has zero check runs/statuses and no required CI configured: this is local validation, not green CI.
Production gate before deploy: baseline has one replica and zeroDowntime:true / Docker start-first; old scheduler does not coordinate with new kernel lock. Native stop-first rollout must be configured and old task confirmed stopped before new task starts. No expensive full count just to test. Owner/session: agent:main:subagent:d5986289-e468-4a6d-8544-45dc7c998cec.

## Independent source review / production release gate GEN-KANEO-26 — Keep borodutch.com counter daily across deployments and restarts. Independent GPT-6 Sol review of PR #62 exact head `1aac4d5db1d35d6712247f7200250eca3ffcb939` against `99ab5c93d9a8515e6864820f0901e915925bb4df`: **source PASS; no blocking code findings**. 14 suites / 92 tests, TypeScript build and diff check passed; actual Linux image kernel lock test proved live-holder exclusion, SIGKILL release and restart callback without deleting the lock inode. Controlled scheduler validation includes manual/API serialization, last-good, failure retry, strict dates and long timers. GitHub has zero check runs/statuses and no required CI configured: this is local validation, **not green CI**. Production gate before deploy: baseline has one replica and `zeroDowntime:true` / Docker start-first; old scheduler does not coordinate with new kernel lock. Native stop-first rollout must be configured and old task confirmed stopped before new task starts. No expensive full count just to test. Owner/session: `agent:main:subagent:d5986289-e468-4a6d-8544-45dc7c998cec`.
Sign in to join this conversation.
No description provided.