Skip to content

fix(packaging): scope CloudKit provisioning to the signing team - #3461

Merged
steipete merged 1 commit into
mainfrom
codex/package-team-provisioning
Sep 7, 2026
Merged

fix(packaging): scope CloudKit provisioning to the signing team#3461
steipete merged 1 commit into
mainfrom
codex/package-team-provisioning

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Packaging embeds the upstream Developer ID provisioning profile and CloudKit entitlements for every identity-signed release, even when APP_TEAM_ID has already been resolved to another team. That can require or embed a profile that does not authorize the selected team's app.

Restrict the bundled profile and CloudKit entitlements to the upstream team. Derive the shared app/widget group directly from the resolved bundle ID, removing duplicated debug suffix handling. Net production delta: -3 lines in package_app.sh.

Extracted the profile-selection repair from #3372, with @krazybean's contributor credit preserved. Direct APP_IDENTITY calls without a matching resolved APP_TEAM_ID remain a separate scope; this does not claim complete alternate-identity discovery. Required widget builds, timestamping, hardened runtime, signature verification and sandbox smoke checks remain enforced.

Validation:

  • Baseline execution of the actual entitlement-generation block failed for a configured alternate-team release because it required the upstream profile.
  • All 16 configuration cases now pass: upstream/alternate team, debug/release, identity/ad-hoc, and profile present/absent. Tests inspect generated app/widget plist groups, CloudKit fields, required-profile failure and actual profile-copy selection.
  • Fixture profile contents are a selection marker, not a fabricated certificate or claim of valid signing.
  • Existing package signature/quarantine tests and make check passed. Isolated P2 autoreview found no actionable findings.
  • Full make test passed all 1,028 selections / 86 groups on the first pass without retries or timeouts (1,288.6 seconds). Exact-head CI passed.

The source regression is traceable to the unscoped CloudKit gate added in #2597. Changelog and packaging documentation describe the repaired team boundary.

Extract the profile-selection repair from #3372 and derive app groups from the resolved bundle ID.

Co-authored-by: Juanito <krazybean@gmail.com>
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 11:46 PM ET / September 7, 2026, 03:46 UTC.

ClawSweeper review

What this changes

Restrict bundled CloudKit provisioning to upstream-team release signing, preserve app/widget groups, and add configuration-matrix tests and packaging documentation.

Merge readiness

Ready for maintainer review

The repair remains necessary on current main and v0.56.7. No introduced correctness defect was found in this narrowly scoped, owner-authored PR.

Priority: P2
Reviewed head: c932fa9a3d2982f85f4d3880dcbbe3b7ac3141b9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant configuration coverage, clear scope, and no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The owner-authored PR is exempt from ordinary contributor proof. Its reported matrix exercises production entitlement generation and profile copying, not native signing or launch; inspection found no unresolved introduced authority violation requiring exceptional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The owner-authored PR is exempt from ordinary contributor proof. Its reported matrix exercises production entitlement generation and profile copying, not native signing or launch; inspection found no unresolved introduced authority violation requiring exceptional final-effect proof.
Evidence reviewed 8 items Repository policy and identity: The origin identifies steipete/CodexBar. Root AGENTS.md was read fully; no nested policy or maintainer-notes directory was found for the changed paths. Focused validation and preservation of signing safeguards informed the review.
Introduced change and signing boundary: The new team condition controls both entitlement generation and profile copying. Both supported bundle IDs produce unchanged app-group values. Packaging recreates its staging directory, retains timestamped hardened-runtime signing, verifies signatures, and retains the release launch check.
Current main still needs the repair: The inspected main version requires the upstream provisioning profile for identity-signed releases without checking APP_TEAM_ID.
Findings None None.
Security None None.

How this fits together

CodexBar’s packaging script turns build configuration and signing-team settings into app/widget entitlements and a signed application. The resulting CloudKit entitlement controls whether the app can initialize iCloud sync.

flowchart TD
  A[Build configuration] --> C[Packaging script]
  B[Resolved signing team] --> C
  C --> D[Matching app and widget groups]
  C --> E{Upstream identity release?}
  E -->|Yes| F[Embed profile and CloudKit entitlements]
  E -->|No| G[Package without CloudKit access]
  F --> H[Signed application]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production -3 lines net; tests +58 lines The repair reduces packaging code while adding targeted regression coverage.
Configuration coverage 16 combinations Tests cover both teams, configurations, signing modes, and profile-presence states.

Technical review

Best possible solution:

Keep provisioning tied to its authorized team while preserving existing app groups and signing safeguards; handle automatic identity discovery separately.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: an alternate APP_TEAM_ID with identity/release packaging still enters main’s upstream-profile gate and fails when that profile is absent. Native signing and launch were not executed.

Is this the best way to solve the issue?

Yes. Adding the team condition at the shared entitlement/profile selection point is a narrow repair, and the group-expression simplification preserves both supported bundle IDs.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 49f2dc916919.

Labels

Label changes:

  • add P2: This repairs a bounded alternate-team packaging failure without changing normal upstream release behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The owner-authored PR is exempt from ordinary contributor proof. Its reported matrix exercises production entitlement generation and profile copying, not native signing or launch; inspection found no unresolved introduced authority violation requiring exceptional final-effect proof.

Label justifications:

  • P2: This repairs a bounded alternate-team packaging failure without changing normal upstream release behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The owner-authored PR is exempt from ordinary contributor proof. Its reported matrix exercises production entitlement generation and profile copying, not native signing or launch; inspection found no unresolved introduced authority violation requiring exceptional final-effect proof.

Evidence

What I checked:

  • Repository policy and identity: The origin identifies steipete/CodexBar. Root AGENTS.md was read fully; no nested policy or maintainer-notes directory was found for the changed paths. Focused validation and preservation of signing safeguards informed the review. (AGENTS.md:1, c932fa9a3d29)
  • Introduced change and signing boundary: The new team condition controls both entitlement generation and profile copying. Both supported bundle IDs produce unchanged app-group values. Packaging recreates its staging directory, retains timestamped hardened-runtime signing, verifies signatures, and retains the release launch check. (Scripts/package_app.sh:248, c932fa9a3d29)
  • Current main still needs the repair: The inspected main version requires the upstream provisioning profile for identity-signed releases without checking APP_TEAM_ID. (Scripts/package_app.sh:251, 49f2dc916919)
  • Latest release comparison: v0.56.7 also contains the unscoped gate; the requested repair is not present in the supplied latest release. (Scripts/package_app.sh:251, d8f4cec19b82)
  • Runtime rejects absent CloudKit entitlement: Both sync startup and enablement check the running task’s CloudKit entitlement before initializing the CloudKit engine. Removing incompatible entitlement claims does not introduce a bypass to cloud access. (Sources/CodexBar/Sync/CloudSyncEngine.swift:437, c932fa9a3d29)
  • Regression coverage and proof scope: The complete test script exercises 16 combinations using extracted production generation/copy blocks and a synthetic profile marker. The captured PR body reports these cases and make check passing; it explicitly does not claim certificate validity or a signed-app launch. Tests were inspected, not executed during this read-only review. (Scripts/test_package_signing.sh:79, c932fa9a3d29)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 02c073a into main Sep 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant