Skip to content

[fp-enhancer] Improve pkg/actionpins: extract pure helpers, eliminate duplicate init#27523

Merged
pelikhan merged 4 commits intomainfrom
fp-enhancer/actionpins-functional-helpers-5fc1192535e0e569
Apr 21, 2026
Merged

[fp-enhancer] Improve pkg/actionpins: extract pure helpers, eliminate duplicate init#27523
pelikhan merged 4 commits intomainfrom
fp-enhancer/actionpins-functional-helpers-5fc1192535e0e569

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Functional/immutability improvements to pkg/actionpins as part of the round-robin FP enhancer cycle. Next package: pkg/agentdrain.

Three targeted refactors were applied to improve clarity, testability, and reduce mutation duplication — all with zero behavior change.


Changes

1. Extract buildByRepoIndex() — pure function from sync.Once closure

Before: The logic to group and sort pins by repository was embedded inside the sync.Once initializer, mixing concerns and making it untestable in isolation.

After: Extracted as a standalone pure function that takes []ActionPin and returns map[string][]ActionPin, sorted version-descending per repo. The sync.Once closure now reads cleanly.

2. Extract countPinKeyMismatches() — validation logic out of init

Before: Key/version mismatch counting used a mutable mismatchCount variable iterated inline inside sync.Once.

After: Extracted as a focused function that iterates entries and logs each mismatch, returning the count. The call site collapses to one conditional line.

3. Extract initWarnings() — eliminate two duplicate lazy-init blocks

Before: ResolveActionPin duplicated if ctx.Warnings == nil { ctx.Warnings = make(map[string]bool) } in two separate code paths.

After: Single initWarnings(ctx) helper called at each site, making the intent explicit and the duplication gone.


Benefits

Improvement Safety Clarity Testability
buildByRepoIndex extraction ✅ Pure, no side effects ✅ Closure is simpler ✅ Independently testable
countPinKeyMismatches extraction ✅ Isolated validation ✅ Init path is cleaner ✅ Separately verifiable
initWarnings extraction ✅ No missed nil-init ✅ Removes duplication

Testing

  • ✅ All existing tests pass (go test ./pkg/actionpins/)
  • ✅ Code formatted (gofmt -l reports no changes)
  • ✅ No behavior changes — pure refactoring

Round-Robin Progress

  • Processed: pkg/actionpins (1/22)
  • Next run: pkg/agentdrain

Generated by Functional Pragmatist · ● 1.4M ·

  • expires on Apr 22, 2026, 10:04 AM UTC

…rnings init

- Extract buildByRepoIndex() as a pure function from sync.Once closure,
  grouping and sorting pins by repo. Improves testability and separates
  concerns from the initialization path.
- Extract countPinKeyMismatches() to validate pin entry consistency outside
  the initialization closure, making the logic independently inspectable.
- Extract initWarnings() to eliminate two identical lazy-init blocks for
  ctx.Warnings in ResolveActionPin, reducing mutation duplication.

All existing tests pass. No behavior changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot merge main and add tests

Copilot AI and others added 2 commits April 21, 2026 13:51
…s-functional-helpers-5fc1192535e0e569

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

@copilot merge main and add tests

Done: merged origin/main and added focused tests for the extracted pkg/actionpins helpers in commit 4766e7d (merge commit: ec1c731).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login &#43; &#34;/&#34; &#43; .name ntdrain.test GOINSECURE /go-yaml GOMODCACHE ntdrain.test 5430�� se 3039877/b022/vet.cfg .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 537519715 7LFx/9x5EhNlMwHDxpQFH7LFx 64/pkg/tool/linux_amd64/link GOINSECURE contextprotocol/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/link -c 59/001/test-inlined-imports-enabled-with-body-content.md log ortcfg.link --format=%H:%ct GOWORK 64/bin/go 9Ym34G_sfJyM6o-Ioz/mT-tLcfK0hMgkSLlQ1ZG/V_z3kiodremote (http block)
    • Triggering command: /usr/bin/gh gh repo view owner/repo env 537519715 .cfg util.test GOINSECURE contextprotocol/rev-parse GOMODCACHE util.test 5430�� 3039877/b394/_pkg_.a log ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe -n1 --format=format:remote --end-of-options-v ache/go/1.25.8/x64/pkg/tool/linurev-parse (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json age/common.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name 97335b7ccfaa2b19GOINSECURE GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv --paginate repos/{owner}/{repo}/actions/runs/1/artifacts /usr/bin/gh .artifacts[].namgit .cfg 64/pkg/tool/linu--show-toplevel gh repo�� view owner/test-repo /usr/bin/git 392284176/.githunode oYmy/n_pwg_VDfKQ/opt/hostedtoolcache/node/24.14.1/x64/bin/npm ache/go/1.25.8/xinstall git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq [.object.sha, .object.type] | @tsv GOMODCACHE go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git /001/test-inlinenode GO111MODULE 64/pkg/tool/linuinstall git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv ansitiveImports1373780412/001 x_amd64/compile ache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/vet ache/node/24.14.1/x64/bin/node s-29�� ere Test User /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq [.object.sha, .object.type] | @tsv --show-toplevel -tests /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv se 3039877/b101/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p syscall/js -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git 3039877/b398/_pktr zUvD/O0MXJnxKO-H\n .cfg git rev-�� --show-toplevel ache/go/1.25.8/x12346 /usr/bin/git 4326-36986/test-git -trimpath ache/go/1.25.8/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git -bool -buildtags /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git r-test424288011/git config /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/compile git init�� GOMODCACHE x_amd64/compile ache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/vet ache/node/24.14.1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq [.object.sha, .object.type] | @tsv --bare --initial-branch=develop /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript70246712/001/test-inlined-imports-enabled-with-body-contgit pUs8qTQzYq54 /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel ache/go/1.25.8/x64/pkg/tool/linu-buildtags /usr/bin/git CommaSeparatedCogit 3039877/b222/vetcheckout 64/pkg/tool/linu-b git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a stmain.go x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq [.object.sha, .object.type] | @tsv --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linurev-parse /usr/bin/git 5507-65150/test-git -trimpath 1/x64/bin/node git rev-�� --show-toplevel go /usr/bin/git SameOutput284713git GO111MODULE /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json ag.go x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/compile GOINSECURE GOMOD bytealg/compare_--show-toplevel x_amd64/compile env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/compile /usr/bin/git le-frontmatter.mgit .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git -json .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git mLsRemoteWithReagit mLsRemoteWithRearev-parse 64/bin/go git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel x_amd64/vet /usr/bin/infocmp -json .cfg 64/pkg/tool/linu--show-toplevel infocmp -1 xterm-color 64/pkg/tool/linux_amd64/vet /usr/bin/git ty-test.md .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv t0 --jq (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq [.object.sha, .object.type] | @tsv --show-toplevel GOPROXY (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv bfed7307786d15d1-s st/suppress-warn-w $name) { hasDiscussionsEnabled } } ion-test..token-git git ndor/bin/git st/dist/workers/forks.js show�� --verify 840f970a de_modules/.bin/node -m (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq [.object.sha, .object.type] | @tsv bfed7307786d15d13e0d7ed643a1298ade531d07..full-mode-branch 840f970a..HEAD tions/setup/node_modules/.bin/git ion-test..token-/bin/sh Initial commit e_modules/.bin/ggit add . git rev-�� HEAD 840f970a..HEAD n-dir/node -m ings.cjs 86_64/git git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv github.event.inputs.branch -tests /usr/bin/git DseGpepMC .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --git-dir 64/pkg/tool/linux_amd64/vet /usr/bin/git 8545894/b148/_pkgit .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq [.object.sha, .object.type] | @tsv --show-toplevel go /usr/bin/git ty-test.md GO111MODULE 64/bin/go git rev-�� --show-toplevel ortcfg /usr/bin/git 1243926c601af34bgit GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv --show-toplevel -extld=gcc /usr/bin/git -json GO111MODULE x_amd64/compile git -C s/test.md rev-parse /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json t/format.go x_amd64/compile node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv git-upload-pack &#39;/tmp/TestParseDefaultBranchFromLsRemoteWithRealremote.origin.url git-upload-pack &#39;/tmp/TestParseDefaultBranchFromLsRemoteWithRealGitmain_branch34-ifaceassert /opt/hostedtoolcache/node/24.14.1/x64/bin/node GOSUMDB GOWORK 64/bin/go node /tmp�� /tmp/TestHashConsistency_GoAndJavaScript70246712/001/test-frontmatter-with-nested-objects.md go /usr/bin/git h306243132/001&#39; h306243132/001&#39; 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv --show-toplevel -dwarf=false /usr/bin/git go1.25.8 -c=4 -nolocalimports git rev-�� runs/20260421-134326-36986/test-2710341087 /tmp/go-build3543039877/b419/_testmain.go /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json nal.go x_amd64/compile node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv --bare --initial-branch=main /usr/bin/git GOSUMDB GOWORK 64/bin/go git -C /tmp/gh-aw-test-runs/20260421-135507-65150/test-2604974097/.github/workflows remote /usr/bin/git th .prettierignogit GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 8545894/b007/sym/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/architecture-guardian.md 64/pkg/tool/linux_amd64/vet ache�� 392284176/.github/workflows oYmy/n_pwg_VDfKQLamLkoYmy ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE fips140only GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8545894/b199/_pkg_.a .cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel go env 5507-65150/test-2221508290/.github/workflows GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name om/modelcontextprotocol/go-sdk@v1.5.0/internal/mcpgodebug/mcpgodebug.go 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/sha3 GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8545894/b229/_pkg_.a Ldjv/q8rDzC5dO2KyVIFwLdjv 64/pkg/tool/linux_amd64/compile GOINSECURE contextprotocol/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/pkg/tool/linu-nolocalimports GOINSECURE fips140/aes GOMODCACHE 64/pkg/tool/linu/tmp/go-build3543039877/b455/_testmain.go env 537519715 qrnP/bIu9B-2Kyy25-yTJqrnP .cfg GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name --check 1/x64/bin/node **/*.ts **/*.json --ignore-path git -has�� vaScript70246712/001/test-empty-frontmatter.md --merged=ec1c731b32b8ba23e3b8a0bf0282a0c447e7b243 1/x64/bin/node &#34;prettier&#34; --wrigit git 64/bin/go go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE fips140/sha256 GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8545894/b230/_pkg_.a t2Bi/LbyKJAzlPTfrrG8ct2Bi .cfg GOINSECURE contextprotocol/config GOMODCACHE ache/go/1.25.8/xtest@example.com (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet ortc�� 8545894/b180/_pkg_.a stmain.go .cfg GOINSECURE fips140/ecdsa GOMODCACHE ache/go/1.25.8/xremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GOPROXY 64/pkg/tool/linux_amd64/vet GOSUMDB GOWORK 64/bin/go 64/pkg/tool/linux_amd64/vet -c log.showsignature=false log ache/go/1.25.8/x64/bin/go -n1 --format=format:rev-parse --end-of-options--show-toplevel go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 8545894/b013/sym/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/archie.md 64/pkg/tool/linux_amd64/vet env 392284176/.github/workflows r73k/ZR15bOYtzO_sNGC5r73k ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE t/internal/strinconfig GOMODCACHE ache/go/1.25.8/xtest@example.com (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8545894/b236/_pkg_.a 4ACQ/f02Eva1ttQPQuPWq4ACQ ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-extld=gcc (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel go env 5507-65150/test-2221508290/.github/workflows GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env 392284176 taK6/ikh7gQ1RReQdq87ptaK6 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE /semver GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-buildtags (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE /cpu GOMODCACHE 64/pkg/tool/linux_amd64/vet env 8545894/b235/_pkg_.a GO111MODULE k GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name efaultBranchFromLsRemoteWithRealGitmain_branch348713883/001&#39; 1/x64/bin/node **/*.json --ignore-path ../../../.pretti--show-toplevel go t-ha�� vaScript70246712/001/test-frontmatter-with-arrays.md GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 8545894/b007/sym/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/artifacts-summary.md 64/pkg/tool/linux_amd64/vet env 8545894/b251/_pkg_.a 8545894/b007/importcfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE b/gh-aw/pkg/giturev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-trimpath (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE ntio/asm/cpu/arminit ache/go/1.25.8/x64/src/internal//tmp/go-build3543039877/b446/_pkg_.a 64/pkg/tool/linux_amd64/vet env 8545894/b225/_pkg_.a GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu-lang=go1.25 GOINSECURE ce GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-dwarf=false (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name **/*.cjs At,event,headBranch,headSha,displayTitle **/*.json --ignore-path ../../../.pretti--show-toplevel go env 5507-65150/test-2221508290/.github/workflows GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name g/gitutil/gituti-c=4 64/pkg/tool/linu-nolocalimports GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build3543039877/b458/_testmain.go env 8545894/b255/_pkg_.a k-ff/hcoMcb4nJlDk1Ubnk-ff 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD 8545894/b029/symuser.email 64/pkg/tool/linutest@example.com env 3831659638/custom/workflows Kv-X/SrddFjc3EqPBzwz7Kv-X ger.test GOINSECURE GOMOD GOMODCACHE ger.test (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name **/*.cjs ache/go/1.25.8/x64/bin/go **/*.json --ignore-path ../../../.pretti--show-toplevel go env -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -c=4 -nolocalimports -importcfg /tmp/go-build3543039877/b422/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil_test.go env -json o x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE x_amd64/vet env json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env ithub/workflows bYse/Agvt9vB4Z3tFs27lbYse ache/go/1.25.8/x64/pkg/tool/linu-test.short=true GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuTest User (http block)
  • https://api.github.com/repos/github/gh-aw/contents/.github/workflows/shared/reporting.md
    • Triggering command: /tmp/go-build3543039877/b403/cli.test /tmp/go-build3543039877/b403/cli.test -test.testlogfile=/tmp/go-build3543039877/b403/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /tmp/go-build1964008950/b404/cli.test /tmp/go-build1964008950/b404/cli.test -test.testlogfile=/tmp/go-build1964008950/b404/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go ode_�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv it/ref/tags/v4 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sv (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq [.object.sha, .object.type] | @tsv --show-toplevel node /usr/bin/git --check **/*.cjs ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git 5507-65150/test-ls GO111MODULE ache/go/1.25.8/x/tmp/gh-aw/aw-feature-branch.patch git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv 3039877/b001/_pkg_.a GO111MODULE k GOINSECURE b/gh-aw/actions/rev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet sRem�� se 3039877/b142/vet.cfg x_amd64/vet -p cmp -lang=go1.25 x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE ules/.bin/node GOINSECURE GOMOD GOMODCACHE go 7927�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env 200018081/001 200018081/002/work x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE ode GOINSECURE GOMOD GOMODCACHE go tion�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env g_.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq [.object.sha, .object.type] | @tsv -json GO111MODULE 1/x64/lib/node_m-nilfunc GOINSECURE GOMOD GOMODCACHE go tion�� lGitmaster_branch1792774322/001&#39; lGitmaster_branch1792774322/001&#39; 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv se 3039877/b009/vet.cfg Name,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq [.object.sha, .object.type] | @tsv mLsRemoteWithRealGitmaster_branch1792774322/001&#39; mLsRemoteWithRealGitmaster_branch1792774322/001&#39; 64/bin/go GOINSECURE GOMOD erignore go env 3108325318/.github/workflows GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE /go-yaml/internarev-parse 8545894/b087/sym--show-toplevel 64/pkg/tool/linux_amd64/vet estl�� se 3039877/b012/vet.cfg ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-buildtags (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go t-ha�� orts651635205/001/main.md GO111MODULE e/git GOINSECURE GOMOD GOMODCACHE e/git (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json age/compact/comp-ifaceassert x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state .cfg GOINSECURE able 8545894/b092/sym--show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name e2fcff8e52300fa5GOINSECURE GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test/repo
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch 8545894/b236/_pkg_.a 4ACQ/f02Eva1ttQPQuPWq4ACQ ache/go/1.25.8/x64/pkg/tool/linu-buildmode=exe GOINSECURE osh-tekuri/jsonsrev-parse GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-extld=gcc (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test/repo --jq .default_branch --get remote.origin.url om/upstream/repo.git 01 GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /opt/hostedtoolcache/node/24.14.1/x64/bin/node run check:pkg-jsgit GO111MODULE ules/.bin/sh /opt/hostedtoolcache/node/24.14.config (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git conf�� --local --get ode_modules/.bin/git cal/bin/git git /git git add . git tions/setup/node_modules/.bin/git -M main bin/git git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan marked this pull request as ready for review April 21, 2026 14:01
Copilot AI review requested due to automatic review settings April 21, 2026 14:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors pkg/actionpins to improve functional purity/testability by extracting helper logic out of the sync.Once initializer and removing duplicated warnings-map initialization, while keeping behavior the same.

Changes:

  • Extracted buildByRepoIndex() to build the per-repo index (version-descending) outside the sync.Once closure.
  • Extracted countPinKeyMismatches() to isolate mismatch detection/logging and return a count.
  • Added initWarnings() helper and internal tests for the new helpers.
Show a summary per file
File Description
pkg/actionpins/actionpins.go Extracts helper functions, simplifies sync.Once init, and deduplicates warnings-map initialization.
pkg/actionpins/actionpins_internal_test.go Adds package-internal unit tests covering the extracted helpers.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Copilot AI requested a review from pelikhan April 21, 2026 14:03
…ionpins

Generated by Design Decision Gate workflow run 24726693548.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

Commit pushed: 2685afa

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions
Copy link
Copy Markdown
Contributor Author

🏗️ Design Decision Gate — ADR Required

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

AI has analyzed the PR diff and generated a draft ADR to help you get started:

📄 Draft ADR: docs/adr/27523-extract-pure-helpers-in-actionpins.md

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-27523: Extract Pure Helper Functions in pkg/actionpins

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.


📋 Draft ADR Summary

Decision captured: Extract three inline behaviours (buildByRepoIndex, countPinKeyMismatches, initWarnings) from sync.Once closures and duplicated call sites into named, pure package-level helper functions in pkg/actionpins. Zero behaviour change; improves testability and removes duplicated nil-guard pattern.

Alternatives captured:

  • Keep logic inline (status quo) — rejected due to untestability and duplicate code
  • Struct-based lazy initializer — rejected as too large a structural change for this refactor cycle

Key consequences: Helpers are now independently unit-testable; duplicate nil-guard risk eliminated; package surface area grows by three unexported symbols; countPinKeyMismatches retains a logging side effect.

📋 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).

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

References: §24726693548

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · ● 110.1K ·

@github-actions
Copy link
Copy Markdown
Contributor Author

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100

Excellent test quality

Metric Value
New/modified tests analyzed 3
✅ Design tests (behavioral contracts) 3 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 2 (67%)
Duplicate test clusters 0
Test inflation detected No (1.21:1 ratio)
🚨 Coding-guideline violations None

Test Classification Details

View All Test Classifications (3 tests)
Test File Classification Issues Detected
TestBuildByRepoIndex_GroupsByRepoAndSortsDescending pkg/actionpins/actionpins_internal_test.go:13 ✅ Design No error path; happy-path only
TestCountPinKeyMismatches_ReturnsOnlyVersionMismatches pkg/actionpins/actionpins_internal_test.go:33 ✅ Design Includes invalid-key edge case
TestInitWarnings_InitializesAndPreservesMap pkg/actionpins/actionpins_internal_test.go:43 ✅ Design Covers nil and non-nil edge cases

Flagged Tests — Requires Review

No tests require mandatory remediation. One minor observation:

i️ TestBuildByRepoIndex_GroupsByRepoAndSortsDescending — missing edge case

Classification: Design test ✅
Observation: Tests grouping and descending sort with two repos, each with two versions — good behavioral coverage. However, there is no case for an empty pins slice or a single-element slice, which would verify the function handles boundary conditions without panicking.
Suggested improvement: Add a sub-case or small follow-up test asserting buildByRepoIndex([]ActionPin{}) returns an empty (non-nil) map.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 3 tests — unit (//go:build !integration)
  • 🟨 JavaScript (*.test.cjs, *.test.js): 0 tests

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). Build tag //go:build !integration is present. No mock-library violations. All assertion calls include descriptive messages. The new internal test file provides solid behavioral coverage for the three extracted pure helpers (buildByRepoIndex, countPinKeyMismatches, initWarnings).


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.


References: §24726693679

🧪 Test quality analysis by Test Quality Sentinel · ● 441.5K ·

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). All 3 tests verify observable behavioral contracts of the extracted pure helpers with descriptive assertions and proper build tags.

@pelikhan pelikhan merged commit f188764 into main Apr 21, 2026
22 of 24 checks passed
@pelikhan pelikhan deleted the fp-enhancer/actionpins-functional-helpers-5fc1192535e0e569 branch April 21, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants