Description
buildSafeJobs appends job names while iterating a Go map, so the resulting needs: list on the conclusion job is produced in non-deterministic order. Verified on main: pkg/workflow/safe_jobs.go:163-164 declares var safeJobNames []string then for jobName, jobConfig := range data.SafeOutputs.Jobs with no sort before appending at line 313. Map iteration order is randomized in Go, so workflows with 2+ safe-jobs can compile to different .lock.yml output across runs, breaking compilation idempotence.
Fix
Sort the safe-job keys before iterating (mirror the established pattern already used at jobs.go:299-303 with sort.Strings, mcp_renderer_github.go:201 sortedMapKeys(), and run_step_sanitizer.go:131 slices.SortFunc). Add/extend a round-trip test with 2+ safe-jobs to lock it in.
Expected Impact
Removes a confirmed compilation-idempotence gap (no-op recompiles producing diffs), reducing stale-lock-file churn and spurious recompile PRs.
Suggested Agent
Daily Compiler Code Quality / copilot-swe-agent.
Estimated Effort
Quick (< 1 hour).
Data Source
DeepReport 2026-06-19 (run 27835256431); Repository Quality report #40314.
Generated by 🔬 DeepReport - Intelligence Gathering Agent · 277.2 AIC · ⌖ 19.5 AIC · ⊞ 10.5K · ◷
Description
buildSafeJobsappends job names while iterating a Go map, so the resultingneeds:list on the conclusion job is produced in non-deterministic order. Verified onmain:pkg/workflow/safe_jobs.go:163-164declaresvar safeJobNames []stringthenfor jobName, jobConfig := range data.SafeOutputs.Jobswith no sort before appending at line 313. Map iteration order is randomized in Go, so workflows with 2+ safe-jobs can compile to different.lock.ymloutput across runs, breaking compilation idempotence.Fix
Sort the safe-job keys before iterating (mirror the established pattern already used at
jobs.go:299-303withsort.Strings,mcp_renderer_github.go:201sortedMapKeys(), andrun_step_sanitizer.go:131slices.SortFunc). Add/extend a round-trip test with 2+ safe-jobs to lock it in.Expected Impact
Removes a confirmed compilation-idempotence gap (no-op recompiles producing diffs), reducing stale-lock-file churn and spurious recompile PRs.
Suggested Agent
Daily Compiler Code Quality / copilot-swe-agent.
Estimated Effort
Quick (< 1 hour).
Data Source
DeepReport 2026-06-19 (run 27835256431); Repository Quality report #40314.