WIP: Live fix publisher deployment probe #7

Closed
lambadalambda wants to merge 1 commit from test/live-fix-publisher-20260826 into main

Purpose

Controlled production probe for the newly deployed /oc review/oc fix latest workflow.

The intentionally inverted identity comparison makes the focused test fail. The review bot should report it, and the trusted fix publisher should produce a deterministic companion branch and PR containing an independently cherry-pickable correction.

Baseline verification

  • go test ./testdata/live-fix-publisher fails as intended
## Purpose Controlled production probe for the newly deployed `/oc review` → `/oc fix latest` workflow. The intentionally inverted identity comparison makes the focused test fail. The review bot should report it, and the trusted fix publisher should produce a deterministic companion branch and PR containing an independently cherry-pickable correction. ## Baseline verification - `go test ./testdata/live-fix-publisher` fails as intended
test: add live fix publisher probe
All checks were successful
opencode/review OpenCode execution completed
opencode/fix OpenCode fixes published
4919fd9273
Author
Owner

/oc review

/oc review
opencode-bot left a comment

OpenCode Review

This PR adds only testdata/live-fix-publisher, an access-control predicate for the live fix publisher gate. IsAllowed is inverted: it returns candidate != expected, so it authorizes every identity except the trusted one and denies the trusted one, contradicting its own doc comment. The accompanying test asserts the documented behavior and fails when the package is run (verified with go test). Because the package lives under testdata, go test ./... and go vet ./... skip it, so standard CI gates pass and the broken authorization primitive and failing test merge silently. Fix the comparison to candidate == expected so the gate matches its contract and the test passes; consider moving the package out of testdata or adding an explicit test target so it is actually exercised by CI.

Rating

3/5

1 finding(s) are attached to changed lines.

Overall

Not merge-ready. The single added function is an inverted authorization check (allows all identities except the expected one) whose own test fails; standard ./... test patterns skip testdata, so nothing in CI catches it. One-line fix required, plus wiring the package into a test target so it cannot regress silently.


Last reviewed commit: 4919fd9273f2

<!-- opencode-pull-review:v1:c87bc80b969ea54d61735ad0a8429a15 --> <!-- opencode-pull-review-result:v1:7b17b70b65db4e14b4009167e0bf7efb --> ## OpenCode Review This PR adds only testdata/live-fix-publisher, an access-control predicate for the live fix publisher gate. IsAllowed is inverted: it returns candidate != expected, so it authorizes every identity except the trusted one and denies the trusted one, contradicting its own doc comment. The accompanying test asserts the documented behavior and fails when the package is run (verified with go test). Because the package lives under testdata, go test ./... and go vet ./... skip it, so standard CI gates pass and the broken authorization primitive and failing test merge silently. Fix the comparison to candidate == expected so the gate matches its contract and the test passes; consider moving the package out of testdata or adding an explicit test target so it is actually exercised by CI. ## Rating **3/5** _1 finding(s) are attached to changed lines._ ## Overall Not merge-ready. The single added function is an inverted authorization check (allows all identities except the expected one) whose own test fails; standard ./... test patterns skip testdata, so nothing in CI catches it. One-line fix required, plus wiring the package into a test target so it cannot regress silently. --- _Last reviewed commit: `4919fd9273f2`_
@ -0,0 +2,4 @@
// IsAllowed reports whether a candidate exactly matches the expected identity.
func IsAllowed(candidate, expected string) bool {
return candidate != expected
Collaborator

[P1] Inverted authorization check allows every identity except the trusted one

IsAllowed is documented to report whether candidate exactly matches the expected identity, but it returns candidate != expected. As the live fix publisher gate, this authorizes any non-matching (attacker) identity and rejects the sole trusted identity — a complete access-control inversion. The PR's own test asserts the documented contract and fails when run (verified: go test ./testdata/live-fix-publisher → FAIL at access_test.go:7 "matching identity must be allowed"). Because the package is under testdata, go list/test ./... skips it, so the repo's standard test commands pass and the defect ships unexercised by CI. Same root cause covers both the security inversion and the failing test.

Suggested replacement (manual):

return candidate == expected
**[P1] Inverted authorization check allows every identity except the trusted one** IsAllowed is documented to report whether candidate exactly matches the expected identity, but it returns candidate != expected. As the live fix publisher gate, this authorizes any non-matching (attacker) identity and rejects the sole trusted identity — a complete access-control inversion. The PR's own test asserts the documented contract and fails when run (verified: `go test ./testdata/live-fix-publisher` → FAIL at access_test.go:7 "matching identity must be allowed"). Because the package is under testdata, `go list/test ./...` skips it, so the repo's standard test commands pass and the defect ships unexercised by CI. Same root cause covers both the security inversion and the failing test. **Suggested replacement (manual):** return candidate == expected <!-- opencode-pull-review-finding:v1:d0f1f849ef232bbfd56c89d912435b1f -->
Author
Owner

/oc fix latest

/oc fix latest
Collaborator

OpenCode Fixes

Based exactly on reviewed commit 4919fd9273f2 from review job #46 (fix job #47).

Companion PR: lambadalambda/opencode-forgejo-bot#8

Finding 1: Inverted authorization check allows every identity except the trusted one

Fixed in 740e3928b87c.

Tests reported by the fixer:

  • go test ./testdata/live-fix-publisher
  • go vet ./testdata/live-fix-publisher
<!-- opencode-review:v1:c47a4b12f7d4153707b7c66f0f8f5ad4 --> <!-- opencode-reviewed-head:4919fd9273f2f776ede7cdc52f1c06e739aa911e --> ## OpenCode Fixes _Based exactly on reviewed commit `4919fd9273f2` from review job #46 (fix job #47)._ Companion PR: [lambadalambda/opencode-forgejo-bot#8](https://git.pleroma.social/lambadalambda/opencode-forgejo-bot/pulls/8) ### Finding 1: Inverted authorization check allows every identity except the trusted one Fixed in [`740e3928b87c`](https://git.pleroma.social/lambadalambda/opencode-forgejo-bot/commit/740e3928b87c1a6e82d308eee24db5ffe5cac112). Tests reported by the fixer: - go test \./testdata/live\-fix\-publisher - go vet \./testdata/live\-fix\-publisher
Author
Owner

Closing this intentionally artificial deployment probe now that the companion-fix workflow has been validated. The production implementation was merged through PR #9 and is deployed from main.

Closing this intentionally artificial deployment probe now that the companion-fix workflow has been validated. The production implementation was merged through PR #9 and is deployed from main.
lambadalambda closed this pull request 2026-08-29 07:41:45 +00:00
All checks were successful
opencode/review OpenCode execution completed
opencode/fix OpenCode fixes published

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lambadalambda/opencode-forgejo-bot!7
No description provided.