Repository navigation
fix(provider): reconcile interrupted watchdog launch receipts - #1394
Gajesh2007 merged 7 commits into
Conversation
|
@darkbloombugs is attempting to deploy a commit to the EigenLabs Team on Vercel. A member of the Team first needs to authorize it. |
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Failure diagnostics: Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. |
jonathan308
left a comment
There was a problem hiding this comment.
Reviewed exact head 5f1b078 against current master cea374e. Approval is blocked by two launch-intent ownership cases in the new healthy-path reconciliation. Both were reproduced offline with the verbatim base/head health methods and unchanged production state/snapshot/identity code. Session and daemon dependencies were in-memory stubs, so this is state/method evidence, not full disk or launchd qualification. Documentation coverage and lint pass. No live provider, launchd, hardware or Apple attestation operation was performed.
|
Maintenance refresh published at Validation: six watchdog functions / 17 cases rerun from the hash-verified retained executable. No fresh provider build or combined-source compilation. Fourteen changelog tests, fragment validation/preview, 368 documentation checks and the final six-file docs-impact check passed. Historical broader tests remain retained evidence, not a new run. The existing human changes-requested review and unresolved threads still require re-review. CI approval/results remain separate gates; no passing-CI claim. These CPU fixture tests do not qualify native launchd, Apple operations, a signed release installation or the complete provider suite. |
|
Re-reviewed exact head Fresh CPU-only differential replay compiled the verbatim health method plus unchanged production state/snapshot/identity code: 17 scenarios / 87 assertions, with 36 failures at reviewed head A local conflict resolution preserves master's documentation plus this PR's six-file delta. Both exact-delta docs-impact and full docs lint (374 files) pass; changelog validation passes. It is not pushed: the current Remote conflicts and the existing changes-requested review/two unresolved threads remain. CI, Contribution Policy, Integration Tests and E2E Benchmarks are |
|
Refreshed onto master Conflicts fixed: Proof (Swift 6.3.2, macOS arm64):
Independent code review found no correctness issues. Reconciliation runs under the update lease, requires comparable positive evidence for the same label, can't double-charge an attempt, and doesn't extend the timeout. It also works with master's dev-build launchd labels. |
Both findings were fixed in later commits and re-proven on head 3d7de26 after merging current master (6/6 targeted tests pass; 42 assertions fail with the fix reverted).
davidtai
left a comment
There was a problem hiding this comment.
Reviewed the current head. The two earlier P2 findings are addressed: reconciliation now requires a baseline, a snapshot for the same label, and comparable evidence (runs advanced with both known, or process identity changed with both known) before calling reconcileLaunchIntent, so an unchanged or partial snapshot can neither arm an attempt for the serving predecessor nor clear an unproven intent. Reads under the existing update session, one write per observation. Tests cover the missing/partial/different-job cases. Resolved the two outdated threads accordingly. Approving; merge once the approved CI run is green.
Brings in master through 927172b (#1394, #1524) and the merged-dependency pins through the parent: mlx 71271f08 (Layr-Labs/mlx#36) and mlx-swift 81f58d79 (Layr-Labs/mlx-swift#57). The libs/mlx-swift-lm conflict resolves to 8df7bb62, the squash-merged Layr-Labs/mlx-swift-lm#317 on main (same tree as the SDK this branch's fixes were tested against, a00f4730).
Summary
Recover a candidate's durable launch receipt when the watchdog exits after starting it but before recording success.
observeHealthyProvidernow persists positively proven launch evidence under the existing update lease, so a running candidate without a heartbeat reaches the existing startup timeout.The health observation requires a higher known run count or a change between two known process identities for the same job. Missing, partial or unchanged evidence preserves the intent. This prevents an old serving process from acquiring a false timeout and lets a health observation before kickstart retain evidence for the subsequent launch. Shared reconciliation and down-provider recovery behavior are unchanged.
This extends the launch-intent mechanism introduced in #534. No public interface, persistent schema, configuration, version or protocol changes.
Before — reviewed head
5f1b0785flowchart TD I[("Durable launchIntent")] --> H["observeHealthyProvider"] H --> R["reconcileLaunchIntent with available snapshot"] R --> M{"Saved evidence missing or partial?"} M -->|Yes| F["Old process may count as a launch"] F --> T["False startup timeout and failure"] M -->|No, unchanged before kickstart| D["Intent deleted"] D --> L["Later silent launch cannot recover receipt"] L --> S["Stabilizing indefinitely"] classDef data fill:#fef3c7,stroke:#b45309,color:#78350f classDef code fill:#dbeafe,stroke:#2563eb,color:#1e3a8a classDef failure fill:#fee2e2,stroke:#dc2626,color:#7f1d1d class I data class H,R,M code class F,T,D,L,S failureAfter
flowchart TD I[("Durable launchIntent")] --> H["observeHealthyProvider holds update lease"] H --> P{"Same job: known count rises or known identity changes?"} P -->|No| R["Retain intent for a later observation"] P -->|Yes| C["reconcileLaunchIntent"] C --> W[("Persist receipt once with original intent ID")] W --> B{"Matching fresh heartbeat?"} B -->|Yes| G["Existing stabilization and promotion"] B -->|No, startup timeout expires| T["inactiveCandidate enters recovery"] T --> F["Charge the pending attempt once"] classDef data fill:#fef3c7,stroke:#b45309,color:#78350f classDef code fill:#dbeafe,stroke:#2563eb,color:#1e3a8a classDef safe fill:#dcfce7,stroke:#16a34a,color:#14532d class I,W data class H,P,C,B,T code class R,G,F safeBlue denotes code/control flow, amber durable state, red the reproduced defects, and green preserved intent or bounded recovery.
Validation — October 10
Correction commit:
a7631c4e2eca3a9b0a38facc023ec3bcae09ba54, directly following reviewed head5f1b0785af1d6cbc5d62e633bf0d4e2532ccda67; master remainscea374e88c1fd970859fccc949e3bb5f51513874. Contributor commits are preserved.5f1b0785with regression tests only: six failing cases, 44 failed assertions, five passing controls. Four cases establish false launch attribution from missing/partial saved evidence; two establish intent loss before a later silent launch. Raw logs and source/binary hashes are retained.swift build --build-tests --jobs 2 --force-resolved-versionspasses. Tests useswift test --skip-build --no-parallel --jobs 2 --force-resolved-versions; the focused selector is documented indocs/developer/test.mdunder “Watchdog launch evidence.”make docs-impact-check BASE=cea374e88c1fd970859fccc949e3bb5f51513874: six changed files pass.make docs-check: 368 files pass.Environment: Apple Swift 6.3.2, macOS 27.0.1 (26A434), arm64. Existing dependency pins and
Package.resolvedare unchanged: MLXcb77239b, MLX-Swift6923a80f, MLX-Swift-LM3fd4944c; nested MLX-C remains the package-pinned02cf6f4drather than independently upgrading its upstream tip. Each command has a 590-second work bound plus ten seconds for teardown, with at most two build jobs and serial test execution. Existing SwiftPM dependency warnings remain in the logs.The signed correction passed normal hooks and was pushed non-force to private staging first, then this existing public branch; GitHub verifies the signature. Latest-head CI and human review remain separate gates. The PR stays ready for review; no merge, deployment, release or issue closure is requested.
Validation limits
The regression executes the actual
WatchdogRecoveryService, updater, update lease and disk-backed recovery store through temporary synthetic installs and loopback release HTTP. Launch snapshots, liveness and restart effects are injected; fixture code-signature verification is disabled. It proves this recovery boundary, not an observed deployed incident or a physical launchd interruption.The real controller cancellation interleaving, detached update monitor, process-kill lock tests, reaped-child identity test, full provider/native/model suite and signed provider-release installation were not run. A missing saved baseline cannot by itself establish a later silent launch; the stricter healthy path conservatively retains intent until other existing confirmation or recovery paths act. The shared down-provider policy is intentionally outside this correction.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.