Skip to content

[Feature]: Preview integration mutations using the server ownership plan #5118

Closed

Description

@lidge-jun

Area

Dashboard

What are you trying to accomplish?

Review which managed configuration fields will change before applying, overwriting, disabling or restoring a client integration.

What prevents this today?

Existing writers already snapshot, classify foreign edits, publish atomically and journal recovery. src/server/management/integration-routes.ts:108 exposes mutation controls, while gui/src/pages/integrations/RestoreDialog.tsx:137 shows generic consequences rather than the exact bounded planned paths.

What should OpenCodex do?

Offer a read-only plan from the same server-owned classifier/writer used by mutation. Show change kinds and safe managed paths, never raw before/after values. Bind confirmation to a fingerprint and re-read at commit.

Example usage or interface

Preview reports that a managed provider URL field will be changed and a snapshot will be created, with a foreign-edit status. If a user edits the file before confirmation, mutation rejects or requires a fresh preview instead of applying the stale plan.

Alternatives or workarounds

Raw unified diffs can expose credentials/private settings. Client-side inference duplicates server authority. Existing status remains useful but cannot show operation-specific consequences.

Additional context

Source snapshot: 7864869c31c41cca9830d93540238f17df8faafb after fast-forwarding dev on 2026-09-19. This is source-grounded analysis, not a runtime test result.

This is a reviewability enhancement, not a claim that takeover/restore or transactional recovery is missing.

Implementation path

  1. Extract a pure planning seam in src/integrations/plan.ts around existing ownership classification.
  2. Add authenticated preview routes and bounded response types in src/server/management/integration-routes.ts/route-registry.ts.
  3. Carry operation+fingerprint from preview response through gui/src/pages/integrations/integration-api.ts into existing confirmation dialogs, then validate on mutation.
  4. Reuse existing snapshot/rollback/foreign-edit code; do not create a second client-side planner.
  5. Add read-only, privacy and stale-preview regressions; update structure/clients/integrations.md, management owners and the existing integration guide.

Acceptance criteria and verification

  • Preview performs no config writes, snapshot creation, secret rotation or journal mutation.
  • Returned paths are from an allowlisted managed schema, bounded and value-free.
  • Unchanged state: confirmed plan matches applied mutation. Changed state: safe refusal/recompute.
  • Existing rollback, restore, overwrite and foreign-edit semantics stay intact; dialogs explain the state.

Register new tests in both layout inventories, preserve size caps, and update the existing structure owners. User-facing policy changes need corresponding public documentation and non-contradictory translations. Run focused tests and exact-head hosted CI during implementation; no local suite was run for this analysis.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

  1. added
    enhancement
    on Sep 19, 2026
  2. added
    gui
    on Sep 19, 2026
  3. 4 remaining items

  4. Ingwannu commented on Sep 20, 2026

    @Ingwannu
    Owner

    Implementation is split across merged server preview support in #5185 and the remaining confirmation/UI work in #5197. Keep this issue open until #5197 resolves its stale-plan handling, card-level 409 state, and all-unapplicable batch confirmation gate; screenshots alone do not close those behavior gaps. Once that PR is corrected and merged, verify preview fingerprints are refreshed after 409 and that no mutation occurs from a stale plan, then close this issue.

  5. lidge-jun commented on Sep 20, 2026

    @lidge-jun
    OwnerAuthor

    Implemented on dev through server #5185 (e64d6994eb179dbc6f9e5c073bb1f110503a6247) and dashboard #5197 (ed44e04a933f6d4d62d2e049bf7606f08d347b06). The final dashboard merge tree matches the inspected hosted merge-ref tree 62883f3d4de5bc8c1cb3b1fe30aa8b04b5fb1ef5.

    The shared server planner is read-only, bounded and value-free; confirmations carry operation/fingerprint and revalidate state. Existing restore, overwrite and foreign-edit behavior is retained. Aggregate Aside intent stays on its existing all-profile route while single-profile and ordinary file actions retain bound previews. Stale bulk confirmation preserves completed results and requires an explicit new confirmation. Guides and translations are included.

    Hosted gates at source278513a79e executed the six added aggregate/bulk regressions successfully. The current hosted GUI artifact was driven through twelve baseline states plus the aggregate/refusal/stale/retry flows, with fifteen captured frames and request/action traces inspected. This is fixture-rendered GUI evidence, not a live-backend claim; backend behavior has separate hosted route regression evidence.

    The owner requested immediate integration while the remaining macOS jobs were unfinished. That timing exception is recorded on #5197; complete platform regression and release verification remain tracked separately and are not claimed complete here. Two non-blocking review observations are retained for follow-up. Closing this implementation issue after verified landing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions