Skip to content

[Code Quality] Add log warning for silent JSON skip in compiler_safe_outputs include-merge loop #48006

Description

@github-actions

Description

pkg/compiler/compiler_safe_outputs.go silently ignores invalid JSON in its include-merge loop with a bare continue and no log or error propagation. This means malformed, empty, or truncated include files are silently dropped — creating hard-to-debug behavior where safe-output includes are silently missing.

This was flagged in the Daily Compiler Code Quality report as a Medium-priority issue reducing the file score from a potential 95+ to 88/100.

Suggested Changes

  1. Replace the bare continue in the include-merge loop with a log.Warn or log.Debug call that includes:
    • The file path of the invalid include
    • The JSON parse error message
  2. Consider whether to return an error or just warn (recommend warn + continue for resilience, error for strictness)
  3. Add a unit test to verify the warning is emitted on invalid JSON

Files Affected

  • pkg/compiler/compiler_safe_outputs.go (the silent continue in the include-merge loop)
  • pkg/compiler/compiler_safe_outputs_test.go (add/update test for invalid JSON behavior)

Success Criteria

  • Invalid/empty/truncated JSON include files log a warning with file path and error
  • Valid include files still merge correctly (no regression)
  • make test-unit passes
  • The silent-skip path is no longer undetectable in logs

Priority

Medium — prevents silent data loss in safe-output compilation pipeline; improves debuggability

Source

Extracted from [daily-compiler-quality] Daily Compiler Code Quality Report - 2026-07-25

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · sonnet46 · 58.9 AIC · ⌖ 5.58 AIC · ⊞ 7.1K · ◷

  • expires on Jul 26, 2026, 5:14 AM UTC-08:00

Activity

  1. github-actions commented on Jul 26, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-07-26T13:14:37.142Z.

    Closed by Workflow

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions