unify s/ and b/ namespaces: batch jobs now live under s/

Option C implementation: single namespace with composable file tables.
Batch jobs are sessions with a reduced file set — the directory
contents declare the capability.

- core: SessionStore absorbs BatchStore; s/new detects batch format
- 9p: /b/ removed entirely; all routing through /s/
- scripts/b/* moved to scripts/s/*; paths updated
- subagent_spawn, optimize: /b/q -> /s/q
- scripts/b/ removed
This commit is contained in:
Levi Neely 2026-04-23 18:50:05 +02:00
parent 7477a0f78d
commit f4c340c2cb
7 changed files with 13 additions and 13 deletions

2
9p

@ -1 +1 @@
Subproject commit 9f5286c8b2f974906eb5c0dfee5bebee270a5bb5
Subproject commit 8d5be7212fb9abcf540c946b4690831ac226fd3e

2
core

@ -1 +1 @@
Subproject commit 8f856ea186d558597b5d8d3b0a2320ae89d73065
Subproject commit 10dd4ee82fa0b0aeb1bd3101c21b13e856b9b142

View File

@ -1,10 +1,10 @@
#!/usr/bin/env bash
# b/cleanup: remove all batch jobs with state "done".
# s/cleanup: remove all batch jobs with state "done".
set -euo pipefail
OLLIE=${OLLIE:-$HOME/mnt/ollie}
for job in "$OLLIE"/b/*/; do
for job in "$OLLIE"/s/*/; do
[ -d "$job" ] || continue
state=$(cat "$job/state" 2>/dev/null | tr -d '[:space:]') || continue
case "$state" in

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# b/job: non-interactive ollie query via b/ namespace.
# s/job: non-interactive ollie query via s/ namespace.
#
# Usage: oq [flags] [prompt...]
# echo "prompt" | oq [flags]
@ -92,7 +92,7 @@ cwd=${cwd:-$(pwd)}
printf 'parallel=%s\n' "$parallel"
printf -- '---\n'
printf '%s\n' "$prompt"
} > "$MOUNT/b/new" || die "failed to submit job"
} > "$MOUNT/s/new" || die "failed to submit job"
if [ "$bg" -eq 1 ]; then
for i in $(seq 0 $((parallel - 1))); do
@ -109,7 +109,7 @@ if [ "$parallel" -gt 1 ]; then
pids=()
for i in $(seq 0 $((parallel - 1))); do
id="${name}-${i}"
B="$MOUNT/b/$id"
B="$MOUNT/s/$id"
(
exec 3< "$B/statewait"
while true; do
@ -128,7 +128,7 @@ if [ "$parallel" -gt 1 ]; then
echo 1 > "$abort"
for j in $(seq 0 $((parallel - 1))); do
jid="${name}-${j}"
[ "$jid" != "$id" ] && rm -r "$MOUNT/b/$jid" 2>/dev/null || true
[ "$jid" != "$id" ] && rm -r "$MOUNT/s/$jid" 2>/dev/null || true
done
fi
[ "$keep" -eq 0 ] && rm -r "$B" 2>/dev/null || true
@ -153,7 +153,7 @@ if [ "$parallel" -gt 1 ]; then
for pid in "${pids[@]}"; do wait "$pid" || rc=1; done
else
id="${name}-0"
B="$MOUNT/b/$id"
B="$MOUNT/s/$id"
exec 3< "$B/statewait"
while true; do

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# b/q: foreground one-shot query; output goes to stdout.
# s/q: foreground one-shot query; output goes to stdout.
for _arg; do
[ "$_arg" = "-help" ] && cat <<'EOF' && exit 0
usage: q [flags] [prompt...]

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# b/sched: submit a background job; prints the b/ path for each job.
# s/sched: submit a background job; prints the b/ path for each job.
for _arg; do
[ "$_arg" = "-help" ] && cat <<'EOF' && exit 0
usage: sched [flags] [prompt...]
@ -22,5 +22,5 @@ if [ $# -eq 0 ] && [ -t 0 ]; then
fi
OLLIE=${OLLIE:-$HOME/mnt/ollie}
"${0%/*}/job" -bg "$@" | while IFS= read -r id; do
[ -n "$id" ] && printf '%s/b/%s\n' "$OLLIE" "$id"
[ -n "$id" ] && printf '%s/s/%s\n' "$OLLIE" "$id"
done

View File

@ -47,7 +47,7 @@ fi
[ -z "$prompt" ] && { printf 'optimize: empty prompt\n' >&2; exit 1; }
Q="${0%/*}/../b/q"
Q="${0%/*}/../s/q"
c_flags=()
j_flags=()