The orchestrator that turns SolidCraft issues into pull requests that a maintainer can
merge. Bash, Python and a user crontab: it is not an app, it is a process. Every piece
of state lives on disk, so it survives a crash, a /new session and a SIGKILL.
This README is also the onboarding guide. Section 3 ("What NOT to do") is the most
important part of the file: every line there is a lesson that cost hours. The long
version, with the measurements, is in
reports/lecciones-2026-11-22.md; what this session
did and what it produced is in
reports/sesion-2026-11-23.md.
| piece | what it is | where it lives |
|---|---|---|
| the agent of a slot | an opencode session: opencode run --standalone --auto --format json --title issue-N -m <model> |
bin/dispatch-slot.sh |
| the turn of the agent | the same session, plus a nudge when the run ends without a verdict | bin/agent-turn.sh |
| the model, the binary, the agent name | the policy of this machine, not code | bin/agent-env.sh reads $LOOP_DIR/config.env |
| the scheduler | the user crontab (cron, not hermes) | bin/install-crontab.sh installs the jobs of bin/crons.txt |
| the claim arbiter | one implementation, asked once | bin/claim-verify.sh (exit code IS the verdict) |
| the gate | the CI of the fork (GATE_MODE=fork-ci) or the local one (GATE_MODE=local) |
bin/gate.sh, bin/fork-ci.sh |
| the cleanup | the orchestrator's job, never the agent's | bin/close-slot.sh |
| the memory | files on disk, never the chat | state/ (by concept), state.json (the artifact), history.jsonl |
hermes is gone. It was the runner of the agents and the owner of the crons; it is
not installed on this machine any more, and nothing in this repo needs it. Two lessons
came out of that: a scheduler that is not installed is not a scheduler (there were
no crons at all for a whole night, and the slots piled up: three "running" slots
with no agent and 53 GB of worktrees and target dirs), and a cron that runs a copy of
the script is a cron that runs old code (the wave ran a week-old wave.sh for hours and
nobody noticed). The crontab runs the script of this repo, so a fix lands in the
cron at once.
issue -> claim (draft PR) -> RED -> fix -> PR -> gate -> ready -> merge
Each step is a process that can die and be resumed; the edges are conditions on files and on GitHub, not on a session being alive.
bin/wave.sh is one turn of the loop, every 10 minutes:
- collects the slots in flight: the ones in the state, the ones whose lock is taken (the lock is the durable record: the state can lose a slot) and the ones whose worktree is on disk (an agent that released its lock and died leaves 7 GB nobody knows about).
- closes the slots whose work landed as a pull request and whose agent is not working any more: the PR is verified, the target dir and the worktree go, the brief goes, the lock is released. That is what frees the disk for the next agent (5.6 GB of target and 700 MB of worktree per slot).
- reaps the locks of the slots that are dead without a pull request: their branch
goes to the fork first (a branch in the fork is the work that survives), then the
slot is marked
saved. - resumes the work in progress before starting anything new: a slot with the work already in the fork is worth more than a new issue (the RED test is written, the analysis is done, and upstream will not give the issue back: the claim lapses after 14 days without pushes).
- starts the free slots: the next issue worth an agent (
bin/next-issue.py), the slot prepared (bin/prepare-slot.sh), the agent dispatched (bin/dispatch-slot.sh). Before it starts or resumes anything without a PR, it asks the rules gate (bin/rules-gate.sh): on HOLD or UNKNOWN no new issue starts (see "The rules gate" below).
A slot whose agent is alive is never touched. "The PR exists" is not "the work is
done": an agent that opened the PR keeps working on it (the gate, the evidence). The
liveness is checked by bin/slot-busy.sh: a process whose working directory is inside
the worktree or the target dir.
The process of an issue is declared, not remembered:
workflow.yaml is 15 nodes with their edges, their preconditions,
what to do when they fail, and the vocabulary of signals that the runner evaluates
against the disk. It exists because the process used to live in the head of whoever
ran the orchestrator: 49 scripts and no map, so nobody could answer "what is next"
without rebuilding the state by hand.
nodos:
- id: buscar-issue # an agent does it: script: null
- id: claim-verify # bin/claim-verify.sh
- id: gate # bin/gate.sh
senales: # the conditions, evaluated against the state on disk
- pr_draft_sin_veredictoTwo scripts read it:
| script | what it does |
|---|---|
bin/workflow-validate.py |
the graph has to be a graph: the edges point to nodes that exist, every script named exists, every signal used is declared, and bin/crons.txt and the graph agree |
bin/workflow-runner.sh --list |
the nodes that are eligible now, and why |
bin/workflow-runner.sh --dry-run |
the exact command of the node it would run, without running it |
bin/workflow-runner.sh |
runs exactly one eligible node, and only after validating the graph |
The runner never compiles Rust: a node marked compilacion_pesada: si is proposed,
and the cron that owns it runs it. It never calls the network either: GitHub is the
final truth, but the runner reads the state on disk, so if state.json is old the
proposals are old.
bin/loop-pause.sh stops the loop without losing anything, in three levels:
bash bin/loop-pause.sh pause # no NEW work: the crontab block goes
bash bin/loop-pause.sh pause --freeze # also SIGSTOP of the agents and the gates
bash bin/loop-pause.sh pause --stop # also SIGTERM: the CPU is free at once
bash bin/loop-pause.sh resume # the crontab comes back
bash bin/loop-pause.sh statuspause leaves a marker (locks/loop-paused) so the wave exits early while it exists.
The work already pushed to the fork survives any of the three.
The register is bin/crons.txt; bin/workflow-validate.py checks
that it and workflow.yaml agree, so a cron that runs and is not in the register does
not exist, and a cron in the register that is not in the workflow is an error of the
suite.
| cron | every | script | what it does |
|---|---|---|---|
| solidcraft-wave | 10 min (*/10) |
wave.sh |
closes the finished slots, starts the free ones |
| solidcraft-pipeline | 5 min (:02,:07,…) |
pipeline.py |
dispatches the CI of the fork (or queues the local gate), passes the PRs to ready. It does not edit bodies any more |
| solidcraft-gate-queue | 5 min (:03,:08,…) |
gate-queue.sh |
drains the gate queue (two at a time) |
| solidcraft-comment-watch | 15 min (:04,:19,…) |
comment_watch.py |
reads the maintainer's comments into a task queue |
| solidcraft-nice-compilations | 10 min (:01,:11,…) |
nice-compilations.sh |
lowers the priority of the new builds |
| solidcraft-reporte-diario | :16 and :46 |
daily-report.py |
the daily report, no LLM |
| solidcraft-gc-disk | 30 min (:14,:44) |
gc-disk.sh |
the disk: artifacts and dead targets |
| solidcraft-loop-status | 30 min (:06,:36) |
loop-status.py |
the state of the loop, no LLM |
| solidcraft-rules-gate | 6 h (:25) |
rules-gate.sh |
upstream's rules against the reviewed ones; HOLD stops new issues |
No two of them fall in the same minute, and the order inside the cycle matters: the
wave dispatches at :00, the pipeline queues the gates at :02 and the queue takes
them at :03.
Two jobs were taken out of the register on 2026-11-21:
solidcraft-ping-ready (upstream's guide says not to ask for approved-for-ci over and
over; bin/ping-ready.sh stays for a manual --report) and
solidcraft-wave-prompt-guard (it watched a hermes cron, and hermes is gone).
bash bin/install-crontab.sh # install the jobs (idempotent)
bash bin/install-crontab.sh --dry-run # what it would do
bash bin/install-crontab.sh --remove # take the jobs away
bash bin/preflight.sh # what this machine is missingTwo gates, one policy knob ($LOOP_DIR/config.env):
GATE_MODE=fork-ci(the default here): the CI of the fork is the gate. The fork has onlyci.ymlenabled (the other sixteen workflows of upstream are disabled: in October the fork published a nightly release and tagged its issues). This needs the fork's Actions to be enabled in the web UI; when they are off, the dispatch answers422 Actions has been disabled for this repositoryand the gate falls back to the light lane of upstream plus the local scoped gate.GATE_MODE=local: the scoped gate compiles here (bin/gate.sh).
The agent marks its PR ready for review when the change is done and its proof and the local
gate are green (upstream's rule: the draft is only the claim). The pipeline also passes a draft
to ready when its gate is green, and takes the (#N) out of the title: that is the fallback for
an agent that died before doing it.
Every line is a lesson that cost hours. The numbers are in
reports/lecciones-2026-11-22.md.
- An agent compiles only under the heavy token, and never the whole workspace. Its
RED and GREEN proof and
cargo xtask fast --base origin/mainrun betweenbin/slot-lock.sh --heavy --takeand--release(prompts/agent-brief.md, point 3); everything bigger belongs to the gate queue. Before the token existed, agents that compiled at will competed for the Cargo locks: there were 3-9 concurrent builds, and two agents burned 2h29m each without a single commit. (Until 2026-12-02 this line said "do not compile from an agent", which the brief had long stopped saying.) - Do not use
pkill,killallorkill -9. On a shared machine apkillcan kill somebody else's build. To stop your build: keep its PID and sendkill -TERMto that PID only. To wait for the box: a loop overpgrep -x cargo, orbin/build-slot.sh --status. - Do not edit a script that is running. Replace it atomically (
os.replace,mv). - Do not put a stub of a tool in a directory that can be on the
PATH. A fakeghthat does nothing turnspr createinto a no-op: pull requests that do not exist. - Two heavy builds at most, each with its own
CARGO_TARGET_DIR(one per slot). A shared target makes one build delete the artifacts of the other: 2423 false failures, once. CARGO_INCREMENTAL=0, always. With incremental therustcruns are not cacheable and every slot recompiles the same dependencies.- The box has 15 GB and ONE heavy build at a time. The heavy token
(
bin/slot-lock.sh --heavy) exists for that. If a build dies withsignal 9, that is memory, not code: wait for the box to breathe and try again. The agents that ran here for hours proved it: with eight builds at once, the engine's test binary (5 GB to link) was killed a dozen times.
- A verdict that does not reach the exit code is worse than no verdict. Everything that fails exits non-zero, and whoever reports propagates the code.
- A failure that already exists in
origin/mainis not a regression. The verdict that counts is the effective one (bin/gate-baseline.sh), which separates what was already broken from what the change broke. - The baseline is merged, never replaced. A merge cannot lower the count of pre-existing failures.
- The effective verdict must be compared against the same upstream commit.
- A check that could not run is NOT a red: exit code 6 = UNKNOWN, never "no".
- The draft PR is the claim, and it has to be pushed every day. Upstream's rule
(
.agents/skills/solidcraft-contributing/SKILL.md, "Push daily"): a draft with no pushes for 72 hours may be taken over by someone else, who comments first and then opens their own claim. The bot's automatic cleanup is separate: a/claimwithout a PR lapses after 72 h, a claim with a PR after 14 days without pushes (PR_IDLE_DAYSinscripts/claim/claim.js). The 72 hours are the number that matters for our drafts. - The RED test comes before the fix. The minimum deliverable of the investigation is the failing test, committed and pushed.
- The briefs are literal: the code to apply, the path, the commit message, the test command. A brief that says "look for the bug" produces exploration, not code.
- Only issues, not features. Measured on this machine: an issue costs $0.25 and 16 h of agent time per delivery; a feature, $1.90 and 138 h, with an 86% chance of being cancelled. The issue arrives with the cause; a feature demands inventing the API, the command spec, the UI and the locales.
- A regression test goes in the area's existing test file, never in a file named
after the bug (
AGENTS.md, issue #3226). Changes a default: nois the exact form the upstream parser reads. Not "Changes to default: no". The position does not matter; a code fence or an HTML comment break it. The parser also acceptsnowith a note behind it, the heading form## Changes a defaultwith the value under it, and a backticked value.
Upstream moved its rules on 2026-11-25, 2026-11-28 and 2026-12-02 (AGENTS.md was
rewritten, the skills moved to .agents/skills/, and the layer rule split kernel from feature
math). These are the rule now, not the old form:
-
Kernel or feature (2026-12-02): a kernel operation, one any CAD app needs, goes in
solidcore/; one feature's own math (a cam profile, a flat pattern, shaft spline teeth) goes in a SolidCraft feature crate that calls the kernel throughkernel-api(.agents/skills/solidcraft-layers/SKILL.md, step 0). Feature math is work this box can do; a change insidesolidcore/orcrates/kernelis still vetoed here. -
The claim DRAFT carries the issue number in its title (the claim bot reads it there); the ready pull request does not:
Area: what the user now gets, present tense, nofeat:/fix:, about 100 characters. The merge adds the(#N). A follow-up says it in the title:(follow-up to #23431). -
Test change: <why the old expectation was wrong>only when the diff touches kernel source (solidcore/,crates/smlib/) AND changes or deletes a line of an existing test or golden expectation. New tests need no line. -
A fixed test leaves
tests/KNOWN_FAILING_TESTS. If the fix makes a listed test pass, its line is removed in the same PR: the CI fails on a listed test that now passes. -
Media only in two cases: a change visible in the UI, or a change in how the model looks. A kernel or geometry fix proven by tests needs none. When it is needed, the pictures go in the description as links, never in the diff, and without private details (home paths, user names, tokens).
-
The gate here is narrow on purpose. Upstream says "Before pushing:
cargo xtask ci", but thatcialways runs the whole-workspace clippy, the whole test suite (78 binaries, 56-90 min on this box), the wasm build of every crate and the doc tests; only four checks are picked by changed paths. The local gate iscargo xtask fast --base origin/mainpluscargo xtask app-geometry(new,fastdoes not run it) and the path gates the change touches; the completecibelongs in the CI. -
Merging
mainin is the cheap way to be up to date (the CI carries a passing run when the merge leaves the change as it was); a rebase re-runs the whole suite. Rebasing is fine too, with--force-with-leaseand only on your own branch. -
The PR is opened ready for review when the change is done: the draft is only the claim.
- Push ONLY to the fork. Never to
origin, never force-push tomain, never change the branch of the main checkout. - Do not touch the main checkout or the worktree of another slot. Each agent has its own worktree.
- The liveness of a lock is its age and its owner, never its PID. And release the slots: a build token taken without a live process blocks the whole queue.
- Before opening a PR, read the comments, the assignees, the timeline and the open PRs. On a duplicate the lowest number wins. A lost claim is not thrown away: the diff and the commits are preserved and offered on the PR that won.
- The cleanup is the orchestrator's job.
bin/close-slot.shremoves the target dir, the worktree, the brief and the lock, and refuses to do it while a gate is running or queued. The agent must NOT delete its own worktree: the gate of the slot compiles inside it, and the pipeline queues that gate after the agent opens the PR. An agent that deleted its worktree produced a false ROJO on a healthy PR (#20017). - Do not close a slot whose agent is still working. The orchestrator deleted the worktrees of a live agent twice and aborted its test run. Close a slot when its agent has reported, or when the worktree is clean AND no process works in it.
- A leftover of a finished turn keeps a slot alive for hours. An agent that left
a
python3 -m http.serverrunning kept its slot "busy" for 20 h 54 min, and its 79 GB of target were never freed:bin/slot-busy.shsees the working directory of a process and calls the slot alive. gh pr create --body @filedoes not expand the file. The pull request keeps the literal string@/tmp/...as its body, and the "Defaults line check" fails because of it. Usegh pr create --body-file <file>, orgh api -X PATCH repos/tangency-labs/solidcraft/pulls/<n> -F body=@<file>.- The work that exists only on this machine is a commit that exists for nobody. The
question is "is MY work in the fork?", and the base of the comparison is the
mainof the upstream, not the fork's.bash bin/branch-risk.shsays the three things without confusing them: AT RISK (the commit is in no ref of the fork), SAVED (it is on GitHub under another name) and merged.
- A cron that is not in
bin/crons.txtdoes not run. There were two graphs (the declared one inworkflow.yamland the installed one in the crontab) and nothing checked them: a cron could exist, run every day and be in neither list.bin/workflow-validate.pyis the check. gh issue list --limittruncates the pool. The upstream has ~6,800 issues open;--limit 150showed the selector 2% of them, and the rest looked like "no issue left".bin/gh_snapshot.pytakes one snapshot of the open issues and PRs and everything reads that.- One arbiter per concept. The rule of "who owns the claim of issue N" lived in a
jqinsidebin/claim-verify.shand in two scripts ofloop/, and they did not read the body the same way. It is now one file:bin/claim_rule.py. opencode runends when the model writes text without calling a tool. A turn can finish with "let me instrument all the doc-level boolean calls" and no verdict, no commit, no push: the wave then closes the slot.bin/agent-turn.shis the wrapper that nudges the same (still warm) session when the run has no verdict.
About fifty scripts, grouped by what they are for. The name of the group is the question you have when you look for one.
The loop — one turn of it, the pause, the schedule
| script | what it does |
|---|---|
bin/wave.sh |
one turn of the loop (close, reap, resume, start) |
bin/wave-chain.sh |
the sequencer of the wave of 14-11 (the resume path still points at it) |
bin/loop-pause.sh |
pause / resume the loop in three levels |
bin/crons.txt |
the register of the crons: the source of truth |
bin/install-crontab.sh |
installs the jobs of the register in the crontab of the user |
bin/loop-status.py |
the state of the loop, no LLM |
bin/daily-report.py |
the daily report, no LLM |
The declared graph — the process, written down
| script | what it does |
|---|---|
workflow.yaml |
the declaration of the process of an issue (15 nodes, edges, preconditions, signals) |
bin/workflow-validate.py |
the graph is a graph, and the register agrees with it |
bin/workflow-runner.sh |
runs one eligible node, after validating the graph |
The slot — the agent and its box
| script | what it does |
|---|---|
bin/prepare-slot.sh |
the slot: lock, worktree, branch, target dir, brief |
bin/dispatch-slot.sh |
starts the opencode agent of a slot with the brief |
bin/agent-turn.sh |
one turn of the agent, with the nudge when the run has no verdict |
bin/agent-env.sh |
the agent runtime of this machine (binary, model, name) |
bin/close-slot.sh |
the close-out: verify the PR, free the disk, release the lock |
bin/slot-lock.sh |
the locks of the slots and the heavy-build token |
bin/slot-busy.sh |
is somebody working in this slot right now |
bin/slot-stale.sh |
which slots are stuck (old lock, branch that does not move) |
bin/slot-prs.py |
our pull requests, matched to the slots in flight |
bin/slot-target-dir.sh |
the target dir of a slot, one per slot |
bin/lock-heartbeat.sh |
refreshes the liveness of a lock |
bin/slots.sh |
how many slots may run at once (free cores and free RAM) |
bin/run-issue-scope.sh |
an issue runner with a memory ceiling |
Choosing the work — which issue, and whose claim it is
| script | what it does |
|---|---|
bin/next-issue.py |
the next issue worth an agent, and why |
bin/issue-card.py |
the card of an issue (cause, kernel or not, the value) |
bin/gh_snapshot.py |
one snapshot of the open issues and PRs of the upstream |
bin/dup-scan.sh |
one of our PRs duplicating another author's |
bin/claim_rule.py |
the one rule of "who owns the claim of issue N" |
bin/claim-verify.sh |
the arbiter of the claim (the exit code IS the verdict) |
The gate and the pull request
| script | what it does |
|---|---|
bin/gate.sh |
the local gate (cargo xtask fast --base) |
bin/fork-ci.sh |
the CI of the fork used as the gate |
bin/gate-queue.sh |
the queue of gates waiting for a build slot |
bin/gate-runner.sh |
the gates, one at a time |
bin/gate-baseline.sh |
the effective verdict: the raw one minus what was already broken |
bin/baseline-refresh.sh |
refreshes the failures measured on origin/main |
bin/pipeline.py |
dispatches the CI of the fork (or queues the local gate), passes the PRs to ready |
bin/publish-pr.sh |
the only way to open one of our pull requests |
bin/verify-pr.sh |
everything about a PR in one call (0 ok, 1 failed, 6 unknown) |
bin/ping-ready.sh |
the review package of the PRs that are ready (manual now, not a cron) |
bin/ping-ready-report.sh |
the same summary, without commenting on GitHub |
bin/ci-status.sh |
the CI of a head in one line |
bin/comment_watch.py |
the maintainer's comments become a task queue |
The machine — the box, the disk, the builds
| script | what it does |
|---|---|
bin/build-slot.sh |
the token of a build slot |
bin/cargo-jobs.sh |
how many parallel jobs a cargo invocation should use |
bin/nice-compilations.sh |
lowers the priority of the new builds |
bin/gc-disk.sh |
the disk: artifacts, dead targets, dead branches |
bin/sccache-health.sh |
is the compile cache earning the disk it holds? |
bin/branch-risk.sh |
the work that only exists on this machine |
bin/kill-orphan-browsers.sh |
the browsers of the MCP that were left without an owner |
The state, the reports and the launchers
| script | what it does |
|---|---|
bin/merge-state.sh |
the state split by concept, and its artifact (--bootstrap, --check) |
bin/state-set.py |
writes one key of the state and rebuilds the artifact |
bin/orch-state.sh |
the state, by part (slots, prs, gates, issue N) |
bin/rules-gate.sh |
the pre-issue check: are upstream's rules the reviewed ones? PASS, HOLD or UNKNOWN, the pack for the brief, the trace in state/rules/ |
bin/rules-sync.sh, bin/rules-snapshot.sh |
did upstream move the rules this repo quotes; --mark-reviewed records a review (a person's act) |
bin/preflight.sh |
what this machine is missing |
bin/test-all.sh |
every suite of the orchestrator, and its verdict |
bin/launch-app.sh |
the app with its control channel open, for the evidence |
bin/launch-wave.sh, bin/launch-resume.sh, bin/launch-slot-service.sh |
a wave, a resume, and an agent as a transient systemd unit |
bin/sc_control.py |
the client of the control channel of the app |
bin/measure-17881-before-after.sh, bin/capture-17881-evidence.py, bin/experimento-paralelismo.sh |
the measurement of one issue, its evidence, and the experiment of the parallelism |
The half of the orchestrator that lives in $LOOP_DIR (the publisher, the claim
arbitration of the loop, the scoped gate, the disk collector) is versioned here, in
loop/. The runtime that is per machine (the verdicts, the logs, the
worktrees, config.env) is not.
Everything is on disk; the chat is not the memory.
state/ the state by concept: slots, prs, gates, claims, policy, notes
state.json the artifact: the same, rebuilt by bin/merge-state.sh
history.jsonl append-only: what was done, one line per action
locks/ the lock of each slot, the heavy-build token, the pause marker
gates/ the queue of the gates, and the verdicts (in $LOOP_DIR/gates/)
targets/ the target dir of each slot (a cache: cargo rebuilds it)
logs/ the evidence: the turn of each agent, the verification of each PR
reports/ the measurements, the analyses, the lessons
Read it by parts, never whole:
bash bin/orch-state.sh # summary: slots, PRs, gates
bash bin/orch-state.sh slots # only the slots
bash bin/orch-state.sh issue 16829 # everything known about one issue
bash bin/orch-state.sh history 10 # the last ten actionsThree exit codes decide things, and they do not mean the same thing. A script that could not read the world returns "unknown", and "unknown" is never "no":
| script | 0 | 1 | other |
|---|---|---|---|
bin/verify-pr.sh |
the PR is fine | the PR is broken | 6 = it could not be read |
bin/claim-verify.sh |
the claim is ours | we LOST the claim | 2 = it could not be told |
bin/prepare-slot.sh |
the slot is ready | the slot could not be prepared | 6 = the cause is in the kernel, which this box does not build |
The state has to be true, not complete. An entry that is old (a merged PR that still says "open") costs more than a missing one. GitHub is the truth; the disk is corrected.
git clone <this-repo> ~/.local/share/solidcraft-orch
cd ~/.local/share/solidcraft-orch
mkdir -p targets logs locks gates state reports briefs baseline
bash bin/merge-state.sh --bootstrap # the state of a new machine (idempotent)
bash bin/merge-state.sh --check # has to be rc=0The other half, the runtime:
LOOP_DIR="${LOOP_DIR:-$HOME/.local/share/solidcraft-loop}"
mkdir -p "$LOOP_DIR"
ln -s "$ORCH_DIR/loop/bin" "$LOOP_DIR/bin" # the versioned code
ln -s "$ORCH_DIR/loop/prompts" "$LOOP_DIR/prompts" # the prompts of the loop
cp "$ORCH_DIR/loop/config.env.example" "$LOOP_DIR/config.env" # the policy of the machineThen the agent runtime and the crons:
bash bin/preflight.sh # says what is missing
bash bin/install-crontab.sh # the cronsThe paths have defaults, so on another machine it is enough to export them:
ORCH_DIR=... LOOP_DIR=... SOLIDCRAFT_REPO=... WORKTREES_DIR=...
The secrets (never in a versioned file) are GH_TOKEN and
SOLIDCRAFT_CONTROL_TOKEN.
bash bin/test-all.sh # every suite
bash bin/test-all.sh --fast # only the ones that run anywhere
bash bin/test-all.sh gate # only the suites whose name matches41 suites live in bin/test-*.sh and bin/test-*.py. A suite that cannot run is
reported as a failure, never as a skip: a suite that cannot run is not a green.
The two that live in the loop (test-gate-quick.sh and test-rules.py) need the
machine, and five are heavy (test-slot-parallelism.sh, test-deploy-drift.sh,
test-publish-pr.sh, test-state-split.sh, test-briefs.sh).
Two checks that do not compile and are worth running before any heavy work:
cargo xtask fast --base origin/main # the narrow local gate of this box: fmt, layers,
# clippy, check, nextest on the packages the change
# touches (upstream's prepush check is `cargo xtask ci`,
# which is the whole suite and does not fit here)
cargo xtask app-geometry # the new check `fast` does not run
bash bin/rules-gate.sh # the pre-issue check: PASS / HOLD / UNKNOWN, and the pack
bash bin/rules-snapshot.sh --diff # what moved upstream since the review
bash bin/rules-snapshot.sh --mark-reviewed # AFTER aligning RULES.md and prompts/: lifts a HOLD
bash bin/rules-verdict.sh # the long diagnosis: also the paths our documents citeThe rules gate (bin/rules-gate.sh, 2026-12-02) is the one decision about upstream's rules.
bin/prepare-slot.sh asks it before the claim arbiter (exit 7: the issue does not start),
bin/wave.sh asks it before it starts anything (3a), and the cron solidcraft-rules-gate runs
it every six hours, node upstream-rules of workflow.yaml. It fetches upstream (three
tries), compares with rules-snapshot/SHA256SUMS through bin/rules-snapshot.sh --check, and
answers:
| verdict | exit | what moved | what happens |
|---|---|---|---|
| PASS | 0 | nothing | the issue starts |
| PASS_DRIFT | 0 | a skill or document the agent reads (not a process one), or an MCP skill | the issue starts; the brief carries upstream's diff verbatim; state/rules/pending-review.md asks a person to review |
| PASS_FALLBACK | 0 | unknown: the fetch failed | the last good check is younger than 24 h, so it stands |
| HOLD | 1 | AGENTS.md, a claim or PR skill (contributing, file-pr, babysit-pr, full-stop, takeover), claim.js, pr-checks.js, the PR template, or the CONTRIBUTING.md sections about sending a change, the rules or the tests |
no new issue starts, and no saved slot without a PR is resumed; a slot with our PR goes on, with the new text in its brief |
| UNKNOWN | 6 | unknown, and the last good check is older than 24 h | as HOLD |
Every brief carries the commit it was prepared under (RULES: line, rules_sha in the slot's
state) and upstream's hard rules copied word for word from that commit's AGENTS.md, so an
agent on an old branch still reads today's rules. The gate never marks anything as reviewed:
bash bin/rules-snapshot.sh --mark-reviewed is a person's act, after aligning RULES.md,
prompts/agent-brief.md and this README with the diff. Until 2026-12-02 the wave ran that refresh
by itself when only AGENTS.md or a skill moved, and the record said our documents had been
read when nobody had read them.
The watch job (until 2026-12-02; the cron solidcraft-rules-gate replaces it and it can be
turned off): the automation solidcraft-rules-watch runs bin/rules-verdict.sh every six
hours and brings the verdict: OK (the snapshot matches origin/main), CAMBIÓ (the files that
moved and the diff stat) or NO SE PUDO COMPROBAR (the check could not run, which is not "up to
date"). It only reads: it changes nothing, it publishes nothing, it merges nothing. It also
checks two things that rot without noise: the paths of upstream that our documents name exist
(the skills, the scripts, the kernel files) and the briefs cite paths that are still there. The
verdict is also written to ~/.local/share/solidcraft-orch/state/rules-verdict.txt with the date
and the upstream commit it measured. When it says something moved, a person orders the update and
a subagent does it against RULES.md and prompts/.
| what | where |
|---|---|
| the lessons of this machine, with the numbers | reports/lecciones-2026-11-22.md |
| what this session did and produced | reports/sesion-2026-11-23.md |
| the analysis of the loop, with the costs | reports/analisis-orquestador-2026-11-21.md |
| the state at the start of a session | HANDOFF.md |
| the rules of the orchestrator | RULES.md |
| the declared process of an issue | workflow.yaml |
| the documents of the loop | docs/ — the index is docs/README.md; start with docs/starting-a-session.md and docs/known-traps.md |
| the rules of upstream (the truth) | AGENTS.md, CONTRIBUTING.md and .agents/skills/ in the SolidCraft repository (skills/ there are the MCP's, not the agents') |