fix(company): terminalize report-chain failure into FAILED settlement; prompt-spill hygiene

Report chain: when consecutive report cards exceed the failure limit the
parent now fails through transition_work_item (settlement, dependents,
manager visibility) instead of parking forever in AWAITING_MANAGER_REVIEW
behind a metadata hold no reconcile path could clear. The hold stamp
survives only as the quarantine fallback when the FAILED write does not
land, mirroring the attempt ledger's terminalize pattern.

Cursor prompt spill: one stable file per task (retries overwrite instead
of accumulating) and a self-ignoring .gitignore so workspace git never
picks up .opc/external_prompts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
LZH-YS1998
2026-07-31 19:53:13 +08:00
parent 18ddc18948
commit 5f5fbf432e
4 changed files with 121 additions and 17 deletions
+11
View File
@@ -3612,6 +3612,17 @@ class ExternalAgentMonitoringTests(unittest.IsolatedAsyncioTestCase):
self.assertIn(str(prompt_file), str(cmd[-1]))
self.assertNotIn(prompt[:64], metadata["command"])
self.assertLess(len(cmd[-1].encode("utf-8")), CursorAdapter._ARGV_PROMPT_MAX_BYTES)
# Hygiene: one stable file per task (retries overwrite) and a
# self-ignoring directory so workspace git never picks it up.
self.assertEqual(prompt_file.name, "cursor_task-large.md")
_cmd2, metadata2 = adapter.build_interactive_invocation(
task, workspace_path=tmpdir
)
self.assertEqual(metadata2["prompt_file"], str(prompt_file))
self.assertEqual(
sorted(p.name for p in prompt_file.parent.iterdir()),
[".gitignore", "cursor_task-large.md"],
)
finally:
_cleanup_test_dir(tmpdir)