Skip to content

feat(planner): require trycycle-ready bead contracts before trycycle worker runs - #722

Open
shaug wants to merge 16 commits into
mainfrom
scott/issue-719-trycycle-ready-planner-contract
Open

feat(planner): require trycycle-ready bead contracts before trycycle worker runs#722
shaug wants to merge 16 commits into
mainfrom
scott/issue-719-trycycle-ready-planner-contract

Conversation

@shaug

@shaug shaug commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Tightened trycycle.approved_at validation in src/atelier/trycycle_contract.py to require an auditable timestamp format: must include a time component and timezone offset (date-only and naive datetime values are now rejected fail-closed).
  • Added TDD coverage in tests/atelier/test_trycycle_contract.py for the new failing cases:
    • date-only approved_at
    • naive datetime approved_at
  • Added projected-runtime execution coverage in tests/atelier/skills/test_projected_skill_runtime_bootstrap.py for plan-promote-epic, proving projected repo src/ is preferred for trycycle_contract import resolution.

Test Plan

  • uv run pytest tests/atelier/test_trycycle_contract.py -k "date_only_approved_timestamp or naive_approved_timestamp" -v
    • Failed first (red), then passed after implementation.
  • uv run pytest tests/atelier/test_trycycle_contract.py -v
    • Passed (11 passed).
  • uv run pytest tests/atelier/skills/test_projected_skill_runtime_bootstrap.py -k "projected_promote_epic_reorders_repo_src_ahead_of_installed_package or check_guardrails" -v
    • Passed (4 passed).
  • just format
    • Passed.
  • just lint
    • Passed.
  • just test
    • Passed (1699 passed pytest + shell suites passed).

Residual Issues

  • minor: _parse_bool in trycycle_contract.py currently treats 1, yes, on as targeted in addition to true; behavior docs describe targeting as trycycle.targeted: true.
  • minor: test-plan item for guardrails main() path coverage remains incomplete (_evaluate_guardrails is covered; main() path not yet explicitly covered).
  • minor: test-plan item for invalid promotion coverage with and without --yes currently covers non---yes path only.

shaug added 16 commits March 26, 2026 17:57
- add a complete trycycle-planning execution plan for GitHub issue #719\n- define behavior contracts, invariants, architecture decisions, and cutover risks\n- break implementation into TDD task slices with exact files, tests, commands, and commit checkpoints
- close startup bypass gaps by requiring trycycle gating across explicit, review-feedback, and merge-conflict claim paths
- add missing test-surface updates for next-changeset protocol consumers and focused regression commands
- capture epic-as-single-unit approval metadata expectations to avoid promotion-time audit gaps
- add a prioritized, source-of-truth-mapped test plan for issue #719\n- define harness prerequisites for planner scripts, startup gating, and projected runtime\n- enumerate coverage and explicit exclusions for trycycle contract gating
- add shared trycycle readiness schema and parser
- add deterministic readiness validation and diagnostics
- wire guardrail script to shared trycycle readiness validator
- add deterministic contract violation coverage
- block promotion when trycycle contract validation fails
- persist approval metadata and planning evidence audit trail
- add startup claim gate for trycycle contract readiness across all claim paths
- preserve existing non-trycycle claim behavior
- align planner template and skill docs with trycycle gating contract
- update bootstrap and docs coverage for new shared contract usage
- close verification gaps across planner validation and worker gating
- ensure format/lint/test gates pass with fail-closed invariants
- hydrate startup claim candidates before trycycle eligibility checks across review-feedback and merge-conflict paths
- hydrate sparse startup-runtime payloads before delegating to shared trycycle validator
- persist trycycle approval evidence before lifecycle transitions so failed metadata writes do not partially promote work
- extend worker and promotion tests for shared-validator parity and fail-closed transition sequencing
- fail closed when startup claim candidates cannot load metadata before trycycle eligibility checks
- require explicit ATELIER_AGENT_ID for targeted approval recording in promotion flow
- validate malformed trycycle approval message identifiers in shared contract checks
- add differential parity and regression tests across evaluator, guardrails, promotion preflight, and worker adapters
- require  to be a timezone-aware datetime with a time component
- add red/green readiness tests for date-only and naive approval timestamps
- add projected runtime execution coverage proving  prefers repo  imports for

Fixes #719
- rename the shared planner/worker contract module and APIs to refined terminology\n- switch metadata defaults to execution.strategy/planning.* while preserving legacy trycycle key compatibility reads\n- update planner skills, template guidance, and worker startup claim eligibility wiring\n- add the plan-refined-deliberation skill and refresh coverage/docs for refined planning semantics
- drop all trycycle.* metadata fallback reads in refined planning readiness checks\n- require execution.strategy=refined and planning.* fields exclusively\n- add regression coverage proving legacy trycycle fields are ignored
- expand plan-refined-deliberation with strategy challenge, assumption handling, and plan quality rubric\n- add planner template instructions for low-bar replan and high-bar user escalation\n- add test coverage that locks in strategy-challenge language for planner template and skill docs
- thread strategy-challenge and boundary-first drafting guidance through planner template and core planning skills\n- keep refined planning focused on iterative evaluation/sign-off while reusing the same drafting strategy\n- extend planner template and packaged-skill tests to lock in the cross-skill planning discipline wording
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