Skip to content

Recognize verified compiler-owned checkout cleanup in artipacked lint - #71806

Merged
pelikhan merged 8 commits into
mainfrom
pelikhan-refactored-pancake
Oct 25, 2026
Merged

pelikhan merged 8 commits into
mainfrom
pelikhan-refactored-pancake

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

artipacked warns on compiler-generated agent checkouts using force-clean-git-credentials: true, even when the next step removes credentials and verifies their absence before agent execution. This fixes that false positive without changing checkout authentication or credential lifecycle.

Approach

  • Capture compiler-emitted agent checkout blocks for the current compilation and reuse the exact-block matcher introduced in Narrowly exempt compiler-generated PR checkouts from artipacked warnings #71783 (now merged).
  • Exempt only warning-level artipacked findings inside a uniquely matching block when the immediately following step exactly matches compiler-owned cleanup plus verification.
  • Preserve warnings for authored lookalikes, ambiguous copies, modified or conditional cleanup, missing verification, and intervening steps, including sparse-checkout repair. Standalone lint and unrelated diagnostics remain unchanged.
  • Update the linter reference and compiler threat-detection specification.

Validation

Passed make build, make fmt, scoped Go lint (zero issues), and:

go test ./pkg/workflow -run 'TestCompilerLint|TestCheckout|TestKnownAction' -count=1

Regressions cover provenance boundaries, multi-repository token preservation, compiler reuse, unchanged standalone lint, and identical runtime YAML with lint enabled or disabled. No corpus workflows were executed.

make agent-report-progress passed impacted tests but was not fully green: its Go lint initially hit shared-runner contention (the separate scoped run passed), and custom lint reports pre-existing unchecked fmt.Fprintf and slice accesses on unchanged lines in compiler_yaml_checkout.go. The new implementation has no custom-lint findings.

pelikhan and others added 6 commits October 24, 2026 18:41
Split the checkout lint concern from #71711. Preserve runtime authentication and standalone lint behavior, with provenance-scoped exceptions and independent regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document exact-block provenance, exclusion boundaries, standalone lint behavior, and regression evidence in specification version 1.0.70.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve both compiler specification amendments, assigning the checkout lint exception version 1.0.71 after main's admission-gating version 1.0.70.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep standalone lint and runtime checkout authentication unchanged. Require current compiler provenance, a unique exact block, and immediate canonical cleanup plus verification.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 25, 2026 04:02
Copilot AI max review requested due to automatic review settings October 25, 2026 04:02
Preserve verified agent checkout cleanup alongside finalized safe-output provenance handling and upstream release checkout credential hardening. Reconcile specification history with the merged base.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The credential-warning exemption can apply to checkouts that cleanup and verification never inspect.

1 open issue
What changed in this PR

Extends compiler-only artipacked filtering to recognize generated agent checkouts followed immediately by credential cleanup and verification, building on the existing PR-checkout exception.

Changes:

  • Tracks per-compilation checkout provenance and requires unique, exact block matches.
  • Adds regressions for ownership boundaries, multiple repositories, compiler reuse, and unchanged runtime YAML.
  • Documents the compiler-only exemptions and their security constraints.
File Description
specs/​compiler-threat-detection-spec.md Defines checkout-exemption requirements and compatibility versions.
specs/​compiler-threat-detection-changelog.md Records the PR and agent checkout exemptions.
pkg/​workflow/​compiler_yaml.go Resets checkout provenance between compilations.
pkg/​workflow/​compiler_yaml_checkout.go Captures generated agent checkout blocks.
pkg/​workflow/​compiler_types.go Stores compiler-owned checkout provenance.
pkg/​workflow/​compiler_safe_outputs_steps.go Captures the generated PR checkout/authentication block.
pkg/​workflow/​compiler_lint.go Filters eligible warning-level checkout diagnostics.
pkg/​workflow/​compiler_lint_test.go Tests generated PR checkouts and provenance reset.
pkg/​workflow/​compiler_lint_checkouts.go Matches unique compiler-owned PR checkout blocks.
pkg/​workflow/​compiler_lint_checkouts_test.go Tests PR ownership boundaries and per-repository tokens.
pkg/​workflow/​compiler_lint_checkout_cleanup.go Determines agent checkout cleanup exemptions.
pkg/​workflow/​compiler_lint_checkout_cleanup_test.go Tests cleanup eligibility, reuse, and runtime YAML stability.
docs/​src/​content/​docs/​reference/​workflow-linters.md Explains compiler-only artipacked exemptions.

Review effort: Max

Comment thread pkg/workflow/compiler_lint_checkout_cleanup.go
Require statically provable workspace-relative paths within the cleanup and verification scripts' maxdepth 15 limit. Cover config depth 15 versus 16, normalized paths and unresolved path semantics without altering runtime cleanup.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/compiler_lint_checkout_cleanup.go:70): A valid checkout path with 14 directory components puts .git/config at depth 16, beyond the find -maxdepth 15 used by both credential cleanup and verify_git_credentials.sh. Both scripts can succeed without touching that config, but this branch still hides its artipacked warning. Keep the warning for paths outside discovery coverage, including paths whose depth cannot be determined statically, and add a deep-path regression. - Recognize verified compiler-owned checkout cleanup in artipacked lint #71806 (comment)

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 78c2db2
Sous-chef work: 1c7bc26a137bc23eec1d868128376ee92d9064b4c613761db38cbb75a3f0d245
Sous-chef state: 33dcf60711b9c0fbe961ea4a315a7f4f465328855a1551fc1b84a7f1ff240d71

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · ~4 AIC · ⌖ ~9 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit c17bde4 into main Oct 25, 2026
47 of 48 checks passed
@pelikhan
pelikhan deleted the pelikhan-refactored-pancake branch October 25, 2026 04:54

Copilot AI commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

PR #71806 merged into main as c17bde4 during this pass. The depth-limit fix and deep/dynamic-path regressions are already included via e82a972, and the linked review thread is answered and resolved. No further branch changes are needed; I did not trigger CI.

Copilot stopped work on behalf of gh-aw-bot due to an error October 25, 2026 04:55
Copilot AI requested a review from gh-aw-bot October 25, 2026 04:55
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.93.4

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants