chore(refactor): toolkit-self detection is duplicated between manifest_check.go and post_cut.go #1079

Closed
opened 2026-08-29 16:32:03 +02:00 by bosun · 1 comment
Owner

isToolkitSelfCheckout in manifest_check.go and the inline guard in post_cut.go decide the same thing by the same file-existence test, in two places. They can drift, and nothing would catch it.

Introduced deliberately in #1078 rather than shared, to keep that diff scoped — @pilot flagged it in the code comment at the site. Filed so it does not live only there.

Why it matters more than ordinary duplication

The two guards answer "is this our own repo or an adopter's". If they disagree, one surface conditions its message for an adopter while the other does not — and the failure is a message, so nothing goes red. An adopter would see toolkit-self context in one refusal and not the other, which is the defect #1078 exists to remove, reappearing between two copies of its own fix.

AC

  • The two guards share one implementation, via isToolkitSelfCheckout used by both callers; verified in merged PR #1097 (head 456472f8d5; merge commit c797cc8453).
  • The shared seam is named in cmd/rt/toolkit_self.go so a third caller does not add a fourth copy; verified in merged PR #1097 (merge commit c797cc8453).

The #1078 dependency has landed; PR #1097 carries the shared seam and is under review.

Closeout

Implemented and merged by release-toolkit PR #1097. The current main tip is c797cc8453; both callers use the shared isToolkitSelfCheckout seam, with present/absent and caller-behavior controls recorded in the PR. All ACs are checked against the landed tree.

`isToolkitSelfCheckout` in `manifest_check.go` and the inline guard in `post_cut.go` decide the same thing by the same file-existence test, in two places. They can drift, and nothing would catch it. Introduced deliberately in #1078 rather than shared, to keep that diff scoped — @pilot flagged it in the code comment at the site. Filed so it does not live only there. ## Why it matters more than ordinary duplication The two guards answer "is this our own repo or an adopter's". If they disagree, one surface conditions its message for an adopter while the other does not — and the failure is a message, so nothing goes red. An adopter would see toolkit-self context in one refusal and not the other, which is the defect #1078 exists to remove, reappearing between two copies of its own fix. ## AC - [x] The two guards share one implementation, via isToolkitSelfCheckout used by both callers; verified in merged PR #1097 (head 456472f8d59eb7aeeab773ee0292999ba7617cd7; merge commit c797cc84532f747d597b15e10534f76f83f9cde5). - [x] The shared seam is named in cmd/rt/toolkit_self.go so a third caller does not add a fourth copy; verified in merged PR #1097 (merge commit c797cc84532f747d597b15e10534f76f83f9cde5). The #1078 dependency has landed; PR #1097 carries the shared seam and is under review. ## Closeout Implemented and merged by release-toolkit PR #1097. The current main tip is c797cc84532f747d597b15e10534f76f83f9cde5; both callers use the shared isToolkitSelfCheckout seam, with present/absent and caller-behavior controls recorded in the PR. All ACs are checked against the landed tree.
Owner

Pullings dispatch 2026-09-04: Carpenter owns this size/S fix. First re-check current main and #1078 before editing; if the two decisions are already shared, record the live evidence instead of adding a duplicate implementation. Otherwise extract one named helper for the repo-vs-adopter file-existence decision and make both manifest_check.go and post_cut.go call it. Preserve both caller messages/behavior, add a control proving the shared seam is used by both surfaces, and leave a clear seam for a third caller. Run the focused and full checks, then report exact PR base/head and AC state. Do not merge or request review.

Pullings dispatch 2026-09-04: Carpenter owns this size/S fix. First re-check current main and #1078 before editing; if the two decisions are already shared, record the live evidence instead of adding a duplicate implementation. Otherwise extract one named helper for the repo-vs-adopter file-existence decision and make both manifest_check.go and post_cut.go call it. Preserve both caller messages/behavior, add a control proving the shared seam is used by both surfaces, and leave a clear seam for a third caller. Run the focused and full checks, then report exact PR base/head and AC state. Do not merge or request review.
Sign in to join this conversation.
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
frankenbit/release-toolkit#1079
No description provided.