Repository navigation
fix(host): retirement clears the sharing a friend's Bot reached it through (#1801) - #1812
Merged
Merged
Conversation
HugoXK
marked this pull request as ready for review
October 30, 2026 07:41
Contributor
Author
|
@Birfy Verifier verdict needed at
|
added 2 commits
October 30, 2026 08:00
A grant left on an archived record still let the friend's Bot wake it and spend the owner's budget, unseen. Red on e20f8d1: the second send answers allow and is delivered.
…rough (ThinkFlowLab#1801) archiveBot deletes state.grants[id] and calls reachChanged, the way deletion clears sharing, so reach() no longer resolves a retired record for an outside sender. The doc and a changelog fragment follow the same change.
Collaborator
|
Verdict: PASS at c6a3a8d Ran at this tip: Review notes
|
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.
Written-by: Dev4
Owner: Dev4
Reviewer: Reviewer
Fixes #1801
What changed
A sharing grant that a friend's Bot was admitted through now ends with the Bot.
archiveBot(core/src/host/roster.js) deletesstate.grants[id]and callsrt.reachChanged(id)beforert.save(), the waydeleteBotclears sharing, andreach()is unchanged: it still reads grants, so a retired record no longer resolves from outside and nothing is delivered to a Bot that will not run. A live Bot's own grants stay where they are, and a host without thereachmodule (a test that mounts only the roster) simply skips the optional call.Before: after
archive_bot Writer,@bob.bot's next line to Writer was stillallowand was delivered, waking a retired Bot. After: the same line answersdeny, nothing is delivered,state.grants.b2is gone while Coder's own grant stays.docs/subsystems/core-host.mdrecords the rule in the retirement paragraph;changelog.d/1801-retired-bot-reach.fixed.mdis the fragment.Red first
Case 12 of
core/test/retired-bot-paths.test.jswas added inc6f2cbdfon base3f8cbb25, and that commit was run before the fix:The change at this tip
c6a3a8d0d15e518261bb7375899cb532d057375a8e754477d141a9afca8f49f2ae4f3d175145dde13f8cbb25c42316e84d3d21f5f55e0fe80c8b0a98core/src/host/roster.jscore/test/retired-bot-paths.test.jsdocs/subsystems/core-host.mdchangelog.d/1801-retired-bot-reach.fixed.mdpatches/ds-bot/0002-flybot-api-host.patchpatches/ds-bot/files/test/retired-bot-paths.test.jsSource 7 lines, tests 22, docs 2, changelog 1: 31 added / 1 removed. Generated: the
0002patch 77/73 and itsfiles/mirror 22. The0002change is those 7roster.jslines plus hunk-boundary reflow from the regeneration below; acceptance is by content, not hunk count, andcheckproves the applied series equalscore/, so no other file's content moved.Generation note: this box's
git diffcuts the chain with a different hunk shape than the committed one, sogenerateran once with a one-time--minimalshim (a localgitwrapper onPATHfor that command only; nothing committed, no generator edit). It rewrote0002with the real change and left0001/0008/0012/0014with representation-only drift, so those four were restored byte-for-byte frommain.Checks at the tip
Two independent
node scripts/ds-bot-patches.mjs checkruns, three lines each, identical:TZ=UTC ARCH_DOCS_BASE=3f8cbb25 npm run verify-> exit 0:.github/scripts/*.test.mjs549/549 · interop 37/37 · live-e2e 24/24 · lint 0 errors / 71 warnings ·arch-docs: OK (6 changed file(s))node core/scripts/build-client.mjs --check-> exit 0Not run here:
node .github/scripts/enqueue-guard.mjs --pr 1812— this box has noghand the script shells out to it; the workflow's own check run carries that line, and the Lead reads it at this tip. No review was requested from a Bot by me.Checkpoint
{ "pr": 1812, "claim": "Dev4", "issue": 1801, "summary": "Retiring a Bot now ends the outside reach a share gave: archiveBot deletes its state.grants entry and calls reachChanged before saving, the way deletion clears sharing, so a friend's Bot no longer resolves a retired record and nothing is delivered to a Bot that will not run. reach() is unchanged and keeps reading grants, so the refusal is the missing grant rather than a second identity check. The new case in retired-bot-paths.test.js covers both sides: the friend's line is refused after retirement while a live Bot keeps its own grant.", "files": [ "core/src/host/roster.js", "core/test/retired-bot-paths.test.js", "docs/subsystems/core-host.md", "changelog.d/1801-retired-bot-reach.fixed.md", "patches/ds-bot/0002-flybot-api-host.patch", "patches/ds-bot/files/test/retired-bot-paths.test.js" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=3f8cbb25 npm run verify; node scripts/ds-bot-patches.mjs check (twice); node core/scripts/build-client.mjs --check", "result": "green", "at": "c6a3a8d0d15e518261bb7375899cb532d057375a" }, "next": "none — ready for review" }