Skip to content

feat(rooms): complete fenced coordination and native Stop recovery - #4

Open
JackHunzicker wants to merge 33 commits into
dokterdok:feat/bot-mode-group-chat-complete-20260830from
JackHunzicker:contrib/hosted-room-corrections
Open

JackHunzicker wants to merge 33 commits into
dokterdok:feat/bot-mode-group-chat-complete-20260830from
JackHunzicker:contrib/hosted-room-corrections

Conversation

@JackHunzicker

@JackHunzicker JackHunzicker commented Sep 8, 2026

Copy link
Copy Markdown

Summary

Complete hosted-room coordination contracts on top of NousResearch#98307, retaining its durable store, scheduler and transports. This companion targets that feature branch rather than duplicating its inherited changes against main.

Changes

  • Preserve historical identities; revision-fence membership, titles and roster-dependent sends, including attachment commitment.
  • Bind runtime sessions and participant actions to exact room/thread/member/attempt coordinates, retaining author provenance.
  • Add capability-gated canonical history, edits/deletion/reactions, shared read cursors, reply parents and responder policies.
  • Preserve post-policy corrections to older messages across restart, and only advance delivery watermarks through actually emitted byte-bounded input.
  • Negotiate RoomLink semantic replication features, reject unsupported writers before acknowledgement, and exclude local-only participant tools from peer execution surfaces.
  • Fence approval, input, Stop and retry against exact task generations.
  • Preserve native Stop uncertainty through room finalization, SQLite recovery and peer receipts. Absence of terminal acknowledgement is not cancellation proof.
  • Preserve Windows file paths and bytes while rejecting linked canonical blobs, redirects and unbounded response reads.

Verification

Submitted commit 19aa9853869d249548dea18cb463773f3dcb0341, based on NousResearch#98307 head fab0ac73f070be481b1fe8f7637ee533ad7950ea:

  • Canonical runner: 1,735 tests passed, zero failures, two existing skips across 115 files, retries disabled.
  • Includes the native-room Stop acknowledgement regressions and the full prior hosted-room suite.
  • Regression tests cover roster changes during Send, policy-switch mutations, mixed-peer replication and local-only tool exposure.
  • All 33 contribution commits carry developer sign-offs; whitespace checks pass.

Run scripts/run_tests.sh -j 4 --file-retries 0 over tests/gateway/test_hosted_room*.py, tests/gateway/test_hosted_rooms*.py, tests/tui_gateway/test_hosted_room*.py, tests/tui_gateway/test_groups*.py and tests/gateway/test_api_server_native_stop_ack.py.

Dependencies and limits

…dates

(cherry picked from commit e64ff897ae63befaa4bf0e9fbb3b7c1e5dae03f2)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 205d55c4a8c65477d716e3130ab7a1e642fb5b7b)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit a9a7b08b234692a2d30686cf8695b326f5626c74)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 076514cccf6b135b115b6a5f70c68ddf1879f465)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 1760659880e1c110f2eff4a8ecb79bb2e202e10d)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 3c912042e7a6a8d992aacc5fe1f3072913615491)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit baf1b6740bd7bf1c4305326de579bffc972f633b)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 34e3f499b118ee903805639ca43f8c4a93876a7d)
Signed-off-by: Jack <JLHunzicker@gmail.com>
…dows

(cherry picked from commit fcc2c74165e82a9d5acd21eb05c32a2ee7b9d530)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit f8652ef4fa3008a4cbea98c89a7ed3f0515b3845)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 4fbc6a9dc3baadc44cdd7adf627d2188a7c8e9e0)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 2630748c0138432f9c6cda397be83b280aff1832)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 19677a8ae0b94c26670e4bc99935b0182280ee77)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit b016f22381f0bbf691258ef777e89ab9754f0c0a)
Signed-off-by: Jack <JLHunzicker@gmail.com>
…urns

(cherry picked from commit 76810d8681a4d7301a5d7053506bcfd1d4d07fe8)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 58f761faa773c1f6495592f05877e7107e0fe1d1)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 9f17ee6b43a721fa9810b6d5fccc2f76d994475c)
Signed-off-by: Jack <JLHunzicker@gmail.com>
… replay

(cherry picked from commit 6661d6afb37cffa1fc9a89ce492ae2d8a8203b2a)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 82a0b5179440f0d57666410894c3cfca073993e1)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit e16f15a78920f1e9df5069f9dd89692c04b40a58)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit a15e4cfd5936d7d03cea89cda8d9804c8e0134f2)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit ec5a900f589dca56d4d42a2dd910e7ec6441390f)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 801220c40c65bf98fb23be6483133af7c080004d)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit e2b55c746276c42f0d1666dbcce0942c7f02d5ae)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 90b65ef691237a88e6817861dc2ec4ba28226582)
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit b46a15070f3b30fe1dc1bc4c351099d8bcfc9c8b)
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 848371e56146658953abcdff9120153de0e8287d)
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
Signed-off-by: Jack <JLHunzicker@gmail.com>
(cherry picked from commit 16821e0b90867985e88322b7c7b986079af4adc2)
Signed-off-by: Jack <JLHunzicker@gmail.com>
dokterdok pushed a commit that referenced this pull request Sep 18, 2026
… fingerprint never authorizes a signal

NousResearch#111617 review (andrexibiza P1 #3/#4, kvnloo nit):

- worker_started_at persisted only gateway.status.get_process_start_time(): on Linux that
  is /proc/<pid>/stat field 22, clock ticks since THIS boot. The threat is a row surviving
  a reboot, and that counter does not, so an unrelated process on a later boot with the
  same PID and the same tick value passed _start_times_agree(). The fingerprint is now
  "<gateway.drain_control.current_instantiation_epoch()>|<start>" (boot_id + PID-1 start,
  the witness the drain marker already uses); both halves must match. Integer values on
  rows written before this change keep the start-time-only comparison.
- A failed capture persisted NULL, which _pid_recycled treats as the legacy pre-fingerprint
  row and falls back to bare PID existence - a new spawn silently recreated the NousResearch#89614/
  NousResearch#99558 kill authority. A failed capture now persists UNVERIFIED_WORKER_FINGERPRINT: the
  claim is held while the PID is live (never released beside it, never SIGTERM/SIGKILLed
  by timeout, stale-claim, manual reclaim, archive or the terminal reaper) and reclaimed
  once it is gone. NULL stays legacy-only.
- Every tasks UPDATE that nulls worker_pid nulls worker_started_at too (archive_task and
  the reclaim/timeout/reopen paths): the fingerprint is part of the kill-authority tuple
  and must not outlive its pid.

Live (real sleeper child): reboot-shaped row (same pid, same tick, other boot id) ->
reclaimed to ready, child untouched; matching fingerprint -> SIGTERM delivered, exit -15.
tests/hermes_cli/test_kanban_worker_pid_fingerprint.py: +2 hostile tests, both red on base.

Not changed: the check-then-act window between _pid_recycled and kill (kvnloo P2) is
real but needs pidfd_open/pidfd_send_signal (Linux 5.3+) to close atomically; left as
the documented residual of "never kills a DETECTED recycled PID".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant