fix(code-review): make no-spec mode an explicit supported path (#2645)

* fix(code-review): make no-spec mode an explicit supported path

Replace ambiguous "If yes / If no" language in step-01 spec-context
selection. Honor explicit no-spec declarations without asking, keep
known specs on full mode, and otherwise offer path vs continue-without.

* fix(code-review): clear spec_file when entering no-spec mode

Keep frontmatter consistent when an explicit no-spec declaration
overrides a Tier 1/2 path so later steps do not treat a stale path
as intentional.
This commit is contained in:
Alex Verkhovsky
2026-07-29 04:51:13 -07:00
committed by GitHub
parent 1a8fea5bd0
commit f814c12cff
@@ -64,10 +64,13 @@ story_key: '' # set at runtime when discovered from sprint status
- After constructing `{diff_output}`, verify it is non-empty regardless of source type. If empty, HALT and tell the user there is nothing to review.
4. **Set the spec context.**
- If `{spec_file}` is already set (from Tier 1 or Tier 2): verify the file exists and is readable, then set `{review_mode}` = `"full"`.
- Otherwise, ask the user: **Is there a spec or story file that provides context for these changes?**
- If yes: set `{spec_file}` to the path provided, verify the file exists and is readable, then set `{review_mode}` = `"full"`.
- If no: set `{review_mode}` = `"no-spec"`.
- If the triggering request or recent conversation **explicitly** states there is no spec (e.g. "no spec", "without a spec", "no-spec"): set `{review_mode}` = `"no-spec"` and clear `{spec_file}` (set it to `''`). Do **not** ask for a spec. Do **not** infer no-spec mode merely because the invocation omitted a spec path.
- Else if `{spec_file}` is already set (from Tier 1 or Tier 2): verify the file exists and is readable, then set `{review_mode}` = `"full"`.
- Else (neither a spec path nor an explicit no-spec declaration is present): ask the user to choose:
1. Provide a spec or story file path for context; or
2. Continue without a spec.
- If the user provides a path: set `{spec_file}` to that path, verify the file exists and is readable, then set `{review_mode}` = `"full"`.
- If the user explicitly chooses to continue without a spec: set `{review_mode}` = `"no-spec"`.
5. If `{review_mode}` = `"full"` and the file at `{spec_file}` has a `context` field in its frontmatter listing additional docs, load each referenced document. Warn the user about any docs that cannot be found.