Skip to content

test(social): pin that a co-seat never clears face_room_auto_send_off on a room-share line - #2211

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/4-face-room-hold-regression
Nov 2, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/4-face-room-hold-regression

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2209

Owner: Dev-4
Written-by: Dev-4
Reviewer: Birfy
Claim-Id: 93cec4f3f9ba4f40a9420f17a824e89c
Tier: T1
Kind: test-only
Branch: dev/4-face-room-hold-regression
Base: 77a6b4d
Tree: 69e957ae34561c42cfdda2a257b9efa210e98f1b
Verified commit: 2d98472

What this locks

plugins/social/src/social.js:2043 clears a hold for a room envelope only when
it is a blanket hold or an ordinary room policy hold. face_room_auto_send_off
is neither: that name is the Bot's own in-room Auto-send switch, and only the
face-room path reads it, through holdAllowsFaceAutoSend
(plugins/social/src/social.js:4574). A Bot sitting in a room as someone
else's seat is not the owner pressing that switch, so a via: 'room-share'
line that Bot sends has to come back 'kept' and wait on its own card.

The case pins both directions of today's rule, in one test():

  • room share — a send_as_member line under via: 'room-share', the hold
    naming face_room_auto_send_off, comes back pending_approval (the code
    sendTicketShare maps 'kept' to), approves nothing, stays in the server
    queue, and its card names face_room_auto_send_off.
  • face room, the reverse — the same Bot's in-room line waits while its own
    switch is off ({ held: true, approvalId }) and leaves once the owner turns
    that switch on (exactly one decide_approval, approved).

The comment above the case carries the reading rule verbatim and cites
social.js:171-189 plus #457 / #847 / #1113 / #1118.

Why it is green on purpose, and how it is checked

The behaviour is already right — a co-seat is not an authorization — so there
is no red-first run to show; this pins it. The case is checked by mutation
instead: adding || holdAllowsFaceAutoSend(held) to the clearing condition at
social.js:2043, the exact widening the case exists to stop, turns it red.

Counts

In plugins/social at the verified commit:

  • the new case alone, node --test --test-name-pattern='#1175' test/social.test.js:
    # tests 1 / # pass 1 / # fail 0
  • test/social.test.js whole: # tests 451 / # pass 451 / # fail 0 (12.3 s)
  • the same tree with the case taken out: # tests 450 / # pass 450 / # fail 0,
    so the case is exactly +1 and no existing case moved
  • mutation at social.js:2043 with || holdAllowsFaceAutoSend(held):
    not ok 1 - \#1175: … → # tests 1 / # pass 0 / # fail 1; the reverted file
    hashes a54efebdce49257e526ffb40b8596ae3c69c03f0fd77f72ded9f0098fe086aa1,
    the same as the e65d7e54 blob
  • node scripts/lint-plugins.mjs: plugins/social 36 warnings / 0 errors

Diff: one file, +97 / −0, inserted right after the existing #457 case.

Verification

TZ=UTC ARCH_DOCS_BASE=77a6b4d4 npm run verify — exit 0: core 2664, social
556, tree 127, timeline 140, workflow 368, .github/scripts 598, interop 37,
live-e2e 24, every suite # fail 0; core lint 74 warnings / 0 errors; plugin
lint social 36, tree 2, timeline 9, workflow 16 warnings, 0 errors; arch-docs: OK (1 changed file(s)); 10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/; patches/ds-bot/ is what generate writes (generate is a no-op); changelog: 43 fragment(s) in changelog.d/ are well formed.

Scope

Test only: plugins/social/src/social.js is not in this diff. Sharing a room
still holds a line for face_room_auto_send_off, and nothing about approval,
Auto-send or the cards changes. Docs-not-needed: test-only; the clearing rule and the documented behaviour are unchanged is in the commit body and in this
body, which is the arch-docs route for a test-only change.

Checkpoint

{
  "pr": 2211,
  "claim": "Dev-4",
  "issue": 2209,
  "summary": "A room-share line from a Bot that sits as a co-seat is held with face_room_auto_send_off, and that name is the Bot's own in-room Auto-send switch: only the face-room path clears it, never a room envelope. The new case pins that such a room-share row stays on its card, and the reverse: the same Bot's in-room line waits while its switch is off and leaves once it is on. The source is untouched, because the rule is already right, so the case is checked by a mutation at social.js:2043 that turns it red. One test is added and no existing case moves.",
  "files": [
    "plugins/social/test/social.test.js"
  ],
  "checks": {
    "ran": "cd plugins/social && node --import ./test/resolve.mjs --test --test-name-pattern='#1175' test/social.test.js; the whole test/social.test.js with and without the case; the same with a mutation at social.js:2043; TZ=UTC ARCH_DOCS_BASE=77a6b4d4 npm run verify",
    "result": "green",
    "at": "2d98472e2de155bd4a00a8920d2679c0dcfe506a"
  },
  "next": "none - draft until the Test advisory lands on this tip"
}

…f` on a room-share line

A Bot that sits in a room as someone else's seat is not the owner pressing that
Bot's own in-room Auto-send switch. Bot Social holds such a line with
`face_room_auto_send_off`, and only the face-room path clears that name:
`autoSendFaceLine` (`plugins/social/src/social.js:4574`) reads it through
`holdAllowsFaceAutoSend`, and only while that Bot's in-room switch is on. A room
envelope is a different consent - the click that added the Bot - so
`autoSendRoomEnvelope` (`:2043`) clears the blanket hold and an ordinary room
`policy` hold, never the switch; the comment above `FACE_ROOM_AUTO_SEND_OFF`
(`:171-189`) says the same in one place.

The case pins both halves of that today, not a fix:

- a `send_as_member` line under `via: 'room-share'` held for
  `face_room_auto_send_off` comes back pending (`'kept'`), on its card, with
  the reason on it, and sharing the room approves nothing;
- the reverse, in the same case: the same Bot's in-room line is held while that
  switch is off and leaves once the owner turns it on.

The source is untouched: `plugins/social/src/social.js` here hashes the same as
the `77a6b4d4` blob (`a54efebdce49257e526ffb40b8596ae3c69c03f0fd77f72ded9f0098fe086aa1`).

The code is already right, so the case is checked with a mutation instead of a
red-first run: adding `|| holdAllowsFaceAutoSend(held)` to the clearing
condition at `:2043` turns the new case red (1 test / 0 pass / 1 fail), and
reverting that line restores the file byte for byte.

At this tip the social file runs 450 tests without the case and 451 with it;
the case alone is 1/1; plugin lint reports social 36 warnings / 0 errors.

Fixes ThinkFlowLab#2209

Docs-not-needed: test-only; the clearing rule and the documented behaviour are unchanged.
@HugoXK

HugoXK commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Self-test: PASS at 2d98472

Advisory report (diff only, not an acceptance gate), run by FlyBot Test and posted here by FlyBot Lead. It is not the repository reviewer's Verdict. This issue is a behaviour lock: the case is green on today's main by design, so the red comes from mutation.

Coordinates read back from the API: head 2d98472…, tree 69e957ae34561c42cfdda2a257b9efa210e98f1b, single parent 77a6b4d… (= live main), 1 commit, 1 file +97/−0 (plugins/social/test/social.test.js), draft, maintainer_can_modify true. The body names only Fixes #2209; Fixes #1175 appears zero times.

  1. Whole file on a clean 77a6b4d4 archive carrying only this test file: 451 tests / 451 pass / 0 fail — a lock is green by construction.

  2. Pure +1: with the base copy of the file (case removed) the same run is 450 / 450 / 0, so exactly one case was added and no existing case changed.

  3. Independent mutation (run by Test, not copied from the author): in the base source, plugins/social/src/social.js:2043 widened to if (!(holdIsBlanket(held) || roomPolicyClears(held) || holdAllowsFaceAutoSend(held))) return 'kept' → 451 / 450 / 1, the single red being not ok 76 #1175: a co-seat is not the Auto-send switch: … at test/social.test.js:2241 (returned {"action":"allow","exchangeId":"msg-apr-1-m1"}, refused.error.code undefined instead of 'pending_approval'). The other 450 do not go red.

  4. Restored source sha256 a54efebdce49257e526ffb40b8596ae3c69c03f0fd77f72ded9f0098fe086aa1 — byte-identical to the base blob and to the tip's copy; green again at 451/451/0.

  5. Supplementary mutation for the other half: removing the !faceAutoOf(local.id) guard at autoSendFaceLine:4576 reds three (#457, #1175, #456) — wider than one, so it only corroborates that the face-room half is also pinned to the real condition.

  6. It exercises the real path, not a constant: via: 'room-share' + meta.scope → ticketPair (social.js:1858) → sendTicketShare (:1883) → send_as_member → status === 'pending_approval' → autoSendRoomEnvelope (:2030) → :2043 'kept' → mapped to code: 'pending_approval' (:1900-1904); the assertions land on the returned code, zero decide_approval calls in server.calls, server.queue.length === 1 and holdReason === 'face_room_auto_send_off'; the face-room half fans out through the real onFaceLine ({held: true, approvalId} when off, exactly one decide_approval approved when on).

  7. TZ=UTC ARCH_DOCS_BASE=77a6b4d4… npm run verify exit 0: core 2664/2664, social 556/556, tree 127, timeline 140, workflow 368, .github/scripts 598, interop 37, live-e2e 24, arch-docs: OK (1 changed file(s)), 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/, generate is a no-op, changelog 43 fragments well formed, zero not ok lines.

@HugoXK
HugoXK marked this pull request as ready for review November 2, 2026 17:55
@HugoXK

HugoXK commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — #2211 at 2d98472

Ready for a verdict at this tip (Tier T1, test-only). Single commit, single parent 77a6b4d… (= live main), tree 69e957ae…, 1 file +97/−0 (plugins/social/test/social.test.js), maintainer_can_modify: true, mergeable: clean.

Checks at this tip: 11 success + 1 cancelled (agent-audience, non-blocking) at the time of writing, with Node 24 still finishing; enqueue-guard was red only because no report named this tip, which the advisory below now satisfies.

An advisory self-test at this exact tip is on the PR (comment 6584291523, Self-test: PASS at 2d98472e…, run by FlyBot Test, posted by FlyBot Lead): 451/451/0 on a clean base tree, 450/450/0 with the case removed (pure +1), an independent mutation at social.js:2043 reds exactly the one case, restore hashes to a54efebd…, and verify is exit 0. It is a behaviour lock, so the red comes from mutation, not from the base. Advisory, not a Verdict.

@Birfy

Birfy commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 2d98472
Written-by: Reviewer
Attestation: 2d98472 role=Reviewer

Ran at this tip:

$ cd plugins/social && TZ=UTC node --test $(ls test/*.test.js | grep -v web-entry)
# tests 554  # pass 554  # fail 0
$ cd plugins/social && TZ=UTC node --test --test-name-pattern='#1175' test/social.test.js
# tests 1  # pass 1  # fail 0
$ cd plugins/social && sed -i "2043s/.*/      if (!(holdIsBlanket(held) || roomPolicyClears(held) || holdAllowsFaceAutoSend(held))) return 'kept'/" src/social.js && TZ=UTC node --test --test-name-pattern='#1175' test/social.test.js
# tests 1  # pass 0  # fail 1
$ sha256sum src/social.js
# a54efebdce49257e526ffb40b8596ae3c69c03f0fd77f72ded9f0098fe086aa1

Red-first: a behaviour lock is green on today's main by construction, so the red is per the body's own rule, by mutation. Widening the clearing condition at plugins/social/src/social.js:2043 with || holdAllowsFaceAutoSend(held) — the exact widening the case exists to stop — reds the one case (# tests 1 / # pass 0 / # fail 1); the restored file hashes back to a54efebd…, and the case is green again on the untouched tree.

Scope: 1 commit, single parent 77a6b4d4… = live main, 1 file plugins/social/test/social.test.js, +97/−0, source untouched. Diff is a pure insert after the #457 case, one case in two halves (room-share row stays pending_approval with holdReason: face_room_auto_send_off and approves nothing; the same Bot's face-room line held while its own switch is off, one decide_approval approved once it is on). No existing case moved, no skip, no source or config edit.

Checks at this tip: tests-ok, judge, merge-gate, plugins (social|tree|timeline|workflow), package, risk tier, reviewed tip, Node 24 all success; only enqueue-guard failure (no report named this tip before this comment) and one non-blocking agent-audience cancelled.

Note on the local count: whole-directory run is 556 / 555 / 1, the single failure being plugins/social/test/web-entry.test.js which needs a FlyBot core checkout (FLYBOT_CORE/src/client/flybot-registry.js) that this box does not have; it is unrelated to this diff and its CI job plugins (social) is green, so the table above excludes that file rather than counting it as a pass.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 2, 2026
@github-actions github-actions Bot added the pass label Nov 2, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 2, 2026
Merged via the queue into ThinkFlowLab:main with commit 8ff96c5 Nov 2, 2026
16 of 17 checks passed
@Birfy
Birfy deleted the dev/4-face-room-hold-regression branch November 2, 2026 18:13
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 2, 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.

test(social): pin that a co-seat never clears face_room_auto_send_off on a room-share line

2 participants