Skip to content

Plan exclusive --adapter targeting for installation commands - #540

Open
eXamadeus wants to merge 1 commit into
mainfrom
julian/filter-adapters
Open

Plan exclusive --adapter targeting for installation commands#540
eXamadeus wants to merge 1 commit into
mainfrom
julian/filter-adapters

Conversation

@eXamadeus

@eXamadeus eXamadeus commented Aug 22, 2026

Copy link
Copy Markdown
Member

Why

Projects with multiple installed adapters currently materialize every facet into every compatible adapter. There is no way to say "this project's Facet-managed state belongs in OpenCode only" for a given invocation without hand-deleting files afterwards.

This PR is the plan for that feature, not the feature: it adds the OpenSpec change filter-installation-by-adapter (proposal, design, delta specs, task plan). No product code changes — facet add, facet install, and facet remove behave exactly as they do today.

Details

The central decision is that explicit --adapter targets are exclusive, not additive. Every named adapter receives the complete desired project state, and every other installed materialization-capable adapter is purged of all receipt-owned assets and MCP entries in the same atomic operation.

That choice is what keeps the rest of the design small. Leaving non-target adapters untouched would require adapter-scoped receipt history so later filtered updates and removals could still prove what they were allowed to delete. Because no successful operation leaves project-owned state behind in a discoverable non-target adapter, the machine-local receipt stays adapter-agnostic at schema 0.4 — no adapter dimension, no version bump, no migration.

Constraints worth reviewing:

  • The manifest and lockfile remain project-wide desired state. Targets control physical placement only, and nothing persists them.
  • Purge authority comes from the receipt alone; untracked native files are never touched.
  • Target and purge validation completes before the project lock. An unknown, unavailable, broken, or incapable adapter on either side aborts with no state changed.
  • Purge and target transitions share one transaction with byte-exact rollback, purge first.
  • MCP consent is unchanged. Targeting never manufactures approval or forces re-approval.

One deliberate behavioral regression outside the new flag: the adapter-agnostic removal-refinement fast path is retired globally rather than taught target/purge roles. Every removal will resolve complete remaining target state from cache or source before mutating, so a cold-cache facet remove with no source access will fail unchanged instead of completing receipt-only. Design decision 7 records the trade-off.

The task plan sequences this across ten phases: CLI parsing and flag strictness, engine scope migration and asset purge, MCP purge and frozen mode, scope reporting and failure remedies, then integration, documentation, and release metadata.

Verification

Nothing to run — the diff is planning artifacts plus two .gitignore entries. All four artifacts are complete per bun openspec status, and each went through independent adversarial authoring, comparison review, and reconciliation.

@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 79bf40e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor

cursor Bot commented Aug 22, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

eXamadeus commented Aug 22, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@eXamadeus, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

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

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

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec8b2e66-5b94-471a-81cb-b90b979d33c9

📥 Commits

Reviewing files that changed from the base of the PR and between 9cdacdf and 79bf40e.

📒 Files selected for processing (8)
  • openspec/.gitignore
  • openspec/changes/.gitignore
  • openspec/changes/filter-installation-by-adapter/.openspec.yaml
  • openspec/changes/filter-installation-by-adapter/design.md
  • openspec/changes/filter-installation-by-adapter/proposal.md
  • openspec/changes/filter-installation-by-adapter/specs/cli/spec.md
  • openspec/changes/filter-installation-by-adapter/specs/installation/spec.md
  • openspec/changes/filter-installation-by-adapter/tasks.md

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.

@eXamadeus
eXamadeus force-pushed the julian/filter-adapters branch from beb94b4 to 799e322 Compare August 22, 2026 14:39
@eXamadeus
eXamadeus force-pushed the julian/08-19-bump_viper-plans_to_1.3.0 branch from 50b4b8e to 6c71c97 Compare August 22, 2026 14:39
@cursor

cursor Bot commented Aug 22, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@eXamadeus
eXamadeus changed the base branch from julian/08-19-bump_viper-plans_to_1.3.0 to graphite-base/540 August 22, 2026 14:40
@eXamadeus
eXamadeus force-pushed the julian/filter-adapters branch from 799e322 to 71610cd Compare August 22, 2026 14:41
@cursor

cursor Bot commented Aug 22, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

1. **Purge:** remove every receipt-owned asset and MCP configuration entry from every adapter in `purge`, regardless of whether the identity remains in project desired state.
2. **Target reconciliation:** remove obsolete target-owned identities and materialize the complete desired project state into every adapter in `targets`.

P1 Badge Compose overlapping asset transitions before purging

When a target adapter and a purge adapter resolve an asset to the same physical path, the required pre-mutation planning can mark the target install as unchanged because the file currently exists (packages/adapter/src/types.ts:105-109), after which the purge phase deletes it and target reconciliation performs no write. The operation can therefore report success while the target is missing desired content; unlike MCP documents, the design and tasks define no composition, re-planning, or overlap rejection for asset paths. Require overlapping asset transitions to be composed or rejected before applying this two-phase plan.


run: () => $`bun dev install --accept-mcp`.quiet().then(() => undefined),

P1 Badge Do not auto-approve MCP declarations during bootstrap

When a repository facet introduces or changes an MCP declaration, or an existing native entry requires takeover, every routine bun install now supplies the preapproved consent policy automatically, while .quiet() prevents the developer from seeing the command, URL, or takeover being authorized. This silently writes potentially executable coding-tool configuration during dependency setup instead of obtaining the machine-local explicit approval promised by the CLI; leave the flag off so bootstrap reports the pending declaration, or make approval a separate explicit setup action and document it in the development instructions.

AGENTS.md reference: scripts/AGENTS.md:L1-L2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cursor
cursor Bot changed the base branch from graphite-base/540 to main August 22, 2026 14:41
@eXamadeus
eXamadeus force-pushed the julian/filter-adapters branch from 71610cd to 4579b17 Compare August 22, 2026 14:41
Adds the OpenSpec change `filter-installation-by-adapter` — proposal, design, delta specs, and task plan. Planning artifacts only; no product code changes, so `facet add`, `facet install`, and `facet remove` behave exactly as before.

Explicit targets are exclusive: each named adapter receives the complete desired project state and every other installed capable adapter is purged of receipt-owned assets and MCP entries in the same transaction. That is what keeps the machine-local receipt adapter-agnostic at schema `0.4` — no adapter dimension, no migration.

The plan also retires the adapter-agnostic removal-refinement fast path globally rather than teaching it target and purge roles. Every removal resolves the complete remaining target state from cache or source before mutating, so a cold-cache removal without source access fails unchanged instead of completing receipt-only.

Also gitignores the local OpenSpec archive and `adversarial/` review artifacts.
@eXamadeus
eXamadeus force-pushed the julian/filter-adapters branch from 4579b17 to 79bf40e Compare August 22, 2026 14:43
@eXamadeus eXamadeus changed the title Add --adapter exclusive targeting spec for installation commands Plan exclusive --adapter targeting for installation commands Aug 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79bf40ecba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


There is no deferred reconciliation state and no adapter-specific catch-up metadata. A later operation simply applies its own target/purge partition. An unfiltered operation targets every installed materialization-capable adapter and purges none.

The existing adapter-agnostic removal-refinement path SHALL be disabled globally rather than expanded to prove role-aware target/purge transitions. Every removal SHALL resolve complete remaining target state before mutation, using cached content when available and source/network resolution on cache miss. This intentionally changes the execution strategy for unfiltered removal: a cold-cache invocation without source availability SHALL fail unchanged instead of completing through receipt-only refinement. Target selection, placement postconditions, and receipt-driven deletion authority remain unchanged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace the canonical removal-refinement requirement

Disabling refinement here does not update the existing Removing a facet uninstalls it requirement in openspec/specs/installation/spec.md, which still requires fully tracked removal-only operations to refine locally without fetching and includes cold-cache offline-success scenarios. Applying this delta therefore leaves the normative specification requiring the exact path this design and task 4.5 remove, so implementation and acceptance tests cannot satisfy both; add a MODIFIED replacement for that requirement and its affected scenarios.

Useful? React with 👍 / 👎.


### Requirement: Unsupported MCP adapters are reported completely

When active MCP declarations exist and any target adapter declares no MCP support, the command SHALL fail before prompting or mutation. When the receipt owns an effective MCP identity requiring deletion from a purge adapter and that adapter cannot safely plan the removal, the command SHALL also fail before prompting or mutation. One error SHALL identify every affected adapter and SHALL give actionable remediation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate MCP cleanup capability for target adapters

When there are no active MCP declarations but the receipt owns a stale server that must be deleted from a target adapter—for example after removing or omitting the last declaration—neither condition here requires that target to support planning the deletion; cleanup capability is checked only for purge adapters. The modified requirement previously covered receipt-owned identities needing deletion on every selected adapter, and without that gate the operation can drop the receipt claim while leaving the native entry orphaned. Require cleanup support for targets whenever receipt-owned MCP deletion is pending.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds planning artifacts for exclusive --adapter targeting without changing product code.

  • Defines target reconciliation and receipt-authorized non-target purging.
  • Specifies validation, transaction, rollback, consent, reporting, and frozen-lockfile behavior.
  • Provides a phased implementation, testing, documentation, and release plan.

Confidence Score: 5/5

The planning-only PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "Plan exclusive `--adapter` targeting for..." | Re-trigger Greptile

@eXamadeus eXamadeus added the greptile-review Ensure Greptile reviews this PR label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greptile-review Ensure Greptile reviews this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant