On this page

0264. Forge read-only slice: harness forge launcher and host-store reads

Context

A local anonymous browser needs existing hvc reads without duplicating storage logic or introducing write authority. ADRs 0206 and 0207 are Proposed working assumptions for this slice, not accepted by this decision.

Decision

Forge default: harness forge init|serve is a Rust launcher. Embed examples/tools/forge/ and pure plugins/hosting/ sources with include_str!, materialize their repo-relative layout in a content-hash cache, build once with harness build, and run the cached binary. The app remains directly buildable; there is no separately shipped forge executable. First serve needs gcc.

Use the read-only harness host-store --root <dir> <op> … process bridge, called through Process.run_input with the absolute current_exe() path, never a shell. Ops: repos; refs NS/REPO; tree/blob/items NS/REPO REV PATH; item NS/REPO REV PATH KEY; log NS/REPO REV LIMIT; commit NS/REPO ID. PATH may be empty. stdout starts hs1, then tab-separated records tagged repo, branch, tag, entry, key, commit, detail, by, message, change or text; escape backslash, TAB, LF, CR as \\, \t, \n, \r. Blob output is unframed bytes. Exit codes: 0 success, 2 invalid request, 3 not found, 4 storage error, 5 too large; stderr uses fixed host-store: strings, no paths or VC diagnostics.

Host-root subset: format is exactly harness-host 1\n; ordinary hvc stores live at repos/<ns>/<repo>/.harness/vc/. Canonicalize and reject symlink components. No config.toml, identity, transaction or public directories; CSS ships in the app. Only init writes a new root once. Reads use bounded existing VC mechanisms.

Bind and net.restrict only to 127.0.0.1:<port>, with no host/listen option, auth, cookies, forms or POST. Render server-side through html element/void/text; no raw HTML API, scripts or JavaScript. HTML CSP denies by default, allows only self styles/images, and forbids base, forms and framing. Repository HTML/SVG is text/plain with nosniff and default-src 'none'; sandbox CSP, never markup.

Deferred: writes/CAS/identity/transactions/locks/sessions and snapshot pagination beyond commit-id cursors need VR1+/H3; push/clone need F2/VR*. TLS, browser writes and runner isolation remain undecided. YAML import, issues/review/wiki and ADRs 0204–0207 are not decided here. No diagnostic code; E1088 stays free.

Alternatives considered

Consequences

M-HTTP.14 lands contracts/routes only; .15 views, .16 bridge, .17 app and .18 launcher follow. Loopback fixture browsing is not public production hosting.