Repository navigation
Let the transport, not the payload, decide an inbound room share - #910
Conversation
applyInboundRoomShare took the inviter's home and handle from the envelope before the transport, and then used the same two values as the gate: a share naming a room of mine from a home the room does not belong to matched that room, rewrote its sharedFrom, and a bare line envelope created a room of its own. The author fields were read the same way (#909). Now event.fromHome / event.fromHandle decide and data.inviter* is display only, as #873 already wanted for the visible name. A share that names a room this home holds from another home is refused 'not-inviter' instead of merged through a fallback lookup; only op join projects a room, so a line for an unknown remote room is refused 'unknown-room'; and a line's authorId is kept only when the handle traces to the transport sender, a remote seat of that room, or its inviter, else the line is shown as the sending Bot with unverified: true and still kept. Tests: three cases in core/test/remote-room.test.js, all red on 093ff4d. The two touched paths are files FlyBot adds, so patches/ds-bot/files/ carries the same content the generator would write (no git on this box to run it).
7d37c69 to
07dee97
Compare
|
Ready for review at CI on the tip: Red-proof (in the PR body): on pristine |
|
Verdict: PASS at 07dee97 Ran:
What I verified in the code, not just the tests: Non-blocking notes: (1) the |
A pull request built on an old copy of main re-uploads whole files, and the work main merged after the branch was cut disappears while every check stays green: the deletion is part of the pull request. #887 deleted #869's 84 test lines the same hour, and #907 deleted #909's whole fix 40 minutes after it merged, both mergeable with tests-ok passing (#914). The rule is read off git. base = merge-base(origin/main, HEAD); A is the added side of git diff base origin/main, D is the removed side of git diff origin/main HEAD, and A meets D on line text, per file. Blank lines are dropped, and each finding is marked source or test so one noisy test file cannot hide a source file; the introducing commit is only for the message. It runs as a step of merge-gate.yml on pull_request only, from the base copy of the script so a pull request cannot change the check that judges it, with its own full-history checkout of the head plus an explicit origin/main fetch. Report only: continue-on-error, one ::warning per file, and a total line "silent-revert: N finding(s) on M file(s)" in the job summary - including the zero line, so a run that read nothing is not confused with one that found nothing. Tests: .github/scripts/silent-revert.test.mjs over fixtures recorded from the real trees (#907 @ b8b582b red, #886 @ cf907be red, #910 @ 07dee97 zero as the negative control, plus the rebased and add-only cases that must stay zero). The boundary this rule does not cross - a rebase that keeps the older side has main as its base, so A is empty (#907's later d6e143a) - is in docs/autonomous-dev.md.
A pull request built on an old copy of main re-uploads whole files, and the work main merged after the branch was cut disappears while every check stays green: the deletion is part of the pull request. #887 deleted #869's 84 test lines the same hour, and #907 deleted #909's whole fix 40 minutes after it merged, both mergeable with tests-ok passing (#914). The rule is read off git. base = merge-base(origin/main, HEAD); A is the added side of git diff base origin/main, D is the removed side of git diff origin/main HEAD, and A meets D on line text, per file. Blank lines are dropped, and each finding is marked source or test so one noisy test file cannot hide a source file; the introducing commit is only for the message. It runs as a step of merge-gate.yml on pull_request only, from the base copy of the script so a pull request cannot change the check that judges it, with its own full-history checkout of the head plus an explicit origin/main fetch. Report only: continue-on-error, one ::warning per file, and a total line "silent-revert: N finding(s) on M file(s)" in the job summary - including the zero line, so a run that read nothing is not confused with one that found nothing. Tests: .github/scripts/silent-revert.test.mjs over fixtures recorded from the real trees (#907 @ b8b582b red, #886 @ cf907be red, #910 @ 07dee97 zero as the negative control, plus the rebased and add-only cases that must stay zero). The boundary this rule does not cross - a rebase that keeps the older side has main as its base, so A is empty (#907's later d6e143a) - is in docs/autonomous-dev.md.
A link's join recorded the guest's own Bot and dropped the host's side whole; the join carried no roster and no group notice, so the guest's room listed nobody of the host's and its settings were empty. The join now keeps the Bot that carried it and carries the host's roster and notice; the guest records one remote per entry, shows the unverified and the unconnected honestly, and attributes a line only to a known Bot. Rebased on #909/#910: the transport-only inbound gate and the author rule are main's verifiedAuthor, extended only so a remote seat matches a claim by (home, verified); this branch adds no second gate and no payload fallback.
A link's join recorded the guest's own Bot and dropped the host's side whole; the join carried no roster and no group notice, so the guest's room listed nobody of the host's and its settings were empty. The join now keeps the Bot that carried it and carries the host's roster and notice; the guest records one remote per entry, shows the unverified and the unconnected honestly, and attributes a line only to a known Bot. Rebased on #909/#910: the transport-only inbound gate and the author rule are main's verifiedAuthor, extended only so a remote seat matches a claim by (home, verified); this branch adds no second gate and no payload fallback.
A link's join recorded the guest's own Bot and dropped the host's side whole; the join carried no roster and no group notice, so the guest's room listed nobody of the host's and its settings were empty. The join now keeps the Bot that carried it and carries the host's roster and notice; the guest records one remote per entry, shows the unverified and the unconnected honestly, and attributes a line only to a known Bot. Rebased on #909/#910: the transport-only inbound gate and the author rule are main's verifiedAuthor, extended only so a remote seat matches a claim by (home, verified); this branch adds no second gate and no payload fallback.
A pull request built on an old copy of main re-uploads whole files, and the work main merged after the branch was cut disappears while every check stays green: the deletion is part of the pull request. #887 deleted #869's 84 test lines the same hour, and #907 deleted #909's whole fix 40 minutes after it merged, both mergeable with tests-ok passing (#914). The rule is read off git. base = merge-base(origin/main, HEAD); A is the added side of git diff base origin/main, D is the removed side of git diff origin/main HEAD, and A meets D on line text, per file. Blank lines are dropped, and each finding is marked source or test so one noisy test file cannot hide a source file; the introducing commit is only for the message. It runs as a step of merge-gate.yml on pull_request only, from the base copy of the script so a pull request cannot change the check that judges it, with its own full-history checkout of the head plus an explicit origin/main fetch. Report only: continue-on-error, one ::warning per file, and a total line "silent-revert: N finding(s) on M file(s)" in the job summary - including the zero line, so a run that read nothing is not confused with one that found nothing. Tests: .github/scripts/silent-revert.test.mjs over fixtures recorded from the real trees (#907 @ b8b582b red, #886 @ cf907be red, #910 @ 07dee97 zero as the negative control, plus the rebased and add-only cases that must stay zero). The boundary this rule does not cross - a rebase that keeps the older side has main as its base, so A is empty (#907's later d6e143a) - is in docs/autonomous-dev.md.
Owner: Dev
Reviewer: Reviewer
Fixes #909
Refs #904
Tip SHA: 07dee97
What changed
applyInboundRoomSharetook the inviter's home and handle from the envelope before the transport (:1808-1809) and then used those same two values as the gate, so an envelope that named a room of mine could match it from a home the room does not belong to, rewrite itssharedFrom, and a barelineenvelope could project a room of its own. The author fields were read the same way.Now
event.fromHome/event.fromHandledecide anddata.inviter*is display only — which is what #873 wanted for the visible name:inboundOf) uses the transport; a share that names a room this home already holds while arriving from another home is refusednot-inviter— the "match the stored values as well" fallback is gone, so a mismatch is a refusal, not a merge;sharedFromkeepsinviterNamefrom the envelope (The receiving side names a shared room after the Bot that transmitted the share, not the person who invited #873's visible outcome) and takesinviterHome/inviterHandlefrom the transport, so an envelope can be displayed but never re-writes whose room it is;op: 'join'; alineenvelope for an unknown remote room is refusedunknown-roomand opens nothing;authorIdonly when it traces to the transport sender, a remote seat of that room, or its inviter. Anything else is shown as the Bot that delivered the line withunverified: true, and the line is still kept — a forged claim must not become a way to silence a message (A guest's room shows none of the host's Bots: the join envelope carries no roster, and the mirror records at most one remote #904 blocking point 2). A non-handleauthorId(a person or Bot of the other home, The receiving side names a shared room after the Bot that transmitted the share, not the person who invited #873) is unchanged.Evidence
Three cases in
core/test/remote-room.test.js(+99/−0), each red on093ff4d4for its own reason and green now — I ran them against a pristine base tree and against the fix:refused: 'not-inviter',sharedFromunchanged, participant count unchanged, still one mirror room;linefor a remote room nobody shared:refused: 'unknown-room', no room created;authorIdis the transport sender,authorKind: 'bot',unverified: true, the line is kept; the sender's own claim stays unmarked.Ran at
07dee97don basecbad5e58:node --import ./test/harness-resolve.mjs --test --test-concurrency=2 "test/*.test.js"incore→ 1335/1336, the one failurecheck-arch-docs.test.js: "empty diff passes"(cannot diff against HEAD: this machine has nogit); it fails the same way on the base tree, so it is the environment, not this change;node scripts/lint.mjs→ 0 errors (43 warnings);remote-room.test.jsalone → 57/57.Not run:
npm run verifyas one command andarch-docsitself (both need a git checkout), the smoke test (noindex.jsorsrc/host/change beyond this function), and the plugin suites (nothing underplugins/changed).Diff scope
The two changed paths are files FlyBot adds, so
patches/ds-bot/files/carries the same content the generator would write —generateneedsgit, which this machine does not have, so the two files were mirrored by hand and their blob SHAs match theircore/counterparts exactly.Rebuilt on current main
cbad5e58, and checked against it rather than against093ff4d4:core/src/host/room-membership.js+41/−18(the removals are the four removed constructs above),core/test/remote-room.test.js+99/−0,docs/subsystems/core-host.mdone line replaced (the #896 paragraph fromcbad5e58is intact).Relation to #904
#907/#904 touch
:1808and:1926too. This PR owns the transport-vs-payload gate on this path; whoever lands second rebases and keeps one implementation of it.