|
| 1 | +# Public Harness Inspector demo |
| 2 | + |
| 3 | +## Traceability |
| 4 | + |
| 5 | +- Spec ID: `public-inspector-demo` |
| 6 | +- Status: Implemented |
| 7 | + |
| 8 | +## Intent |
| 9 | + |
| 10 | +Add a first-class Harness Inspector entry to the Better Harness GitHub Pages |
| 11 | +site. Readers should understand the Inspector's evidence-bounded purpose and |
| 12 | +explore the current Workbench interactions without installing the project or |
| 13 | +exposing any maintainer's local sessions, prompts, paths, or repository state. |
| 14 | + |
| 15 | +## Acceptance Scenarios |
| 16 | + |
| 17 | +- AC-1: The website navbar contains an internal `Inspector` link immediately |
| 18 | + after Docs. A compact green `New` badge sits at the link's upper-right on |
| 19 | + desktop and beside the link on the mobile menu; `New` is not part of the |
| 20 | + product name, route, page title, or accessible link name. |
| 21 | +- AC-2: `/inspector/` is a full-width Docusaurus page with a concise product |
| 22 | + introduction, explicit `Interactive sample`, `Read-only`, and `English sample |
| 23 | + data` boundaries, an `Open full screen` action, and an embedded current |
| 24 | + Harness Inspector Workbench. |
| 25 | +- AC-3: The embedded Workbench is generated from a deterministic in-memory |
| 26 | + fixture. Every user-facing fixture value is English, no local session or Git |
| 27 | + discovery runs during the docs build, and the sample contains enough Stories, |
| 28 | + Sessions, Tool Calls, Files, Commits, dates, and evidence kinds to exercise |
| 29 | + Delivery Tree, Date, Evidence Drawer, Session View, and Replay interactions. |
| 30 | +- AC-4: The embedded page identifies itself as sample data rather than `real |
| 31 | + local evidence`, carries `noindex, follow`, and preserves the standalone |
| 32 | + Workbench's escaping and privacy guarantees. The indexable Docusaurus wrapper |
| 33 | + owns the public description. |
| 34 | +- AC-5: English and Simplified Chinese website builds expose the same English |
| 35 | + Workbench sample. Only the wrapper introduction and actions are localized. |
| 36 | + Desktop and narrow viewports retain usable navigation, iframe focus, a |
| 37 | + full-screen fallback, and no page-level horizontal overflow. |
| 38 | +- AC-6: Changes to the Inspector renderer, UI, fixture, docs page, or publishing |
| 39 | + workflow trigger or participate in the GitHub Pages build so the published |
| 40 | + demo cannot silently drift behind the current Workbench. |
| 41 | +- AC-7: The page continues below the interactive sample with concise, |
| 42 | + indexable documentation that explains the Inspector's core jobs, the |
| 43 | + difference between direct, observed, candidate, and contextual evidence, and |
| 44 | + the limits of what those relationships prove. |
| 45 | +- AC-8: A numbered usage guide walks readers through choosing a scope, |
| 46 | + inspecting the three Workbench lanes, opening evidence details, and using |
| 47 | + Session View or Replay. A separate local-project callout provides the exact |
| 48 | + advanced CLI command, default output location, and a link to installation |
| 49 | + documentation without implying that the hosted sample reads local data. |
| 50 | + |
| 51 | +## Non-goals |
| 52 | + |
| 53 | +- Publishing a maintainer's `.qoder/` report, native session identifiers, real |
| 54 | + prompts, commit authors, or current repository activity. |
| 55 | +- Reading a visitor's local workspace or offering a server-backed live report. |
| 56 | +- Rewriting the self-contained Workbench as Docusaurus React components. |
| 57 | +- Synchronizing the wrapper URL with every iframe selection in this slice; the |
| 58 | + standalone Workbench remains the owner of evidence deep links. |
| 59 | +- Adding Compare, editing mappings, recovery, or workspace mutation controls. |
| 60 | + |
| 61 | +## Plan and Tasks |
| 62 | + |
| 63 | +1. Add a pure Inspector demo builder under `scripts/harness-inspector/` with a |
| 64 | + fixed English fixture and generated timestamp. |
| 65 | +2. Add a bounded rendering presentation option for the sample context label, |
| 66 | + robots metadata, and optional public-demo marker without changing local |
| 67 | + report defaults. |
| 68 | +3. Generate `docs/static/demo/harness-inspector/index.html` during the existing |
| 69 | + docs asset-sync step instead of committing a second Workbench copy. |
| 70 | +4. Add a custom full-width `/inspector/` page, localized wrapper copy, full-screen |
| 71 | + action, iframe title, clipboard permission, and responsive frame layout. |
| 72 | +5. Add the `Inspector` navbar item and CSS-only green `New` badge while keeping |
| 73 | + the DOM link text and accessible name equal to `Inspector`. |
| 74 | +6. Extend Pages path triggers to include the Inspector owners and add focused |
| 75 | + behavior tests for fixture language, privacy, presentation metadata, and |
| 76 | + generated output. |
| 77 | +7. Add localized feature, usage, evidence-label, and local-project sections |
| 78 | + below the sample, with responsive cards and semantic headings/lists. |
| 79 | + |
| 80 | +Decision rationale: the Inspector already emits a portable self-contained HTML |
| 81 | +Workbench. Embedding that artifact keeps one UI owner and makes the public sample |
| 82 | +track current interactions. A deterministic fixture prevents CI from depending |
| 83 | +on developer homes or native host state, while the Docusaurus wrapper provides |
| 84 | +the indexable explanation and locale-specific framing. |
| 85 | + |
| 86 | +## Test and Review Evidence |
| 87 | + |
| 88 | +- AC-3/AC-4: focused Vitest coverage builds the demo twice, compares the stable |
| 89 | + report projection, validates English fixture strings, asserts sample/noindex |
| 90 | + metadata, and rejects absolute-home or credential-shaped output. |
| 91 | +- AC-1/AC-2/AC-5: `cd docs && npm run build`, followed by Playwright checks of |
| 92 | + English and `zh-Hans` `/inspector/` routes, navbar/badge placement, iframe |
| 93 | + interaction, full-screen target, console/page errors, and desktop/narrow |
| 94 | + screenshots. |
| 95 | +- AC-6: inspect the Pages workflow path filter and run the docs prebuild from a |
| 96 | + clean generated-static target. |
| 97 | +- AC-7/AC-8: inspect the English and Simplified Chinese page structure in the |
| 98 | + production build, verify the installation link and literal CLI command, and |
| 99 | + review the lower-page layout at desktop and narrow breakpoints. |
| 100 | +- Documentation integrity: `node scripts/doc-link-graph/cli.mjs |
| 101 | + skills/better-harness` and `npx vitest run |
| 102 | + test/skills-docs/doc-link-graph.test.mjs` after adding this spec. |
| 103 | +- Regression and package boundary: focused Inspector tests, `npm test`, |
| 104 | + `npm run pack:verify`, and `git diff --check`. |
| 105 | +- Privacy risk: fixture generation must remain pure and fixed; the docs build |
| 106 | + must never call session discovery or Git history collection. |
| 107 | +- UI risk: nested browser scrolling can obscure the Workbench. Keep the wrapper |
| 108 | + as a viewport-height flex surface and provide a visible full-screen escape. |
| 109 | + |
| 110 | +Observed on 2026-08-13: |
| 111 | + |
| 112 | +- Focused Inspector coverage: 21 tests passed. |
| 113 | +- Documentation link graph: 6 tests passed after regeneration. |
| 114 | +- Full regression suite: 92 files and 1,309 tests passed. |
| 115 | +- Package verification: npm package and runtime zip contents passed. |
| 116 | +- Production documentation build: English and Simplified Chinese builds passed. |
| 117 | +- Browser verification: the English and Simplified Chinese wrappers loaded with |
| 118 | + no console errors or page-level horizontal overflow; the embedded sample used |
| 119 | + English-only fixture data and realistic short commit hashes. The standalone |
| 120 | + sample opened Session View and switched to Replay successfully. |
| 121 | +- Documentation extension: the English and Simplified Chinese production pages |
| 122 | + exposed all feature, usage, evidence-label, and local-project sections; the |
| 123 | + advanced CLI command and installation link were present, with no console |
| 124 | + errors or page-level horizontal overflow. |
0 commit comments