Generalise the projection parity guard beyond MCPServer #1004

Closed
opened 2026-10-27 13:38:38 +00:00 by sam · 0 comments
Owner

Found in archie-core-...#177 (commit a2a26c8d). internal/app/controlplane/runtime_config_test.go now has TestToolSettingsProjectionCarriesEveryMCPServerField, which reflects over every config.MCPServer field and fails if the tool-settings projection does not seed it and hand it back, with a commented allowlist (mcpServerFieldsLeftToTheFile) for fields deliberately left to the file.

The same hand-mirrored projection pattern exists next door: tool_settings.go:28-33 minimaxSettings mirrors config.MinimaxConfig field by field (with APIKey -> api_key_ref as a renamed surrogate) and is complete today, but a newly added MinimaxConfig field would fall through exactly as parallel_tool_calls did.

Fix direction: turn the guard into a table of (source struct, projection struct, allowlist) and cover every mirrored settings type, so the pattern cannot silently regress type by type. Also consider asserting that no projection type carries a JSON key absent from its source struct (the inverse direction the current guard already covers for MCPServer).

Close reason

Landed: the single-type projection parity guard is generalised in internal/app/controlplane/runtime_config_test.go into a table-driven source/projection check covering every mirrored settings type in both directions (no orphaned source field, no unexplained projection field); the GitHub mirror was closed with the red-first verification recorded there.


Imported from beads archie-core-1qp4 · GitHub #1177 · type bug · priority P3 · created 2026-09-21 · closed 2026-09-29

Found in archie-core-...#177 (commit a2a26c8d). internal/app/controlplane/runtime_config_test.go now has TestToolSettingsProjectionCarriesEveryMCPServerField, which reflects over every config.MCPServer field and fails if the tool-settings projection does not seed it and hand it back, with a commented allowlist (mcpServerFieldsLeftToTheFile) for fields deliberately left to the file. The same hand-mirrored projection pattern exists next door: tool_settings.go:28-33 minimaxSettings mirrors config.MinimaxConfig field by field (with APIKey -> api_key_ref as a renamed surrogate) and is complete today, but a newly added MinimaxConfig field would fall through exactly as parallel_tool_calls did. Fix direction: turn the guard into a table of (source struct, projection struct, allowlist) and cover every mirrored settings type, so the pattern cannot silently regress type by type. Also consider asserting that no projection type carries a JSON key absent from its source struct (the inverse direction the current guard already covers for MCPServer). ### Close reason Landed: the single-type projection parity guard is generalised in internal/app/controlplane/runtime_config_test.go into a table-driven source/projection check covering every mirrored settings type in both directions (no orphaned source field, no unexplained projection field); the GitHub mirror was closed with the red-first verification recorded there. --- _Imported from beads `archie-core-1qp4` · GitHub #1177 · type bug · priority P3 · created 2026-09-21 · closed 2026-09-29_
sam added the lowbug labels 2026-10-27 13:38:38 +00:00
sam self-assigned this 2026-10-27 13:38:38 +00:00
sam closed this issue 2026-10-27 13:38:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1004