Skip to content

[CTX-1313] fix(plugin): keep fresh CLI installs disabled (#2204) - #2212

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-1313/fix-plugin-install-disabled
Oct 17, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-1313/fix-plugin-install-disabled

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Priority: P0 | Area: plugin | Labels: fix,P0,area:plugin | Milestone: 0.0.24 | RFC: P0-AC-027 through P0-AC-030 | Task: CTX-1313
Follow-up correction task: CTX-1326 is P1 release metadata and delivery-evidence correction work; the merged source task remains the original P0.

Summary

Fresh CLI plugin installs use the staged disabled policy until an explicit
bitty plugin enable <id>. Existing updates preserve the plugin's current
enabled/disabled state. The public library default
(LocalInstallOptions::default()) is unchanged, so existing runtime/developer
callers are unaffected — only the CLI install path opts into staging.

The local path and the successful tails of Git/archive acquisition converge on
this policy. Captured validation does not include a successful Git transport and
installation run; Git/archive convergence is source-path evidence only.

Install has no VM entry in the install path. The malformed-Lua staging test
observed a successful disabled install with empty discover() output. This is
bounded negative evidence; it is not an instrumented invocation counter or full
hostile-hook proof. Consent denial and stdin EOF fail closed before the package
is committed.

Closes #2204.

Changes

  • crates/bitty-terminal/src/plugin.rs (+9/-4)
    • CLI install path uses LocalInstallOptions::staged_and_disabled().
    • report_install no longer appends “enabled” to the success line.
    • Help text corrected: fresh local/Git/archive installs are staged and disabled;
      updates preserve existing state.
  • crates/bitty-terminal/tests/cli_plugin.rs (+245/-16) — real-binary (no mocks) CLI
    regression coverage:
    • Fresh zero-capability install stays disabled until explicit enable; discovery and
      discovered_ids are empty while staged, then activate only after enable.
    • Enabled update preserves the enabled state for v2 and retains the v1 directory;
      it does not activate v2 or explicitly compare v2 grants/version fields. The
      separately exercised v1 and v3 paths provide the actual activation evidence;
      disabled update stays disabled with empty discovery until enable.
    • Capability-increase decline and EOF compare the exact full index (current.json)
      bytes and parsed records/grants before and after, and assert no committed v2
      directory. They do not hash every retained package file.
    • Malformed-Lua install succeeds staged-disabled and discover() is empty. This test
      does not assert discovered_ids(), use an instrumented invocation counter, or prove
      the full hostile-hook surface.
    • Bundled install/enable/disable toggles restored; fresh-install help wording corrected.

Fixes a reviewed blocker

Independent review (PX-6926/PX-6927/PX-6928/PX-6931) raised NEEDS-FIX on the first commit:
the enabled-update execution proof had been replaced and full index/grant equality was
missing. The repair commit adds the scoped state evidence; cumulative independent review
of the two-file source delta returned APPROVE / SOURCEAPPROVE (PX-6955, PX-6991).

Evidence

Rebased onto origin/main at 4d1b2596 (dropping the superseded [CTX-1317]
prerequisite, which already landed on main via #2209); delta is exactly two files.

Gate Result
just fmt-check PASS
just clippy (workspace --all-targets + bitty-terminal dev-tools) PASS
cargo nextest run --workspace --locked 7214 passed, 1 skipped
cargo nextest run -p bitty-terminal --test cli_plugin --locked 18/18 passed

The preserved independent review also records stable just check and explicit
just test success, plus native typecheck and the Windows GNU cross-check. The
mandatory real local Quality result remains incomplete/pending in the preserved
capture; the shard results are not presented as a full Quality pass. Successful
Git transport/install was not run in the captured evidence, and the existing
archive happy path does not prove the disabled bit.

Historical delivery disclosure (CTX-1326 / PX-7123 / PX-7124)

  • PR [CTX-1313] fix(plugin): keep fresh CLI installs disabled (#2204) #2212 was externally merged at 2026-10-17T19:57:09Z, and CTX-1313 was
    completed at 2026-10-17T19:57:39.794888409Z, before mandatory real local
    Quality acceptance was recorded. At the earlier review capture, the Quality attempt had failed during action
    preparation and its recovery capture was incomplete. The stable validator
    subsequently ended at 2026-10-17T20:20:24.912174024Z. The separate final
    addendum reviewed at 2026-10-17T20:25:14Z, recorded in PX-7137/PX-7138,
    accepts SOURCE + FINAL INSPECTED GATE EVIDENCE: full check, explicit test,
    native typecheck, Windows GNU cross-check, and real local Quality all PASS.
    The original incomplete capture is retained unchanged. This later acceptance
    does not establish compliance before publication or merge and does not
    resolve historical D1/D2 or accept release readiness.
  • Current captured GitHub reviews contain no APPROVED review from a non-author;
    the recorded PR review is COMMENTED by the shared PR-author account. The
    exact required Quality gates context is absent while Quality gates (1) and
    Quality gates (2) shards passed. The historical merge/protection mechanism is
    unestablished by these records; this disclosure does not assert a bypass actor
    or mechanism.
  • CodeRabbit status was Review rate limited, not a clean review. No actionable
    CodeRabbit inline comment was captured.
  • TerminalDocs synchronization completed under CTX-0126 at
    2026-10-17T20:38:08.650360041Z, with commander acceptance PX-0430 and PR [CTX-0146] fix(vt): answer DA/XTGETTCAP/DECRQM queries #240
    merged as 61a4981d4898f87c8995ac9b310a1de030e16be6. Overall D4 remains
    pending because the separately owned plugin package-guide synchronization
    handoff is unfinished. This documentation completion does not establish
    complete security acceptance or release readiness.

R-004 / Issue #2206 and S1 remain blocked and separately owned. Fresh owner release
approval remains required before any tag, release, or publication.

reviewer added 2 commits October 18, 2026 03:02
Closes #2204

Keep local, git, and archive CLI installs staged until explicit enable
while preserving existing update desired state and package security gates.
Extend the real CLI regression coverage for enabled and disabled updates,
capability rejection rollback, and no-package-execution staging evidence.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: daba6aef-adfb-4e40-b91e-24d9fa57eb98
📥 Commits

Reviewing files that changed from the base of the PR and between 4d1b259 and d23def8.

📒 Files selected for processing: 2
  • crates/bitty-terminal/src/plugin.rs
  • crates/bitty-terminal/tests/cli_plugin.rs
  • 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

Comment @coderabbitai help to get the list of available commands.

@Xuepoo Xuepoo added fix Bug fix P0 Priority: highest area:plugin Area: plugin host labels Oct 17, 2026
@Xuepoo Xuepoo added this to the 0.0.24 milestone Oct 17, 2026

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review — separate agent (ctx-1313-reviewer, provider custom), HEAD d23def8

Verdict: LGTM (findings: none blocking; three info-level observations, no defect).

Checks run by the reviewer on the exact PR tree:

  • git diff --name-status origin/main d23def8f → M crates/bitty-terminal/src/plugin.rs, M crates/bitty-terminal/tests/cli_plugin.rs (exactly two files).
  • cargo +1.85 check -p bitty-terminal --offline → Finished dev profile ... in 20.26s (MSRV 1.85 clean; no if ... && let let-chains, so no E0658).
  • cargo nextest run -p bitty-terminal --test cli_plugin on d23def8 → 18 tests run: 18 passed, 0 skipped, including plugin_fresh_zero_capability_install_is_staged_until_explicit_enable and plugin_external_install_load_run_update_remove_live.

Acceptance mapping (#2204):

  • Fresh CLI installs remain disabled: install_local_path now builds LocalInstallOptions::staged_and_disabled() instead of ::default(); install_git_source and install_archive_source both funnel through it, so local/Git/archive fresh installs are all staged disabled.
  • Explicit enable permits activation; update preserves enabled state; capability rejection leaves index/grants unchanged — each covered by a named assertion in the new tests.

Residual risk (reviewer): LocalInstallOptions::default() stays enabled for library/embedder callers — intentional scoping (only the CLI path is changed, which is what #2204 asked); just ci-local was not run by reviewer or implementer (per lane rules only one full local gate at a time); remote CI is the remaining signal.

Head note: verification was performed against d23def8 specifically (the shared checkout HEAD was older).


Recorded by the guard tick; this is a reviewer-of-record comment because the environment shares a single GitHub identity (gh pr review --approve on an own-PR is refused).

@Xuepoo
Xuepoo merged commit 1c52ba7 into main Oct 17, 2026
17 checks passed
@Xuepoo
Xuepoo deleted the ctx-1313/fix-plugin-install-disabled branch October 17, 2026 19:57
@Xuepoo

Xuepoo commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Historical disposition for PX-7123/PX-7124 and CTX-1326: source remains APPROVE for merged commit 1c52ba7617e4c42d2fde06c5b318ebefc54aec3b against base 4d1b2596d3b69a54224d18af871f826f1bb6a1c6, with stable f91f8757a0755f4407adf8b5a65839b6453a03ac, PR head d23def8f697cb864046fda8de9ba3fbb7082fce6, and identical tree 7f4b8615b6c08957f3c33716d7774111d2e58671. This disposition corrects evidence wording only; it is not a source fix or approval.

D1/D2 remain historical delivery disclosures: the external merge and CTX-1313 completion preceded mandatory real local Quality acceptance; the current captured records contain no non-author APPROVED review and no exact Quality gates context while the two Quality shards passed. The historical merge/protection mechanism is unestablished, and this comment does not claim a bypass actor or mechanism. The earlier incomplete capture is retained unchanged and is not a full
Quality pass. The stable validator subsequently ended at
2026-10-17T20:20:24.912174024Z; the separate final addendum reviewed at
2026-10-17T20:25:14Z and recorded in PX-7137/PX-7138 accepts SOURCE + FINAL
INSPECTED GATE EVIDENCE with all final gates PASS. Later acceptance does not
establish compliance before publication or merge, resolve historical D1/D2,
or accept release readiness.

D3 corrections: enabled-v2 evidence is state persistence/retained-v1-directory evidence, not v2 activation, grants, or version proof; v1/v3 activation evidence is separate. Malformed-Lua negative evidence is staging plus empty discover() only, without a discovered_ids() assertion, invocation counter, or full hostile-hook proof. Decline/EOF evidence covers exact index bytes and parsed records/grants unchanged plus no committed v2 directory, not every package byte. Successful Git transport/install was not run; Git/archive convergence is source-path evidence only. CodeRabbit was rate-limited, not a clean review, with no actionable inline comment captured. TerminalDocs synchronization completed under CTX-0126 at
2026-10-17T20:38:08.650360041Z, with commander acceptance PX-0430 and PR #240
merged as 61a4981d4898f87c8995ac9b310a1de030e16be6. Overall D4 remains
pending because the separately owned plugin package-guide synchronization
handoff is unfinished. This documentation completion does not establish
complete security acceptance or release readiness.

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

Labels

area:plugin Area: plugin host fix Bug fix P0 Priority: highest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep fresh CLI plugin installs disabled until explicit enable

1 participant