> 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/phase40-session09-model-intelligence-and-pricing/tasks.md).

# Task Checklist

**Session ID**: `phase40-session09-model-intelligence-and-pricing` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-07-03

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Setup (3 tasks)

* [x] T001 \[S4009] Verify Session 08 artifacts, Session 09 scope, worktree cleanliness, and Hermes owner files (`.spec_system/specs/phase40-session08-catalog-and-context-metadata/validation.md`)
* [x] T002 \[S4009] Capture focused baseline tests for Hermes bridge, parser, hook, and sections (`bunx vitest run scripts/lib/__tests__/hermes-dev-bridge.test.ts src/lib/__tests__/hermes-types.test.ts src/hooks/__tests__/use-hermes.test.tsx src/components/hermes/__tests__/hermes-sections.test.tsx`)
* [x] T003 \[S4009] Confirm no repo-level model-intelligence data file exists and record the Hermes-scoped contract boundary (`src/data/model-intel.json`)

***

## Foundation (5 tasks)

* [x] T004 \[S4009] Create Hermes-scoped Ministry model rows with required default lineup metrics and no live benchmark claims (`scripts/lib/hermes-model-intelligence.ts`)
* [x] T005 \[S4009] Add bundled pricing snapshot and OpenRouter model-pricing parser with bounded values and malformed-field fallback (`scripts/lib/hermes-model-intelligence.ts`)
* [x] T006 \[S4009] Implement local-live pricing overlay with timeout, retry/backoff, 30-minute stale cache, and bundled fallback provenance for external pricing calls (`scripts/lib/hermes-model-intelligence.ts`)
* [x] T007 \[S4009] Extend browser contract types and parser for model intelligence rows, pricing provenance, and missing-metric fallback semantics (`src/lib/hermes-types.ts`)
* [x] T008 \[S4009] Create browser ranking helpers for benchmark, cost, and speed with deterministic ordering and missing-metric fallback behavior (`src/lib/hermes-model-intelligence.ts`)

***

## Implementation (7 tasks)

* [x] T009 \[S4009] Register `/__hermes_model_intelligence` as a public local Hermes read with schema-safe response assembly and explicit error mapping (`scripts/lib/hermes-dev-bridge.ts`)
* [x] T010 \[S4009] Assemble the model intelligence bridge body from bundled rows, configured/catalog aliases, and optional live pricing overlay without exposing credentials or local paths (`scripts/lib/hermes-dev-bridge.ts`)
* [x] T011 \[S4009] Add bundled-snapshot demo model intelligence fixture with live pricing disabled and product-safe provenance labels (`src/lib/hermes-demo-data.ts`)
* [x] T012 \[S4009] Expose model intelligence from `useHermes` with explicit loading, empty, error, offline, and demo-safe query states (`src/hooks/use-hermes.ts`)
* [x] T013 \[S4009] Thread the new model intelligence view through Hermes read-only data plumbing only where needed by existing demo/live boundaries (`src/components/hermes/hermes-read-only-page.tsx`)
* [x] T014 \[S4009] Update Hermes section mocks and fixture expectations for the expanded hook result without adding debug-only UI copy (`src/components/hermes/__tests__/hermes-sections.test.tsx`)
* [x] T015 \[S4009] Preserve public-demo static behavior by ensuring demo mode uses bundled fixtures and never calls the live model intelligence endpoint (`src/components/hermes/hermes-read-only-page.tsx`)

***

## Testing (5 tasks)

* [x] T016 \[S4009] \[P] Add script-side unit tests for default lineup coverage, OpenRouter parser success, live failure fallback, cache stale time, and sanitized output (`scripts/lib/__tests__/hermes-model-intelligence.test.ts`)
* [x] T017 \[S4009] \[P] Add browser parser and ranking tests for valid payloads, invalid payloads, stable sorting, and missing-metric fallback behavior (`src/lib/__tests__/hermes-model-intelligence.test.ts`)
* [x] T018 \[S4009] \[P] Extend Hermes bridge, parser, and hook tests for endpoint registration, no-token reads, live pricing labels, bundled fallback labels, demo-disabled live pricing, and query states (`scripts/lib/__tests__/hermes-dev-bridge.test.ts`)
* [x] T019 \[S4009] Run focused automated checks for all touched Hermes model-intelligence owners (`bunx vitest run scripts/lib/__tests__/hermes-model-intelligence.test.ts scripts/lib/__tests__/hermes-dev-bridge.test.ts src/lib/__tests__/hermes-model-intelligence.test.ts src/lib/__tests__/hermes-types.test.ts src/hooks/__tests__/use-hermes.test.tsx src/components/hermes/__tests__/hermes-sections.test.tsx`)
* [x] T020 \[S4009] Run type, lint, and encoding gates and update implementation notes with validation evidence (`bun run typecheck && bun run typecheck:scripts && bun run lint`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` (next step in the implement -> creview -> validate sequence)

***

## Next Steps

Run the `implement` workflow step.


---

# 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/phase40-session09-model-intelligence-and-pricing/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.
