From c1f5259ff57660c67eb49c4e6c0d40956ec500b4 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Sat, 22 Aug 2026 19:08:20 +0800 Subject: [PATCH 01/23] docs(developer-hub): record the Phase 2 scope decision and write its implementation plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The owner decided the "Work in flight" panel is re-scoped to "Review state" and stays on the repository's own review records, so the spec's one open question is closed and the phase can be planned. The plan covers thirteen tasks: one build-time generator over four sources the repo already keeps, one staleness gate, a typed reader, four Server Component routes, and the registry flip. Three rulings narrow the spec's data contract — orphan routes, broken links and document age are all dropped, because a green gate already guarantees the first two and the third needs mechanism it cannot justify. Co-Authored-By: Claude Opus 5 --- .../plans/2026-08-22-developer-hub-phase-2.md | 3048 +++++++++++++++++ ...2026-08-22-developer-hub-phase-2-design.md | 22 +- 2 files changed, 3062 insertions(+), 8 deletions(-) create mode 100644 docs/superpowers/plans/2026-08-22-developer-hub-phase-2.md diff --git a/docs/superpowers/plans/2026-08-22-developer-hub-phase-2.md b/docs/superpowers/plans/2026-08-22-developer-hub-phase-2.md new file mode 100644 index 000000000..6d5eaacb4 --- /dev/null +++ b/docs/superpowers/plans/2026-08-22-developer-hub-phase-2.md @@ -0,0 +1,3048 @@ +# Developer hub Phase 2 (repo awareness) Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Fill the developer hub's four `phase: 2` panels — routes, documentation, test health, and review state — from one build-time snapshot of data the repository already keeps on disk. + +**Architecture:** One TypeScript generator reads four existing sources (the site-map route walker plus `src/lib/app-modes.ts`, the `docs/` tree, `tests/flake-ledger.json`, and `docs/branch-review-records/`) and writes a single committed `data/repo-awareness-snapshot.json`. One staleness gate regenerates it in memory and fails with the fix command on any content difference. One typed reader imports that JSON so the bundler inlines it, and four Server Component routes render it under the existing `DeveloperAreaGate`. Nothing reads a file at request time, and nothing calls a network. + +**Tech Stack:** Next.js 16 App Router (React 19 Server Components), TypeScript 6 strict, Vitest (`node` + `jsdom` projects), Tailwind 4 `@theme` tokens, `tsx` via `scripts/run-tsx.mjs`. + +**Spec:** `docs/superpowers/specs/2026-08-22-developer-hub-phase-2-design.md` + +**Phase 1 record** (context, not requirements): `docs/superpowers/plans/2026-08-21-developer-hub-phase-1-COMPLETION.md` + +## Global Constraints + +Every task's requirements implicitly include this section. + +- **Never read a file at request time.** The runtime Docker stage copies only `.next`, `public`, `node_modules`, four named source files, `package.json` and `next.config.ts`. `docs/` and `data/` are absent in production. Data reaches a page by `import`ing a JSON file so the bundler inlines it — never by `readFile`. +- **Pages under the development route tree are Server Components.** No `"use client"` on a page. A component that attaches an event handler needs `"use client"` as its own first line; a Server Component must never import _data_ from a `"use client"` module, because Next replaces such an export with a client-reference proxy that has no array methods. Both classes shipped past every gate in Phase 1. +- **`npm run build` is a mandatory acceptance gate, not an optional extra.** It is the only gate that catches a Server Component reading data from a client module. These routes are Dynamic, so the build does _not_ catch a serialised handler — that needs a live request. +- **The snapshot must be byte-deterministic.** No `generated_at`, no `Date.now()`, no value derived from the current time. Anything time-relative (has a quarantine expired?) is computed at render time, never stored. A non-deterministic field makes the staleness gate fail on every run, and a gate that cries wolf stops being a gate. +- **No silent row-dropping.** A malformed input fails the generator loudly and names the file. A value the renderer does not recognise is rendered as it stands under its own heading, never discarded — a page that quietly under-reports is the `#338` failure this feature exists to prevent. +- **An empty section says so in words.** "No tests are quarantined" — never a blank container, which is indistinguishable from a load failure. +- **Counts are computed once by the generator** and rendered as given, so a count and its own list cannot disagree. +- **Design tokens only.** `text-[color:var(--text-heading)]`, `border-[color:var(--border)]`, and friends. No hex literals — `eslint-rules/no-hardcoded-hex.mjs` fails the build. Tap targets are `min-h-12`; never "fix" them down to `min-h-11`. +- **Every `