Skip to content

[CTX-1409] chore(architecture): retire Core dependency resolver (Refs #1999) - #2354

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1409/chore-retire-resolver
Oct 21, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1409/chore-retire-resolver

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: architecture | Labels: chore,P1,area:architecture | Milestone: 0.0.25 | RFC: W-72 / OQ-021 | Task: CTX-1409

Refs #1999. Partial, well-specified slice; the remaining migration is blocked on bitty-plugin-manager#11 and on the undecided signature-depth split, so this PR does not close the issue.

Scope of this PR

W-72 assigns dependency resolution to the external bitty-plugin-manager. Core's draft resolver had zero live consumers: startup re-verification uses the manifest/lock/integrity primitives, and bitty-plugin-host's runtime registry keeps its own in-memory graph check (resolve_all, cycles/missing deps/service satisfaction) without the package resolver. Retire the module and the plumbing that existed only to feed it:

  • delete crates/bitty-package/src/resolver.rs (911 lines: PackageIndex, IndexEntry, resolve, resolve_preserving_locked, budgets, yank/prerelease solving);
  • drop its re-exports and RFC-mapping rows from bitty-package/src/lib.rs, plus the crate README claims;
  • drop PluginDependency::as_package_edge (the manifest-to-resolver conversion; no production caller) and the two tests that only exercised it (registry.rs resolver plumbing test, manifest_toml.rs resolver-edge assertion; the parsed prerelease bit stays covered);
  • remove the resolver-only hostile tests (cycles/diamond, yanked, prerelease selection, comma-order invariance, resolver budget). The retained hostile suite still covers manifest/lock corruption, signatures/trust, source grammar, capability escalation, fetch budgets, and install refusal.

Retained deliberately, with the reason recorded in boundary.rs:

  • Publisher trust + Ed25519 (trust.rs, V-A/V-B/V-C), because security corpus R-015/P0-AC-028 requires it and package-manager-boundary.md leaves install-time vs startup signature depth undecided.
  • Lockfile digest triple, integrity pipeline, startup re-verification, source grammar, the shared Core-retained boundary artifacts.
  • Transactional activation/rollback and the lifecycle state machine (P0-AC-029/R-015 evidence).
  • Install verification, local install paths, and the bitty plugin CLI: the accepted W-72 migration rule says install or verification behavior is not removed before the replacement boundary exists. Manager feat(term-state): implement bitty-term-state crate: Terminal Truth core #11 is still open and its repository still has only the downstream git fleet.

Guard and mutation proof

New crates/bitty-package/tests/distribution_boundary.rs:

  • resolver_module_is_retired_from_core rejects the retired module path, a re-declared mod resolver; in bitty-package, and the resolver's public symbols across all Core sources — including a duplicate with no Cargo edge or module declaration (the W-147 fence's source-level blind spot).
  • dependency_resolution_stays_manager_owned pins PackageOperation::DependencyResolution to ExternalManager.

Mutation runs (probes deleted afterwards, nothing committed):

  1. Re-created crates/bitty-package/src/resolver.rs with pub struct PackageIndex; -> FAIL [bitty-package::distribution_boundary resolver_module_is_retired_from_core], panic: retired distribution module must stay absent: crates/bitty-package/src/resolver.rs.
  2. Added crates/bitty-plugin-host/src/resolver_probe.rs containing pub struct PackageIndex; with no module declaration and no Cargo edge -> same named guard FAIL, panic lists .../crates/bitty-plugin-host/src/resolver_probe.rs: PackageIndex.
  3. Removed the probe -> 2 tests run: 2 passed.

rg for the retired identifiers/symbols in crates/*/src is clean; the only matches are the guard test's own denylist.

Verification (head c67ded9, rebased on 2d23dba)

  • cargo fmt --all -- --check: clean.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo nextest run --workspace --locked: 7647 passed, 0 failed, 3 skipped.
  • cargo test --workspace --doc --locked: pass.
  • cargo check --target x86_64-pc-windows-gnu --workspace --all-targets --locked: clean.
  • Distribution flows: bitty-terminal::{cli_plugin,fetch_env,verify_w147_small_core_graph} -> 37 passed (install/verify/refuse, hostile archive members, zip-bomb pre-extraction, remote-source refusal, W-147 graph + source fence incl. every_direct_extension_dependency_is_fenced).
  • bitty-package: 201 passed (retained hostile + transaction suites + the new guard).
  • just markdownlint: 0 issues. just scratch-paths: OK.
  • just ci-local / act intentionally not run (task instruction). First clippy attempt hit a full filesystem; reran with CARGO_INCREMENTAL=0 after clearing this task's incremental cache and it passed. After the rebase onto 2d23dbac, the affected suites and the distribution flows were re-run on the rebased tree: bitty-package + bitty-plugin-host 716 passed; cli_plugin + fetch_env + verify_w147 38 passed.

Docs sync

bitty-terminal-docs#264 (Markdown-only, merged as 9d98dd50) drops the retired resolver from the release-ladder and core-boundaries implemented-status claims. boundary.rs, lib.rs, and the crate README record the retirement and the retained set in-repo.

Open points / remainder (not implemented here)

  1. bitty-plugin-manager#11 is open; no registry reader, solver, or upstream fleet exists, so Core cannot delegate bitty plugin install|remove|enable|disable|revoke|info yet. The CLI and install pipeline stay fail-closed and unchanged.
  2. Install-time verification/trust/lock/source/activation migration stays blocked by the W-72 rule and the security corpus.
  3. Signature/provenance depth (install-time vs startup) is still an open point in bitty-docs/docs/development/package-manager-boundary.md; no contract is invented here.
  4. The removed implementation is recoverable for the manager's reference at 54c24691:crates/bitty-package/src/resolver.rs (local mirror sha256 08bad8d873cb08695599c4b6b0fcdd97d29d9b11d7ad6c5122ea31c276ff8eab). Manager feat(term-state): implement bitty-term-state crate: Terminal Truth core #11 owns its own solving contract; this is not a proposed merge source.

Do not merge without independent review + CI, per lifecycle. Commander integrates.

@Xuepoo Xuepoo added this to the 0.0.25 milestone Oct 20, 2026
@Xuepoo Xuepoo added chore Chore / maintenance P1 Priority: high area:architecture labels Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 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 8 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: 8e56c3f5-51fc-4639-9a13-e22f539644c4
📥 Commits

Reviewing files that changed from the base of the PR and between 1cad613 and d2520b2.

📒 Files selected for processing: 10
  • crates/bitty-package/README.md
  • crates/bitty-package/src/boundary.rs
  • crates/bitty-package/src/lib.rs
  • crates/bitty-package/src/resolver.rs
  • crates/bitty-package/src/version.rs
  • crates/bitty-package/tests/distribution_boundary.rs
  • crates/bitty-package/tests/hostile.rs
  • crates/bitty-plugin-host/src/manifest.rs
  • crates/bitty-plugin-host/src/registry.rs
  • crates/bitty-runtime/src/plugin_runtime/manifest_toml.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.

W-72 assigns dependency resolution to bitty-plugin-manager and no Core
path consumed bitty-package's draft resolver: startup re-verification
uses manifest/lock/integrity primitives, and the plugin-host registry
only needed its own in-memory graph check. Retire the module, its
re-exports, the test-only prerelease plumbing (as_package_edge), and
the resolver-specific hostile tests.

Retained deliberately: publisher trust and Ed25519 verification
(security corpus R-015/P0-AC-028, signature-depth split still open),
lockfile digest triple, integrity pipeline, source grammar,
transactional activation/rollback (P0-AC-029 evidence), the install
pipeline/local install paths, and the bitty plugin CLI. The W-72
migration rule forbids removing install or verification behavior
before the manager replacement (manager #11) exists.

New named guard tests/distribution_boundary.rs::
resolver_module_is_retired_from_core rejects the retired module path,
resolver module declarations, and the resolver's public symbols across
Core sources, including duplicates without a Cargo edge. Mutation
proof: planting the module (or a PackageIndex symbol in another crate's
source) fails the guard; removing it passes.

Refs #1999. Remainder on the issue: manager #11 replacement, install
verification/trust/lock/source/activation/CLI migration, and the
signature-depth decision.
@Xuepoo
Xuepoo force-pushed the ctx-1409/chore-retire-resolver branch from c67ded9 to d2520b2 Compare October 21, 2026 01:11
@Xuepoo
Xuepoo merged commit 67b09ed into main Oct 21, 2026
18 checks passed
@Xuepoo
Xuepoo deleted the ctx-1409/chore-retire-resolver branch October 21, 2026 01:35
@Xuepoo

Xuepoo commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Approval at c67ded97 integrated.

  • Rebased onto current main (1cad613e) as head d2520b25; the only delta since approval is the trivial stale-comment fix in crates/bitty-package/src/version.rs ("for the resolver" -> "for manifest and compatibility validation").
  • All required checks green on d2520b25: Quality gates (1)/(2), MSRV 1.85, Linux X11/Wayland, macOS ARM64, Windows, Supply chain, CodeQL, VM tier, extension pin drift, M1/compat aggregates.
  • Merged with gh pr merge --squash --admin --delete-branch.
  • Merge SHA: 67b09edb0140e898f4a5ef45bc9cc3ce39198563.

#1999 remains OPEN on purpose (Refs): manager #11, install-verification/trust/lock/source/activation/CLI delegation, and the signature-depth decision remain the documented remainder. Task CTX-1409 closes after independent-review bookkeeping; worktree and target cache are being cleaned.

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

Labels

area:architecture chore Chore / maintenance P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant