> 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/phase34-session06-persistence-schema-contracts/tasks.md).

# Task Checklist

**Session ID**: `phase34-session06-persistence-schema-contracts` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-26

***

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

***

## Progress Summary

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

***

## Setup (3 tasks)

* [x] T001 \[S3406] Verify Phase 34 Session 06 scope, AR-D5-001 and AR-D5-002 evidence, completed prerequisite sessions, and current save-schema baseline tests (`.spec_system/PRD/phase_34/session_06_persistence_schema_contracts.md`)
* [x] T002 \[S3406] Inspect durable claim, wallet, ledger, save-slot, runtime bridge, and focused test paths before editing (`src/extensions/ai-rogue/persistence.ts`)
* [x] T003 \[S3406] Create implementation notes scaffold for claim normalization, durable snapshot naming, hydration decisions, and gate evidence (`.spec_system/specs/phase34-session06-persistence-schema-contracts/implementation-notes.md`)

***

## Foundation (6 tasks)

* [x] T004 \[S3406] Add or expose schema-owned claim normalization through `aiRogueClaimEntrySchema` with schema-validated input and explicit error mapping (`src/extensions/ai-rogue/economy-schema.ts`)
* [x] T005 \[S3406] Replace custom direct claim validation with schema-owned parsing before IndexedDB transactions with idempotency protection, transaction boundaries, and failure-path handling (`src/extensions/ai-rogue/persistence.ts`)
* [x] T006 \[S3406] \[P] Update direct oversized claim regression expectations so wallet balance, ledger amount, and `balanceAfter` cannot disagree (`src/extensions/ai-rogue/__tests__/persistence.test.ts`)
* [x] T007 \[S3406] Add duplicate redemption and legacy localStorage migration coverage after schema-owned parsing with deterministic ordering (`src/extensions/ai-rogue/__tests__/persistence.test.ts`)
* [x] T008 \[S3406] Rename durable save-slot runtime snapshot schema and type exports while retaining narrow compatibility aliases for existing callers (`src/extensions/ai-rogue/save-schema.ts`)
* [x] T009 \[S3406] Add schema-owned durable-to-runtime save payload hydration helper with explicit empty, malformed, and metadata fallback handling (`src/extensions/ai-rogue/save-schema.ts`)

***

## Implementation (7 tasks)

* [x] T010 \[S3406] Preserve durable claim-store writes and legacy guard rollback behavior while routing all durable claims through normalized claim entries with compensation on failure (`src/extensions/ai-rogue/claim-store.ts`)
* [x] T011 \[S3406] Replace Runtime Canvas local durable snapshot cast helper with the schema-owned hydration helper while preserving loading, error, and duplicate-trigger prevention states (`src/extensions/ai-rogue/views/runtime-canvas.tsx`)
* [x] T012 \[S3406] Update save-state imports or type annotations for the durable snapshot rename without changing browser-local storage keys or IndexedDB stores (`src/extensions/ai-rogue/use-save-state.ts`)
* [x] T013 \[S3406] Update save-schema tests for durable snapshot naming, hydration helper success, empty snapshot rejection, metadata fallback, defaults, and unsafe text rejection (`src/extensions/ai-rogue/__tests__/save-schema.test.ts`)
* [x] T014 \[S3406] Update runtime-canvas tests for save-slot load success and invalid saved-run failure through schema-owned hydration with product-facing copy only (`src/extensions/ai-rogue/__tests__/runtime-canvas.test.tsx`)
* [x] T015 \[S3406] Update persistence tests for schema-owned direct claim parsing, wallet/ledger consistency, duplicate handling, and migration behavior (`src/extensions/ai-rogue/__tests__/persistence.test.ts`)
* [x] T016 \[S3406] Record AR-D5-001 and AR-D5-002 resolution evidence, compatibility aliases, and remaining persistence caveats (`.spec_system/specs/phase34-session06-persistence-schema-contracts/implementation-notes.md`)

***

## Testing (4 tasks)

* [x] T017 \[S3406] Run focused persistence, save-schema, and runtime-canvas Vitest coverage and record exact pass/fail evidence (`package.json`)
* [x] T018 \[S3406] Run focused AI Rogue Vitest suite and record exact pass/fail evidence (`package.json`)
* [x] T019 \[S3406] Run typecheck, lint, format check, dependency-diff, no-bridge, no-hosted-write, no-remote-loading, and storage-key spot checks (`src/extensions/ai-rogue`)
* [x] T020 \[S3406] Validate ASCII/LF requirements, update implementation notes, and ensure the task checklist is ready for `implement` (`.spec_system/specs/phase34-session06-persistence-schema-contracts/tasks.md`)

***

## 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` to start the creview -> validate sequence

***

## Next Steps

Run the `creview` 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/phase34-session06-persistence-schema-contracts/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.
