> 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/sessions/phase21-session01-pricing-daily-activity-accuracy/tasks.md).

# Task Checklist

**Session ID**: `phase21-session01-pricing-daily-activity-accuracy` **Total Tasks**: 22 **Estimated Duration**: 3-4 hours **Created**: 2026-06-02

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[SNNMM]` = Session reference (NN=phase number, MM=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 5      | 5      | 0         |
| Implementation | 10     | 10     | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **22** | **22** | **0**     |

***

## Setup (3 tasks)

Initial context capture and implementation scaffolding.

* [x] T001 \[S2101] Verify the current AI OS pricing table and v2.3 source anchors before editing (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)
* [x] T002 \[S2101] Review existing scanner, aggregate, validation, and home-transform tests and record baseline gaps (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)
* [x] T003 \[S2101] Record generated-data privacy and unknown-pricing degradation posture for this session (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/security-compliance.md`)

***

## Foundation (5 tasks)

Lock expected behavior in focused tests before wiring production code.

* [x] T004 \[S2101] \[P] Add pricing-helper tests for exact 4.x rows, Claude 3.x rows, Claude-family variants, cache tokens, missing tokens, and unknown-null behavior (`scripts/lib/__tests__/session-scanner.test.ts`)
* [x] T005 \[S2101] \[P] Add parser tests for per-day unique session counts across same-file turns, multiple files, missing timestamps, malformed rows, and unknown models (`scripts/lib/__tests__/session-scanner.test.ts`)
* [x] T006 \[S2101] \[P] Add aggregate emission tests for `daily[].sessions`, stable cost rounding, deterministic ordering, and true-unknown pricing warnings (`scripts/lib/__tests__/aggregate-orchestration.test.ts`)
* [x] T007 \[S2101] \[P] Add home transform tests that prefer `daily.sessions` and fall back to messages for legacy payloads (`src/lib/__tests__/home-transforms.test.ts`)
* [x] T008 \[S2101] \[P] Add validation compatibility tests for new daily session rows and legacy daily rows (`src/lib/__tests__/nested-validation.test.ts`)

***

## Implementation (10 tasks)

Implement the pricing and daily activity accuracy path.

* [x] T009 \[S2101] Implement `priceForModel` with current AI OS rows, Claude 3.x rows, Claude-family fallback, and unknown `null` handling (`scripts/lib/session-scanner.ts`)
* [x] T010 \[S2101] Route `computeCost` and `hasKnownModelPricing` through `priceForModel` with true unknown models excluded from spend totals (`scripts/lib/session-scanner.ts`)
* [x] T011 \[S2101] Extend scanner day buckets with a per-day session `Set` keyed by stable JSONL session identity and safe row handling (`scripts/lib/session-scanner.ts`)
* [x] T012 \[S2101] Emit parsed daily bucket session counts while preserving token, message, and cost totals (`scripts/lib/session-scanner.ts`)
* [x] T013 \[S2101] Add `daily[].sessions` to aggregate output with rounded costs, bounded rows, and deterministic ordering (`scripts/lib/aggregate-orchestration.ts`)
* [x] T014 \[S2101] Update aggregate model-usage pricing status so fallback-priced Claude variants are priced and true unknown rows warn (`scripts/lib/aggregate-orchestration.ts`)
* [x] T015 \[S2101] Extend the `DailyEntry` contract with optional `day` and `sessions` fields matching emitted live data (`src/lib/live-data-types.ts`)
* [x] T016 \[S2101] Update live-data validation defaults for additive `daily[].sessions` support while preserving legacy daily rows (`src/lib/validate-live-data.ts`)
* [x] T017 \[S2101] Update the committed live-data example for daily session compatibility without committing generated private data (`src/data/live-data.example.json`)
* [x] T018 \[S2101] Update daily activity and usage-daily transforms to prefer `daily.sessions` with legacy message fallback (`src/lib/home-transforms.ts`)

***

## Testing (4 tasks)

Verification and final sign-off evidence.

* [x] T019 \[S2101] Run focused scanner and aggregate tests and record exact commands and results (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)
* [x] T020 \[S2101] Run focused validation and home-transform tests and record exact commands and results (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)
* [x] T021 \[S2101] Run app typecheck, script typecheck, and relevant full test gates with failure notes if any (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)
* [x] T022 \[S2101] Validate ASCII encoding and Unix LF line endings for session artifacts and changed files (`.spec_system/specs/phase21-session01-pricing-daily-activity-accuracy/implementation-notes.md`)

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] `implementation-notes.md` updated
* [x] `security-compliance.md` updated
* [x] Ready for the validate workflow step

***

## Next Steps

Run the validate workflow step to verify session completeness.


---

# 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/sessions/phase21-session01-pricing-daily-activity-accuracy/tasks.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.
