Skip to content

fix(workflows): remove unavailable core-profile handoffs - #1735

Closed
clay-good wants to merge 3 commits into
mainfrom
codex/fix-core-workflow-handoffs-1734
Closed

clay-good wants to merge 3 commits into
mainfrom
codex/fix-core-workflow-handoffs-1734

Conversation

@clay-good

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

Copy link
Copy Markdown
Collaborator

Status

LGTM after hardening at 03631d8d5. All CI checks pass, including Linux, macOS, Windows, security, and CodeRabbit. Maintainer review remains a merge gate; this PR is not merged.

What was wrong

Core installs neither continue nor new, but update/apply handoffs still named them. The CLI's runtime apply instructions also recommended the missing continue skill, including when planning was complete but its tracking file was missing or empty.

Fixes #1734. Follows up on #963 and #919's default-profile acceptance criteria. Preserves the existing #913 archive/sync dependency and #1409 profile-aware console guidance.

How it was fixed

  • Replace optional handoffs with concept-based guidance and existing CLI commands: status / instructions for missing artifacts, new change for distinct intent.
  • Put recovery at the failure point, preserve the selected store, and keep update planning-only.
  • Remove unavailable workflow recommendations from runtime JSON and text output. Distinguish missing artifacts from tracking-file repair, where no artifact may be ready. Preserve the schema's full tracking path.
  • Regenerate the two affected distributed skills and parity hashes; include a patch changeset.

This follows PR #726's decision 9. No new transformer, CLI command, dependency, core workflow, schema field, or artifact-graph behavior. Task parsing, readiness, progress, and completion calculations are unchanged.

Replication / proof

  • Reported reference counts on main: update → continue 5, update → new 2, apply → continue 1. All become 0.
  • Original regression set: 215 failures / 429 cases on unchanged main. Hardening additionally reproduces 5 runtime recovery failures on the original PR head and 2 false negatives in the test reference guard.
  • Coverage includes all skill-capable tools (including global-only MiniMax), delivery modes, core/full custom/update-only/archive+sync profiles, fresh init, stale refresh, and profile switching.
  • Custom-schema CLI cases cover local/store scope, missing artifacts, missing/empty/text-less tracking, read-only instructions, preserved plans, and blocked → ready → all-done transitions.
  • CI run: 4,677 tests pass on both Linux and macOS; Windows has 4,610 passed, 67 platform skips. All required checks pass.
  • 555 focused local tests pass, as do build, lint, source/changed-test type checks, changeset validation, and deterministic regeneration.
  • Three subagents reviewed workflow semantics, tests, and Cloud warnings. The follow-up semantic review is LGTM.

Notes / nits

  • fix(update): close the dead end for partially populated glob artifacts #1733 remains separate: no expansion of update's write targets or partially populated glob semantics. Its eventual textual merge must preserve both fixes.
  • Refactor skill packaging so optional workflows do not break default experiences #919's broader packaging discussion remains open; this does not promise every optional-only custom combination is dependency-free.
  • Cloud warnings on the initial head cited unchanged baseline code/specs, not introduced drift. No unrelated repairs were added.
  • Tests verify emitted guidance and CLI contracts, not an agent executing prose. Local tests isolate global skill discovery and shell settings. A parallel rerun was terminated with exit 137; the serial run had 4,676 passes and one failure in the unchanged binary version-probe test. That entire file passed on isolated rerun (48 tests). Neither local run is represented as a full pass; the complete cross-platform CI results above are green.

Summary by CodeRabbit

  • Workflow Improvements

    • Streamlined update and apply guidance by removing optional workflow handoffs.
    • Added clear CLI-based recovery steps for missing or blocked planning artifacts.
    • Preserved store selection when checking status and retrieving instructions.
    • Intent changes now direct users to create a new change explicitly.
    • Improved tracking-file recovery when planning is complete.
  • Bug Fixes

    • Improved workflow guidance consistency across generated profiles and tools.
    • Prevented references to workflows that are not installed.

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

coderabbitai Bot commented Aug 28, 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: Team

Run ID: 89a96329-679f-4971-9828-e4fd256f382a

📥 Commits

Reviewing files that changed from the base of the PR and between 03631d8 and 194116c.

📒 Files selected for processing (3)
  • test/core/init.test.ts
  • test/core/templates/skill-templates-parity.test.ts
  • test/utils/command-references.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The update and apply workflows no longer reference optional workflow handoffs. Missing artifacts and tracking files now use direct CLI recovery guidance. Tests cover generated references, profile transitions, CLI recovery, and updated template hashes.

Core workflow handoffs

Layer / File(s) Summary
CLI recovery guidance
src/core/templates/workflows/*.ts, src/commands/workflow/instructions.ts, skills/openspec-*-change/SKILL.md, .changeset/fix-core-workflow-handoffs.md
Workflow guidance now directs missing-artifact and tracking-file recovery through status and instructions commands. Intent changes use openspec new change.
Profile-generated reference validation
test/commands/profile-handoffs.test.ts, test/core/templates/profile-handoffs.test.ts
Tests verify that generated content references only installed workflows and that local and store-scoped CLI recovery works.
Template regression coverage
test/core/templates/update-change.test.ts, test/utils/command-references.test.ts, test/core/init.test.ts, test/core/templates/skill-templates-parity.test.ts
Tests assert the removed handoffs, new CLI guidance, and refreshed template hashes.

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

Merge Risk: ⚪ Minimal · up to 19411

Update and apply guidance now uses available CLI recovery commands instead of unavailable core-profile workflow handoffs. The covered recovery and profile-generation paths indicate no remaining merge-blocking risk.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant OpenSpecCLI
  participant Schema
  Workflow->>OpenSpecCLI: Request status for the change
  OpenSpecCLI->>Schema: Resolve artifact rules and tracking configuration
  Schema-->>OpenSpecCLI: Return instructions and template
  OpenSpecCLI-->>Workflow: Return recovery guidance
Loading

Suggested reviewers: mc856

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing unavailable handoffs from core-profile workflows.
Linked Issues check ✅ Passed The changes address issue #1734 by removing references to unavailable continue and new workflows, adding CLI-based recovery guidance, preserving profile-aware behavior, and covering the fix with regre…
Out of Scope Changes check ✅ Passed The changes are within scope. The templates, runtime instructions, generated skills, tests, parity hashes, and patch changeset all support removal of unavailable core-profile handoffs and recovery beh…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 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-core-workflow-handoffs-1734

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.

@openspec-cloud

Copy link
Copy Markdown
Contributor

▶ View full results and scan again

🔎 11 requirements drifted — 7 pointing at code, 4 at stale specs.

AI-generated · A citation proves the line exists, not that it makes the case — verify before acting.

On 728b94d; 2 requirements could not be verified — not a clean result.

🔴 Apply Instructions Command — code is wrong · high

Expectedopenspec/specs/cli-artifact-workflow/spec.md:214

The system SHALL generate schema-aware apply instructions via `openspec instructions apply`.

Observedsrc/commands/workflow/instructions.ts:388

const tracksFile = applyConfig?.tracks ?? null;
First observed in retained OpenSpec Cloud history728b94d in PR #1735.

Next → fix the code at src/commands/workflow/instructions.ts:388 so it satisfies the requirement.
Protect the fix: add a regression check and link it from this requirement.

Agent prompt

Update the implementation starting at src/commands/workflow/instructions.ts:388 so it satisfies the requirement in openspec/specs/cli-artifact-workflow/spec.md (line 214). Add or update a regression check for that behavior. Do not edit the requirement or any specification file.

🔴 Archive Command Argument Support — code is wrong · high

Expectedopenspec/specs/cli-update/spec.md:155

The archive slash command template SHALL support optional change ID arguments for tools that support `$ARGUMENTS` placeholder.

Observedsrc/core/command-generation/adapters/opencode.ts:30

* Frontmatter: description. $ARGUMENTS is injected after the complete input
First observed in retained OpenSpec Cloud history728b94d in PR #1735.

Next → fix the code at src/core/command-generation/adapters/opencode.ts:30 so it satisfies the requirement.
Protect the fix: add a regression check and link it from this requirement.

Agent prompt

Update the implementation starting at src/core/command-generation/adapters/opencode.ts:30 so it satisfies the requirement in openspec/specs/cli-update/spec.md (line 155). Add or update a regression check for that behavior. Do not edit the requirement or any specification file.

🔴 Slash Command Updates — code is wrong · high

Expectedopenspec/specs/cli-update/spec.md:52

The update command SHALL refresh existing slash command files for configured tools without creating new ones, and ensure the OpenCode archive command accepts change ID arguments.

Observedsrc/core/command-generation/adapters/opencode.ts:30

* Frontmatter: description. $ARGUMENTS is injected after the complete input
First observed in retained OpenSpec Cloud history728b94d in PR #1735.

Next → fix the code at src/core/command-generation/adapters/opencode.ts:30 so it satisfies the requirement.
Protect the fix: add a regression check and link it from this requirement.

Agent prompt

Update the implementation starting at src/core/command-generation/adapters/opencode.ts:30 so it satisfies the requirement in openspec/specs/cli-update/spec.md (line 52). Add or update a regression check for that behavior. Do not edit the requirement or any specification file.

8 more findings are in the full check.

View results · Click Refresh, then Scan again in the check. Or comment /openspec-cloud.

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The core-profile handoff fix is consistent across runtime output, distributed skills, and generated templates. Missing planning artifacts and missing or empty tracking files now get distinct, actionable recovery without assuming optional workflows, while store scoping and planning-only boundaries are preserved. CI is green.

Regenerates the skill/command parity hashes and the shipped skills/ mirror
after the merge; main moved explore, ff-change, and propose.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deploying openspec-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 194116c
Status: ✅  Deploy successful!
Preview URL: https://6c2b308c.openspec-docs.pages.dev
Branch Preview URL: https://codex-fix-core-workflow-hand.openspec-docs.pages.dev

View logs

clay-good added a commit that referenced this pull request Sep 7, 2026
#1735 fixes the same issue (#1734) by removing the optional handoffs outright.
This PR resolves them at generation time instead, which is strictly better for
the template layer: an install that has `continue` still gets told about it.
So the mechanism here wins and #1735's content is folded in, rather than the
two competing for the same lines.

What #1735 had that this did not:

- src/commands/workflow/instructions.ts. The CLI's own runtime strings named
  the openspec-continue-change skill. Those are chosen at run time, so
  optionalWorkflow() cannot reach them; taken from #1735 verbatim.
- The blocked-state fallback. It was a one-line pointer; it now carries #1735's
  full CLI recovery (select the next `ready` artifact, not `skipped` or
  `blocked`, read its rules with `openspec instructions`, keep the selected
  `--store` on both commands) plus the tracking-file repair path and the
  `missingArtifacts` field it branches on. The installed branch still names
  `/opsx:continue`, so neither audience loses.

#1735's update-change.ts rewrite is not carried over: this PR already covers
all six of those sites conditionally, which is the better answer.

Both of #1735's test suites come across, and they are worth more here than
there. test/core/templates/profile-handoffs.test.ts asserts that no generated
file names an uninstalled workflow across every tool and all three delivery
modes, which is the property this PR's mechanism exists to provide, and it
passes against it. test/commands/profile-handoffs.test.ts covers the runtime
CLI strings. The two guards are complementary: that one is broad on tools and
deliveries, this PR's own profile-workflow-references.test.ts is broad on
workflow subsets.

#1735's command-references.test.ts assertions could not be carried as written,
since they assume the reference is gone unconditionally. Replaced with a case
that resolves the template against a set without `continue` and asserts the
fallback carries the whole recovery. Verified it fails when the fallback is
shortened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@clay-good

Copy link
Copy Markdown
Collaborator Author

Closing as folded into #1775 (8ae4763ce). Both PRs closed #1734 and both rewrote the same lines in apply-change.ts and update-change.ts, so they were competing for the same fix rather than complementing each other; my mistake for opening the second one without noticing.

#1775 keeps the mechanism, because it is the better one: this PR removed the optional handoffs unconditionally, which fixes the core profile by taking /opsx:continue away from everyone including installs that have it. #1775 resolves the reference at generation time, so each install gets the answer that is true for it.

Everything this PR had that #1775 lacked is carried over, not dropped:

The one thing not carried over is the update-change.ts rewrite, since #1775 already handles all six of those sites conditionally.

No work lost, and #1734 is still closed by #1775.

@clay-good clay-good closed this Sep 7, 2026
pull Bot pushed a commit to mosugi/openspec that referenced this pull request Sep 16, 2026
…its (Fission-AI#1775)

* fix(templates): stop generated skills naming workflows the profile omits

The `core` profile installs six of the twelve workflows, but the update
and apply templates named `/opsx:continue` (6 times) and `/opsx:new`
(twice) regardless. On a default install those became
`/openspec-continue-change` and `/openspec-new-change` — skills that were
never written — so `update-change` refused to create a missing artifact
and handed off to a dead end. The only guard was a sentence asking the
model to check availability at runtime, 70 lines above the two places it
hits the wall.

`command-references.ts` decides how a reference is spelled; nothing
decided whether it should be emitted at all. Add that: templates author
both wordings with `optionalWorkflow()`, and `getSkillTemplates()` /
`getCommandTemplates()` — the one place every generation path already
funnels the resolved workflow set through — pick a branch before the
reference transformers run. A profile that omits a workflow now gets a
concrete `openspec status` / `openspec instructions` fallback instead of
a reference to a skill that does not exist.

Closes Fission-AI#1734

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(changeset): describe profile-aware workflow references

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(init): assert the core profile names no uninstalled workflow

The end-to-end init test pinned the runtime availability hedging that
Fission-AI#1734 is about, and asserted `/opsx:continue` appears in the default
profile's generated update workflow — the bug itself. Assert the fixed
behavior instead: neither `/opsx:continue` nor `/opsx:new` appears, and
the CLI fallback is stated outright, for both the update and apply
surfaces.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(templates): resolve every cross-workflow reference, not just core's

The first commit fixed the two templates the default profile broke on.
Every other cross-workflow handoff had the same shape, and arbitrary
subsets are reachable: a `custom` profile is whatever the user picked,
and `openspec update` re-derives a workflow set from what it finds on
disk (legacy tool overrides, inferred Codex workflows) without passing
it through getProfileWorkflows.

So resolve all of them:

- `apply` -> archive; `continue` -> apply, archive; `ff` -> apply;
  `new` -> continue; `propose` -> apply; `update` -> apply, archive;
  `archive` and `bulk-archive` -> sync.
- `onboard`'s two command-reference tables are built from the installed
  set rather than printed in full with an "only if installed" caveat, and
  its explore, resume and next-step prompts are resolved the same way.

Two supporting changes:

- `onlyWithWorkflow()` plus a whole-line rule in the resolver: a
  conditional that owns its line takes the line with it when it resolves
  to empty, so a dropped table row cannot leave a blank line that ends
  the table in markdown.
- `generateSkillContent()` and `generateCommand()` now throw on an
  unresolved marker. A generation path that skips the choke point fails
  loudly instead of writing `[[opsx:...]]` into a user's SKILL.md.

The propose and ff surfaces keep their deliberate wording difference
(Fission-AI#258): the command surface never invites "ask me to implement", so its
missing-`apply` fallback names the CLI rather than a conversation.

The guard test now runs the property over every subset that could expose
a reference — each workflow alone, everything but one, the empty set, and
the two shipped profiles — for skills and commands, in both spellings.
Twenty-plus of those cases fail against the previous commit.

Only `openspec-onboard` changes in the skills/ mirror: with every
workflow installed, all other templates render byte for byte as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(changeset): cover the full cross-workflow reference fix

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(templates): validate conditionals before choosing a branch

Resolution discarded the unselected branch and only then checked for
residual markers, so a truncated block inside the *missing* branch was
accepted for a profile that installs the workflow and rejected for one
that does not. Profile-dependent authoring errors are exactly what this
module exists to remove.

Validate the authored text up front instead: every marker must be one of
the three recognized forms, and they must appear as a flat sequence of
if / else / end. A malformed block now throws identically for every
profile. The post-resolution check stays as a backstop.

Caught by CodeRabbit on Fission-AI#1775.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: state the profile-aware handoff rule in the skills reference

alfred-openspec on Fission-AI#1775: docs-lab/reference/skills.md described several
handoffs as unconditional while this change deliberately emits a CLI or
conversational fallback when the profile omits the target.

Stated once, above the entries, rather than as a caveat on each of the eleven
affected Response and Creates rows: the page's recipe is one fact per row, and
repeating the same conditional eleven times would bury the contracts it exists
to state. The rows keep naming the skill that owns the next step, which is the
fact a reader looks up; the rule above them says what happens when that skill
is not installed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(workflows): fold Fission-AI#1735 into the profile-aware references

Fission-AI#1735 fixes the same issue (Fission-AI#1734) by removing the optional handoffs outright.
This PR resolves them at generation time instead, which is strictly better for
the template layer: an install that has `continue` still gets told about it.
So the mechanism here wins and Fission-AI#1735's content is folded in, rather than the
two competing for the same lines.

What Fission-AI#1735 had that this did not:

- src/commands/workflow/instructions.ts. The CLI's own runtime strings named
  the openspec-continue-change skill. Those are chosen at run time, so
  optionalWorkflow() cannot reach them; taken from Fission-AI#1735 verbatim.
- The blocked-state fallback. It was a one-line pointer; it now carries Fission-AI#1735's
  full CLI recovery (select the next `ready` artifact, not `skipped` or
  `blocked`, read its rules with `openspec instructions`, keep the selected
  `--store` on both commands) plus the tracking-file repair path and the
  `missingArtifacts` field it branches on. The installed branch still names
  `/opsx:continue`, so neither audience loses.

Fission-AI#1735's update-change.ts rewrite is not carried over: this PR already covers
all six of those sites conditionally, which is the better answer.

Both of Fission-AI#1735's test suites come across, and they are worth more here than
there. test/core/templates/profile-handoffs.test.ts asserts that no generated
file names an uninstalled workflow across every tool and all three delivery
modes, which is the property this PR's mechanism exists to provide, and it
passes against it. test/commands/profile-handoffs.test.ts covers the runtime
CLI strings. The two guards are complementary: that one is broad on tools and
deliveries, this PR's own profile-workflow-references.test.ts is broad on
workflow subsets.

Fission-AI#1735's command-references.test.ts assertions could not be carried as written,
since they assume the reference is gone unconditionally. Replaced with a case
that resolves the template against a set without `continue` and asserts the
fallback carries the whole recovery. Verified it fails when the fallback is
shortened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: name the core-profile fallback on the two rows that hit it

The rule above the entries covers every profile, but apply-change and
update-change are Core skills whose rows name openspec-continue-change, which
the core profile never installs. On the default install those rows now say what
the generated skill points to instead: openspec status and openspec instructions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(changeset): drop em dashes from the release note

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

core profile: openspec-update-change references /openspec-continue-change and /openspec-new-change, neither of which core installs

2 participants