fix(cli): add timing.started ISO timestamp to plan prompt JSON envelope #9447

Merged
HAL9000 merged 3 commits from fix/plan-prompt-json-timing-started into master 2026-06-03 07:20:49 +00:00

3 Commits

Author SHA1 Message Date
HAL9000 24d315749b fix(cli): plan prompt JSON envelope and remove unrelated files
CI / lint (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 25s
CI / build (pull_request) Successful in 48s
CI / helm (pull_request) Successful in 53s
CI / quality (pull_request) Successful in 1m1s
CI / typecheck (pull_request) Successful in 1m9s
CI / security (pull_request) Successful in 1m11s
CI / unit_tests (pull_request) Successful in 5m16s
CI / docker (pull_request) Successful in 1m34s
CI / integration_tests (pull_request) Successful in 9m33s
CI / coverage (pull_request) Successful in 10m21s
CI / status-check (pull_request) Successful in 2s
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
2026-06-03 03:03:14 -04:00
HAL9000 1f1b135db7 fix(cli): add timing.started ISO timestamp to plan prompt JSON envelope
- 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
2026-06-03 03:03:14 -04:00
HAL9000 abd4e83baa fix(cli): add timing.started ISO timestamp to plan prompt JSON envelope
- 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
2026-06-03 03:03:14 -04:00