Skip to content

fix(conductor-patrol): admit the gateway patrol on a crew/member slot - #18592

Closed
rubencu wants to merge 1 commit into
kirodotdev:mainfrom
rubencu:fix/conductor-patrol-member-arm
Closed

rubencu wants to merge 1 commit into
kirodotdev:mainfrom
rubencu:fix/conductor-patrol-member-arm

Conversation

@rubencu

@rubencu rubencu commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a crew/member-mode conductor that dispatches a worker gets the gateway's default work-ledger patrol, so its workers' reports are read even when it arms no loop itself.

After a work_ledger_record action=bind commits, conductor_patrol.ensure_patrol arms a default watch="work-ledger" patrol when the slot holds no loop. On a crew/member conductor that arm never landed: the bind route knows the calling session but not the turn, passes no initiator_slot_key, and autonudge_authz refuses a blank initiator as an outside arm (409). Live gateway since 2026-09-24: 3 refusals (conductor patrol arm refused for member-kirocrew-conductor ... [status 409]), 0 arms, all on member-mode conductors.

That refusal is what docs/request-for-change/rfc-conductor-default-patrol.md (in-progress) chose as a non-goal, because the bind route cannot prove the turn is the session's own. Two days later the patrol's owner filed #17603 asking for this patrol on crew/member conductors. This PR delivers it, so it changes the shape that RFC decided; #18699 (docs only, for the owner to accept by merging) records the decision, and this PR rebases onto it once it lands so the First Principles lane reads it from the base.

Why it matters

Member DM threads are the normal conductor shape, so the safety net was inert where conductors run: done items never accepted, questions and blockers unanswered, goals stalled until a person noticed.

Not a goal

What changed (motivation → approach → change)

The crew/member refusal exists so no outsider's instruction reaches a member's thread through a loop. The default patrol carries none (fixed PATROL_MESSAGE, the slot's own ledger), so it is admitted as a second class, pinned on content rather than on who called, and the content is re-read off the stored row before every wake.

  • autonudge_authz.py (is_gateway_patrol): default_patrol=True admits a crew/member slot only with the exact PATROL_MESSAGE, the work-ledger watch and no structured monitor; audited gateway_patrol; self_armed off.
  • autonudge_selfarm.py: trust entries gain a kind (self | gateway_patrol; none = self). record_gateway_patrol writes before svc.add under a reserved id and fails closed (503); each kind's reader answers False for the other, so the wake-reset gate stays closed to the patrol.
  • conductor_patrol.py (is_patrol_loop): the stored-row twin. The row is the patrol only with default_patrol is True, the fixed text, this slot's own work-ledger watch, and the shape ensure_patrol arms: gate True (ungated, a persisted claim dispatches a structured envelope), empty monitor wake_instructions (that envelope's action line), empty banner (restored as the instruction after an interrupted wake): the store fields that put text in front of the model.
  • slack/gateway.py (_dashboard_mode_admits): a crew/member slot fires a default_patrol row only when is_patrol_loop holds AND the gateway-patrol entry names that loop on that slot; content first, because the entry names an id and a slot while the text lives in the agent-writable autonudge.json. The fire-refusal audit carries default_patrol_bit and default_patrol_content.
  • autonudge_authz.py (authorize_and_update_nudge, state= kwarg, patrol_content_fixed_refusal): a message, watch or non-empty banner edit of a pinned patrol would commit a row refused at every fire (its own text says "tune this loop with monitor_update"), so on a crew/member slot it is refused up front (409), naming the bounds as tunable and the conductor's monitor_start as the arm that replaces the patrol. Both live callers pass state; ordinary slots keep the edit.
  • Specs monitor-architecture.md and learn-cron-dashboard.md: the admission, the fire-time and update rules, and what an edit to PATROL_MESSAGE does to stored patrols (re-arm by the conductor's own arm, or a stop plus the next bind).

Backwards compatibility

Compatible: every arm admitted today is admitted unchanged (the self-arm branch runs first); the only new admission was a 409. Existing trust entries have no kind and read as self-arms. Ordinary-slot patrols arm and fire as before, with no entry and no reserved id.

Taken away: authorize_and_update_nudge now refuses message/watch/banner edits of a crew/member patrol. Its callers in the tree, both updated to pass state:

  • Reader: src/kiro_crew/dashboard/session_directive_apply.py (_monitor_update, the monitor_update MCP tool)
  • Reader: src/kiro_crew/dashboard/handlers/autonudge.py (api_autonudge_update, the goal popover's PATCH)

Nothing else is removed or renamed.

Tests

  • test/test_conductor_patrol.py: the regression test_member_conductor_bind_arms_the_default_patrol[crew|member] (bind answers patrol: armed, fixed message/watch, no self-arm, gateway-patrol entry, gateway_patrol audit); the arm-time pin refuses other text or no ledger watch; an unwritable record denies 503 before the add; the default_patrol= AST ratchet; TestGatewayPatrolTrustEntry; the real-store row pin (ensure_patrol's row passes as stored and reloaded; a message, gate, banner or wake_instructions edit in autonudge.json is not the patrol); the PATROL_MESSAGE sha256 pin; TestPatrolContentIsFixedOnACrewMemberSlot (message/watch/banner edits refused 409 with the row unchanged; bounds tunable; pinned values a no-op; ordinary slot and state-less caller keep the edit).
  • test/test_autonudge_member_self_arm.py: through the real _fire_dashboard_nudge, a recorded patrol fires on crew and member; a rewritten message, an ungated row, a banner, a wake_instructions, another watch, a forged bit without entry, and either kind's entry under the other's bit are refused and audited; TestTheMemberPatrolKeepsItsContentThroughMonitorUpdate: the patrol's own wake turn cannot rewrite its text through apply_session_directive, an idle_secs tune lands.
  • test/test_autonudge_handlers_cov80.py: the PATCH route hands the app state to the chokepoint; no app, None.

Manual verification

N/A — unit coverage sufficient: every path runs through its real code (the HTTP route via aiohttp mocked requests, _fire_dashboard_nudge via the real orchestrator, the row pin via a real AutoNudgeService on a temporary directory). Gates and local runs: see the evidence comments.

Related Issues

Closes #17603. RFC revision: #18699.

Pattern harvest

Rule candidate: review-prompt
Pattern: a trust record that vouches an identity (id and slot) while the payload lives in a store the untrusted side can write; the admission must re-read every payload field that reaches the model against the pinned content at use time, or the record authenticates a label and delivers whatever sits under it.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@rubencu
rubencu requested review from a team and KiroCrewCaptain as code owners October 9, 2026 20:18
@rubencu
rubencu requested a review from buluoray October 9, 2026 20:18
@rubencu

rubencu commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Local test evidence for head 810f0fa (rebased onto 401a14b), dev-dsk Linux, Python 3.12.14, KIROCREW_PROFILE=standalone.

Backend related set (scripts/run_scoped_tests.py --surface backend, 1970 related test files, 7 xdist workers): exit 1 with 17 failures, none in the changed area:

src/kiro_crew/apps/builtins/code_review_sage/tests/test_store_ancestor_chain.py::TestTheWindowBetweenTheRefusalAndTheWalk::test_a_link_planted_inside_the_window_is_followed_outside_every_root
test/test_agent_template_skills.py::TestPatchReordersManagedSkills (6 tests: "'victim' is owned by another Kiro Crew data home")
test/test_cli.py::TestDoctor / TestDoctorStt (10 tests: doctor reads the host; "mcp gateway daemon unreachable", "platform composition failed")

The same 17 node ids were re-run on a pristine detached worktree at the merge-base 56acd14709 with PYTHONPATH pinned to that tree's src/ (import path confirmed): 17 failed there too, identically. They are host-environment failures (/home vs /local/home data-home ownership, a running gateway, symlink refusal under the home mount), not caused by this diff.

Changed-area modules (test_conductor_patrol.py, test_autonudge_member_self_arm.py, test_conductor_wake_reset.py, test_autonudge_refactor_contract.py, test_autonudge_handlers_cov80.py): 580 passed on the rebased head.

D12 determinism proof on the 21 new/changed test ids: 20/20 runs at -n0, 10/10 runs at -n 4 --dist loadgroup --max-worker-restart=2 with test_conductor_wake_reset.py and test_autonudge_refactor_contract.py as co-tenants, and one shuffled order of all three files (seed 2082), all green. test/test_flake_pattern_ratchet.py: 53 passed.

Static gates: check_black_formatting.py, check_subprocess_encoding.py, isort --check-only, flake8 on the changed files, mypy src/kiro_crew (2242 files, no issues), check_comment_history.py, check_brand_name.py, scripts/docs-lint.sh: all pass. semgrep is not installed on this host; CI's SAST job runs the repository rules.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 9, 2026
@rubencu
rubencu force-pushed the fix/conductor-patrol-member-arm branch from 810f0fa to 5c7f1b2 Compare October 9, 2026 21:01
@rubencu

rubencu commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

SAST (Semgrep) on head 5c7f1b2 is an infrastructure red, not a finding. The job failed before semgrep ran: the semgrep/semgrep:1.78 container pull hit Docker Hub's unauthenticated rate limit three times (toomanyrequests: You have reached your unauthenticated pull rate limit), see https://github.com/kirodotdev/KiroCrew/actions/runs/37990832203/job/114025026597. gh run rerun --failed answers Must have admin rights to Repository from a fork contributor, so a maintainer rerun of that job is requested.

The previous head's one finding (kirocrew.test-autouse-shared-monkeypatch on test/test_conductor_patrol.py::TestGatewayPatrolTrustEntry._home) is fixed in this head: the autouse fixture now requests _floor_monkeypatch (D11), as the module's own _env fixture does.

Local proof on head 5c7f1b2, same configuration as the job, semgrep 1.78.0, baseline the merge-base d062bdce2a:

semgrep scan --config p/python --config p/typescript --config p/security-audit --config p/secrets --config p/owasp-top-ten --config semgrep/ --baseline-commit d062bdce2af77afeb31abbaa8d2624eb0cd7595d --error
Ran 254 rules on 8 files: 0 findings.

Changed-area tests on this head: test_conductor_patrol.py, test_autonudge_member_self_arm.py, test_conductor_wake_reset.py, test_autonudge_refactor_contract.py: 512 passed; the fixed class 20/20 at -n0; the three files shuffled (seed 22010) green; test_flake_pattern_ratchet.py 53 passed.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision efd1c7fa669f939434b4a4332c549998e9129d95 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🔴 BLOCK

Premise-level review of efd1c7fa669f939434b4a4332c549998e9129d95 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.

First-Principles-Verdict: BLOCK

product-shape change without accepted RFC: crew/member conductors now get the gateway patrol by default, a shape the base RFC explicitly excludes.

Not justified as shipped

What this change ships

Inventory (6 items) — 5 justified

Intent: the patrol should read a crew/member conductor's worker reports even when the conductor arms no loop itself. This is an ADDITION framed as a FIX.

  1. A crew/member conductor's bind now arms the default work-ledger patrol instead of being refused with a 409. Tag: product-shape, no recorded decision.
  2. A crew/member patrol fires only when the stored row still holds the fixed text and shape and a gateway-patrol trust entry exists — justified
  3. On a crew/member patrol, monitor_update or the goal popover can no longer edit its message, watch or banner (409) — justified
  4. A new gateway_patrol audit outcome, plus the patrol fields on the fire-refusal audit — justified
  5. The bind's arm fails closed with a 503 when the trust entry can't be written — justified
  6. Trust entries gain a kind, and each kind cannot vouch for the other, so the patrol cannot reset the conversation — justified

Blockers

  • product-shape change without accepted RFC: the default patrol on crew/member conductors
    Item 1 changes what a first-class monitor does by default on the usual conductor shape. The only RFC on the base list that covers this patrol (rfc-conductor-default-patrol.md: implemented) decided the opposite: section 5 rules it out, and its exit criteria pin the refusal. The PR also deletes test_member_conductor_is_refused_and_no_trust_record_is_written, the test that pinned that decision. The description names the reversal but has no record behind it.
    Clears when: an RFC revision covering crew/member default-patrol arming (docs(rfc): conductor default patrol on a crew- or member-mode conductor #18699) merges non-draft on the base, then a push or rebase; or a maintainer posts /ai-review override first-principles efd1c7fa669f939434b4a4332c549998e9129d95: <decision>.

[FIRST-PRINCIPLES-REVIEWED] efd1c7f

Description read

[DESCRIPTION-READ] 3553e6f44759c2752b533bffaee6c4f7aa8c5cddf4f21d13ac6280c66fc0a001

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of efd1c7fa669f939434b4a4332c549998e9129d95 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

This reverses a non-goal in the RFC on the base branch (rfc-conductor-default-patrol.md §2/§5, status implemented) before the superseding revision #18699 has merged.

Watch

  • The reversal is ahead of its decision. The base RFC says "a crew- or member-mode conductor refuses the default." This PR deletes test_member_conductor_is_refused_and_no_trust_record_is_written, which pinned that refusal. It also admits patrols armed from cron-injected and sub-agent-shared turns into member threads, and the RFC rejected that by name. The description correctly calls this a decision, not a gap, but on the base the decision still stands. Merge this first and the code contradicts its governing spec.
    Clears when: #18699 is merged by the patrol's owner and this PR is rebased onto it.
  • Editing the patrol text silently strands every stored crew/member patrol. is_patrol_loop checks each stored row against the current PATROL_MESSAGE. After a text edit, every patrol armed under the old text is refused at every fire. _extend_for_open_ledger keeps those rows alive, and an existing record blocks a fresh arm. The result is a row that reads as armed but never wakes, which is the same inert safety net this PR sets out to fix, and no migration exists. A sha256 pin in a test makes the edit deliberate, but it doesn't help the conductors that already hold a patrol.
    Clears when: either a row that is recorded as a patrol but carries an old text is replaced or re-armed automatically, or the fire path stops depending on the stored text (see Suggestion).

Suggestions

  • For a row with the bit set and a recorded entry, have the fire path deliver the gateway's own PATROL_MESSAGE instead of the stored message. A rewritten message then cannot reach the model at all. That removes the message pin, the update-time 409 for message, and the stranding when the text changes. The pins on gate, banner and wake_instructions stay.

[DESIGN-REVIEWED] efd1c7f

Description read

[DESCRIPTION-READ] d27f2a5bbb855597398057c167e344ca6dfed74e01c5c39537f83f0cde130217

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] efd1c7f

@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 Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] efd1c7f

@rubencu
rubencu force-pushed the fix/conductor-patrol-member-arm branch from 5c7f1b2 to 4e5a08d Compare October 10, 2026 01:49
@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • Patrol trust admits agent-rewritten instructions span=e51cd2330ac2

fixed in 4e5a08d: _dashboard_mode_admits admits a default_patrol row on a crew/member slot only when conductor_patrol.is_patrol_loop(loop) holds (the stored message equals PATROL_MESSAGE byte for byte after strip, and the row's monitor is this slot's own work-ledger watch: kind the watch name, target the slot key) AND is_recorded_gateway_patrol names the id on the slot. The content check runs first, so a row rewritten in autonudge.json under the patrol's own id, slot and flag never reaches the trust-record read and is never delivered; the monitor_fire/denied audit carries default_patrol_content: false beside default_patrol_bit: true.
"No structured monitor" is spelled, for the stored row, as "the monitor is exactly this slot's ledger watch": svc.add(watch="work-ledger") stores a work-ledger MonitorState on the row, so a pull-request watch, another slot's ledger or no monitor all refuse. Ordinary slots are untouched: the pin is consulted on crew/member slots only.
Tests: test_a_rewritten_message_under_the_patrols_own_id_is_refused (appended, replaced and emptied text; crew and member), test_a_patrol_row_without_this_slots_ledger_watch_is_refused, test_the_content_is_checked_before_the_entry_is_read, and on a real AutoNudgeService test_a_message_rewritten_in_the_store_is_no_longer_the_patrol (JSON edit of message; id, slot and flag survive the reload) and test_the_armed_default_satisfies_the_row_pin_as_stored_and_reloaded (the arm-time and fire-time pins name the same content).

@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 Oct 10, 2026
@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • Item 1 — inherited: the PR calls the refusal "Bug fix… that arm has never landed" span=a797f45f68ba

fixed in 4e5a08d (description): the body no longer calls the refusal a bug. It now states that rfc-conductor-default-patrol.md (in-progress) chose the refusal as a non-goal and why (the bind route cannot prove the turn is the session's own), that #17603 was filed two days later by that RFC's author asking for the patrol on crew/member conductors, and that this PR changes the shape the RFC decided while keeping the property section 5 protects (no outsider-authored text reaches a member's thread through a loop).
The code already carried that framing (conductor_patrol docstring: "the arm is the GATEWAY'S"); the description was the part that misnamed it.

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • product-shape change without accepted RFC: default patrol on member conductors span=6fbbac9411c9

needs-a-decision: the finding is right that no RFC on the base covers admitting the gateway patrol on crew/member slots; rfc-conductor-default-patrol.md section 5 refuses it and its exit criterion pins the refusal. The question for the maintainer who owns that RFC (its author filed #17603 asking for this patrol, tier T2, due 2026-10-21): is #17603 the decision to revise section 5, in which case this PR is its implementation and /ai-review override first-principles 4e5a08d54d792cb70e8ec9e7cc0545afd7b8c488: <decision> clears the lane, or must the RFC be amended on main first, in which case this PR waits and rebases onto that amendment.
What the PR preserves of section 5: the arm is still never claimed as a self-arm (initiator_slot_key ratchet intact), the admitted text is the fixed PATROL_MESSAGE and the watch the slot's own ledger, checked at arm time (is_gateway_patrol) and at fire time on the stored row (is_patrol_loop), the wake-reset gate stays closed to the patrol, and default_patrol= is ratcheted to conductor_patrol.py. What it changes: a cron-injected or sub-agent-shared bind can now start the fixed patrol on the slot's own ledger, which section 5 listed as the reason to refuse.

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • This reverses a deliberate refusal, not a gap. span=3bc4e230cc74

needs-a-decision: agreed that #17069 chose the refusal and pinned it in test_member_conductor_is_refused_and_no_trust_record_is_written. The description in 4e5a08d now says so and names the RFC non-goal it changes. The reversal is the request in #17603, filed by the RFC's author two days after #17069 landed; whether that issue is the decision or an RFC amendment must come first is put to the maintainer in the first-principles disposition on span 6fbbac9411c9, and the same ruling answers this item.

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • The patch keeps that provenance argument. But its own docstring says the bind can come from a cron injection, an app-driven turn or a sub-agent sharing the slot. span=5197c3b08478

rebutted as a contradiction: the two statements are the same fact read for different purposes. The provenance argument is why the module never claims a self-arm (and why the self-arm record, which opens reset_conversation, is never written for the patrol). The docstring names those callers as the reason the arm is classed as the gateway's rather than the caller's. The admission does not rest on who called; it rests on what is armed being the fixed text on the slot's own ledger, checked at arm time and again on the stored row at fire time (4e5a08d, conductor_patrol.is_patrol_loop).

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • Each of those can now start up to 300 gated wakes in a member's thread. The text is fixed, but it tells the conductor to act on ledger items that workers wrote. span=567e297af988

rebutted in part, decision in part. The ledger items are already the conductor's own inputs: a member conductor that arms its own monitor_start watch="work-ledger" (the path #17069 kept primary) receives exactly the same wakes carrying exactly the same worker-written items, so the patrol adds no content a self-armed conductor would not read; what differs is only who started the loop. The wake is also gated (gate=True, work-ledger watch): a quiet ledger spends no turn, and the 300-cycle / 86400 s bounds are the ones patrol_budget.py check requires of any conductor loop. Whether an outsider-triggered wake of fixed content is acceptable on a member slot is the decision asked of the maintainer on span 6fbbac9411c9.

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • Pinning the message closes "outsider-authored text". It does not close "an outsider-triggered wake", and that second case is the line this PR moves. span=0a39345bd501

accepted as the accurate statement of what moves. The PR description in 4e5a08d now says it in those words under "Not a goal": a cron-injected or sub-agent-shared bind arms the patrol too, and what such a turn can start is only the fixed patrol on the slot's own ledger. Nothing else about the member boundary moves: outside arms with any other text are still 409, the self-arm record is never written, the wake-reset gate stays closed. The ruling on whether that line may move is the maintainer decision requested on span 6fbbac9411c9.

@rubencu

rubencu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author
  • docs/decisions/ has no entry on this, so a human has to make the call. span=f964d1724230

needs-a-decision: correct, and the call is requested in one place so it is not made twice: the first-principles disposition on span 6fbbac9411c9 asks the RFC's owner whether #17603 is the decision (then /ai-review override first-principles 4e5a08d54d792cb70e8ec9e7cc0545afd7b8c488: <decision> and an RFC follow-up) or whether the RFC must be amended on main before this PR rebases onto it. No decision record is added by this PR because the decision is not the author's to record.

@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 Oct 10, 2026
@rubencu
rubencu force-pushed the fix/conductor-patrol-member-arm branch from 4e5a08d to e0b814c Compare October 10, 2026 02:57
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 10, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 11, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 12, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 12, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 12, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 13, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 13, 2026
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 13, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
A conductor that binds a worker and holds no loop gets a default
work-ledger patrol armed by the gateway after the bind commits. On a
crew/member-mode conductor that arm never landed: the bind route knows
the calling session but not the turn, so it passes no self-arm
provenance, and the authorizer refused it as an outside arm with a 409.
Member DM threads are the normal conductor shape, so the safety net was
inert exactly where it was needed; workers reported to a ledger nobody
read.

The refusal exists so no outsider's instruction reaches a member's
thread through a loop. The default patrol carries none: its text is the
fixed PATROL_MESSAGE and it watches the slot's own ledger. So the
authorizer now admits it on a crew/member slot as the gateway's own
arm, a class distinct from a self-arm: pinned on content (the flag alone
does not admit; the message must be the fixed text and the watch the
ledger), audited under its own gateway_patrol outcome, and backed by a
gateway-patrol trust entry written before the add. The fire-time guard
requires the default_patrol bit, the patrol's content on the STORED row
(conductor_patrol.is_patrol_loop: the fixed text and this slot's own
work-ledger watch) and that trust entry together: the loop store is
agent-writable and the entry names only an id and a slot, so a message
rewritten under the patrol's own id is refused like any other outside
text, and the fire-refusal audit says which of the three failed. The two
entry kinds never vouch for each other, so the patrol's wake still
cannot reset the conversation and a forged bit of either kind cannot
borrow the other's record. default_patrol= is ratcheted to
conductor_patrol by a tree-scanning test, like initiator_slot_key.

The row pin also holds the SHAPE the patrol is armed in, because the
other store fields that put text in front of the model live beside the
message: gate stays True (ungated, a persisted claim is dispatched as a
structured envelope), the monitor's wake_instructions stays empty (that
envelope's action line) and banner stays empty (an interrupted wake
restores the banner as the instruction). Because the guard pins the
stored content, a message, watch or banner edit of such a patrol through
monitor_update or the goal popover would commit a row the guard then
refuses at every fire. The update chokepoint, handed the state by both
live callers, refuses that edit on a crew/member slot (409) and names
the bounds as what stays tunable and the conductor's own monitor_start
as the arm that replaces the patrol; an ordinary slot keeps the edit. A
digest test pins PATROL_MESSAGE so an edit to the text is made knowing
what it does to patrols already stored.

Closes kirodotdev#17603
@rubencu
rubencu force-pushed the fix/conductor-patrol-member-arm branch from 069afe4 to efd1c7f Compare October 13, 2026 11:44
@rubencu

rubencu commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Rebased 069afe4eab -> efd1c7fa66 on main 2598f22518: main added the expect_fingerprint string check to the update handler at the spot where this change reads the app state for the chokepoint; both kept, main's validation first, then the state read, and both reach authorize_and_update_nudge. 601 tests across the authz, handler, conductor-patrol, member self-arm and AutoNudge files pass; black, flake8, docs-lint and diff-check clean. MERGEABLE.

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 13, 2026
rubencu added a commit to rubencu/KiroCrew that referenced this pull request Oct 13, 2026
The first version of rfc-conductor-default-patrol.md listed arming on a
crew- or member-mode conductor as a non-goal, because the bind route
cannot prove the turn is the session's own. Two days after it landed the
patrol's owner filed kirodotdev#17603 asking for the patrol on exactly those
conductors, which are the normal conductor shape; on a live gateway
every refusal since 2026-09-24 was a member-mode conductor's bind.

This revision records the decision kirodotdev#17603 asks for and how it is kept
inside the property section 5 protects. The patrol is admitted on such a
slot as the gateway's own arm, never a self-arm: pinned on its fixed
text and the slot's own work-ledger watch at arm time, backed by a
gateway-patrol trust entry, and re-read against the stored row at fire
time, so a message rewritten in the agent-writable store is refused like
any other outside text. The self-arm route the issue suggested is
recorded as an alternative with the reasons it was not taken. Sections
2, 3, 4, 5, 6 and 8 change; the README row is re-audited against
950be41. The implementation is kirodotdev#18592, which rebases onto this
document so its First Principles lane reads the decision from the base.

Refs kirodotdev#17603
@rubencu

rubencu commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Withdrawn. The author accepts §2 non-goals, §5 and §6 of RFC revision #19893 (2c237a2a75) and the rollback finding that the shared trust record is unsafe because is_recorded_self_arm ignores kind. The gateway-arm implementation is abandoned. The member-slot patrol defect will be re-approached as a self-arm provenance fix in the session-directive consumer, per #17603. Maintainer, please close this PR.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 14, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you @rubencu for the careful work on this, and for the clear write-up when you withdrew it.

Closing as you asked in your comment:

Withdrawn. The author accepts §2 non-goals, §5 and §6 of RFC revision #19893 (2c237a2a75) and the rollback finding that the shared trust record is unsafe because is_recorded_self_arm ignores kind. The gateway-arm implementation is abandoned. The member-slot patrol defect will be re-approached as a self-arm provenance fix in the session-directive consumer, per #17603. Maintainer, please close this PR.

The RFC revision on main (#19893, commit 2c237a2, with #19742) lists "Arming on a crew- or member-mode conductor" as a non-goal, see docs/request-for-change/rfc-conductor-default-patrol.md:41.

Your branch is kept, and you are welcome to reopen or open a new PR for the self-arm provenance route. Thanks again!

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 17, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Member/crew conductors get no default patrol on bind

2 participants