Skip to content

fix(update): authorize complete batches before applying changes - #1116

Merged
777genius merged 7 commits into
mainfrom
fix/update-safety-20261126
Nov 26, 2026
Merged

777genius merged 7 commits into
mainfrom
fix/update-safety-20261126

Conversation

@777genius

@777genius 777genius commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Problem and change

update --all --yes could apply imperative tracked packages without the security authorization already enforced by targeted update. In a mixed batch, saved dependencies could be changed before the missing authorization became visible.

This PR authorizes every changed imperative preparation with the actual command options before any saved or imperative apply. It reuses the existing security policy, preserves interactive consent and explicit --accept-security-risk, and returns one batch JSON document containing the blocking assessment. The production correction is 21 added lines in update_all.go.

Plan and review

The plan was published first and revised after two independent reviews before implementation. A separate stale-prepared-update hypothesis did not reproduce: the existing native-object digest check already rejects stale execution. This PR retains one public Engine regression for that protection and makes no corresponding production change.

Independent implementation and fixture review found no correctness issue. The change preserves #1115's overlapping apply/render/saved diagnostics; current main and overlapping work were checked again before merge. The later #1115 deltas through 0618ea955b6c9dee5d057af447a283aa3c840476 were inspected: they change only terminal-ui scripts/tests and add no update/security, Go-fixture or package-manager-catalog overlap.

Actual local evidence

  • RED checkpoint: 998e0f0cc81654c4aa1ba3f48c4de01d934fa13e. On unchanged production, imperative and mixed batches incorrectly completed two and three updates with native effects; targeted refusal and read-only preview were valid. Both separate explicit-risk acceptance/cleanup controls passed after correcting the saved-Skill identity oracle.
  • Production correction: aa03de9cb7f235ce40d1724c3fd9f57c38bb8f16, blob 7d37a95dbfba9d1029723c59c526056a80fd3385.
  • Ordinary focused CLI/composition tests: exit 0, 15 passing test/subtest events, no failures or skips. Covers both batch shapes, human acceptance/rejection with one security prompt, one JSON response, unchanged refusal state and native effects, retained data and foreign files.
  • The two new tagged package-manager cases passed: update-all-security-batch-preflight and update-all-security-mixed-saved-preflight, including acceptance and cleanup (7 passing test/subtest events).
  • Public Engine stale-update regression plus its two existing neighboring regressions passed.

The injected blocking assessment qualifies authorization routing; the existing unchanged-executable phase separately qualifies the pinned real scanner.

Final-head qualification

Final head: e8da867d91c90bf34f8915cf9e8e46925c98d4cc; tree: f86199db4a1812b9a843d2a220be7e3d72db9b65.

Gate Run Actual result
Required 45739262957 All 10 jobs passed
Core fast 45739262603 All 15 jobs passed
Package manager full PR matrix 45739262951 All four OS jobs passed; reports inspected
Native Client Runtime 45739262886 All 11 substantive cells passed; 70 required tests passed, zero skipped

Full local make lint passed all four modules in both passes; the exclusion baseline remains 137 rules with no growth. The hosted core log was inspected and confirms complete make test-core plus coverage on the final source, including installer, internal CLI and public CLI packages. Local full core encountered unavailable procfs process-tree and Unix-socket prerequisites; those local failures were not counted as passes. The first local changed-line lint lacked the shallow checkout's base object; normal Git history was fetched before the successful unchanged-gate retry.

All four package-manager reports have suite: full, status: pass, full_qualification: true, no excluded tests, unchanged clean source and all 16 phases passing. Their merge ref 7fae09baade53ad1852e8f8d2179603e264e9241 has exactly the final PR tree above. Each installation event stream contains actual run/pass events for both new security cases and their refusal/acceptance children, with no failure or skip. The cold pinned real-scanner binary lifecycle, ownership and crash/recovery phases also passed. Artifacts: Ubuntu 15084315763, Windows 15085327203, Apple Silicon 15085163752, Intel 15083956297.

Every inspected native report records exact final head/tree, status: passed, exit 0 and no skipped required test. These use genuine pinned clients with scripted loopback model endpoints and qualify the stated lifecycle, discovery, MCP and isolation behaviors. Vendor authentication and real-model behavior are outside those fixtures. Codex Linux also passed the actual browser/project Skills lifecycle. OpenCode V1 macOS additionally passed SDK → real Go engine → native OpenCode, with a complete SDK receipt and exact-source process receipt.

Inspected native artifacts
Cell Job Artifact Required / passed / skipped
Claude Linux amd64 139670715609 15087832719 8 / 8 / 0
Claude macOS arm64 139670715613 15088200613 8 / 8 / 0
Claude Windows amd64 139670715643 15088715219 8 / 8 / 0
Codex Linux amd64 139670715723 15088412284 10 / 10 / 0
Codex macOS arm64 139670715664 15089275458 9 / 9 / 0
Codex Windows amd64 139670715670 15089640126 9 / 9 / 0
OpenCode V1 macOS arm64 139670715708 15089640625 6 / 6 / 0
OpenCode V1 Windows amd64 139670715734 15088338801 6 / 6 / 0
OpenCode V2 Linux amd64 139670715582 15087226925 2 / 2 / 0
OpenCode V2 macOS arm64 139670715564 15088092749 2 / 2 / 0
OpenCode V2 Windows amd64 139670715592 15087637652 2 / 2 / 0

Additional selected gates

Authoring completed all 7 jobs successfully. Aggregate job 139694775197 checked out the exact head and passed mandatory graph validation, 28 negative-control tests, and check-packed-workflow.py --results requiring every selected native and packed dependency to succeed.

Remaining-client acceptance completed all 10 jobs successfully. The five final reports below each attempted all 30 cases, have full coverage and complete source selection, and contain zero unexpected errors. Each names PR head e8da867… and source merge ref 7fae09ba…, with the verified final tree above.

Cell Job Artifact Full lifecycle Prepared lifecycle Expected refusal
Windsurf plugin 139667296211 15091950730 0 25 5
Windsurf Skill 139667296094 15091876940 30 0 0
Grok plugin 139667296169 15090809820 29 0 1
Grok Skill 139667296112 15093051107 0 30 0
ChatGPT plugin bridge 139667296157 15093592407 30 0 0

Windsurf plugin qualifies prepared installation acceptance: 25 prepared lifecycles and five verified refusals, preserving binding/residue boundaries. Grok Skill explicitly uses the prepared-Skills contract and qualifies 30 prepared lifecycles. Their reports have installation_acceptance_passed: true; they do not claim native activation or authentication. Grok plugin's negative is the documented unsupported source. ChatGPT plugin qualifies the canonical Codex bridge, not ChatGPT Desktop runtime or real-model behavior.

Completed merge and post-merge acceptance

Merged by the ordinary merge API with expected head e8da867d91c90bf34f8915cf9e8e46925c98d4cc on 2026-11-26 at 06:44:58 UTC. The actual merge commit is 0cfb5655adcad430f2da3f581585320f0a47121f, with parents ce789138a393bffd7e6d001c0e4f8aec05e47773 and the reviewed head. Its tree is exactly f86199db4a1812b9a843d2a220be7e3d72db9b65, matching the qualified PR source.

Before merge, the actual final-head check-runs scan read 138 checks: 110 successful, one neutral CodeRabbit rate-limit result, 26 expected skips and one superseded cancellation. There were no active checks, failures, timeouts or action-required results. Independent implementation review was complete, and no GitHub review or inline thread required resolution.

The actual merge commit's automatic push Package manager E2E run completed all six platform jobs successfully. Every retained artifact was downloaded and inspected.

Platform Successful job Inspected artifact Phases
Ubuntu x64 139741231490 15096836465 16 / 16 passed
Ubuntu ARM64 139741231530 15096716017 16 / 16 passed
Windows x64 139741231687 15098035509 16 / 16 passed
Windows ARM64 139741231221 15096733000 16 / 16 passed
macOS ARM64 139741231584 15096599342 16 / 16 passed
macOS Intel 139741231467 15096114113 16 / 16 passed

Every report has suite=full, status=pass, full_qualification=true, excluded_tests=[], exact merge commit/tree, correct OS/architecture, source.dirty=false and source_unchanged_during_run=true. All 192 persisted phase-stream SHA-256 values were recomputed and matched: 32 stdout/stderr streams per platform.

Each installation stream contains exactly one real run/pass pair for both update-all-security-batch-preflight and update-all-security-mixed-saved-preflight, plus their refusal-and-preview and explicit-risk-acceptance children. There are zero failure or skip events in those complete installation streams.

All six full jobs also passed their applicable supplementary ownership, native Git policy, project lock isolation, process crash/recovery and EOL checks. The Windows held-reader check passed on Windows x64; its existing workflow condition skips it on the other five platforms. The skipped draft evidence preflight is excluded from product proof.

The authorization cases use injected fixture assessments to verify routing. Separately, all six reports pass the cold unchanged production-binary installation with real pinned lintai 0.1.3, scanner_evidence_source=local_scan and real_cold_production_scan. Native sessions, authentication and model behavior are covered only to the explicit boundaries described in the earlier native evidence.

Verified post-merge report SHA-256 values
Platform SHA-256 of report.json
Ubuntu x64 2c8ac413ecfbbc5926495d6b24f3ae7e3004254136e25ffa041d1f9e6c534ae9
Ubuntu ARM64 8371af8bca75d1bc3084f41e0c8dd22e4062ddf8c2d2b62170fafedf7ccb8715
Windows x64 2988d2ad98f21d87ab1770e474139ae03bf52c3c435331b7a826484633188647
Windows ARM64 919b475f7a22401ebb60e21b656944c6375e40ed736b7b0b22f559f09d80d848
macOS ARM64 ec37288a2f0af992554b11da42d04601e6f850afacd9b7cec6eecc1e76c958f8
macOS Intel 91248c6a40a6de6f9cd6824145890163e5d42ae0355dbdad1ecf583d5112cede

The final merge-commit check snapshot contains 63 checks: 61 successful and two skipped, with no active or failed result. Later main 4903e6794f29ce7f2c39bfd054bf37c5bf654f79 contains this merge; its update preflight call and authorization helper were inspected and remain intact after #1115. The six-platform evidence above identifies this PR's actual merge commit explicitly.

No release or publication is included; VS Code and deferred #1114 probes are unchanged.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change adds CLI and composed E2E tests for update --all security preflight, registers two test cases, and documents the test plan. It also adds installer integration coverage for stale prepared package revisions.

Changes: Update-all security preflight

Layer / File(s) Summary
CLI preflight and consent tests
cli/internal/agentpluginscli/update_all_security_test.go
Tests assert that a blocked batch returns a preflight failure without state changes or activation. Human-mode tests cover declined and accepted consent for imperative and mixed-saved batches.
Composed preflight journeys
cli/cmd/agentplugins/update_all_security_e2e_test.go, cli/cmd/agentplugins/package_manager_update_security_e2e_test.go, cli/cmd/agentplugins/package_manager_install_e2e_test.go, cli/cmd/agentplugins/testdata/package_manager_install_cases.json, docs/testing/package-manager-e2e.md
Composed tests cover preview, refusal, accepted updates, saved-installation state, and cleanup. The case registry and documentation include both security-preflight journeys.
Update reliability plan and evidence
docs/plans/2026-11-26-installed-package-update-reliability.md
The plan records acceptance criteria, review and qualification gates, scope decisions, and runtime evidence for the update-preflight work and stale-plan investigation.

Stale prepared revision coverage

Layer / File(s) Summary
Stale prepared revision regression test
install/integrationctl/agentplugins/installer/update_prepared_revision_test.go
The integration test checks that applying a stale prepared revision conflicts without changing the committed revision or its recorded effects. It then checks that a fresh preparation succeeds.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

Merge Risk: Moderate · up to 998e0

This draft adds regression tests for update --all security authorization, but it does not yet include the production fix. Those tests are expected to fail until the fix lands. Hold the merge until the authorization change is added and the registered cases pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title "fix(update): authorize complete batches before applying changes" matches the main change. The PR adds a security authorization step for update --all so that every changed imperative prepa…
Description check Passed The description follows the repository template in substance. It has a clear problem and change statement, a verification section with local and hosted gate evidence, and release impact context (no re…
Full details: Title check

Explanation

The title "fix(update): authorize complete batches before applying changes" matches the main change. The PR adds a security authorization step for update --all so that every changed imperative preparation is authorized before any saved or imperative apply. The title is specific and concise, and it follows a conventional-commit style. It does not cover the stale-prepared-update plan item, but the description states that hypothesis did not reproduce and no production change was made for it, so that omission is acceptable.

Full details: Description check

Explanation

The description follows the repository template in substance. It has a clear problem and change statement, a verification section with local and hosted gate evidence, and release impact context (no release or publication included, VS Code and deferred #1114 probes unchanged). The template's checklist items are not literally ticked, and the 'Verification' list items (go test ./..., make lint, make vet, make generated-check) are not explicitly marked as run in those exact forms. The description is long and heavy on run IDs, but the core required information is present and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ce78913 and 998e0f0.

Files selected for processing: 8

  • cli/cmd/agentplugins/package_manager_install_e2e_test.go
  • cli/cmd/agentplugins/package_manager_update_security_e2e_test.go
  • cli/cmd/agentplugins/testdata/package_manager_install_cases.json
  • cli/cmd/agentplugins/update_all_security_e2e_test.go
  • cli/internal/agentpluginscli/update_all_security_test.go
  • docs/plans/2026-11-26-installed-package-update-reliability.md
  • docs/testing/package-manager-e2e.md
  • install/integrationctl/agentplugins/installer/update_prepared_revision_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@777genius 777genius changed the title fix(update): enforce security authorization and prepared-state freshness fix(update): authorize complete batches before applying changes Nov 26, 2026
@777genius
777genius marked this pull request as ready for review November 26, 2026 01:58
@strix-security

Copy link
Copy Markdown

Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here.

So far, Strix has reviewed 392 pull requests, surfaced 113 security issues (1 critical/high) and blocked 3 risky merges across this workspace.

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.12%. Comparing base (78af312) to head (e8da867).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1116   +/-   ##
=======================================
  Coverage   64.12%   64.12%           
=======================================
  Files        2328     2328           
  Lines      141837   141851   +14     
=======================================
+ Hits        90948    90962   +14     
+ Misses      37901    37900    -1     
- Partials    12988    12989    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant