Skip to content

Commit 0882866

Browse files
aklofasclaude
andcommitted
Fix KH-315: mark hierarchy_context and related fields OPTIONAL in --schema
Harness --schema-vs-real-output regression test flagged that hierarchy_context is documented in the schematic analyzer's --schema output but absent from most real outputs. It's only emitted when analyzing a sub-sheet with hierarchy context resolved (rare in the corpus — most projects are flat). Collapse the hierarchy_context nested doc to a single inline description prefixed OPTIONAL, and clarify that hierarchy_warning, _redirected_from, and _stale_file_warning are likewise optional. Also add project_settings to the optional sections list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc81205 commit 0882866

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

skills/kicad/scripts/analyze_schematic.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9056,18 +9056,11 @@ def _get_schema():
90569056
"erc_warnings": "[string]",
90579057
},
90589058
"connectivity_issues": {"single_pin_nets": "[net_name]", "multi_driver_nets": "[net_name]", "floating_nets": "[net_name]"},
9059-
"_optional_sections": "power_budget, power_sequencing, pdn_impedance, sleep_current_audit, usb_compliance, inrush_analysis, bom_optimization, test_coverage, assembly_complexity, sheets (multi-sheet only), missing_info, bom_lock",
9060-
"hierarchy_context": {
9061-
"root_schematic": "string — root .kicad_sch filename",
9062-
"target_sheet": "string — this sub-sheet filename",
9063-
"sheets_in_project": "[string — all sheet filenames]",
9064-
"cross_sheet_nets": "{label_name: {external_components: [{reference, value, lib_id, type, sheet}], is_power_rail: bool, connected_sheets: [string]}}",
9065-
"project_power_rails": "[string — power rail net names]",
9066-
"reference_corrections_applied": "int",
9067-
},
9068-
"hierarchy_warning": "string — present when sub-sheet detected without root (optional)",
9069-
"_redirected_from": "string — original filename when sub-sheet was redirected to root (optional)",
9070-
"_stale_file_warning": "string — present when input file is not in the project sheet tree (optional)",
9059+
"_optional_sections": "power_budget, power_sequencing, pdn_impedance, sleep_current_audit, usb_compliance, inrush_analysis, bom_optimization, test_coverage, assembly_complexity, sheets (multi-sheet only), missing_info, bom_lock, project_settings",
9060+
"hierarchy_context": "OPTIONAL — only present when analyzing a sub-sheet with hierarchy context resolved. Shape: {root_schematic, target_sheet, sheets_in_project: [string], cross_sheet_nets: {label: {external_components, is_power_rail, connected_sheets}}, project_power_rails: [string], reference_corrections_applied: int}",
9061+
"hierarchy_warning": "OPTIONAL string — present when sub-sheet detected without root",
9062+
"_redirected_from": "OPTIONAL string — original filename when sub-sheet was redirected to root",
9063+
"_stale_file_warning": "OPTIONAL string — present when input file is not in the project sheet tree",
90719064
}
90729065

90739066

0 commit comments

Comments
 (0)