Repository navigation
fix(harness): spell the init hint per tool and scope doctor to cospec files - #63
Merged
Merged
Conversation
Proposal, blocking-changes, design, harness-workflows delta, tasks and verification for the two defects #51 surfaced: the init receipt hint always spelled for Claude, and doctor's harness checks reading every .md under a harness dir. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lifts the receipt's two closing hint lines into receiptHintLines with today's output, and adds verification 1.6's rows: claude, all and none keep /cospec:propose; opencode, codex, agents, an explicit opencode,claude list and a synthetic @ row land as test.failing until the hint follows the first selected row. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cospec init ended every receipt with /cospec:propose, a command only Claude Code registers. The two closing hint lines now go through the first selected row's body dialect and invocation prefix with transformBody, the respelling its generated bodies get; init and render.ts read the canon workflow manifest through one shared loader. Release note: the `cospec init` receipt for `--harness opencode`, `--harness codex` and `--harness agents` (and for any list or detection whose first row is one of them) now ends with the corrected hint: `/cospec-propose` for OpenCode, and `$cospec-propose (Codex) or /cospec-propose (other agents)` for Codex and the shared .agents skills. The claude, all, default and none receipts are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds verification 2.1-2.4 and 3.2's rows. A user's .claude/notes.md, a nested worktree's copy under .claude/worktrees/, a SKILL.md deeper than one directory, and other markdown under a scan root land as test.failing until isHarnessDocument narrows. A dangling ref in a cospec-written command, the legacy .codex/skills root, the table's command paths, and upstream's legacy opsx command paths in the leftover scan pass before and after. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isHarnessDocument accepted every .md under a top-level harness dir, so doctor's stale-harness, mixed-versions and dangling-ref checks read a user's own .claude/notes.md and a nested worktree's checkout under .claude/worktrees/. It now accepts exactly <skills-root>/<skill>/SKILL.md (project and legacy skills roots) and each markdown row's command paths, matched on the full root. The opsx leftover scan keeps today's breadth: it moves into init.ts (isLeftoverCandidate, leftoverScanFiles), and findOpsxFiles and doctor's checkOpsx both read it. Release note: - The `cospec init` receipt for `--harness opencode`, `--harness codex` and `--harness agents` (and for any list or detection whose first row is one of them) ends with the corrected hint lines. The claude, all, default and none receipts do not change. - `cospec doctor` (text and `--json`) no longer reports stale-harness, mixed-versions or dangling-ref findings for markdown outside <skills-root>/<skill>/SKILL.md and the table's command paths. A repo that failed doctor only because of such a file, such as a user's own notes or a nested worktree's copy, now passes, and its findings and summary counts shrink. Findings on files cospec writes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
harness-setup.md states that init's Try: hint uses the first selected harness's spelling and what --harness none prints. The commands.md doctor row names the files the harness checks read and that user markdown and nested worktree copies are no longer checked. docs/harness-integration.md drops its two known-defect passages and describes the corrected behaviour. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replaces shared.md's known-defects sentence with the behaviour this change ships, then syncs CLAUDE.md and AGENTS.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Task 6.1: e21c226's body relays the proposal's BREAKING list (receipt hint for opencode/codex/agents; doctor's narrowed harness checks) with no ! and no BREAKING CHANGE footer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Task 7.1 and rows 5.1-5.2: mise run check exits 0 and validate --strict is clean. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tasks 1.2, 6.2 and 7.2: the PR number is recorded in proposal.md and the ledger header; row 4.4 observed the BREAKING list in both fix-commit bodies and the PR body; validate --strict is clean and every verification row is [x]. Task 7.3 (archive) stays open for the merge stage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Task 7.3 (cospec archive) is performed by the next commit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
cospec archive: moved the change to openspec/changes/archive/2026-10-05-harness-receipt-and-doctor-scope/ and merged both new requirements (init receipt hint follows the selected harness; doctor checks only the harness files cospec writes) into openspec/specs/harness-workflows/spec.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
replygirl
marked this pull request as ready for review
October 5, 2026 08:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two user-visible defects on
main, surfaced while reviewingharness-adapter-table(PR #51), which was held to byte-identical output and could not fix either
(cospec-roadmap ruling 2026-10-04):
cospec initended every receipt withTry: /cospec:propose …whicheverharness was selected.
/cospec:proposeexists only in Claude Code'snamespaced command dir — wrong for OpenCode (
/cospec-propose), andmeaningless for Codex/agents (
$cospec-propose//cospec-propose), whichhave no slash commands at all.
cospec doctorchecks markdown cospec never wrote. Doctor'sstale-harness,mixed-versionsanddangling-refchecks read every.mdfile under a harness dir, not just the files cospec generates — so a user's
own
.claude/notes.md, or a nested worktree checkout under.claude/worktrees/, could fail doctor on a healthy repo.What changes
row's body dialect and invocation prefix via the same
transformBodythatrenders workflow bodies (claude →
/cospec:propose; opencode →/cospec-propose; codex/agents →$cospec-propose (Codex) or /cospec-propose (other agents);nonekeeps today's/cospec:propose).isHarnessDocumentis narrowed to exactly two shapes:<skills-root>/<skill>/SKILL.mdand the table's command paths. Any othermarkdown under a harness dir is no longer a harness document.
move into
init.ts(today's breadth), and doctor'sopsx-leftovercheck nowreads that same scan.
apps/docs/guide/harness-setup.md,apps/docs/reference/commands.md,docs/harness-integration.md) and.agents/shared.mdupdated to describethe corrected behaviour.
Breaking
cospec initreceipt for--harness opencode,--harness codexand--harness agents(and for any list or detection whose first row is one ofthem) ends with the corrected hint lines. The
opencode,codexandagentsreceipt goldens change by design. Theclaude,all, default andnonegoldens do not change.cospec doctor(text and--json) no longer reportsstale-harness,mixed-versionsordangling-reffindings for markdown outside<skills-root>/<skill>/SKILL.mdand the table's command paths. A repo thatfailed doctor only because of such a file now passes, and its findings and
summarycounts shrink. Findings on files cospec writes are unchanged.Judgment calls
(
$cospec-propose (Codex) or /cospec-propose (other agents)) is not ajudgment call made in this PR — cospec-roadmap CONFIRMED it 2026-10-05
(obligations.md,
harness-receipt-and-doctor-scope); the committed designdecision 1, goldens, spec scenario and ledger rows 1.2–1.3 stand as ruled.
carries a synthetic
name: "OPSX: …"marker: the pinned 1.13.1 OpenCodeadapter writes only a
descriptionfield in its leftover commandfrontmatter, so the real leftover never trips doctor's provenance check —
the fixture proves the path is still walked, not that doctor would flag a
real one. Raised below for a ruling; not fixed in this PR (out of the ruled
scope).
Archive
cospec archive harness-receipt-and-doctor-scoperan clean as the finalcommit on this branch, no force flags. Moved the change to
openspec/changes/archive/2026-10-05-harness-receipt-and-doctor-scope/andmerged both new requirements ("Init receipt hint follows the selected
harness", "Doctor checks only the harness files cospec writes") into
openspec/specs/harness-workflows/spec.md(+2 ~0 -0, all verified).git show --stat HEADlists onlyopenspec/paths.Raised for cospec-roadmap (no owner in obligations.md)
descriptionfield in frontmatter, so doctor'sopsx-leftoverprovenancecheck can never flag a real OpenCode leftover as cospec-authored.
.claude/worktrees/, soinit --remove-opsxcould delete an openspec-written leftover inside anested worktree. This also happens on
maintoday and is outside this PR'sruled scope.
🤖 Generated with Claude Code