Skip to content

[deep-report] Document panic() contract for 8 embed-guarded lazy-load panic sites in pkg/workflow/pkg/actionpins #54316

Description

@github-actions

Description

The Error Handling Consistency & Panic Safety report (discussion #54241, 2026-08-20) found 8 panic() call sites in pkg/workflow/pkg/actionpins that fire only if lazily-loaded, go:embed-ed JSON/config data fails to unmarshal — a condition that should be build-time-impossible. Verified live: pkg/workflow/model_aliases.go:91,148, pkg/actionpins/data.go:74,90,98, pkg/workflow/agentic_engine.go:557, pkg/workflow/permissions_toolset_data.go:44, pkg/workflow/pi_engine.go:149, pkg/workflow/mcp_setup_gateway.go:133, pkg/workflow/mcp_setup_safe_outputs.go:59. These currently rely only on the panic-in-library-code linter's incidental exemption for init-like patterns rather than an explicit documented contract, so a future refactor could unintentionally introduce a runtime panic path reachable from user input.

Expected Impact

Makes an implicit "should never happen" invariant explicit and linter-consistent, reducing the risk that a future change accidentally routes dynamic (non-embedded) data through one of these panic paths.

Suggested Agent

New Agent — add a one-line doc comment immediately above each panic() call stating it's an intentional, build-time-guarded invariant (matching the pattern in pkg/linters/panic-in-library-code/testdata/.../panicinlibrarycode.go around line 86). Verify each package already has a test that unmarshal-validates its embedded data file; add one if missing so a corrupted embedded file fails go test in CI rather than only surfacing as a runtime panic. Do not change panic behavior itself.

Estimated Effort

Medium (1-4 hours)

Data Source

DeepReport Intelligence Briefing analysis of discussion #54241 (Repository Quality Improvement Report - Error Handling Consistency & Panic Safety, 2026-08-20).

Generated by 🔬 Deep Report · agent · 163.9 AIC · ⌖ 8.4 AIC · ⊞ 11.9K ·

  • expires on Aug 22, 2026, 10:32 AM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions