<!-- task=m-backtest-multi-timeframe-coverage/02+01_monthly_operator_handoff plan=0 tag=OPERATIONS -->
# Plan - OPERATIONS

## Meta

- Task: m-backtest-multi-timeframe-coverage/02+01_monthly_operator_handoff
- Milestone: agent-roadmap/phase/backtest-loop/milestones/backtest-multi-timeframe-coverage.md
- Lane: local
- Gate: G05
- Tag: OPERATIONS
- Status: planned
- Scope: monthly-bars operator handoff and milestone closure
- Predecessor: `agent-task/m-backtest-multi-timeframe-coverage/01_monthly_worker_core/complete.log` or the matching archived complete log

## Roadmap Targets

- `agent-roadmap/phase/backtest-loop/milestones/backtest-multi-timeframe-coverage.md` task id `monthly-bars`

## Spec Targets

- `agent-roadmap/sdd/backtest-loop/backtest-multi-timeframe-coverage/SDD.md` scenario S04: monthly-bars deterministic daily aggregation with provenance evidence

## Context

This task is the handoff layer for `monthly-bars`. It should start only after the worker/API core task has an active or archived complete log. Once the API operation exists, the operator scenario needs a small action, JSONL evidence, and documentation updates so the SDD scenario can be demonstrated without relying on ad hoc API calls.

## Scope

In scope:

- Add an operator action for monthly aggregation that maps scenario input to the new API request.
- Extend operator step events and output rendering with monthly aggregation counts and provenance summary fields.
- Add deterministic operator tests and fixtures that prove the monthly aggregation action produces expected JSONL evidence.
- Update `apps/cli/testdata/operator/headless_validation.md` with the new evidence scenario.
- Check the `monthly-bars` roadmap task only after the operator evidence and predecessor verification pass.

Out of scope:

- Worker/API core implementation. That belongs to `01_monthly_worker_core`.
- Any provider-side refresh workflow.
- Broad scenario runner refactors unrelated to monthly aggregation.

## Work Items

1. Verify the predecessor complete log exists and the core API operation is available.
2. Add a scenario action such as `aggregate_monthly_bars` in `apps/cli/internal/operator/scenario.go` using the existing market/venue/provider/symbol/range vocabulary.
3. Add an operator API client method and runner branch that calls the monthly aggregation API operation.
4. Extend `StepEvent` and text/JSONL output with source bar count, monthly bar count, provenance count, and aggregation rule id.
5. Add fake-client unit tests and deterministic testdata under `apps/cli/testdata/operator`.
6. Update the headless validation document with the exact command/evidence path.
7. Mark roadmap task `monthly-bars` complete only after tests and scenario evidence pass.

## Acceptance Criteria

- The operator can run a deterministic monthly aggregation scenario and emit JSONL evidence that includes monthly counts and provenance summary.
- Scenario validation rejects missing provider, empty symbols, invalid market/venue, and invalid date/range inputs before calling the API.
- The expected JSONL fixture is stable across repeated runs.
- The `monthly-bars` roadmap checkbox is updated with completion evidence after all verification commands pass.

## Verification

- Confirm predecessor: active `01_monthly_worker_core/complete.log` or matching archived complete log
- `go test ./apps/cli/internal/operator -run 'Test(RunScenarioAggregateMonthlyBars|ValidateAggregateMonthlyBars|MonthlyBarsFixture)'`
- `bin/contracts-check`
- `git diff --check`

## Notes

- Keep the operator output compact and evidence-oriented. The full provenance payload can remain in API responses; operator output should expose the fields needed to prove SDD S04.
- This task owns the final `monthly-bars` roadmap checkbox because it produces user-visible verification evidence.
