Repository navigation
feat(queen): bees record a tri cast, read a tool index, name missing tools - #531
Merged
Merged
Conversation
…tools Every bee job now ends with a terminal recording in the tri cast format (asciicast v2 with exit-code events), written by queen-cast.ts to /workspace/casts/queen-N.cast and named on a `cast:` line of the VERDICT. The review checks it the way `tri cast check` does and says what it found in the note; it warns and never sends work back on it. Bees also get a generated index of the commands that already exist (one line per command, from the gHashTag/trinity tool catalog, cached with its commit), a rule to use it before writing a script, and a `missing-tool:` verdict line for a repeated job with no tool. The review counts tool calls per job, the indexed commands used and the missing tools, and logs and reports them. On the Mac, land.mjs can hand a landed bee's recording to `tri cast ship` as a dry run (cast-ship.mjs), opt-in with TRI_CAST_SHIP=1, never --confirm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Each bee job now ends with a check that can be rerun. Bees also see the tools that already exist.
1. Each job ends with a
tri castrecordingqueen-cast.tsis a Bun recorder that writes thetri castformat: asciicast v2, plus anxevent that carries each command's exit code and thecommands/redactedheader fields. It followstermgif.pyclosely enough thattri cast checkaccepts its files. The bee runs it as the last step of the job:~in the output and in the header./workspace/casts/queen-N.cast, outside every worktree, so it can never be committed.## Recording your worksection, and the VERDICT template has acast: <path>line. The worker system prompt repeats the rule.parseVerdictCastreads thecast:line.cast(- cast: met) is still a criterion.2. The review warns but never fails on the recording
The review reads the file and checks it the way
tri cast checkdoes:The result is one sentence near the top of the review note, plus a
castfield (ok/missing/fail) in the log. It never changes the decision.This is deliberate. A missing or failing recording would otherwise send back work that meets every criterion. Here is how the rule could tighten later:
3. From the Mac to the blog
To publish a bee's recording by hand:
There is also an opt-in automatic chain, because harvest (
land.mjs) runs on the Mac:TRI_CAST_SHIP=1(off by default),land.mjscallscast-ship.mjsfor each issue it lands.cast-ship.mjsfetches the recording through the existing container channel. The bytes travel as hex, becausechannel.clean()drops lines containing "Existing" or "Migrate".tri cast checkon the recording. Only if the check is clean does it runtri cast ship <cast> queen-N --title ... --desc ....--confirmand never passes--repo. That makes it a dry run: it renders local files and drafts, and sends nothing. Publishing is still the owner's tap.castsfield of the land record.4. Bees get a tool index and a
missing-tool:linequeen-tool-index.jsonis generated from the tool catalog of gHashTag/trinity, not written by hand. The catalog is the cards underapps/website/public/t27/files/specs/tools/, read through the site's ownreadToolCatalog(). That joinsspec-tools.jsonwith thespec-tools-trios.jsonpart file and checks the hash and count.name - purpose, merging aliases that share a purpose) and covers trios tri, trinity tri, t27 tri and MCP: 360 lines.a1b44cbc3025. Regenerate it once that PR merges.## Tools you already havesection just before## Finishing, and costs about 7k tokens per brief.missing-tool: <what>to the verdict block. The worker system prompt repeats the rule.parseVerdictMissingToolsreads these lines, which are not criteria and do not end the block.toolrows and notes which indexed commands it ran.toolsandmissingTools.Tests
Only targeted files were run; the full suite is left to CI.
tests/api/queen-cast.test.ts(19) andtests/api/queen-tools.test.ts(13). All pass.queen-salvage-guardsfails one test at the 5s default timeout: a git-heavy rename test. It passes with--timeout 60000and does not touch this change.selftest.mjs: the 4 newcast-shipcases pass when run on their own. The full selftest timed out locally.tsc. Left to CI.🤖 Generated with Claude Code