Repository navigation
fix(daemon): preserve structured command termination outcomes - #130634
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 11:12 AM ET / 15:12 UTC. ClawSweeper reviewWhat this changesThe PR preserves timeout, signal, and launch-failure outcomes from systemd and launchd commands so Doctor does not mistake interrupted probes for known inactive or absent services. Merge readinessThis maintainer-authored, protected PR remains necessary: the exact head repairs the prior unknown-service-state blocker, with no new actionable defect found. Exact-head CI and normal maintainer merge judgment remain pending. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway service maintenance invokes platform service managers, then Doctor and lifecycle flows classify the response before reporting or changing a service. This PR changes the shared command-result boundary that feeds those classifications. flowchart LR
A[Service manager command] --> B[Daemon command result]
B --> C{Normal exit?}
C -->|Yes| D[Known service classifier]
C -->|No| E[Uncertain service result]
D --> F[Doctor and lifecycle flow]
E --> F
Decision needed
Why: The PR carries the protected maintainer label and its final merge decision cannot be automated by this review. Before merge
Agent review detailsSecurityNone. PR surfaceSource -19, Tests +361, Other 0. Total +342 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared structured-outcome repair after exact-head CI and mergeability confirm it against current main. Do we have a high-confidence way to reproduce the issue? Yes, at source level: abnormal command termination previously collapsed into an inactive/absent interpretation, while the current head preserves it through the activity and ownership classifiers. The reviewer did not execute the tests because this is a read-only checkout. Is this the best way to solve the issue? Yes: the repair belongs at the shared command-result and service-classification owners, and the Doctor consumers now receive an explicit unknown outcome rather than adding downstream guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9c2b86362030. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Interpret service state only after a normal command exit. Carry timeout, signal and spawn failures through the shared command owner, and reuse that boundary in doctor before removing legacy service files.
9c04387 to
3f5c7f7
Compare
|
Final repair pushed at The same invariant also exposed a detached launchd shell path: partial absence output from a terminated command previously passed the ownership guard. One classifier now runs before and after the filesystem scan and rejects command-execution/signal-range failures before interpreting text. Four captured failures now pass, with all 23 rendered-shell cases green. The shared handoff fixture is confined to owned directories; production handoff behavior is otherwise unchanged. Validation: 614 owner/sibling tests passed with six existing platform skips before the final mechanical lint correction; both affected suites were then rerun, 279/279 passed. All 29 full changed checks passed on the final cumulative 18-file patch. Real inert-process proof covers 14 user/system cases. Fresh cumulative Codex autoreview found no P0 blockers; independent source review found no actionable issues. Production +147/-166 (net -19); tests +647/-286. Final cumulative patch SHA256: These are actual process and rendered-shell proofs, not a native Linux deployment, packaged installation or real detached launchd activation. Hosted checks on this exact published head and native prepare/merge remain pending. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The final published head is I read the latest ClawSweeper review and its rank-up list. Its remaining CI/current-main checks are satisfied; no actionable source finding remains. The static stored-data warning does not represent a schema or format change: the assertion baseline changes an existing source-location entry, and Doctor preserves uncertain service state instead of rewriting it. No database, migration, new option, timeout, or public API was added. The canonical owner repair removes 19 net production lines. Native preparation and merge are proceeding under the authorized maintainer sweep. The earlier Git transport stall was recovered only after its owned processes exited; the successful retry used per-invocation HTTP/2 and a bounded low-speed timeout (the earlier HTTP/1.1 attempt also stalled), with no persistent Git, authentication, or gate changes. Actual native Linux service deployment and detached launchd activation are not claimed; the retained evidence exercises actual subprocesses and the rendered shell without changing operator services. |
|
Merged via squash.
|
…aw#130634) * fix(daemon): preserve structured command termination outcomes Interpret service state only after a normal command exit. Carry timeout, signal and spawn failures through the shared command owner, and reuse that boundary in doctor before removing legacy service files. * test(daemon): cover interrupted service decisions * fix(daemon): preserve uncertain service probe outcomes
What Problem This Solves
Fixes an issue where operators checking or repairing Gateway services could have an interrupted or unavailable service-manager command treated as proof that a service was absent or stopped. Doctor could then hide a detected service or proceed with a repair without knowing the service state.
Why This Change Was Made
The daemon command boundary now preserves normal exit, spawn failure, timeout and signal outcomes instead of discarding that information. Service classifiers consume those facts directly. The Systemd activity helper returns the existing Result type; both Doctor paths and the competing-service check preserve unknown outcomes rather than translating them into inactivity.
The detached launchd guard uses one query classifier before and after its existing filesystem scan. Execution failures and signal-range shell statuses cannot become absence merely because partial output contains familiar text. The generated shell remains independent of the installed JavaScript package. The shared handoff test fixture now confines its service scan, state, plist and temporary paths to an owned fixture directory.
User Impact
Doctor retains uncertain service findings and explains why it cannot safely repair them. Normal active, inactive and missing-service results retain their intended behavior. A failed ownership probe no longer permits cleanup or restart decisions based on partial output.
No new configuration, dependency, schema, service policy, timeout, public API or compatibility path is introduced. Production changes are +147/-166 (net -19); tests are +647/-286; the pre-existing assertion-baseline relocation remains net zero.
Evidence
The latest completed ClawSweeper finding and both rank-up moves are addressed: unknown is-active outcomes remain structured, and timeout/signal coverage reaches the activity boundary and both Doctor consumers. The detached shell classifier is an additional repair of the same invariant. Native Linux deployment, a real detached launchd activation, and packaged installation are not claimed by these isolated proofs.