4 Commits
Author SHA1 Message Date
Claude 7e30b4525e logs: the developer protocol on defd47e5 -- PASS, all eight stages
Build / Image PC (push) Successful in 9m16s
Build / Image MILKV (push) Successful in 6m54s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 19m51s
Build / Image RASPI (push) Successful in 6m42s
Acceptance / Acceptance (pull_request) Successful in 27m4s
logs/20261112-114545/PROTOCOL.md: one stage per foreground command (paused
between stages 2 and 3 for Captain Bob's emergency, then resumed on the same
commit): the four boots 538/538, word_count=318, dict_hash
0x8c92508f748f99cf on all three; test-32 39 programs, 1,869,197 checks, 0
failures; the proofs (StarForth, 44 s); the images; the documents. The tree
clean before and after.

The evidence for the held batch: plan section 8 (the FMEA in the PR review),
the notes, and scripts/ci_litter_check.sh (#129).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-12 12:18:29 +00:00
Claude defd47e5ff scripts: ci_litter_check.sh -- #129's week-later check, run on the server
Each cleanup #129 set up (Captain Bob, 2026-11-07), and what proves it ran:
the Docker prune's and the package cleanup's logs written in the last 8 days;
no image older than 8 days that no container uses; at most KEEP (5)
lithosananke-runner tags; no artifact older than ARTIFACT_DAYS (30) + 1; no
Nexus snapshot asset older than 8 days (with NEXUS_USER/NEXUS_PASSWORD,
skipped and said so without); a dated disk line appended to HISTORY each run,
so "disk use flat" is a comparison of weeks. PASS:/FAIL:/SKIP:/INFO:,
RESULT:, exit 0 only if nothing fails.

Tested here against fixtures (a stale log, an old artifact, no docker -- each
FAIL; clean -- PASS) and a stand-in docker (one stale unused image of three --
FAIL, the in-use and the recent ones kept). The registry check ran against
the real registry: 2 tags. Not run here: the real Docker, Nexus.

Captain Bob, 2026-11-12: "Correct the issue text and write the check script".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-12 11:25:28 +00:00
Claude ffaf9d8e45 notes: the developer protocol, and its strictness ruled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-12 00:47:24 +00:00
Claude 4d4706c389 plan: the FMEA in the PR review -- section 8, for ruling (CAPA & FMEA gate)
Captain Bob, 2026-11-12: "Is it possible to include the FMEA in the pr
review? That way the items are forced into a manual review beforehand?" --
"Yes, add it to the plan". Each FMEA row names its paths; the PR carries a
review record with a decision for every row its diff touches; a
check_fmea_review.sh beside check_protocol.sh refuses the PR without one, or
with one for another diff. A sixth point to rule. Nothing built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-12 00:45:35 +00:00
21 changed files with 276 additions and 0 deletions
+11
View File
@@ -106,3 +106,14 @@ v3 is not part of acceptance. There is no `make test`. Hosted `make` is compile
- Toolchain for acceptance: `make ARCH=amd64,aarch64,riscv64 init INIT_DOCS=0 INIT_PROOFS=0` (the repo's own).
- Clean tree: since 90c5c140 a build changes no tracked file (version.h untracked; BLOCK_MAP.md has no
timestamp). A *signed* build still rewrites BLOCK_MAP.md's Signed column -- open, Bob's call.
## The developer protocol (#135, built 2026-11-12)
- `scripts/nightly.sh protocol <stage>` one stage per foreground command (accept-amd64 begins it), then
`protocol-report` -> logs/<TS>/PROTOCOL.md; commit logs/ + experiments/bare_metal/runs/; the PR's gate runs
`scripts/check_protocol.sh` on the head first.
- **Strict, ruled** (Bob 2026-11-12: "Keep it strict"): ANY change outside logs/ and the DoE CSVs after the run --
documents and notes included -- makes the evidence stale and needs a full protocol rerun. So batch docs/notes
commits and push them with the next protocol, not one by one. Hold commits that would stale an open PR.
- The docs stage takes ~30 min here (the API reference); it outlasts the foreground limit and the tool
moves it to the background (not an acceptance boot; no QEMU). Proofs need the HOL-Library heap
(ci/runner-image's URL, checksum in its Dockerfile).
@@ -91,6 +91,33 @@ Threshold: RPN >= 100, or Severity >= 9 at any RPN.
3. Where: a stage in `acceptance.yml` (my call), or a separate required check?
4. The scales and the threshold (section 5).
5. Which of section 4's five become CAPAs.
6. The FMEA in the PR review (section 8), or not.
Don't over-engineer: start with the escaped defects and an FMEA grown as defects arrive, not a
large table written up front.
## 8. The FMEA in the PR review: a manual review forced before the merge
Captain Bob, 2026-11-12: "Is it possible to include the FMEA in the pr review? That way the items
are forced into a manual review beforehand?" -- then "Yes, add it to the plan". As with the protocol's
evidence (#135), the review is a record committed in the PR, and the gate refuses the PR without it.
- **Each FMEA row names the paths it concerns** (`paths:` in `fmea.yml`), narrowly: the MINT-ZUSE row
`kernel/src/v4/sk_v4_mint.c`, the put-back row `scripts/nightly.sh` and the scripts it lists.
- **The PR carries `docs/quality/reviews/<TS>.yml`:** for every row whose paths the PR's diff against
`master` touches -- the row's id; the decision (scores unchanged / raised / lowered, a control
added); one line of why; and any failure mode the change brings, as a new row in `fmea.yml`.
- **The gate:** `scripts/check_fmea_review.sh` in `acceptance.yml`, beside `check_protocol.sh`, refuses
the PR when a touched row has no entry, an entry names a row that does not exist, or the review was
made for another diff (it names the base and head it reviewed, as PROTOCOL.md names its commit).
It prints exactly which rows the PR triggers, so the review is of those and no more.
- **The PR template** gets an "FMEA review" section pointing at the file: the review is done before
the PR is opened, not after.
- **What it forces, and what it cannot:** that every affected row was looked at and a decision
written down. Whether the thinking was honest stays a person's: Captain Bob's while there is one
developer; with a second, branch protection's required approval as well, the record telling the
reviewer what to check.
- **The risk:** rows mapped too coarsely make every PR touch dozens, and the review becomes ticking
boxes. Rows are mapped narrowly, and a row that triggers on most PRs is split.
*To rule:* a sixth point -- the FMEA review in the PR, as above, or not.
+63
View File
@@ -0,0 +1,63 @@
# Protocol for defd47e5
- Commit: defd47e5ff354c7bfe641d6d96efa9329cb5796e
- Tree: clean
- Result: PASS
`scripts/nightly.sh protocol` (#135), begun 20261112-114545 UTC; `scripts: ci_litter_check.sh -- #129's week-later check, run on the server`.
## Stages
| Stage | Result | Output |
|---|---|---|
| `accept-amd64` | PASS | `logs/20261112-114545/protocol/accept-amd64.log` |
| `accept-aarch64` | PASS | `logs/20261112-114545/protocol/accept-aarch64.log` |
| `accept-riscv64` | PASS | `logs/20261112-114545/protocol/accept-riscv64.log` |
| `accept-stick-high` | PASS | `logs/20261112-114545/protocol/accept-stick-high.log` |
| `test-32` | PASS | `logs/20261112-114545/protocol/test-32.log` |
| `proofs` | PASS | `logs/20261112-114545/protocol/proofs.log` |
| `images` | PASS | `logs/20261112-114545/protocol/images.log` |
| `docs` | PASS | `logs/20261112-114545/protocol/docs.log` |
## The boots
| Boot | Serial log | POST | System |
|---|---|---|---|
| amd64 | `logs/20261112-114622/amd64/qemu-amd64-20261112-114622.log` | `PARITY:V4_POST tests=538 pass=538 fail=0` | `PARITY:V4_SYSTEM word_count=318 dict_hash=0x8c92508f748f99cf` |
| aarch64 | `logs/20261112-114828/aarch64/qemu-aarch64-20261112-114828.log` | `PARITY:V4_POST tests=538 pass=538 fail=0` | `PARITY:V4_SYSTEM word_count=318 dict_hash=0x8c92508f748f99cf` |
| riscv64 | `logs/20261112-115423/riscv64/qemu-riscv64-20261112-115423.log` | `PARITY:V4_POST tests=538 pass=538 fail=0` | `PARITY:V4_SYSTEM word_count=318 dict_hash=0x8c92508f748f99cf` |
| stick-high | `logs/20261112-115606/amd64/qemu-amd64-20261112-115606.log` | `PARITY:V4_POST tests=538 pass=538 fail=0` | `PARITY:V4_SYSTEM word_count=318 dict_hash=0x8c92508f748f99cf` |
dict_hash: the same on all three: `0x8c92508f748f99cf`.
## test-32
39 programs, 1869197 checks, 0 failures
## The proofs
`logs/20261112-120245/isabelle/isabelle-20261112-120245.log`
## The images (SHA-256)
```
a7bc55304a103619b2ede87d8c8114c69458c3b6ecfb44b6f98cacbecf1fc6cf StarshipOS.iso
e2a299655b7ec3a01f7c021b87125fefb57c3a196623d3465d623b2481bd94d6 pc-stick.img
0379acff2e7b079b99d7cf6a7d006c4db486d14aed020c68218731d30d3fb956 raspi5.img
2e8c0766898c31d4dd2befff08535786e137f342f47925ab83426593ca54de42 MilkV.img
dc7a6e4a3275d55d49cbc18a03695e66185bf04f8f98c9edef740615b2a063fe pc-stick.img.xz
eac7d5a489ac663661ca7c6516d0f6218f15d21caf4a3c771bd6d5c84e8fb5c6 raspi5.img.xz
bbddc8b848bf44ea1535b259be4932e2173250ddb0f12282d1098df4d48055ef MilkV.img.xz
```
## The documents (SHA-256)
```
d018cdf73a2f8596ceb1b511b4f585f6568d94ff10e14230f634ba16cb39549c ./api.pdf
3041d60d586492386b25b6d4f1ea3bc1a3de393c3c363fe703d3be08746693ca ./book.pdf
6333842859042ce590626f6d0fcc676893f039988de5c72d65d1305b03887257 ./dictionary.pdf
a0945bc13acf2e61c8be9600cc9b967db6bbdfc2f748a0334ab632b7122e8b5c ./fabric.pdf
8b30dd3b8029983c9590077a99d56d481242394c48054138b0f753f8bf2f4098 ./vol1.pdf
48ceba628778f4c1c1377b09db490fa8d9d9c95e80b96c880451d75c8c4a679f ./vol2.pdf
890122fad4ca12db371a79eb0e826a2ff8afacc7e981a2fffc6044053d30531a ./vol3.pdf
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+136
View File
@@ -0,0 +1,136 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: LicenseRef-Starship-1.0
# Copyright (c) 2023-2026 Robert A. James
# ci_litter_check.sh -- #129's check that CI cleans up its litter, green, orange and red runs alike.
# Run ON THE SERVER, after a Sunday's cleanup, as a user who can run docker and read /var/log:
#
# sudo scripts/ci_litter_check.sh
#
# Each cleanup #129 set up on 2026-11-07 (Captain Bob's comment there), and what proves it ran:
# Docker prune, Sundays 03:00 /var/log/docker-prune.log written in the last 8 days; no image
# older than 8 days that no container uses
# Gitea package cleanup, Sun 03:15 /var/log/gitea-cleanup.log written in the last 8 days; at most
# KEEP lithosananke-runner tags in the registry
# Gitea artifacts, 30 days no file under GITEA_ARTIFACTS older than ARTIFACT_DAYS + 1
# Nexus snapshots, 7 days no starshipos-snapshots asset older than 8 days (with
# NEXUS_USER and NEXUS_PASSWORD; skipped, and said so, without)
# Disk use flat a dated line appended to HISTORY each run; the last weeks shown
#
# Settings (environment): GITEA_ARTIFACTS (default: the first of /var/lib/gitea/data/actions_artifacts,
# /data/gitea/actions_artifacts that exists), ARTIFACT_DAYS (30), KEEP (5), GITEA_URL
# (https://gitea.starshipos-f18.org), GITEA_TOKEN (optional), NEXUS_URL
# (https://nexus.starshipos-f18.org), NEXUS_USER, NEXUS_PASSWORD, HISTORY (/var/log/ci-litter-check.log),
# PRUNE_LOG (/var/log/docker-prune.log), CLEANUP_LOG (/var/log/gitea-cleanup.log).
#
# Prints PASS:/FAIL:/SKIP:/INFO: per check and RESULT:; exits 0 only if no check fails.
set -uo pipefail
ARTIFACT_DAYS=${ARTIFACT_DAYS:-30}
KEEP=${KEEP:-5}
GITEA_URL=${GITEA_URL:-https://gitea.starshipos-f18.org}
NEXUS_URL=${NEXUS_URL:-https://nexus.starshipos-f18.org}
HISTORY=${HISTORY:-/var/log/ci-litter-check.log}
PRUNE_LOG=${PRUNE_LOG:-/var/log/docker-prune.log}
CLEANUP_LOG=${CLEANUP_LOG:-/var/log/gitea-cleanup.log}
if [ -z "${GITEA_ARTIFACTS:-}" ]; then
for d in /var/lib/gitea/data/actions_artifacts /data/gitea/actions_artifacts; do
[ -d "$d" ] && { GITEA_ARTIFACTS=$d; break; }
done
fi
ok=1
pass() { echo "PASS: $*"; }
fail() { echo "FAIL: $*"; ok=0; }
skip() { echo "SKIP: $*"; }
info() { echo "INFO: $*"; }
now=$(date +%s)
recent_log() { # recent_log <file> <what>: written in the last 8 days
local f=$1 what=$2
if [ ! -f "$f" ]; then fail "$what: no $f"; return; fi
local age=$(( (now - $(stat -c %Y "$f")) / 86400 ))
if [ "$age" -le 8 ]; then pass "$what: $f written $age day(s) ago -- $(tail -1 "$f" | cut -c1-100)"
else fail "$what: $f last written $age days ago"; fi
}
# 1. Docker
recent_log "$PRUNE_LOG" "the weekly Docker prune"
if command -v docker >/dev/null && docker info >/dev/null 2>&1; then
used=$(docker ps -a --format '{{.Image}}' | xargs -r docker image inspect -f '{{.Id}}' 2>/dev/null | sort -u)
stale=0
while read -r id created; do
[ -n "$id" ] || continue
c=$(date -d "$created" +%s 2>/dev/null || echo "$now")
if [ $(( (now - c) / 86400 )) -gt 8 ] && ! grep -qx "$id" <<<"$used"; then stale=$((stale + 1)); fi
done < <(docker image ls -q --no-trunc | sort -u | xargs -r docker image inspect -f '{{.Id}} {{.Created}}')
if [ "$stale" = 0 ]; then pass "Docker: no image older than 8 days that no container uses"
else fail "Docker: $stale image(s) older than 8 days that no container uses -- the prune did not take them"; fi
info "docker system df: $(docker system df --format '{{.Type}} {{.Size}} ({{.Reclaimable}} reclaimable)' | paste -sd ';' -)"
dockerdf=$(docker system df --format '{{.Type}}={{.Size}}' | paste -sd ' ' -)
else
fail "Docker: docker is not usable here (run this on the server, as a user who may run docker)"
dockerdf=none
fi
# 2. Gitea's package registry
recent_log "$CLEANUP_LOG" "the weekly Gitea package cleanup"
pkgs=$(curl -fsS ${GITEA_TOKEN:+-H "Authorization: token $GITEA_TOKEN"} \
"$GITEA_URL/api/v1/packages/rajames?type=container&q=lithosananke-runner&limit=50" 2>/dev/null)
if [ -n "$pkgs" ]; then
tags=$(python3 -c 'import json,sys; print(sum(1 for p in json.load(sys.stdin) if not p["version"].startswith("sha256:")))' <<<"$pkgs")
if [ "$tags" -le "$KEEP" ]; then pass "registry: $tags lithosananke-runner tag(s), at most $KEEP"
else fail "registry: $tags lithosananke-runner tags, more than $KEEP"; fi
else
fail "registry: $GITEA_URL's package API did not answer (GITEA_TOKEN?)"
fi
# 3. Gitea's run artifacts
if [ -n "${GITEA_ARTIFACTS:-}" ] && [ -d "$GITEA_ARTIFACTS" ]; then
old=$(find "$GITEA_ARTIFACTS" -type f -mtime +"$((ARTIFACT_DAYS + 1))" | wc -l)
if [ "$old" = 0 ]; then pass "artifacts: none older than $((ARTIFACT_DAYS + 1)) days in $GITEA_ARTIFACTS"
else fail "artifacts: $old file(s) older than $((ARTIFACT_DAYS + 1)) days in $GITEA_ARTIFACTS"; fi
info "artifacts: $(du -sh "$GITEA_ARTIFACTS" 2>/dev/null | cut -f1) in $(find "$GITEA_ARTIFACTS" -type f | wc -l) files"
else
fail "artifacts: no Gitea artifact directory found (set GITEA_ARTIFACTS)"
fi
# 4. Nexus's snapshots
if [ -n "${NEXUS_USER:-}" ] && [ -n "${NEXUS_PASSWORD:-}" ]; then
oldest=$(NEXUS_URL=$NEXUS_URL python3 - <<'EOF'
import base64, json, os, urllib.request, datetime
url = os.environ["NEXUS_URL"] + "/service/rest/v1/assets?repository=starshipos-snapshots"
auth = base64.b64encode((os.environ["NEXUS_USER"] + ":" + os.environ["NEXUS_PASSWORD"]).encode()).decode()
token, dates = None, []
while True:
req = urllib.request.Request(url + ("&continuationToken=" + token if token else ""), headers={"Authorization": "Basic " + auth})
d = json.load(urllib.request.urlopen(req, timeout=60))
dates += [a["lastModified"] for a in d.get("items", []) if a.get("lastModified")]
token = d.get("continuationToken")
if not token:
break
if not dates:
print("none")
else:
o = min(datetime.datetime.fromisoformat(x.replace("Z", "+00:00")) for x in dates)
print(len(dates), int((datetime.datetime.now(datetime.timezone.utc) - o).days))
EOF
)
case $oldest in
none) pass "Nexus: starshipos-snapshots is empty" ;;
*\ *) n=${oldest% *}; days=${oldest#* }
if [ "$days" -le 8 ]; then pass "Nexus: $n snapshot asset(s), the oldest $days day(s) old"
else fail "Nexus: the oldest of $n snapshot assets is $days days old -- the 7-day cleanup did not take it"; fi ;;
*) fail "Nexus: the asset listing did not answer" ;;
esac
else
skip "Nexus: set NEXUS_USER and NEXUS_PASSWORD to check the 7-day snapshot cleanup"
fi
# 5. Disk use, week on week
diskline="$(date -u +%Y-%m-%dT%H:%MZ) root=$(df -P / | awk 'NR==2 {print $3"K used of "$2"K"}') docker: $dockerdf"
if { echo "$diskline" >> "$HISTORY"; } 2>/dev/null; then
info "disk, the last weeks ($HISTORY):"; tail -4 "$HISTORY" | sed 's/^/ /'
else
fail "disk: could not append to $HISTORY"; info "disk: $diskline"
fi
echo "RESULT: $([ $ok = 1 ] && echo PASS || echo FAIL)"
[ $ok = 1 ]