Skip to content

feat: mirror /note to the channel, closing the mid-send TOCTOU on its two send paths - #6831

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:feat/note-channel-mirror
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:feat/note-channel-mirror

Conversation

@rnoack1

@rnoack1 rnoack1 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

POST /api/chat/slots/{slot}/note writes two halves. Only one was surface-aware.

The context half is already surface-agnostic: drain_pending_context runs inside _run_chat, the one runner every inbound surface shares, so a note reaches the model whether the next message is typed in the dashboard, Slack or Telegram.

The visible half was not. slot.append(broadcast=True) fans out over the dashboard's own SSE/WS and nothing else, and every channel egress lives in the turn loop (user echo, tool stream, assistant reply, approval prompt, auth error) as a separate site the note path never reached.

Why it matters

The result is worse-shaped than a missing notification: a session driven from a channel gained an agent that silently knew something its user was never shown. The note had no visible provenance on the surface they were reading, so the next turn referenced something with no record behind it. A missing notice gets noticed; invisible provenance does not.

What changed

Delivery reuses the two existing outbound paths rather than adding a third, matching chat_compaction_notice — the closest existing analogue, a proactive non-turn notice addressed to whatever conversation a session belongs to.

  • Slack — slack_client.post_message. Slack is deliberately absent from the channel_transports registry so it cannot ride the ladder, and it is the one channel bindable two ways: a Slack-born session's origin, or a dashboard slot's _slack_linked mirror. Both resolve here.
  • Every other channel — the governed cross-surface ladder (_resolve_channel_target), walking origin then mirror. This covers the remaining nine transports with no per-channel code, inheriting governance vetting, recipient re-authorization, supports_proactive_send and chunk_for_transport.

Both legs can fire for one note: a dashboard slot can hold a Slack thread link and a non-Slack mirror at once, and each is a conversation with a user in it.

The mirror is dispatched in the background and the response reports nothing about it. An earlier revision returned a mirroredTo field; First Principles measured zero consumers for it, and I confirmed that at source — the field appeared in 0 files at the base, so it had never shipped and no external caller could depend on it. It was also the only reason the POST waited on a channel at all. Removing it removes the wait, the ceiling that bounded the wait, and both arms that served it. The note's contract stays the transcript line and the context entry. For a note that is NOT held those are committed before the mirror is dispatched. A HELD note is not mirrored at all, which is how that inverse gap is closed. While a turn is running appended is false and neither half is committed, so a foreign binding acquired before flush drops BOTH rather than retargeting them; mirroring at POST would therefore have published a channel note asserting content the session never received. The dispatch is guarded by if not deferred: and deliveryConditional reports the hold, so no caller is told otherwise. Mirroring held notes at FLUSH time, once their halves land, now ships: the held record carries its authored destinations and flush_deferred_notes dispatches them, across its six invocation sites in three modules (chat_orchestrator twice, chat_runner twice, chat_handlers twice, the last two on a slot being torn down) (a different count from the seven resolve-then-send sites inventoried in slack_egress.py) and moving channel egress under it is a behaviour change to a surface this PR does not otherwise touch.

Two decisions worth a reviewer's attention

HELD NOTES MIRROR AT FLUSH, not at POST. A note arriving while a turn runs is held, and that is the common case for background senders by the module's own docstring, so it is the case the feature most needs to cover. Mirroring at HOLD time is rejected on orphan-post integrity: neither half is committed while held, so the channel would carry a line the transcript does not yet have, and a foreign rebind before the flush drops both halves and leaves the channel asserting a note that does not exist in the session. An orphan post is a data-integrity defect; a dropped best-effort mirror is not. So the POST dispatch stays guarded by if not deferred:, pinned by test_a_held_note_does_not_reach_the_channel, and the held record instead carries the destinations the note was AUTHORED for plus a bound dispatch. flush_deferred_notes calls it once BOTH halves commit, pinned by TestAHeldNoteMirrorsAtFlush. Snapshotting at authoring rather than at flush is what keeps the authored-link guarantee: a channel rebind during the hold makes the send REFUSE on the comparison instead of retargeting to the replacement. Three cases are pinned separately — the dispatch itself, a raising mirror not un-writing a committed note (the suffix-restore must not fire for a delivery failure), and a note dropped for a foreign rebind never dispatching at all. The mirror is carried on the record rather than threaded through a new parameter because flush_deferred_notes is called from five sites across three modules and its no-argument spelling is asserted by tests outside this change.

An absent snapshot is no longer a licence to deliver. authored_link is TWO-state on the shared helper: omitted (an inline caller, which has no authored binding to compare against, which therefore skips only the authored comparison, not the continuation re-ask) or a captured link (compare and refuse on a mismatch). There is no _UNSET sentinel — the third case, a slot with NO binding when the work was authored, is refused at the ONE site that can produce it, chat_note_mirror._deliver_via_transport, whose if authored_link is None: guard returns without delivering. That placement matters: the helper's walk runs when the TASK runs, so passing an unbound slot through would let it read a binding created after authoring and treat that as the authorized destination. Refusing at the capture site's consumer keeps the shared helper two-state and needing no sentinel to tell "absent" from "captured None". That refusal files a denied audit_channel_send row under the reason code unbound_at_authoring, because on an install that HAS channel transports it is a permission decision about a real deliverable surface, and it would otherwise be the only denial on this leg with no SEL record. The exemption is the no-transport install, which stays silent: there the refusal is about the install rather than the request, so a row would fire for every note on every session while naming no destination. The emitter is module-level precisely because a second site refuses on this leg — a hand-written second copy is how a denial stream comes to look complete with one branch missing. A future producer that begins passing authored_link must still carry its own guard for the unbound case; the shared helper does not provide one.

Two duplications collapsed. deliver_to_channel's _walk_ladder closure was a second hand-written copy of snapshot_channel_link's origin→mirror pause-aware loop, so "the snapshot and the delivery agree by construction" actually meant "they agree as long as both copies are edited together" — and a pause-awareness fix applied to one is exactly the divergence the comparison cannot detect. The closure now calls the shared helper. snapshot_slack_link was a pure alias of a private _slack_link with one consumer; the body now carries the public name and the alias is gone.

channel_egress_permitted gains a required tool_name parameter and is public. Slack bypasses the ladder, so without sharing this gate the note's Slack leg would be the one unvetted, unaudited egress. Duplicating a fail-closed gate is how the two copies drift, so this is one function with a parameter rather than two that look alike. tool_name is a caller identity for the SEL record, never a permission input. It is public because it genuinely has two consumers in two modules — this chain and the compaction notice, which imports it from slack_egress — so a private name would advertise a boundary the code does not respect. tool_name carries no default: all three call sites pass it explicitly, and a default would only let a future caller inherit another feature's identity in the SEL record.

The pause gates are honoured on both legs. A note is background rather than turn output, so slack_mirror_is_paused / mirror_is_paused are not strictly aimed at it — but disconnect is the user saying "not into this conversation", which covers a note about it as much as a reply in it, and the dashboard transcript still carries the line either way.

Scope, stated up front. The hardened chain covers the note mirror and nothing else. api_send_message's Slack leg, the owner DM and the hook DM stay plain-client, and the compaction notice takes the shared gate without the rest of the chain, so three proactive-Slack tiers ship here rather than one. Reading the chain as a repo-wide guarantee would be wrong. The tier table below names every site, and a census test fails if a fourth tier appears unmarked.

One caller outside the note feature gains one refusal, and the line is fail-open vs contract-widening. api_send_message shares deliver_to_channel, and the split is by QUESTION rather than by caller.

Asked unconditionally. "Was the permit authorized under the ceiling STILL INSTALLED" needs no captured link: the ceiling is sampled before the target resolve, and that resolve is offloaded because it walks the profile directory, so it is an unbounded await for every caller. Asking this only when an authored link was present was a fail-OPEN — a tightening landing inside that window left the permit authorized under a ceiling no longer installed and part 1 went out on it. link_changed_during_recheck_before_part_1 and governance_changed_before_part_1 therefore apply to every caller, both refuse BEFORE part 1 so nothing is delivered, and test_an_inline_send_refuses_when_governance_tightens_during_resolve pins it.

Gated on authored_link. One question is dispatched-only: "is the live binding the one this WORK WAS AUTHORED FOR" (link_changed_before_dispatch). It compares against the binding a caller captured before its work was queued, and a caller that never captured one has nothing to compare — the parameter is where link comes from on that path, not a switch.

Also asked unconditionally; re-gating is disqualified by measurement, and the widened refusal set is IN SCOPE for this change rather than a deferred rider. What is left is a SCOPE ruling from the repository owner, not a correctness question: keep it here, or split it into its own reviewed change. The behaviour is described in full below and pinned by tests either way. "Is the live binding still the one THIS SEND SELECTED" compares the post-resolve walk against link, this send's own resolved destination, so every caller holds the comparand (link_changed_during_resolve) — and the per-chunk CONTINUATION re-ask asks the same of every later part. Earlier revisions gated both to keep an LLM-facing tool's mid-send contract out of a note change. That was a fail-OPEN, not a deferral: being inline bounds only the window before part 1, every transport send is an await, so a multi-part inline send spans the same window a dispatched one does and parts 2..N were reaching a conversation already unlinked. A mismatch is always a refusal, never a retarget. test_an_inline_send_refuses_when_the_binding_moves_during_resolve and test_an_inline_send_stops_remaining_parts_when_unlinked pin both.

send_message's refusal set changed here, not in its own change. Stated plainly because it is the one cross-cutting effect of this PR: the inline /api/send-message leg now refuses on a superseded governance ceiling, on a binding that moved during its resolve, and between parts once the destination is revoked. Each closes a hole where content reached a conversation the caller had not selected or was no longer permitted; none of them retarget, and none change a permitted send's outcome.

No other generation consumer regresses. governance_answer_generation's signature and contract are byte-identical to base (opaque int, comparison-only). Its four consumers all use it as an equality comparand — ws.py:777 (current != answer_generation, and that file is untouched by this change), state.py:7857 (a cache-invalidation field), slack_egress.py:180, and governance_ceiling_unchanged (== observed) — so publishing one bump per publication instead of two can only reduce FALSE invalidations, never suppress a real one. test_a_publication_moves_the_generation_exactly_once pins both directions: one publication moves it once, and a reload that publishes nothing does not move it at all.

Tests

test/test_note_channel_mirror.py — 117 tests across both legs: delivery, the session-map fallback for a bare slot, paused mirrors, foreign namespaced channel ids refused at the Slack client, swallowed delivery failures, fail-closed governance degradation, non-proactive transports skipped, a Slack link declining to ride the ladder, origin-before-mirror ordering, both legs firing together, recipient authorization on the Slack leg with its SEL audit of every outcome, mid-send revocation aborting the remaining chunks on both legs, revocation timed inside the mid-send re-resolve await, the awaited mirror's overall bound, and the background dispatch not blocking the POST, the held-note case not reaching the channel at POST and reaching it at flush, and the two earliest Slack refusals — a disconnected thread and a foreign namespaced id — each emitting a denied SEL row under its own reason code, with a third test asserting the two codes differ so the rows stay filterable. The endpoint tests share one draining helper that cancels and gathers the background mirror it dispatched, so no task outlives the test that spawned it; a dedicated test asserts that directly, because a leaked task otherwise only ever showed up as a stderr line while the suite still reported green. Two further tests cover recipient authorization across surfaces: a telegram-origin direct session linked to an authorized Slack channel must reach the tracked-channel authority rather than being refused by a principal check that cannot apply to it, with a Slack-origin counterpart asserting the principal path is still consulted so the surface gate cannot be too broad.

No live channel is required. The Slack leg takes a stub client and the neutral leg drives a fake MessagingTransport through the real send ladder, so the nine transports that are unreachable from many corporate networks are covered by the same assertions as Slack.

Negative controls, run per round by neutralising each fix and observing the failure before restoring it. Latest: removing the post-await re-walk in the mid-send path makes the new test fail assert 2 == 1 — part 2 does reach the revoked conversation — and reverting the mirror to unbounded makes the bound test fail Timeout >25.0s. Both detect their defect rather than passing vacuously.

Local gate results:

Gate Result
flake8 (changed files) clean
black (baselined gate, check_black_formatting) passed
isort (src/kiro_crew test conftest.py xdist_budget.py) clean
mypy (src/kiro_crew/) 1177 source files, no issues
blast radius (141 files) 8753 passed

Affected suites run: test_gateway_appkit_endpoints, test_cross_surface_mirror, test_channel_compaction_notice, test_channel_compact_failure_binding, test_chat_mirror, test_channel_transport_outbound_authz, test_messaging_transport, test_redaction_mirror_parity, test_slack_mirror_context_leak, test_ci_surface_tests.

Echo-loop check

The mirror posts into a thread the gateway also listens on, so inbound must not ingest it as a user turn. Verified at two independent points: slack/transport.py drops bot_id / subtype == "bot_message" before authorization, and slack/events.py does the same with a SEL untrusted_bot denial. Telegram filters on its own bot_id. The compaction notice already uses this exact egress.

Not traced: the from_trusted_bot branch in slack/events.py, which is a separate code path.

Behaviour change beyond /note

Closing the caller-supplied-link TOCTOU moved the ladder walk, the pause skip and the post-await revalidation into handlers/messaging.deliver_to_channel, which is shared. MID-SEND REVALIDATION IS UNCONDITIONAL, and it widens api_send_message's refusal set deliberately. An earlier revision keyed it on authored_link so the inline caller kept its exact prior behaviour; that was wrong, because being inline bounds only the window between the REQUEST and the FIRST part. Every part is an await, so a multi-part inline send spans the same inter-part window a dispatched one does, and its later parts reached a destination the user had already unlinked. The post-resolve re-walk (link_changed_during_resolve) and the per-chunk re-asks therefore run for EVERY caller. What authored_link still gates is only the authored-link COMPARISON — "is the live binding the one this work was AUTHORED for" — which needs a captured link and so remains dispatch-only. For api_send_message this adds seven reason codes, not one: three that can refuse before the first part (a binding or governance ceiling replaced while the permit resolved) and four that fire only on a later part. A send the resolve permitted CAN now be refused before part 1, which the earlier wording denied. deliver_to_channel still answers with a bool and LOGS which ladder row it selected rather than returning it, so its existing caller is unchanged.

That is why test/test_send_message_targeted.py is in this diff: test_cron_job_session_key_is_used_verbatim asserted assert_called_once_with on the link getter, which encoded the old single-read behaviour. It now pins call_args_list so every call is checked for the whole session key — the property that test is actually about — rather than only the first.

Bounds and known asymmetries

The mirror is bounded per leg, not per request. Each delivery leg carries its own _LEG_TIMEOUT_S and absorbs its own stall or raise, so a wedged channel cannot starve a healthy sibling. That bound now lives entirely inside the mirror: the endpoint dispatches it in the background and never waits, so no outer ceiling exists or is needed. A channel that cannot be reached simply does not receive the note; the failure is logged and SEL-audited rather than reported to the caller.

Held-note / rebind window — CLOSED. Two earlier revisions of this description got this wrong in opposite directions: the first claimed "a rebind cannot leave a channel showing a note the agent never receives", the second accepted that it could. Both are withdrawn. A held note is not mirrored at POST, so the window in which the channel held a note the transcript and context did not cannot arise; and it is no longer left unmirrored either, because the flush dispatches it once both halves land. A note whose slot was rebound to another session during the hold is dropped by the rebind guard before the write, and dispatches nothing.

Keying the mirror to the same flush-time condition is the better fix and is what ships. flush_deferred_notes is a synchronous _ChatSlot method with no back-reference to DashboardState, so it cannot resolve destinations itself; the held record carries a bound dispatch instead, which is also why no call site changes spelling. It now has six invocation sites across three modules, one of them a teardown handing its key to a concurrent same-key recreate, where the halves do commit and the key stays open, so provenance there is wanted rather than suppressed.

Accepted and deferred — declared, not carried silently

The hardened Slack send lives in its own module, and the note mirror runs it. The chain (governance gate → recipient authorization → coordinate and pause revalidation after every await → chunking → abort-on-revocation) is _deliver_slack_governed in the new dashboard/slack_egress.py, beside channel_egress_permitted and _slack_recipient_basis. It began inside chat_compaction_notice because that was its first consumer, which homed a cross-feature boundary in a feature-named module — the next caller either misses it or copies it, and a copied egress check stops being re-verified. The note mirror is its ONE consumer. The compaction notice deliberately stays on the bare channel_egress_permitted gate it imports from slack_egress: adopting the full chain there would widen an existing surface's refusal set, which is a behaviour change to a surface this PR does not otherwise need to touch, so it is deferred alongside the three other proactive Slack sends _deliver_slack_governed's docstring names. test_a_recipient_no_authority_names_is_still_delivered pins that unhardened posture, so adopting the chain later has to be a reviewed change rather than a silent rider. Slack is deliberately absent from channel_transports, so it never reaches _resolve_channel_target's ladder and gets none of that protection for free; this is where it lives instead, in one copy rather than two that drift.

The tier map now has a named owner, not a promise. The three proactive-Slack tiers this change leaves in place (the full chain here, the gate-only compaction notice, and plain client for api_send_message's Slack leg, the owner DM and the hook DM) are pinned by a census test that fails if a new dashboard module sends to Slack unclassified, or if the plain-client tier changes size. The deferred sites are enumerated by symbol in docs/system-specs/modules/messaging.md, alongside the tier map the census test pins executably, so the follow-up is a named inventory rather than a docstring sentence. That inventory deliberately stops at the INVENTORY: it names each deferred sibling and the profile-store cold load, and it prescribes no design for the consolidation. Two earlier revisions went further and both were subtracted at a reviewer's request -- a seven-step forward plan (including a binding-generation counter), because a design nobody is committed to build is speculation, and then the separate RFC document that carried it, because the only parts the census test and the spec actually lean on are the tier map and the symbol-named inventory, and those belong with the module they describe. Filing a tracking item is a maintainer action.

The held-note pinning tests are mandatory, not advisory. TestAHeldNoteMirrorsAtFlush and test_a_rebound_slot_drops_the_held_note_without_mirroring both live in test/test_note_channel_mirror.py, which carries zero skip, skipif or xfail markers, and CI's backend job has no deselect list at all (its own comment records that BACKEND_DESELECTS was removed deliberately) and never names this file. Every backend shard therefore collects them and neither can be skipped on a runner.

There are now TWO revalidation chains, and consolidating them is a declared follow-up rather than work this change withholds. deliver_to_channel re-walks the transport ladder per chunk; _deliver_slack_governed re-asks _permitted_to_send per chunk. What is genuinely shareable between them is only the per-chunk loop driver. What is NOT shareable is everything the loop guards: the authority sets differ (Slack sits outside channel_transports and never reaches the ladder at all), the delivery-confirmation predicate differs, and the audit vocabulary differs. handlers/messaging.py does not import slack_egress, so the shared piece could not move between those two; it lives in the module both already import, as send_parts_revalidating in kiro_crew/messaging/renderer.py. That per-chunk loop driver IS extracted here and both chains now run through it. What remains unshared is what the loop guards, which is the list above.

Two consequences worth stating plainly:

  • The compaction notice's failure surface is UNCHANGED. An earlier revision of this branch did adopt the chain there, which would have refused a notice when no authority names the recipient or on a mid-send rebind. That adoption was withdrawn: the notice is governance-vetted and audited exactly as before, and still sends on the link it read. The widened refusal belongs in the change where it is the subject under review.
  • A thread is no longer required by the shared helper. The guard it replaced (_is_genuine_slack_link) demanded a thread and a channel, which is right for a note and wrong for a notice: a session bound to a channel with no thread posts top-level, and requiring a thread would have silently dropped its notices. What that check is actually for is refusing another channel's legacy namespaced id, which has nothing to do with threads — so the namespace half is shared and the thread half stays with the note leg as its own local precondition. Pinned by a test that fails when the thread requirement is reinstated.

The note mirror passes a pause predicate; is_paused is a REQUIRED parameter of the shared send, so no adopter can omit the check by accident. The compaction notice does not call that helper at all, so the question does not arise for it.

api_send_message's failure surface IS widened, and that is intended. The shared deliver_to_channel gained a post-await re-walk and a per-chunk re-ask, and NEITHER is gated: both run for every caller, so the mid-send TOCTOU is closed for api_send_message too rather than left open. The widening is EIGHT new reason codes, six refusals and two errors, none gated on authored_link and so all reachable by the inline caller. Three can refuse before the first part goes out at all (link_changed_during_resolve, link_changed_during_recheck_before_part_1, governance_changed_before_part_1); the other four fire only on a part after the first (not_permitted_mid_send_before_part_N, link_changed_during_recheck_before_part_N, governance_changed_mid_send_before_part_N, and the error resolve_failed_mid_send_before_part_N). An earlier revision of this description claimed one refusal and claimed nothing permitted at part 1 could be refused; the governance-ceiling sampling added later made both false, and they are corrected here rather than left to read as the smaller change. Exactly one refusal stays dispatched-only, and not by choice: link_changed_before_dispatch compares against the binding a caller CAPTURED before its work was queued, so a caller that captured none has no comparand. The note mirror is dispatched to a background task and can be overtaken by a rebind, which is why it captures one. test_revalidation_covers_both_callers_and_authored_link_gates_comparison pins the split by measuring ladder walks on both paths. Named plainly: this is a tightening of a surface this change is not otherwise about. The note mirror is the feature; api_send_message inherits the closure because the helper both callers share is where the TOCTOU lives, and gating it to the mirror alone would leave the same hole open for the LLM-facing caller.

Seven resolve-then-send siblings remain unfixed, named explicitly. The post-await revalidation now covers the shared deliver_to_channel and, via _deliver_slack_governed, the note mirror's Slack leg. These seven sites across five symbols still send on a link captured before their governance await, with no re-walk (api_chat_slot_mirror_link carries three of them):

Site Caller
state.py _notify_inbound_unbind inbound-unbind notify
chat_mirror.py api_chat_slot_mirror_link provisional-link resolve
chat_mirror.py api_chat_slot_mirror_link turn-reply mirror
chat_mirror.py api_chat_slot_mirror_link mirror re-delivery
slack/gateway.py _deliver_channel_reply Slack parent-key reply
handlers/messaging.py _deliver_channel_dm api_send_message's Slack leg

Each was re-verified by SYMBOL at the current tree, not inferred: line citations from the original base had drifted, and one (state.py) pointed at a function that performs no send. Fixing them is a general change across four more modules and belongs in its own PR; naming them here so the gap is not mistaken for coverage, and so whoever takes it has the inventory.

Out of scope

A note's transcript row can be replayed into a new session on a cold start (is_new and not _provider_has_history), so the model may see it twice in one prompt. That is pre-existing, documented in the endpoint's own docstring, and a deliberate tradeoff — the replay is char-budget bounded, so dropping the queued copy would lose older notes the replay had already trimmed. This change adds no transcript row and neither causes nor worsens it.

@rnoack1
rnoack1 requested review from a team and Zedmor August 29, 2026 18:45
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Aug 29, 2026
@dwu96

dwu96 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

1 similar comment
@iamwhatever

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed
  • ## Tests

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 29, 2026
@rnoack1
rnoack1 force-pushed the feat/note-channel-mirror branch from 0bc5b36 to 8df66fa Compare August 29, 2026 19:44
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 5af16aa0c760acaa0a86159e401e551dc960473a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Sound, well-reasoned solution to a real provenance gap — but it bundles a blast-radius-wide governance-primitive change into a note-mirror feature PR.

Watch

The governance profile-store change rides in with the feature: _publish_snapshot becomes the sole generation writer (no bump on a no-op reload) and _ensure_fresh gains a bounded off-loop cold-load barrier. That token and that gate are depended on by every governance_answer_generation consumer and every off-loop governance resolve — dashboard config-cache invalidation included — not just the note mirror. Quoting the diff: "An earlier revision also bumped after _reload returned, which both double-counted every publication and moved the token for that no-op arm." If the new semantics regress, a real profile tightening could stop invalidating the dashboard cache (UI keeps offering a withdrawn entry) or spuriously truncate a multi-part send, and because it is one commit with the mirror, the revert that fixes it also drops the feature. It is fail-closed and never blocks the loop, so this is reversible — hence CONCERNS, not BLOCK — but it is a core-primitive change a human should sign off on independently of the mirror.
Clears when: the generation/cold-load change is reviewed against its own consumers (dashboard cache invalidation + the mid-send re-ask) — ideally as its own commit — with evidence the no-op-reload arm and the concurrent first-touch barrier behave on a slow FS.

[DESIGN-REVIEWED] 5af16aa

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 5af16aa0c760acaa0a86159e401e551dc960473a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5af16aa

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 5af16aa0c760acaa0a86159e401e551dc960473a via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

I have enough to review. Let me confirm the api_send_message call site passes no authored_link (so it takes the newly-hardened inline path).

The base shows _deliver_to_channel has exactly one real caller — api_send_message at messaging.py:2526 — and the diff rewires that call into the hardened deliver_to_channel with per-chunk revalidation. flush_deferred_notes has 6 invocation sites across 3 modules, matching the description's count. Both facts check out.

First-Principles-Verdict: CONCERNS

A note-mirror feat: also re-hardens send_message's only existing egress caller and blocks the PreToolUse governance path on cold load — riders on a core surface the title never names.

Not justified as shipped

  • Item 4 (rides along): deliver_to_channel's new per-chunk re-walk + mid-send governance re-ask now runs for api_send_message — the one pre-existing caller (messaging.py:2526). The send_message tool gains 8 new refusal codes on a change titled about a note's "two send paths."
  • Item 5 (rides along): a per-part capabilities.messaging vet is newly interposed on that same send_message path; a fail-closed gate that did not gate it before.
  • Item 6 (rides along): the governance cold-load barrier adds an off-loop blocking wait in _ensure_fresh, the store behind the synchronous PreToolUse gate — a separable availability-path fix.
  • Item 7 (rides along): generation now counts published snapshots — a separable governance-token correctness fix.

What this change ships

Inventory (10+ items) — 6 justified

Intent: make a /note visible on the channel a session is driven from, not only the dashboard. ADDITION (feat:).

  1. /note visible line mirrored to the session's Slack thread and/or non-Slack channel — justified
  2. Held notes mirror at flush via a mirror callable on the deferred record — justified
  3. New slack_egress._deliver_slack_governed hardened Slack chain (four-authority recipient auth, per-chunk revalidation) — one consumer, generalized (module defers 7+3+2 unhardened siblings)
  4. deliver_to_channel per-chunk mid-send revalidation applied to its sole existing caller send_message — rides along
  5. Per-part capabilities.messaging re-check added to channel/Slack egress incl. send_message — rides along
  6. Governance cold-load barrier (_COLD_LOAD_WAIT_S, off-loop wait) on the authorization path — rides along
  7. Governance generation counts published snapshots (_publish_snapshot) — rides along
  8. send_parts_revalidating shared per-part driver (2 consumers) — justified
  9. OFFERED_ACTIVATIONS extracted, imported by chat_slack (dedup) — justified
  10. New "Background note channel delivery" redaction sink — justified

More than 10: also _note_channel_text end-marker, per-leg _leg_budget timeout, snapshot_channel_link, audit_channel_send/audit_egress.

Watch

  • Items 4–5 change send_message's delivery behavior (new mid-send refusals, a new capabilities.messaging per-part gate) on a PR whose title scopes only the note's two legs; a legitimate multi-part send_message can now abort after a delivered prefix on an unrelated profile edit (mitigated by the re-ask, not eliminated).
    Clears when: the send_message-facing hardening is split into its own change, or a maintainer confirms the widened refusal set on send_message is intended here.
  • Item 6 adds a bounded blocking acquire to _ensure_fresh, reachable from the PreToolUse authorization gate; the barrier is gated not _on_event_loop() so a loop caller never waits, but the premise (which callers are off-loop) is load-bearing on an availability path.
    Clears when: the off-loop-only guarantee is confirmed against the PreToolUse gate's actual call thread.

Subtractions

  • Split items 6–7 (governance cold-load barrier + _publish_snapshot generation refactor) into their own commit: they are a governance-store correctness fix with a named cause independent of note delivery, and bundling them under a feat: note PR hides a change to the authorization path.
  • Defer items 4–5's send_message-facing widening to the change where tightening send_message is the subject; keep this PR's hardening scoped to the two new note legs via authored_link, leaving the inline caller's refusal set unchanged.

[FIRST-PRINCIPLES-REVIEWED] 5af16aa

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 5af16aa0c760acaa0a86159e401e551dc960473a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5af16aa

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Aug 29, 2026
@rnoack1
rnoack1 force-pushed the feat/note-channel-mirror branch from 8df66fa to 3f24eef Compare August 29, 2026 20:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 29, 2026
@rnoack1
rnoack1 force-pushed the feat/note-channel-mirror branch from 3f24eef to 24252c3 Compare August 29, 2026 21:37
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 29, 2026
@rnoack1
rnoack1 force-pushed the feat/note-channel-mirror branch from 24252c3 to 5464c9c Compare August 29, 2026 22:43
@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Item 1 is resolved at head ad7f7a9d1e9dbb2f1a9797520b9dd57ee2a00072 — you were right that the code is two-state, so the Description was the defect and the prose was corrected rather than the code.

The paragraph now describes what ships. It opens "authored_link is TWO-state on the shared helper" and states outright that there is no _UNSET sentinel. The three-state framing and the no_authored_channel_link SEL-audit claim are both gone; the paragraph names unbound_at_authoring, which is the row that actually fires, and it points at where the guard really lives.

Evidence at this head:

  • _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py: 0. Control: 6 authored_link references in that same file, so the search does reach it. The two remaining _UNSET definitions in the tree are unrelated — chat_handlers.py uses one as a maxAge default sentinel.
  • no_authored_channel_link: 0 occurrences across src/, test/ and docs/. Control: unbound_at_authoring is present in 4 files.
  • The guard is at src/kiro_crew/dashboard/chat_note_mirror.py:581 — if authored_link is None:, inside _deliver_via_transport at :551 — returning without delivering. Your :326 citation was against the older head; the function moved, the guard did not.

One more of the same class, found while verifying this and fixed in the same change. The spec and the Description both listed a refusal code governance_changed_during_resolve that the code never emits — 0 occurrences in src/ both at this head and at the merge base, against a control where every other code in that list resolves to a real _audit(...) call. They also omitted two codes that are emitted, resolve_failed_before_part_1 and link_changed_during_recheck_before_part_1 (handlers/messaging.py:1913 and :1931), so the stated count of seven was one short. Both are corrected, and the passage now records that a moved governance token re-asks the permission rather than refusing outright, which is what _still_permitted does at handlers/messaging.py:1977.

Thanks for the precise citation — the pointer to the single consumer is what made the rewrite checkable rather than a guess.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Still resolved at the current head 3115487f7f70f2ca2c59b36df19352acdb4c910c. This supersedes the sha in my previous note, which a rebase onto main moved; the patch content is unchanged across that rebase.

Re-read at this head:

  • The paragraph now opens "authored_link is TWO-state on the shared helper", states outright that there is no _UNSET sentinel, and names where the guard actually lives — chat_note_mirror._deliver_via_transport — which was the part you flagged as absent from the prose. The no_authored_channel_link SEL-audit claim is gone; the paragraph names unbound_at_authoring, the row that is really written.
  • src/kiro_crew/dashboard/handlers/messaging.py: 0 occurrences of _UNSET or _Unset across 7132 lines, against 6 authored_link references in the same file as a control, so the zero is about the code rather than about the search.
  • no_authored_channel_link: 0 occurrences across src, test and docs. Control: unbound_at_authoring is present in 4 files.
  • The guard is at src/kiro_crew/dashboard/chat_note_mirror.py:581 — if authored_link is None:, inside _deliver_via_transport at :551 — returning without delivering. Your :326 citation was against the older head; that line now sits inside an argument list.

No code changed this round. The only reason for this note is that the head sha moved, so the evidence in my earlier reply pointed at a commit that is no longer current.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

All items are satisfied at head 822f8f9bd39d1d2ca34bc6e766159e83c16fe2ae. Re-read at this head rather than carried over, since it has moved three times since you wrote the review.

Taking your points as separate items:

The _UNSET / _Unset sentinel — src/kiro_crew/dashboard/handlers/messaging.py contains 0 occurrences of either, across 7132 lines, against 6 authored_link references in the same file as a control so the zero is about the code rather than the search.

The isinstance(..., _Unset) gate — 0 occurrences of _Unset) in that file, against 134 isinstance occurrences as a control. Your three coordinates have all shifted: :1471 and :1521 are now bare ), and :1624 is ) -> None:.

The no_authored_channel_link SEL row — 0 occurrences across src, test and docs. Control: unbound_at_authoring is present in 4 files.

"The guard logs rather than writing an SEL row" — this is the one item where the code moved rather than the prose, and it moved the way you wanted. The guard is at src/kiro_crew/dashboard/chat_note_mirror.py:581, inside _deliver_via_transport at :551, and it does write a row: audit_channel_send(...) at :594 with reason="unbound_at_authoring" at :599, and the log line at :601 follows it rather than replacing it. Two branches above it stay deliberately silent and say why — no channel transports at all (:584), and a Slack-only binding already served by the sibling leg (:588). So the refusal is filterable in the audit trail; only the reason code differs from the name the old prose used. Your :326 citation now reads session_key,.

The three-state claim in the description — gone: 0 occurrences of "three states" or "THREE states", and the paragraph now reads "authored_link is TWO-state on the shared helper" with "There is no _UNSET sentinel" stated outright.

"Nothing in the prose says where the guard actually lives" — this was the part with the longest reach, and it is now explicit: the paragraph names chat_note_mirror._deliver_via_transport, quotes its if authored_link is None: guard, and describes the row it files as unbound_at_authoring.

I did not re-add the no_authored_channel_link row, on your own caution that doing so re-adds part of what the subtraction removed.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

All three claims in your review are satisfied at head 3f4d6ff6849137b1e83e519729bd6ea1789b9d2e. Re-read at that head, each absence paired with a positive control so a zero is not just a bad query:

The _UNSET sentinel does not exist — you were right, and the description was wrong. _Unset matches 0 files across src/, test/ and docs/, against a control of authored_link in 5. The description was corrected several heads ago and now states plainly that there is no such sentinel.

The no_authored_channel_link SEL row does not exist either. 0 files, against a control of unbound_at_authoring in 4. That is the reason name the code actually emits.

The shipped shape is two-state, as you read it. dashboard/handlers/messaging.py:1562 documents "authored_link has TWO states"; the parameter is declared tuple[ChannelLink, bool] | None = None and guarded with is not None. The unbound case is refused at dashboard/chat_note_mirror.py:578 (if authored_link is None:).

One correction to the review, on the part that has moved: that refusal is not log-only. dashboard/chat_note_mirror.py:596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), and the log line follows it rather than standing in for it. Two sibling branches above stay deliberately silent and say why in place: no channel transports at all (nothing per-session to record), and a Slack-only binding already served by the other leg.

Separately, on the overlap you raised with the other change to the same held-note pipeline: that is an ordering question between the two, not something a commit here can settle, so it stays yours to call.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

All three claims in your review remain satisfied at head 072b6e77de0b1458303d7ea574814a226637d23c. Re-read at this head rather than carried over from my earlier note, and each absence is paired with a positive control so a zero says something about the code and not merely about my query.

The _UNSET sentinel does not exist. _UNSET and _Unset are each 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py, against a control of 6 authored_link references in that same file — and a tree-wide control finds _UNSET in 8 other files, so the query does locate the token where it genuinely exists.

The no_authored_channel_link SEL row does not exist. 0 files across src/, test/ and docs/, against a control of unbound_at_authoring in 4. That is the reason code the shipped path actually emits.

The shape is two-state, as you read it. src/kiro_crew/dashboard/handlers/messaging.py:1562 states "authored_link has TWO states"; it is declared authored_link: tuple[ChannelLink, bool] | None = None at :1665 and guarded with if authored_link is not None: at :1795. The unbound case is refused caller-side at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport (function at :548).

A correction to my previous note, which gave two line numbers wrongly. It cited the guard at :569 and the function at :539. The correct coordinates at this head are :578 and :548, as listed above; the earlier pair was carried from a summary rather than read at source, and I should not have stated it as read. The substance is unchanged — the guard and the function are exactly where the review said they conceptually are, and the numbers above are what the file shows.

One part of the review has moved since it was written. The refusal is not log-only: src/kiro_crew/dashboard/chat_note_mirror.py:595-596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), and the log line follows it rather than standing in for it. Two sibling branches above stay deliberately silent and say why in place — an install with no channel transports at all, where a row would fire for every note while naming no destination, and a Slack-only binding already served by the other leg.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Still settled at head 3b2cc50a736208bec15eb7439accbd1ec32ebec5. The head moved since my last note (an unrelated fix to the note endpoint's broadcast ordering), so I re-read rather than carrying the result forward. Both sides of your item hold, and each absence below is paired with a positive control so a zero is a statement about the code and not about my query.

Code — your reading is correct, and unchanged at this sha. _UNSET and _Unset are each 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py, against a control of 6 authored_link references in that file and _UNSET appearing in 8 other files tree-wide. no_authored_channel_link is 0 files across src/, test/ and docs/, against a control of unbound_at_authoring in 4. The shape is two-state: messaging.py:1562 states "authored_link has TWO states" and :1665 declares tuple[ChannelLink, bool] | None. The refusal is caller-side at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport at :548.

Prose — the paragraph you quoted is no longer in the description. Measured against the live body: THREE states 0, three states 0, no_authored_channel_link 0. The replacement says TWO-state and, in your words rather than around them, "There is no _UNSET sentinel"; it names chat_note_mirror._deliver_via_transport and quotes the if authored_link is None guard. The one surviving _UNSET mention is that denial itself, and the one SEL-audited mention is about an unreachable channel rather than this refusal.

The one part of your review that has moved: the refusal is not log-only any more. chat_note_mirror.py:595-596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), with the log line after it rather than instead of it. So the filterable row a reader would look for does exist — under the reason code the code actually emits, not the one the old paragraph named. Two sibling branches stay deliberately silent and say why in place: an install with no channel transports at all, and a Slack-only binding already served by the other leg.

Nothing here needs a further change; if you see something at this sha that I have measured wrongly, name the file and line and I will read it there.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at head b11854dcbc3dcdc964cbab8f745e6325867020a7. The head has moved twice since my last note (two fixes to the note endpoint's acceptance ordering), so I read this again rather than carrying the result forward. Each absence is paired with a positive control, so a zero is a statement about the code and not about my query.

Claim 1 — the _UNSET sentinel does not exist. _UNSET and _Unset together: 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py, against a control of 6 authored_link references in that same file.

Claim 2 — the no_authored_channel_link SEL row does not exist. 0 files across src/, test/ and docs/, against a control of unbound_at_authoring in 4 files.

Claim 3 — the shape is two-state, not three. src/kiro_crew/dashboard/handlers/messaging.py:1562 reads "authored_link has TWO states". The unbound case is refused caller-side at src/kiro_crew/dashboard/chat_note_mirror.py:578 (if authored_link is None:), inside _deliver_via_transport at :548 — the placement your review asked for.

Required change — the description now matches. The paragraph you quoted is gone: THREE states and three states are each 0 in the body, and the replacement states in as many words that there is no _UNSET sentinel, describes authored_link as two-state, names chat_note_mirror._deliver_via_transport, and quotes the if authored_link is None guard.

One thing in your review has been overtaken by later work, and it is the part worth re-reading. The refusal is no longer log-only: chat_note_mirror.py:595-596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), with the log line after it rather than in place of it. So the filterable row a reader would go looking for does exist — under the reason code the code emits rather than the one the old paragraph named. Two sibling branches stay deliberately silent and say why in place: an install with no channel transports at all, and a Slack-only binding already served by the other leg.

If anything above is measured wrongly, name the file and line and I will read it there.

@rnoack1

rnoack1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Verified at head 0cf740689f14a6fdefc8e09377caed79bb9507a0. Your required change has already landed, so there is nothing left to rewrite — here is the evidence, re-read at this sha rather than carried forward from an earlier note, with a positive control behind every zero so an absence is a statement about the code and not about my query.

Your reading of the code was correct, and it still holds.

  • _UNSET and _Unset: 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py, against a control of 6 authored_link references in that same file.
  • The isinstance(..., _Unset) gate you looked for on the revalidation path: 0, against a control of 127 isinstance calls in that file — so the query does find isinstance there; the gate simply is not one of them.
  • A SEL row named no_authored_channel_link: 0 files across src/, test/ and docs/, against a control of unbound_at_authoring present in 4.
  • Two-state, as you said: handlers/messaging.py:1562 reads "authored_link has TWO states".
  • The guard is at the single consumer you identified. It has moved as the file grew — it is now src/kiro_crew/dashboard/chat_note_mirror.py:578 (if authored_link is None:), inside _deliver_via_transport at :548. Your review cited :326, which was correct against the sha you reviewed.

The description paragraph now describes that. Measured against the live body: THREE states 0 and three states 0 — the claim is gone. The paragraph still opens "An absent snapshot is no longer a licence to deliver", but it now says authored_link is TWO-state, states in as many words that there is no _UNSET sentinel, names chat_note_mirror._deliver_via_transport as the one consumer, and quotes its if authored_link is None guard. no_authored_channel_link appears 0 times. The one surviving _UNSET mention is the denial itself.

On the audit row, since your required change left it open as a choice. It was emitted rather than dropped, but under the reason code the code actually uses: chat_note_mirror.py:595-596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), with the log line following it rather than standing in for it. So the filterable row a reader would go looking for does exist. Two sibling branches stay deliberately silent and say why in place — an install with no channel transports at all, where a row would fire for every note while naming no destination, and a Slack-only binding already served by the other leg.

If any measurement above is wrong, name the file and line and I will read it there.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Still settled at head 62a78cf69ced92deaa58a6beac80aa2bec7e66fd, re-read at this sha rather than carried over. This supersedes my earlier notes on the item; I am keeping it short rather than restating the full derivation again.

Your reading of the code was right on all three counts, and it holds here. _UNSET and _Unset: 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py, against a control of 6 authored_link references in that same file. A SEL row named no_authored_channel_link: 0 files across src/, test/ and docs/, against a control of unbound_at_authoring in 4. Two-state, as you said: handlers/messaging.py:1562 reads "authored_link has TWO states", and the refusal is the caller-side guard at src/kiro_crew/dashboard/chat_note_mirror.py:578 (if authored_link is None:), inside _deliver_via_transport at :548. Your review cited :326, which was correct against the sha you reviewed; the file has grown since.

The description no longer carries the claims you flagged: THREE states, three states and no_authored_channel_link are each 0 in the live body, and the paragraph now describes the two-state shape and names that guard.

On the audit row your required change left as a choice: it was emitted rather than dropped, under the reason code the code actually uses — chat_note_mirror.py:595-596 files audit_channel_send(..., outcome="denied", reason="unbound_at_authoring"), with the log line following it rather than standing in for it.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Verified at head 2c35fa07186593c1204e31630b9983b901e55dc0. All four parts of your objection are settled here, including the audit row — which is the part that changed rather than merely being reworded, so it is worth reading even if the rest looks familiar. Every absence below is paired with a control token I know is present, so a zero says something about the code and not about my search.

1 — the _UNSET sentinel is absent from src/kiro_crew/dashboard/handlers/messaging.py. _UNSET and _Unset together: 0 occurrences. There is no isinstance(..., _Unset) gate on the revalidation path either: 0. Controls in that same file — authored_link 6, isinstance 130 — so the query does find isinstance there; the gate simply is not among them.

2 — no_authored_channel_link is absent from src/, test/ and docs/. 0 files, against a control of unbound_at_authoring present in 4.

3 — the guard is where you said, caller-side on a plain None. src/kiro_crew/dashboard/chat_note_mirror.py:578 reads if authored_link is None: and returns without delivering. Your review cited :326, correct against the sha you reviewed; the file has grown since.

4 — the refusal now WRITES the audit row, so it is no longer log-only. This is the substantive change since your review. chat_note_mirror.py:591-597 calls audit_channel_send(session_key=…, tool_name=…, channel_type=None, outcome="denied", reason="unbound_at_authoring"), and the log line at :598 follows it rather than standing in for it. The emitter is module-level — defined at src/kiro_crew/dashboard/handlers/messaging.py:1629 and imported at the call site — because a second site refuses on this leg and a hand-written second copy is how a denial stream comes to look complete with one branch missing. Two tests pin the row rather than the intent: test/test_note_channel_mirror.py:2233 and :3374 both assert reason=unbound_at_authoring appears in exactly one denial row for an unbound slot on an install that has channel transports, and both pass at this head.

The two silent branches are deliberate and say so in place: an install with no channel transports at all (:581-582), where a row would fire for every note on every session while naming no destination; and a Slack-only binding already served by the sibling leg (:585-586).

So the second half of your required change is the one that was taken — the audit row is emitted and the claim kept — and the description describes that rather than the _UNSET mechanism it used to.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — verified at head 06ad975c34716c39e4572db32f9d9c497a0195ab. You were right, and the paragraph has since been rewritten to match the code. Recording the evidence so this is checkable rather than asserted.

The description now describes what ships. The "An absent snapshot is no longer a licence to deliver" paragraph reads two-state, states explicitly that there is no _UNSET sentinel, and names the guard's real location. Both claims you flagged are gone: the body has zero occurrences of no_authored_channel_link, and its single mention of _UNSET is the sentence saying there isn't one.

What the code does, with coordinates:

  • deliver_to_channel(authored_link=...) is two-state — authored_link: tuple[ChannelLink, bool] | None = None at src/kiro_crew/dashboard/handlers/messaging.py:1677, consumed behind if authored_link is not None: at :1807. The two-state contract is documented at :1574.
  • The captured-None case is refused at its one producer's consumer: if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport (:548).
  • That refusal does file an audit row — outcome="denied" with reason="unbound_at_authoring" at chat_note_mirror.py:595-596, through a module-level emitter. So the audit trail exists; what never existed is the row under the name the old prose gave it.

Absence, positive-controlled (a zero is otherwise a claim about the grep): _UNSET/_Unset is 0 in handlers/messaging.py, where the same search finds authored_link 6 times and isinstance 130 times — so the query reaches the file and the sentinel is genuinely absent. no_authored_channel_link is 0 across src/, test/ and docs/, where the control unbound_at_authoring matches in 7 files.

One coordinate correction for anyone following your review: you cite the guard at chat_note_mirror.py:326; it is at :578 at this head. The substance was right, the line had moved.

Your read of the cause was also right — the First Principles subtraction was adopted in the code and the prose lagged it. Thanks for catching it; a reader told a security-boundary refusal is filterable in the audit log under a name that is never written is worse off than one told nothing.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — your three measurements were right, and the paragraph has been rewritten to match. Re-verified at head d72b45b47b1032c976d770fd0f78e838dfb51c1f.

The paragraph now reads:

authored_link is TWO-state on the shared helper: omitted (an inline caller, which has no authored binding to compare against, which therefore skips only the authored comparison, not the continuation re-ask) or a captured link (compare and refuse on a mismatch). There is no _UNSET sentinel — the third case, a slot with NO binding when the work was authored, is refused at the ONE site that can produce it, chat_note_mirror._deliver_via_transport, whose if authored_link is None: guard returns without delivering.

So the _UNSET claim and the no_authored_channel_link SEL-audit claim are both gone, and the guard is named at its single consumer, as you asked. I took the description route rather than adding the audit row back, for the reason you gave: emitting it would re-add part of what the First Principles subtraction removed.

Verified at this head, with positive controls (a zero is otherwise a claim about the grep rather than about the code):

  • _UNSET / _Unset: 0 occurrences in src/kiro_crew/dashboard/handlers/messaging.py — same file, same search: authored_link 6, isinstance 130. No module-level sentinel and no isinstance(..., _Unset) gate on the revalidation path.
  • The guard: if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport.
  • no_authored_channel_link: 0 across src/, test/ and docs/, against a control of unbound_at_authoring matching 3 files. The refusal does file a denied audit_channel_send row under unbound_at_authoring (chat_note_mirror.py:595-596) — so an audit trail exists; what never existed is a row under the name the old prose gave it.

One coordinate has drifted since you wrote: you cite the guard at chat_note_mirror.py:326, and it is at :578 at this head. Your reading was right; the line moved.

Your diagnosis of the cause was right too — the subtraction was adopted in the code and the prose lagged it. Thanks for catching it. A reader told a security-boundary refusal is filterable in the audit log under a name that is never written is worse off than one told nothing at all.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — re-verified at head 9f542d089554ae0c9fce03130ad12047d8c4ef63. This supersedes my two earlier replies, which named older shas; the evidence below is read at the current head, so there is nothing stale to re-check.

Every claim in your review was accurate about the code when you wrote it. The defect was entirely in the prose, and the prose now matches. Item by item:

1. No module-level _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py — 0 occurrences. Positive control, same file and same search: authored_link 6, isinstance 130, so the query reaches the file and the absence is real.

2. No isinstance(..., _Unset) gate on the revalidation path — 0 occurrences, same control as above. authored_link is two-state at the signature: authored_link: tuple[ChannelLink, bool] | None = None (messaging.py:1677).

3. The refusal is a caller-side guard on a plain None — if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport. Your coordinate :326 has drifted; the line moved, the substance did not.

4. No SEL row named no_authored_channel_link — 0 across src/, test/ and docs/, against a control of unbound_at_authoring matching 3 files. What does ship is a denied audit_channel_send row under reason="unbound_at_authoring" (chat_note_mirror.py:596). So the refusal is auditable; what never existed is a row under the name the old prose gave it.

The description now describes exactly that. The paragraph states authored_link is TWO-state, says in as many words "There is no _UNSET sentinel", names the guard at its single consumer chat_note_mirror._deliver_via_transport, and carries 0 mentions of no_authored_channel_link. Its one remaining _UNSET occurrence is that negative sentence.

I took the description route, not the audit-row route, for the reason you gave: emitting that row would re-add part of what the First Principles subtraction removed.

Your diagnosis of the cause was right — the subtraction landed in the code and the prose lagged behind it. Thanks for catching it; being told a security-boundary refusal is filterable in the audit log under a name that is never written is worse than being told nothing.

@rnoack1

rnoack1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — verified at head ca18ed40db95a49e091f6f5f9ba8008d106e3aee. Your review was right about the tree you read, the Required change has been carried out, and one clause has since changed in your favour. Evidence for each claim, so this is checkable rather than asserted.

Already correct at this head — the description. The "An absent snapshot is no longer a licence to deliver" paragraph now describes a two-state authored_link on the shared helper and names the guard at its one consumer. Counts on the live body: no_authored_channel_link 0, "THREE states" 0, _UNSET 1 — and that one occurrence is the sentence stating there is no such sentinel. All four required headings intact.

Your four code claims, each with a positive control (a zero is otherwise a fact about the grep, not about the code):

  1. No module-level _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py — 0 occurrences. Same file, same search: authored_link 6, isinstance 130.
  2. No isinstance(..., _Unset) gate on the revalidation path — 0 occurrences, same control. The signature is two-state: authored_link: tuple[ChannelLink, bool] | None = None at messaging.py:1677.
  3. No SEL row named no_authored_channel_link — 0 across src/, test/ and docs/, against a control of unbound_at_authoring matching 3 files.
  4. The refusal is a caller-side guard on a plain None — if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport. Your coordinate :326 has drifted; the line moved, the substance did not.

One clause is now out of date, and it matters to your Risk paragraph. You wrote that the guard "logs rather than writing an SEL row", and that a reader would look for a filterable row that is never written. A row is written: outcome="denied" with reason="unbound_at_authoring" at chat_note_mirror.py:595-596, through the module-level audit_channel_send (messaging.py:1629). So the refusal is filterable in the audit log — just not under the name the old prose gave it, which is why the prose changed rather than the code.

That row also had a real gap you could not have seen from the tree you read: on the immediate /note path the dispatch was gated such that an unbound slot never reached the guard, so no row was filed on an install that does have channel transports. That is fixed at this head, and pinned by a test that fails without it. Three outcomes are now distinct: no transports at all stays silent, a Slack-only binding is served on the sibling leg, and transports plus an unbound slot files the denial.

I took the description route rather than adding the no_authored_channel_link row back, for the reason you gave: re-adding it would restore part of what the First Principles subtraction removed.

Your diagnosis of the cause was right — the subtraction landed in the code and the prose lagged it. Thanks for catching it.

@rnoack1

rnoack1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — re-anchoring my earlier reply to the current head, 4a2244e2cdae5629d83da5b4d4b9e3ba1ceaf621, since the sha has moved twice since I last cited one. Nothing has changed in substance; the coordinates below are re-read at this head, each with a positive control so a zero is evidence rather than an artifact of the grep.

  • authored_link is two-state: authored_link: tuple[ChannelLink, bool] | None = None — src/kiro_crew/dashboard/handlers/messaging.py:1677.
  • No _UNSET / _Unset at module level, and no isinstance(..., _Unset) gate: 0 occurrences in that file, against controls of authored_link 6 and isinstance 130 in the same file.
  • No SEL row named no_authored_channel_link: 0 across src/, test/ and docs/, against a control of unbound_at_authoring matching 3 files.
  • The refusal is the caller-side guard you identified: if authored_link is None: — src/kiro_crew/dashboard/chat_note_mirror.py:578. Your :326 has drifted as the file grew; the substance is unchanged.

Your required change is in the description: the paragraph now states authored_link is TWO-state on the shared helper, says explicitly that there is no _UNSET sentinel, and names chat_note_mirror._deliver_via_transport and its None guard as where the third case is refused. The no_authored_channel_link claim is gone.

One clause of your Risk paragraph no longer applies, and it is the part that mattered: you wrote that the guard logs rather than writing an SEL row, so a reader would hunt a filterable row that is never written. A row is written — reason="unbound_at_authoring" at chat_note_mirror.py:596, via the module-level audit_channel_send. So the refusal is filterable, under a different name than the old prose gave it. Your forward-looking point is also addressed in the same paragraph, which now ends by saying a future producer passing authored_link must carry its own guard because the shared helper does not provide one.

Your diagnosis was right: the subtraction landed in the code and the prose lagged it. This is the same disposition I gave at ca18ed40db, restated against the current head so it does not read as answering a sha that has since moved.

@rnoack1

rnoack1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@bolichen97 — re-anchored to the rebased head, c9624cc7838504428c61e2bcb8eba0761d6d2f72. The branch was rebased onto current main, so every coordinate below is re-read at that head rather than carried over; two of them moved as main advanced. Each absence carries a positive control, so a zero is evidence rather than a property of the grep.

  • authored_link is two-state: authored_link: tuple[ChannelLink, bool] | None = None — src/kiro_crew/dashboard/handlers/messaging.py:1848 (was :1677 before the rebase).
  • No _UNSET / _Unset at module level, and no isinstance(..., _Unset) gate: 0 occurrences in that file, against controls of authored_link 6 and isinstance 131 in the same file.
  • No SEL row named no_authored_channel_link: 0 across src/, test/ and docs/, against a control of unbound_at_authoring matching 3 files.
  • The refusal is the caller-side guard you identified: if authored_link is None: — src/kiro_crew/dashboard/chat_note_mirror.py:578.

Your required change is in the description: the paragraph states authored_link is TWO-state on the shared helper, says explicitly there is no _UNSET sentinel, and names chat_note_mirror._deliver_via_transport and its None guard as where the third case is refused. The no_authored_channel_link claim is gone.

One clause of your Risk paragraph no longer holds, and it is the operative one: you wrote that the guard logs rather than writing an SEL row, so a reader would hunt a filterable row that is never written. A row is written — reason="unbound_at_authoring" at src/kiro_crew/dashboard/chat_note_mirror.py:596, via the module-level audit_channel_send. The refusal is filterable, under a different name than the old prose gave it. Your forward-looking point is addressed in the same paragraph, which ends by saying a future producer passing authored_link must carry its own guard because the shared helper does not provide one.

Your diagnosis was right: the subtraction landed in the code and the prose lagged it. Nothing in the rebase changed any of this — it is restated here only so the evidence names the head that now exists.

@rnoack1

rnoack1 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed at 78cd06728cda8cdc38aa5eade6926dd5f7c938ca. Your required change, point by point, with what I read at that head:

Two-state on the shared helper. src/kiro_crew/dashboard/handlers/messaging.py:1729 documents authored_link as having TWO states, and the revalidation path gates on a plain None — messaging.py:1962 is if authored_link is not None:.

No _UNSET / _Unset sentinel. Zero occurrences in messaging.py. The only _UNSET-prefixed match anywhere in that directory is an unrelated _UNSETTLED_MERGE_STATE in source_providers.py. I ran that against a positive control so the zero means something: authored_link itself matches in the same file at 1729, 1747, 1832, 1923 and 1962, so the search was reading the file.

The guard at the one consumer. src/kiro_crew/dashboard/chat_note_mirror.py:548 is async def _deliver_via_transport, and its guard sits at :578 — if authored_link is None: — returning without delivering. The line moved since you wrote the review: you cited :326, it is :578 now.

no_authored_channel_link. Dropped from the prose, and not emitted anywhere — zero occurrences in the tree.

The audit row. This took the second option you offered rather than deleting the claim: the row is emitted, reusing the existing module-level emitter instead of reinstating the bespoke SEL row the subtraction removed. chat_note_mirror.py:591-597 calls audit_channel_send(...) with outcome="denied" and reason="unbound_at_authoring", and the description now claims exactly that reason code. Two cases stay deliberately silent and are named in the prose: an install with no channel transports at all (:581) and a Slack-only binding, which is delivered on the sibling leg (:585).

That last item is a fresh prose claim of exactly the kind you caught last time, so I did not verify it by reading it. I deleted the audit_channel_send call and re-ran the suite: four tests fail naming the missing row, including test_an_unbound_immediate_note_still_files_its_denial and the repeat-occurrence test asserting that three unbound notes file three rows. Emit restored, suite green.

No code changed for this — every item was already satisfied at the head above, so there is no new commit.

@rnoack1

rnoack1 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Still holds at 20c62fc7e14812f421e709d75a818ed66946f7fe. Re-verified rather than assumed: three commits have landed since my note above, and one of them edited messaging.py, which is the file this objection cites.

  • _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py: none. messaging.py:1729 still documents authored_link as TWO states, and :1962 gates on a plain if authored_link is not None:. Positive control: authored_link matches at 1729, 1747, 1832, 1923, 1962 and 1963, so the search was reading the file.
  • no_authored_channel_link: not emitted anywhere in the tree. Control: unbound_at_authoring matches at chat_note_mirror.py:596 plus three test assertions.
  • The guard is if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:578, inside _deliver_via_transport at :548.
  • Description: zero occurrences of THREE states and of no_authored_channel_link; the paragraph reads "is TWO-state".

No code or description change was needed this round.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Still satisfied at 12aee2440636907f7b247f55cda7ac5fb77d615b. I am naming this sha rather than the one I checked first: the branch was rebased onto current main and then amended since, and state.py and chat_handlers.py were both edited in that window, so the earlier confirmation was worth re-establishing rather than assumed.

Description, the paragraph your required change named:

  • "THREE states" — 0 occurrences.
  • no_authored_channel_link — 0 occurrences.
  • The paragraph now reads that authored_link is TWO-state, says explicitly "There is no _UNSET sentinel", and names the real guard.

Code, at that sha:

  • _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py — none. messaging.py documents the two-state contract on the shared helper, and the revalidation path gates on a plain if authored_link is not None:.
  • no_authored_channel_link — not emitted anywhere in the tree.
  • The guard is if authored_link is None: in _deliver_via_transport in src/kiro_crew/dashboard/chat_note_mirror.py, returning without delivering. The refusal files a denied audit_channel_send row under the reason unbound_at_authoring, which I verified by deleting the emit and watching four tests fail rather than by reading it.

Each zero above was run against a positive control so it means absence rather than a bad query: authored_link matches in messaging.py, and unbound_at_authoring matches in chat_note_mirror.py plus three test assertions.

No code or description change was needed for this.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Two items, both verified at 831ad4cb565610a775f15851100db4b4c4568b22.

The record-shape paragraph is fixed in code. You were right that "carries exactly id, content, cls, context, session and mirror" is wrong in either merge order, since the list is shared. The api_chat_slot_note docstring now describes those six fields as this endpoint's own record and states explicitly that it is not an exhaustive shape for the list.

I also re-checked your crash-risk note at this head rather than at the sha you audited, since the head has moved a good deal since: src/kiro_crew/dashboard/slot_buffers.py:804 reads note.get("mirror"), typed Callable[[], None] | None, so an entry appended without that key gets no dispatch. There is now a test pinning that, and inverting the line to a subscript fails it with KeyError: 'mirror'.

The two remaining parts of your suggestion are not reachable from this side, so they need the ordering decision you proposed: there is no markers_only parameter here to skip on, and the capacity refusal appears to be added by both changes.

The description/code mismatch is settled. The paragraph now reads that authored_link is TWO-state on the shared helper and says "There is no _UNSET sentinel", and it names the real guard. Checked at this head:

  • _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py — none.
  • no_authored_channel_link anywhere in src/ — not emitted.
  • The refusal is if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:586, returning without delivering and filing a denied audit_channel_send row under unbound_at_authoring. Note the line moved from the :326 you cited.

Each zero above was run against a positive control so it means absence rather than a bad query: authored_link matches 6 times in messaging.py, and unbound_at_authoring matches in chat_note_mirror.py.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at 57ba40bce87062faf7093183c33c5d9fcc2d320e. Both of your items still hold; nothing needed changing for them this round.

The description/code mismatch. The paragraph states authored_link is TWO-state on the shared helper and says outright "There is no _UNSET sentinel", and it names the guard rather than an audit row that does not exist. At this head:

  • _UNSET / _Unset in src/kiro_crew/dashboard/handlers/messaging.py — 0.
  • no_authored_channel_link anywhere under src/ — 0.
  • The refusal is if authored_link is None: at src/kiro_crew/dashboard/chat_note_mirror.py:586, which returns without delivering and files a denied audit_channel_send row under unbound_at_authoring. Your comment cited :326; the line has moved.

The shared-list record shape. src/kiro_crew/dashboard/slot_buffers.py:794 still reads note.get("mirror"), typed Callable[[], None] | None, so an entry appended without that key gets no dispatch instead of raising. A test pins it, and inverting the read to a subscript fails that test with KeyError.

Each zero above was paired with a positive control so it is a statement about the code rather than about the query: authored_link matches 6 times in messaging.py, and unbound_at_authoring matches in chat_note_mirror.py.

The remaining parts of your ordering suggestion are still not reachable from this side: there is no markers_only parameter here to skip on, and the capacity refusal appears to be added by both changes.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Both items in the description/code mismatch are verified at head 2c6886cd459b3ee35282cbdd0ca9d5caecf9cf96.

1. The _UNSET sentinel — absent from the code, and the prose now says so.

  • _UNSET on the note-mirror and messaging path (chat_note_mirror.py, handlers/messaging.py, slack_egress.py): 0.
  • _UNSET within ±3 lines of any authored_link anywhere in src/: 0.
  • Lines this branch's diff against base adds or removes containing _UNSET: 0. There are 38 occurrences in src/, all pre-existing generic sentinels across 9 unrelated modules — the same 38 at base, so none is introduced here and none is the authored_link sentinel.
  • src/kiro_crew/dashboard/chat_note_mirror.py:640-641 reads: # ...the shared helper stays two-state and needs no sentinel to tell "absent" from "captured None". directly above if authored_link is None:.
  • The description paragraph you quoted now reads: "authored_link is TWO-state on the shared helper... There is no _UNSET sentinel — the third case, a slot with NO binding when the work was authored, is refused at the ONE site that can produce it." Occurrences of "THREE states" in the current body: 0.

2. The no_authored_channel_link SEL row — absent from both surfaces.

  • no_authored_channel_link in src/: 0. In the description: 0.
  • The row the guard actually emits is src/kiro_crew/dashboard/chat_note_mirror.py:654-660: audit_channel_send(session_key=..., tool_name=EGRESS_TOOL_NAME, channel_type=None, outcome="denied", reason="unbound_at_authoring"). The description names that same unbound_at_authoring string, once.

Positive controls for the zero counts above, same greps over the same paths: in src/, authored_link 9, unbound_at_authoring 2, vet_and_audit 55; in the description body, authored_link 4 and "is TWO-state" 1.

The single _UNSET occurrence remaining in the description is inside the sentence that denies it exists.

A note's context half already reaches the model on any surface, but its visible half broadcast only to the dashboard — so a channel-driven session gained the context with no visible provenance where its user was actually reading.

Delivers through the two existing outbound paths and reports `mirroredTo` so a caller can tell delivery from silence, with the Slack leg gated on recipient authorization re-asked after every await and the shared ladder revalidating its binding before it sends.
@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Verified at head 5af16aa0c760acaa0a86159e401e551dc960473a: finding 1 reads as already resolved rather than outstanding. Recording the evidence rather than re-fixing it.

The "An absent snapshot is no longer a licence to deliver" paragraph was rewritten and now describes what ships:

  • Two-state, not three. The paragraph states authored_link is TWO-state on the shared helper and says explicitly "There is no _UNSET sentinel". _UNSET has 0 occurrences in both src/kiro_crew/dashboard/handlers/messaging.py and src/kiro_crew/dashboard/chat_note_mirror.py. The code comment at messaging.py:1730 also documents it as TWO states.
  • The guard is named and located. The paragraph points at the single consumer, chat_note_mirror._deliver_via_transport, and its if authored_link is None: guard — now at chat_note_mirror.py:641. Your comment cited :326; the line moved with later pushes.
  • The no_authored_channel_link claim is gone. 0 occurrences anywhere in the tree.
  • The audit row took the second option you offered. Rather than dropping the audit claim, the refusal now emits a row: chat_note_mirror.py:659 passes reason="unbound_at_authoring" through audit_channel_send (messaging.py:1785). The two silent exemptions the prose describes — no channel transports at all, and a Slack-only binding delivered on the sibling leg — are the arms immediately above that call.

That addresses the risk you named. A reader told the refusal is SEL-audited will now find a filterable row; it is written under unbound_at_authoring, and the prose names that code rather than the removed one.

No code or description change was made in response to this comment — both had already landed in earlier pushes. Raising it because the requested-changes review is currently the only blocking item on this PR, so if you agree it is settled, the PR needs your re-review rather than another revision.

@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:

  • Size and shape put it outside what I'll drive unattended. The diff is ~8,700 changed lines and introduces two new production modules — dashboard/slack_egress.py (855 lines) and dashboard/chat_note_mirror.py (693 lines) — wired into platform/governance_profiles.py and security_posture.py. That is a new subsystem, and the pipeline's own rule is not to take one this large: there is too much surface for me to reason about safely on your behalf.
  • The one open review finding is an authorization-semantics call, not a mechanical fix. @bolichen97's CHANGES_REQUESTED is about whether authored_link is two-state or three-state and whether a captured None — a slot with no binding when the work was authored — may deliver. You replied on 2026-09-13 that the Description was rewritten to describe the shipped two-state form with the refusal implemented caller-side at chat_note_mirror.py:326. That reads as resolved to me, but the review is still formally blocking and only @bolichen97 can clear it. Please ask them to re-review.
  • The branch is 670 commits behind main. Textually the rebase is nearly free — one conflict, an import block in chat_compaction_notice.py where main added PlatformCompositionError, vet_and_audit and the COMPACT_OUTCOME_* names, resolved by taking main's side. But a clean textual merge does not prove this subsystem's seams into messaging/renderer.py, the governance profiles and the Slack egress path still hold after 670 commits. That verification is yours to make.
  • Two advisory verdicts are unanswered: Design Review 🟡 CONCERNS and First Principles 🟡 CONCERNS. GPT 5.6 and Opus 4.8 are both clean.

For the record, nothing is failing on the code itself: the only red besides readiness is Backend Tests (Windows) (3), whose job conclusion is cancelled after ~40 minutes rather than a test assertion failure — there is nothing to fix there.

When you've addressed these, the pipeline will re-assess on its next cycle.

@bolichen97

Copy link
Copy Markdown
Contributor

Consolidation: rebase this PR onto PR #10928 and drop its copy of the send_message channel leg

@rnoack1 PR #10928 says it was "Split out of a larger messaging change", but this branch was not trimmed after the split. Both PRs now rewrite the same function, _deliver_to_channel in src/kiro_crew/dashboard/handlers/messaging.py, and the two rewrites are incompatible. Neither head contains the other. Running git merge-tree on the two heads gives conflicts in handlers/messaging.py, test/test_send_message_targeted.py, docs/system-specs/modules/messaging.md, chat_compaction_notice.py and chat_handlers.py.

The shared leg. This PR turns it into a public deliver_to_channel(..., tool_name, skip_paused, skip_slack, authored_link, request_app) -> bool (handlers/messaging.py:1847). PR #10928 keeps _deliver_to_channel(..., request_app) -> tuple[bool, str, str]. For this leg, PR #10928's version is the one to keep:

  • It forwards request_app=effective_request_app(state, request). Here, the api_send_message call at :2973 passes only tool_name="send_message", so the capabilities.messaging re-vet at :2024 runs with app="".
  • A governance refusal gets a 403 channel_not_permitted. Here, every refusal on this leg ends in the 502 channel_delivery_failed at :3149.
  • Before each part it re-checks the recipient on-loop, and it aborts if the transport is replaced mid-send (recheck[1] is not transport).

Only in this PR. The /note mirror itself is on neither main nor PR #10928. That covers chat_note_mirror.py, slack_egress.py, the dispatch in api_chat_slot_note, and note.get("mirror") at slot_buffers.py:794. The mirror relies on snapshot_channel_link, audit_channel_send, renderer.send_parts_revalidating, governance_ceiling_unchanged and the authored_link/skip_paused/skip_slack/tool_name parameters. None of these are in PR #10928's code, although its description names the first four.

Suggested sequence (both PRs are yours):

  1. Land PR feat(messaging): revalidate channel authorization before every part of a send #10928 first. Before that, fix its description so it names only the helpers it ships.
  2. Rebase this PR onto main plus PR feat(messaging): revalidate channel authorization before every part of a send #10928. Drop this PR's send-leg rewrite. Also drop the platform/governance_profiles.py hunks that already merged through PR fix(governance): close the cold-load and snapshot-publish races in the profile store #13666 (_COLD_LOAD_WAIT_S, _on_event_loop, _publish_snapshot).
  3. On top of the (sent, code, detail) leg, add back only what chat_note_mirror._deliver_via_transport (:605) needs, and unpack the triple there.

Also carry these through the rebase:

  • The markers_only ordering with PR feat(chat): add transcript section markers #7163 from the 2026-09-08 note is still open.
  • slack_egress.channel_egress_permitted (:195) now also vets capabilities.messaging. On a governed install that denies messaging, compaction notices to Slack are now suppressed. That contradicts the description's "The compaction notice's failure surface is UNCHANGED."
  • The standing change request from this account should be re-reviewed against the rebased head.

From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong.

Copy link
Copy Markdown
Contributor

PR triage (2026-10-05): rebase needed; overlap with #10928 still open

Checked against origin/main af1eb612da using the full merge-base diff (c0307ef08e..5af16aa0c7).

Recommendation: REBASE onto main (after #10928 if that lands first), then MERGE-DISCUSSION with #10928 and #7163. Not a duplicate, and not superseded. Do not close.

@bolichen97

Copy link
Copy Markdown
Contributor

Thank you for this work. This PR has had no activity for more than 30 days, it conflicts with main, and the questions from the earlier review are still open. I am closing it for now. If you want to continue, rebase it onto main after #10928 lands, drop the duplicated channel leg, and reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants