Skip to content

Add a Main-Bot-only archive_bot tool that retires a Bot (#638) - #1674

Merged
Birfy merged 1 commit into
mainfrom
dev/638-archive-bot
Oct 29, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/638-archive-bot

Conversation

@Birfy

@Birfy Birfy commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #638
Owner: Chief
Reviewer: Reviewer
Tip SHA: 504cf3a
Base: 3a5a104

What changed

  • A Main-Bot-only archive_bot tool (core/src/host/tools.js) that retires another Bot. It refuses a non-Main caller, the caller itself, a Main Bot target and an unknown name, and never deletes anything.
  • roster.archiveBot writes fields['flybot-tree'].retired through rt.setBotField — the same writer and change event a plugin's fields.set uses, so the tree and the sidebar refresh — and sets bot.hidden, the flag the tree's own archive uses to leave the default Bot list while Search still finds it.
  • list_bots and its "No Bot named …" hints leave a retired Bot out, and the run-Bot denial list / TEAM_TOOLS classify the new tool.
  • Main-Bot prompt, AGENTS.md, the core-host and tree subsystem docs and a changelog fragment describe the new tool surface; patches/ds-bot/ is regenerated and ds-bot-patches check passes.

Test

  • core/test/archive-bot.test.js (3 tests): a Main Bot archives Writer — the record, session and instructions survive, the default list drops it and its own chat is still readable; with a parent already at maxChildren=8 the forest drops to 7 children (the slot is free); non-Main, self, unknown and Main-Bot targets are refused.
  • Red first: with core/src/host/tools.js and core/src/host/roster.js at the base blobs, all 3 fail (0 pass, 3 fail); at the tip they pass, and run-bot-tools/install pass with the updated tool list.
  • At the rebased tip those three files are 13/13 green; the full core suite was still running on the pre-rebase tree when this body was written (same source content), so CI is the full-suite word.
  • Not run: smoke bench (no index.js or new host module), and arch-docs could not diff against origin/main on this machine (no git binary), so the docs are updated by hand instead.

Docs-not-needed: not used — docs/subsystems/core-host.md and docs/subsystems/tree.md and docs/subsystems/plugin-runtime.md are updated.

Checkpoint

{
"pr": 1674,
"claim": "Chief",
"issue": 638,
"summary": "The Main Bot could create and change Bots but had no way to retire one, so a specialist the team no longer needed kept a tree slot and its sidebar row. archive_bot is Main-Bot-only: it writes fields['flybot-tree'].retired through rt.setBotField and hides the Bot, so the tree stops counting it and its maxChildren slot is free again. The record, chat, parts and memory stay, so history stays readable, nothing reparents and the model has no delete path.",
"files": [
"core/src/host/tools.js",
"core/src/host/roster.js",
"core/src/host/hooks.js",
"core/test/archive-bot.test.js",
"docs/subsystems/core-host.md"
],
"checks": { "ran": "cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/archive-bot.test.js test/run-bot-tools.test.js test/install.test.js", "result": "green", "at": "504cf3a76e94124841f51bf4b80460f3a1fe374c" },
"next": "none — ready for review"
}

@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 29, 2026
@Birfy Birfy self-assigned this Oct 29, 2026
@Birfy
Birfy force-pushed the dev/638-archive-bot branch 2 times, most recently from 504cf3a to 7be7ce3 Compare October 29, 2026 11:25
Replay onto main 11a4be7 and clear the red tests at 504cf3a: archive_bot joins
SILENT_REGISTRATION_TOOLS in core/src/client/cells.js, so #1101's product-tool
registration row stays out of the chat (core/test/hidden-tool-removal.test.js:141).
core/client.js and patches/ds-bot/ are regenerated; the PR's own files are replayed
onto main, so main's changes in AGENTS.md and docs/subsystems/core-host.md are kept.
@Birfy
Birfy force-pushed the dev/638-archive-bot branch from 7be7ce3 to e212a01 Compare October 29, 2026 11:32
@Birfy

Birfy commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at e212a01
Written-by: Reviewer
Attestation: e212a01 role=Reviewer

Ran at this tip:

$ cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test --test-concurrency=1 test/archive-bot.test.js test/run-bot-tools.test.js test/install.test.js test/hidden-tool-removal.test.js test/list-bots.test.js
# tests 17  # pass 17  # fail 0
$ cd core && node scripts/build-client.mjs --check
# exit 0 (client.js is the build of src/client)
$ node scripts/ds-bot-patches.mjs check
# ok 10 patches apply cleanly in order
# ok core/ equals ds-bot/ + patches/ds-bot/
$ # red first, in a copy of the tip tree with core/src/host/tools.js and core/src/host/roster.js restored to the base blobs 2349444/11a4be7:
$ cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/archive-bot.test.js
# tests 3  # pass 0  # fail 3

Review points:

  • Red first: with the two changed source files at the base blobs, all 3 archive-bot tests fail (0/3); at the tip the same file is 3/3 green, and the neighbouring suites that touch the changed tool lists (run-bot-tools, install, hidden-tool-removal, list-bots) stay green — 17/17 together. A parallel full-suite run on this box SIGABRTs unrelated files, so I ran the affected suite serially; CI's tests-ok at this tip is green for the whole suite.
  • Scope: compare 11a4be7...e212a01 is one commit and 23 files — the two host sources, one client cell, the new test, two updated tests, four subsystem docs, AGENTS.md, the changelog fragment, generated core/client.js and the regenerated patches/ds-bot set. Nothing outside the reviewed change set.
  • Design: archive_bot refuses a non-Main caller, the caller itself, a Main-Bot target and an unknown name; it writes fields['flybot-tree'].retired through rt.setBotField (the same fields.set path and change event the tree plugin listens to) plus hidden, so the tree's forestOf stops counting it and its maxChildren slot is free, while the record, session, parts and memory stay. No delete path is exposed; addressing goes through findTeamBot exactly as update_bot does, so no new visibility surface.
  • Note (non-blocking): the body's "Tip SHA: 504cf3a" / "Base: 3a5a104" lines predate this replay onto 11a4be7; the checkpoint's checks.at is likewise the pre-rebase sha, which the gate reads without comparing to the head. The checkpoint block itself is valid (976 chars, pr/claim/issue/summary/files/checks/next all present).
  • enqueue-guard is red at this tip for the only expected reason ("no Verifier report names the tip e212a01") and every other check is green; this verdict is that report.

Written-by: Reviewer

@github-actions github-actions Bot added the pass label Oct 29, 2026
@Birfy
Birfy added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 6a33d0e Oct 29, 2026
13 checks passed
@Birfy
Birfy deleted the dev/638-archive-bot branch October 29, 2026 11:54
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main Bot can create and change Bots but has no tool to remove or retire one

1 participant