Skip to content

feat(v5): declared agent routing on the board (wish: cross-agent-delegate) - #2766

Merged
namastex888 merged 8 commits into
devfrom
wish/cross-agent-delegate
Aug 11, 2026
Merged

namastex888 merged 8 commits into
devfrom
wish/cross-agent-delegate

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Summary

Wave 1 of the cross-agent-delegation design: board cards declare which roster agent (claude|codex|pi|hermes|prime) works a task and why, with NULL meaning the current orchestrating agent. Declaration-only routing substrate the W2 delegate-bridge wish consumes.

  • Additive nullable tasks.assigned_agent/assigned_reason columns (no user_version bump), EXPECTED_SCHEMA/schemaIsCurrent lockstep, additive backfill on open
  • ROSTER allowlist constant + typed rejection errors at every write path; --agent requires --why
  • task create --agent/--why, new task assign <id> [--clear] with in-transaction timeline notes, task status display, CLAUDE.md docs
  • Lane-path board --json gains assignedAgent/assignedReason; laneless and genie_task MCP shapes stay byte-frozen via Omit<>-typed projections + byte-identical fixture regressions
  • Assignments survive task export → import → three-way task sync; older keyless snapshots import with null backfill

Wish: .genie/wishes/cross-agent-delegate/WISH.md (plan review SHIP → per-group execution reviews SHIP ×5 → independent pre-merge review SHIP, all appended in-document).

Validation

  • Full gate bun run check: 3192 pass / 14 fail — all 14 attributed by name to the pre-existing environment set (proven at base by detached-baseline re-run), zero wish-related
  • Focused suites (task-state, genie-db, v5-task, v5-board, mcp, card-render): 286 pass / 0 fail
  • bun run wishes:lint OK (76 files); real-CLI transcripts for create/assign/clear/rejections/board shapes/sync round-trip (reviewer-run)

Reviewer notes

  • Expected one-time diff: first task export --write after upgrade adds two null keys per card in .genie/roadmap.json (export is column-blind by design)
  • MEDIUM (non-blocking, carried into delegate-bridge W2 as a named prerequisite): imported snapshots store assignment raw — declaration-only per design Decision 2; W2 must validate via requireRosterAgent at consumption before any shell/prompt use
  • QA criteria (functional/integration/regression on dev) remain for the QA agent after merge

…ssign/clear state API

A1 of cross-agent-delegate W1: additive nullable TEXT columns with
EXPECTED_SCHEMA/schemaIsCurrent lockstep and additive backfill (no
user_version bump); ROSTER typed constant (claude|codex|pi|hermes|prime)
with named rejection errors; declaration-only assignTask/clearTaskAssignment
appending assign/clear timeline events.
A2 of cross-agent-delegate W1: CLI verbs over the A1 state API (single
timeline event per op — no double-append), pair invariant + roster
rejections with exit 1 and named errors, declaration-only at any card
status, status renders the assignment, CLAUDE.md Task subcommands table
documents the verb/flags and the lane-path-only serialization consequence.
…eeze preserved

B of cross-agent-delegate W1: lane-path serializer gains the two declared-routing
fields (14-key explicit projection alongside lane/enforcedBlock); laneless --json
and mcp genieTask strip them via explicit key-picking projections, keeping the
byte-frozen shapes identical to pre-change output; leak lists extended and a
byte-identical laneless fixture regression added.
C of cross-agent-delegate W1: insertSnapshotRows carries
assigned_agent/assigned_reason (?? null backfill for older snapshots;
insertTaskRows extraction keeps cognitive complexity within budget);
exportState verified column-blind (no change); roadmap-sync.ts verified
hash-based — first sync after upgrade exports (never diverged), second is
none. Round-trip + older-snapshot + sync-baseline tests added.
Fresh reviewer re-derived all evidence at ca39117: six success
criteria PASS, full gate matches the declared pre-existing failure
set exactly, scope confined to wish files + two authorized
deviations. MEDIUM doc-contract finding carried into delegate-bridge
(W2) as a named prerequisite; two LOW + one INFO recorded.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8459cf3b-0901-44e2-a2af-dbbe1d766796

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e51d8fe1eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/v5/task-state.ts
Comment on lines +500 to +501
assignedAgent: row.assigned_agent,
assignedReason: row.assigned_reason,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep assignment fields out of task list JSON

When callers run genie task list --json, handleList directly serializes the TaskRow[] returned by listTasks (src/term-commands/v5-task.ts:274-276), so adding these properties in mapTask exposes assignedAgent and assignedReason on this non-lane JSON surface—even as null on unassigned tasks. This contradicts the declared lane-path-only serialization contract and changes the existing machine-readable payload; project the pre-assignment fields before stringifying this path, as the board and MCP serializers now do.

Useful? React with 👍 / 👎.

Codex PR review (P2, verified): handleList serialized raw TaskRow[],
leaking assignedAgent/assignedReason onto a non-lane machine-readable
surface — the wish contract is lane-path board --json only. Hoist the
frozen projection into task-state.ts next to TaskRow (canonical copy,
was local to mcp-tools) and ship task list --json through it; leak
regression proven red on the unfixed code.
@namastex888
namastex888 merged commit 993d3bc into dev Aug 11, 2026
17 checks passed
@automagik-genie
automagik-genie deleted the wish/cross-agent-delegate branch September 25, 2026 04:51
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