• v0.9.0 31530e7bd9

    v0.9.0
    All checks were successful
    release / release (push) Successful in 5s
    test / changelog (push) Successful in 3s
    test / lint (push) Successful in 32s
    test / scripts (push) Successful in 51s
    Stable

    city-root released this 2026-11-12 20:38:36 +00:00 | 5 commits to main since this release

    Added

    • The roles pack's failures order mails the Operator when an order keeps failing, which nothing read before: gc records each failed run as an order.failed event and each run that went through as order.completed, both with the order and its scope as the subject (merge:rig:rexcity), and in the 24 hours to 2026-11-12 15:35 the log held 138 failures, 128 of them the merge order of one rig reading a forge that answered 503. When an order has failed three runs in a row (FAILURES_STREAK) it sends ORDER FAILING <order>: <n> runs in a row from controller with --notify, a body of the order, the count, the first and last failure and the end of the last error, and the dedup key order-failing:<order>:<seq of the first failure>; when that order runs again it sends ORDER RECOVERED <order>, without --notify, with order-recovered:<order>:<seq>. A streak that ends before three mails nothing, and each order and scope is counted apart. The order has scope = "city", so it runs once and not once per import of the pack, and it says on stderr when its last run is older than the lookback. The order is a five-minute cooldown order and not one on order.failed, since the mail that an order runs again has no failure to wait for. It reads the events of the last two hours (FAILURES_LOOKBACK) above a cursor kept in failures.json under the pack's state directory, so each event is counted once and the streak of an order that runs daily lasts across days; a mail that failed is sent by the next run. The logic is roles order failures in the roles Go tool, and assets/scripts/failures.sh starts it.
    • FORGEJO_TOKEN_COMMAND in the forgejo pack: a command, run with sh -c, whose trimmed stdout is the Forgejo API token. When it is set it wins over FORGEJO_TOKEN_FILE, and a command that fails or prints nothing is an error, not a fall back to the file; the error carries the command's stderr, cut to 300 bytes, and never its stdout. Every reader in the pack's Go tool (pr open, pr state, pr merge, pr review, pr comment, and the merge, checks, schedule and review orders) takes it through one function, so a city can keep its token in a secret store and set the command that prints it, and the pack stays agnostic of the store. The command runs in the pack's directory with the environment of the process that started the tool. The Go tests (forgejo/assets/forgejo/token_test.go) carry the file, the command, the command beating the file, a command that fails, prints nothing or writes a long stderr, and the tool's commands reading the token from the command.
    • gc forgejo token, which prints the token as the tool reads it, from the command or the file, for the one reader that is not the tool, the Reviewer's formula. It takes no argument, prints nothing and exits 1 when there is no token, and 2 for an argument. Its help says the token goes in the header of the request it is for and nowhere else.
    • A line in the Worker's prompt: the Forgejo token is a secret it never reads, neither the file, nor what FORGEJO_TOKEN_COMMAND or gc forgejo token prints; it opens, reads and comments on pull requests with the gc forgejo pr commands, which read it themselves. tests/formula.sh checks the line in the prompt as gc renders it.
    • tests/doctor.sh, run by the lint job: the doctor for a file, a command, both, neither, and a command that fails or prints nothing, and that it never prints the token and runs the command once.
    • gc roles version prints the version of the roles pack's Go tool, roles/assets/roles, which also runs the handover order. It starts as go tool -C "$GC_PACK_DIR" roles version, as the forgejo pack's commands start their tool.
    • internal/gcx, the code the two tools share, starting with the lookup of the city's Operator, which the forgejo tool's merge, schedule and checks orders now take from it.
    • internal/budget, a Go test run by go test ./..., holds the packs' shell to the rule of docs/shell.md: it measures each unit of shell and compares it with the new ledger, docs/shell-ledger.txt, which lists the 10 units that exist and are over a threshold. CI runs it as its own step of the lint job in warning mode, so it prints what it would fail and passes; SHELL_BUDGET=fail makes it fail.
    • tests/pack-cache.sh, run by CI, starts both tools from a copy of the checkout as gc's pack cache holds one, offline and through gc.
    • REVIEW.md states the shell rule for the Reviewer, and the Worker's skill carries the same three paragraphs.
    • The Researcher's Perplexity server reads its key from PERPLEXITY_API_KEY_COMMAND when that variable is set and not empty: the command is run with sh -c and its standard output is the key. A command that fails, or prints nothing, ends the start and does not fall back to the file.
    • The roles pack carries mol-researcher-work, the Researcher's formula, which its agent already names as default_sling_formula: one step of five parts (read the bead and mark it taken, scope the question, investigate, check, post), held by one session from the claim to the close. The Researcher posts its findings as one comment headed [research-<bead id>] on its own bead, then closes the bead with the reason Findings posted: [research-<bead id>], gc.work_outcome=no-op and gc.work_verification, then closes the step and acknowledges the drain. The bead gets no branch, pull request or merge result. A restart counts the comments before it posts, so a comment is never posted twice. A bead that is not a question, or is a decision or a change, is halted to the Operator with the reason, as a Worker's is, with the commands in the step.
    • The formula's bash blocks are 24 code lines, under the 60 that docs/shell.md allows a formula, so it needs no Go tool.
    • tests/researcher-formula.sh compiles the formula in a throwaway city and checks that it is one step of five parts, that the step is closed as passed once and as failed only by a halt, the order of its writes, that it runs no git command but a clone, no rm, no sling and no write to a bead but the work bead and its step, its size, and its 60 code lines; it runs the lines that write the beads against a stub gc. CI runs it.
    • The README says what the trial by hand found: under full-auto a call of the Agent tool is refused and nothing prompts; the tool names of the allow list are Claude Code's own; claudeacp accepts full-auto; and an allow list cannot limit Bash to commands that only read, because the city's list allows Bash as a whole and a deny list names only the commands it lists.
    • gc roles waiting [--json] [agent] and gc roles nudge [agent], two commands of the roles pack's Go tool that answer what waits on an agent and nudge it once: the logic of the city's operator-nudge order, which gascity-root#44 wrote as an 18-line shell script and whose review found two defects of the kind a test catches. A bead waits on an agent when it is assigned to it and not closed (open, in_progress, blocked and deferred count alike), in the HQ store and in the store of every rig, read with gc bd list --assignee, with the HQ store read as the city's own whichever rig the caller stands in. waiting prints one line for each bead (id, status, store and title, separated by tabs), or with --json one object with schema_version ("1"), agent, count and beads. nudge sends one gc session nudge with the line <n> bead(s) wait on you: <up to five ids> (and and more after five) when at least one bead waits and no nudge to the agent's session is pending or in flight in gc nudge status, and sends nothing otherwise. The agent is $OPERATOR, else the one city-scoped agent named operator, when none is named; both commands take gc's --city, which they give to every gc call. A store that cannot be read, the list of the rigs, and the nudge queue are errors that name what failed, with exit status 1: waiting prints nothing and nudge sends no nudge, not even for the stores that could be read, where the shell script took a failed HQ store or any rig but the last for "nothing waits" and a failed gc nudge status for success. Both read every store and the queue in each run, so a queued nudge does not hide a failure. The Go tests (roles/assets/roles/waiting_test.go) carry those cases with and without beads in the other stores, the five-id limit, the queue states, the --city on every call and the command lines; tests/waiting.sh, run by the scripts job, tests the wrappers and the real tool against a stub gc. The README says what the city's order becomes (exec gc roles nudge) and how the Operator learns that an order keeps failing: from the failures order.

    Changed

    • The roles tool's lookup of the Operator, its state directory and its atomic write of a state file are in roles/assets/roles/common.go, shared by the handover and failures orders. handover.json is written as before.
    • The Reviewer's formula mol-forgejo-review takes its token from $(gc {{forge}} token) in each of the six places where it read $(cat "$FORGEJO_TOKEN_FILE"), so it and the tool cannot disagree about where the token is; tests/reviewer.sh pins that every request of the formula is authorized that way and that no line of it names FORGEJO_TOKEN_FILE or FORGEJO_TOKEN_COMMAND but to say that no other agent's names the Reviewer's token, and its stub curl refuses a request that does not carry the token the stub gc forgejo token prints. The Reviewer's prompt says the account is the one whose token the pack's token command prints. A Reviewer started by a city that sets only FORGEJO_TOKEN_FILE reads the same file as before.
    • The doctor of the forgejo pack accepts either variable: with FORGEJO_TOKEN_COMMAND set it runs the command once and exits 2 when it fails or prints nothing, without showing what it printed; with neither variable set it exits 1 and says neither is set. Its message for a readable file is unchanged.
    • The README says where the token comes from, including that the command wins over the file even when the file is the agent's own and the command the workspace's, so a city that moves to the command moves every place that names the token. The help of pr open, pr state, pr merge, pr review and pr comment says the same.
    • Breaking: the Researcher's Perplexity server no longer reads ~/.config/gascity-root/perplexity-token. Without PERPLEXITY_API_KEY_COMMAND, it reads the file named by PERPLEXITY_API_KEY_FILE, and with neither variable set it does not start. A city that kept the file sets PERPLEXITY_API_KEY_FILE to its path in the env of a patch of roles.researcher.
    • The README's section on the Researcher no longer says that its formula and its skill are not in the pack yet.

    Fixed

    • The apply and upgrade orders no longer fail when they fire together. Both fetch origin/main into the city repository, and git lets only one of two concurrent fetches that find it moved update refs/remotes/origin/main: the other failed with "cannot lock ref" and mailed the Operator, and the merged change waited for the next apply run. Both now fetch through roles git fetch <repo> <branch>, a command of the roles pack's Go tool that runs the fetch again, up to five tries 0.2 to 0.6 seconds apart, when it lost the lock on the ref; by then the ref is where the first fetch put it. Any other failure, and a lock still lost after the last try, still fails and still mails the Operator. The orders retry rather than take a lock of their own because a lock shared across two scripts needs a stale-lock rule for a run killed outright, and retrying also covers a fetch the user or a Worker runs in the city directory. The upgrade order now needs go on the supervisor's PATH, as apply already did.
    • The schedule order no longer takes an open review bead for a Worker on the pull request. When the head of a pull request moved to one no bead holds, it raised no_worker only if no open bead carried the pull request's URL, and a review bead (pr_url, review_head) is open while the pull request is under review, so the Operator was never told that someone pushed to a branch nobody was working on. A bead that carries review_head is now skipped, as one that carries pr_event already was.
    Downloads