Skip to content

feat(workspace-sync): add portable imports and v2 fork workflows - #7700

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/v2-workflow-sync
Sep 10, 2026
Merged

feat(workspace-sync): add portable imports and v2 fork workflows#7700
icecrasher321 merged 2 commits into
stagingfrom
codex/v2-workflow-sync

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add portable workflow exports and atomic mapped draft imports using shared reference codecs, destination authorization, and source field identities.
  • Expose fork discovery, preview/apply, mappings, push/pull, selectors, recovery, and operation status through shared application use cases and generated v2/CLI contracts. Add stale-preview checks, durable request receipts, resumable copy work, and deployments bound to the admitted graph.
  • Document the CLI/HTTP flow and add a disposable database/HTTP/CLI harness covering concurrent retries, atomic refusal, permissions, both sync directions, pagination, and deployment readiness. Companion skills guidance: feat(skills): add portable imports and workspace sync guidance skills#10.

UI internal routes and v2 routes call the same authorized fork/sync application use cases, which reuse the existing create, promote, copy, remap, and rollback engine. The UI retains its current request/response and completion flow; v2 adds preview-bound receipts and durable completion through explicit admission options in that shared engine.

Type of Change

  • New feature and additive database migration

Testing

  • 28 end-to-end scenarios passed with disposable PostgreSQL 17, real API-key authorization, HTTP adapters, CLI subprocesses, transaction locks, and deployment workers. External providers and the separate realtime process use controlled fixtures; this does not certify live provider accounts.
  • Full app Vitest suite: 47,720 passed, 153 skipped, including existing fork/sync and internal-route compatibility tests. Full CLI suite: 1,025 passed, 3 skipped.
  • All 26 package type checks, lint, 46 release audits, API validation, generated OpenAPI/CLI/docs checks, and migration safety against latest staging passed. The harness tests a fresh schema; migration safety is reviewed separately.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@icecrasher321
icecrasher321 requested a review from a team as a code owner September 9, 2026 23:47
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 10, 2026 12:14am UTC

Request Review

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile-apps @greptile Please review this PR despite the file-count limit.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

No new actionable issue was established in the changes since the previous review, so the latest revision appears safe to merge from this review’s scope.

Summary

  • Adds mapped, atomic workflow imports with preview fingerprints and durable operation receipts.
  • Adds fork discovery, preview/apply, push/pull, mapping, recovery, and operation-status APIs.
  • Adds resumable copy and deployment work tied to admitted workflow snapshots.
  • Extends generated CLI/OpenAPI documentation and disposable PostgreSQL integration coverage.

Diagram

sequenceDiagram
    participant Client
    participant Preview as Preview API
    participant Apply as Apply API
    participant DB as Transaction and receipts
    participant Outbox as Durable outbox
    participant Worker as Copy/deployment workers

    Client->>Preview: Submit mappings and sync choices
    Preview-->>Client: Fingerprint, plan, unresolved bindings
    Client->>Apply: Confirm with requestId and fingerprint
    Apply->>DB: Authorize, verify revision, commit admitted graph
    DB-->>Client: Operation receipt
    DB->>Outbox: Enqueue immutable copy/deployment work
    Outbox->>Worker: Process resumable operations
    Client->>Apply: Poll operation status
    Apply-->>Client: Completion and deployment readiness
Loading

Reviews (2) · Last reviewed commit: "fix(workspace-sync): preserve activity a..."

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

Regarding “Sync effects run twice”: the reviewed commit already returns the admitted receipt before reaching either legacy side effect.

  • promoteFork returns at lines 1310–1311 when txResult.operation.syncResult is present. Receipt replays return immediately above it.
  • admitForkSync always sets syncResult: result on the report it persists and returns. Therefore an admitted sync cannot reach performFullDeploy or scheduleForkContentCopy below that return; those calls serve legacy requests without admission.
  • The PostgreSQL integration test now also checks all deployment-operation and deployment-version rows for the target after five concurrent requests, worker completion, and a retry. It requires exactly the one attempt and version recorded in the receipt. The same test checks that a subsequent draft edit cannot alter the admitted deployment and that polling reaches readiness.

This finding does not require a production-code change. The review-fix commit separately restores actor names in fork/sync activity and updates the existing route and API-contract tests for the shared application boundary.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile-apps @greptile Please review the latest commit despite the file-count limit, including the control-flow clarification above.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@icecrasher321
icecrasher321 merged commit ccc6f9e into staging Sep 10, 2026
42 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/v2-workflow-sync branch September 10, 2026 01:36
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