Repository navigation
fix(runtime): close owned resources and bound process shutdown - #2641
Conversation
|
[PHASE: PLAN] Both reported process-exit failures reproduce on current main with a real Redis socket. The structured subprocess tests reach readiness, receive SIGTERM, and each exceeds the exit watchdog: child clean/timed-out drain 0/2 pass; service clean/timed-out drain 0/2 pass. Repeated on the pinned Deno 2.9.7 with the same four failures. Deno KV alone is a negative control and exits naturally. Commit 2913e2a locks process ownership, defined 0/1/2 exit semantics, explicit loopback hostname override, and cleanup deadlines within the total shutdown budget. Plan includes generated role ownership and one full scaffold.runtime smoke. Separate-session PLAN-EVAL is required before product implementation. The isolated Redis resource was removed after the teardown preview and exact ownership verification. Foreign/unknown-owner resources were left alone. No operator environment values enter public evidence. |
|
[PHASE: PLAN-EVAL] [VERDICT: CHANGES_REQUESTED] Gate result: FAIL_PLAN — the plan's scope, root cause, deadline accounting, ownership model, and role coverage are sound, but four unstated decisions and a slice-contract gap must be locked in Evaluated head Findings
Confirmed
Next
|
|
[PHASE: PLAN] Applied all five cycle-one PLAN-EVAL repairs in commit f86b889: explicit Deno.exit on clean and failed process-owned paths; exactly-once Prisma disposal registered by raw withDatabase; closeKv() as the singleton-aware process route; OTel bounded flush without exiting, with standalone behavior documented; and per-slice file groups, each below 30 files. No production implementation has started. Manual stop and external cancellation remain embeddable. The accepted real Redis reproduction remains the baseline. Cycle-two PLAN-EVAL is next, before implementation. |
|
[PHASE: PLAN-EVAL] [VERDICT: APPROVED] Gate result: PASS — every Plan-Gate box is satisfied at head Evaluated head Cycle-one repairs verified
Checklist resultsAll eight
The evaluator re-verified the load-bearing findings against the tree at the head: child health binds without Acceptance coverageAll seven acceptance boxes across #2630 and #2631 are meetable: child SIGTERM exit within its drain budget (S1 red subprocess tests → S2); service exits after clean and timed-out drains with distinct codes (S1 → S2, exit vocabulary 0/1/2); role-level KV/Prisma/Redis closure (S2 core Plan-only repairsNone required on cycle two — the committed plan satisfies every box without further edit. Next
|
|
[PHASE: IMPL] Committed the S1 regressions after PLAN-EVAL PASS. In addition to the four real Redis subprocess failures already recorded, unchanged main source fails the loopback bind regression and exits 0 during the OTel/runtime ownership test instead of preserving the runtime's drain and exit 7. Baseline focused suite: 9 pass, 2 fail. Signal subprocess cases skip Windows because the acceptance uses SIGTERM. |
|
[PHASE: IMPL] S2 commit 029b9e6 makes the lifecycle regressions pass. Child health defaults to loopback with an explicit hostname override. Process-owned child/service shutdown uses bounded drain/cleanup deadlines and explicit 0/1/2 exits; raw withDatabase registration deduplicates client identities for reserved signal cleanup, and KV cleanup uses closeKv(). OTel retains bounded shutdown without taking over process termination. Real Redis subprocess tests now pass 4/4 (formerly four watchdog failures); focused child/coordinator/OTel tests pass 15/15; expanded resource/coordinator tests pass 8/8; existing listener/builder/runtime tests pass 34/34. Structured type-check/lint/fmt and quality:gate pass. Two embedded signal tests explicitly retain process ownership and preserve all assertions. Owned Redis resource was removed after read-only teardown preview and identity proof. Generated role disposal, documentation/assets, final scaffold.runtime smoke and IMPL-EVAL remain pending. |
|
[PHASE: IMPL] S3a commit eab4bc2 adds owner-supplied idempotent context disposal and generated DB acquisition tracking. Standard child roles close shared KV and invoke the host bootstrap disposer; workers/sagas/auth service signal cleanup invokes the owner callback. The host callback closes only acquired DB identities; KV remains singleton-aware process-edge cleanup. When a host callback owns DB disposal, disposeDatabaseOnSignal:false avoids duplicate automatic disconnects. Before refreshing the embedded template, two generated-owner tests failed with missing disposal; after canonical gen:assets-barrel, the focused suite passes 37/37. It covers all three generated runtime artifacts, unused/acquired DB cases, disposal idempotency and exactly-once host DB cleanup under a real signal. Structured check/lint/fmt pass, using the explicit CLI quality config for files excluded by the root config. No lock changes. Documentation, generated documentation/publish carriers, one-pass scaffold.runtime smoke and IMPL-EVAL remain. |
|
[PHASE: IMPL] S3b documents shutdown ownership, loopback override, total/reserved budgets and 0/1/2 exits, and refreshes source-derived child health, shipped prose, export-surface and publish-asset carriers. Documentation generator tests pass 2/2; freshness, docs:accuracy, release:preflight and quality:gate pass. Reference formatting-only churn was removed from the final diff. Service doc lint is clean. Plugin doc lint (18 diagnostics) and telemetry doc lint (7) exactly match the base command/distribution. Plugin JSR dry-run succeeds; its audit retains three missing @module tags in untouched entrypoints, proven unchanged by git diff. Service, telemetry and CLI JSR audits exit 0 with existing warnings. These baseline limits remain visible in the run evidence. Started the required single one-pass command on pinned Deno 2.9.7: Runtime verdict and independent IMPL-EVAL are pending. |
|
[PHASE: IMPL] S2-S3 and runtime validation follow-up are committed through 26e945e. Explicit process termination, bounded cleanup, deduplicated database ownership, singleton KV disposal, child loopback override and OTel composition are implemented. The service/plugin structured suite passes 820/820, and all four separately executed real Redis subprocess regressions pass. Static/publication/docs/carrier gates pass apart from the measured pre-existing doc/JSR diagnostics disclosed in the PR body. The local full runtime command ran twice and cannot provide a complete verdict on this environment: native PostgreSQL readiness failed on remote Docker; a temporary bridge repaired reachability but plugin doctor correctly rejects remote Docker. Infrastructure and affected service/worker health were observed healthy. No guard was disabled. A supported-runner workflow is requested for the full runtime verdict. Temporary bridge/AppHost cleanup is complete. Preview/apply removed one owned diagnostic container; final scans show zero owned mount/bridge container survivors. The temporary bridge's interference with persistent-network cleanup and already-removed-proxy cleanup error remain recorded in the run worklog. Foreign and unknown-owner resources were untouched. Next: separate feature-tier IMPL-EVAL, supported CI runtime evidence, then issue acceptance/body reconciliation and readiness. No merge or release requested. |
|
[PHASE: IMPL-EVAL] [VERDICT: CHANGES_REQUESTED] Independent feature-tier IMPL-EVAL returns FAIL_FIX. Lifecycle and ownership match the approved plan; release-gate evidence is missing. Evaluator: separate session from the Codex generator. Requested muse_spark_1_3/xhigh, observed opencode-go/muse-spark-1.3-contributor. Different session and vendor family. Fallback not used. Head 26e945e, base origin/main b0eb079. Findings
Independent checks
Next
|
|
[PHASE: IMPL] Addressed IMPL-EVAL F2 in 0cea585: generated workers/sagas/triggers forward NETSCRIPT_CHILD_HEALTH_HOSTNAME to the existing native hostname option. Unset preserves loopback, including Aspire executable probes; container launches can explicitly set 0.0.0.0. The S4 decision and scope are recorded in drift.md. The new subprocess regression executes all three emitted entrypoints and observes native bound addresses plus real HTTP health responses. On base b0eb079, 3/6 fail because default binds all interfaces. Before this repair, 3/6 fail because the override is ignored and non-loopback HTTP is refused. After repair, 6/6 pass; with installed artifact tests, 31/31 pass. Structured changed-source check/lint/fmt, quality:gate, release:preflight and docs:accuracy pass. F1 remains pending supported-runner full runtime evidence. The prior full dispatch evaluates 26e945e; a final-head dispatch and evaluator currency pass follow generated consumer refresh. No local full smoke is repeated on the explicitly unsupported remote-Docker topology. |
|
[PHASE: IMPL] S4 native failure diagnosis atd6ef1fa71: the supported Postgres smoke stops at generated-web resource restart after55passing gates; cleanup passes. Main SQLite comparison has the same symptom while main/Garnet Postgres passes, so no product cause is inferred yet. The CLI discarded Aspire's native restart exit code and diagnostic, preventing a decisive diagnosis. Two genuine regression tests fail on the unchanged-main CLI error path (stderr and stdout fallback). Minimal repair retains native exit code/detail and the scoped manual remedy. Adjacent refresh suite14/14, scoped typecheck, quality:cli, release:preflight and docs:accuracy pass. Failure observability only: no retry, target, cleanup assertion, drain contract or readiness bypass. New supported final-head full smoke will provide the native error or a complete pass. No unsupported-host local rerun. |
|
[PHASE: IMPL] S4 supported full-runtime verdict is now green atd6ef1fa71: workflow43951994678 SUCCESS, Postgres124/124, SQLite116/116 plus showcase8/8, scaffold-static and desktop-native all succeed. Cleanup runs intact. No guard bypass, weaker assertion or automated retry was added. Earlier native web-restart failure remains diagnosed as an intermittent supported-runner symptom also seen on main; the small error-path repair retains native exit/detail for future failures. Both cycle-one findings are addressed: F1 complete supported smoke now passes; F2 all workers/sagas/triggers generated launchers forward NETSCRIPT_CHILD_HEALTH_HOSTNAME to the native option. Main baseline fails3/6on defaults; pre-repair branch fails3/6on ignored override; fixed generated bind tests6/6pass, serving real HTTP on a non-loopback interface for the explicit override. Combined installed artifact suite31/31. Full smoke confirms actual generated role health/readiness200 in Aspire. Acceptance #2630: four real Redis subprocess regressions failed via watchdog on main and pass after repair (child/service clean and timeout; distinct0/2exitcodes), fatalexit1 preserved, all role-owned singletonKV/Redis and identity-deduped acquiredPrisma disposal covered by builder/host/installed tests, embedding retains external ownership, exitcodes documented. Acceptance #2631: native loopback default/override red->green and generated forwarding/health evidence above. Full service/plugin820pass/4optionalRedis separately4pass; owner/runtime37/37; all scoped static/quality/preflight/accuracy/carrier gates pass with measured unchanged doc/JSR baseline warnings disclosed in body/run. Final independent IMPL-EVAL follow-up next. No merge, auto-merge, ready-merge or publication. Run |
|
[PHASE: IMPL-EVAL] [VERDICT: PASS] Independent feature-tier IMPL-EVAL cycle two. Fresh evaluator session; prior cycle-one FAIL_FIX history preserved in
F1 complete supported smoke — repaired and verified:
F2 generated hostname forwarding — repaired and independently verified:
Lifecycle (spot-check preserved):
Independent gates at current head:
Acceptance (7 boxes, all checked with linked proof #2641 (comment)):
Finding: low only — draft-head CI shows expected skipping apart from docs/build lanes; decisive green is the identical-source supported workflow above. No product/test/doc edits, commits, pushes, labels, merges, or watching in this lane. Run dir updated with cycle-two verdict, left uncommitted. |
|
[PHASE: IMPL] Ready-transition CI found one new public type diagnostic: Validation at source |
|
[PHASE: IMPL] Ready for independent review at |
|
[PHASE: IMPL-EVAL] [VERDICT: PASS] Narrow ready-transition follow-up at Scope
Route
Independent evidence
Findings
No source/docs edits, commits, pushes, labels, watching, merge, or publication in this lane. |
|
[PHASE: IMPL] Final evidence head |
|
[PHASE: IMPL] Old head: Local gates pass: structured check/lint/fmt for 443 files (including explicit CLI/docs-helper configurations), 118 focused tests with zero failures or skips (real Redis signal exits, generated hostname/ownership/crash-reload, service resources, OTel and public type closure), quality/architecture, carrier freshness, release:preflight and docs:accuracy. The exact owned Redis container and original volume were removed; labels, PR body and issue checkboxes are unchanged. |
Summary
Background children and services now finish signal shutdown with explicit exit codes after bounded work and resource cleanup. Child health binds loopback by default and accepts a native hostname override.
Scope
Closes #2630
Closes #2631
Slices
Validation
Harness
.llm/runs/fix-runtime-child-drain--issues-2630-2631/.Drift / Debt
Definition of Done
🤖 Generated with Codex