Skip to content

feat(verify): detect semantic planning residue - #1373

Open
Seekers2001 wants to merge 6 commits into
Fission-AI:mainfrom
Seekers2001:codex/verify-semantic-relevance
Open

feat(verify): detect semantic planning residue#1373
Seekers2001 wants to merge 6 commits into
Fission-AI:mainfrom
Seekers2001:codex/verify-semantic-relevance

Conversation

@Seekers2001

@Seekers2001 Seekers2001 commented Jul 16, 2026

Copy link
Copy Markdown

What changed

  • add Relevance as a fourth verification dimension in both the generated openspec-verify-change skill and /opsx:verify command
  • audit changed implementation elements for traceable links to requirements, tasks, design decisions, or necessary enabling roles
  • require reference and data-flow evidence before reporting planning residue
  • keep pre-existing debt out of scope and downgrade uncertain findings to suggestions
  • update the verify documentation and add parity coverage for both generated templates

Why

Issue #1073 proposes an optional semantic cleanup checkpoint after implementation and before verification/archive. This draft integrates that checkpoint into the existing optional /opsx:verify workflow rather than adding another command. It keeps the workflow surface small while placing the check immediately before archive.

Impact

This changes generated verification instructions and documentation only. It does not automatically remove code or block archive; it reports evidence-backed warnings and suggestions for human review.

Validation

  • OPENSPEC_TELEMETRY=0 ./node_modules/.bin/vitest run — 100 test files, 1,876 tests passed
  • node build.js
  • ./node_modules/.bin/eslint src/ — 0 errors
  • git diff --check

Review note

This is a draft specifically to confirm that extending /opsx:verify is preferable to introducing a separate checkpoint command.

Prepared with Codex assistance and reviewed locally for scope and false-positive boundaries.

Addresses #1073

Summary by CodeRabbit

  • New Features

    • Verification now evaluates completeness, correctness, coherence, and relevance.
    • Reports identify potentially unused or unrelated implementation elements.
    • Relevance checks gracefully skip when implementation scope cannot be determined.
  • Documentation

    • Updated verification guidance, workflows, examples, and review criteria to cover relevance checks and reporting.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The /opsx:verify workflow now evaluates completeness, correctness, coherence, and relevance. It audits changed implementation for planning residue, updates reports and fallback rules, and synchronizes templates, documentation, and parity tests.

Changes

Verify relevance workflow

Layer / File(s) Summary
Add relevance auditing to verify templates
src/core/templates/workflows/verify-change.ts
Both verify templates establish implementation scope, audit semantic residue, classify findings, and apply four-dimension reporting and fallback rules.
Align generated skill and documentation
skills/openspec-verify-change/SKILL.md, docs/commands.md, docs/editing-changes.md, docs/reviewing-changes.md, docs/workflows.md
The generated skill and documentation describe relevance as the fourth dimension and update verification examples and tables.
Update template parity expectations
test/core/templates/skill-templates-parity.test.ts
Golden hashes and parity assertions are updated for the revised templates and generated skill content.

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

Possibly related PRs

Suggested reviewers: tabishb, alfred-openspec

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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: detecting semantic planning residue in verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Seekers2001
Seekers2001 marked this pull request as ready for review July 26, 2026 11:16
@Seekers2001
Seekers2001 requested a review from TabishB as a code owner July 26, 2026 11:16
@Seekers2001

Copy link
Copy Markdown
Author

Updated the branch against current main and resolved the template-parity conflict in afd700c. I also regenerated the committed openspec-verify-change skill and its parity hashes so the distributed skill matches the source template. Local validation: build passes, template parity 14/14, and the full suite passes 2253/2253 with telemetry disabled. This PR is now ready for review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/templates/workflows/verify-change.ts`:
- Around line 119-122: Update the verify-change workflow to deterministically
discover and baseline the complete implementation-file diff before auditing
relevance, then use that file set when reviewing changed code. Apply the same
discovery instructions at src/core/templates/workflows/verify-change.ts lines
119-122 and 311-314, and regenerate skills/openspec-verify-change/SKILL.md lines
117-120 with the matching guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e98dae52-6848-42ee-abf6-f261f714e77e

📥 Commits

Reviewing files that changed from the base of the PR and between 19d4171 and afd700c.

📒 Files selected for processing (7)
  • docs/commands.md
  • docs/editing-changes.md
  • docs/reviewing-changes.md
  • docs/workflows.md
  • skills/openspec-verify-change/SKILL.md
  • src/core/templates/workflows/verify-change.ts
  • test/core/templates/skill-templates-parity.test.ts

Comment thread src/core/templates/workflows/verify-change.ts Outdated
@Seekers2001
Seekers2001 requested a review from a team as a code owner August 1, 2026 09:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/templates/workflows/verify-change.ts`:
- Line 193: Update the verify-change workflow rule at
src/core/templates/workflows/verify-change.ts lines 193-193 so Relevance runs
whenever the implementation baseline and file set are reliable: use tasks for
task-only changes, and tasks plus specs when both exist, without requiring every
artifact such as design.md. Apply the same graceful-degradation behavior to the
OPSX command template at src/core/templates/workflows/verify-change.ts lines
395-395.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 51fd6999-fc0a-4648-a98c-a05565f8fb8a

📥 Commits

Reviewing files that changed from the base of the PR and between afd700c and c661890.

📒 Files selected for processing (3)
  • skills/openspec-verify-change/SKILL.md
  • src/core/templates/workflows/verify-change.ts
  • test/core/templates/skill-templates-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/core/templates/skill-templates-parity.test.ts
  • skills/openspec-verify-change/SKILL.md

Comment thread src/core/templates/workflows/verify-change.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
skills/openspec-verify-change/SKILL.md (3)

50-58: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Include untracked files in the added implementation inventory.

The implementation scope lists already-versioned and staged/unstaged changes, but new implementation files can exist only as untracked files. Add untracked files to the added-file set so they are included in the relevance audit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-verify-change/SKILL.md` around lines 50 - 58, Update the
implementation scope procedure to include untracked files when building the
added-file inventory, alongside committed, staged, and unstaged changes. Ensure
untracked implementation files are classified and included in the saved
implementation file set used by the relevance audit, while preserving the
existing baseline and limitation handling.

127-142: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Scope residue findings to changed elements.

The relevance audit can examine every file in the changed-file set, but current candidates include added and modified files, not every changed element. State that each unused, unreachable, placeholder, mock, duplicated, or disconnected candidate must be compared with version-control diff hunks against the baseline before reporting planning residue.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-verify-change/SKILL.md` around lines 127 - 142, Update the
“Semantic Residue Audit” guidance in “Verify Relevance” so every suspected
residue candidate is confirmed against the version-control diff hunks and
baseline before reporting it. Limit planning-residue findings to elements added
or modified by the change, while keeping the existing checks for unused,
unreachable, placeholder, mock, duplicated, or disconnected elements.

50-58: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Expose VCS scope discovery to the verifier. Bash(openspec:*) permits no Git inspection, and OpenSpec does not inspect project Git history or diffs. Step 4 therefore cannot establish the baseline or inventory committed, staged, unstaged, untracked, and renamed files. Add a VCS/file-inventory capability or an openspec command that returns this data.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-verify-change/SKILL.md` around lines 50 - 58, Update the
implementation-scope step in the verifier instructions so it uses an available
VCS/file-inventory capability or an openspec command to determine the baseline
and enumerate committed, staged, unstaged, untracked, added, deleted, and
renamed files. Require recording the discovery method and preserve the existing
fallback to state the limitation and skip the relevance audit when reliable VCS
data is unavailable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@skills/openspec-verify-change/SKILL.md`:
- Around line 50-58: Update the implementation scope procedure to include
untracked files when building the added-file inventory, alongside committed,
staged, and unstaged changes. Ensure untracked implementation files are
classified and included in the saved implementation file set used by the
relevance audit, while preserving the existing baseline and limitation handling.
- Around line 127-142: Update the “Semantic Residue Audit” guidance in “Verify
Relevance” so every suspected residue candidate is confirmed against the
version-control diff hunks and baseline before reporting it. Limit
planning-residue findings to elements added or modified by the change, while
keeping the existing checks for unused, unreachable, placeholder, mock,
duplicated, or disconnected elements.
- Around line 50-58: Update the implementation-scope step in the verifier
instructions so it uses an available VCS/file-inventory capability or an
openspec command to determine the baseline and enumerate committed, staged,
unstaged, untracked, added, deleted, and renamed files. Require recording the
discovery method and preserve the existing fallback to state the limitation and
skip the relevance audit when reliable VCS data is unavailable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e6e467b1-9acc-4e39-908d-a971b609cd79

📥 Commits

Reviewing files that changed from the base of the PR and between 4b59f96 and 751e0a2.

📒 Files selected for processing (5)
  • docs/commands.md
  • docs/workflows.md
  • skills/openspec-verify-change/SKILL.md
  • src/core/templates/workflows/verify-change.ts
  • test/core/templates/skill-templates-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/core/templates/skill-templates-parity.test.ts
  • docs/workflows.md
  • docs/commands.md
  • src/core/templates/workflows/verify-change.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
skills/openspec-verify-change/SKILL.md (2)

194-194: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Define one fallback for an unresolved baseline.

Line 53 says to ask the user when the baseline is ambiguous. Line 194 says to skip relevance when the baseline cannot be identified reliably. An ambiguous baseline is an unreliable baseline, so these instructions overlap.

Specify the sequence: prompt first and skip only when the user cannot resolve the baseline, or skip immediately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-verify-change/SKILL.md` at line 194, Update the
baseline-handling instructions in the verification workflow to define one
consistent fallback: prompt the user first when the implementation diff baseline
or file set is ambiguous, and skip relevance only if the user cannot resolve it.
Remove the conflicting instruction that permits skipping immediately for an
unreliable baseline.

167-167: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep uncertain relevance findings visible as SUGGESTION.

Step 9 emits SUGGESTION: Possibly irrelevant code when purpose is uncertain. The SUGGESTION section at Lines 170-173 lists only pattern inconsistencies and minor improvements. Add uncertain relevance to that list, or state that the bullets are examples. Otherwise, the downgrade in Lines 137-139 is not explicit in the report contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/openspec-verify-change/SKILL.md` at line 167, Update the SUGGESTION
section in the verification report instructions to include uncertain relevance
findings, specifically the “Possibly irrelevant code” result from Step 9, or
explicitly state that the listed bullets are examples. Ensure the report
contract clearly preserves this finding as SUGGESTION rather than requiring a
downgrade.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@skills/openspec-verify-change/SKILL.md`:
- Line 194: Update the baseline-handling instructions in the verification
workflow to define one consistent fallback: prompt the user first when the
implementation diff baseline or file set is ambiguous, and skip relevance only
if the user cannot resolve it. Remove the conflicting instruction that permits
skipping immediately for an unreliable baseline.
- Line 167: Update the SUGGESTION section in the verification report
instructions to include uncertain relevance findings, specifically the “Possibly
irrelevant code” result from Step 9, or explicitly state that the listed bullets
are examples. Ensure the report contract clearly preserves this finding as
SUGGESTION rather than requiring a downgrade.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a2d1cf6f-e9b0-4d26-aac0-912603fde2dc

📥 Commits

Reviewing files that changed from the base of the PR and between 751e0a2 and 641d309.

📒 Files selected for processing (5)
  • docs/commands.md
  • docs/workflows.md
  • skills/openspec-verify-change/SKILL.md
  • src/core/templates/workflows/verify-change.ts
  • test/core/templates/skill-templates-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • docs/commands.md
  • test/core/templates/skill-templates-parity.test.ts
  • src/core/templates/workflows/verify-change.ts
  • docs/workflows.md

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