Repository navigation
feat(runtime): initialize and reconcile ordinary watchers - #401
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughWatcher startup can initialize a missing index at the exact project root under daemon ownership. Startup and reuse request fresh reconciliation and report readiness only after file indexing, synthesized-edge processing, and ownership checks complete. ChangesWatcher startup
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is evident in the reviewed change context. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 5 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Ordinary watcher startup previously required an existing index and could reuse a ready watcher without requesting another reconciliation.
startRuntimeWatchernow lets the elected daemon initialize a missing index at the exact requested root. It waits for a fresh reconciliation through that daemon before returning, including when reusing an existing watcher.Initialization follows daemon election and guarded writer acquisition. Preserving CLI startup keeps the supplied root instead of resolving an uninitialized child to its indexed parent. Graph opening and refresh reject changed owner generations. Initialization failures retain partial databases and remove only the candidate's own coordination records.
The refresh uses the existing JSON-RPC connection and graph mutex. It finishes queued synthesis, rejects indexing or synthesis failures, and preserves shared daemons on caller timeout. A matching status response cannot acknowledge refresh. Legacy CLI initialization that ignores writer ownership remains outside these guards.
Build and full-suite validation passed with 7,549 tests and 39 existing skips. Golden validation passed all eight tests with no dump changes. Regression coverage includes real concurrent initializers, exact-child isolation, reused-watcher freshness, delayed and failed daemon refresh, same-PID successors, partial initialization cleanup, unreadable-file retry and pending-marker failure. The ordering test rejected a removed completion guard on
detach -> watcher -> refresh; the source was restored before final checks.The assertion-floor scanner flagged superseded missing-index rejection assertions, generalized owner-preservation assertions and an import of
expect. The new cases retain the owner-preservation checks and test the selected initialization behavior. No skips or suppressions were added.README's "About this fork" section was checked, including deferred synthesis, MCP launcher preservation and build revision behavior. README and the API and CLI site references document the guarded initialization flag and fresh reconciliation contract. The CLI reference addition addresses the documentation warning. Source logic stayed unchanged, so no further source review ran. No MCP tool schema or installer pointer changes are needed for this internal RPC. No installation, artifact promotion, managed runtime activation or release is included.