Skip to content

[deep-report] Sort safeJobNames for deterministic conclusion needs: ordering #40334

Description

@github-actions

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 ·

  • expires on Jun 21, 2026, 7:56 AM UTC-08:00

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions