feat(content): comprehensive extraction hardening, code mode UI, overnight plan

- Relax isBookLikeResponse threshold (>=2 to >=1)
- Widen book patterns: inline prose, verb-preceded, numbered bold, em-dash
- Remove overly aggressive film/song gating on book extraction
- Allow songs to coexist with film/book tags (explicit tags always returned)
- Strengthen TV patterns: seasons, created by, standalone "tv" query match
- Fix TV_EXT_RE to handle both Title|Year|Creator and Title|Creator|Year
- Widen place patterns: type word search in descriptions, bold fallback
- Add "pizza" to isPlaceQuery and preferredFirstTab
- Add Code tab: isCodeQuery, isCodeLikeResponse, extractCodeBlocks, wiring
- Fix image threshold: single image with meaningful alt text shown
- Refactor filterTabsByContext: specialized paths now append remaining content
- Add code mode UI: orange input styling, design system selection, file selection
- DesignSystemGrid: selection toggle only on checkmark, card click opens detail
- Add 64-test extraction quality test suite
- Update overnight plan.md and prompt.md for hardening run

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-04 10:54:03 +00:00
co-authored by Claude Opus 4.6
parent 75e9274582
commit f0eb4383bd
13 changed files with 1049 additions and 260 deletions
+26 -14
View File
@@ -1,9 +1,19 @@
You are executing the AIUI product roadmap autonomously. Read these files first:
You are hardening the AIUI content extraction pipeline and completing incomplete features. Read these files first:
1. `loop/plan.md` — Your task checklist (mark items `- [x]` as you complete them)
2. `PLAN2.md`Detailed specs for each task (M8.1, M8.2, etc.)
3. `CLAUDE.md` — Project conventions, design system rules, and coding standards
4. `PROGRESS.md` — Update the session log after each task
2. `CLAUDE.md`Project conventions, design system rules, and coding standards
## Key Context
The content extraction pipeline lives in:
- `packages/app/src/composables/contentExtraction.ts` — Extracts books, films, TV, songs, podcasts, places, images, code blocks, apps from AI response text
- `packages/app/src/composables/contentFiltering.ts` — Query/response classifiers (isBookQuery, isTVQuery, etc.) and tab routing (filterTabsByContext)
- `packages/app/src/composables/useContentPanel.ts` — Wires extraction functions to Vue reactive state and tab system
- `packages/app/src/components/content/ContentPanel.vue` — Main content panel rendering grids and detail views
- `packages/app/src/components/content/ContentGridView.vue` — Grid view (already has ImageGrid/PlaceGrid wired)
- `packages/app/src/__tests__/extractionQuality.test.ts` — Extraction quality test suite (currently 64 tests)
Content flows: AI response text → extraction functions → useContentPanel refs → filterTabsByContext → ContentPanel/ContentGridView rendering
## Design System Rules (must follow for every file you touch)
@@ -19,22 +29,24 @@ You are executing the AIUI product roadmap autonomously. Read these files first:
## For each task in loop/plan.md:
1. Find the first unchecked `- [ ]` item
2. Read the detailed spec from `PLAN2.md` for that task code (e.g. M8.1)
3. Implement the feature following the spec and design system rules above
4. Run `pnpm typecheck && pnpm lint` — fix all errors before committing
5. Run `pnpm test` — fix any failing tests
6. If the task has a **Testing Gate** (`pnpm test:e2e` or specific test file), run it and fix failures
7. Commit: `type(scope): description` (conventional commits)
8. Mark it done `- [x]` in `loop/plan.md`
9. Update `PROGRESS.md` session log
2. Read the task description carefully
3. Read the relevant source files before making changes
4. Implement the feature/fix following conventions and design system rules
5. Run `pnpm typecheck && pnpm lint` — fix all errors before committing
6. Run `pnpm test` — fix any failing tests
7. If the task involves tests, run `cd packages/app && npx vitest run src/__tests__/extractionQuality.test.ts` specifically
8. Commit: `type(scope): description` (conventional commits)
9. Mark it done `- [x]` in `loop/plan.md`
10. Move to the next unchecked task immediately
## Rules
- Never skip a testing gate — if tests fail, fix them before moving on
- If a task is proving difficult, keep trying different approaches. Make at least 30 genuine attempts before giving up and moving on. If you do move on, note the attempt count in the Notes section and leave the task unchecked.
- If a task is proving difficult, keep trying different approaches. Make at least 30 genuine attempts before giving up and moving on.
- Always run typecheck + lint after every code change
- Keep initial bundle < 250 KB gzipped — lazy-load anything heavy (PDF viewer, Mermaid, KaTeX, etc.)
- Keep initial bundle < 250 KB gzipped — lazy-load anything heavy
- Bitcoin only — never altcoins, never fiat payment flows
- Privacy first — no external analytics calls, no telemetry
- Do not stop until all tasks are checked or you are rate limited
- When adding tests, aim for realistic AI response patterns, not trivial examples
- When wiring components into ContentPanel.vue, follow the exact same pattern used for existing content types (BookGrid/BookDetail, TVSeriesGrid/TVSeriesDetail, etc.)