agent-orchestrator/packages/cli/__tests__/commands
Harsh Batheja aefa6ef001 fix(core): enforce single-owner PR claim consolidation (#390)
* fix(core): enforce single-owner PR claim consolidation

* refactor: remove dead `takeover` option from claimPR

Since PR consolidation is now automatic (single-owner enforcement),
the `--takeover` flag became dead code. Users passing it got no
error but it had zero effect.

This commit:
- Removes takeover from ClaimPROptions interface
- Removes --takeover flag from spawn and session CLI commands
- Updates orchestrator-prompt.ts examples
- Updates tests to reflect automatic consolidation

Tests: ao-core 403 passing, ao-cli 189 passing (spawn+session)

* fix: remove stale --takeover from Quick Start example

Remove remaining --takeover reference in orchestrator prompt Quick Start section.

* feat(core): document and test asymmetric PR ownership model

- Add JSDoc to claimPR documenting RULE A (exclusive PR->Agent) and
  RULE B (Agent->Many PRs) ownership contract
- Add tests for:
  - Same session claiming multiple PRs sequentially (RULE B)
  - Idempotent re-claim by same owner
  - Stale/dead prior owner handoff
  - Exclusive PR ownership enforcement (RULE A)

139 tests passing

---------

Co-authored-by: Harsh <harsh@Ubuntu-24-Forrest.lan>
2026-03-11 06:41:03 +00:00
..
dashboard.test.ts refactor: delegate CLI commands to core SessionManager (#88) 2026-02-18 14:30:17 +05:30
init.test.ts test: align codex plugin version checks and stabilize init port tests 2026-03-07 21:02:07 +05:30
open.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
review-check.test.ts feat: add PR claim flow for agent sessions (#326) 2026-03-07 03:54:19 +05:30
send.test.ts feat: OpenCode session lifecycle and CLI controls (#315) 2026-03-08 09:55:44 +05:30
session.test.ts fix(core): enforce single-owner PR claim consolidation (#390) 2026-03-11 06:41:03 +00:00
spawn.test.ts fix(core): enforce single-owner PR claim consolidation (#390) 2026-03-11 06:41:03 +00:00
start.test.ts fix: pause workers on model limits and stabilize session visibility (#367) 2026-03-11 06:41:03 +00:00
status.test.ts feat: add PR claim flow for agent sessions (#326) 2026-03-07 03:54:19 +05:30