From 6a488e1f97abbc2e8307030edd5d2654c04f9859 Mon Sep 17 00:00:00 2001 From: Bin Le Date: Wed, 12 Aug 2026 23:51:43 -0400 Subject: [PATCH] Release v1.9.5: build-cover-dist.sh emits the local cover snapshot Adds a LOCAL_COPY phase (default docs/cover.html) so the committed, browsable snapshot of the landing page is generated rather than hand-synced. The manual step produced two bugs in a row: a copy several versions behind, and a hero image that never resolved. Hand-maintaining it could not work. The version badge is injected at build time, so an edited duplicate is stale as soon as the version moves; and because the copy lands outside dist-cover/, its relative asset paths dangle. The phase runs after the secret scan, so a snapshot is never written carrying a leak the scan would have rejected. Asset references are re-pointed at COVER_SRC relative to wherever the copy lands; anchors, absolute URLs, and refs that do not resolve in the source tree are left untouched rather than silently rewritten. LOCAL_COPY="" skips it. Co-Authored-By: Claude Opus 5 (1M context) --- .agents/skills/publish-cover/SKILL.md | 12 ++++++ .../publish-cover/scripts/build-cover-dist.sh | 38 +++++++++++++++++++ CHANGELOG.md | 17 +++++++++ docs/cover.html | 8 ++-- pyproject.toml | 2 +- uv.lock | 2 +- 6 files changed, 73 insertions(+), 6 deletions(-) diff --git a/.agents/skills/publish-cover/SKILL.md b/.agents/skills/publish-cover/SKILL.md index 688c715..d83e9d6 100644 --- a/.agents/skills/publish-cover/SKILL.md +++ b/.agents/skills/publish-cover/SKILL.md @@ -81,6 +81,7 @@ What the script does deterministically: | Stamp | `` in every `.html` | | Validate | Every `.gif` in dist: max file size, nonzero frame count | | Scan | Secret scan across all dist files (rejects on match) | +| Local copy | Writes `LOCAL_COPY` — a committed, browsable snapshot of the built page | | Report | Manifest + per-file sizes to stdout | **Env overrides:** @@ -91,6 +92,17 @@ What the script does deterministically: | `COVER_DIST` | `dist-cover/` | Build output | | `MAX_GIF_SIZE_MB` | `5` | Reject gifs larger than this | | `SKIP_SECRET_SCAN` | `0` | `1` = bypass (escape hatch) | +| `LOCAL_COPY` | `docs/cover.html` | Repo-relative snapshot of the built page; `""` skips | + +**On `LOCAL_COPY`:** do not hand-maintain a duplicate of the cover. The version +badge is injected *at build time*, so any manually edited copy is stale the +moment the version moves — and because the copy lands outside `COVER_DIST`, its +relative asset paths dangle (`docs/cover.html` shipped a broken hero image for +exactly this reason). The build emits it after the secret scan and re-points +each asset reference at `COVER_SRC`, relative to wherever the copy lands. +Anchors, absolute URLs, and refs that do not resolve in the source tree are +left untouched. Only `index.html` is mirrored — it is a snapshot, not a second +dist. Commit the result; never edit it by hand. ### Step 2 — Audit diff --git a/.agents/skills/publish-cover/scripts/build-cover-dist.sh b/.agents/skills/publish-cover/scripts/build-cover-dist.sh index aa55131..b2130d4 100755 --- a/.agents/skills/publish-cover/scripts/build-cover-dist.sh +++ b/.agents/skills/publish-cover/scripts/build-cover-dist.sh @@ -8,6 +8,11 @@ COVER_SRC="${COVER_SRC:-cover}" COVER_DIST="${COVER_DIST:-dist-cover}" MAX_GIF_SIZE_MB="${MAX_GIF_SIZE_MB:-5}" SKIP_SECRET_SCAN="${SKIP_SECRET_SCAN:-0}" +# Repo-relative path for a committed, browsable snapshot of the built page. +# Set to "" to skip. This exists because a hand-maintained copy cannot stay +# correct: the version badge is injected here at build time, so any manually +# edited duplicate is stale the moment the version moves. +LOCAL_COPY="${LOCAL_COPY:-docs/cover.html}" RED='\033[0;31m' GREEN='\033[0;32m' @@ -183,6 +188,39 @@ else: echo "$HITS" fi +# ── local copy ────────────────────────────────────────────────────────────── +# Emitted AFTER the secret scan so a copy is never committed with a leak the +# scan would have rejected. Asset references are re-pointed at COVER_SRC: +# the copy lands outside COVER_DIST, so every relative src/href in it would +# otherwise dangle (this is exactly how docs/cover.html shipped a broken hero +# image). Only index.html is mirrored — the copy is a browsable snapshot, not +# a second dist. + +if [ -n "$LOCAL_COPY" ]; then + say "emitting local copy → ${LOCAL_COPY}" + python3 - "$COVER_DIST" "$COVER_SRC" "$REPO_ROOT/$LOCAL_COPY" <<'PY' +import os, pathlib, re, sys + +dist, src, out = (pathlib.Path(a) for a in sys.argv[1:4]) +html = (dist / "index.html").read_text() +rel = os.path.relpath(src.resolve(), out.parent.resolve()) + +SKIP = re.compile(r'^(?:[a-z][a-z0-9+.-]*:|//|#|\.\.?/)', re.I) + +def repoint(m): + attr, val = m.group(1), m.group(2) + if SKIP.match(val): + return m.group(0) + # Only rewrite refs that actually resolve inside the source tree; anything + # else is left untouched rather than silently pointed somewhere wrong. + return f'{attr}="{rel}/{val}"' if (src / val).is_file() else m.group(0) + +out.parent.mkdir(parents=True, exist_ok=True) +out.write_text(re.sub(r'\b(src|href)="([^"]+)"', repoint, html)) +print(f" assets re-pointed at {rel}/") +PY +fi + # ── manifest + summary ────────────────────────────────────────────────────── say "build complete" diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c0183..1cf9c63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,23 @@ This project follows a Keep a Changelog-style format and uses version tags for r ## [Unreleased] +## [1.9.5] - 2026-08-12 + +### Changed + +- **`build-cover-dist.sh` now emits the local cover snapshot itself** + (`LOCAL_COPY`, default `docs/cover.html`), removing the manual sync step that + produced two bugs in a row: a copy several versions behind, and a hero image + that never resolved. Hand-maintaining it could not work — the version badge is + injected at build time, so an edited duplicate is stale as soon as the version + moves, and because the copy lands outside `dist-cover/` its relative asset + paths dangle. + The new phase runs after the secret scan (so a snapshot is never written with + a leak the scan would have rejected) and re-points each asset reference at + `COVER_SRC`, computed relative to wherever the copy lands. Anchors, absolute + URLs, and references that do not resolve in the source tree are left alone + rather than silently rewritten. `LOCAL_COPY=""` skips the phase. + ## [1.9.4] - 2026-08-12 ### Fixed diff --git a/docs/cover.html b/docs/cover.html index 0bf50da..3413ce5 100644 --- a/docs/cover.html +++ b/docs/cover.html @@ -1,4 +1,4 @@ - + @@ -166,14 +166,14 @@
- v1.9.4 + v1.9.5

actop.

Watch your Apple Silicon Mac the way it actually works — sudoless, in-process, for M1–M4.

- actop live during a llama.cpp inference run: E-CPU/P-CPU/GPU/ANE utilization, per-core frequency, memory bandwidth, and power charts on Apple Silicon + actop live during a llama.cpp inference run: E-CPU/P-CPU/GPU/ANE utilization, per-core frequency, memory bandwidth, and power charts on Apple Silicon
Live under a local llama.cpp run — the stack layout with braille then block sparklines, then the process panel with its watt-attributed PWR column.
@@ -275,7 +275,7 @@

actop — Apple Chip top

diff --git a/pyproject.toml b/pyproject.toml index 2dc7e4b..0adc9fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "actop" -version = "1.9.4" +version = "1.9.5" description = "Apple Silicon (M1–M4) power, GPU, ANE & memory-bandwidth monitor — sudoless TUI + Python API for profiling local LLM / MLX / CoreML inference" readme = "README.md" license = { text = "MIT" } diff --git a/uv.lock b/uv.lock index e79beb0..06227bb 100644 --- a/uv.lock +++ b/uv.lock @@ -15,7 +15,7 @@ resolution-markers = [ [[package]] name = "actop" -version = "1.9.4" +version = "1.9.5" source = { editable = "." } dependencies = [ { name = "rich" },