> 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-session02-project-windows-skill-roi-defaults/tasks.md).

# Task Checklist

**Session ID**: `phase21-session02-project-windows-skill-roi-defaults` **Total Tasks**: 20 **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 | 8      | 8      | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **20** | **20** | **0**     |

***

## Setup (3 tasks)

Initial context capture and implementation scaffolding.

* [x] T001 \[S2102] Verify Session 01 completion, current project row shape, and v2.3 source anchors before editing (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/implementation-notes.md`)
* [x] T002 \[S2102] Review existing aggregate, validation, workspace transform, and saved-time tests and record baseline gaps (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/implementation-notes.md`)
* [x] T003 \[S2102] Record generated project metadata privacy and ROI-default security posture for this session (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/security-compliance.md`)

***

## Foundation (5 tasks)

Lock expected behavior in focused tests before wiring production code.

* [x] T004 \[S2102] \[P] Add aggregate project helper tests for seven-day `recentProjects`, bounded `allProjects`, deterministic ordering, invalid timestamps, and sanitized row fields with bounded output handling (`scripts/lib/__tests__/aggregate-orchestration.test.ts`)
* [x] T005 \[S2102] \[P] Add live-data validation tests for `allProjects`, legacy payloads without `allProjects`, malformed project arrays, and invalid project timestamp fields with schema-validated input and explicit error mapping (`src/lib/__tests__/nested-validation.test.ts`)
* [x] T006 \[S2102] \[P] Add workspace/history transform tests that prefer `allProjects` and fall back to `recentProjects` for legacy data with explicit empty and malformed states (`src/lib/__tests__/route-transforms.test.ts`)
* [x] T007 \[S2102] \[P] Add saved-time default tests for known v2.3 prefixes, case variants, unknown skill fallback, empty names, and explicit zero override behavior (`src/lib/__tests__/time-saved.test.ts`)
* [x] T008 \[S2102] \[P] Add ROI total tests proving default minutes produce non-zero saved value while caller-provided overrides remain authoritative (`src/lib/__tests__/time-saved.test.ts`)

***

## Implementation (8 tasks)

Implement project window semantics and saved-time defaults.

* [x] T009 \[S2102] Extract aggregate project row builders with run-clock injection, sanitized fields, stable sorting, and bounded pagination (`scripts/lib/aggregate-orchestration.ts`)
* [x] T010 \[S2102] Emit `recentProjects` as the seven-day project window and `allProjects` as bounded long-tail history with deterministic ordering (`scripts/lib/aggregate-orchestration.ts`)
* [x] T011 \[S2102] Extend the live-data project contract with `allProjects`, `lastActiveMs`, `messages`, and compatible optional fields matching declared contract; exhaustive enum handling (`src/lib/live-data-types.ts`)
* [x] T012 \[S2102] Validate and default `allProjects` while preserving legacy payload compatibility and dropping malformed rows with schema-validated input and explicit error mapping (`src/lib/validate-live-data.ts`)
* [x] T013 \[S2102] Update the committed live-data example with sanitized `recentProjects` and `allProjects` rows without committing generated private data (`src/data/live-data.example.json`)
* [x] T014 \[S2102] Update workspace and settings route transforms to use `allProjects` for all-history views and legacy `recentProjects` fallback with explicit empty and malformed states (`src/lib/route-transforms.ts`)
* [x] T015 \[S2102] Keep the standalone workspace transform compatible with the shared project row shape and bounded numeric defaults (`src/lib/transforms/workspaces.ts`)
* [x] T016 \[S2102] Port `SKILL_MINUTE_DEFAULTS` and generic five-minute fallback into `getDefaultMinutes` while preserving user and file override precedence (`src/lib/time-saved.ts`)

***

## Testing (4 tasks)

Verification and final sign-off evidence.

* [x] T017 \[S2102] Run focused aggregate project tests and record exact commands and results (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/implementation-notes.md`)
* [x] T018 \[S2102] Run focused validation, route-transform, workspace-transform, and saved-time tests and record exact commands and results (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/implementation-notes.md`)
* [x] T019 \[S2102] Run app typecheck, script typecheck, and relevant full test gates with failure notes if any (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/implementation-notes.md`)
* [x] T020 \[S2102] Validate ASCII encoding and Unix LF line endings for session artifacts and planned changed files (`.spec_system/specs/phase21-session02-project-windows-skill-roi-defaults/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 implement workflow step to begin AI-led implementation.


---

# 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-session02-project-windows-skill-roi-defaults/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.
