Repository navigation
Conversation
`scc view [--port N] [--root DIR] [--json]` serves the workspace's record to a person: wiki, ADRs, codewiki next to the source lines it cites, glossary, stack, notes, and every plan and spec with its task progress. It runs until interrupted, and an interrupt exits 0. internal/view is stdlib net/http with three JSON routes (/api/tree, /api/page, /api/source), each reading the disk per request through internal/artifact, so the page cannot disagree with `scc map`. The frontend is React, built by Vite from web/ into internal/view/dist/, committed and embedded with go:embed, so `go build` still needs no node. Boundaries: binds 127.0.0.1 only; a Host header that does not name loopback is 403 (DNS rebinding); GET/HEAD only; CSP keeps scripts and connections on the viewer's origin; raw HTML in Markdown renders as text. Paths must be clean, inside the workspace after symlinks, and carry no dot-named segment on the real path, so neither a committed symlink to .env nor a Windows short name like GIT~1 reaches past it. Files over 1 MiB are refused and left out of the tree. Reopens the "no embedded web dashboard" line of ADR 0002 in ADR 0003; stack.md lists the frontend's packages; CI gains a `web` job that tests, typechecks and rebuilds dist/, failing on a diff. Spec: specs/view/ Verified: scc validate --checks (1029 Go tests, 86.3% coverage, lint and format clean); 16 vitest cases and tsc for web/; driven in Chrome against this repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
New command
scc view [--port N] [--root DIR] [--json]: serves the workspace's record as a local, read-only web page — wiki, ADRs, codewiki with the cited source lines highlighted, glossary, stack, notes, and every plan and spec with its task progress. Runs until Ctrl+C (exit 0). Default port 7777;--port 0picks a free one.internal/view— stdlibnet/http; three JSON routes (/api/tree,/api/page,/api/source), each reading the disk per request throughinternal/artifact, plus the embedded SPA.internal/cli/view.go— the command handler; wired into the dispatcher, usage and README.web/— React 19 + react-markdown/remark-gfm, built by Vite 8 intointernal/view/dist/(committed,go:embed).go buildstill needs no node;go.modstays stdlib-only..github/workflows/ci.yml— newwebjob:npm ci, vitest,tsc, rebuild, fail ifdist/differs from what is committed.adr:0003-local-read-only-viewer(reopens the "no embedded web dashboard" line of ADR 0002, with a pointer added there),docs/stack.mdfrontend entries, a codewiki section indocs/codewiki/packages.md.Spec
specs/view/— requirements R1 (serving), R2 (content), R3 (safety); 8/8 tasks done.Security boundary
Binds
127.0.0.1only ·Hostmust name loopback (DNS rebinding → 403) · GET/HEAD only (405) · CSPdefault-src 'self'with no inline scripts,nosniff,frame-ancestors 'none'· raw HTML in Markdown renders as text (norehype-raw) · external links limited to http(s)/mailto · paths must be clean, inside the workspace after symlinks, and carry no dot-named segment on the resolved real path · files over 1 MiB refused and left out of the tree.How it was verified
scc validate --checks: build, format, lint, test — 1029 Go tests, 86.3% coverage, 0 findings.web/: 14 vitest cases (link resolution, slug parity withmdscan.Slug, route parsing),tscclean. (The commit message says 16; it is 14.)Reviews
index.html. Not fixed: if a page has two headings with the same text, they get the same anchor id. This matchesmdscan.Slug, which the server's table of contents is built from, so I kept the two in step. Not fixed: requirements.md had unstaged changes. Nothing to change in the code; everything is now staged and committed.GIT~1/configwas read on the reviewer's Windows host) and through a committed symlink to a dot path. Fixed: the rule now runs on theEvalSymlinkspath, relative to the resolved root. Tests were added for both. Its hypotheses are also fixed: the 1 MiB cap now covers pages and the tree. One low, accepted and recorded in ADR 0003: any local account can reach the unauthenticated loopback port. Re-review was not run after the fixes (one fix round, perdelivery.md).