Files
raea/tools/legacy-names.sh
shane d873402ac5 raea goal is the loop, raea make the asset tools (#269)
One loop, raea goal: every rule in TypeScript, held at edit, render, publish and done (goal check, tasks, judge, seen, gates, next); the brief's contract is goal: (one goal or a list, a workflow inline), and its plan is plan:. raea make is making a finished asset: character, clothes, motion, solid, wear, splat, physics, bake, sounds, component, the kit pipeline and shots. Instruments (check, judge, ask, world, scene faults, light check) stay top-level. With it: the montage pack (MK48-MK51), JavaScriptCore fixes raea goal needs (CommonJS named exports, reserved words too, dynamic import of file URLs, process.exit from a promise, stdin for -), raea-cli-goal and raea-cli-refused split out of raea-cli, and skills at raea-skills 105aede.
2026-11-29 18:43:09 -08:00

82 lines
4.8 KiB
Bash
Executable File

#!/bin/bash
# What raea's loop made legacy, named nowhere (docs/goal.feature MK41, MK45): every rule is raea/goal's (sdk/goal), run
# by `raea goal check` at edit, render, publish and done; `raea make` is the asset tools; and the commands, files and
# code they replaced are gone with no alias. A skill, a guide, the manual, help text or code that still names one teaches an agent a command that isn't
# there, so this fails on each, with its file and line and what to say instead.
#
# tools/legacy-names.sh [DIR...] this checkout and its submodules (skills: raea-skills), and each DIR given (a raea-platform,
# raea-skills or raea-feed checkout); CI runs it on this one
#
# Not held to it: this script, docs/goal.feature (which says what was replaced), the changelogs (docs/manual/whats-new),
# code that recognises an older raea by what it prints ("raea make status [DIR] ..."), and the code that moves a
# plan.org to plan.ts once (SKIP below names each).
set -euo pipefail
cd "$(dirname "$0")/.."
# each gone name, and what to say instead
NAMES=(
'raea make status => raea goal check (--at done is what the Stop hook and raea cloud run)'
'raea words check => raea goal check: its words pack holds an export to CUT.lines.txt'
'raea frames check => raea goal check: its frames pack'
'raea frames place => raea make place'
'raea sound check => raea goal check: its sound pack'
'(frames|sound|words)-check\.json => FILE.check.json (raea goal check)'
'runtime/(cut|goal)-plan => sdk/goal/src/packs/ (cut.ts, goal.ts)'
'raea-runtime-(cut|goal)-plan => sdk/goal (raea/goal)'
'naming-check\.ts => raea/goal'"'"'s naming pack'
'raea make (check|seen|look|judge|gates)\b => raea goal check|seen|judge|gates (MK45: goal is the loop, make the asset tools)'
'raea make plan\b => raea make blockout (a project'"'"'s tasks: raea goal tasks)'
'raea next\b => raea goal next'
'raea (clothes|motion|solid|wear|splat|physics|bake|sao|tokensynth|sounds|component)( |`|$) => raea make clothes, motion, solid... (MK45: the asset tools are under make)'
'raea part (add|list) => raea make component add|list'
'(@?raea/make|sdk/make)\b => raea/goal (sdk/goal)'
'make\.feature => docs/goal.feature'
'review/make\.json => review/goal.json'
'review/goal\.judge\.json => review/judge/NAME.json'
'make: (cut|scene|kit|shot|goal)\( => goal: cut(...), rules(...) (brief.ts'"'"'s `goal`)'
'RAEA_CLOUD_(FRAMES|SOUND) => RAEA_CLOUD_CHECK'
'/v1/faces => /v1/scene (its faces)'
'(NAMING|SIZES|SOUND)_METHOD => RAEA_METHOD (one paragraph on the loop)'
'plan\.org => brief.ts'"'"'s `plan` (raea goal tasks; docs/plan.feature, MK40, MK44)'
'plan\.ts beside (its|the) brief => brief.ts'"'"'s `plan` (raea goal tasks; MK44)'
'(\bmake|`make`) contract => brief.ts'"'"'s `goal` (cut(), rules()...: MK45)'
'\bMake(Cut|CutPlan|Quoted|Phrase|Cta|Open)\b => CutGoal, CutPlan, Quoted, Phrase, Cta, CutOpen (raea/brief.gen)'
'make-checks => goal-checks (raea cloud: the brief'"'"'s goals checked at every stop)'
'#\+(TODO|LINK_STATES): => plan.ts: `keywords`, `trackers`'
'sdk/task/src/org\.ts => sdk/task/src/doc.ts and literal.ts'
'text/org => text/typescript (a plan is plan.ts)'
)
SKIP=(':!tools/legacy-names.sh' ':!docs/goal.feature' ':!docs/manual/whats-new/**' ':!**/CHANGELOG*' ':!target/**'
# the one move from Org to plan.ts (MK40): sdk/task's, the raea app's, raea cloud's and their tests, and the plan
# spec's history of it
# (a pathspec's * crosses folders), and runs an agent recorded before it (test fixtures)
':!*from-org.ts' ':!*from-org.test.ts' ':!docs/plan.feature' ':!*host/plan.ts' ':!*host/plan.test.ts'
':!*harness/plan.ts' ':!*harness/plans.ts' ':!*cloud/test/plan.test.ts' ':!*scripts/migrate.ts' ':!*test/fixtures/runs-audit/*')
# what an older raea prints, matched to say it's older
OLDER='make status \\?\[DIR'
# the old file the move keeps (host/plan.ts renames a plan.org to .raea/plan.org.was), as skills' generated files.md
# lists what host/plan.ts names
KEPT='plan\.org\.was'
fail=0
scan() {
local dir=$1 sub=${2:-}
for entry in "${NAMES[@]}"; do
local re=${entry%% => *} say=${entry#* => }
while IFS= read -r hit; do
[ -n "$hit" ] || continue
printf 'FAIL legacy name: %s%s: "%s" is gone; say %s\n' "${dir:+$dir/}" "$(cut -d: -f1,2 <<<"$hit")" "$(grep -oE "$re" <<<"$hit" | head -1)" "$say"
fail=1
done < <(git -C "${dir:-.}" grep -n -I -E $sub -e "$re" -- . "${SKIP[@]}" 2>/dev/null | grep -vE "$OLDER|$KEPT" || true)
done
}
# this checkout with what isn't committed yet, then each submodule as a repo of its own (skills: raea-skills)
scan "" --untracked
for m in $(git config -f .gitmodules --get-regexp '\.path$' | awk '{print $2}'); do
[ -e "$m/.git" ] && scan "$m"
done
for d in "$@"; do scan "$d"; done
if [ $fail = 0 ]; then echo "legacy names: none"; fi
exit $fail