Major project setup: experimental/dev/main flow, release sweep mode, spec rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
RobinFiredrake 2026-12-01 12:52:37 -06:00
parent 160848f881
commit 64d14febf4
3 changed files with 32 additions and 5 deletions

View file

@ -13,3 +13,16 @@ How to work on it: `docs/DESIGN.md` §5. Module map: `docs/ARCHITECTURE.md`.
No real waiting: the runner uses simulated time (`--fixed-fps 60`). No real waiting: the runner uses simulated time (`--fixed-fps 60`).
- A suite that loads its own board calls `start_main(false)`: building the demo is slow. - A suite that loads its own board calls `start_main(false)`: building the demo is slow.
- Suites extend `TestBase` (no UI) or, only if they need the app, `AppTestBase`. - Suites extend `TestBase` (no UI) or, only if they need the app, `AppTestBase`.
## Major project: branches, gates and specs
TableTarot is a **major** project (Robin, 2026-12-01). Rules: `~/AI/Rules/coding/tests.md`
("Major and minor projects") and `coding/code.md` ("Specs"). In short:
- Flow: feature branch → `experimental` → `dev` → `main`. Branch features off `experimental`.
- **Into `experimental`: no gate.** The agent tests only its own code, then merges.
- **Dev gate** (`experimental` → `dev`): the user tries it and says OK, then one full
`tools/run_tests.sh` run plus the spec checks.
- **Release sweep** (`dev` → `main`): `tools/run_tests.sh --sweep` (every suite, 5× the budget)
plus the spec health report.
- Pushing `experimental`, `dev` or `main` needs the user's OK. Own work branches: push freely.
- **Specs are required** (Coderstanding app `tabletower`). Plan new behaviour as a spec Draft
branch first; only the user approves specs. Check: `coderstanding specs tabletower --lines`.

View file

@ -302,8 +302,10 @@ that works on any theme (solid background, stronger text, thicker borders, no ef
- **GDScript traps hit today:** don't name methods `_set`, `_get` or `convert` (built-ins); compare - **GDScript traps hit today:** don't name methods `_set`, `_get` or `convert` (built-ins); compare
roll-node Dictionaries with `is_same()`, not `==` (it compares contents); in Python patch roll-node Dictionaries with `is_same()`, not `==` (it compares contents); in Python patch
scripts, avoid apostrophes inside single-quoted replacement strings. scripts, avoid apostrophes inside single-quoted replacement strings.
- **Git:** origin `git@forgejo.smhub.duckdns.org:RobinFiredrake/TableTower.git`. Feature branch, - **Git:** origin `git@forgejo.smhub.duckdns.org:RobinFiredrake/TableTower.git`. Major project
fast-forward merge to `main` when the user asks. Co-Authored-By line on commits. (2026-12-01): feature branch → `experimental` → `dev` → `main`, with a dev gate and a release
sweep (`CLAUDE.md`). Worktree for `experimental`: `~/Repos/Worktrees/TableTower/experimental`.
Co-Authored-By line on commits.
- **Agents:** only for large, separate jobs. Worktree briefs start with `git reset --hard <branch>`, - **Agents:** only for large, separate jobs. Worktree briefs start with `git reset --hard <branch>`,
own specific files, keep public APIs as delegators, don't touch tests. The user's computer has own specific files, keep public APIs as delegators, don't touch tests. The user's computer has
been crashing: an interrupted agent's work stays in `.claude/worktrees/`; resume it with been crashing: an interrupted agent's work stays in `.claude/worktrees/`; resume it with
@ -313,6 +315,9 @@ that works on any theme (solid background, stronger text, thicker borders, no ef
- **Coderstanding** (structure scanner, tours) is installed: `coderstanding` on PATH (venv - **Coderstanding** (structure scanner, tours) is installed: `coderstanding` on PATH (venv
`~/.local/share/coderstanding/venv`), app `tabletower`, data and tours in `~/.local/share/coderstanding/venv`), app `tabletower`, data and tours in
`~/.local/share/coderstanding/tabletower`, viewer http://127.0.0.1:8517/. Tours teach the `~/.local/share/coderstanding/tabletower`, viewer http://127.0.0.1:8517/. Tours teach the
user (new to coding): plain words, explain basics. Update: pull user (new to coding): plain words, explain basics. Specs are required (major project):
`coderstanding specs tabletower --lines`. Update: pull
https://forgejo.smhub.duckdns.org/digit/coderstanding and `pip install` it into that venv. https://forgejo.smhub.duckdns.org/digit/coderstanding and `pip install` it into that venv.
After a Fedora Python upgrade the venv breaks (`No module named 'coderstanding'`): rebuild it
with `python3 -m venv` and reinstall (done for 3.15 on 2026-12-01, v0.4.0).
- **Keep this page short.** Put history in HISTORY.md and file maps in ARCHITECTURE.md. - **Keep this page short.** Put history in HISTORY.md and file maps in ARCHITECTURE.md.

View file

@ -9,10 +9,19 @@
# A suite fails on a failed check, a SCRIPT ERROR or a Godot crash. # A suite fails on a failed check, a SCRIPT ERROR or a Godot crash.
# #
# Usage: tools/run_tests.sh [name-filter] e.g. tools/run_tests.sh inspector # Usage: tools/run_tests.sh [name-filter] e.g. tools/run_tests.sh inspector
# tools/run_tests.sh --sweep release sweep: every suite, 5x the budget
# Exit codes: 0 all passed, 1 a suite failed, 2 over budget, nothing failed. # Exit codes: 0 all passed, 1 a suite failed, 2 over budget, nothing failed.
# Failing suites print their first 8 error lines; passing output is discarded. # Failing suites print their first 8 error lines; passing output is discarded.
set -u set -u
readonly BUDGET_SECS=15 readonly BUDGET_SECS=15
# The release sweep (before dev goes into main) gets 5 times the budget: a rule of the user's.
readonly SWEEP_MULTIPLIER=5
limit_secs=$BUDGET_SECS
if [[ "${1:-}" == "--sweep" ]]; then
limit_secs=$(( BUDGET_SECS * SWEEP_MULTIPLIER ))
shift
(( $# )) && { echo "--sweep runs every suite: no filter"; exit 1; }
fi
cd "$(dirname "$0")/.." || exit 1 cd "$(dirname "$0")/.." || exit 1
GODOT="${GODOT:-$HOME/apps/Godot_v4.7.2-stable_linux.x86_64}" GODOT="${GODOT:-$HOME/apps/Godot_v4.7.2-stable_linux.x86_64}"
TIMES=.godot/test_times # git-ignored: "<milliseconds> <suite>" TIMES=.godot/test_times # git-ignored: "<milliseconds> <suite>"
@ -20,7 +29,7 @@ CLASSES=.godot/global_script_class_cache.cfg
start_ms=$(date +%s%3N) start_ms=$(date +%s%3N)
now_ms() { echo $(( $(date +%s%3N) - start_ms )); } now_ms() { echo $(( $(date +%s%3N) - start_ms )); }
# 1 s is kept back for stopping suites and printing the report. # 1 s is kept back for stopping suites and printing the report.
left_ms() { echo $(( BUDGET_SECS * 1000 - 1000 - $(now_ms) )); } left_ms() { echo $(( limit_secs * 1000 - 1000 - $(now_ms) )); }
# Runs a command at low priority; it is killed at the deadline. # Runs a command at low priority; it is killed at the deadline.
in_budget() { in_budget() {
local left; left=$(left_ms) local left; left=$(left_ms)
@ -105,7 +114,7 @@ for n in "${!last_ms[@]}"; do
[[ -e "tests/$n.gd" ]] && echo "${last_ms[$n]} $n" [[ -e "tests/$n.gd" ]] && echo "${last_ms[$n]} $n"
done | sort -n >"$TIMES" done | sort -n >"$TIMES"
took="$(awk -v ms="$(now_ms)" 'BEGIN { printf "%.1f", ms / 1000 }')s of ${BUDGET_SECS}s" took="$(awk -v ms="$(now_ms)" 'BEGIN { printf "%.1f", ms / 1000 }')s of ${limit_secs}s"
if (( ${#not_run[@]} )); then if (( ${#not_run[@]} )); then
echo "NOT RUN (${#not_run[@]}): ${not_run[*]}" echo "NOT RUN (${#not_run[@]}): ${not_run[*]}"
(( ${#stopped[@]} )) && echo "Stopped while running: ${stopped[*]}" (( ${#stopped[@]} )) && echo "Stopped while running: ${stopped[*]}"