The prior commits added `timing.started` to a local envelope dict in
`prompt_plan_cmd`, but that dict was passed as the `data` argument to
`format_output()`, which builds its OWN envelope from `data`. Result:
the test-asserted `command="plan prompt"` ended up as an empty string
at the JSON root, and `timing.started` was buried in
`data.timing.started` instead of `timing.started`.
This commit:
- Extends `format_output` and `_build_envelope` with an optional
`started_at: datetime | None` parameter. When provided, the envelope's
`timing` dict includes a `started` ISO-8601 field alongside
`duration_ms`. Backward compatible: default `None` preserves the
existing timing shape for all current callers.
- Refactors `prompt_plan_cmd` to call
`format_output(prompt_data, fmt, command="plan prompt", ...,
started_at=started_at)` for the JSON and YAML formats so the envelope
keys are populated at the document root. Table/plain/color formats
retain the legacy envelope-wrapping behavior — the existing scenario
outline relies on the envelope being passed directly to the table
renderer.
- Removes 48 unrelated files accidentally committed to the repo root
by the original PR commit (`_issue_state.py`, `_pr_dep*.py`,
`_pr_labels.py`, `_pr_setup.py`, `coverage_boost_steps*.py`,
`cross_plan_correction_*.py`, `parse_*.py`, `search_*.py`,
`retry_policy_updated.py`, `run_behave_parallel.py`,
`acms_context_analysis_steps.py`, `aggregate_all.py`,
`check_issues.py`, `check_last_page.py`, `fix_timing.py`,
`helper_cross_plan_correction*.py`, `groom_prompt.txt`,
`label_result.txt`, `prompt_auto_rev_sup.txt`, `tmp/uat_worker_*`,
`tmp/update_issue_labels.sh`). These contained hardcoded API tokens
and broke `ruff format --check`. The exposed token
(`92224acff675c50c5958d1eaca9a688abd405e06`) should be rotated
separately.
- Adds CHANGELOG.md entry under [Unreleased] > Fixed.
ISSUES CLOSED: #9353
- Capture started_at timestamp using datetime.now(UTC) before service call
- Add timing.started field to JSON envelope with ISO 8601 format
- Update step definitions to verify timing.started is present and valid
- Remove @tdd_expected_fail tag from plan_prompt_command.feature scenario
- Remove unrelated files accidentally committed to repo root
- Move datetime import to top of plan_prompt_command_steps.py
- Add CHANGELOG.md entry under [Unreleased] > Fixed
ISSUES CLOSED: #9353
- Capture started_at timestamp using datetime.now(UTC) before service call
- Add timing.started field to JSON envelope with ISO 8601 format
- Update step definitions to verify timing.started is present and valid
- Remove @tdd_expected_fail tag from plan_prompt_command.feature scenario
Fixes#9353