Repository navigation
fix: reject malformed HTTP error constants - #14
Conversation
🤖 Automated Review PanelReviewer A — GPT-5.6 TerraAPPROVE — no correctness blockers remain.
Reviewer B — Gemini 3 Flash (OpenRouter)APPROVE (minor non-blocking notes only).
Resolution and evidenceThe first Reviewer A pass identified one real issue: optional string constants lacked source-path context. It was fixed before this final dual-model confirmation by wrapping semantic definition validation in the loader's source context and adding a regression assertion. The real Final verified gates: All passed; the full suite contains 51 codegen tests, 14 Notes-surface tests, and 6 security-scan tests. The committed HTTP-error fixture's existing two-write byte-determinism test also remained green. |
Auto-Merge GateConfidence: 0.93 The implementation directly satisfies COD-508: omitted Independent checks observed: CI Scope limits reviewed: two files only; no release, deployment, credential, consumer, generated-artifact, or runtime dispatch change. |
Summary
Closes COD-508 by making typed HTTP-error
constdeclarations strict at the real YAML loader boundary:constas dynamicNone;null,~, empty YAML values, booleans, numbers, sequences, and mappings before generation;Option<String>model;No generated fixture or public surface changed for valid definitions.
Evidence
Baseline before the fix, through
hydra_core::load_api_definition, incorrectly acceptedconst: nullasconstant=None.The new table-driven loader test derives temporary definitions from the committed HTTP-error fixture. It covers required and optional fields, omitted/dynamic behavior, escaped/empty/quoted scalar strings, all malformed YAML scalar/collection forms, named source diagnostics, and the existing required-only constant rule.
A real CLI boundary check now rejects an optional string constant before write with:
Verification
All commands passed. The existing HTTP-error fixture's two temporary generated writes remained byte-identical, and both committed example artifact checks reported current output.
Scope
This is a bounded loader-validation correction only: no release, tag, dependency, consumer adoption, configuration, generated artifact, CLI/MCP behavior, SSE behavior, or runtime dispatch change.