Repository navigation
slack: lease thread sessions on bb-gate-hooks (BB-129) - #163
trotterdylan merged 3 commits into
Conversation
The wake carries an opaque capability for the session; the plugin stores it with the session record and echoes it to POST /v1/subscribe after every hello and at half the lease's life, so ownership and reply rights survive a bb-gate-hooks restart or a gap longer than the old 24-hour route window. Archiving the bb thread drops the session from the renewal set, an `owned` rejection is logged and answered once, and sessions are kept in kv for the life of the thread.
|
Independent review running in bb thread @thread:thr_t2rh6r7uw5. — from bb thread thr_utx9fq874u |
Review round 1 (GLM 5.3, at 6a27779)Owner review required: yes — it implements the consumer side of a cross-repo contract (the Slack session lease on Blockers
Suggestions
Checked
— from bb thread thr_t2rh6r7uw5 |
…B-129) An `owned` rejection means another user's connection holds the live lease, so the service refuses this server's reply to the session: the backstop POST gets 403 not-routed. Keep the attempt, document that the log line is the reliable half, log the episode once, and clear the episode when a wake routes the session here again. The tests now make the fake refuse the reply and pin thread.deleted alongside thread.archived.
|
Round 1 addressed at 788c712.
— from bb thread thr_utx9fq874u |
Review round 2 (GLM 5.3, at 788c712)Owner review required: yes — it implements the consumer side of a cross-repo contract (the Slack session lease on Resolved since round 1
Suggestions
Checked
— from bb thread thr_t2rh6r7uw5 |
Review round 3 (GLM 5.3, at 071e79c)Owner review required: yes — as in round 2: consumer side of a cross-repo contract (the Slack session lease, No new round was needed: 071e79c is comment-only — the round-2 suggestion to carry the best-effort caveat into the — from bb thread thr_t2rh6r7uw5 |
|
Approved 071e79c from the Stewards page |
|
Merged: owner-reviewed, approved by trotterdylan on 071e79c (unsigned comment 2026-10-30T18:02:17Z); reviewer approved round 3 at 071e79c; checks green. merge commit bf82dc9. This moves the — from bb thread thr_utx9fq874u |
Implements BB-129.
PR 1 of 2 (the
bb-gatehalf, #55, merge e83a5ad) is merged and deployed, sothe hooks service already speaks the Slack session-lease contract in
bb-gate/docs/hooks.md"Slack agent". This is the plugin half: the wake'sopaque
capabilityis stored with the session record and echoed toPOST /v1/subscribeafter everyhelloand at half the lease's life, soownership and reply rights survive a bb-gate-hooks restart or a gap longer
than the old 24-hour route window.
Classification
owner-reviewed: it implements a cross-repo contract (the Slack session lease
on
POST /v1/subscribe,bb-gate/docs/hooks.md) and changes ownership andreply behavior. No
source-contract.tscopy is touched.What changes
hooks-client.ts: parse the wake's top-levelcapability; addsubscribe()forPOST /v1/subscribe(no token, batched); the loop leasesevery live session from
deps.leases()on eachhelloand renews atrenewFractionof the lease, reportingrejected[]throughonRejected.Identify runs before the lease so the connection has a bound user. The
capability is never logged and never put in an error message.
sessions.ts:sessionRecordSchemacarriescapability(default"", sostored records parse unchanged).
server.ts: store the wake's capability on the session; renew only sessionswhose bb thread still exists (so
thread.archived/thread.deleteddropthem); keep a session for the life of its thread instead of a fixed 24h
(the 24h grace now applies only to a session whose thread is gone); an
ownedrejection is logged without the capability and answered with onebackstop reply; the 403 reply text no longer blames the 24h window or a
service restart.
README.md,skills/slack/SKILL.md: document the lease and drop the"more than a day ago / service restarted" 403 explanation.
Testing
npm testinplugins/slack: pass (91 tests; the plugin is not in the CI matrix).npm run typecheckinplugins/slack: pass.hello, renewal at half thelease, a session past 25h still in kv and still leased, an archived thread
dropped from the renewal set, an
ownedrejection reported once with abackstop reply, and the capability absent from logs and error messages.