ARCH: добавить policy gate ответа MCP discovery

This commit is contained in:
2026-04-20 12:06:22 +03:00
parent 58c1358960
commit c744308223
7 changed files with 515 additions and 2 deletions
@@ -970,6 +970,39 @@ Validation:
- `npm test -- assistantMcpDiscoveryResponseCandidate.test.ts assistantMcpDiscoveryRuntimeEntryPoint.test.ts assistantMcpDiscoveryDebugAttachment.test.ts assistantMcpDiscoveryAnswerAdapter.test.ts assistantMcpDiscoveryPilotExecutor.test.ts` passed 17/17;
- `npm run build` passed.
## Progress Update - 2026-04-20 MCP Discovery Response Policy Gate
The thirteenth implementation slice of Big Block 5 added the first explicit guarded answer-replacement policy:
- `assistantMcpDiscoveryResponsePolicy.ts`
- `assistantMcpDiscoveryResponsePolicy.test.ts`
- living-chat runtime integration for unsupported current-turn meaning boundaries.
This is the first slice where MCP discovery can affect the user-facing answer, but only through a narrow policy gate.
The policy can apply a discovery candidate only when all of the following are true:
- the current living-chat branch is `unsupported_current_turn_meaning_boundary` or its deterministic boundary reply;
- the runtime meta contains a valid `assistant_mcp_discovery_runtime_entry_point_v1` contract;
- the candidate status is one of `ready_for_guarded_use`, `checked_sources_only_candidate`, or `clarification_candidate`;
- `eligible_for_future_hot_runtime=true`;
- the candidate has non-empty user-facing text;
- the text does not expose internal primitive/query/runtime mechanics.
When the gate does not pass, the old honest boundary answer is preserved.
The living-chat debug surface now includes:
- `mcp_discovery_response_policy_v1`;
- `mcp_discovery_response_candidate_v1`;
- `mcp_discovery_response_applied`;
- the standard MCP discovery entry-point attachment fields on chat-path output.
Validation:
- `npm test -- assistantMcpDiscoveryResponsePolicy.test.ts assistantLivingChatRuntimeAdapter.test.ts assistantMcpDiscoveryResponseCandidate.test.ts assistantMcpDiscoveryDebugAttachment.test.ts` passed 19/19;
- `npm run build` passed.
## Execution Rule
Do not implement this plan as: