Skip to content

Refactor parameter-heavy safe-update and package resolution APIs - #52982

Merged
pelikhan merged 5 commits into
mainfrom
copilot/lint-monster-refactor-parameter-counts
Aug 16, 2026
Merged

Refactor parameter-heavy safe-update and package resolution APIs#52982
pelikhan merged 5 commits into
mainfrom
copilot/lint-monster-refactor-parameter-counts

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Two custom-linter findings exceeded the configured parameter-count limit in safe-update enforcement and repository package extension resolution.

  • Safe-update enforcement

    • Add SafeUpdateOptions to group manifest, references, redirect, transition, and memory-validation inputs.
    • Update compiler and test call sites.
    EnforceSafeUpdate(SafeUpdateOptions{
        Manifest: oldManifest,
        SecretNames: bodySecrets,
        ActionRefs: bodyActions,
    })
  • Package extension resolution

    • Add repositoryPackageExtensionFilesOptions for repository, manifest, and inclusion inputs.
    • Preserve skill/agent resolution behavior while reducing the function signature to context plus options.

run: https://github.com/github/gh-aw/actions/runs/31914929251> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.2 AIC · ⌖ 6.93 AIC · ⊞ 8.7K ·

Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor functions to reduce parameter count Refactor parameter-heavy safe-update and package resolution APIs Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 23:03
@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 23:09
Copilot AI balanced review requested due to automatic review settings August 15, 2026 23:09
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Reviewed PR #52982 with ponytail-review lens: mechanical options-struct extraction to fix parameter-count lint violations (EnforceSafeUpdate, resolveRepositoryPackageExtensionFiles). Each new struct has 5-8 genuinely-used fields, single call site pattern is standard for reducing parameter count, no speculative/unused flexibility introduced. Lean already. Ship.

Generated by Ponytail Reviewer for #52982

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Completed PR review analysis for #52982; no GitHub write performed because I found no actionable review comments to submit.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-15T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable issues in changed lines
files_reviewed:
  - pkg/cli/add_package_manifest.go
  - pkg/workflow/compiler.go
  - pkg/workflow/compiler_threat_detection_formal_test.go
  - pkg/workflow/safe_update_enforcement.go
  - pkg/workflow/safe_update_enforcement_test.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.68 AIC · ⌖ 5.33 AIC · ⊞ 6.9K ·
Comment /review to run again

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.

Pull request overview

Refactors the two parameter-heavy APIs identified in #52813 while preserving existing safe-update and package-resolution behavior.

Changes:

  • Introduces options structs for safe-update enforcement and package extension resolution.
  • Updates compiler and test call sites to use the new APIs.
Show a summary per file
File Description
pkg/workflow/safe_update_enforcement.go Adds SafeUpdateOptions and refactors enforcement.
pkg/workflow/safe_update_enforcement_test.go Updates safe-update tests.
pkg/workflow/compiler.go Passes compiler inputs through the options struct.
pkg/workflow/compiler_threat_detection_formal_test.go Updates formal conformance tests.
pkg/cli/add_package_manifest.go Adds package-extension resolution options.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions github-actions Bot 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.

Clean refactor converting positional parameters to options structs for EnforceSafeUpdate and resolveRepositoryPackageExtensionFiles. All call sites and tests updated consistently. No logic changes detected. LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 14.7 AIC · ⌖ 7.01 AIC · ⊞ 5.6K

@github-actions github-actions Bot mentioned this pull request Aug 15, 2026

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /codebase-design — this is a clean, well-executed refactor. Approving with a few minor observations.

📋 Key Themes & Highlights

Key Themes

  • Struct consistency: SafeUpdateOptions is exported; repositoryPackageExtensionFilesOptions is unexported — intentional asymmetry but worth documenting.
  • Zero-value semantics: both option structs rely on Go zero values for omitted fields, which works correctly here, but the nil-vs-zero distinction for Manifest is load-bearing and slightly subtle.

Positive Highlights

  • ✅ Mechanical, behavior-preserving refactor with no logic changes
  • ✅ All call sites and test suites updated consistently
  • ✅ Named struct fields make call sites self-documenting
  • ✅ Security-critical tests (compiler_threat_detection_formal_test.go) all preserved and updated

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 22.8 AIC · ⌖ 8.87 AIC · ⊞ 7.7K
Comment /matt to run again

Adds a draft Architecture Decision Record documenting the decision to
consolidate parameter-heavy function signatures into options structs
(SafeUpdateOptions and repositoryPackageExtensionFilesOptions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (110 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/52982-options-struct-for-parameter-heavy-functions.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-52982: Options Structs for Parameter-Heavy Functions

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 0042-use-postgresql.md for PR #42).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · sonnet46 · 59 AIC · ⌖ 16.4 AIC · ⊞ 9K ·
Comment /review to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage for maintainer-ready follow-up:

Please refresh the branch if GitHub allows it and run the pr-finisher skill before handing this PR back to maintainers.

Outstanding maintainer-facing follow-up (newest first):

Failed checks from the compact candidate set:

  • None listed.

Branch update was requested automatically for this run when GitHub allows it.
Run context: https://github.com/github/gh-aw/actions/runs/31914929251

Generated by 👨🍳 PR Sous Chef
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.2 AIC · ⌖ 6.93 AIC · ⊞ 8.7K ·
Comment /souschef to run again

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

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage for maintainer-ready follow-up:

Please refresh the branch if GitHub allows it and run the pr-finisher skill before handing this PR back to maintainers....

Done — ADR-52982 is finalized (status: Accepted) and linked in the PR body so the Design Decision Gate can re-evaluate. Ran make fmt/make lint/targeted go test locally: no unrelated changes needed, and the one pre-existing fmt-check-cjs prettier failure on create_pr_review_comment.cjs predates this branch and is unrelated to this refactor.

Maintainer-facing summary: this refactor remains fully behavior-preserving — EnforceSafeUpdate and resolveRepositoryPackageExtensionFiles keep identical internal logic/security semantics, only the parameter surface changed. No ADR-only follow-up remains outstanding.

Note: no gh/CI re-trigger was available from this session (no GH_TOKEN for gh CLI), so CI on the latest HEAD is unverified and needs a maintainer re-trigger before merge.

Copilot AI requested a review from gh-aw-bot August 15, 2026 23:45
@pelikhan
pelikhan merged commit f6236fd into main Aug 16, 2026
29 checks passed
@pelikhan
pelikhan deleted the copilot/lint-monster-refactor-parameter-counts branch August 16, 2026 00:04
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.0

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.

[lint-monster] LintMonster: parameter-count options-struct follow-ups (2 findings)

4 participants