The Researcher, build 4: the formula mol-researcher-work and its trial by hand #87
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!87
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-n2x5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Build bead 4 of the Researcher (docs/researcher.md in gascity-root, section 7): the formula
mol-researcher-work, its test, and the trial by hand that the bead names as its first act.The formula
One step of five parts (read the bead and mark it taken, scope, investigate, check, post), held from the claim to the close as
mol-worker-workis. It changes no checkout and has no worktree, branch or pull request. The findings are one comment headed[research-<bead id>]on the Researcher's own bead. The writes go in this order: the comment,gc.work_outcome=no-opandgc.work_verificationon the bead, the bead's close with the reasonFindings posted: [research-<bead id>], the step's close,gc runtime drain-ack. A restart counts the comments before it posts, so a comment is never posted twice. A bead that is a decision, a change or empty is halted to the Operator; the halt's commands are in the step, becauseworker-haltbelongs to the Worker's own agent (gc internal materialize-skills --agent roles.researchergives the Researcherroles.city,roles.contactandroles.researcheronly) and detaches a worktree the Researcher has none of.Shell rule. The step's
bashblocks are 24 code lines against the 60 that docs/shell.md allows a formula (the Worker's has 163), so no Go tool is needed and none is waiting ongascitypacks-0uk. The step is 7955 characters.The trial by hand
Run on 2026-11-12 with Claude Code 2.1.322, claudeacp 0.5.0 and gc's source at the pin
6bd609f. A Worker's session is not logged in to run a model from a nestedclaude, so I ranclaudeas the acp box starts it (stream-json in and out,--permission-prompt-tool=stdio,--permission-mode dontAsk,--settings <city>/.gc/settings.json, setting sourcesuser,project,local) in a config directory of its own, with the Researcher's overlay as the project settings, against a scripted stand-in for the API that answers each request with the next tool call of a list. What it tries is Claude Code's own permission engine; it is not a trial against a model. The method is in the README.full-auto, and nothing prompts.No such tool available: Agent. Agent is disabled for this session, in subagents as well as here.The deny takes the tool out of the session. Edit, Write and NotebookEdit the same. Holds when the workspace is untrusted too: Claude Code ignores the project'sallowentries then ("this workspace has not been trusted") and keeps itsdenyentries.dontAskrefuses what no rule allows; a prompting mode asks. Bashtouchwith no allow rule: "denied because Claude Code is running in don't ask mode", file not made. Indefaultmode the same call went to the permission prompt tool.full-auto. The live acp sessions runclaudeacp --permission-mode dontAsk --effort high --model ... --settings <city>/.gc/settings.json, and theclaudeunder it gets--permission-mode=dontAsk(read from the process list).Bashallowed, lists merge as a union), an overlay allowing onlyBash(git log:*),Bash(grep:*)... changes nothing:touch,sh -c 'touch f',echo x > fandgit log --output=fall ran. With the overlay's list alone:touch,sh -cand the redirect were refused,git log,cat,grep,lsran, andgit log -1 --output=falso ran and wrote the file, since an allowed prefix allows every flag. A deny list of writers (touch,rm,git push,sed -i,tee) refusedtouchand nothing else that writes. So the rule "no file changed, no git write" is held by the formula and the skill, and the overlay keeps bareBash.Not tried, and left to build bead 5: a real model given a refusal, the whole path of a bead (sling, claim, comment, close), a 100,000-character comment.
Side effect to know of: the city's acp work directory is not in the live user config's trusted projects; the denies hold either way (above), but the overlay's own
allowentries are ignored until the directory is trusted, so what the Researcher may call comes from the city's list.How I checked
tests/researcher-formula.sh(new, run by CI): compiles the formula in a throwaway city; one step, five parts and Halting; the step closed as passed once and as failed only by a halt; the order of the writes; drain-ack last; no git command but a clone; norm; no sling; no write to a bead but the work bead and the step; the one mail; size; the 60 lines. It also runs the claim mark, the count, the post, the outcome and the close, the step's close, a restart that posted already, and the halt against a stubgc. Each rule was seen to fail by undoing it in the formula (agit commit, a close in Part 3, a comment on another bead, a missing "you post nothing", outcomeshipped, mail tohuman, a missing no-sub-agent sentence, the drain before the failed close, a missing scratch sentence, agc sling, a baremktemp). I did not try anrm -rfor agit pushmutation: the session refused that command text, so those two rest on the rm check's own self-test and on the git check that passes onlyclone.tests/formula.sh,tests/researcher.sh,tests/operator-overlay.shpass;gc lint .passes; the changelog check (v2,-base main) saysvalid=true. Rebased onto main with #86 and #66 merged, tests run again after.Bead: gascitypacks-n2x5
Review of
b8756c1160for gascitypacks-n2x5. Checks of the head: success.Verdict
pass
Findings
git cloneinto its scratch directory" says more than the design and the skill do. docs/researcher.md 3.3 lets the Researcher's Bash read with "clone, log, show, grep and the like", and the skill (roles/skills/researcher/SKILL.md:26) asks for facts "at a commit", which takesgit log/git showin the clone. The formula itself forbids only the writes (tests/researcher-formula.sh:379), so this is wording only: "runs no git command that writes, and clones only into its scratch directory" would match it.full-auto"on an acp box") ranclaudewith the flags claudeacp passes, not through claudeacp. The README and the PR say so, and claudeacp passing the mode on is read from the live process list, so the conclusion holds. Build bead 5's release trial should run one refused call through claudeacp itself, to close the gap.allowentries. The Researcher's WebFetch, WebSearch and two Perplexity tools then depend on the city's list. That needs a bead of its own before bead 5 (trust the directory, or put the tools on the city's list).Verified
[research-<id>],gc.work_outcome=no-op,gc.work_verification, close reasonFindings posted: [research-<id>], step close, drain-ack. The Halting section is in the step, as it must be withoutworker-halt. Line 172's Bash question is answered, and the changelog fragment and the PR description are there.fe5a75f, with #86 and #66): clean.gc lint .(2 packs ok),tests/formula.sh,tests/reviewer.sh,tests/operator-overlay.sh,tests/researcher.shandtests/researcher-formula.shall print ok (24 code lines, 7965 characters).go vet ./...andgo test ./...pass.-base=main:valid=true.trap 'rm -rf "$tmp"'is the form of every other test.bd comments <id>,bd comment <id> --file,bd close --reason,bd update --set-metadata/--unset-metadata. The claim mark and the escalation default are word for word those ofmol-worker-work(:92, :38).gc bd update/comment/closeby id). That is bead 5's trial, and the design names it there.b8756c1160e25a83bd11New commits pushed, approval review dismissed automatically according to repository settings
Review of
e25a83bd11for gascitypacks-n2x5. Checks of the head: success.Verdict
pass
Findings
tests/researcher-formula.shon the merge result prints 7965. Both are well under the 9000 the test holds it to. The figure in the description is out of date.allowentries. Today that costs nothing, because the city's list allows everything the overlay allows (Bash, Read, Glob, Grep, Skill, WebFetch, WebSearch, TodoWrite, ToolSearch). The two Perplexity entries that the README and the 0.8.0 changelog say the allow list "is to name" are not in the overlay on main. Once they are added, they take effect only after the directory is trusted. That is for whoever adds them (the Operator should know), not for this pull request.Verified
worker_session,worker_step, the same line asmol-worker-work.toml:92). It posts one[research-<id>]comment after counting the existing ones, writesgc.work_outcome=no-opandgc.work_verification, closes the bead with--reason "Findings posted: [research-<id>]", closes the step, then runsdrain-ack. The trial answers the three questions of row 4 and the line-172 question, and says what was not tried (claudeacp itself, a real model), which is left to bead 5. Changelog fragment and description present. Nopr_url,branchormerge_resultis written.gcand stubsgcfor the bead writes. That is allowed by docs/shell.md:166/233, and itsrmcalls act only on its ownmktemp -ddirectory. The formula's bash blocks are 24 code lines, under 60.bd comment <id> --file,bd comments <id>,bd close --reason,bd update --unset-metadataall exist.gc bd commentsanswers for an HQ bead and for a rig bead from one session.9e45e9e, the head's merge base): clean, forge says mergeable.gc lint .(2 packs ok),tests/formula.sh,tests/reviewer.sh,tests/operator-overlay.sh,tests/researcher.sh,tests/researcher-formula.sh("24 code lines, 7965 characters", ok),tests/pack-cache.sh: all ok.go vet ./...,go test ./...,go test -race ./...: ok.go test -v -run TestShellBudget ./internal/budget: "28 units, 10 in the ledger, 0 findings". Changelog checker v2.1.0 built from source,-base=main:valid=true.scriptsjob's tests, since this diff touches nothing they cover. The head's own run of them is green.