site, docs: Downloads and Documents with every document and the nightly; never the patent (#191)
The documents stage builds the SSRN paper, experiments, proofs and the four TeX experiment reports (from their sources), and refuses the patent (scripts/check_no_patent.sh, by name or PDF title: test failed first, 5 cases pass); a release and the Nexus publish check again. texlive-science added to make init's documents (siunitx). The canvas's Documents gains the seven, Downloads a nightly section from Nexus's latest snapshot (build.py). Built in a scratch copy: every link and sum filled, no patent. Left: Nexus's anonymous read, on the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||
# Copyright (c) 2023-2026 Robert A. James
|
||||
# check_no_patent.sh DIR -- refuse a directory of documents that holds the patent (#191, Captain Bob
|
||||
# 2026-11-13: "the SSRN paper but not the patent"): a file whose name says patent, or a PDF whose title does
|
||||
# (docs/formal/patent: "Steady-State Machine -- Patent Application"). Run by scripts/nightly.sh on what the
|
||||
# documents stage builds and on what a release attaches. Exit 0 and "no patent", or 1 naming each file.
|
||||
# Tests: scripts/test_check_no_patent.sh.
|
||||
set -uo pipefail
|
||||
dir=${1:?usage: check_no_patent.sh DIR}
|
||||
[ -d "$dir" ] || { echo "check_no_patent: $dir is not a directory -- refused" >&2; exit 1; }
|
||||
bad=0
|
||||
while IFS= read -r -d '' f; do
|
||||
if [[ "$(basename "$f")" =~ [Pp][Aa][Tt][Ee][Nn][Tt] ]]; then
|
||||
echo "check_no_patent: $f is named for the patent -- refused" >&2; bad=1; continue
|
||||
fi
|
||||
case "$f" in
|
||||
*.pdf|*.PDF)
|
||||
title=$(pdfinfo "$f" 2>/dev/null | sed -n 's/^Title: *//p')
|
||||
if [[ "$title" =~ [Pp][Aa][Tt][Ee][Nn][Tt] ]]; then
|
||||
echo "check_no_patent: $f is titled \"$title\" -- the patent, refused" >&2; bad=1
|
||||
fi ;;
|
||||
esac
|
||||
done < <(find "$dir" -type f -print0)
|
||||
[ $bad = 0 ] && echo "check_no_patent: $dir: no patent"
|
||||
exit $bad
|
||||
+28
-2
@@ -284,11 +284,30 @@ docs)
|
||||
make --no-print-directory fabric
|
||||
make --no-print-directory dictionary
|
||||
make --no-print-directory -C docs/formal vols doxygen
|
||||
# #191: the SSRN paper, experiments and proofs (never the patent), and the four TeX experiment reports,
|
||||
# built from their sources into build/docs/reports (their committed PDFs are not touched)
|
||||
make --no-print-directory -C docs/formal ssrn experiments proofs
|
||||
rep=$(pwd)/build/docs/reports; mkdir -p "$rep"
|
||||
for r in experiments/bare_metal/analysis/report/bare_metal_doe_report \
|
||||
experiments/bare_metal/analysis/report/stadium_relaunch_report \
|
||||
experiments/std79-doe/report-20260912/report/std79_doe_report \
|
||||
experiments/artemis_stress/analysis/report/artemis_stress_report; do
|
||||
for pass in 1 2; do
|
||||
(cd "$(dirname "$r")" && pdflatex -interaction=nonstopmode -halt-on-error -output-directory="$rep" "$(basename "$r").tex" > "$rep/$(basename "$r").pass$pass.log") \
|
||||
|| { echo "nightly: docs: $r.tex did not build (see $rep/$(basename "$r").pass$pass.log)" >&2; exit 1; }
|
||||
done
|
||||
done
|
||||
cp build/docs/LithosAnanke.pdf "$DOCS/book.pdf"
|
||||
cp build/docs/BookOfFabric.pdf "$DOCS/fabric.pdf"
|
||||
cp build/docs/Dictionary.pdf "$DOCS/dictionary.pdf"
|
||||
for v in 1 2 3; do cp "docs/formal/build/vol$v/main.pdf" "$DOCS/vol$v.pdf"; done
|
||||
cp docs/formal/build/doxygen/StarForth-API-Reference.pdf "$DOCS/api.pdf"
|
||||
for d in ssrn experiments proofs; do cp "docs/formal/build/$d/main.pdf" "$DOCS/$d.pdf"; done
|
||||
cp "$rep/bare_metal_doe_report.pdf" "$DOCS/report-bare-metal-doe.pdf"
|
||||
cp "$rep/stadium_relaunch_report.pdf" "$DOCS/report-stadium-relaunch.pdf"
|
||||
cp "$rep/std79_doe_report.pdf" "$DOCS/report-std79-doe.pdf"
|
||||
cp "$rep/artemis_stress_report.pdf" "$DOCS/report-artemis-stress.pdf"
|
||||
scripts/check_no_patent.sh "$DOCS" # never the patent (#191)
|
||||
(cd "$DOCS" && sha256sum ./*.pdf | tee SHA256SUMS)
|
||||
;;
|
||||
gitea-release)
|
||||
@@ -305,6 +324,7 @@ gitea-release)
|
||||
# stage wrote them, then the documents and the Root CA's certificate -- so that
|
||||
# `sha256sum -c SHA256SUMS` checks all of it, and the .com's Documents page (site/com/build.py,
|
||||
# #157) finds each document's sum. The Nexus artifacts keep their own SHA256SUMS.
|
||||
scripts/check_no_patent.sh "$DOCS" # #191: a release never attaches the patent
|
||||
rel=$(mktemp -d)
|
||||
cp "$OUT/SHA256SUMS" "$rel/SHA256SUMS"
|
||||
extra=("$DOCS"/*.pdf ci/pki/starshipos-root-ca.pem)
|
||||
@@ -338,11 +358,17 @@ print(json.dumps(notes.strip() + "\n\n## Checksums (SHA-256)\n\n```\n" + sums.st
|
||||
;;
|
||||
publish-docs)
|
||||
url=${2:-}; [ -n "$url" ] || usage
|
||||
need "$DOCS/book.pdf" "$DOCS/fabric.pdf" "$DOCS/dictionary.pdf" "$DOCS/vol1.pdf" "$DOCS/vol2.pdf" "$DOCS/vol3.pdf" "$DOCS/api.pdf"
|
||||
need "$DOCS/book.pdf" "$DOCS/fabric.pdf" "$DOCS/dictionary.pdf" "$DOCS/vol1.pdf" "$DOCS/vol2.pdf" "$DOCS/vol3.pdf" "$DOCS/api.pdf" \
|
||||
"$DOCS/ssrn.pdf" "$DOCS/experiments.pdf" "$DOCS/proofs.pdf" "$DOCS/report-bare-metal-doe.pdf" \
|
||||
"$DOCS/report-stadium-relaunch.pdf" "$DOCS/report-std79-doe.pdf" "$DOCS/report-artemis-stress.pdf"
|
||||
scripts/check_no_patent.sh "$DOCS" # #191
|
||||
deploy "$url" documentation "$DOCS/book.pdf" pdf book "$DOCS/fabric.pdf" pdf fabric \
|
||||
"$DOCS/dictionary.pdf" pdf dictionary \
|
||||
"$DOCS/vol1.pdf" pdf vol1 "$DOCS/vol2.pdf" pdf vol2 "$DOCS/vol3.pdf" pdf vol3 \
|
||||
"$DOCS/api.pdf" pdf api
|
||||
"$DOCS/api.pdf" pdf api \
|
||||
"$DOCS/ssrn.pdf" pdf ssrn "$DOCS/experiments.pdf" pdf experiments "$DOCS/proofs.pdf" pdf proofs \
|
||||
"$DOCS/report-bare-metal-doe.pdf" pdf report-bare-metal-doe "$DOCS/report-stadium-relaunch.pdf" pdf report-stadium-relaunch \
|
||||
"$DOCS/report-std79-doe.pdf" pdf report-std79-doe "$DOCS/report-artemis-stress.pdf" pdf report-artemis-stress
|
||||
;;
|
||||
diagnose)
|
||||
# The EMERGENCY diagnostic build: see the header. Evidence only -- it exits 0 whatever happens.
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||
# Copyright (c) 2023-2026 Robert A. James
|
||||
# test_check_no_patent.sh -- the tests of scripts/check_no_patent.sh (#191: "the SSRN paper but not the
|
||||
# patent"): a directory of documents is refused if any file is the patent -- named for it, or a PDF whose
|
||||
# title says it is -- and passed otherwise. PDFs made here with pdflatex, from a line of TeX each.
|
||||
#
|
||||
# Prints PASS:/FAIL: per check and RESULT:; exits 0 only if every check passes.
|
||||
set -uo pipefail
|
||||
CHECK="$(cd "$(dirname "$0")" && pwd)/check_no_patent.sh"
|
||||
T=$(mktemp -d)
|
||||
trap 'rm -rf "$T"' EXIT
|
||||
ok=1
|
||||
pdf() { # pdf <dir> <name> <title>
|
||||
mkdir -p "$1"
|
||||
printf '\\documentclass{article}\\title{%s}\\usepackage{hyperref}\\hypersetup{pdftitle={%s}}\\begin{document}x\\end{document}\n' "$3" "$3" > "$T/t.tex"
|
||||
(cd "$T" && pdflatex -interaction=nonstopmode -halt-on-error t.tex > /dev/null 2>&1) && mv "$T/t.pdf" "$1/$2"
|
||||
}
|
||||
expect() { # expect <pass|refuse> <dir> "what"
|
||||
local out rc
|
||||
out=$(bash "$CHECK" "$2" 2>&1); rc=$?
|
||||
if { [ "$1" = pass ] && [ $rc -eq 0 ]; } || { [ "$1" = refuse ] && [ $rc -eq 1 ] && grep -q "refused" <<<"$out"; }; then
|
||||
echo "PASS: $3"; else echo "FAIL: $3 (exit $rc: $out)"; ok=0; fi
|
||||
}
|
||||
pdf "$T/good" book.pdf "LithosAnanke"
|
||||
pdf "$T/good" ssrn.pdf "Steady-State Machines: a paper"
|
||||
expect pass "$T/good" "the book and the SSRN paper: passed"
|
||||
pdf "$T/named" patent.pdf "Something"
|
||||
expect refuse "$T/named" "a file named for the patent: refused"
|
||||
pdf "$T/titled" vol9.pdf "Steady-State Machine --- Patent Application"
|
||||
expect refuse "$T/titled" "a PDF titled as the patent, under another name: refused"
|
||||
mkdir -p "$T/empty"
|
||||
expect pass "$T/empty" "an empty directory: passed"
|
||||
expect refuse "$T/missing" "a directory that is not there: refused, not passed by default"
|
||||
echo "RESULT: $([ $ok = 1 ] && echo PASS || echo FAIL)"
|
||||
[ $ok = 1 ]
|
||||
Reference in New Issue
Block a user