chore(api): drop deprecated patch_policies.sources column (#3151) - #3154
Draft
ToddHebebrand wants to merge 15 commits into
Draft
chore(api): drop deprecated patch_policies.sources column (#3151)#3154ToddHebebrand wants to merge 15 commits into
ToddHebebrand wants to merge 15 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…DeferralDays Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…losed deferral/severity parsing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d drop the third_party_app virtual category Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…es the severity exemption Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ing, reject third_party_app rules Ring create/update routes now flow autoApprove.thirdPartyApps and thirdPartyDeferralDays through to the DB (ringAutoApproveSchema already validates them). Removes the dead createRingSchema/updateRingSchema sources field, the list-select and insert/update sources plumbing on patch_policies (expand/contract: DROP COLUMN ships a release later), and rejects third_party_app category rules at the write boundary in favor of the ring-level toggle. patchPolicies.sources still has one other reader, aiToolsPolicyPrereqs.ts (Task 7's job to remove) — tsc --noEmit does not flag it since selecting a still-existing column isn't a type error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code review on Task 5 caught that GET /update-rings/:id still leaked patchPolicies.sources — its full-row select spreads the raw DB row into the JSON response, unlike the list endpoint's explicit column projection. Destructure `sources` out before the response spread instead of hand-projecting all ~20 remaining columns (that select also feeds the partnerId access check and every other detail field). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pp category rules Fixes over the initial version per review: statement 2 no longer overwrites an explicit thirdPartyApps key set via the new UI (a stale legacy third_party_app rule now falls through to statement 3, which strips it without touching auto_approve); statement 1 only stamps thirdPartyDeferralDays when absent; statement 2's deferralDaysOverride parse is bounded to 0-365 to match the evaluator's read-time bound and avoid an integer-overflow abort on a huge digit string. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…urces Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… trip Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds an "Auto-approve" column to the Update Rings table summarizing each
ring's gate as badges (OS severities, 3rd-party apps, or Manual), and a
hint under the PatchTab third-party sources toggle pointing techs at the
linked Update Ring for auto-approval rules.
Bumps the de-DE/es-419/pt-BR patches.json exact-English duplicate
baselines by one each: "Manual" and "OS: {{severities}}" are legitimately
identical in those locales.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pp category rules Fixes over the initial version per review: statement 2 no longer overwrites an explicit thirdPartyApps key set via the new UI (a stale legacy third_party_app rule now falls through to statement 3, which strips it without touching auto_approve); statement 1 only stamps thirdPartyDeferralDays when absent; statement 2's deferralDaysOverride parse is bounded to 0-365 to match the evaluator's read-time bound and avoid an integer-overflow abort on a huge digit string. Second review pass: statement 2 was flipping enabled:true on a ring whose OS auto-approve was previously off, silently carrying forward its stored severities as if OS auto-approve had been on all along — now clears severities to [] whenever the pre-image wasn't already boolean-true enabled, so a disabled OS state survives the ring-level enable. Added a comment documenting the accepted narrowing where an already-enabled ring with empty severities loses rule-based 3P intent (fail-closed, 0 known rows), and a comment in migrateToConfigPolicies.ts flagging that its hardcoded sources:['os'] is safe only because the script is a retained one-shot, not a repeatable sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contract phase of the third-party update ring auto-approve expand/contract plan (spec 2026-08-04). The expand phase (#3150) removed every reader and writer of patch_policies.sources; this drops the column itself, removes the deprecated schema definition, and deletes the now-dead response strips in the ring detail route and the manage_update_rings AI tool (a full-row select can no longer return a sources key). Must not merge until the release containing #3150 has shipped to both prod regions, so rolling deploys never run an older API against the dropped column. Closes #3151 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying breeze with
|
| Latest commit: |
b72c9e4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf43b87f.breeze-9te.pages.dev |
| Branch Preview URL: | https://chore-3151-drop-patch-polici.breeze-9te.pages.dev |
Collaborator
Author
|
Heads-up from the base branch: 10fb309 on 🤖 Generated with Claude Code |
Base automatically changed from
ToddHebebrand/3rd-party-patch-update-rings
to
main
August 5, 2026 21:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contract phase of the third-party update ring auto-approve expand/contract plan (
docs/superpowers/specs/vuln-patch/2026-08-04-third-party-update-ring-auto-approve-design.md). The expand phase (#3150) removed every reader and writer ofpatch_policies.sources; this PR drops the column itself.2026-08-14-drop-patch-policies-sources.sql:ALTER TABLE patch_policies DROP COLUMN IF EXISTS sources;— idempotent, no inner transaction. Named-14-(not today's date) so it sorts after the existing2026-08-13ring backfill migration from feat(patching): third-party auto-approval as a first-class Update Ring control #3150.sourcescolumn definition + deprecation comment fromapps/api/src/db/schema/patches.ts(patchSourceEnumitself stays — still used bypatches.source).sourceskey, so the defensiveconst { sources: _sources, ...rest }strips inroutes/updateRings.ts(detail endpoint) andservices/aiToolsPolicyPrereqs.ts(manage_update_ringsget) are removed. Tests updated accordingly; thenot.toHaveProperty('sources')response assertions are kept as regression guards.patch_policiesis partner-owned (noorg_id, nodevice_id), so it appears in none of the cascade or export-policy lists.SELECT *-equivalent full-row reads against a dropped column).ToddHebebrand/3rd-party-patch-update-rings(feat(patching): third-party auto-approval as a first-class Update Ring control #3150). After feat(patching): third-party auto-approval as a first-class Update Ring control #3150 merges, retarget/rebase this PR ontomainbefore merging.Verification
pnpm db:check-drift: clean for this change (my migration applies and schema matches; the only remaining local drift entries are sibling-branch migrations in the shared local DB ledger, pre-existing).pnpm db:migrate.tsc --noEmitclean inapps/api.updateRings_detail_update_delete,updateRings_list_create,updateRings_patches_compliance_scope,db/autoMigrate,services/aiToolsPolicyPrereqs.patchPolicies.sources/patch_policies.sources.Closes #3151
🤖 Generated with Claude Code