Repository navigation
Centralize DIFC Phase 5 pipeline wiring - #16927
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The Phase 5 tests lack a regression case verifying that the helper preserves a propagate-mode evaluator’s capability ceiling and keeps out-of-scope collection items filtered.
1 open issue
What changed in this PR
Centralizes DIFC Phase 5 filtering and result conversion in a shared guard helper, removing repeated wiring from the HTTP proxy and MCP tool and prompt handlers.
Changes:
- Adds
guard.RunPipelinePhase5alongside the existing phase helpers. - Migrates all three callers while preserving their error, response, and HTTP status handling.
- Adds regression tests for label and operation forwarding, enforcement modes, nil/simple data, and conversion errors.
| File | Description |
|---|---|
internal/server/prompt_call.go |
Uses the shared helper for prompt responses. |
internal/server/backend_call.go |
Uses the shared helper for tool responses. |
internal/proxy/handler.go |
Uses the shared helper for proxy responses. |
internal/guard/pipeline.go |
Adds the Phase 5 wrapper and updates pipeline comments. |
internal/guard/pipeline_test.go |
Adds focused Phase 5 regression coverage. |
Review effort: Max (adaptive)
Add a test for RunPipelinePhase5 to check secrecy propagation. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write of any kind leaked through any surface in this run.
|

Proxy, tool, and prompt handlers repeat the same six-argument Phase 5 call. This refactor centralizes that wiring alongside the existing Phase 4 and Phase 6 helpers.
guard.RunPipelinePhase5, extracting agent labels and operation fromPipelinePreResult, and migrate all three handlers: