Skip to content

stack/loop lifecycle 01 runtime - #295

Closed
pedronauck wants to merge 4 commits into
mainfrom
stack/loop-lifecycle-01-runtime
Closed

pedronauck wants to merge 4 commits into
mainfrom
stack/loop-lifecycle-01-runtime

Conversation

@pedronauck

@pedronauck pedronauck commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Stack created with GitHub Stacks CLI • Give Feedback 💬

Summary by CodeRabbit

  • New Features

    • Added configurable loop lifecycle controls for retries, timeouts, waits, admission, autopause, cancellation, and circuit breakers.
    • Added durable retry scheduling, node quarantine and requeue workflows, wait handling, and cancellation states.
    • Added lifecycle effects that can emit events or invoke tools with reliable delivery and idempotent outcomes.
    • Added clearer failure classification, retry and repair feedback, and target-health recovery handling.
    • Added lifecycle validation, richer diagnostics, and support for new wait and effect definitions.
  • Bug Fixes

    • Improved timeout reporting, stale-schedule handling, late-arriving results, and protection against stale updates.

pedronauck and others added 4 commits August 3, 2026 17:52
Checkpoint via cy-loop-tasks (iteration 2, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 4, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 5, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
@vercel

vercel Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
compozy-site Ready Ready Preview Aug 3, 2026 9:40pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown

Too many files changed for review. (202 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 69c24f97-5d63-4f93-bd4e-fa5901e6e42e

📥 Commits

Reviewing files that changed from the base of the PR and between 0385983 and f337856.

⛔ Files ignored due to path filters (21)
  • docs/qa/bugs/BUG-20260802-loop-lifecycle-config-unsupported.md is excluded by !**/*.md
  • docs/qa/charters/CH-loop-lifecycle-config-cli.md is excluded by !**/*.md
  • docs/qa/charters/CH-loop-quarantine-repair.md is excluded by !**/*.md
  • docs/qa/journeys/J-bound-runaway-work.md is excluded by !**/*.md
  • docs/qa/journeys/J-recover-loop-node-failure.md is excluded by !**/*.md
  • docs/qa/journeys/J-tune-loop-lifecycle-defaults.md is excluded by !**/*.md
  • docs/qa/reports/2026-08-02-loop-lifecycle-config.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-error-route-fallback.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-loop-lifecycle-config-cli.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-on-error-notification-with-context.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-quarantine-diagnose-requeue.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-sick-target-degrades-one-lane.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-terminal-outcome-notification.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-transient-blip-heals.md is excluded by !**/*.md
  • docs/qa/scenarios/LP-unannotated-escalation.md is excluded by !**/*.md
  • docs/qa/scenarios/TA-loop-failure-breaker.md is excluded by !**/*.md
  • internal/store/globaldb/schema/migrations/atlas.sum is excluded by !**/*.sum, !**/*.sum
  • internal/testutil/acpmock/testdata/loop_node_lifecycle_fixture.json is excluded by !**/*.json
  • openapi/compozy.json is excluded by !**/*.json
  • web/src/generated/compozy-openapi.d.ts is excluded by !**/generated/**, !**/generated/**, !**/*.d.ts
  • web/src/generated/loop-enums.ts is excluded by !**/generated/**, !**/generated/**
📒 Files selected for processing (181)
  • internal/api/contract/loop_enums.go
  • internal/api/core/loops_test.go
  • internal/cli/config_path_classification.go
  • internal/cli/config_test.go
  • internal/config/config.go
  • internal/config/loop_autopause.go
  • internal/config/loop_lifecycle.go
  • internal/config/loops.go
  • internal/config/loops_test.go
  • internal/config/merge_loops.go
  • internal/config/tool_surface_loops.go
  • internal/config/tool_surface_test.go
  • internal/daemon/boot.go
  • internal/daemon/boot_components.go
  • internal/daemon/boot_dead_entity.go
  • internal/daemon/boot_publish.go
  • internal/daemon/daemon.go
  • internal/daemon/daemon_shutdown_runtime.go
  • internal/daemon/daemon_shutdown_targets.go
  • internal/daemon/loop_action_failure.go
  • internal/daemon/loop_action_failure_test.go
  • internal/daemon/loop_action_liveness.go
  • internal/daemon/loop_action_runtime.go
  • internal/daemon/loop_defaults.go
  • internal/daemon/loop_defaults_test.go
  • internal/daemon/loop_effect_relay.go
  • internal/daemon/loop_effect_relay_boot.go
  • internal/daemon/loop_effect_relay_test.go
  • internal/daemon/loop_goal_command_definition.go
  • internal/daemon/loop_goal_executor_test.go
  • internal/daemon/loop_goal_managed_runtime_integration_test.go
  • internal/daemon/loop_node_lifecycle_e2e_integration_test.go
  • internal/daemon/loop_target_health.go
  • internal/daemon/loop_target_health_test.go
  • internal/daemon/scheduler_loop_coordinator.go
  • internal/daemon/scheduler_loop_due_scan.go
  • internal/daemon/scheduler_loop_retry_timer.go
  • internal/daemon/scheduler_runtime.go
  • internal/daemon/scheduler_runtime_test.go
  • internal/daemon/scheduler_task_source_types.go
  • internal/daemon/settings_runtime_applier.go
  • internal/daemon/task_runtime_boot.go
  • internal/daemon/task_runtime_boot_roles.go
  • internal/daemon/task_runtime_test.go
  • internal/deadentity/service_test.go
  • internal/loop/action_failure.go
  • internal/loop/action_repair_feedback.go
  • internal/loop/action_retry_feedback.go
  • internal/loop/action_runagent.go
  • internal/loop/action_test.go
  • internal/loop/action_types.go
  • internal/loop/admission_claim.go
  • internal/loop/api_types.go
  • internal/loop/cancellation.go
  • internal/loop/config.go
  • internal/loop/constants.go
  • internal/loop/control_namespace.go
  • internal/loop/control_namespace_history.go
  • internal/loop/control_namespace_history_test.go
  • internal/loop/control_namespace_test.go
  • internal/loop/control_plan.go
  • internal/loop/control_plan_finish.go
  • internal/loop/control_readiness.go
  • internal/loop/control_tasks.go
  • internal/loop/coordinator.go
  • internal/loop/coordinator_action.go
  • internal/loop/coordinator_effects.go
  • internal/loop/coordinator_error_routes.go
  • internal/loop/coordinator_generation.go
  • internal/loop/coordinator_generation_idle.go
  • internal/loop/coordinator_generation_reattempt.go
  • internal/loop/coordinator_generation_succession.go
  • internal/loop/coordinator_goal_control_test.go
  • internal/loop/coordinator_history.go
  • internal/loop/coordinator_lifecycle.go
  • internal/loop/coordinator_lifecycle_test.go
  • internal/loop/coordinator_metadata.go
  • internal/loop/coordinator_options.go
  • internal/loop/coordinator_outputs.go
  • internal/loop/coordinator_quarantine.go
  • internal/loop/coordinator_requeue.go
  • internal/loop/coordinator_retry.go
  • internal/loop/coordinator_retry_test.go
  • internal/loop/coordinator_snapshot_test.go
  • internal/loop/coordinator_succession.go
  • internal/loop/coordinator_target_health.go
  • internal/loop/coordinator_terminal_helpers.go
  • internal/loop/coordinator_test.go
  • internal/loop/dsl/codec_test.go
  • internal/loop/dsl/contract.go
  • internal/loop/dsl/effects.go
  • internal/loop/dsl/graph.go
  • internal/loop/dsl/lifecycle.go
  • internal/loop/dsl/node_params.go
  • internal/loop/dsl/refs/condition.go
  • internal/loop/dsl/refs/diagnostics.go
  • internal/loop/dsl/refs/namespace.go
  • internal/loop/dsl/refs/refs_test.go
  • internal/loop/dsl/types_nodes.go
  • internal/loop/dsl/wait.go
  • internal/loop/effect_context.go
  • internal/loop/effect_outbox.go
  • internal/loop/effects_dispatch.go
  • internal/loop/effects_dispatch_test.go
  • internal/loop/errors.go
  • internal/loop/executed_definition_snapshot.go
  • internal/loop/failure_class.go
  • internal/loop/failure_classify.go
  • internal/loop/failure_classify_test.go
  • internal/loop/failure_repair.go
  • internal/loop/failure_repair_test.go
  • internal/loop/failure_result_contract.go
  • internal/loop/failure_result_contract_test.go
  • internal/loop/generation_intent.go
  • internal/loop/generation_snapshot.go
  • internal/loop/generation_snapshot_attempts.go
  • internal/loop/generation_snapshot_controls.go
  • internal/loop/generation_snapshot_intents.go
  • internal/loop/generation_snapshot_test.go
  • internal/loop/lifecycle_config.go
  • internal/loop/linter_contract.go
  • internal/loop/linter_effects.go
  • internal/loop/linter_lifecycle.go
  • internal/loop/linter_test.go
  • internal/loop/linter_wait.go
  • internal/loop/node_attempt.go
  • internal/loop/node_control.go
  • internal/loop/node_control_mutation.go
  • internal/loop/node_requeue.go
  • internal/loop/node_wait.go
  • internal/loop/predicate_policy.go
  • internal/loop/predicate_policy_test.go
  • internal/loop/quarantine.go
  • internal/loop/retry_due.go
  • internal/loop/service_test.go
  • internal/loop/service_types.go
  • internal/loop/target_health.go
  • internal/loop/target_health_test.go
  • internal/loop/types.go
  • internal/loop/watch_events_registry_phase_a.go
  • internal/store/globaldb/global_db_goal_reentry_test.go
  • internal/store/globaldb/global_db_goal_turn_runtime_integration_test.go
  • internal/store/globaldb/global_db_loop.go
  • internal/store/globaldb/global_db_loop_admission_claims.go
  • internal/store/globaldb/global_db_loop_effect_outbox.go
  • internal/store/globaldb/global_db_loop_events.go
  • internal/store/globaldb/global_db_loop_node_attempts.go
  • internal/store/globaldb/global_db_loop_node_controls.go
  • internal/store/globaldb/global_db_loop_node_requeue.go
  • internal/store/globaldb/global_db_loop_node_terminal.go
  • internal/store/globaldb/global_db_loop_node_waits.go
  • internal/store/globaldb/global_db_loop_retry_due.go
  • internal/store/globaldb/global_db_loop_scan.go
  • internal/store/globaldb/global_db_loop_schema_integration_test.go
  • internal/store/globaldb/global_db_loop_test.go
  • internal/store/globaldb/global_db_task_claim_complete.go
  • internal/store/globaldb/global_db_task_claim_test.go
  • internal/store/globaldb/global_db_task_coordinator_boundaries.go
  • internal/store/globaldb/global_db_task_coordinator_effects.go
  • internal/store/globaldb/global_db_task_coordinator_intents.go
  • internal/store/globaldb/global_db_task_coordinator_runtime.go
  • internal/store/globaldb/loop_sqlc_mapping.go
  • internal/store/globaldb/queries/loop_core.sql
  • internal/store/globaldb/queries/loop_lifecycle.sql
  • internal/store/globaldb/queries/loop_runtime.sql
  • internal/store/globaldb/queries/task_claim.sql
  • internal/store/globaldb/schema/definitions/41_reliability.sql
  • internal/store/globaldb/schema/definitions/50_loops.sql
  • internal/store/globaldb/schema/migrations/00043_schema.sql
  • internal/store/globaldb/schema/migrations/00044_schema.sql
  • internal/store/globaldb/sqlcgen/loop_core.sql.go
  • internal/store/globaldb/sqlcgen/loop_lifecycle.sql.go
  • internal/store/globaldb/sqlcgen/loop_runtime.sql.go
  • internal/store/globaldb/sqlcgen/models.go
  • internal/store/globaldb/sqlcgen/task_claim.sql.go
  • internal/store/types_dead_entity.go
  • internal/task/coordinator.go
  • internal/task/coordinator_timer.go
  • internal/task/manager.go
  • internal/task/manager_constructor.go
  • internal/task/manager_coordinator_run.go

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

The PR adds loop lifecycle reliability features across configuration, DSL validation, retries, quarantines, effects, target health, daemon scheduling, durable storage, and event handling. It also adds migration coverage and end-to-end tests.

Changes

Loop lifecycle reliability

Layer / File(s) Summary
Lifecycle contracts and configuration
internal/config/*, internal/loop/dsl/*, internal/loop/lifecycle_config.go, internal/loop/service_types.go
Adds lifecycle configuration, retry and breaker policies, effects, waits, cancellation states, result contracts, predicate policies, and lifecycle grammar validation.
Coordinator execution and failure handling
internal/loop/coordinator*, internal/loop/failure_*, internal/loop/node_*, internal/loop/quarantine.go
Adds attempt tracking, retry planning, failure classification, error routing, quarantine, requeue planning, parked dependencies, target admission, and repair feedback.
Effects and daemon runtime
internal/loop/effects_*, internal/daemon/loop_effect_relay*, internal/daemon/loop_target_health.go, internal/daemon/scheduler_loop_*
Adds rendered effect intents, durable effect delivery, target-health breakers, retry timers, due-retry recovery, daemon boot wiring, and shutdown handling.
Persistence and validation
internal/store/globaldb/*, internal/task/*
Adds lifecycle tables, migrations, SQL accessors, epoch fencing, event delivery keys, retry wake persistence, effect acknowledgements, coordinator timers, and migration/integration tests.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • compozy/compozy#290: Overlaps with coordinator generation, succession, snapshot intents, and lifecycle event handling.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stack/loop-lifecycle-01-runtime

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit f337856.

This branch was successfully deployed

1 active deployment
Preview — f3378561 Deployed Aug 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant