> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_29/session_15_pre_run_estimate.md).

# Session 15: Pre-Run Estimate

**Session ID**: `phase29-session15-pre-run-estimate` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Show projected spend, source cadence, and expected wall-clock before a Trend Finder run starts. Maps the Tier 3 cost/wall-clock-transparency idea.

***

## Scope

### In Scope (MVP)

* Reuse existing spend/cadence accounting to compute a bounded pre-run estimate.
* Surface it in the scheduler first-run panel and run control before the run.
* Label it as an estimate and keep retrospective spend labels unchanged.
* Do not imply a hard cap unless one is actually enforced by the runner.

### Out of Scope

* Introducing or enforcing a new hard spend cap.
* Changing the post-run actual-spend accounting path.

***

## Prerequisites

* [x] Phase 28 spend-accounting and scheduler-status paths green.

***

## Deliverables

1. Bounded pre-run spend/cadence/wall-clock estimate.
2. Estimate surfaced in scheduler first-run panel and run control before run.
3. Estimate labeling that does not imply an unenforced hard cap.
4. Tests covering missing-cost and configured paid-source cases.

***

## Success Criteria

* [ ] A pre-run spend/cadence estimate renders before execution.
* [ ] The post-run actual-spend path is unchanged.
* [ ] Tests cover missing-cost and configured paid-source cases.
* [ ] Payload budget and privacy scans remain green.

***

## Key Files

* `scripts/extensions/trend-finder/spend-accounting.ts`
* `scripts/lib/trend-finder-scheduler-status.ts`
* `src/extensions/trend-finder/scheduler-status.ts`
* `src/extensions/trend-finder/run-control.ts`
* `src/extensions/trend-finder/components/scheduler-first-run-panel.tsx`
* `src/extensions/trend-finder/components/trend-run-control.tsx`

***

## Comparison Notes (folded from comparison plan)

**Effort:** Low. **Boundary risk:** None. Tier 3 polish.

**Cost and wall-clock transparency.** In TrendingAI, Stage 1 announces estimated spend and a time budget with a hard ceiling. Trend Finder adoption: show projected spend, source cadence, and expected wall-clock in scheduler/run-control before execution; label it an estimate and do not imply a hard cap unless one is actually enforced by the runner.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_29/session_15_pre_run_estimate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
