Skip to content

fix(kanban): --takeover re-homes the card; explicit --session beats parent home (t_5c908e14) - #1118

Merged
ang-fleet-lander[bot] merged 5 commits into
mainfrom
daedalus/t_5c908e14-takeover-rehome
Sep 26, 2026
Merged

ang-fleet-lander[bot] merged 5 commits into
mainfrom
daedalus/t_5c908e14-takeover-rehome

Conversation

@Kyzcreig

@Kyzcreig Kyzcreig commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

fix(kanban): --takeover re-homes the card; explicit --session beats parent home (t_5c908e14)

A --takeover on assign/unblock/promote/reclaim/triage-resolve/complete now
sets tasks.session_id to the taking session, records prev_session_id and
session_id in the takeover event payload, notes the re-home in the audit
comment, and subscribes the taker's chat (best effort). Other verbs stay
one-off foreign actions; --operator never re-homes; edit --session <sid>
remains the status-free re-home.

Children created with --parent already inherit the parent's CURRENT home,
so after a takeover they follow the new home. create --session <sid>
(explicit) now wins over the parent's home; an omitted --session still
defers to the parent. create_task gains session_explicit=False (default
keeps library/tool behavior unchanged).

The origin: line is already written by create_task (the single create
choke point) when the body lacks one; a CLI test now pins that.

Verified: tests/hermes_cli/test_kanban_home_session.py 89 passed.
Mutant (new_home = None, i.e. skip the re-home): 7 tests RED.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…arent home (t_5c908e14)

A --takeover on assign/unblock/promote/reclaim/triage-resolve/complete now
sets tasks.session_id to the taking session, records prev_session_id and
session_id in the takeover event payload, notes the re-home in the audit
comment, and subscribes the taker's chat (best effort). Other verbs stay
one-off foreign actions; --operator never re-homes; `edit --session <sid>`
remains the status-free re-home.

Children created with --parent already inherit the parent's CURRENT home,
so after a takeover they follow the new home. `create --session <sid>`
(explicit) now wins over the parent's home; an omitted --session still
defers to the parent. create_task gains session_explicit=False (default
keeps library/tool behavior unchanged).

The origin: line is already written by create_task (the single create
choke point) when the body lacks one; a CLI test now pins that.

Verified: tests/hermes_cli/test_kanban_home_session.py 89 passed.
Mutant (new_home = None, i.e. skip the re-home): 7 tests RED.
@Kyzcreig

Copy link
Copy Markdown
Collaborator Author

CHANGES REQUESTED (Apollo diff review 14:5x PT, PR #1118 @eb246a2b). Core is right (explicit create --session beats parent; children follow the CURRENT home; prev_session_id in the takeover event). Two defects, both from the card's own 'sweeps never re-home' line:

  1. CRON / SWEEP actors must NOT re-home. scripts/mq-review-card-closer.sh (cron 1cd274c546db) runs 'complete --takeover' on review cards every 20 min; as written every card it closes is re-homed to a cron_* session, pulled out of its home conversation's count, and its pings go nowhere. Skip the re-home when the actor session id starts with 'cron_' or the caller is a delegate child/sweep (the takeover event still records the actor). Test: cron-session actor -> session_id unchanged.
  2. Drop 'complete' from REHOME_ON_TAKEOVER_ACTIONS. Completing is terminal — re-homing a finished card only moves it between conversations' counts. Adoption of an abandoned card happens on assign/unblock/promote/reclaim/triage-resolve (or edit --session). Test: complete --takeover -> session_id unchanged.
    Keep the rest. Push to the same branch; CI is the gate; hand back.

Kyzcreig and others added 3 commits September 25, 2026 21:33
…actors (t_5c908e14)

Apollo review of #1118 @eb246a2b:
- drop "complete" from REHOME_ON_TAKEOVER_ACTIONS: completing is terminal;
  mq-review-card-closer runs complete --takeover every 20 min.
- _can_adopt_home(): a cron_* session or a delegate_task child never
  becomes a card's home. The takeover event still records the actor
  (by_sessions); prev_session_id is only written when a re-home happens.
- --takeover help text updated.

Verified: test_kanban_home_session.py 90 passed (test-gate).
Mutants: cron_ check disabled -> test_cron_actor_takeover_does_not_rehome
RED; "complete" re-added -> test_complete_takeover_does_not_rehome RED.
@ang-fleet-lander

Copy link
Copy Markdown

🤖 merged-by: apollo · lane: kanban-merge-pass · gate: BYPASS: FleetReview paused since 09-22; gate = CI green + Apollo diff review · why: t_5c908e14: --takeover re-homes (not on complete; cron/delegate never adopt); Apollo reviewed; rebased onto flake fixes

@ang-fleet-lander
ang-fleet-lander Bot added this pull request to the merge queue Sep 26, 2026
Merged via the queue into main with commit 1bfad2a Sep 26, 2026
56 checks passed
@ang-fleet-lander
ang-fleet-lander Bot deleted the daedalus/t_5c908e14-takeover-rehome branch September 26, 2026 16:19
@ang-prism

ang-prism Bot commented Sep 27, 2026

Copy link
Copy Markdown

FleetReview

Review: post-merge · head 1bfad2aa34f2 · duration 13m 33s
Profile: light (merit: default light: lines 262<800, files 3<1000000, hunks 12<1000000, no hot path) · policy: below-size-and-path-gates
Roster: B-assert-ctx → gpt-6-sol (openai), C-assert-xhigh → claude-code-opus-5-5 (anthropic), G → grok-4.6 (xai), L6 → gpt-6-sol (openai)

Post-merge review (fleetreview:post-merge override): this reviewed the merge commit against its first parent — the bytes that already shipped. It is not a pre-merge gate pass.

profile: light (rule: default light: lines 262<800, files 3<1000000, hunks 12<1000000, no hot path) · round 0 · members: B-assert-ctx, L6, C-assert-xhigh, G · families: anthropic,openai,xai

Confidence: 3/5

Findings

  • P1 hermes_cli/kanban_db.py:5088 — Unstamped child · agreed: B-assert-ctx,C-assert-xhigh,G (openai, anthropic, xai)
  • P1 hermes_cli/kanban_db.py:5730 — Unhomed adoption · agreed: B-assert-ctx,C-assert-xhigh (openai, anthropic)

FleetReview provenance · models: B=gpt-6-sol, C=claude-code-opus-5-5, D=grok-4.6 · cost: $1.19 · duration: 13m 28s · rounds: 1 · files examined: 3

ang-fleet-workers Bot added a commit that referenced this pull request Oct 2, 2026
…nd_message seal, adapt tests to fork gates / upstream shapes

- tools/send_message_tool.py: restore `_is_dispatcher_owned_worker_process` / `_check_send_message`
  verbatim from fork/main (#636 worker notify-channel seal; fork-only, dropped by the merge).
- tests (upstream-only, adapted to fork contracts): test_kanban_provenance — a dispatched worker cannot
  mint on the placeholder 'default' lane (kanban_worker_policy) and a worker-created card is homed on
  the owning task (kanban_db._resolve_birth_session C6 #1118), not a tool-supplied session_id;
  test_kanban_descendant_scope / test_kanban_redaction — completions carry a structured receipt
  (fork receipt gate #1621, prose alone is refused).
- tests (fork-only, adapted to upstream shapes, property kept): test_kanban_authority_ambient_reads —
  `_require_orchestrator_tool` raises _Reject (handlers return it); sandbox passthrough seal asserts
  the property (never "task var present + owner marker absent": fork stamped an owner pid, upstream
  strips the var and fences the lineage); test_kanban_comment_provenance_tools — forged attribution
  is now refused by the strict-parameter gate instead of silently dropped, and nothing lands;
  test_kanban_session_attribution — spawn source scan repointed to kanban_db_dispatch (split).

Verified via scripts/test-gate: provenance+descendant_scope+redaction 17 passed;
authority_ambient_reads+comment_provenance_tools+session_attribution 36 passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant