Sub-agent landed the feature. Summary:
Modified: plan.py (Step.optional + validation/serialization), events.py (make_step_skipped_event / make_item_skipped_event factories, terminal-state handling), gate.py:254–298 (cursor advances on skip events, bypasses produces gating, repeat-loop exits clean), lifecycle.py (cmd_next --skip loop), inbox.py ("skip" decision), run_audit.py (skipped_steps tally + events verify --strict rejection of illegal skips), pipeline.py (skip in LIFECYCLE_VERBS).
Added: astrid/core/task/lifecycle_skip.py (the cmd_skip verb), tests/task/test_optional_steps.py (14 tests, all pass).
Tests: 14/14 new tests pass. Broader suite: 164 passed, 2 failed — both pre-existing on baseline (test_plan_schema_collapsed.py::test_load_plan_rejects_non_v2 and test_task_kernel_e2e.py::test_two_step_plan_drives_kernel_end_to_end), verified by stash/unstash. Untouched.
Deviations worth flagging:
- Skip-legality replay check went in
run_audit.py::cmd_events_verify --strict rather than validator.py — the validator is plan-mutation-only; event replay already lives in run_audit.py. Cleaner placement.
cmd_next --skip consumes consecutive optional steps then prints the next dispatch in one call (more useful than exit-after-skip).
- Item-level skip via
--item works regardless of host step's optional flag — matches your spec's for_each test case.
Heads up:
- New
skipped_steps field in astrid run show --json output.
- Pre-existing failures on
reshape/sprint-5b (unrelated to this work) are worth a separate fix.
WIP preserved, nothing committed. Want me to run a quick smoke (astrid skip on a real plan) or open a diff for review?