Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

skills.sh reads the feed app in the tree it checks when the tree has one, as its files are; l2.sh takes the app from the commit

shinyobjectz6ee015071d18
diff --git a/tools/l2.sh b/tools/l2.sh
index 12b62a0c..8f55e76f 100755
--- a/tools/l2.sh
+++ b/tools/l2.sh
@@ -29,12 +29,17 @@ mkdir -p "$OUT/bin" "$OUT/p26"
free() { df -g / | awk 'NR==2{print $4}'; }
say() { echo "L2 $*"; }
-# the commit, and the app at that commit's pointer
+# the commit, and the app: in its tree since 11-16 (a clone of the old raea-feed app left in the checkout goes first);
+# before, the raea-feed commit at that commit's pointer, in a clone of its own
+intree=; [ "$(git -C "$T" cat-file -t "$SHA:apps/app" 2>/dev/null)" = tree ] && intree=1
+[ -n "$intree" ] && [ -d "$T/apps/app/.git" ] && rm -rf "${T:?}/apps/app"
git -C "$T" checkout -q -f "$SHA" || exit 2
[ -z "$(git -C "$T" status --porcelain --untracked-files=no -- . ':!apps/app')" ] || { say "checkout has tracked changes"; exit 2; }
app=$(git -C "$T" ls-tree HEAD apps/app | awk '{print $3}')
-[ -d "$T/apps/app/.git" ] || { rmdir "$T/apps/app" 2>/dev/null; git clone -q "$ROOT/apps/app" "$T/apps/app" || exit 2; }
-git -C "$T/apps/app" fetch -q "$ROOT/apps/app" && git -C "$T/apps/app" checkout -q -f "$app" || exit 2
+if [ -z "$intree" ]; then
+ [ -d "$T/apps/app/.git" ] || { rmdir "$T/apps/app" 2>/dev/null; git clone -q "$ROOT/apps/app" "$T/apps/app" || exit 2; }
+ git -C "$T/apps/app" fetch -q "$ROOT/apps/app" && git -C "$T/apps/app" checkout -q -f "$app" || exit 2
+fi
say "commit: $(git -C "$T" log --oneline -1 | cut -c1-90) | app ${app:0:8}"
# what git doesn't track, linked from ~/raea (once; never through a link, never trimming a name)
diff --git a/tools/release.sh b/tools/release.sh
index ed54d0e4..816c05cd 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -60,7 +60,8 @@ untar() {
return $rc
}
raea_bin=$bin/raea; [ -f "$raea_bin.exe" ] && raea_bin=$raea_bin.exe
-# The gate reads the feed app's checkout (apps/app), which is private: a public checkout (release.yml's runners) has
+# The gate reads the feed app (apps/app), in raea's own tree since 11-16, so every checkout of a later REF has it and
+# skills.sh reads the app REF holds. Before, the app was private and a public checkout (release.yml's runners) had
# none. There, RAEA_SKILLS_PASSED=SHA stands for it: the gate passed at SHA where the feed app is (a maintainer's
# checkout), and it counts for REF only when what the gate reads (the skills and guides, the glossary, the CLI's usage,
# skills.sh) is the same at both. With neither, the release refuses (T1f, 11-07)
diff --git a/tools/release/linux/build.sh b/tools/release/linux/build.sh
index 1cb8f7e9..c19e8355 100755
--- a/tools/release/linux/build.sh
+++ b/tools/release/linux/build.sh
@@ -2,8 +2,9 @@
# In the container (Dockerfile here): a Linux release from /rel, a clone at the release SHA, with /target a folder of its
# own: raea with the plugin catalog and the two app hosts (targets.feature T1f), each in a cargo call, stripped, then
# tools/release.sh under Xvfb (its release check opens the web target's window, which needs a display on Linux). Run
-# release.sh with bash: zsh reads `$ref:apps` as a path modifier. The skills gate reads /rel/apps/app (clone the
-# feed app there at the commit the release SHA records). A virtiofs /target holds deleted files until the VM stops.
+# release.sh with bash: zsh reads `$ref:apps` as a path modifier. The skills gate reads /rel/apps/app (in the release
+# SHA's own tree since 11-16; before, a clone of the feed app at the commit it records). A virtiofs /target holds
+# deleted files until the VM stops.
set -uo pipefail
V=${1:?version}; jobs=${2:-8}
export CARGO_TARGET_DIR=/target CARGO_INCREMENTAL=0
diff --git a/tools/skills.sh b/tools/skills.sh
index 36d62788..ed597cb4 100755
--- a/tools/skills.sh
+++ b/tools/skills.sh
@@ -27,10 +27,11 @@
# Sources: cli.md from `raea help --json` (engine/cli/src/usage.rs); feed.md from FEED_TOOLS (apps/app
# src/acp/protocol.ts), with each tool's access tag; files.md from a workspace and project raea makes in a scratch
# folder, and the ~/.raea paths engine/cli and the feed's host name; sdk.md from the exports of each sdk/raea/src entry.
-# RAEA_BIN picks the raea (default: this checkout's target/debug/raea, else target/release/raea, else PATH), and
-# RAEA_APP the feed app's checkout (default apps/app; an L0 export has no submodules, so L0 names the shared one), read
-# at RAEA_APP_REV: the commit raea's tree records for apps/app (L0 passes its tree's), so what's generated follows the
-# submodule pointer, not whatever that checkout has on disk.
+# RAEA_BIN picks the raea (default: this checkout's target/debug/raea, else target/release/raea, else PATH). The feed
+# app is the one in this tree when the tree has it (apps/app is raea's own since 11-16, docs/public-first.feature), read
+# as its files are, so what's generated follows the commit being checked. A tree without it (before 11-16) reads
+# RAEA_APP, the app's own checkout (default apps/app; L0 names the shared one), at RAEA_APP_REV, the commit raea's tree
+# records for it (L0 passes its tree's), not whatever that checkout has on disk.
set -euo pipefail
ROOT=$(cd "$(dirname "$0")/.." && pwd)
cd "$ROOT"
@@ -58,14 +59,28 @@ copies() {
COPY_DIRS="3d motion craft craft/modes craft/verbs craft/checks craft/match-cuts"
SKILL_ONLY="3d/plugins.md 3d/rows.md"
HEAD_LINE="<!-- generated by tools/skills.sh gen; do not edit -->"
-APP=${RAEA_APP:-apps/app}
+APP=${RAEA_APP:-apps/app} APP_REV=
# check-cli reads only raea's help, so it runs where the feed app isn't (a public checkout: release.yml's runners)
if [ "${1:-}" != check-cli ]; then
+ # the app in this tree, tracked here: its files as they are, whatever RAEA_APP names
+ if git ls-files --error-unmatch apps/app/src/acp/protocol.ts >/dev/null 2>&1; then APP=apps/app; fi
[ -f "$APP/src/acp/protocol.ts" ] || { echo "skills.sh: no feed app at $APP (RAEA_APP names its checkout)" >&2; exit 2; }
APP=$(cd "$APP" && pwd)
- APP_REV=${RAEA_APP_REV:-$(git rev-parse -q --verify HEAD:apps/app 2>/dev/null || git -C "$APP" rev-parse HEAD)}
- git -C "$APP" cat-file -e "$APP_REV" 2>/dev/null || { echo "skills.sh: apps/app has no commit $APP_REV (fetch raea-feed)" >&2; exit 2; }
+ # an app with a checkout of its own (raea-feed, before 11-16): read at the commit raea records
+ if [ -e "$APP/.git" ]; then
+ APP_REV=${RAEA_APP_REV:-$(git rev-parse -q --verify HEAD:apps/app 2>/dev/null || git -C "$APP" rev-parse HEAD)}
+ git -C "$APP" cat-file -e "$APP_REV" 2>/dev/null || { echo "skills.sh: apps/app has no commit $APP_REV (fetch raea-feed)" >&2; exit 2; }
+ fi
fi
+# a file of the app's, from its root: at APP_REV in its own checkout, else as it is in this tree
+app_show() { if [ -n "$APP_REV" ]; then git -C "$APP" show "$APP_REV:$1"; else cat "$APP/$1"; fi; }
+# git grep over the app's tracked files (OPTION... PATTERN -- PATHSPEC...), paths from its root
+app_grep() {
+ local a=()
+ while [ $# -gt 0 ] && [ "$1" != -- ]; do a+=("$1"); shift; done
+ if [ -n "$APP_REV" ]; then git -C "$APP" grep "${a[@]}" "$APP_REV" "$@" | sed "s|^$APP_REV:||"
+ else git -C "$APP" grep "${a[@]}" "$@"; fi
+}
raea_bin() {
if [ -n "${RAEA_BIN:-}" ]; then echo "$RAEA_BIN"
@@ -95,7 +110,7 @@ gen_cli() {
gen_platforms() {
# the app's publishing guidelines (apps/app src/publish/specs.ts at the recorded commit; it imports nothing)
local p; p=$(mktemp -d "${TMPDIR:-/tmp}/skills-platforms.XXXXXX")
- git -C "$APP" show "$APP_REV:src/publish/specs.ts" > "$p/specs.ts"
+ app_show src/publish/specs.ts > "$p/specs.ts"
bun -e '
const { SPECS } = await import(process.argv[1] + "/specs.ts")
console.log(JSON.stringify(Object.entries(SPECS).filter(([, s]) => s.aspects.length).map(([name, s]) => ({ name, ...s }))))
@@ -123,7 +138,7 @@ gen_platforms() {
gen_feed() {
# protocol.ts at the recorded commit (it imports nothing), evaluated from a scratch copy
local p; p=$(mktemp -d "${TMPDIR:-/tmp}/skills-feed.XXXXXX")
- git -C "$APP" show "$APP_REV:src/acp/protocol.ts" > "$p/protocol.ts"
+ app_show src/acp/protocol.ts > "$p/protocol.ts"
bun -e '
const { FEED_TOOLS } = await import(process.argv[1] + "/protocol.ts")
console.log(JSON.stringify(Object.entries(FEED_TOOLS).map(([name, t]) => ({ name, ...t }))))
@@ -199,7 +214,7 @@ gen_files() {
echo "| path | moved by | named in |"
echo "|---|---|---|"
{ git grep -nE '\.raea(/|", ")[A-Za-z]' -- engine io runtime ':!*.test.*' ':!*/tests/*' ':!*.md'
- git -C "$APP" grep -nE '\.raea(/|", ")[A-Za-z]' "$APP_REV" -- host ':!*.test.*' | sed "s|^$APP_REV:|apps/app/|"
+ app_grep -nE '\.raea(/|", ")[A-Za-z]' -- host ':!*.test.*' | sed "s|^|apps/app/|"
} 2>/dev/null | perl -ne '
my ($f, $text) = /^([^:]+):\d+:(.*)$/ or next;
while ($text =~ m{(?<![\w.-]/)(?<![\w-])\.raea(?:/|", ")([A-Za-z][A-Za-z0-9_.-]*(?:/[A-Za-z][A-Za-z0-9_.-]*)?)}g) {
@@ -363,7 +378,7 @@ check() {
[ $stale_help = 1 ] || "$R" help --json | jq -r '.verbs[] | select(.own_parser | not) | "\(.verb)\t\([.flags[].flag] | join(" "))"' > "$tmp/flags"
# 4. RAEA_* variables: read somewhere outside the docs
git grep -ohE 'RAEA_[A-Z0-9_]+' -- ':!*.md' ':!*.feature' > "$tmp/vars" 2>/dev/null || true
- git -C "$APP" grep -ohE 'RAEA_[A-Z0-9_]+' "$APP_REV" -- ':!*.md' >> "$tmp/vars" 2>/dev/null || true
+ app_grep -ohE 'RAEA_[A-Z0-9_]+' -- ':!*.md' >> "$tmp/vars" 2>/dev/null || true
sort -u -o "$tmp/vars" "$tmp/vars"
texts | WORDS="$words" FLAGS="$tmp/flags" VARS="$tmp/vars" STALE_HELP=$stale_help perl -e '
my @words = grep { length } split /\n/, $ENV{WORDS};