Bound Workflow listings, cleanup, and replay resources - #20
Conversation
Bound definition and instance listings with quotas, byte budgets, cursor continuation, and consolidated snapshots. Bound lifecycle preflight and batched cleanup while preserving deletion fences and validating restart params. Account for retained, detached, and in-flight replay bytes and release reservations when controllers close. Expose configurable system-runtime maintenance capacity and align fixtures, tests, and bilingual documentation. Signed-off-by: Lu Zhang <lu@wdl.dev>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
Rollout documentation incorrectly claims deferred CLI pagination support is included.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds bounded resource handling across Workflow listing, deletion, replay, and persisted payload paths, with synchronized contracts, tests, and infrastructure controls.
Changes:
- Adds paginated, byte-limited Workflow definition and instance listing.
- Bounds lifecycle cleanup and Runtime replay memory while validating persisted payloads.
- Adds system-runtime capacity configuration and updates documentation/tests.
File summaries
| File | Description |
|---|---|
tests/unit/workflow-replay-cache.test.js |
Tests replay accounting and admission. |
tests/unit/workflow-definitions.test.js |
Tests definition quotas and snapshots. |
tests/unit/style-contracts.test.js |
Pins fixtures and Terraform wiring. |
tests/unit/runtime-dispatch-workflows.test.js |
Tests replay cancellation and saturation. |
tests/unit/control-shared.test.js |
Tests bounded Workflow transport and lifecycle pagination. |
tests/unit/control-handlers-workflows.test.js |
Tests definition and instance listing. |
tests/unit/control-deploy-watch.test.js |
Tests quota-aware deploy reads. |
tests/unit/control-delete-handler.test.js |
Updates delete-lock expectations. |
tests/integration/workflows-runtime-retention.test.js |
Tests restart validation and cleanup paging. |
tests/integration/workflows-runtime-core.test.js |
Tests replay pressure and bounded lists. |
tests/integration/workflows-metadata.test.js |
Tests definition pagination and quotas. |
tests/integration/helpers/workflows-scenarios.js |
Adds lifecycle test helpers. |
tests/helpers/workflow-definitions.js |
Adds definition-module test adapter. |
tests/helpers/load-control-shared.js |
Wires bounded-response dependencies. |
tests/helpers/load-control-lib.js |
Wires definition module into tests. |
tests/helpers/control-shared-stub.js |
Exposes Workflow reader helpers. |
tests/fixtures/workflow-limits.json |
Adds params and instance response limits. |
tests/fixtures/workflow-lifecycle-check.json |
Defines lifecycle pagination contract. |
test-workers/workflow-replay-lifetime/src/root.js |
Adds replay-lifetime root probe. |
test-workers/workflow-replay-lifetime/src/metrics.js |
Adds probe metric storage. |
test-workers/workflow-replay-lifetime/src/index.js |
Tests cross-JSRPC replay cleanup. |
test-workers/workflow-replay-capacity/src/index.js |
Generates concurrent replay pressure. |
terraform/variables.tf |
Adds system-runtime desired count. |
terraform/terraform.tfvars.example |
Documents maintenance scaling. |
terraform/README.md |
Documents capacity controls. |
terraform/modules/compute/variables.tf |
Declares module capacity input. |
terraform/modules/compute/system_runtime_service.tf |
Applies configurable desired count. |
terraform/main.tf |
Passes the new capacity input. |
rust/workflows/src/server.rs |
Returns typed instance-list responses. |
rust/workflows/src/api/tick.rs |
Bounds persisted params reads. |
rust/workflows/src/api/status.rs |
Builds byte-limited instance pages. |
rust/workflows/src/api/pending_create.rs |
Shares fenced cleanup primitives. |
rust/workflows/src/api/payload.rs |
Centralizes persisted payload validation. |
rust/workflows/src/api/model.rs |
Adds raw rows and lifecycle cursors. |
rust/workflows/src/api/limits.rs |
Defines shared response limits. |
rust/workflows/src/api/lifecycle/restart.rs |
Validates params before restart mutation. |
rust/workflows/src/api/lifecycle/cleanup.rs |
Adds bounded, resumable cleanup. |
rust/workflows/src/api.rs |
Re-exports new Workflow primitives. |
runtime/dispatch/workflow-step.js |
Adds replay leases and cancellation. |
runtime/dispatch/workflow-replay-cache.js |
Enforces replay working-set limits. |
runtime/config-system.capnp |
Embeds the definition module. |
README.zh.md |
Removes obsolete V2 terminology. |
README.md |
Removes obsolete V2 terminology. |
docs/source-map.zh.md |
Records definition-module ownership. |
docs/source-map.md |
Records definition-module ownership. |
docs/security.zh.md |
Updates residual-risk terminology. |
docs/security.md |
Updates residual-risk terminology. |
docs/redis-key-layout.zh.md |
Documents definition quotas. |
docs/redis-key-layout.md |
Documents definition quotas. |
docs/protocol-contracts.zh.md |
Documents new Workflow fixtures. |
docs/protocol-contracts.md |
Documents new Workflow fixtures. |
docs/modules/workflows.zh.md |
Expands Workflow resource contracts. |
docs/modules/workflows.md |
Expands Workflow resource contracts. |
docs/modules/runtime.zh.md |
Documents replay accounting. |
docs/modules/runtime.md |
Documents replay accounting. |
docs/modules/log-tail-observability.zh.md |
Documents replay metrics. |
docs/modules/log-tail-observability.md |
Documents replay metrics. |
docs/modules/infra.zh.md |
Documents desired-count controls. |
docs/modules/infra.md |
Documents desired-count controls. |
docs/modules/control-auth.zh.md |
Documents bounded Workflow transport. |
docs/modules/control-auth.md |
Documents bounded Workflow transport. |
docs/modules/cli.zh.md |
Removes obsolete V2 terminology. |
docs/modules/cli.md |
Removes obsolete V2 terminology. |
docs/compatibility.zh.md |
Updates Workflow compatibility wording. |
docs/compatibility.md |
Updates Workflow compatibility wording. |
control/workflows-client.js |
Adds bounded response readers and deadlines. |
control/workflow-definitions.js |
Implements quotas and Redis snapshots. |
control/shared.js |
Adds bounded lifecycle continuation. |
control/handlers/workflows.js |
Implements paginated definition/list forwarding. |
control/handlers/versions.js |
Passes version-delete lock token. |
control/handlers/deploy.js |
Enforces retained-definition quotas. |
control/handlers/delete.js |
Passes worker-delete lock token. |
control/bundle.js |
Bounds Workflow declarations. |
CHANGELOG.md |
Summarizes Workflow resource bounds. |
Review details
- Files reviewed: 74/74 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f42b52296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Return the retryable incomplete error for lifecycle checks requiring a fresh scan. Cover rescan responses in shared fixtures and Rust/Control regression tests. Pin CLI 1.9.0 and align support diagnostics, CI, and bilingual rollout guidance. Clarify configurable system-runtime capacity and zero-replica maintenance. Signed-off-by: Lu Zhang <lu@wdl.dev>
Keep per-call and total-deadline failures distinct and require explicit timeout selection. Add bounded server-only payload diagnostics and production-path rescan coverage. Clarify scan limits, dry-run behavior, and system-runtime maintenance effects. Signed-off-by: Lu Zhang <lu@wdl.dev>
There was a problem hiding this comment.
🔵 Needs a closer look
The coordinated Redis, Rust, Runtime memory, pagination, and rollout changes warrant final human validation despite extensive coverage.
Review details
- Files reviewed: 80/80 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Verify published CLI pagination through empty and short pages in text and JSON output. Keep replay resource assertions mandatory while making Docker RSS sampling optional. Update CLI documentation and calibrate fallback scheduling from the complete 58-file integration run. Signed-off-by: Lu Zhang <lu@wdl.dev>
There was a problem hiding this comment.
🔵 Needs a closer look
It spans stateful cross-tier protocols, lifecycle deletion, and Runtime memory admission, while the final commit did not receive a complete integration-suite run.
Review details
- Files reviewed: 80/80 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Summary
workflow_lifecycle_check_incomplete; completed cleanup is retained without automatic rescan. Explicit per-call timeout selection is required, and the limiting deadline is fixed at request setup so delayed rejection cannot change its classification.system_runtime_desired_count(default one; zero permitted for maintenance), pin CLI 1.9.0, and align fixtures, tests, bilingual documentation, and version diagnostics. Remove obsolete Workflows V2 wording and simplify the single-worker definition builder.API And Rollout
/whoami.minCliVersionremains diagnostic metadata, not request enforcement. Upgrading WDL services does not upgrade installed clients.workflow_lifecycle_check_incompleterequires a fresh deletion request. The ten-second budget covers Workflow preflight, not the whole delete path. Dry-run remains read-only and need not converge over stale indexes. Replay gauges count accounted bytes, not RSS. Definition quotas include retired names.__system__Workers, not necessarily tenant traffic served by other pools.Details: Workflow contract and rollout notes.
Validation
1240100b3ffcaeccd1110dc2a0d30088bb69ac81.0924e52: rebuilt-image integration 10/10 files, 84/84 tests passed, covering all nine CLI files plus auth/whoami.7f42b52with CLI 1.8.1. Full integration has not been rerun on the final commit; the targeted runs above do not constitute a new full-suite pass.Deliberately Deferred