[repository-quality] π― Repository Quality Improvement β Import Pipeline Reliability: Silent Unmarshal Errors (2026-06-24) #41228
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
π― Repository Quality Improvement Report - Import Pipeline Reliability
Analysis Date: 2026-06-24
Focus Area: Import Pipeline Reliability β Silent Unmarshal Errors & Serialization Overhead
Strategy Type: Custom (random=44, 0β59 tier)
Custom Area: Yes β YAML-string-as-IPC is unique to this codebase
Executive Summary
The workflow compilation pipeline stores five step categories as raw YAML strings in
ImportsResult, forcing up to 10 YAML operations per compile (Unmarshal+SliceToSteps+StepsToSlice+Marshal per category). More critically, 31 production sites use the silentif err := yaml.Unmarshal(...); err == nilpattern β malformed imported YAML silently produces empty step lists with no error to the user.The highest-risk sites are
workflow_builder.go(5 instances) andcompiler_orchestrator_engine.go(5 instances). Fixing these to propagate errors is low-effort and high-impact. A companion linter prevents recurrence.Full Analysis
Current State
if err := yaml.Unmarshal(...); err == nilin productionworkflow_builder.gocompiler_orchestrator_engine.gopkg/workflowImportsResultstep fields using YAML string transportinit()eager JSON loads inpkg/workflowStrengths
SliceToSteps/MapToStepavoid JSON round-trips via directmap[string]anyextractionb.ReportAllocs()and-benchmemSilent Unmarshal Pattern
Same pattern Γ5 in
compiler_orchestrator_engine.godrops engine/runtime config silently.YAML Round-Trip in ImportsResult
Each of 5 step fields (
MergedSteps,CopilotSetupSteps,MergedPreSteps,MergedPreAgentSteps,MergedPostSteps) traverses:string β Unmarshal β []any β SliceToSteps β []*WorkflowStep β applyPins β StepsToSlice β []any β Marshal β string. Replacing thosestringfields with[]map[string]anyeliminates all 10 YAML operations.Startup Eager Loads
Three
init()inpkg/workflowunmarshal JSON at package import:domains.go(~30 KB),gh_cli_permissions.go(~50 KB + map build),github_tool_to_toolset.go(~10 KB). Non-compile commands (gh aw env,gh aw audit) pay this cost unnecessarily.π€ Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Task 1: Propagate unmarshal errors in workflow_builder.go
Priority: High | Effort: Small
Description: 5
if err := yaml.Unmarshal(...); err == nilblocks inprocessAndMergeStepssilently discard steps on parse failure.Acceptance Criteria:
return fmt.Errorf("failed to parse <field>: %w", err)MergedStepsYAML returns an error fromprocessAndMergeStepsmake testpassesCode Region:
pkg/workflow/workflow_builder.goTask 2: Propagate unmarshal errors in compiler_orchestrator_engine.go
Priority: High | Effort: Small
Description: 5 silent
if err == nilunmarshal patterns incompiler_orchestrator_engine.gosilently drop engine/runtime configuration.Acceptance Criteria:
make testpassesCode Region:
pkg/workflow/compiler_orchestrator_engine.goTask 3: Add
silentyamlunmarshallinterPriority: Medium | Effort: Medium
Description: Linter to flag
if err := yaml.Unmarshal(...); err == nilanti-pattern. Register incmd/linters/main.goandspec_test.go.Acceptance Criteria:
pkg/linters/silentyamlunmarshal/withanalysistesttestscmd/linters/main.goandcmd/linters/spec_test.gopkg/linters/doc.go//nolint:silentyamlunmarshal+ justificationmake lintpassesCode Region:
pkg/linters/silentyamlunmarshal/,cmd/linters/main.go,pkg/linters/doc.goTask 4: Replace ImportsResult step YAML strings with typed slices
Priority: Medium | Effort: Large
Description: Change 5
stringfields inImportsResultto[]map[string]any, eliminating 10 YAML operations per compilation.Acceptance Criteria:
[]map[string]anyinpkg/parser/import_processor.goyaml.Marshalfor these fields)workflow_builder.go:processAndMergeStepsskips initialyaml.Unmarshalfor these fieldsBenchmarkStepMergingwithb.ReportAllocs()added and shows improvementmake testpasses; golden tests unchangedCode Region:
pkg/parser/import_processor.go,pkg/workflow/workflow_builder.goTask 5: Convert workflow init() to sync.Once lazy init
Priority: Low | Effort: Small
Description: Convert 3 eager
init()inpkg/workflowtosync.Onceso non-compile commands avoid startup cost.Acceptance Criteria:
init()removed fromdomains.go,gh_cli_permissions.go,github_tool_to_toolset.gosync.Once+ getter accessed lazily from call sitesmake testpassesCode Region:
pkg/workflow/domains.go,pkg/workflow/gh_cli_permissions.go,pkg/workflow/github_tool_to_toolset.goπ Historical Context
Last 5 Focus Areas
π Success Metrics
References:
[Β§28102213814]Generated by Repository Quality Improvement Agent
Beta Was this translation helpful? Give feedback.
All reactions