fix: release comms-blocking parks when replies arrive and give every role file authoring tools

Project 3333 forensics: env_engineer sent a blocking question to the CTO,
got a full reply 96s later, and still deadlocked the whole run — the
park half (`_park_for_blocking_comms`) had no wired consumer, so
WAITING_FOR_PEER work items could never be released.

Unpark path (root fix):
- The dispatcher loop now calls `_try_unpark_blocking_comms` each tick
  for parked, non-in-flight tasks; blocking replies land as durable
  inbox files, so the check is read-only until all replies are present.
- `_try_unpark_blocking_comms` accepts orphaned waits (peer_wait
  stripped by the legacy resolver while the work item stayed parked)
  and falls back to the park predicate itself: an empty unresolved
  blocking outbox releases the task, anything pending keeps it parked.
- `resolve_task_peer_wait` no longer touches comms_blocking waits (it
  flipped task.status without the work-item phase and stripped the
  peer_wait evidence); `_resume_peer_checkpoint` re-enters the company
  runtime for comms/orphaned waits and lets the dispatcher converge.

File tools (defaults changed at their declaration sites, honoring the
"empty tools = everything, explicit list = exactly that" contract):
- corporate builtin groups gain file_write/file_edit for coordination,
  QA, and data-acquisition roles.
- all shipped org YAML role tool lists gain the missing
  file_write/file_edit entries.
- coordination turn modes no longer strip file_write/file_edit at
  runtime — in-context content (briefs, matrices) must be persistable
  instead of getting trapped in blocking DM hand-offs.

Also includes the pending office_ui ws_handler change from the working
tree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
LZH-YS1998
2026-07-08 21:06:39 +08:00
parent 4b29b89371
commit 5aa57e69ee
12 changed files with 110 additions and 10 deletions
@@ -70,6 +70,8 @@ roles:
- web_search
- web_fetch
- shell_exec
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- Focus on technical feasibility, architecture quality, and engineering best practices.
@@ -113,6 +115,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- Optimize for audience fit, brand consistency, and content quality.
@@ -157,6 +161,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- Ensure operational efficiency, process compliance, and delivery quality.
@@ -205,6 +211,7 @@ roles:
- browser_select_option
- browser_take_screenshot
- browser_close
- file_edit
preferred_external_agent: claude_code
prompt_refs:
- 'Run data acquisition in four phases: Discover, Verify, Prepare, Report.'
@@ -440,6 +447,7 @@ roles:
- browser_scroll
- browser_select_option
- browser_take_screenshot
- file_edit
preferred_external_agent: null
prompt_refs:
- Test rigorously. Reject unclear or unsafe outputs.
@@ -32,6 +32,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: codex
prompt_refs:
- You are the Studio Director. You are the owner-facing final decision role for
@@ -79,6 +81,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: claude_code
prompt_refs:
- You are the Game Designer. Turn the user's request into a buildable gameplay brief
@@ -31,6 +31,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: claude_code
prompt_refs:
- You are the Chief Analyst — the owner-facing final decision role for a lean research
@@ -81,6 +83,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: claude_code
prompt_refs:
- You are the Researcher. Your job is to conduct thorough, evidence-based research
@@ -31,6 +31,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- 'You are the Managing Partner. Defines the investment mandate, target stage, sector
@@ -83,6 +85,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- 'You are the Investment Director. Translates the user request into an investment
@@ -137,6 +141,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Sector Analyst. Evaluates whether the target sector can compound over
@@ -181,6 +187,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Market Researcher. Quantifies TAM/SAM/SOM, buyer budgets, growth rates,
@@ -226,6 +234,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Startup Scout. Builds a broad candidate pool with founding date, headquarters,
@@ -274,6 +284,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Competitive Analyst. Maps incumbents, startup competitors, substitute
@@ -318,6 +330,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the News & Signal Analyst. Tracks recent market signals, customer wins,
@@ -360,6 +374,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- 'You are the Due Diligence Lead. Turns the shortlist into a diligence plan, coordinates
@@ -460,6 +476,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: claude_code
prompt_refs:
- You are the Business DD Analyst. Evaluates target customers, sales motion, pricing
@@ -552,6 +570,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Risk & Legal Analyst. Finds privacy, open-source license, supply-chain,
@@ -595,6 +615,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- 'You are the Investment Committee Chair. Runs structured bull-case and bear-case
@@ -644,6 +666,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Bull Case Reviewer. Builds the strongest evidence-backed case for
@@ -688,6 +712,8 @@ roles:
- browser_wait_for
- browser_scroll
- browser_take_screenshot
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Bear Case Reviewer. Builds the strongest evidence-backed case against
@@ -726,6 +752,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- You are the Final Decision Reviewer. Reconciles bull and bear cases, ranks companies,
@@ -768,6 +796,8 @@ roles:
- todo_read
- web_search
- web_fetch
- file_write
- file_edit
preferred_external_agent: null
prompt_refs:
- 'You are the Report & Delivery Lead. Owns final deliverables: investment memo,