Repository navigation
feat: add complete Loop node lifecycle - #305
Conversation
Implement the complete Loop node lifecycle across runtime, persistence, APIs, CLI, native tools, web UI, SDKs, documentation, and QA coverage. Incorporate and extend the externalized Loop output hydration fix from PR #286. Co-authored-by: Marco Aurélio <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Too many files changed for review. ( |
|
Important Review skippedToo many files! This PR contains 587 files, which is 287 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (133)
📒 Files selected for processing (587)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
React Doctor found 1 new issue in 1 file · 1 error · score 84 / 100 (Needs work) · 0 fixed · vs Errors
Reviewed by React Doctor for commit |
| loadedCount={inventory.loadedCount} | ||
| loopFilter={search.nodes_loop ?? ""} | ||
| loopOptions={loopOptions} | ||
| nowMs={Date.now()} |
There was a problem hiding this comment.
React Doctor · react-hooks-js/purity (error)
This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot call impure function during render. Rewrite the flagged code so the compiler can optimize it.
Fix → Date.now is an impure function. Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent).
Summary
This PR completes the Loop node lifecycle and failure contract as one landing change. It gives Loop authors a declarative failure vocabulary, gives operators durable repair controls, and gives agents equivalent structured interfaces across HTTP, UDS, CLI, native tools, and MCP-projected Host API methods.
The implementation consolidates the previously reviewed stacked changes into one commit on top of the current
main, incorporates the remediation from the earlier review rounds, and includes the externalized Loop-output hydration work from #286. Marco Aurélio (magoamz) is credited as a co-author on the commit.Fixes #285.
Supersedes #286.
Why
The existing Loop engine owned the outer goal/act/verify lifecycle but did not have a complete contract for failure inside one node. A transient transport failure could escalate an entire generation, expensive agent work could restart instead of continue, waits and sick dependencies could become invisible, and operators lacked precise controls for pause, repair, resume, quarantine, requeue, cooperative cancellation, and immediate kill.
This change makes those states explicit, durable, observable, and repairable without requiring the Web UI. The undeclared default remains safe: failures escalate to generation repair rather than disappearing silently.
What changes
Failure classification and planning
allow_fail), with forward-only and mutually exclusive authoring rules.Durable lifecycle state
cancelfrom immediatekill; the former drains safely, while the latter closes immediately and suppresses node-trigger effects.Long-running supervision and recovery
Target health, quarantine, and watch admission
target_unavailablewhile independent lanes continue.event_keymandatory for extension watch sources and rejects invalid identity before a run starts.Effects and lifecycle events
on_*effects for structured event emission and normal tool invocation.Authoring and configuration
compozy.loop/v1with retry backoff/non-retryable rules, deadlines, payload result contracts, error policies, effects, wait nodes, expiry policy, andon_parent_close.loops.defaults.delivery,loops.defaults.watch, and daemon-globalloops.breaker.Operator and agent surfaces
compozy loop cancel|kill --run-id ...compozy loop node pause|resume|cancel|kill|requeue ...compozy loop nodes --state waiting|quarantined|attention|retrying ...compozy__loop_cancelcompozy__loop_killcompozy__loop_node_pausecompozy__loop_node_resumecompozy__loop_node_cancelcompozy__loop_node_killcompozy__loop_node_requeuecompozy__loop_nodescompozy__loop_statuswith node lifecycle state and marks kill tools as destructive.compozy mcp serve; they remain outside the nativecompozy__*registry.Web, documentation, and official skill
Externalized Loop output hydration
Persistence and migrations
Three append-only Goose migrations land after the current
mainschema:00045_schema.sql: lifecycle tables and columns, effect delivery identity, Loop target kind, retry/control/wait/admission state, run cancel fields, and row-preserving rebuilds.00046_schema.sql: partial due-time index for retry scanning.00047_schema.sql: admission-claim expiry backfill and expiry index.The migrations preserve existing rows. There is no compatibility reader, dual schema, fallback column, or boot-time repair path.
Intentional hard cuts
stoproute, CLI verb, native tool, and bindings; callers must choosecancelorkill.event_keyidentity from watch-source extensions.Safety invariants
Verification
The final branch-wide gate passed on the exact committed tree:
37d2a0de948011aaaada3aadace1326e6f413a2ecompozy_host__IDsReview history
mainsession-input implementation from fix: make busy-session inputs durable #304 and adds the missing MCP projection decision found by the final gate.Risk and rollout
Compozy Impact Audit
compozy__loop_stop, extendscompozy__loop_status, refreshes descriptors/schema digests/risk flags, and covers capability/availability decisions. Session-input Host API methods are intentionally MCP-projected without becoming native tool IDs.event_key; existing extension/MCP/native tools can be effect targets under normal workspace policy; lifecycle hooks receive additive failure/disposition context; no new extension kind, bundle kind, bridge kind, registry kind, or MCP sidecar kind is introduced.skills/compozy/references/loops.mdwith lifecycle grammar, failure precedence, CLI/native-tool paths, inventories, state transitions, and repair guidance.