interplane-forge
INTERPLANE Forge
Brought by drakestapleton
Comparing 539217d2e4a67ec266b6d88ab2f3dc882f929f46 ... e8ae0f2ce0e12ca87b06a1be46e8cbf5d9012aac
- Merge the forge chrome for the redesigned site layout
- Merge the recovered commit-pinned clone panels and archive edge
- Recover live commit-pinned clone panels and archive edge
- Fix forge chrome for the redesigned site layout
16 files changed, +469 -105
| README.md | +14 | -2 |
| browse/a_core.om | +4 | -0 |
| browse/c1_page.om | +16 | -2 |
| browse/tests/stubutil.om | +1 | -0 |
| dl/tests/pinned-archives.sh | +83 | -0 |
| docs/API.md | +8 | -0 |
| docs/CONTRACT.md | +25 | -0 |
| docs/FEATURES.md | +4 | -3 |
| infra/bazinga/omega-read | +22 | -7 |
| infra/nginx/snippets/bazinga-git.conf | +2 | -2 |
| server/chromegen.om | +90 | -44 |
| server/pages.om | +12 | -5 |
| server/tests/sitechrome.sh | +50 | -31 |
| server/util.om | +10 | -0 |
| store/clone.om | +18 | -9 |
| store/tests/pinned-clone.sh | +110 | -0 |
README.md
| @@ -8,8 +8,12 @@ raw, source archives (zip, tar.gz), releases, Radicle patches and issues, stars, | ||
| 8 | 8 | and Radicle-key sign-in. Pages are server-rendered HTML and CSS; there is no JavaScript. Every page |
| 9 | 9 | wears the interplane.io header and footer (one site): `./run.sh units` generates them at every build from the |
| 10 | 10 | site's own source with `server/chromegen.om`, and `server/tests/sitechrome.sh` checks the result. |
| 11 | -The galaxy dark palette is taken from that same generated site :root, so the forge does not keep | |
| 12 | -a second copy of the site CSS palette (the favicon and the two diff-row tints keep their own values). The galaxy tokens asset is only routed on the root | |
| 11 | +Projects (the link to `/explore`) is marked current; forge controls remain a separate row. The | |
| 12 | +three-column footer keeps its site structure around forge-specific fine print. The decorative rope | |
| 13 | +band outside the site's footer is not copied. Header/footer rules include responsive and Strand-system | |
| 14 | +overrides, including the sticky header and primary button. The dark navy palette comes from the | |
| 15 | +generated site `:root`; forge aliases refer to its tokens, not a second palette (only the favicon and | |
| 16 | +the two diff-row tints keep their own values). The galaxy tokens asset is only routed on the root | |
| 13 | 17 | base, not under /forge/, so forge.css stays self-contained for both bases. visits/visits.css |
| 14 | 18 | already reads galaxy/tokens.css and needs no separate palette. |
| 15 | 19 | |
| @@ -64,6 +68,14 @@ How the pieces fit together: `docs/CONTRACT.md`. What replaces the GitHub annoya | ||
| 64 | 68 | `FORGE_CLONE_BASE=https://<host>/<path>/`) reads the project list from the store's `catalog.tsv` |
| 65 | 69 | and Git from `projects/NAME/repo.git` (`store/`, docs/CONTRACT.md section 1); `deploy` and |
| 66 | 70 | `restart` refuse it. Acceptance: `bash store/tests/compare.sh STORE KEY IPL_DIR`. |
| 71 | + On the repository home, the store clone panel names the displayed commit: | |
| 72 | + `git clone --no-checkout <url> <name> && git -C <name> checkout --detach <40-hex>`. | |
| 73 | + Its ZIP and tar.gz links use `/<owner>/<repo>/archive/commits/<40-hex>.zip|.tar.gz`. | |
| 74 | + That address is answered by the public Git edge (`infra/bazinga/omega-read`), not forged's | |
| 75 | + `dl/dl.om`: only full lower-case commit IDs reachable from a public head or tag are accepted. | |
| 76 | + The old `/archive/refs/heads/<branch>` addresses remain branch archives; forged's | |
| 77 | + `/archive/<sha>` still redirects only when a canonical head or tag points exactly at that commit. | |
| 78 | + Checks: `bash store/tests/pinned-clone.sh` and `bash dl/tests/pinned-archives.sh` (private fixtures). | |
| 67 | 79 | |
| 68 | 80 | ## Data |
| 69 | 81 |
browse/a_core.om
| @@ -440,6 +440,10 @@ if ne st 0 | ||
| 440 | 440 | ret false |
| 441 | 441 | end |
| 442 | 442 | hx = false |
| 443 | +note A full commit id wins over a same-named ref, keeping pinned page links pinned. | |
| 444 | +if eq brhexseg 40 | |
| 445 | +k = 0 | |
| 446 | +end | |
| 443 | 447 | if eq k 0 |
| 444 | 448 | k = brhexseg |
| 445 | 449 | if eq k 0 |
browse/c1_page.om
| @@ -659,6 +659,14 @@ na = add tab 1 | ||
| 659 | 659 | brreadme na sub e na |
| 660 | 660 | end |
| 661 | 661 | text tbnord "<p class=\"pj-nordme\">This project has no README yet. A README is the page where a project says what it is and how to use it. Here are its files:</p>\n" |
| 662 | +note brpinhd: share the resolved commit with the header only for this render. | |
| 663 | +fn brpinhd to void | |
| 664 | +for i ulong 40 | |
| 665 | +put fpin i get gbsha i | |
| 666 | +end | |
| 667 | +frepohd 0 | |
| 668 | +put fpin 0 0 | |
| 669 | +end | |
| 662 | 670 | note brhome: repo home at the default branch; 0 hands an empty repo back to the server's home. |
| 663 | 671 | note README first: the friendly header (frepohd), the README (or a plain note and the file list when |
| 664 | 672 | note there is none), then the "For developers: proof and records" section (server/pages.om fpjdev1, |
| @@ -671,7 +679,13 @@ ret 0 | ||
| 671 | 679 | end |
| 672 | 680 | put ftil 0 0 |
| 673 | 681 | ftirepo |
| 674 | -frepohd 0 | |
| 682 | +for i ulong 40 | |
| 683 | +put gbref i get gbsha i | |
| 684 | +put gbfr i get gbsha i | |
| 685 | +end | |
| 686 | +put gbrefl 0 40 | |
| 687 | +put gbfrl 0 40 | |
| 688 | +brpinhd | |
| 675 | 689 | lsok = brrdfind |
| 676 | 690 | rd = and lsok gt get gbrml 0 0 |
| 677 | 691 | if rd |
| @@ -709,7 +723,7 @@ brloc tbblob | ||
| 709 | 723 | ret 302 |
| 710 | 724 | end |
| 711 | 725 | brti tbtfil |
| 712 | -frepohd 0 | |
| 726 | +brpinhd | |
| 713 | 727 | brrefbar |
| 714 | 728 | brcrumb |
| 715 | 729 | brlast |
browse/tests/stubutil.om
| @@ -18,6 +18,7 @@ global fown uchar 64 | ||
| 18 | 18 | global fownl ulong 1 |
| 19 | 19 | global frepo uchar 128 |
| 20 | 20 | global frepol ulong 1 |
| 21 | +global fpin uchar 40 | |
| 21 | 22 | global frest uchar 4096 |
| 22 | 23 | global frestl ulong 1 |
| 23 | 24 | global fkind ulong 1 |
dl/tests/pinned-archives.sh
| new file mode 100644 | ||
| @@ -0,0 +1,83 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# ORACLE: exercise the deployed edge CGI's commit archives with private Git fixtures, no sockets. | |
| 3 | +# The product CGI and nginx snippet stay byte-identical to their deployed copies. Only this | |
| 4 | +# private executable's fixed public root is substituted. Every accepted class has a refused twin. | |
| 5 | +set -euo pipefail | |
| 6 | +cd "$(dirname "$0")/../.." | |
| 7 | +T=$(mktemp -d /tmp/forge-pinned-archive.XXXXXX) | |
| 8 | +trap '[ "${KEEP_TEST_TMP:-0}" = 1 ] || rm -rf "$T"' EXIT | |
| 9 | +run() { taskset -c "${CORES:-4,5}" nice -n 10 "$@"; } | |
| 10 | +pass=0 | |
| 11 | +ok() { pass=$((pass+1)); echo "PASS $*"; } | |
| 12 | +die() { echo "FAIL $*"; exit 1; } | |
| 13 | +export GIT_AUTHOR_NAME=fixture GIT_AUTHOR_EMAIL=fixture@invalid GIT_COMMITTER_NAME=fixture GIT_COMMITTER_EMAIL=fixture@invalid | |
| 14 | +export GIT_AUTHOR_DATE=2026-01-01T00:00:00Z GIT_COMMITTER_DATE=2026-01-01T00:00:00Z | |
| 15 | +mkdir -p "$T/public" "$T/w" | |
| 16 | +git -C "$T/w" init -q -b main | |
| 17 | +printf 'one\n' > "$T/w/README" | |
| 18 | +git -C "$T/w" add README; git -C "$T/w" commit -qm one | |
| 19 | +old=$(git -C "$T/w" rev-parse HEAD) | |
| 20 | +printf 'two\n' >> "$T/w/README"; git -C "$T/w" commit -qam two | |
| 21 | +head=$(git -C "$T/w" rev-parse HEAD) | |
| 22 | +branch=$(printf branch | git -C "$T/w" commit-tree "$old^{tree}") | |
| 23 | +tag=$(printf tag | git -C "$T/w" commit-tree "$old^{tree}") | |
| 24 | +dangling=$(printf dangling | git -C "$T/w" commit-tree "$old^{tree}") | |
| 25 | +git clone -q --bare "$T/w" "$T/public/fixture.git" | |
| 26 | +G=(git --git-dir="$T/public/fixture.git") | |
| 27 | +# Objects unreachable from main are copied explicitly, then only two get canonical refs. | |
| 28 | +for c in "$branch" "$tag" "$dangling"; do "${G[@]}" fetch -q "$T/w" "$c"; done | |
| 29 | +"${G[@]}" update-ref refs/heads/other "$branch" | |
| 30 | +"${G[@]}" update-ref refs/tags/only-tag "$tag" | |
| 31 | +"${G[@]}" update-ref refs/noncanonical/hidden "$dangling" | |
| 32 | +blob=$("${G[@]}" rev-parse "$head:README") | |
| 33 | +sed "s|^export GIT_PROJECT_ROOT=.*|export GIT_PROJECT_ROOT=$T/public|" infra/bazinga/omega-read > "$T/omega-read" | |
| 34 | +req() { | |
| 35 | + local path=$1 method=${2:-GET} | |
| 36 | + run env PATH_INFO="/fixture$path" REQUEST_METHOD="$method" QUERY_STRING= sh "$T/omega-read" > "$T/response" | |
| 37 | + # CGI headers end in CRLF CRLF. Keep archive bytes unmodified. | |
| 38 | + if head -1 "$T/response" | grep -q '^Status:'; then | |
| 39 | + status=$(head -1 "$T/response" | tr -d '\r' | cut -d' ' -f2) | |
| 40 | + else status=200; fi | |
| 41 | + LC_ALL=C awk '{ n += length($0) + 1; if ($0 == "\r") {print n; exit} }' "$T/response" > "$T/offset" | |
| 42 | + dd if="$T/response" of="$T/body" bs=1 skip="$(cat "$T/offset")" status=none | |
| 43 | + LC_ALL=C awk '$0 == "\r" {exit} {sub(/\r$/, ""); print}' "$T/response" > "$T/headers" | |
| 44 | +} | |
| 45 | +accept() { | |
| 46 | + local sha=$1 fmt=$2 path=${3:-/commits/$1.$2} | |
| 47 | + req "$path" | |
| 48 | + [ "$status" = 200 ] || die "$path status $status" | |
| 49 | + grep -qF "Content-Disposition: attachment; filename=fixture-$sha.$fmt" "$T/headers" || die disposition | |
| 50 | + grep -qF "ETag: \"$sha\"" "$T/headers" || die etag | |
| 51 | + grep -qFx 'Cache-Control: no-cache' "$T/headers" || die cache | |
| 52 | + local mime=application/zip; [ "$fmt" != tar.gz ] || mime=application/gzip | |
| 53 | + grep -qFx "Content-Type: $mime" "$T/headers" || die type | |
| 54 | + "${G[@]}" archive --format="$fmt" --prefix="fixture-$sha/" "$sha" > "$T/want" | |
| 55 | + cmp -s "$T/want" "$T/body" || die "$path body" | |
| 56 | + ok "$path status, type, disposition, cache, etag and archive bytes" | |
| 57 | +} | |
| 58 | +refuse() { req "$1"; [ "$status" = 404 ] && [ ! -s "$T/body" ] || die "$1 expected empty 404"; ok "NEG $1 empty 404"; } | |
| 59 | +for sha in "$head" "$old" "$branch" "$tag"; do | |
| 60 | + for fmt in zip tar.gz; do accept "$sha" "$fmt"; refuse "/commits/${sha:0:39}.$fmt"; done | |
| 61 | +done | |
| 62 | +refuse "/commits/${head:0:7}.zip" | |
| 63 | +for sha in "$dangling" "$blob" 0000000000000000000000000000000000000000 "${head^^}" "${head}0"; do refuse "/commits/$sha.zip"; done | |
| 64 | +for suffix in '' .tar .tgz .ZIP .zip. .zip/; do refuse "/commits/$head$suffix"; done | |
| 65 | +req "/commits/$head.zip" HEAD | |
| 66 | +[ "$status" = 200 ] && [ ! -s "$T/body" ] || die 'HEAD response' | |
| 67 | +ok 'HEAD has the same archive headers and no body' | |
| 68 | +req /refs/heads/main.zip | |
| 69 | +[ "$status" = 200 ] || die 'old branch route' | |
| 70 | +"${G[@]}" archive --format=zip --prefix=fixture-main/ "$head" > "$T/want" | |
| 71 | +cmp -s "$T/want" "$T/body" || die 'old branch bytes' | |
| 72 | +ok 'old /refs/heads/main.zip keeps its branch prefix' | |
| 73 | +refuse /refs/heads/missing.zip | |
| 74 | +req /archive/main.zip | |
| 75 | +[ "$status" = 200 ] && cmp -s "$T/want" "$T/body" || die 'old CGI archive alias' | |
| 76 | +ok 'old CGI /archive/main.zip alias stays equal' | |
| 77 | +# Mutant: remove reachability check. The same dangling request must now violate the refusal. | |
| 78 | +sed '/\[ -n "$visible" \] || notfound/d' "$T/omega-read" > "$T/mutant" | |
| 79 | +mv "$T/omega-read" "$T/good"; mv "$T/mutant" "$T/omega-read" | |
| 80 | +req "/commits/$dangling.zip" | |
| 81 | +[ "$status" = 200 ] && [ -s "$T/body" ] || die 'reachability mutant not detected' | |
| 82 | +ok 'NEG reachability mutant exposes hidden commit and fails the refusal oracle' | |
| 83 | +echo "pinned archives: $pass pass, 0 fail" |
docs/API.md
| @@ -129,6 +129,14 @@ All keys of the repo summary above, then: | ||
| 129 | 129 | | `readme` | object or null | the README the home page renders (`readme.md` first, then any name starting with `readme`, ignoring case): `name`, `html` (blob page), `raw` (raw file) | |
| 130 | 130 | | `counts` | object | real clone, download and seeding numbers, below | |
| 131 | 131 | |
| 132 | +The store-reading HTML home panel differs from the JSON `archives` object's branch links: | |
| 133 | +it offers `/drakestapleton/<repo>/archive/commits/<40-lower-case-hex>.zip` and `.tar.gz`, | |
| 134 | +pinned to the commit displayed. These are public Git edge routes (`infra/bazinga/omega-read`), | |
| 135 | +not forged `dlroute` routes. A commit object reachable from the public mirror's root heads or | |
| 136 | +tags is required; short, upper-case, unknown and unreachable IDs are refused. An accepted | |
| 137 | +archive has prefix `<repo>-<sha>/`, quoted-SHA ETag and `Cache-Control: no-cache`. | |
| 138 | +The JSON archive links and legacy `/archive/<sha>` redirects are unchanged. | |
| 139 | + | |
| 132 | 140 | ### `counts` |
| 133 | 141 | |
| 134 | 142 | Every number comes from a log or table that exists on the node, and says which. Nothing is seeded, |
docs/CONTRACT.md
| @@ -88,6 +88,24 @@ store-reading build never writes `server/forged`. The store layout and its rules | ||
| 88 | 88 | CONTRACT.md v0; `store/repos.om` says which of them forged checks. `store/tests/compare.sh` is the |
| 89 | 89 | acceptance test. |
| 90 | 90 | |
| 91 | +The store repository home resolves its default branch once and pins the README/file links, | |
| 92 | +Files tab and clone panel to that commit. `brpinhd` copies `gbsha` into `fpin` (uchar 40), calls | |
| 93 | +`frepohd 0`, then clears `fpin[0]`; tree pages use the same wrapper. `fputpin` writes its 40 bytes. | |
| 94 | +A full 40-hex ref segment is interpreted as a commit even if a branch has that exact name. | |
| 95 | +Without `FORGE_CLONE_BASE`, the Git command is omitted but the pinned archive links remain. | |
| 96 | +An empty repository has no clone panel. | |
| 97 | + | |
| 98 | +The public Git edge, not `dlroute`, answers | |
| 99 | +`/drakestapleton/<repo>/archive/commits/<40-lower-case-hex>.zip|.tar.gz` | |
| 100 | +(`infra/nginx/snippets/bazinga-git.conf`, `infra/bazinga/omega-read`). The object must be a commit | |
| 101 | +reachable from a root `refs/heads` or `refs/tags` in the public filtered Git mirror, including | |
| 102 | +older history and commits on another branch or only under a tag. The download's prefix is | |
| 103 | +`<repo>-<sha>/`, ETag is the quoted SHA, and Cache-Control is `no-cache`. HEAD sends no body. | |
| 104 | +Malformed paths fall through to forged; a well-formed but unknown, non-commit or unreachable SHA | |
| 105 | +gets an empty 404 from the edge. Existing branch archives retain their branch-based prefix. | |
| 106 | +Forged's legacy `/archive/<7..40-hex>` remains a 302 only for a commit at a canonical head or tag | |
| 107 | +tip, otherwise 404. It does not implement the edge's `/archive/commits/` path. | |
| 108 | + | |
| 91 | 109 | ## 2. Request (set by the server before dispatch; read only) |
| 92 | 110 | |
| 93 | 111 | Scalars are `global X ulong 1`, read with `get X 0`. |
| @@ -219,6 +237,13 @@ The edge CSP forbids inline `style=` and `<style>`: use class names from the ser | ||
| 219 | 237 | texts `tfcssv` and `tfcss2..9` in `server/pages.om` (ask ForgeServer to add a class). `frepohd tab` and `dlclone` (the clone panel: rad, git over HTTPS, zip/tar.gz) are in |
| 220 | 238 | pages.om / dl/dlclone.om (store-reading build: store/clone.om, git over HTTPS only with a clone base, zip/tar.gz). |
| 221 | 239 | |
| 240 | +The generated header marks the single `https://interplane.io/explore` link (Projects) current with | |
| 241 | +`aria-current="true"`; `tfcss2` styles it and the forge controls stay in their separate row. | |
| 242 | +`tchrfoot` holds the site's three-column footer through its SI line; forge-specific fine print is | |
| 243 | +followed by generated `tchrfend`, which closes the site's footer containers. The decorative rope band | |
| 244 | +between the site's main and footer is deliberately excluded. Responsive chrome rules and the later | |
| 245 | +Strand-system overrides retain source order and their enclosing at-blocks. | |
| 246 | + | |
| 222 | 247 | ## 4. Helpers in server/util.om |
| 223 | 248 | |
| 224 | 249 | | Helper | Effect | |
docs/FEATURES.md
| @@ -43,7 +43,7 @@ Unclaimed feature paths answer a styled 501 "Coming soon" page, never a crash or | ||
| 43 | 43 | | Tags | List tags | `/<o>/<r>/tags`; tags are also listed as releases on `/releases` | DONE | Browse | |
| 44 | 44 | | History of a file | Commits that touched a path | `/<o>/<r>/commits/<ref>/<path>` | DONE | Browse | |
| 45 | 45 | | Permalinks | Links pinned to a commit sha | tree / blob / raw accept a full commit sha as the ref | DONE | Browse | |
| 46 | -| Clone URLs | HTTPS / SSH clone | Clone panel on the repo home: `rad clone rad:<RID>`, `git clone https://www.aienos.com/rad/<RID>.git` (git-over-HTTPS by the rad-http service; `info/refs` answers 200), zip / tar.gz, and the one-command `forge-contribute` (arguments in docs/ANNOYANCES.md). No SSH clone. Store-reading build: no `rad clone` and no `forge-contribute` line; `git clone <base>projects/<name>/repo.git` only when built with `FORGE_CLONE_BASE` (no server answers that address yet) | PARTIAL | DL, Infra, simplify | | |
| 46 | +| Clone URLs | HTTPS / SSH clone | Store-reading home panel: `git clone --no-checkout <base>projects/<name>/repo.git <name> && git -C <name> checkout --detach <sha>`, pinned to the displayed default-branch commit. No HTTPS line without `FORGE_CLONE_BASE`; no panel for an empty repo. No `rad clone` or `forge-contribute` line in the store build. The default build's clone panel is unchanged. No SSH clone | PARTIAL | DL, Infra | | |
| 47 | 47 | | Code search (global) | Search code across repositories | `/search?q=`: case-insensitive fixed-string `git grep` over every public repo's default branch in allow-list order, at most 5 hits per file and 100 in total, links to `blob/<branch>/<path>#L<n>`. Each grep is stopped once the page has the lines it can still show, so a common word no longer scans whole trees; the page bytes are the same as reading every grep to the end (`nodes/tests/ab.sh check`); time in `docs/PERF.md` | DONE | Server | |
| 48 | 48 | | Code search (one repo) | Search inside one repository | `/<o>/<r>/search?q=`: fixed-string `git grep` on the default branch, hits link to `blob/...#L<n>` | DONE | Browse | |
| 49 | 49 | | Repository search | Search repositories by name / description | `/search?q=`: case-insensitive substring on name and description | DONE | Server | |
| @@ -59,6 +59,7 @@ Unclaimed feature paths answer a styled 501 "Coming soon" page, never a crash or | ||
| 59 | 59 | |---|---|---|---|---| |
| 60 | 60 | | Source archive (zip) | Download a ref as .zip | `/<o>/<r>/archive/refs/heads/<b>.zip`, `/archive/refs/tags/<t>.zip` via `git archive`, top dir `<repo>-<ref>/`, cached under `~/forge-data/archives/<rid>/`, 512 MiB cap; `/archive/<sha>.zip` 302 to the branch or tag archive when a head or tag points at it, else 404; at most 2 cold builds per 60 s site-wide (503 + Retry-After); bad ref 404 | DONE | DL | |
| 61 | 61 | | Source archive (tar.gz) | Download a ref as .tar.gz | Same paths with `.tar.gz` (`application/gzip`) | DONE | DL | |
| 62 | +| Commit-pinned source archive | Download an exact commit | Public Git edge (`infra/bazinga/omega-read`), not forged: `/drakestapleton/<repo>/archive/commits/<40-lower-case-hex>.zip` or `.tar.gz`. Requires a commit object reachable from a root head or tag in the public filtered mirror, including older history. Prefix `<repo>-<sha>/`, quoted-SHA ETag, `Cache-Control: no-cache`; HEAD omits the body. Unknown or unreachable commits are empty 404; malformed URLs fall through to forged. Existing branch/tag paths and legacy SHA redirects are unchanged. `dl/tests/pinned-archives.sh` covers accepted/refused twins and a reachability mutant | DONE | Infra | | |
| 62 | 63 | | Releases list | Tagged releases with notes and assets | `/<o>/<r>/releases`: tags as releases, notes from the annotated tag message, source archives as assets, paged; asset checksums shown once built, else "checksum computed on first download"; "No releases yet" when there are no tags | DONE | DL | |
| 63 | 64 | | Release page / latest | One release; `/releases/latest` | `/<o>/<r>/releases/tag/<t>` (200); `/releases/latest` 302 to the newest tag, 404 without tags | DONE | DL | |
| 64 | 65 | | Release assets (binaries) | Uploaded files attached to a release | `/releases/download/<t>/<asset>` serves the source archives only; uploads need a write path that Radicle does not have yet | PARTIAL | DL | |
| @@ -154,11 +155,11 @@ Unclaimed feature paths answer a styled 501 "Coming soon" page, never a crash or | ||
| 154 | 155 | | Feature | GitHub behaviour | Mine | Status | Owner | |
| 155 | 156 | |---|---|---|---|---| |
| 156 | 157 | | Two domains, one forge | (mine) | Same server at `https://interplane.io/` and `https://www.aienos.com/forge/`; every link and redirect built from `X-Forge-Base` | DONE (public smoke by ForgeInfra on both domains) | Server, Infra | |
| 157 | -| One site with interplane.io | (mine) | Every HTML page wears the interplane.io header (brand to `https://interplane.io/`, the site nav with Forge as the current entry, the Bring your slop button) and footer, its palette and its type; the forge controls are a second row. Generated, not copied: `./run.sh units` runs `server/chromegen.om` (seeded Omega) on `content/_layout.html` and `public/style.css` of the site's canonical main in local Radicle storage and composes `.build/chrome.om` (texts `tchrhead`, `tchrfoot`, `tchrcss`, `tchrsite`), so a site change reaches the next forge build with no edit; `./run.sh deploy` writes the site commit into `infra/DEPLOY.md`. `server/tests/sitechrome.sh` checks the result against the site source, that a changed site reaches a build, and that an unreadable layout stops the build with its reason | DONE | Server | | |
| 158 | +| One site with interplane.io | (mine) | Every HTML page wears the interplane.io header (brand to `https://interplane.io/`, the site nav with Projects as the current entry, the Get Omega button) and three-column footer, its palette and its type; the forge controls are a second row. Generated, not copied: `./run.sh units` runs `server/chromegen.om` (seeded Omega) on `content/_layout.html` and `public/style.css` of the site's canonical main in local Radicle storage and composes `.build/chrome.om` (texts `tchrhead`, `tchrfoot`, `tchrfend`, `tchrcss`, `tchrsite`), so a site change reaches the next forge build with no edit; `./run.sh deploy` writes the site commit into `infra/DEPLOY.md`. The decorative rope band outside the site footer is excluded. `server/tests/sitechrome.sh` checks the result against the site source, that a changed site reaches a build, and that an unreadable layout stops the build with its reason | DONE | Server | | |
| 158 | 159 | | Header search box | Global search from every page | Forge row form GET `<base>search`, under the site header | DONE | Server | |
| 159 | 160 | | Error pages | Styled 404 / 500 | Server error pages for 400 403 404 405 413 429 500, plus 501 "Coming soon" for named features not served yet | DONE | Server | |
| 160 | 161 | | Mobile layout | Usable on phones | Responsive CSS: the site header's own breakpoints (1000, 860, 760, 480, 380 px) and the forge's (760, 640 px); no horizontal scroll at 390 px | DONE | Server | |
| 161 | -| Dark mode | Dark theme | The pages use the galaxy dark palette from the generated interplane.io site chrome; no second light palette | IMPLEMENTED | Server | | |
| 162 | +| Dark mode | Dark theme | The pages use the site's dark navy palette from the generated interplane.io `:root`; no second light palette | IMPLEMENTED | Server | | |
| 162 | 163 | | No JavaScript | (mine) | No script anywhere; CSP forbids it | DONE | Server | |
| 163 | 164 | | Keyboard shortcuts | Hotkeys | Not offered (needs JS) | PLANNED | Server | |
| 164 | 165 | | Access log | (platform) | One line per request to stderr: epoch, IP, method, path, status, bytes, ms | DONE | Server | |
infra/bazinga/omega-read
| @@ -24,18 +24,33 @@ case "$REQUEST_METHOD $PATH_INFO" in | ||
| 24 | 24 | export PATH_INFO="/$name.git$PATH_INFO" |
| 25 | 25 | exec /usr/lib/git-core/git-http-backend |
| 26 | 26 | ;; |
| 27 | - "GET /archive/"*|"HEAD /archive/"*) | |
| 27 | + "GET /archive/"*|"HEAD /archive/"*|"GET /refs/heads/"*|"HEAD /refs/heads/"*|"GET /commits/"*|"HEAD /commits/"*) | |
| 28 | 28 | case "$PATH_INFO" in |
| 29 | 29 | *.zip) format=zip; mime=application/zip ;; |
| 30 | 30 | *.tar.gz) format=tar.gz; mime=application/gzip ;; |
| 31 | 31 | *) notfound ;; |
| 32 | 32 | esac |
| 33 | - branch=${PATH_INFO#/archive/} | |
| 34 | - branch=${branch%."$format"} | |
| 35 | - case "$branch" in ''|*[!a-zA-Z0-9._/-]*) notfound ;; esac | |
| 36 | - git check-ref-format "refs/heads/$branch" >/dev/null || notfound | |
| 37 | - commit=$(git --git-dir="$repo" rev-parse --verify "refs/heads/$branch^{commit}" 2>/dev/null) || notfound | |
| 38 | - label=$(printf '%s' "$branch" | tr / -) | |
| 33 | + case "$PATH_INFO" in | |
| 34 | + /commits/*) | |
| 35 | + commit=${PATH_INFO#/commits/} | |
| 36 | + commit=${commit%."$format"} | |
| 37 | + case "$commit" in *[!0-9a-f]*) notfound ;; esac | |
| 38 | + [ "${#commit}" -eq 40 ] || notfound | |
| 39 | + [ "$(git cat-file -t "$commit" 2>/dev/null)" = commit ] || notfound | |
| 40 | + visible=$(git for-each-ref --count=1 --contains="$commit" --format='%(refname)' refs/heads refs/tags) || notfound | |
| 41 | + [ -n "$visible" ] || notfound | |
| 42 | + label=$commit | |
| 43 | + ;; | |
| 44 | + *) | |
| 45 | + branch=${PATH_INFO#/refs/heads/} | |
| 46 | + branch=${branch#/archive/} | |
| 47 | + branch=${branch%."$format"} | |
| 48 | + case "$branch" in ''|*[!a-zA-Z0-9._/-]*) notfound ;; esac | |
| 49 | + git check-ref-format "refs/heads/$branch" >/dev/null || notfound | |
| 50 | + commit=$(git --git-dir="$repo" rev-parse --verify "refs/heads/$branch^{commit}" 2>/dev/null) || notfound | |
| 51 | + label=$(printf '%s' "$branch" | tr / -) | |
| 52 | + ;; | |
| 53 | + esac | |
| 39 | 54 | printf "Content-Type: %s\r\nContent-Disposition: attachment; filename=%s-%s.%s\r\nETag: \"%s\"\r\nCache-Control: no-cache\r\n\r\n" "$mime" "$name" "$label" "$format" "$commit" |
| 40 | 55 | [ "$REQUEST_METHOD" = HEAD ] || exec git --git-dir="$repo" archive --format="$format" --prefix="$name-$label/" "$commit" |
| 41 | 56 | ;; |
infra/nginx/snippets/bazinga-git.conf
| @@ -25,8 +25,8 @@ location ~ "^/(?:drakestapleton/(?<sr>[A-Za-z0-9][A-Za-z0-9._-]*?)(?:\.git)?|pro | ||
| 25 | 25 | add_header X-Content-Type-Options nosniff always; |
| 26 | 26 | proxy_pass http://127.0.0.1:17941; |
| 27 | 27 | } |
| 28 | -location ~ "^/drakestapleton/(?<ar>[A-Za-z0-9][A-Za-z0-9._-]*)/archive/refs/heads/(?<af>[A-Za-z0-9._/-]+\.(?:zip|tar\.gz))$" { | |
| 29 | - set $archive_uri /omega-read/$ar/archive/$af; | |
| 28 | +location ~ "^/drakestapleton/(?<ar>[A-Za-z0-9][A-Za-z0-9._-]*)/archive/(?<af>(?:refs/heads/[A-Za-z0-9._/-]+|commits/[0-9a-f]{40})\.(?:zip|tar\.gz))$" { | |
| 29 | + set $archive_uri /omega-read/$ar/$af; | |
| 30 | 30 | rewrite ^ $archive_uri break; |
| 31 | 31 | proxy_read_timeout 300s; |
| 32 | 32 | proxy_buffering off; |
server/chromegen.om
| @@ -2,35 +2,45 @@ om2 | ||
| 2 | 2 | note server/chromegen.om: makes the forge's copy of the interplane.io site chrome from the site's own |
| 3 | 3 | note source, at every build (run.sh units runs it), so a site change never needs a hand copy. |
| 4 | 4 | note stdin: content/_layout.html, a 0 byte, public/style.css, a 0 byte, the site commit (40 hex). |
| 5 | -note stdout: one Omega unit (texts tchrsite, tchrhead, tchrfoot, tchrcss) that server/pages.om writes: | |
| 5 | +note stdout: one Omega unit (texts tchrsite, tchrhead, tchrfoot, tchrfend, tchrcss) that server/pages.om writes: | |
| 6 | 6 | note tchrhead <header class="site-head"> .. </header> of the layout, release build: {{#flag}} and |
| 7 | 7 | note {{/flag}} marks dropped (the optional data is present on interplane.io), every |
| 8 | 8 | note site-relative href or src made absolute (https://interplane.io/...), and the one link |
| 9 | -note to https://interplane.io/explore marked aria-current="true" (Forge is the section); | |
| 9 | +note to https://interplane.io/explore marked aria-current="true": that link is the forge's | |
| 10 | +note entry in the site nav whatever its label (Forge until 2026-11-19, Projects since), and | |
| 11 | +note the forge's own rule .site-head nav a[aria-current] (server/pages.om) shows it; | |
| 10 | 12 | note translate="no" attributes left out: forged adds its hints when it sends a page |
| 11 | 13 | note (server/tr.om, class brand and others), so a page in fob holds none and its size is exact |
| 12 | 14 | note tchrfoot the footer lines after <footer class="site-foot"><div class="shell"> up to the first |
| 13 | -note <p class="foot-fine"> line (the forge writes its own fine print), the same way | |
| 15 | +note <p class="foot-fine"> line (the forge writes its own fine print), the same way; since | |
| 16 | +note the 2026-11-19 layout this ends inside <div class="foot-base">, after the SI line | |
| 17 | +note tchrfend what the layout has after its fine-print line(s) up to </footer>: the </div> lines that | |
| 18 | +note close what tchrfoot left open, so the forge footer closes the way the site's does | |
| 14 | 19 | note tchrcss the site's :root line, then between the marks of server/tests/sitechrome.sh every |
| 15 | 20 | note style.css rule line that styles the header or footer (the rule below, the same one |
| 16 | 21 | note sitechrome.sh checks) inside its @-block, in the site's order |
| 22 | +note Not copied: what the layout has between </header> and <footer (main, and since 2026-11-22 the | |
| 23 | +note <div class="rope-band rope-sm foot-rope"> strand picture above the footer). The rope band is page | |
| 24 | +note decoration, neither header nor footer, and its picture is a site file the forge does not serve, so | |
| 25 | +note its rule .foot-rope is left out too although the name starts with foot-. | |
| 17 | 26 | note Chrome rule: a line that starts with a base selector (*, html, body, a, a:hover, a:active, |
| 18 | 27 | note a:focus-visible,summary:focus-visible, code,pre,.mono) and "{", or names one of the classes |
| 19 | -note site-head head-row brand site-foot foot-<a-z> si-line skip shell (not followed by a-z or -), or | |
| 20 | -note .button, .button.dark or .button.small before ":" or "{"; left out: nav.short, main p:where, | |
| 21 | -note .invite .button, .actions .button, .hop-stage (page rules), a one-line @media print rule, and | |
| 22 | -note @-blocks naming | |
| 28 | +note site-head head-inner brand site-foot foot-<a-z> si-line skip shell btn btn-primary btn-sm (not | |
| 29 | +note followed by a-z or -); left out: nav.short, .foot-rope, main p:where, .invite .button, | |
| 30 | +note .actions .button, .hop-stage (page rules), a one-line @media print rule, and @-blocks naming | |
| 23 | 31 | note prefers-reduced-motion. |
| 24 | 32 | note Refusals (stderr names the reason, stdout is empty): exit 2 input shape, 3 header or footer |
| 25 | -note not found, 4 a {{ mark other than {{#..}} or {{/..}} in them, 5 no single Forge link, 6 no :root | |
| 26 | -note first line, 7 a control byte other than a line feed, 8 fewer than 30 chrome lines, 9 output. | |
| 33 | +note not found, 4 a {{ mark other than {{#..}} or {{/..}} in them, 5 no single link to the forge | |
| 34 | +note (https://interplane.io/explore) in the header, 6 no :root first line, 7 a control byte other than | |
| 35 | +note a line feed, 8 fewer than 30 chrome lines, 9 output, 10 the footer has something other than | |
| 36 | +note </div> lines after its fine print, 11 unsupported or unbalanced stylesheet block structure. | |
| 27 | 37 | note The input and output buffers are 16 MiB each (the largest pool omc allows); the site files are |
| 28 | -note about 40 KB. A larger input is refused with exit 2, never cut. | |
| 38 | +note about 100 KB. A larger input is refused with exit 2, never cut. | |
| 29 | 39 | global cgi uchar 16777216 |
| 30 | 40 | global cgn ulong 1 |
| 31 | 41 | global cgo uchar 16777216 |
| 32 | 42 | global cgl ulong 1 |
| 33 | -note the three parts of the input: layout [0, cgp 1), style [cgp 2, cgp 3), sha [cgp 4, cgn) | |
| 43 | +note the parts of the input: layout [0, cgp 1), a 0 byte, style (cgp 1, cgp 2), a 0 byte, the commit | |
| 34 | 44 | global cgp ulong 5 |
| 35 | 45 | note the current @-block: its line (start, end) and whether it was written yet |
| 36 | 46 | global cgb ulong 3 |
| @@ -39,6 +49,9 @@ text thd "<header class=\"site-head\">" | ||
| 39 | 49 | text the "</header>" |
| 40 | 50 | text tfo "<footer class=\"site-foot\"><div class=\"shell\">" |
| 41 | 51 | text tff "<p class=\"foot-fine\">" |
| 52 | +text tfe "</footer>" | |
| 53 | +text tdivc "</div>" | |
| 54 | +text tpend "</p>" | |
| 42 | 55 | text thref "href=\"/" |
| 43 | 56 | text tsrc "src=\"/" |
| 44 | 57 | text tsite "https://interplane.io" |
| @@ -55,6 +68,7 @@ text ts1 "text tchrsite \"" | ||
| 55 | 68 | text ts2 "text tchrhead \"" |
| 56 | 69 | text ts3 "text tchrfoot \"" |
| 57 | 70 | text ts4 "text tchrcss \"" |
| 71 | +text ts5 "text tchrfend \"" | |
| 58 | 72 | text tbs1 "*{" |
| 59 | 73 | text tbs2 "html{" |
| 60 | 74 | text tbs3 "body{" |
| @@ -64,31 +78,34 @@ text tbs6 "a:active{" | ||
| 64 | 78 | text tbs7 "a:focus-visible,summary:focus-visible{" |
| 65 | 79 | text tbs8 "code,pre,.mono{" |
| 66 | 80 | text tcl1 "site-head" |
| 67 | -text tcl2 "head-row" | |
| 81 | +text tcl2 "head-inner" | |
| 68 | 82 | text tcl3 "brand" |
| 69 | 83 | text tcl4 "site-foot" |
| 70 | 84 | text tcl5 "si-line" |
| 71 | 85 | text tcl6 "skip" |
| 72 | 86 | text tcl7 "shell" |
| 73 | 87 | text tcl8 "foot-" |
| 74 | -text tbtn "button" | |
| 75 | -text tdark ".dark" | |
| 76 | -text tsmall ".small" | |
| 88 | +text tcl9 "btn" | |
| 89 | +text tcl10 "btn-primary" | |
| 90 | +text tcl11 "btn-sm" | |
| 77 | 91 | text tsk1 "nav.short" |
| 78 | 92 | text tsk2 "main p:where" |
| 79 | 93 | text tsk3 ".invite .button" |
| 80 | 94 | text tsk4 ".actions .button" |
| 81 | 95 | text tsk5 ".hop-stage " |
| 82 | 96 | text tsk6 "@media print" |
| 97 | +text tsk7 ".foot-rope" | |
| 83 | 98 | text tskin "prefers-reduced-motion" |
| 84 | 99 | text te2 "chromegen: input is not layout, NUL, style, NUL, commit (or larger than 16 MiB)\n" |
| 85 | 100 | text te3 "chromegen: the layout has no <header class=\"site-head\"> .. </header>, or no footer line <footer class=\"site-foot\"><div class=\"shell\"> followed by a <p class=\"foot-fine\"> line\n" |
| 86 | 101 | text te4 "chromegen: the site header or footer holds a {{ mark other than {{#name}} or {{/name}}; teach server/chromegen.om what the release build does with it\n" |
| 87 | -text te5 "chromegen: the site header does not hold exactly one <a href=\"https://interplane.io/explore\"> (the Forge entry)\n" | |
| 102 | +text te5 "chromegen: the site header does not hold exactly one <a href=\"https://interplane.io/explore\"> (the forge's entry in the site nav, marked current on forge pages)\n" | |
| 88 | 103 | text te6 "chromegen: the first line of public/style.css is not the :root token line\n" |
| 89 | 104 | text te7 "chromegen: a control byte other than a line feed in the copied header, footer or stylesheet lines\n" |
| 90 | 105 | text te8 "chromegen: fewer than 30 chrome rule lines found in public/style.css; the rule above no longer fits the site\n" |
| 91 | 106 | text te9 "chromegen: the output did not fit or could not be written\n" |
| 107 | +text te10 "chromegen: the footer has something other than </div> lines between its fine print and </footer>; the forge cannot close the footer the way the site does\n" | |
| 108 | +text te11 "chromegen: unsupported or unbalanced stylesheet block structure\n" | |
| 92 | 109 | fn cgdie code ulong t view uchar * to void |
| 93 | 110 | w = write 2 t 0 len t |
| 94 | 111 | exit int code |
| @@ -296,32 +313,6 @@ ret true | ||
| 296 | 313 | end |
| 297 | 314 | ret ne get cgi q 45 |
| 298 | 315 | end |
| 299 | -fn cgbtn p ulong e ulong to bool | |
| 300 | -if not cgat p e tbtn | |
| 301 | -ret false | |
| 302 | -end | |
| 303 | -q = add p len tbtn | |
| 304 | -if cgat q e tdark | |
| 305 | -q = add q len tdark | |
| 306 | -else | |
| 307 | -if cgat q e tsmall | |
| 308 | -q = add q len tsmall | |
| 309 | -end | |
| 310 | -end | |
| 311 | -if ge q e | |
| 312 | -ret false | |
| 313 | -end | |
| 314 | -c = get cgi q | |
| 315 | -if or eq c 58 eq c 123 | |
| 316 | -ret true | |
| 317 | -end | |
| 318 | -q = add p len tbtn | |
| 319 | -if ge q e | |
| 320 | -ret false | |
| 321 | -end | |
| 322 | -c = get cgi q | |
| 323 | -ret or eq c 58 eq c 123 | |
| 324 | -end | |
| 325 | 316 | fn cgbase s ulong e ulong to bool |
| 326 | 317 | if or cgat s e tbs1 or cgat s e tbs2 cgat s e tbs3 |
| 327 | 318 | ret true |
| @@ -339,7 +330,7 @@ end | ||
| 339 | 330 | if or cgat s e tsk2 or cgat s e tsk3 or cgat s e tsk4 cgat s e tsk5 |
| 340 | 331 | ret false |
| 341 | 332 | end |
| 342 | -if cgat s e tsk6 | |
| 333 | +if or cgat s e tsk6 cgat s e tsk7 | |
| 343 | 334 | ret false |
| 344 | 335 | end |
| 345 | 336 | if cgbase s e |
| @@ -355,7 +346,7 @@ end | ||
| 355 | 346 | if or cgcls q e tcl5 or cgcls q e tcl6 or cgcls q e tcl7 cgfoot q e |
| 356 | 347 | ret true |
| 357 | 348 | end |
| 358 | -if cgbtn q e | |
| 349 | +if or cgcls q e tcl9 or cgcls q e tcl10 cgcls q e tcl11 | |
| 359 | 350 | ret true |
| 360 | 351 | end |
| 361 | 352 | end |
| @@ -385,6 +376,7 @@ cgline a x | ||
| 385 | 376 | for i ulong len tm1 |
| 386 | 377 | cge get tm1 i |
| 387 | 378 | end |
| 379 | +note copied rules stay in their original single-level @-block | |
| 388 | 380 | put cgcur 0 0 |
| 389 | 381 | put cgb 2 0 |
| 390 | 382 | n = ulong 0 |
| @@ -398,12 +390,18 @@ end | ||
| 398 | 390 | l = add l 1 |
| 399 | 391 | end |
| 400 | 392 | if cgopen s l |
| 393 | +if eq get cgcur 0 1 | |
| 394 | +cgdie 11 te11 | |
| 395 | +end | |
| 401 | 396 | put cgb 0 s |
| 402 | 397 | put cgb 1 l |
| 403 | 398 | put cgb 2 0 |
| 404 | 399 | put cgcur 0 1 |
| 405 | 400 | else |
| 406 | 401 | if cgclose s l |
| 402 | +if eq get cgcur 0 0 | |
| 403 | +cgdie 11 te11 | |
| 404 | +end | |
| 407 | 405 | if and eq get cgcur 0 1 eq get cgb 2 1 |
| 408 | 406 | cgline s l |
| 409 | 407 | end |
| @@ -428,6 +426,9 @@ end | ||
| 428 | 426 | end |
| 429 | 427 | s = add l 1 |
| 430 | 428 | end |
| 429 | +if eq get cgcur 0 1 | |
| 430 | +cgdie 11 te11 | |
| 431 | +end | |
| 431 | 432 | for i ulong len tm2 |
| 432 | 433 | cge get tm2 i |
| 433 | 434 | end |
| @@ -558,4 +559,49 @@ end | ||
| 558 | 559 | cgt ts3 |
| 559 | 560 | m = cgpart fa f1 false |
| 560 | 561 | cgt tqe |
| 562 | +cgfend f1 lz | |
| 563 | +end | |
| 564 | +note The site's closing div lines belong to its footer structure, not to the forge's fine print. | |
| 565 | +fn cgfend a ulong e ulong to void | |
| 566 | +z = cgfind a e tfe | |
| 567 | +if eq z e | |
| 568 | +cgdie 3 te3 | |
| 569 | +end | |
| 570 | +p = a | |
| 571 | +while lt p z bound 16777216 | |
| 572 | +if not cgat p z tff | |
| 573 | +break | |
| 574 | +end | |
| 575 | +p = cgfind p z tpend | |
| 576 | +if eq p z | |
| 577 | +cgdie 10 te10 | |
| 578 | +end | |
| 579 | +p = add p len tpend | |
| 580 | +while lt p z bound 16777216 | |
| 581 | +if ne get cgi p 10 | |
| 582 | +break | |
| 583 | +end | |
| 584 | +p = add p 1 | |
| 585 | +end | |
| 586 | +end | |
| 587 | +cgt ts5 | |
| 588 | +while lt p z bound 16777216 | |
| 589 | +if cgat p z tdivc | |
| 590 | +for i ulong len tdivc | |
| 591 | +cge get tdivc i | |
| 592 | +end | |
| 593 | +p = add p len tdivc | |
| 594 | +else | |
| 595 | +if ne get cgi p 10 | |
| 596 | +cgdie 10 te10 | |
| 597 | +end | |
| 598 | +cge 10 | |
| 599 | +p = add p 1 | |
| 600 | +end | |
| 601 | +end | |
| 602 | +for i ulong len tfe | |
| 603 | +cge get tfe i | |
| 604 | +end | |
| 605 | +cge 10 | |
| 606 | +cgt tqe | |
| 561 | 607 | end |
server/pages.om
| @@ -21,9 +21,9 @@ text tfhal4 "events.json" | ||
| 21 | 21 | note ---- the site chrome: the interplane.io header and footer and their stylesheet lines are not kept |
| 22 | 22 | note here. server/chromegen.om makes them at every build from the site's own source (canonical main of |
| 23 | 23 | note rad:z399yKvnXcBQNkKoq86iBDgTvQ5QV, content/_layout.html and public/style.css) into the generated |
| 24 | -note unit .build/chrome.om (run.sh units): texts tchrhead, tchrfoot, tchrcss and the site commit | |
| 25 | -note tchrsite. Every site link is absolute, so the same bytes serve the bases / and /forge/; Forge is | |
| 26 | -note the current section. server/tests/sitechrome.sh checks the result against the site source. | |
| 24 | +note unit .build/chrome.om (run.sh units): texts tchrhead, tchrfoot, tchrfend, tchrcss and the site commit | |
| 25 | +note tchrsite. Every site link is absolute, so the same bytes serve the bases / and /forge/; the site's | |
| 26 | +note Projects entry marks this section current. server/tests/sitechrome.sh checks against the source. | |
| 27 | 27 | note the forge's own controls, a second row under the site header |
| 28 | 28 | text tfh4 "<div class=\"forge-row\"><div class=\"shell forge-bar\"><nav class=\"forge-nav\" aria-label=\"Forge\"><a href=\"" |
| 29 | 29 | text tfexp "explore" |
| @@ -50,7 +50,8 @@ text tfstars "stars" | ||
| 50 | 50 | text tff4 "\">Stars</a> · <a href=\"https://interplane.io/translate/\">Read in your language</a> · <a href=\"" |
| 51 | 51 | text tff4q "?format=text" |
| 52 | 52 | text tff4a "&format=text" |
| 53 | -text tff4b "\" rel=\"alternate\" type=\"text/plain\">This page as plain text</a></p>\n<p class=\"foot-fine\">Translation is done by your own browser or tool, on your machine. This forge translates nothing and keeps no translated copies; the English page is the reference, and commands, fingerprints and file names are marked to stay exactly as written.</p>\n</div></footer>\n</body></html>\n" | |
| 53 | +text tff4b "\" rel=\"alternate\" type=\"text/plain\">This page as plain text</a></p>\n<p class=\"foot-fine\">Translation is done by your own browser or tool, on your machine. This forge translates nothing and keeps no translated copies; the English page is the reference, and commands, fingerprints and file names are marked to stay exactly as written.</p>\n" | |
| 54 | +text tffend "</body></html>\n" | |
| 54 | 55 | text tfq "q" |
| 55 | 56 | note ---- error pages |
| 56 | 57 | text tfe1 "<section class=\"err\"><h1>" |
| @@ -381,12 +382,14 @@ else | ||
| 381 | 382 | fput tff4q |
| 382 | 383 | end |
| 383 | 384 | fput tff4b |
| 385 | +fput tchrfend | |
| 386 | +fput tffend | |
| 384 | 387 | end |
| 385 | 388 | note ---- the stylesheet (served at <base>assets/forge.css) |
| 386 | 389 | note tchrcss (generated, see the site chrome note above): the site's :root token line, then between |
| 387 | 390 | note the two marks the site's header and footer rule lines. tfcssv: the forge's own names for tokens. |
| 388 | 391 | text tfcssv ":root{--bg:var(--paper);--fg:var(--ink);--mut:var(--muted);--acc:var(--orange-ink);--box:var(--white)}\n" |
| 389 | -note tfcss2: the forge's own rules on the site chrome: Forge marked current, the forge row, main | |
| 392 | +note tfcss2: the forge's own rules on the site chrome: Projects marked current, the forge row, main | |
| 390 | 393 | text tfcss2 ".site-head nav a[aria-current]{color:var(--ink);text-decoration-color:currentColor}\n:where(.site-foot) p{margin:0;color:var(--muted)}\n.forge-row{border-bottom:1px solid var(--line)}\n.forge-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;min-height:60px;padding-top:8px;padding-bottom:8px}\n.forge-nav{display:flex;gap:24px}.forge-nav a{display:inline-flex;align-items:center;min-height:44px;font-size:15px;font-weight:600;text-decoration:underline 2px transparent;text-underline-offset:10px}.forge-nav a:hover{text-decoration-color:currentColor;text-underline-offset:5px}\n.search{display:flex;gap:6px;flex:1;min-width:200px;max-width:460px}\n.search input{flex:1;min-width:0;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--r2);background:var(--white);color:var(--ink);font:inherit;font-size:15px}\nbutton{padding:5px 10px;border:1px solid var(--line);border-radius:var(--r1);background:var(--white);color:var(--ink);cursor:pointer;font:inherit}button:hover{border-color:var(--ink)}\n.search button,.who button{min-height:44px;padding:8px 16px;border-radius:var(--r2);font-size:15px;font-weight:600}\n.who{margin-left:auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;font-size:15px;font-weight:600}.inline{display:inline}\nmain{max-width:1200px;margin:0 auto;padding:var(--s5) 40px var(--s6);font-size:16px;line-height:1.55}\nmain a{color:var(--acc);text-decoration:none}main a:hover{text-decoration:underline}\nmain h1,main h2,main h3{font-weight:600;letter-spacing:-.03em;line-height:1.2}main h1{font-size:clamp(28px,3.4vw,40px);margin:4px 0 12px}\ncode,pre,.mono{font-size:13px}pre{background:var(--box);border:1px solid var(--line);padding:12px;overflow:auto;border-radius:var(--r2)}\ntable.md{display:block;max-width:100%;overflow-x:auto}\n@media(max-width:1000px){main{padding-left:28px;padding-right:28px}}\n@media(max-width:760px){main{padding:16px 20px var(--s5)}.forge-bar{gap:4px 20px}.search{order:3;flex-basis:100%;max-width:none}.readme{padding:12px 14px}}\n" |
| 391 | 394 | text tfcss3 ".muted,.meta{color:var(--mut)}.meta{font-size:13px;margin:2px 0}\n.repos{list-style:none;padding:0;margin:0}.repos li{padding:14px 0;border-bottom:1px solid var(--line)}\n.rname{font-size:17px;font-weight:600}.desc{margin:4px 0}.stars{float:right;color:var(--mut)}\n.rhead h1{font-size:22px;margin:0 0 4px;font-weight:500}.rhead h1 b{font-weight:700}\n.tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);margin:14px 0 18px}\n.tabs a{padding:8px 12px;border-bottom:2px solid transparent;color:var(--fg)}.tabs a.on{border-bottom-color:var(--acc);font-weight:600}\n.clone{background:var(--box);border:1px solid var(--line);border-radius:6px;padding:6px 10px;display:inline-block}\n" |
| 392 | 395 | text tfcss4 ".bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}\ntable{border-collapse:collapse;width:100%}td,th{padding:6px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}\n.err h1{font-size:26px}.box{border:1px solid var(--line);border-radius:6px;padding:12px 16px;margin:12px 0}\n.ok{color:var(--ok)}.bad{color:var(--bad)}.hit{font-family:ui-monospace,Menlo,monospace;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}\ninput[type=text],textarea{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--fg);font:inherit}\n@media (max-width:640px){.stars{float:none;display:block}.tabs a{padding:6px 8px}}\n" |
| @@ -639,9 +642,13 @@ ftab 0 on tfempty tfabout | ||
| 639 | 642 | fput tfahref |
| 640 | 643 | fputrl |
| 641 | 644 | fput tfptree |
| 645 | +if ne get fpin 0 0 | |
| 646 | +fputpin | |
| 647 | +else | |
| 642 | 648 | if ok |
| 643 | 649 | fputbr i |
| 644 | 650 | end |
| 651 | +end | |
| 645 | 652 | if eq on 10 |
| 646 | 653 | fput tfton |
| 647 | 654 | else |
server/tests/sitechrome.sh
| @@ -12,10 +12,10 @@ | ||
| 12 | 12 | # a {{^flag}} block refuses the run. Site-relative links are resolved against https://interplane.io. |
| 13 | 13 | # Checks, under both bases (/ and /forge/) on explore, a project page, its patches and issues, search, |
| 14 | 14 | # stars, login and a 404: |
| 15 | -# 1. one site header, one Main nav, one footer; the brand goes to https://interplane.io/; Forge is | |
| 16 | -# the current entry; the page names no script and no inline style | |
| 17 | -# 2. Main nav, header button, footer brand, footer columns and the SI line: labels and absolute | |
| 18 | -# targets equal the reference | |
| 15 | +# 1. one site header, one Main nav, one footer; the brand goes to https://interplane.io/; Projects is | |
| 16 | +# the current entry; the page names no script and no inline style or decorative rope band | |
| 17 | +# 2. Main nav, header button, brand, all three footer columns and the SI line: markup, labels and | |
| 18 | +# absolute targets equal the reference; the footer's div structure is balanced | |
| 19 | 19 | # 3. the forge row keeps its controls on the base: Explore, Stars, the entries the composed slices |
| 20 | 20 | # add (Open builds; Research on base / only), the search form, Sign in |
| 21 | 21 | # and on <base>assets/forge.css: |
| @@ -27,7 +27,7 @@ | ||
| 27 | 27 | # 6. the Content-Security-Policy of every page is the one forged sent before this change |
| 28 | 28 | # Negative controls: a forged built with one nav label changed fails 2; reference copies with the |
| 29 | 29 | # Forge entry removed, a footer target changed, --paper changed and one copied CSS line changed fail |
| 30 | -# 2, 2, 5 and 4; a forge stylesheet without the 480 px nav rule, a reference with one new header rule, | |
| 30 | +# 2, 2, 5 and 4; a forge stylesheet without the 380 px nav rule, a reference with one new header rule, | |
| 31 | 31 | # a forge stylesheet with one copied rule moved out of its @media block and a forge stylesheet without |
| 32 | 32 | # the footer column heading rule (its text-transform must not exempt it) fail 4; and every line of the |
| 33 | 33 | # copied block, removed alone from forge.css (a sweep), fails 4. |
| @@ -101,24 +101,26 @@ parts() { | ||
| 101 | 101 | h=$(cut1 "$page" '<header class="site-head">' '</header>') || return 1 |
| 102 | 102 | f=$(cut1 "$page" '<footer class="site-foot">' '</footer>') || return 1 |
| 103 | 103 | links "$(cut1 "$h" '<nav aria-label="Main">' '</nav>')" > "$o.nav" || return 1 |
| 104 | - links "$(cut1 "$h" '<a class="button' '</a>')" > "$o.button" || return 1 | |
| 104 | + links "$(cut1 "$h" '<a class="btn btn-primary btn-sm"' '</a>')" > "$o.button" || return 1 | |
| 105 | 105 | absol "$(cut1 "$h" '<a class="brand"' '</a>')" > "$o.brand" || return 1 |
| 106 | - absol "$(cut1 "$f" '<div class="foot-brand">' '</div>')" > "$o.footbrand" || return 1 | |
| 107 | - { cut1 "$f" '<nav class="foot-cols"' '</nav>' | sed -E 's|<p class="foot-h">([^<]*)</p>|\n# \1\n|g'; } > "$o.cols.raw" || return 1 | |
| 108 | - { while IFS= read -r l; do case "$l" in '# '*) printf '%s\n' "$l";; *) links "$l";; esac; done < "$o.cols.raw"; } > "$o.cols" | |
| 106 | + # The old foot-brand/nav.foot-cols became three div.foot-col inside div.foot-grid. | |
| 107 | + # Compare the entire grid (not just its links): headings, order, wrappers and attributes matter. | |
| 108 | + absol "$(cut1 "$f" '<div class="foot-grid">' '<div class="foot-base">')" > "$o.grid" || return 1 | |
| 109 | + sed -E 's|<p class="foot-h">([^<]*)</p>|\n# \1\n|g' "$o.grid" > "$o.cols.raw" | |
| 110 | + { while IFS= read -r l; do case "$l" in '# '*) printf '%s\n' "$l";; *) links "$l" || true;; esac; done < "$o.cols.raw"; } > "$o.cols" | |
| 109 | 111 | absol "$(cut1 "$f" '<p class="si-line">' '</p>')" > "$o.si" || return 1 |
| 110 | 112 | } |
| 111 | 113 | release "$T/ref/layout.html" > "$T/ref/release.html" |
| 112 | 114 | parts "$(cat "$T/ref/release.html")" "$T/ref/p" || die "reference layout: header or footer part not found" |
| 113 | -# the forge marks Forge current; the reference has it as a plain entry | |
| 114 | -grep -qx $'Forge\thttps://interplane.io/explore' "$T/ref/p.nav" || echo "NOTE reference Main nav has no Forge entry to https://interplane.io/explore" | |
| 115 | +# Projects is the forge's entry; its target, not the former label Forge, determines current marking. | |
| 116 | +grep -qx $'Projects\thttps://interplane.io/explore' "$T/ref/p.nav" || die "reference Main nav has no Projects entry to https://interplane.io/explore" | |
| 115 | 117 | [ "$(wc -l < "$T/ref/p.nav")" -ge 5 ] && [ "$(grep -c '^# ' "$T/ref/p.cols")" = 3 ] || die "reference parts look wrong: $(wc -l < "$T/ref/p.nav") nav entries" |
| 116 | 118 | ok "reference parts read: $(wc -l < "$T/ref/p.nav") Main nav entries, $(grep -vc '^# ' "$T/ref/p.cols") footer links in 3 columns" |
| 117 | 119 | |
| 118 | 120 | # cmpparts PREFIX WHAT: compare a page's parts with the reference; prints the first difference |
| 119 | 121 | cmpparts() { |
| 120 | 122 | local p=$1 x |
| 121 | - for x in nav button brand footbrand cols si; do | |
| 123 | + for x in nav button brand grid cols si; do | |
| 122 | 124 | if ! cmp -s "$T/ref/p.$x" "$p.$x"; then echo "$x differs:"; diff "$T/ref/p.$x" "$p.$x" | head -6; return 1; fi |
| 123 | 125 | done |
| 124 | 126 | } |
| @@ -184,9 +186,8 @@ get() { | ||
| 184 | 186 | } |
| 185 | 187 | hdr() { grep -i "^$1:" "$T/hdr" | head -1 | tr -d '\r' | cut -d' ' -f2-; } |
| 186 | 188 | PAGES="explore:200 drakestapleton/chromefixture:200 drakestapleton/chromefixture/patches:200 drakestapleton/chromefixture/issues:200 search?q=chrome:200 stars:303 login:200 no-such-page-xyz:404" |
| 187 | -# the store-reading build composes collab/ out: its patch and issue pages are the 501 page, which carries | |
| 188 | -# the same chrome | |
| 189 | -[ "$SV" = 1 ] && PAGES=${PAGES//patches:200/patches:501} && PAGES=${PAGES//issues:200/issues:501} | |
| 189 | +# Both builds serve patch and issue lists: the store build uses patch/ and collab/native/. | |
| 190 | +# Keep the same 200 + chrome checks there, rather than the old pre-native 501 expectations. | |
| 190 | 191 | # pagechecks BASE: checks 1 to 3 and 6 on every page; returns 1 with the reason on the first failure |
| 191 | 192 | pagechecks() { |
| 192 | 193 | local b=$1 pc page want code body cur |
| @@ -208,8 +209,12 @@ pagechecks() { | ||
| 208 | 209 | parts "$body" "$T/pg" || { echo "$b$page: a compared part was not found"; return 1; } |
| 209 | 210 | cmpparts "$T/pg" || { echo " on $b$page"; return 1; } |
| 210 | 211 | cur=$(cut1 "$body" '<nav aria-label="Main">' '</nav>' | grep -o '<a [^>]*aria-current="[a-z]*"[^>]*>[^<]*</a>' || true) |
| 211 | - [ "$cur" = '<a href="https://interplane.io/explore" aria-current="true">Forge</a>' ] || { echo "$b$page: current entry is '$cur'"; return 1; } | |
| 212 | + [ "$cur" = '<a href="https://interplane.io/explore" aria-current="true">Projects</a>' ] || { echo "$b$page: current entry is '$cur'"; return 1; } | |
| 212 | 213 | grep -qF '<a class="brand" href="https://interplane.io/" aria-label="Interplane home">' <<< "$body" || { echo "$b$page: brand target"; return 1; } |
| 214 | + if grep -qE 'rope-band|foot-rope|strand-thread|\{\{' <<< "$body"; then echo "$b$page: page decoration or unresolved layout mark copied"; return 1; fi | |
| 215 | + cut1 "$body" '<footer class="site-foot">' '</footer>' | sed 's/></>\n</g' | | |
| 216 | + awk '/^<div([ >])/{n++} /^<\/div>/{n--; if(n<0) bad=1} END{exit (bad || n)}' || | |
| 217 | + { echo "$b$page: unbalanced footer divs"; return 1; } | |
| 213 | 218 | # slice entries after Stars: Open builds on every base; Research on base / only; Bring your build |
| 214 | 219 | # only while the salvage store is on, and it is off in this build; Feed (door/ evnav) on every base |
| 215 | 220 | # (the store-reading build composes open/ out: no Open builds entry there) |
| @@ -222,16 +227,16 @@ pagechecks() { | ||
| 222 | 227 | } |
| 223 | 228 | # ctxlines FILE: "<enclosing @-block line or ->TAB<rule line>" for every rule line of a stylesheet |
| 224 | 229 | ctxlines() { awk '/^@[^}]*\{$/{c=$0; next} /^\}+$/{c=""; next} {print (c == "" ? "-" : c) "\t" $0}' "$1"; } |
| 225 | -# The reference rules the chrome needs: a header or footer class, or the plain, dark or small button. | |
| 230 | +# The reference rules the chrome needs: a header/footer class or the btn/primary/small header button. | |
| 226 | 231 | # CHROME_SKIP: the rules left out on purpose (print, hopbot.org's nav.short, buttons in page sections, |
| 227 | 232 | # the Hop page's night hero, whose .hop-stage .shell rule (site 1daf702) only positions its own rings, |
| 228 | -# the reading measure of main p), matched on the rule; CHROME_SKIP_IN: the blocks left out (motion), | |
| 233 | +# the reading measure of main p, the decorative foot-rope), matched on the rule; CHROME_SKIP_IN: motion | |
| 229 | 234 | # matched on the enclosing @-block, so a property name such as text-transform exempts nothing. |
| 230 | 235 | # A new or changed site rule outside both must be copied. |
| 231 | 236 | # The page-wide base rules the chrome stands on (box model, body palette and type, link look, code |
| 232 | 237 | # face) are named exactly by their selector; a header or footer class is matched anywhere in the rule. |
| 233 | -export CHROME_SEL='^(\*|html|body|a|a:hover|a:active|a:focus-visible,summary:focus-visible|code,pre,\.mono)\{|\.(site-head|head-row|brand|site-foot|foot-[a-z]+|si-line|skip|shell)([^a-z-]|$)|\.button(\.(dark|small))?[:{]' | |
| 234 | -export CHROME_SKIP='^@media print|nav\.short|^main p:where|^\.(invite|actions) \.button|^\.hop-stage ' | |
| 238 | +export CHROME_SEL='^(\*|html|body|a|a:hover|a:active|a:focus-visible,summary:focus-visible|code,pre,\.mono)\{|\.(site-head|head-inner|brand|site-foot|foot-[a-z]+|si-line|skip|shell|btn|btn-primary|btn-sm)([^a-z-]|$)' | |
| 239 | +export CHROME_SKIP='^@media print|nav\.short|^main p:where|^\.(invite|actions) \.button|^\.hop-stage |^\.foot-rope' | |
| 235 | 240 | export CHROME_SKIP_IN='prefers-reduced-motion' |
| 236 | 241 | # csschecks STYLE: checks 4 and 5 of the stylesheet in $T/css against the reference STYLE |
| 237 | 242 | csschecks() { |
| @@ -272,7 +277,7 @@ build new | ||
| 272 | 277 | start new |
| 273 | 278 | for base in / /forge/; do |
| 274 | 279 | r=$(pagechecks "$base") || die "base $base: $r" |
| 275 | - ok "base $base: explore, project, patches, issues, search, stars, login, 404: one site header and footer equal to the reference, Forge current, brand to https://interplane.io/, forge row on the base, CSP unchanged" | |
| 280 | + ok "base $base: explore, project, patches, issues, search, stars, login, 404: one site header and footer equal to the reference, Projects current, brand to https://interplane.io/, forge row on the base, CSP unchanged" | |
| 276 | 281 | code=$(get assets/forge.css "$base"); [ "$code" = 200 ] || die "${base}assets/forge.css HTTP $code" |
| 277 | 282 | cp "$T/body" "$T/css" |
| 278 | 283 | r=$(csschecks "$T/ref/style.css") || die "stylesheet: $r" |
| @@ -291,7 +296,7 @@ kill -0 "$pid" || die "server died" | ||
| 291 | 296 | stop |
| 292 | 297 | |
| 293 | 298 | # ---- negative controls |
| 294 | -build lab 's|>Mission</a><a href=\\"https://interplane.io/explore\\"|>Missions</a><a href=\\"https://interplane.io/explore\\"|' | |
| 299 | +build lab 's|>Mission</a>|>Missions</a>|' | |
| 295 | 300 | grep -q '>Missions</a>' "$T/lab.om" || die "control lab: the label mutation did not apply" |
| 296 | 301 | start lab |
| 297 | 302 | if r=$(pagechecks /); then die "control: a forged with the nav label Missions passed"; fi |
| @@ -307,7 +312,7 @@ mutant() { | ||
| 307 | 312 | sed -i -e "$3" "$T/n-$1/$2" |
| 308 | 313 | if cmp -s "$T/ref/$2" "$T/n-$1/$2"; then die "control $1: the mutation did not apply"; fi |
| 309 | 314 | } |
| 310 | -mutant noforge layout.html 's|<a href="https://interplane.io/explore">Forge</a>||' | |
| 315 | +mutant noforge layout.html 's|<a href="https://interplane.io/explore">Projects</a>||' | |
| 311 | 316 | parts "$(release "$T/n-noforge/layout.html")" "$T/n-noforge/p" || die "control noforge: parts" |
| 312 | 317 | if cmp -s "$T/n-noforge/p.nav" "$T/pg.nav"; then die "control noforge: a reference without Forge compares equal"; fi |
| 313 | 318 | ok "NEG reference without the Forge entry: Main nav differs" |
| @@ -321,15 +326,17 @@ mutant paper style.css '1s/--paper:[^;]*/--paper:#ff0000/' | ||
| 321 | 326 | if r=$(csschecks "$T/n-paper/style.css"); then die "control paper: a changed --paper passed"; fi |
| 322 | 327 | grep -q 'token --paper' <<< "$r" || die "control paper failed for another reason: $r" |
| 323 | 328 | ok "NEG reference with --paper changed: refused ($r)" |
| 324 | -mutant line style.css 's/^\.head-row{display:flex;align-items:center;gap:32px;min-height:92px}$/.head-row{display:flex;align-items:center;gap:30px;min-height:92px}/' | |
| 329 | +mutant line style.css 's/^\.head-inner,\.head-row{display:flex;align-items:center;gap:24px;min-height:64px}$/.head-inner,.head-row{display:flex;align-items:center;gap:30px;min-height:64px}/' | |
| 325 | 330 | if r=$(csschecks "$T/n-line/style.css"); then die "control line: a changed copied line passed"; fi |
| 326 | 331 | grep -q 'copied line' <<< "$r" || die "control line failed for another reason: $r" |
| 327 | 332 | ok "NEG reference with one copied line changed: refused" |
| 328 | -grep -qxF '.site-head nav:not(.short){display:grid;grid-template-columns:repeat(3,auto);gap:0 8px;justify-content:space-between}' "$T/css" || die "control omit480: the rule is not in forge.css" | |
| 329 | -grep -vxF '.site-head nav:not(.short){display:grid;grid-template-columns:repeat(3,auto);gap:0 8px;justify-content:space-between}' "$T/body" > "$T/css" | |
| 330 | -if r=$(csschecks "$T/ref/style.css"); then die "control omit480: a forge.css without the 480 px nav rule passed"; fi | |
| 331 | -grep -q 'rule not copied' <<< "$r" || die "control omit480 failed for another reason: $r" | |
| 332 | -ok "NEG forge stylesheet without the 480 px nav rule: refused" | |
| 333 | +# The old 480 px grid-nav rule became the 380 px nav-font rule: still a mobile-only rule. | |
| 334 | +NAVSM='.site-head nav a{font-size:13px}' | |
| 335 | +grep -qxF "$NAVSM" "$T/css" || die "control omit380: the rule is not in forge.css" | |
| 336 | +grep -vxF "$NAVSM" "$T/body" > "$T/css" | |
| 337 | +if r=$(csschecks "$T/ref/style.css"); then die "control omit380: a forge.css without the 380 px nav rule passed"; fi | |
| 338 | +grep -q 'rule not copied' <<< "$r" || die "control omit380 failed for another reason: $r" | |
| 339 | +ok "NEG forge stylesheet without the 380 px nav rule: refused" | |
| 333 | 340 | cp "$T/body" "$T/css" |
| 334 | 341 | mutant addrule style.css 's/^\.site-head{[^}]*}$/&\n.site-head{position:relative}/' |
| 335 | 342 | if r=$(csschecks "$T/n-addrule/style.css"); then die "control addrule: a reference with a new header rule passed"; fi |
| @@ -341,7 +348,7 @@ if r=$(csschecks "$T/ref/style.css"); then die "control moved: rules moved out o | ||
| 341 | 348 | grep -qE "another block|not closed one by one" <<< "$r" || die "control moved failed for another reason: $r" |
| 342 | 349 | ok "NEG forge stylesheet with the 380 px rules out of their block: refused" |
| 343 | 350 | cp "$T/body" "$T/css" |
| 344 | -FOOTH='.foot-cols .foot-h{margin:0 0 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}' | |
| 351 | +FOOTH='.foot-col .foot-h,.foot-cols .foot-h{margin:0 0 10px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;font-size:12px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}' | |
| 345 | 352 | grep -qxF "$FOOTH" "$T/css" || die "control omitfooth: the rule is not in forge.css" |
| 346 | 353 | grep -vxF "$FOOTH" "$T/body" > "$T/css" |
| 347 | 354 | if r=$(csschecks "$T/ref/style.css"); then die "control omitfooth: a forge.css without the footer column heading rule passed"; fi |
| @@ -375,7 +382,7 @@ cmp -s "$T/ref/style.css" "$T/follow/public/style.css" && die "follow: the style | ||
| 375 | 382 | FORGE_SITE_SRC=$T/follow build follow |
| 376 | 383 | start follow |
| 377 | 384 | code=$(get explore /); [ "$code" = 200 ] || die "follow: explore HTTP $code" |
| 378 | -grep -qF '>Missions</a><a href="https://interplane.io/explore" aria-current="true">Forge</a>' "$T/body" || die "follow: the changed site label is not on the page" | |
| 385 | +grep -qF '>Missions</a>' "$T/body" && grep -qF '<a href="https://interplane.io/explore" aria-current="true">Projects</a>' "$T/body" || die "follow: the changed site label or current Projects entry is not on the page" | |
| 379 | 386 | code=$(get assets/forge.css /); [ "$code" = 200 ] || die "follow: forge.css HTTP $code" |
| 380 | 387 | cp "$T/body" "$T/css" |
| 381 | 388 | grep -qxF '.site-head{position:relative}' "$T/css" || die "follow: the new site header rule is not in forge.css" |
| @@ -393,6 +400,18 @@ sed 's|{{#receipts}}|{{^receipts}}|' "$T/ref/layout.html" > "$T/broken/content/_ | ||
| 393 | 400 | rc=0; FORGE_SITE_SRC=$T/broken ./run.sh chrome > "$T/broken.out" 2> "$T/broken.err" || rc=$? |
| 394 | 401 | [ "$rc" != 0 ] && grep -q 'chromegen: the site header or footer holds a {{ mark' "$T/broken.err" || die "broken mark: run.sh chrome rc $rc, $(head -c 300 "$T/broken.err")" |
| 395 | 402 | ok "NEG a {{^flag}} mark in the site header: ./run.sh chrome stops (rc $rc) and names why" |
| 403 | +# New layout hazards: a changed footer container must not leave the forge's footer unclosed, and | |
| 404 | +# a missing CSS block terminator must not silently flatten the following responsive rules. | |
| 405 | +cp "$T/ref/layout.html" "$T/broken/content/_layout.html" | |
| 406 | +sed 's|</div></footer>|<aside>changed</aside></div></footer>|' "$T/ref/layout.html" > "$T/broken/content/_layout.html" | |
| 407 | +rc=0; FORGE_SITE_SRC=$T/broken ./run.sh chrome > "$T/broken.out" 2> "$T/broken.err" || rc=$? | |
| 408 | +[ "$rc" != 0 ] && grep -q 'chromegen: the footer has something other than </div>' "$T/broken.err" || die "broken footer tail: rc $rc" | |
| 409 | +ok "NEG unsupported footer tail stops chrome generation with its reason" | |
| 410 | +cp "$T/ref/layout.html" "$T/broken/content/_layout.html" | |
| 411 | +awk '!lost && /^}$/ {lost=1; next} {print}' "$T/ref/style.css" > "$T/broken/public/style.css" | |
| 412 | +rc=0; FORGE_SITE_SRC=$T/broken ./run.sh chrome > "$T/broken.out" 2> "$T/broken.err" || rc=$? | |
| 413 | +[ "$rc" != 0 ] && grep -q 'chromegen: unsupported or unbalanced stylesheet block' "$T/broken.err" || die "broken CSS block: rc $rc" | |
| 414 | +ok "NEG missing CSS block terminator stops chrome generation with its reason" | |
| 396 | 415 | ./run.sh chrome > /dev/null || die "run.sh chrome on the real site failed after the controls" |
| 397 | 416 | sha256sum "$OMC" "$T/new.om" "$T/new.bin" "$T/lab.bin" |
| 398 | 417 | echo "sitechrome.sh: PASS $pass (reference $REF)" |
server/util.om
| @@ -127,6 +127,11 @@ note fsrt being the store root with its final "/". 0: <tfstore><RID>, Radicle st | ||
| 127 | 127 | global fsrcst ulong 1 |
| 128 | 128 | global fsrt uchar 4096 |
| 129 | 129 | global fsrtl ulong 1 |
| 130 | +note fpin: the commit a repository page is pinned to, 40 lower-case hex, or fpin[0] = 0 for none. | |
| 131 | +note browse (brpinhd) sets it around frepohd on the repo home and on /tree/ pages, so the Files tab | |
| 132 | +note and the clone panel (store/clone.om) name the commit the page shows, not a branch that may move | |
| 133 | +note between the page and the download. fputpin writes it. | |
| 134 | +global fpin uchar 40 | |
| 130 | 135 | text tfsprj "projects/" |
| 131 | 136 | text tfsrg "/repo.git" |
| 132 | 137 | text tfstore "/home/drakestapleton/.radicle/storage/" |
| @@ -221,6 +226,11 @@ for i ulong get frepol 0 bound 128 | ||
| 221 | 226 | fescc get frepo i |
| 222 | 227 | end |
| 223 | 228 | end |
| 229 | +fn fputpin to void | |
| 230 | +for i ulong 40 | |
| 231 | +fputc get fpin i | |
| 232 | +end | |
| 233 | +end | |
| 224 | 234 | fn fputrepo to void |
| 225 | 235 | fputown |
| 226 | 236 | fputc 47 |
store/clone.om
| @@ -1,19 +1,22 @@ | ||
| 1 | 1 | note store/clone.om: the clone panel of the store-reading build, composed after dl/dl.om in place of |
| 2 | 2 | note dl/dlclone.om (run.sh units with FORGE_STORE). It never shows a rad clone line. The Git over |
| 3 | 3 | note HTTPS line is shown only when the build was given a clone base (FORGE_CLONE_BASE, FSCB 1 in |
| 4 | -note .build/store.om): <base>projects/<name>/repo.git, the store's own layout. The archive links are | |
| 5 | -note dl/dlclone.om's. The agent line of dl/dlclone.om (forge-contribute, which opens a Radicle | |
| 4 | +note .build/store.om): <base>projects/<name>/repo.git, the store's own layout. The clone checkout and | |
| 5 | +note archive links are pinned to fpin (set by browse/brpinhd). The agent line of dl/dlclone.om (forge-contribute, which opens a Radicle | |
| 6 | 6 | note patch) is left out: proposals move to Interplane's own records (interplane-native DESIGN.md |
| 7 | 7 | note step 3). |
| 8 | 8 | text tscl1 "<details class=\"clone pj-get\"><summary class=\"pj-btn\">Get this repository</summary><dl>" |
| 9 | -text tscl2 "<dt>Git over HTTPS</dt><dd><code>git clone " | |
| 9 | +text tscl2 "<dt>Git over HTTPS</dt><dd><code>git clone --no-checkout " | |
| 10 | +text tsclsp " " | |
| 11 | +text tscland " && git -C " | |
| 12 | +text tscldet " checkout --detach " | |
| 13 | +text tsclcm "/archive/commits/" | |
| 10 | 14 | text tscl3 "</code></dd>" |
| 11 | 15 | text tscl4 "<dt>Source archive of " |
| 12 | 16 | text tscl5 "</dt><dd><a href=\"" |
| 13 | 17 | text tscl6 ".zip\">Download ZIP</a> · <a href=\"" |
| 14 | 18 | text tscl7 ".tar.gz\">tar.gz</a></dd></dl></details>\n" |
| 15 | 19 | fn dlclone to void |
| 16 | -dldefbr | |
| 17 | 20 | fput tscl1 |
| 18 | 21 | if eq FSCB 1 |
| 19 | 22 | i = get fridx 0 |
| @@ -23,18 +26,24 @@ fesc tfcbase | ||
| 23 | 26 | fesc tfsprj |
| 24 | 27 | fputrn i |
| 25 | 28 | fesc tfsrg |
| 29 | +fput tsclsp | |
| 30 | +fputrn i | |
| 31 | +fput tscland | |
| 32 | +fputrn i | |
| 33 | +fput tscldet | |
| 34 | +fputpin | |
| 26 | 35 | fput tscl3 |
| 27 | 36 | end |
| 28 | 37 | end |
| 29 | 38 | fput tscl4 |
| 30 | -dlescref | |
| 39 | +fputpin | |
| 31 | 40 | fput tscl5 |
| 32 | 41 | dlrepol |
| 33 | -fput tdarhh | |
| 34 | -dlescref | |
| 42 | +fput tsclcm | |
| 43 | +fputpin | |
| 35 | 44 | fput tscl6 |
| 36 | 45 | dlrepol |
| 37 | -fput tdarhh | |
| 38 | -dlescref | |
| 46 | +fput tsclcm | |
| 47 | +fputpin | |
| 39 | 48 | fput tscl7 |
| 40 | 49 | end |
store/tests/pinned-clone.sh
| new file mode 100644 | ||
| @@ -0,0 +1,110 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +# ORACLE: private store fixture, both bases, clone-base/no-base, empty repo and pin lifetime. | |
| 3 | +# No live data or services. The mutant removes clone --no-checkout; the exact panel oracle refuses it. | |
| 4 | +set -euo pipefail | |
| 5 | +cd "$(dirname "$0")/../.." | |
| 6 | +PORT=${PINNED_CLONE_PORT:-18583} | |
| 7 | +case $PORT in 185[5-9][0-9]) ;; *) echo 'REFUSED: private port must be 18550..18599'; exit 2;; esac | |
| 8 | +ss -ltnH "sport = :$PORT" | grep -q . && { echo 'NOT_RUN: port busy'; exit 3; } | |
| 9 | +OMC=${OMEGA_MV:-$HOME/work/flux/omega-mv}/seed/out/omc | |
| 10 | +[ "$(sha256sum "$OMC" | cut -d' ' -f1)" = 3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194 ] | |
| 11 | +T=$(mktemp -d /tmp/forge-pinned-clone.XXXXXX) | |
| 12 | +pid=; pass=0 | |
| 13 | +cleanup() { if [ -n "$pid" ]; then kill "$pid" 2>/dev/null || true; wait "$pid" 2>/dev/null || true; fi; [ "${KEEP_TEST_TMP:-0}" = 1 ] || rm -rf "$T"; } | |
| 14 | +trap cleanup EXIT | |
| 15 | +run() { taskset -c "${CORES:-4,5}" nice -n 10 "$@"; } | |
| 16 | +ok() { pass=$((pass+1)); echo "PASS $*"; } | |
| 17 | +die() { echo "FAIL $*"; exit 1; } | |
| 18 | +export GIT_AUTHOR_NAME=fixture GIT_AUTHOR_EMAIL=fixture@invalid GIT_COMMITTER_NAME=fixture GIT_COMMITTER_EMAIL=fixture@invalid | |
| 19 | +export GIT_AUTHOR_DATE=2026-01-01T00:00:00Z GIT_COMMITTER_DATE=2026-01-01T00:00:00Z | |
| 20 | +mkdir -p "$T/w" "$T/store/projects" "$T/data/logs" "$T/bin" "$T/ng" | |
| 21 | +cp server/tests/fake/rad server/tests/fake/getent "$T/bin/" | |
| 22 | +chmod +x "$T/bin/"* | |
| 23 | +: > "$T/ng/dl.log"; : > "$T/ng/access.log" | |
| 24 | +git -C "$T/w" init -q -b main | |
| 25 | +printf '# Fixture\n\n[file](file.txt)\n' > "$T/w/README.md" | |
| 26 | +printf 'old\n' > "$T/w/file.txt" | |
| 27 | +git -C "$T/w" add .; git -C "$T/w" commit -qm one | |
| 28 | +old=$(git -C "$T/w" rev-parse HEAD) | |
| 29 | +printf 'new\n' > "$T/w/file.txt"; git -C "$T/w" commit -qam two | |
| 30 | +head=$(git -C "$T/w" rev-parse HEAD) | |
| 31 | +# Deliberately create a ref named after the older commit but pointing at the newer one. | |
| 32 | +git -C "$T/w" branch "$old" "$head" | |
| 33 | +# These are parser fixtures, not signed landing records. Forge checks record 1's hash and fields. | |
| 34 | +mkproject() { | |
| 35 | + local name=$1 sha=$2 p="$T/store/projects/$1" id | |
| 36 | + mkdir -p "$p/records" | |
| 37 | + if [ "$sha" = none ]; then git init -q --bare "$p/repo.git"; else git clone -q --bare "$T/w" "$p/repo.git"; fi | |
| 38 | + printf 'interplane-project 1\nproject %s\nbranch main\nvisibility public\nowner SHA256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nalias -\nnonce 00000000000000000000000000000000\n' "$name" > "$p/records/1" | |
| 39 | + id=$(sha256sum "$p/records/1" | cut -d' ' -f1) | |
| 40 | + printf '%s\t%s\tmain\t%s\tpublic\n' "$name" "$id" "$sha" >> "$T/store/catalog.tsv" | |
| 41 | +} | |
| 42 | +mkproject Name._-9 "$head" | |
| 43 | +mkproject empty none | |
| 44 | +export FORGE_STORE="$T/store" FORGE_SITE_REF=${FORGE_SITE_REF:-c6c3d3b3d2a846bb60c67b224e18d22e408fa2be} | |
| 45 | +export FORGE_SITE_STORE=${FORGE_SITE_STORE:-$HOME/interplane-store-owner/projects/interplane.io/repo.git} | |
| 46 | +build() { | |
| 47 | + local name=$1 base=$2 | |
| 48 | + export FORGE_CLONE_BASE=$base | |
| 49 | + { printf 'om2\n'; cat $(./run.sh units); } | sed \ | |
| 50 | + -e "s|2130706433 18480|2130706433 $PORT|" \ | |
| 51 | + -e "s|/home/drakestapleton/forge-data/|$T/data/|g" \ | |
| 52 | + -e "s|^text tfzp0 .*|text tfzp0 \"$T/ng/dl.log\"|" \ | |
| 53 | + -e "s|^text tfzp1 .*|text tfzp1 \"$T/ng/access.log\"|" \ | |
| 54 | + -e "s|^text tfzwal .*|text tfzwal \"$T/ng/wal\"|" \ | |
| 55 | + -e "s|^text tfzspth .*|text tfzspth \"$T/counts.snapshot\"|" \ | |
| 56 | + -e "s|^text tfzrad .*|text tfzrad \"$T/bin/rad\"|" \ | |
| 57 | + -e "s|^text tfzgent .*|text tfzgent \"$T/bin/getent\"|" > "$T/$name.om" | |
| 58 | + ! grep -qE '2130706433 18480|/home/drakestapleton/forge-data/' "$T/$name.om" || die 'live target remains' | |
| 59 | + run "$OMC" < "$T/$name.om" > "$T/$name.bin" | |
| 60 | + chmod +x "$T/$name.bin" | |
| 61 | +} | |
| 62 | +start() { | |
| 63 | + FORGE_SOCIAL_DIR="$T/data/" taskset -c "${CORES:-4,5}" nice -n 10 "$T/$1.bin" > "$T/$1.log" 2>&1 & pid=$! | |
| 64 | + for _ in {1..60}; do | |
| 65 | + kill -0 "$pid" 2>/dev/null || die 'server exited during startup' | |
| 66 | + curl -fsS --max-time 1 -o /dev/null "http://127.0.0.1:$PORT/explore" 2>/dev/null && return | |
| 67 | + sleep .1 | |
| 68 | + done | |
| 69 | + die 'server did not start' | |
| 70 | +} | |
| 71 | +stop() { kill "$pid"; wait "$pid" 2>/dev/null || true; pid=; } | |
| 72 | +get() { [ "$(curl -sS --max-time 20 -o "$T/page" -w '%{http_code}' -H "X-Forge-Base: $2" "http://127.0.0.1:$PORT/drakestapleton/$1")" = 200 ] || die "GET $1"; } | |
| 73 | +panel() { grep -o '<details class="clone.*</details>' "$T/page" > "$T/panel"; } | |
| 74 | +checkpanel() { | |
| 75 | + local base=$1 cb=$2 clone= | |
| 76 | + if [ -n "$cb" ]; then clone="<dt>Git over HTTPS</dt><dd><code translate=\"no\">git clone --no-checkout ${cb}projects/Name._-9/repo.git Name._-9 && git -C Name._-9 checkout --detach <span translate=\"no\">$head</span></code></dd>"; fi | |
| 77 | + printf '<details class="clone pj-get"><summary class="pj-btn">Get this repository</summary><dl>%s<dt>Source archive of <span translate="no">%s</span></dt><dd><a href="%sdrakestapleton/Name._-9/archive/commits/%s.zip">Download ZIP</a> · <a href="%sdrakestapleton/Name._-9/archive/commits/%s.tar.gz">tar.gz</a></dd></dl></details>\n' "$clone" "$head" "$base" "$head" "$base" "$head" > "$T/want" | |
| 78 | + cmp -s "$T/want" "$T/panel" | |
| 79 | +} | |
| 80 | +build good https://interplane.io/ | |
| 81 | +build nobase '' | |
| 82 | +for variant in good nobase; do | |
| 83 | + start "$variant" | |
| 84 | + cb=https://interplane.io/; [ "$variant" = good ] || cb= | |
| 85 | + for base in / /forge/; do | |
| 86 | + get Name._-9 "$base"; panel | |
| 87 | + checkpanel "$base" "$cb" || die "$variant $base exact panel" | |
| 88 | + ok "$variant $base exact commit-pinned panel, translation hints and safe name punctuation" | |
| 89 | + grep -qF "href=\"${base}drakestapleton/Name._-9/tree/$head\"" "$T/page" || die 'Files tab not pinned' | |
| 90 | + grep -qF "blob/$head/file.txt" "$T/page" || die 'README link not pinned' | |
| 91 | + ok "$variant $base Files and README links pinned" | |
| 92 | + get "Name._-9/tree/$old" "$base" | |
| 93 | + grep -qF "tree/$old\"" "$T/page" || die 'commit ref shadowed by same-named branch' | |
| 94 | + grep -qF "commit/$old" "$T/page" || die 'wrong commit rendered' | |
| 95 | + ok 'NEG full commit id wins over conflicting branch' | |
| 96 | + get empty "$base" | |
| 97 | + ! grep -q 'Get this repository' "$T/page" || die 'empty repo has panel' | |
| 98 | + grep -q 'Nothing to download yet' "$T/page" || die 'empty message missing' | |
| 99 | + ! grep -qF "tree/$head" "$T/page" || die 'pin leaked to next page' | |
| 100 | + ok "$variant $base empty repository refuses downloads, pin does not leak" | |
| 101 | + done | |
| 102 | + stop | |
| 103 | +done | |
| 104 | +sed 's/git clone --no-checkout /git clone /' "$T/good.om" > "$T/mutant.om" | |
| 105 | +run "$OMC" < "$T/mutant.om" > "$T/mutant.bin"; chmod +x "$T/mutant.bin" | |
| 106 | +start mutant; get Name._-9 /; panel | |
| 107 | +if checkpanel / https://interplane.io/; then die 'clone mutant escaped oracle'; fi | |
| 108 | +ok 'NEG clone mutant fails exact panel oracle' | |
| 109 | +stop | |
| 110 | +echo "pinned clone: $pass pass, 0 fail" |