mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 20:25:56 +00:00
Remove dead Patrol assessment and save-failure handoffs
buildPatrolAssessmentAssistantHandoff lost its last caller when the Patrol summary card's Discuss handler was removed ineac7dfe9ef(2026-05-15), and buildPatrolConfigurationFailureHandoff lost its last caller in27ba85ddc6(2026-06-23). Since then only their own tests called them. A TypeScript compiler import graph rooted at src/index.tsx confirms no reachable file imports either one. Removing them also drops PatrolInvestigationContextSummary, their input and output types, and the private assessment, recent-change, correlation and save-failure helpers that only they used (found with noUnusedLocals until it reported nothing). Rollup had already tree-shaken all of it: production builds of the parent tree and of this tree are byte-identical across all 187 dist files, and the bundle-size check passes. The presentation helpers the dead code imported keep their live callers. Their test cases go with them. Two cases covered branches the live finding handoff still uses, so they now run through buildPatrolAssistantFindingHandoffActions and buildPatrolAssistantFindingHandoff: a typed pending action without a legacy approval id stays approval-bound, and the finding context qualifies its resource with the record's node and truncates long lines. v8 coverage of the surviving model code matches the pre-removal baseline except one defensive guard the live caller cannot reach. The raw-source guards pinned none of the removed code. The Assistant drawer still restores saved patrol_assessment and patrol_configuration_failure sessions, so that compatibility path stays. The contracts described both handoffs as live producers, and described a Patrol summary card, assessment strip, assessment readout, score chip and header trust line that the page no longer renders. patrol-intelligence, ai-runtime, api-contracts, frontend-primitives, security-privacy, storage-recovery, agent-lifecycle and unified-resources now say what the code does: those handoffs survive only as saved sessions, the drawer, session list and API keep restoring them, rules for a returning summary card, strip or readout are conditional, and handoff_actions and adjacent-boundary clauses name the finding and attention handoffs that send them today. The run-history handoff clauses also claimed the browser sends a [Patrol Run Context] block and scoped resources; it sends the briefing and run identity, and internal/ai/patrol_assistant_handoff.go rebuilds the rest from the run ID. docs/AI.md (and its public mirror) told users the legacy operational score sits in a collapsed supporting-context section. That section and the score are gone; the section now points at Activity > Finding options and history, where check history lives. ai_runtime_docs_policy_test.py, its registered proof, now pins that location and rejects the retired claim. The same file had failed on main since2789a15fe5reworded the Patrol mode API sentence to "The API retains `autonomy_level` for compatibility" without updating its pin; the pin now matches that wording.
This commit is contained in:
@@ -121,6 +121,11 @@ class AIRuntimeDocsPolicyTest(unittest.TestCase):
|
||||
self.assertNotIn("Pulse Assistant should be replaced by", normalized_content)
|
||||
self.assertNotIn("MCP replaces Pulse Assistant", normalized_content)
|
||||
self.assertNotIn("Assistant can be removed", normalized_content)
|
||||
# The Patrol summary card and its supporting-context section are gone,
|
||||
# so the docs point at where check history actually lives.
|
||||
self.assertIn("Activity > Finding options and history", normalized_content)
|
||||
self.assertNotIn("legacy operational score remain", normalized_content)
|
||||
self.assertNotIn("collapsed supporting-context section", normalized_content)
|
||||
self.assertIn("- **Anthropic** (API key)", content)
|
||||
self.assertIn("Anthropic OAuth is not a supported runtime authentication method", normalized_content)
|
||||
self.assertIn("does not make Anthropic configured", normalized_content)
|
||||
@@ -304,7 +309,7 @@ class AIRuntimeDocsPolicyTest(unittest.TestCase):
|
||||
self.assertIn("## Patrol Modes", control_doc)
|
||||
self.assertIn("Patrol mode sets how far Pulse can go", control_doc)
|
||||
self.assertIn("**UI:** Patrol → Patrol mode", control_doc)
|
||||
self.assertIn("The API keeps the autonomy_level field name for compatibility.", control_doc)
|
||||
self.assertIn("The API retains `autonomy_level` for compatibility", control_doc)
|
||||
self.assertNotIn("Patrol Control Level", control_doc)
|
||||
self.assertNotIn("## Patrol Control Levels", control_doc)
|
||||
self.assertNotIn("Patrol control is configured on the **Patrol** page.", control_doc)
|
||||
|
||||
Reference in New Issue
Block a user