fix(database): make CLI db-init deterministically reliable (eliminate scaffold.runtime flake)#146
fix(database): make CLI db-init deterministically reliable (eliminate scaffold.runtime flake)#146rickylabs wants to merge 6 commits into
Conversation
IMPL — db-init reliabilityRoot causeThe original transient signature remains Prisma schema-engine lifecycle instability: The residual failure mode that made PR #98 insufficient was that the Prisma child could fail to return control to the retry wrapper at all. Locally this surfaced in That run timed out at Fix
EvidenceFocused/package gates passed:
Full runtime proof passed 5 consecutive runs of: rtk proxy deno task e2e:cli run scaffold.runtime --cleanup --format prettyResults:
|
IMPL summary — db-init reliabilityRoot cause:
Fix:
Consecutive-run evidence:
Validation:
Caveat:
|
|
Superseded by #152. This PR was opened from the same branch as #145 three minutes after #145 squash-merged, leaving it permanently CONFLICTING. Its only genuine net-new value over main — the retriable-failure classifier refinement in migrate.ts (standalone "Schema engine exited." is now non-retriable) plus its unit test — has been extracted cleanly onto a fresh branch off alpha.10 in #152 (deno.json version drift excluded; all package gates green). |
… (#164) * docs(release): one-shot deterministic release automation — research + plan (#147) Folds #122 (workspace-coordinated version bump: root+members+lock), #146 (drop --frozen rejected by Deno 2.9 deno ci), #123 (gate e2e-cli-prod behind publish via workflow_run, no JSR race), #133 (text-import preflight gate). Plan-only; no tooling code. Awaiting PLAN-EVAL before any implementation slice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(openhands): apply agent changes * chore(openhands): record run trace 28304587059-1 * docs(release): PLAN-EVAL cycle-2 revision — narrow D3 + two-pass cross-line scan (#147) Addresses PLAN-EVAL cycle-1 FAIL_PLAN (sole blocker D3). D3 now scans only Deno.readTextFile/readFile (drops constructor false-positives) with a two-pass cross-line resolver for the openapi.ts:29->155 break class + positive/negative fixtures. Folds the 3 non-blocking clarifications: D4 artifact version handoff, D5 agentic:sync-claude regen, D2 exact edit sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(openhands): apply agent changes * chore(openhands): record run trace 28305083715-1 * chore(release): fix prod install args * chore(release): add text import preflight * chore(release): add release cut orchestrator * chore(release): order prod e2e after publish * docs(release): add release workflow skill * chore(harness): finalize release automation run artifacts * chore(openhands): apply agent changes * chore(openhands): record run trace 28305978962-1 * chore(lock): drop spurious @std/yaml entry from IMPL-EVAL ad-hoc parse The IMPL-EVAL evaluator ran an ad-hoc `@std/yaml parse` for workflow YAML sanity, which leaked jsr:@std/yaml@1 into the root deno.lock. No committed source imports @std/yaml, so the entry is unused churn. Restore deno.lock to the IMPL HEAD (58ab73c) state. Release-automation tooling is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: OpenHands Bot <openhands@all-hands.dev>
Summary
@netscript/databasePrisma migration retry behavior for CLIdb init.Schema engine exited.failures..llm/tmp/run/fix-db-init-reliability/.Root Cause
The residual
scaffold.runtimedb-init flake was still in the Prisma schema-engine lifecycle path, not Postgres readiness. The db-init logs show Aspire waiting for Postgres and the generated database resource to be running, healthy, and ready before invoking Prisma. The evidenced transient signatures were:ERR_STREAM_PREMATURE_CLOSEPremature closeSchema engine exitedwhen coupled withschema-engine-windows.exe cli can-connect-to-databaseprisma-init-postgres, motivating a bounded Prisma-child timeout so retry can recover before the outer operation timeoutValidation
deno test --allow-all packages/database/tests/migrate-retry_test.tsdeno test --allow-all --repeats=100 --fail-fast packages/database/tests/migrate-retry_test.tsdeno check --unstable-kv packages/database/scripts/mod.ts packages/database/tests/migrate-retry_test.tsdeno run --allow-read --allow-run .llm/tools/run-deno-check.ts --root packages/database --ext ts,tsxdeno run --allow-read --allow-run .llm/tools/run-deno-lint.ts --root packages/database --ext ts,tsxdeno run --allow-read --allow-run .llm/tools/run-deno-fmt.ts --root packages/database --ext ts,tsxdeno doc packages/database/scripts/mod.tsdeno doc --lint packages/database/scripts/mod.tsdeno publish --dry-run --allow-dirtyfrompackages/databasertk proxy deno task e2e:cli run scaffold.runtime --cleanup --format prettyruns passed withSummary: passed=47 failed=0;database.initdurations were 30857ms, 33324ms, 32995ms, 36449ms, and 33083ms.Notes
deno task arch:checkstill fails before doctrine fitness on pre-existing dependency-centralization drift for divergent@netscript/aspireand@netscript/pluginranges. This PR does not edit dependency declarations.