Harden gojq walk_schema single-output contract and document jq binding safety - #10625
Conversation
walk_schema single-output contract and document jq binding safety
There was a problem hiding this comment.
Pull request overview
Strengthens gojq safety documentation and regression coverage without changing runtime behavior.
Changes:
- Expands
walk_schemasingle-output tests across scalar, null, empty, and nested inputs. - Documents
$ENVisolation and safe runtime variable binding.
Show a summary per file
| File | Description |
|---|---|
internal/middleware/README.md |
Documents jq security controls. |
internal/middleware/jqschema_test.go |
Broadens single-output contract coverage. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Part B note: Gateway exposes only 22 read-only tools; all write tool calls return MCP error Part D/E note: Overall: PASS References: §30827215996
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Notes:
Overall: PASS References: §30827217196
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Result file: References: §30827216929
|
The gojq review found no functional or security gaps in current usage, but flagged two high-value follow-ups: lock down
walk_schema’s single-output invariant with stronger coverage and document variable-binding safety alongside existing$ENVhardening. This PR addresses those targeted follow-ups without changing runtime behavior.Contract coverage:
walk_schemamust emit exactly one valueTestApplyJqSchema_SingleOutputContractto cover broader/adversarial JSON shapes (scalars,nil, empty collections, mixed nested structures).Security documentation: bind values, don’t interpolate
internal/middleware/README.mdto describe both controls together:$ENVdisabled viaWithEnvironLoader(...)CompileToolResponseFilterWithVars/gojq.WithVariables+RunWithContext(...)args