Skip to content

fix(profiles): include sync with archive workflows - #1663

Open
clay-good wants to merge 3 commits into
mainfrom
codex/fix-archive-sync-dependency
Open

fix(profiles): include sync with archive workflows#1663
clay-good wants to merge 3 commits into
mainfrom
codex/fix-archive-sync-dependency

Conversation

@clay-good

@clay-good clay-good commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Status

LGTM.

What was wrong

Custom profiles could select archive or bulk archive without selecting sync. The generated archive workflow still called the missing sync workflow, so archive could stop or improvise the main-spec update. Legacy Codex prompt migration could create the same broken combination.

How it was fixed

Profile resolution now includes sync whenever either archive workflow is selected without it. The same dependency resolution is applied when legacy Codex prompts are migrated. Existing core profiles and custom profiles that already include sync are unchanged.

The profile editor keeps custom profiles user-owned: accepting an unchanged effective selection does not convert it to the core preset or rewrite its raw workflow list. Update guidance reports the effective workflow set, so it does not claim that an installed dependency is missing.

Replication / proof

  • Reproduced on current main with a custom profile containing propose, explore, apply, and archive: init generated 4 skills and 4 commands, while archive referenced the absent openspec-sync-specs workflow.
  • The same end-to-end init now generates 5 skills and 5 commands, including sync.
  • Update regression tests start from pre-fix archive-only files and prove repair for skills, commands, and both delivery modes.
  • Init and legacy Codex migration tests cover both archive and bulk archive.
  • Dependency tests prove existing sync is not duplicated or reordered and input selections are not mutated.
  • Profile-editor regressions prove dependency expansion cannot silently convert custom to core or rewrite raw custom workflows during delivery changes.
  • Focused profile, config, init, update, drift, generation, tool-detection, and adapter suites pass.
  • Lint and TypeScript build pass.
  • The full local run passed 3,961 tests. Its 16 loopback-server sandbox failures passed 48/48 with local-network permission. The remaining 2 failures reproduce on untouched main: a stale Cursor deprecated-alias path assertion and detection of the user-level MiniMax installation.

Notes / nits

This completes an existing workflow dependency without changing archive execution, templates, schemas, or file formats. No changeset is included because this routine bug fix follows the normal release cadence.

Related prior approach: #1443 changes archive templates to add a manual fallback. It is currently conflicting and broader in scope; this PR instead ensures the workflow dependency is installed at the shared profile boundary.

Fixes #1650

Summary by CodeRabbit

  • Bug Fixes

    • Custom profiles using archive or bulk-archive workflows now automatically include the required sync workflow.
    • Profile updates accurately report missing workflows and install associated sync files when needed.
    • Legacy Codex archive prompts are correctly replaced while required components are installed.
    • Profile configuration preserves existing custom workflows when selections remain unchanged or only delivery settings change.
  • Tests

    • Added coverage for workflow ordering, profile initialization, update behavior, configuration preservation, and delivery options.

@clay-good
clay-good requested a review from a team as a code owner August 14, 2026 22:35
@clay-good
clay-good requested review from TabishB and removed request for a team August 14, 2026 22:35
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bb1ca37a-2686-4dc3-8fe7-b48a887aa810

📥 Commits

Reviewing files that changed from the base of the PR and between 41b44dd and 5798c09.

📒 Files selected for processing (2)
  • src/commands/config.ts
  • test/commands/config-profile.test.ts

📝 Walkthrough

Walkthrough

Custom profiles that select archive or bulk-archive now receive sync automatically. Initialization, update, and interactive configuration paths apply resolved workflows and preserve custom selections when only delivery settings change.

Changes

Archive Sync Dependency

Layer / File(s) Summary
Resolve archive workflow dependencies
src/core/profiles.ts, test/core/profiles.test.ts
Custom profiles insert sync before archive or bulk-archive when absent. Tests verify ordering, reference preservation, and input immutability.
Apply resolved workflows and report missing items
src/core/update.ts, test/core/init.test.ts, test/core/update.test.ts
Initialization and update paths install sync artifacts. Update notices use validated desiredWorkflows. Legacy Codex workflow inference filters recognized workflows. Tests cover delivery modes and archive prompt replacement.
Preserve custom configuration
src/commands/config.ts, test/commands/config-profile.test.ts
Interactive configuration preserves custom workflows when selections do not change or when only delivery settings change. Tests cover unchanged, delivery-only, and combined changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 5798c

The change ensures archive workflows install their required sync workflow and updates migration and reporting behavior accordingly; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested reviewers: tabishb, alfred-openspec

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes generate sync for archive and bulk-archive profiles and cover legacy Codex migration, satisfying issue #1650.
Out of Scope Changes check ✅ Passed The configuration and test changes support profile dependency resolution and preserve existing custom-profile behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: adding the sync workflow when archive workflows are selected.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-archive-sync-dependency

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.

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.

Feedback: archive-change skill delegates to a skill that openspec init never generates

1 participant