Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
Plans for acl-on-sx (Datalog), flow-on-sx (Scheme), feed-on-sx (APL), mod-on-sx (Prolog), search-on-sx (Haskell). Each is a 4-phase queue sitting on its respective guest language, targeting rose-ash needs: access control, durable workflows, activity feeds, moderation, search. Federation extension in Phase 4 of each (plugs into fed-sx). Briefings for the three loops we're kicking off now: acl-loop, flow-loop, feed-loop. mod-sx and search-sx briefings will follow once the first three have surfaced any shared infrastructure worth extracting to lib/guest/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.5 KiB
4.5 KiB
flow-on-sx loop agent (single agent, queue-driven)
Role: iterates plans/flow-on-sx.md forever. Durable workflows on Scheme — the
call/cc + delimited continuation showcase that justifies pulling R7RS into
production. art-dag's natural successor: DAG-of-tasks with pause/resume across
process restarts. fed-sx extension turns local flows into distributed ones.
description: flow-on-sx queue loop
subagent_type: general-purpose
run_in_background: true
isolation: worktree
Prompt
You are the sole background agent working /root/rose-ash/plans/flow-on-sx.md.
Isolated worktree, forever, one commit per feature. Push to origin/loops/flow
after every commit.
Restart baseline — check before iterating
- Read
plans/flow-on-sx.md— roadmap + Progress log. ls lib/flow/— pick up from the most advanced file.- If
lib/flow/tests/*.sxexist, run them viabash lib/flow/conformance.sh. Green before new work. - If
lib/flow/scoreboard.mdexists, that's your baseline. - Read
lib/scheme/scheme.sxpublic API once — that's your substrate.
The queue
Phase order per plans/flow-on-sx.md:
- Phase 1 — declarative DAG:
defflow,sequence,parallel, sync runtime, basic api - Phase 2 — control flow + error handling:
cond,retry,timeout,try-catch - Phase 3 — THE SHOWCASE:
suspend/resumeviacall/cc, persistent store, crash recovery - Phase 4 — distributed nodes via fed-sx (remote-node, handoff, replication)
Within a phase, pick the checkbox that unlocks the most tests per effort.
Every iteration: implement → test → commit → tick [ ] → Progress log → next.
Ground rules (hard)
- Scope: only
lib/flow/**andplans/flow-on-sx.md. Do not editspec/,hosts/,shared/, otherlib/<lang>/dirs,lib/stdlib.sx, orlib/root. May import fromlib/scheme/only (its public API). - NEVER call
sx_build. 600s watchdog. If sx_server binary broken → Blockers entry, stop. - Shared-file issues → plan's Blockers with minimal repro.
- SX files:
sx-treeMCP tools ONLY.sx_validateafter edits. - Worktree: commit, then push to
origin/loops/flow. Never touchmainorarchitecture. - Commit granularity: one feature per commit. Short factual messages
(
flow: retry combinator with exponential backoff + 6 tests). - Plan file: update Progress log + tick boxes every commit.
flow-specific gotchas
- Continuations must be re-entrant. Phase 3's
suspendcaptures a continuation that may be re-entered after a process restart. That means: no captured file descriptors, no captured sockets, no captured live runtime references that won't survive serialization. State referenced by the continuation must be plain SX data or live in the flow store. - call/cc, not call-with-escape-continuation. R7RS distinguishes. Use the full
call/cc for resume; escape-only continuations cannot be re-entered. Read
lib/scheme/r7rs.md(or equivalent) to confirm semantics. parallelin Phase 1 is sequential. Don't try threading until Phase 3+. Just evaluate branches in order, collect results, return joined value. Document the semantics clearly so users don't assume true concurrency.- Retry doesn't retry continuations. If a node has already suspended, retry on
resume doesn't re-run it from scratch — it resumes.
retryonly applies to exceptions raised before suspend. Be explicit in the API. - Cancellation invalidates the continuation.
(flow/cancel id)must remove the stored continuation so a staleresumecannot wake it. Document semantics. - Timeouts in pure SX are tricky. Without a scheduler,
timeoutis a budget on step count or wall-clock probed at safe points. Pick one approach (probably step budget for determinism) and document.
General gotchas (all loops)
- SX
do= R7RS iteration. Usebeginfor multi-expr sequences. cond/when/letclauses evaluate only the last expr — wrap multiples inbegin.env-bind!creates a binding;env-set!mutates an existing one (walks scope chain).sx_validateafter every structural edit.list?returns false on raw JS Arrays — host data must be SX-converted.
Style
- No comments in
.sxunless non-obvious. - No new planning docs — update
plans/flow-on-sx.mdinline. - Short, factual commit messages.
- One feature per iteration. Commit. Log. Push. Next.
Go. Start by reading the plan; find the first unchecked [ ]; implement it.