RQ Controller State Orchestration Reads
Status: Complete (closed 2026-04-10 18:08 UTC) Timezone: UTC (all dates/times in this package documentation use UTC unless explicitly stated otherwise).
Overview
This package implemented the run-scoped orchestration read surfaces that let agents drive WEPPcloud workflows deterministically without UI scraping. It delivered /pipeline and /readiness for existing runid/config contexts with canonical step identity, state transitions, invalidation lineage, and next-action semantics.
Objectives
- Implement run-scoped orchestration read endpoints in rq-engine:
GET /api/runs/{runid}/{config}/pipelineGET /api/runs/{runid}/{config}/readiness
- Enforce contract-aligned step/state semantics (
step_id,operation_id, status/state machine,can_run_now, invalidation lineage). - Ensure payloads are deterministic and config/mod-aware for baseline and disturbed runs.
- Add/extend OpenAPI and route-level tests plus frozen artifact/checklist guards for the new endpoints.
Scope
This package delivered orchestration-read route implementation, contract-aligned payload builders, and required tests/docs/checklist updates.
Included
- New rq-engine orchestration-read routes for pipeline/readiness.
- Router-registration and OpenAPI metadata updates.
- Pipeline/readiness payload assembly from run state with contract-required fields.
- Contract and route tests for auth, payload shape, state transitions, deterministic next-action selection, and review-identified regressions.
- Frozen artifact updates:
docs/work-packages/20260208_rq_engine_agent_usability/artifacts/endpoint_inventory_freeze_20260208.mddocs/work-packages/20260208_rq_engine_agent_usability/artifacts/route_contract_checklist_20260208.md
Explicitly Out of Scope
- Endpoint schema/default surfaces for core operations (
20260410_rq_controller_state_schema_defaults). - Geospatial/upload metadata contracts (
20260410_rq_controller_state_geospatial_uploads). - Error catalog/progress/outputs surfaces (
20260410_rq_controller_state_errors_progress_outputs). - Auth-concurrency/idempotency rollout enforcement (
20260410_rq_controller_state_auth_concurrency).
Stakeholders
- Primary: rq-engine maintainers and agent-interface implementers.
- Reviewers: API contract/schema maintainers.
- Security Reviewer: independent security subagent review required by package gate.
- Informed: downstream owners for roadmap packages 4-8.
Success Criteria
-
/pipelineand/readinessare implemented and exposed under rq-engine/api/runs/{runid}/{config}. - Step identity and status fields align with the contract core vocabulary and state-machine semantics.
-
next_actionable_stepsis deterministic for baseline and disturbed configs given equivalent state. - Frozen endpoint inventory/checklist artifacts include the orchestration read routes.
- Required validation gates pass (code, QA, security, docs) with no unresolved medium/high findings.
Dependencies
Prerequisites
docs/work-packages/20260410_rq_controller_state_foundation/(complete)docs/work-packages/20260410_rq_controller_state_setup_discovery/(complete)- Canonical route artifacts:
docs/work-packages/20260208_rq_engine_agent_usability/artifacts/endpoint_inventory_freeze_20260208.mddocs/work-packages/20260208_rq_engine_agent_usability/artifacts/route_contract_checklist_20260208.md
Blocks
20260410_rq_controller_state_schema_defaults20260410_rq_controller_state_geospatial_uploads20260410_rq_controller_state_errors_progress_outputs20260410_rq_controller_state_auth_concurrency20260410_rq_controller_state_contract_cutover
Related Packages
- Depends on:
- Related: 20260208_rq_engine_agent_usability
- Follow-up:
20260410_rq_controller_state_schema_defaults20260410_rq_controller_state_geospatial_uploads20260410_rq_controller_state_errors_progress_outputs20260410_rq_controller_state_auth_concurrency
Timeline Estimate
- Expected duration: 1-2 focused sessions
- Complexity: High
- Risk level: High
Security Impact and Review Gate
- Security impact triage:
high - Dedicated security review required:
yes - Triage rationale: Adds new agent-facing run-scoped endpoints that expose orchestration state and readiness decisions; requires explicit review of run-access boundaries, auth/scope parity, and state disclosure constraints.
- Security review artifact:
docs/work-packages/20260410_rq_controller_state_orchestration_reads/artifacts/2026-04-10_security_review.md
Required Validation Gates
Code Gate
- Implement/extend orchestration-read route and contract tests.
- Update OpenAPI metadata/tests for orchestration-read endpoints.
- Update frozen endpoint inventory/checklist artifacts and contract-rule guards.
- Required commands:
wctl run-pytest tests/microservices/test_rq_engine_orchestration_read_routes.py --maxfail=1wctl run-pytest tests/microservices/test_rq_engine_openapi_contract.py --maxfail=1python tools/check_endpoint_inventory.pypython tools/check_route_contract_checklist.pywctl run-pytest tests/tools/test_endpoint_inventory_guard.py tests/tools/test_route_contract_checklist_guard.py --maxfail=1
QA Gate
- Run independent
reviewerandqa_reviewersubagent passes. - Capture findings and dispositions in package tracker.
- No unresolved medium/high QA findings at handoff.
Security Gate
- Complete
artifacts/2026-04-10_security_review.mdusing template guidance. - Run independent
security_reviewersubagent pass. - Explicitly review auth/scope/session/CSRF and run-state disclosure implications.
- No unresolved medium/high security findings at handoff.
Docs Gate
- Run
wctl doc-linton changed package/tracker/prompt/security docs, frozen artifacts, andPROJECT_TRACKER.md.
References
docs/schemas/rq-controller-state-contract.mddocs/schemas/rq-engine-agent-api-contract.mddocs/work-packages/README.mddocs/prompt_templates/codex_exec_plans.mddocs/prompt_templates/security_review_template.mdwepppy/microservices/rq_engine/AGENTS.mdPROJECT_TRACKER.md
Deliverables
- Orchestration-read route implementation in rq-engine (
/pipeline,/readiness). - Orchestration-read tests and OpenAPI contract updates.
- Updated frozen inventory/checklist artifacts for new agent-facing routes.
- Updated package lifecycle docs and archived ExecPlan.
- Completed security review artifact and reviewer/QA/security finding dispositions.
Closure Notes
- Implemented run-scoped orchestration reads:
GET /api/runs/{runid}/{config}/pipelineGET /api/runs/{runid}/{config}/readiness
- Added deterministic payload synthesis with stable issue joins, invalidation lineage, and next-action prioritization.
- Hardened review-driven edge handling:
- dedicated
RunConfigMismatchError(404only for config mismatch) - canonical
500for non-not-found value failures - UTC normalization for naive timestamps
- deterministic empty-timeline
updated_at - recursive child-job status/ended-at folding for fan-out queue trees
- dedicated
- Expanded orchestration route tests to cover auth denial, malformed paths, completion fallback, revision sensitivity, redaction, baseline/disturbed determinism, roads/swat completion semantics, and child-tree status precedence.
- Completed independent
reviewer,qa_reviewer, andsecurity_reviewerpasses; no unresolved medium/high QA or security findings remain. - Archived active ExecPlan to:
docs/work-packages/20260410_rq_controller_state_orchestration_reads/prompts/completed/rq_controller_state_orchestration_reads_execplan.md- outcome note:
docs/work-packages/20260410_rq_controller_state_orchestration_reads/prompts/completed/rq_controller_state_orchestration_reads_execplan_outcome.md
Follow-up Work
20260410_rq_controller_state_schema_defaults20260410_rq_controller_state_geospatial_uploads20260410_rq_controller_state_errors_progress_outputs20260410_rq_controller_state_auth_concurrency