Commit Graph

121 Commits

Author SHA1 Message Date
ejclaw
497e6dec74 refactor: decompose runtime coordination and runner internals (PR6) 2026-04-10 22:48:49 +09:00
ejclaw
4e05f60400 refactor: land approved runtime cleanup and room binding cutover 2026-04-10 21:04:23 +09:00
ejclaw
2e62e125ae Audit outbound delivery and fix reviewer turn routing 2026-04-10 15:22:45 +09:00
ejclaw
c67bd1c622 Finalize turn-role invariants and legacy migration cutover 2026-04-10 11:44:34 +09:00
ejclaw
7753ee46f0 style: apply prettier formatting 2026-04-09 22:50:21 +09:00
ejclaw
5714348897 fix: simplify and stabilize runtime service routing 2026-04-09 22:49:20 +09:00
ejclaw
0f994ab2ce fix: harden paired runtime turn coordination 2026-04-09 13:52:42 +09:00
ejclaw
d996d5ff10 Move paired handoff enqueue into backend 2026-04-08 10:09:23 +09:00
ejclaw
0f751af151 Stabilize paired follow-up routing 2026-04-08 03:50:06 +09:00
ejclaw
e1837759c0 Format runtime refactor modules 2026-04-07 23:46:36 +09:00
ejclaw
f9d9c2af6d Refactor paired runtime orchestration 2026-04-07 23:45:53 +09:00
ejclaw
f2c0615f45 Format fresh review-ready owner routing 2026-04-07 19:06:26 +09:00
ejclaw
f24d9ee117 Route fresh review-ready input to owner 2026-04-07 19:05:18 +09:00
ejclaw
7ad4586985 Restore reviewer wake-up after owner delivery 2026-04-07 18:39:00 +09:00
ejclaw
81cb9bda01 Fix paired finalize re-review reentry 2026-04-07 07:06:34 +09:00
ejclaw
10e10b499c Complete paired-room SSOT cleanup and logger singleton 2026-04-07 05:12:22 +09:00
ejclaw
58b20fad6c Format retry transition refactor files 2026-04-07 02:50:08 +09:00
ejclaw
b8e8c9dabf Unify paired status transitions and retry handling 2026-04-07 02:49:02 +09:00
ejclaw
9d8c97a8e2 Fix reviewer-to-owner follow-up race 2026-04-07 01:22:27 +09:00
ejclaw
cbb6bc97c7 Refactor paired execution flow boundaries 2026-04-07 00:45:17 +09:00
ejclaw
0363021218 Fix owner follow-up after reviewer bot output 2026-04-06 23:28:53 +09:00
ejclaw
b62eebc25b Simplify paired turn routing and prompt builders 2026-04-06 22:44:38 +09:00
ejclaw
24ffa3d2f1 Refactor paired turn transitions and scheduling 2026-04-06 19:32:36 +09:00
ejclaw
d75d26c23d Stabilize paired reviewer recovery and owner follow-up 2026-04-06 07:49:26 +09:00
Eyejoker
b6c8546f25 Dedup reviewer finals only after actual IPC delivery 2026-04-05 08:02:02 +09:00
Eyejoker
e560fe6536 Deduplicate direct terminal reviewer deliveries 2026-04-05 06:57:56 +09:00
Eyejoker
f5e9400b9b Avoid duplicate merge_ready finalize follow-ups 2026-04-05 01:08:13 +09:00
Eyejoker
ac225f2b1e Add paired delivery diagnostic logging 2026-04-05 00:00:09 +09:00
Eyejoker
6ae9468a45 Inline merge_ready finalize handoff 2026-04-04 23:34:32 +09:00
Eyejoker
4a331c5036 Fix paired-room delivery role persistence 2026-04-04 22:28:41 +09:00
Eyejoker
e9c400424d Add reviewer host evidence and verification shims 2026-04-04 20:51:24 +09:00
Eyejoker
dfd9eb0f47 fix: recover fallback delivery retries across agent types 2026-04-04 05:21:25 +09:00
Eyejoker
54abb5bb4e Apply formatter after local memory refactor 2026-04-04 03:52:28 +09:00
Eyejoker
3dd772c229 Refactor local memory and role-fixed runtime routing 2026-04-04 03:50:28 +09:00
Eyejoker
ca58e8c8eb fix: honor handoff agent type during failover 2026-04-01 03:13:05 +09:00
Eyejoker
60f360b5ea fix: preserve handoff roles during failover 2026-04-01 02:54:35 +09:00
Eyejoker
141898f764 refactor: scope runtime log context 2026-03-31 17:23:43 +09:00
Eyejoker
509e4c24a3 refactor: cut over room mode from paired legacy 2026-03-31 14:47:59 +09:00
Eyejoker
1c87616c44 fix: support same-service tribunal runtime 2026-03-31 14:01:31 +09:00
Eyejoker
a81e5aea63 style: format pending paired turn helpers 2026-03-31 05:43:54 +09:00
Eyejoker
43f8341c17 refactor: extract pending paired turn helpers 2026-03-31 05:43:17 +09:00
Eyejoker
3283522be5 feat: enrich finalize prompts and raise round-trip default 2026-03-31 04:40:56 +09:00
Eyejoker
e1b9501e87 feat: add completion_reason to paired_tasks (done/escalated/stopped/arbiter_escalated)
- owner can summon arbiter via BLOCKED/NEEDS_CONTEXT verdict
- completion_reason tracks why task ended: done (success), escalated
  (reviewer gave up), stopped (/stop), arbiter_escalated
2026-03-31 04:10:33 +09:00
Eyejoker
61c9b8c2e9 fix: reviewer auto-trigger now receives owner turn outputs instead of static prompt 2026-03-31 03:55:45 +09:00
Eyejoker
efb5710aad feat: Discord-independent inter-agent communication via paired_turn_outputs
- New paired_turn_outputs table stores agent output directly in DB
- Owner/reviewer prompts assembled from DB instead of Discord messages
- Arbiter context includes human messages + turn outputs
- Falls back to Discord messages for pre-migration tasks
- 50k char storage limit with truncation warning
2026-03-31 03:38:53 +09:00
Eyejoker
4a5edaceb6 refactor: remove SERVICE_AGENT_TYPE legacy constant
SERVICE_AGENT_TYPE was always 'claude-code' in the unified service,
making it a misleading constant. Each group already has its own
agentType field.

- Removed SERVICE_AGENT_TYPE from config.ts
- Session functions now accept agentType parameter (default: 'claude-code')
- Task scheduler uses task-level agent_type for token rotation decisions
- All fallback defaults changed to 'claude-code' literal
- Logging uses 'unified' instead of the misleading type
2026-03-30 23:10:48 +09:00
Eyejoker
5562e30ce1 refactor: use resolveActiveRole() as SSOT for all status→role mapping
Eliminated duplicate task status checks in message-agent-executor.ts
and message-runtime.ts. All status→role decisions now flow through
the single resolveActiveRole() function.
2026-03-30 23:03:00 +09:00
Eyejoker
d3df67e08c chore: remove dead code (pairedCursorKey, unused ARBITER_AGENT_TYPE import) 2026-03-30 22:59:18 +09:00
Eyejoker
14d70f345a refactor: extract resolveActiveRole() as single source of status→role mapping
resolveCursorKey and resolveChannel both duplicated the same
taskStatus→role switch. Now resolveActiveRole() is the single
mapping, and both functions derive from it.
2026-03-30 22:58:00 +09:00
Eyejoker
a91776b067 refactor: centralize channel selection with resolveChannel()
Replace all manual channel selection (useReviewerChannel,
useArbiterChannel, isReviewerWorkItem, isArbiterWorkItem, 3-way
ternary chains) with a single resolveChannel(taskStatus) function
that maps task status to the correct Discord bot channel.
2026-03-30 22:56:40 +09:00