# Factory cache-first run explorer

status: ACTIVE
task IDs: #6, #7, #8
source request: Owner reports `/factory` takes about one minute and appears broken. Recover lost Factory redesign before implementation; design cache-first rendering followed by lazy fresh data, bounded efficient queries, a factory-runs table linking each run name to `/factory/<slug>`, and a one-run detail page restoring the lost Astryx-style observability, chat-like event interface, and specialized diff viewer. Ask genuine clarifying questions before launching `/claudex-workflow`; use a new dynamic workflow with isolated workers and explicit worktree/dark-delivery instructions.

## Acceptance criteria

- Locate and preserve exact prior design/WIP artifacts, including commit/ref/path receipts.
- `/factory` presents cached content immediately and refreshes real data lazily without blocking initial interaction.
- Backend queries are measured, bounded, indexed/paginated as appropriate, and do not load full run histories for the list view.
- Runs table uses the approved shared `DataTable` primitive and links factory name to `/factory/<slug>`.
- Detail route loads exactly one run and exposes complete honest observability through recovered visual language, chat-like timeline, and specialized diff viewer.
- Existing behavior remains available while incomplete work is OFF according to controller-owned dark delivery.
- Authored design and implementation plan are reviewed before a dynamic `/claudex-workflow` launch.
- Work is isolated, tested, landed, deployed, and verified owner-visible.

## Preserved WIP

- Shared main checkout remains untouched.
- Dedicated worktree: `/home/user/Projects/overdeck/.worktrees/factory-recovery-brainstorm`; branch `wt/factory-recovery-brainstorm`.
- Candidate recovered snapshot: `1b8fcb29e` (`wt/obsdesign` WIP triage), especially `docs/specs/2026-08-08-overdeck-observability-design.md` and canonical companion `docs/specs/2026-08-08-observability-design.md`.
- No candidate WIP will be copied across bases; required deltas must be recovered through Git history.

## Constraints

- Read and obey root plus UI/factory nested instructions before changing those areas.
- Never mutate shared main checkout or disturb unrelated WIP.
- Reuse platform `DataTable` and deck-ui registry; no new primitive without explicit owner approval.
- Measure current latency/query volume before choosing cache and query architecture.
- No fabricated data, unbounded list payload, stale-cache ambiguity, or direct runtime feature activation.
- Brainstorm first; ask one genuine product question at a time; launch workflow only after design and plan are durable.

## Execution steps

1. Search current tree, all preserved refs/snapshots, and relevant history for lost Factory visual design and component WIP.
2. Inspect current `/factory` route, data contracts, collector queries, cache facilities, and performance evidence.
3. Ask owner only unresolved preference/product questions.
4. Compare viable cache/query/detail-route architectures and select robust reversible design.
5. Write and review `docs/specs/2026-08-11-factory-cache-first-run-explorer-design.md`.
6. Produce matching implementation plan and dynamic workflow instructions with isolated worktrees and OFF-by-default delivery.
7. Launch `/claudex-workflow`; review, test, land, deploy, and prove installed behavior.

## Current receipt

2026-08-11: Exact source recovered. Conversation `c0c245b9-d222-46a3-b6e9-d16f2626c5f9` contains owner-provided UI discussion and Astryx clone inventory. Canonical design survives at `wt/factory-ui:docs/specs/2026-08-09-factory-run-view-design.md`; it explicitly selects page-scoped `@astryxdesign/core`/`lab`, chat-style `ChatReasoning`, drawer details, terminal logs, and a unique deck-ui `DiffView`; owner deferred any deck-wide Astryx migration. Implementation exists only on `wt/factory-ui`, principally commit `6c6e42370` plus fixes/canary commits through `c26824d1b`. Branch is 10 commits ahead and 181 behind `origin/main`; tip is not an ancestor of main. None of `FactoryRunApp`, `FactoryRunContent`, `FactoryStepDrawer`, `FactoryRawTrace`, `DiffView`, or `/factory/[adwId]` exists on `origin/main`. Therefore this is preserved WIP, not shipped or complete. Recovery registry committed as `2ee8ad6aa`.

Dynamic workflow `wf_3449f89c-0ca` was killed and MUST NOT resume. Owner replaced it with `/gpt-orchestrator`. One ask-gpt Pro producer is `DISPATCHING` as background process `bk19snyhq`, using installed `ask-gpt --effort pro`, full current-default-branch archive, full exact task-worktree archive, and bounded authoritative package SHA-256 `c70345f2c733acdab6d5973049d8acd77aafd0e70f87e815317a389e1ed3a74f`. Durable dispatch/artifact/integration state: `docs/plans/2026-08-11-factory-cache-first-run-explorer-ledger.md`.

## Next executable action

On tracked completion notification, reconcile conversation identity, download real attachments, validate archive/script as hostile input, apply surgically, run clean gates and independent review, correct locally or through same conversation, then guarded land/deploy and prove owner-visible behavior.
