diff --git a/doc/OBSERVATIONS.md b/doc/OBSERVATIONS.md index 9a8e585..46d6328 100644 --- a/doc/OBSERVATIONS.md +++ b/doc/OBSERVATIONS.md @@ -23,7 +23,7 @@ **AI pipelines with standard tools** — ollie scripts compose into multi-stage AI pipelines via Unix pipes. Proof-of-concept: ``` -; s/optimize -n 2 -cm qwen/qwen3-8b -jm 'anthropic/claude-opus-4.6' 'generate a hello world program. use c++.' >[2]/dev/null | s/q +; s/optimize -n 2 -cm qwen/qwen3-8b -jm 'anthropic/claude-opus-4.6' 'generate a hello world program. use c++.' >[2]/dev/null | b/q ``` -`s/optimize` generates and judges candidate prompts, emitting the best to stdout; `s/q` acts on it. Any tool that reads stdin and writes stdout is already a pipeline stage. +`s/optimize` generates and judges candidate prompts, emitting the best to stdout; `b/q` acts on it. Any tool that reads stdin and writes stdout is already a pipeline stage. diff --git a/scripts/README.md b/scripts/README.md index ac8ceae..ace426f 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -9,8 +9,8 @@ mounted filesystem under `s/`, so they are available without any `$PATH` changes ```sh exec $OLLIE/s/sh # start interactive shell $OLLIE/s/job "my prompt" # batch job (foreground) -$OLLIE/s/q "my prompt" # foreground one-shot query -$OLLIE/s/sched "my prompt" # background job; prints b/ path +$OLLIE/b/q "my prompt" # foreground one-shot query +$OLLIE/b/sched "my prompt" # background job; prints b/ path $OLLIE/s/ls # list sessions $OLLIE/s/kill # kill a session $OLLIE/s/optimize "prompt" # generate and return best optimized prompt @@ -19,6 +19,7 @@ $OLLIE/s/optimize "prompt" # generate and return best optimized prompt Scripts are organized by the filesystem namespace they are hosted under: - `s/` — scripts hosted under the `s/` namespace +- `b/` — scripts hosted under the `b/` namespace --- @@ -104,6 +105,42 @@ With `-parallel N` and N > 1, results are separated by `=== {id} ===` headers. --- +## b/q + +Foreground one-shot query; thin wrapper around `s/job`. Output goes to stdout. + +``` +b/q [flags] [prompt...] +echo "prompt" | b/q [flags] +``` + +Accepts the same flags as `s/job`. + +--- + +## b/sched + +Submit a background job; prints the `b/` path for each job. + +``` +b/sched [flags] [prompt...] +echo "prompt" | b/sched [flags] +``` + +**Flags** + +| Flag | Description | +|---|---| +| `-name N` | Base job name | +| `-cwd DIR` | Working directory (default: `pwd`) | +| `-agent A` | Agent config name | +| `-backend B` | Backend override | +| `-model M` | Model override | +| `-output FORMAT` | Output format hint (e.g. `json`) | +| `-parallel N` | Submit N parallel jobs (default: 1) | + +--- + ## s/optimize Generates N candidate optimized prompts, judges them, and returns the best one to stdout. Debugging output (progress messages) goes to stderr. @@ -128,7 +165,7 @@ echo "prompt" | s/optimize [flags] ```sh s/optimize "Summarize this document" s/optimize -n 5 -cm qwen/qwen3-8b -jm anthropic/claude-opus-4.6 "Write a haiku" -s/optimize "generate a hello world program. use c++." >[2]/dev/null | s/q +s/optimize "generate a hello world program. use c++." >[2]/dev/null | b/q ``` Outputs to stdout, making it composable with other pipeline stages. diff --git a/scripts/s/q b/scripts/b/q similarity index 86% rename from scripts/s/q rename to scripts/b/q index beec2c5..630a7d0 100644 --- a/scripts/s/q +++ b/scripts/b/q @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# s/q: foreground one-shot query; output goes to stdout. +# b/q: foreground one-shot query; output goes to stdout. for _arg; do [ "$_arg" = "-help" ] && cat <<'EOF' && exit 0 usage: q [flags] [prompt...] @@ -16,4 +16,4 @@ Flags: -help show this help EOF done -exec "${0%/*}/job" "$@" +exec "${0%/*}/../s/job" "$@" diff --git a/scripts/s/sched b/scripts/b/sched similarity index 84% rename from scripts/s/sched rename to scripts/b/sched index 79c498e..00f4bec 100644 --- a/scripts/s/sched +++ b/scripts/b/sched @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# s/sched: submit a background job; prints the b/ path for each job. +# b/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...] @@ -17,6 +17,6 @@ Flags: EOF done OLLIE=${OLLIE:-$HOME/mnt/ollie} -"${0%/*}/job" -bg "$@" | while IFS= read -r id; do +"${0%/*}/../s/job" -bg "$@" | while IFS= read -r id; do [ -n "$id" ] && printf '%s/b/%s\n' "$OLLIE" "$id" done diff --git a/scripts/s/optimize b/scripts/s/optimize index d14b2fc..a2a68a7 100755 --- a/scripts/s/optimize +++ b/scripts/s/optimize @@ -47,7 +47,7 @@ fi [ -z "$prompt" ] && { printf 'optimize: empty prompt\n' >&2; exit 1; } -Q="${0%/*}/q" +Q="${0%/*}/../b/q" c_flags=() j_flags=()