> 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/phase29-session14-one-to-watch-surface/implementation-notes.md).

# Implementation Notes

**Session ID**: `phase29-session14-one-to-watch-surface` **Started**: 2026-06-21 03:54 **Last Updated**: 2026-06-21 04:36

***

## Session Progress

| Metric              | Value   |
| ------------------- | ------- |
| Tasks Completed     | 20 / 20 |
| Estimated Remaining | 0 hours |
| Blockers            | 0       |

***

### Task T020 - Run final validation

**Started**: 2026-06-21 04:34 **Completed**: 2026-06-21 04:36 **Duration**: 2 minutes

**Notes**:

* Ran focused Vitest suites successfully: `bun run test -- src/extensions/trend-finder/__tests__/view-model.test.ts src/extensions/trend-finder/views/__tests__/brief-view.test.tsx src/extensions/trend-finder/__tests__/brief-export-model.test.ts scripts/extensions/trend-finder/__tests__/static-brief-export.test.ts scripts/extensions/trend-finder/__tests__/static-brief-renderer.test.ts` (5 files, 99 tests).
* Ran app and scripts typechecks successfully: `bun run typecheck` and `bun run typecheck:scripts`.
* Ran Trends/static Brief Playwright checks successfully: `bun run test:e2e -- tests/e2e/trend-finder.spec.ts tests/e2e/trend-finder-static-brief.spec.ts` (7 tests).
* Ran `bun run build` successfully before payload checks.
* Ran Trend Finder payload-size validation successfully: `bun run scripts/extensions/trend-finder/measure-payload-size.ts src/data/live-data.json --threshold-kb=1024 --json`; Trend Finder browser data payload is 457150 bytes under the 1048576-byte boundary.
* Ran `bun run runtime:check-private`, `git diff --check`, and ASCII validation successfully.
* Also reran `bun run budget:check`; the full bundle check still reports the known pre-existing total client JS gzip overage (1221 KB / 1200 KB), matching the Session 13 note that this is outside the Trend Finder payload gate.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added older-payload fallbacks for missing reception/corroboration during support scoring.
* `src/extensions/trend-finder/views/trends-view.tsx` - Kept the compact One-to-Watch strip tablet/desktop-only to preserve the existing mobile first-viewport contract.
* `tests/e2e/trend-finder.spec.ts` - Added One-to-Watch browser assertions and restored the explicit endorsed reception fixture field.
* `tests/e2e/trend-finder-static-brief.spec.ts` - Added static Brief One-to-Watch browser assertions.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T020 complete and updated completion checklist.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged final validation results.

**BQC Fixes**:

* Contract alignment: typechecks caught and fixed missing derived-field fallback handling for older topic payloads.
* Accessibility and platform compliance: Playwright confirms One-to-Watch output is browser-visible without mobile horizontal overflow or first-viewport regression.
* Trust boundary enforcement: payload-size and private-artifact checks passed against the generated Trend Finder data boundary.

***

### Task T019 - Add static Brief export and renderer tests

**Started**: 2026-06-21 04:33 **Completed**: 2026-06-21 04:34 **Duration**: 1 minute

**Notes**:

* Added static export assertions for bounded One-to-Watch rows, unknown calibration honesty, strong support labels, and privacy scanning.
* Added renderer coverage for One-to-Watch escaping, empty state copy, unknown calibration copy, unsafe-link absence, and no media/embed output.
* Ran `bun run test -- scripts/extensions/trend-finder/__tests__/static-brief-export.test.ts scripts/extensions/trend-finder/__tests__/static-brief-renderer.test.ts` successfully.

**Files Changed**:

* `scripts/extensions/trend-finder/__tests__/static-brief-export.test.ts` - Added One-to-Watch static export assertions.
* `scripts/extensions/trend-finder/__tests__/static-brief-renderer.test.ts` - Added One-to-Watch renderer assertions for escaping and empty states.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T019 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged static export/renderer tests.

**BQC Fixes**:

* Trust boundary enforcement: tests verify projected One-to-Watch output passes privacy scanning and escapes unsafe strings before rendering.
* Error information boundaries: tests verify unsafe links and media/embed tags are not introduced by the static One-to-Watch section.

***

### Task T018 - Add Brief and export tests

**Started**: 2026-06-21 04:30 **Completed**: 2026-06-21 04:33 **Duration**: 3 minutes

**Notes**:

* Added Brief component tests for rendered One-to-Watch rows, empty archive copy, unavailable calibration labels, and no row accuracy percentages.
* Added export-model tests for Markdown/JSON One-to-Watch rows, duplicate section heading safety, sparse empty copy, and private-string redaction inside watch-next copy.
* Ran `bun run test -- src/extensions/trend-finder/views/__tests__/brief-view.test.tsx src/extensions/trend-finder/__tests__/brief-export-model.test.ts` successfully.

**Files Changed**:

* `src/extensions/trend-finder/views/__tests__/brief-view.test.tsx` - Added One-to-Watch Brief rendering coverage.
* `src/extensions/trend-finder/__tests__/brief-export-model.test.ts` - Added One-to-Watch export coverage.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T018 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged Brief/export tests.

**BQC Fixes**:

* Duplicate action prevention: existing clipboard duplicate-write test remains green with the new export shape.
* Trust boundary enforcement: tests verify private-looking One-to-Watch copy is redacted before export.

***

### Task T017 - Add One-to-Watch view-model tests

**Started**: 2026-06-21 04:27 **Completed**: 2026-06-21 04:30 **Duration**: 3 minutes

**Notes**:

* Added tests for row ranking, support labels, due-state filtering, stable tie-breaks, unavailable calibration, no row-level accuracy percentages, and empty archive state.
* Ran `bun test ./src/extensions/trend-finder/__tests__/view-model.test.ts` successfully.

**Files Changed**:

* `src/extensions/trend-finder/__tests__/view-model.test.ts` - Added One-to-Watch view-model coverage.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T017 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged view-model test work.

**BQC Fixes**:

* Contract alignment: tests assert row output does not contain hit-rate or accuracy percentage copy.

***

### Task T016 - Document One-to-Watch behavior

**Started**: 2026-06-21 04:24 **Completed**: 2026-06-21 04:27 **Duration**: 3 minutes

**Notes**:

* Documented the Trends strip, Brief section, source of truth, deterministic ranking inputs, calibration honesty, static Brief projection, and privacy boundary.
* Kept docs framed as shipped behavior, not future capability.

**Files Changed**:

* `docs/extensions/trend-finder-ui-surfaces.md` - Added live UI and calibration behavior.
* `docs/extensions/trend-finder-history.md` - Added One-to-Watch source-of-truth and calibration-honesty section.
* `docs/extensions/trend-finder-pipeline.md` - Added projection/privacy notes for static/export pipeline.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T016 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged documentation work.

**BQC Fixes**:

* Contract alignment: docs distinguish One-to-Watch presentation from prediction generation and do not describe unimplemented collectors or models.

***

### Task T015 - Render One-to-Watch static Brief section

**Started**: 2026-06-21 04:21 **Completed**: 2026-06-21 04:24 **Duration**: 3 minutes

**Notes**:

* Added a static Brief One-to-Watch section after Today's Pick.
* Rendered escaped row text, support details, calibration honesty details, caveats, and evidence IDs without links, media, or embeds.
* Added explicit empty-state and calibration-context output.

**Files Changed**:

* `scripts/extensions/trend-finder/static-brief-renderer.ts` - Added static One-to-Watch renderer and report section.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T015 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged static rendering work.

**BQC Fixes**:

* Error information boundaries: static HTML renders escaped bounded fields only and does not add external links or media surfaces.

***

### Task T014 - Project One-to-Watch into static Brief data

**Started**: 2026-06-21 04:19 **Completed**: 2026-06-21 04:21 **Duration**: 2 minutes

**Notes**:

* Added static Brief One-to-Watch projection from the shared view-model.
* Bounded all row, support-chip, accuracy, caveat, and evidence-ID fields through the static exporter.
* Omitted live-app topic links from the standalone static report projection.

**Files Changed**:

* `scripts/extensions/trend-finder/static-brief-export.ts` - Added One-to-Watch report projection and report wiring.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T014 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged static projection work.

**BQC Fixes**:

* Trust boundary enforcement: static rows are bounded and privacy-checked with the rest of the report before output.

***

### Task T013 - Wire One-to-Watch into Brief exports

**Started**: 2026-06-21 04:05 **Completed**: 2026-06-21 04:19 **Duration**: 14 minutes

**Notes**:

* Added One-to-Watch rows to the safe Brief export document.
* Added a Markdown One to Watch section and included the same rows in JSON output.
* Rows are bounded, redacted through the existing private-string cleaner, and ordered by the shared deterministic view-model.

**Files Changed**:

* `src/extensions/trend-finder/brief-export-model.ts` - Added One-to-Watch export projection and Markdown/JSON output.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T013 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged Brief export wiring.

**BQC Fixes**:

* Trust boundary enforcement: export text is cleaned and bounded before it reaches copyable Markdown or JSON.

***

### Task T012 - Render full Brief One-to-Watch section

**Started**: 2026-06-21 04:15 **Completed**: 2026-06-21 04:18 **Duration**: 3 minutes

**Notes**:

* Added a full Brief section with One-to-Watch rows, topic links, direction/due/provenance chips, support details, calibration honesty details, caveats, evidence IDs, and empty state copy.
* Added a watch-row metric to the Brief summary block.
* Long topic names, rationale, watch-next copy, and evidence IDs use wrapping instead of truncating out of their containers.

**Files Changed**:

* `src/extensions/trend-finder/views/brief-view.tsx` - Added full One-to-Watch Brief section and summary metric.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T012 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged Brief rendering work.

**BQC Fixes**:

* Accessibility and platform compliance: row articles carry accessible labels and links remain keyboard reachable.
* Failure path completeness: empty and unavailable One-to-Watch states render explicit copy.

***

### Task T011 - Render compact Trends One-to-Watch strip

**Started**: 2026-06-21 04:12 **Completed**: 2026-06-21 04:15 **Duration**: 3 minutes

**Notes**:

* Added a compact One-to-Watch strip inside the Trends dashboard first-viewport block.
* Rows show rank, direction, calibration honesty, support label, due state, watch-next copy, and topic links when the current topic exists.
* The strip uses the existing visibility panel system and keyboard-reachable anchors.

**Files Changed**:

* `src/extensions/trend-finder/views/trends-view.tsx` - Added compact One-to-Watch strip and dashboard wiring.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T011 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged Trends rendering work.

**BQC Fixes**:

* Accessibility and platform compliance: row articles have accessible labels and topic links remain keyboard focusable.

***

### Task T010 - Implement calibration honesty labels

**Started**: 2026-06-21 04:11 **Completed**: 2026-06-21 04:12 **Duration**: 1 minute

**Notes**:

* Added row states for unavailable, unresolved, stale pending, unknown, and aggregate-calibrated outcomes.
* Added summary-level aggregate calibration context while keeping row-level labels free of hit-rate or accuracy percentages.
* Preserved explicit uncalibrated copy when no resolved retros exist.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added One-to-Watch calibration honesty helpers and labels.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T010 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged calibration label work.

**BQC Fixes**:

* Error information boundaries: row labels expose only intentional aggregate/unknown calibration states, not fabricated or inferred per-row accuracy.

***

### Task T009 - Implement One-to-Watch topic support labels

**Started**: 2026-06-21 04:10 **Completed**: 2026-06-21 04:11 **Duration**: 1 minute

**Notes**:

* Joined watch rows to current topics by ID, canonical topic ID, and aliases.
* Added support levels, support details, and support chips for current rank, score, evidence, reception, corroboration, and caveats.
* Added explicit unavailable support state when a prediction no longer maps to a current topic.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added One-to-Watch topic join and support-label logic.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T009 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged support-label work.

**BQC Fixes**:

* Failure path completeness: unmatched current-topic context stays visible with an explicit support-unavailable row instead of disappearing silently.

***

### Task T008 - Implement One-to-Watch row projection

**Started**: 2026-06-21 04:09 **Completed**: 2026-06-21 04:10 **Duration**: 1 minute

**Notes**:

* Added `getOneToWatchSummaryViewModel` to project rows from `predictionRetroSummary.storyLog` and `recentPredictions`.
* Dedupes Story Log and recent prediction candidates by prediction ID and keeps deterministic stable fallback ordering.
* Verified compile-through with `bun test ./src/extensions/trend-finder/__tests__/view-model.test.ts`.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added One-to-Watch projection API.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T008 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged projection work.

**BQC Fixes**:

* Contract alignment: projection rows match the declared bounded view-model contract.

***

### Task T007 - Add One-to-Watch visibility entries

**Started**: 2026-06-21 04:08 **Completed**: 2026-06-21 04:09 **Duration**: 1 minute

**Notes**:

* Added stable panel IDs for the Brief One-to-Watch section and Trends compact strip.
* Reused the existing visibility provider and Trends run re-entry reset behavior instead of adding separate state.

**Files Changed**:

* `src/extensions/trend-finder/views/brief-view.tsx` - Added Brief visibility menu item.
* `src/extensions/trend-finder/views/trends-view.tsx` - Added Trends visibility menu item.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T007 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged visibility setup.

**BQC Fixes**:

* State freshness on re-entry: new panels use the existing visibility model and do not add stale local panel state.

***

### Task T006 - Extend Brief copy/export contract

**Started**: 2026-06-21 04:05 **Completed**: 2026-06-21 04:08 **Duration**: 3 minutes

**Notes**:

* Added One-to-Watch export row and support-chip types.
* Added a One-to-Watch branch to `BriefExportDocument`.
* Wired Markdown and JSON output to the shared One-to-Watch view-model through the existing private-string cleaner and bounded limits.

**Files Changed**:

* `src/extensions/trend-finder/brief-export-model.ts` - Added One-to-Watch export types, projection, and Markdown section.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T006 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged Brief export contract work.

**BQC Fixes**:

* Trust boundary enforcement: copy/export rows pass through the existing private-string redaction before leaving the browser projection.
* Contract alignment: Markdown and JSON now use the same bounded projection shape.

***

### Task T005 - Extend static Brief One-to-Watch schema

**Started**: 2026-06-21 04:03 **Completed**: 2026-06-21 04:05 **Duration**: 2 minutes

**Notes**:

* Added static Brief row, support chip, and summary schema definitions with strict parsing and bounded limits.
* Added defaults so older static Brief report payloads can parse without a One-to-Watch branch.
* Kept topic links as bounded strings and evidence IDs bounded to avoid unsafe link or payload growth.

**Files Changed**:

* `scripts/extensions/trend-finder/static-brief-export.ts` - Added One-to-Watch static schema, defaults, and limits.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T005 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged static schema work.

**BQC Fixes**:

* Contract alignment: strict schema defaults prevent older report payloads from failing and keep new rows bounded.

***

### Task T004 - Define One-to-Watch ranking inputs

**Started**: 2026-06-21 03:58 **Completed**: 2026-06-21 04:03 **Duration**: 5 minutes

**Notes**:

* Added candidate collection from Story Log and recent predictions with prediction-ID deduplication.
* Added current topic lookup by topic ID, canonical topic ID, and aliases.
* Added deterministic ranking inputs for due state, direction, watch-next copy, rationale, current score, evidence count, source count, reception, corroboration, visibility, stale pending, generated date, topic name, and stable IDs.
* Added bounded row limits plus due-state filter normalization and filtering helpers.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added internal One-to-Watch candidate and ranking helpers.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T004 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged ranking implementation.

**BQC Fixes**:

* Contract alignment: rank tie-breaks end with stable IDs to keep ordering deterministic across callers.

***

### Task T003 - Define One-to-Watch view-model contracts

**Started**: 2026-06-21 03:57 **Completed**: 2026-06-21 03:58 **Duration**: 1 minute

**Notes**:

* Added bounded summary, row, support chip, due-state filter, support level, source kind, and accuracy state types.
* Kept the contract label-based and aggregate-context based; no row exposes an accuracy percentage or mock hit-rate field.

**Files Changed**:

* `src/extensions/trend-finder/view-model.ts` - Added One-to-Watch view-model type definitions.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T003 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged type contract work.

**BQC Fixes**:

* Contract alignment: explicit row accuracy states prevent UI/export callers from inventing per-row accuracy chips.

***

### Task T002 - Inspect current Trend Finder prediction and surface paths

**Started**: 2026-06-21 03:55 **Completed**: 2026-06-21 03:57 **Duration**: 2 minutes

**Notes**:

* Reviewed relevant ADRs, schema shapes, fixtures, prediction/retro view-models, Brief/Trends visibility panels, copy export projection, static Brief schema/projection/renderer, and focused tests.
* Confirmed existing fixtures include prediction, retro, calibration, Story Log, not-yet-due, and stale pending rows suitable for One-to-Watch coverage.
* Confirmed the feature can be additive and dependency-free with strict bounded projections and existing privacy checks.

**Files Changed**:

* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T002 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged inspection findings.

**BQC Fixes**:

* N/A - inspection only.

***

### Task T001 - Verify analyzer state and session scope

**Started**: 2026-06-21 03:54 **Completed**: 2026-06-21 03:55 **Duration**: 1 minute

**Notes**:

* Ran the local-first analyzer and prerequisite checks.
* Confirmed active session `phase29-session14-one-to-watch-surface`, Phase 29 in progress, and prerequisite Sessions 03, 04, and 13 recorded complete.
* Read the Session 14 PRD stub and confirmed scope is One-to-Watch presentation over existing prediction, retro, and calibration data with no mock accuracy chips.

**Files Changed**:

* `.spec_system/specs/phase29-session14-one-to-watch-surface/tasks.md` - Marked T001 complete and updated progress.
* `.spec_system/specs/phase29-session14-one-to-watch-surface/implementation-notes.md` - Logged setup verification.

**BQC Fixes**:

* N/A - setup verification only.

***

## Task Log

### 2026-06-21 - Session Start

**Environment verified**:

* [x] Prerequisites confirmed
* [x] Tools available
* [x] Directory structure ready

***


---

# 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/phase29-session14-one-to-watch-surface/implementation-notes.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.
