Skip to content

Harden CLI command reliability gates#595

Merged
djm81 merged 7 commits into
devfrom
feature/tester-command-reliability
Jun 1, 2026
Merged

Harden CLI command reliability gates#595
djm81 merged 7 commits into
devfrom
feature/tester-command-reliability

Conversation

@djm81
Copy link
Copy Markdown
Collaborator

@djm81 djm81 commented May 31, 2026

Summary

Harden the core CLI reliability path for tester bug reports #585-#593:

  • companion modules PR: Harden module command reliability gates specfact-cli-modules#307
  • adds the OpenSpec change tester-cli-reliability
  • makes missing subcommands, missing parameters, invalid options, and typos render contextual help plus actionable missing-info
  • generates source-derived command overview artifacts for humans and AI agents: llms.txt, docs/reference/commands.generated.json, and docs/reference/commands.generated.md
  • gates command overview freshness, live command behavior, docs command references, and package-manager runtime smoke in pre-commit/PR validation
  • updates legacy command docs/templates away from removed flat shims
  • adds real-world runtime smoke for direct, hatch, pip editable, pipx, uv, and uvx style launchers
  • fixes pipx stale launcher validation/repair and macOS Application Support path handling
  • bumps core version to 0.47.0 and refreshes bundled module checksums for changed built-ins

Validation

  • openspec validate tester-cli-reliability --strict
  • hatch run format
  • hatch run type-check (0 errors; existing warning volume remains)
  • hatch run lint
  • hatch run yaml-lint
  • hatch run check-command-overview
  • hatch run check-command-contract
  • hatch run check-docs-commands
  • focused pytest suites recorded in openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • hatch run runtime-discovery-smoke --launcher direct
  • hatch run runtime-discovery-smoke --launcher uv-run
  • specfact code review run --scope changed --bug-hunt --include-tests --json --out .specfact/code-review.changed.json -> 0 blocking findings
  • pre-commit hooks passed for the committed core change

Notes

Strict local release signature verification still requires approval-time/release signing keys; local signing refreshed checksum integrity only.

@strix-security
Copy link
Copy Markdown

Strix is installed on this repository, but we could not run this PR security review because this workspace does not have an active plan. If you'd like to continue receiving code reviews, you can add a payment method or manage billing here.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 31, 2026

Review Change Stack

📝 Walkthrough

PR #595: Harden CLI Command Reliability Gates

User-Visible Behavior & CLI Surface

Command Surface Changes:

  • Standardized specfact code import argument ordering across all documentation: --repo . now consistently precedes the bundle/project name (updated in 25+ doc files)
  • Extended specfact init ide target support: added codex, claude-skills, and mistral-vibe IDE integrations alongside existing Cursor/VS Code options
  • Renamed workflow command: PR validation now uses specfact code repro (instead of specfact repro); docs updated accordingly in GitHub annotations and templates
  • Updated enforcement commands: docs/examples now use specfact govern enforce stage pattern (replacing prior enforce stage); updated recovery guidance to suggest specfact project --help + specfact code import (replacing legacy plan select)

Error Guidance & Help Behavior (NEW):

  • Unknown commands, missing subcommands, and missing required parameters now render contextual help plus actionable guidance with a usage-error exit code (newly gated in CI via check-command-contract)
  • Added --help-advanced option support for progressive disclosure of advanced parameters and help sections
  • Lazy-delegated bundle commands (specfact module install ...) now preserve command path/prog name and centralize error rendering for consistent CLI misuse guidance

IDE Integration Behavior (NEW):

  • specfact init ide now exports prompt templates for slash-command targets (Cursor, VS Code) and grouped SKILL.md capability files for skill-based targets (Codex, Claude skills, Mistral Vibe)
  • Codex/skill exports: one aggregated SKILL.md per prompt source/module instead of flat per-prompt files; automatic cleanup of stale per-prompt skill folders

Package Manager Detection (HARDENED):

  • Runtime execution context now takes precedence: uv run specfact upgrade is classified as uv-run (not pipx) via UV_RUN_RECURSION / UV environment detection, avoiding incorrect package-manager hinting
  • Active environment probing: tool availability checks now use the effective execution context (hatch/uv/pip/pipx) via subprocess.run() with timeout rather than stale global inventories
  • Pipx launcher repair: post-upgrade validation runs specfact --version on the public launcher; if stale/broken, runs pipx reinstall specfact-cli and re-validates, failing if repair does not succeed
  • macOS Application Support path handling: fixed shlex-style parsing of spaced interpreter paths (~/Library/Application Support/...)

Contract & API Impact

Public Function Signatures Changed:

  • init command callback (src/specfact_cli/modules/init/src/commands.py): ctx: click.Contextctx: typer.Context (enables consistent Typer internal patching across releases)
  • check_tool_in_env() (src/specfact_cli/utils/env_manager.py): now performs active-environment version probing via subprocess.run() with 10s timeout instead of assuming availability via prefix

Progressive Disclosure Helper Signatures (Relaxed Types):

  • _is_advanced_help_context(), get_params(), format_help(), _patched_get_params(), _patched_make_context() now accept ctx: Any (previously ClickContext) to support both Click and Typer contexts across releases

New Public Functions (Scripts/Tools):

  • generate-command-overview.py (335 lines): build_records() -> list[dict[str, Any]] and main(argv: list[str] | None = None) -> int — deterministically generates llms.txt, docs/reference/commands.generated.json/md from mounted Typer apps; supports --write and --check modes; includes module-repo discovery and TEST_MODE propagation
  • check-command-contract.py (240 lines): main(argv: list[str] | None = None) -> int — validates generated command records against live --help output; enforces error-contract cases for missing subcommands/arguments; accumulates failures and returns non-zero on mismatch
  • check-docs-commands.py extended (173 lines added): new collect_specfact_commands_from_guidance_text(text: str) -> list[list[str]] helper; scans Markdown inline backtick snippets and YAML guidance for stale commands; rejects invalid option ordering (positional elements must precede flags)

Module Package Manifests (Version Bumps):

  • init module: 0.1.350.1.36 (IDE support expansion; checksum: 61f8486ee635a8c4de3ae856a58f5343edc0d30852c7b1ebd962e944743a8f5c)
  • upgrade module: 0.1.190.1.21 (pipx launcher repair & uv/macOS detection; checksum: 812c41fd674958172579af1f6cf7f1ade389db9e8102ac94ca9b872ecfe43376)
  • Note: integrity blocks now contain checksum-only (signature field removed); local signing uses checksum for development/testing

Core Package Versions:

  • Core version bumped: 0.46.280.47.2 (across pyproject.toml, setup.py, src/__init__.py, src/specfact_cli/__init__.py)
  • Progressive module discovery enhanced: added worktree detection (specfact-cli-worktrees segment maps to paired specfact-cli-modules-worktrees); enables local development across monorepo layouts

Testing & Quality Gates

New Contract Validation Gates (Pre-Commit & CI):

  • Command Overview Freshness (hatch run check-command-overview): CI/pre-commit fails if llms.txt, docs/reference/commands.generated.json/md are stale; points to hatch run generate-command-overview for refresh
  • Command Contract Validation (hatch run check-command-contract): validates generated records against live --help output; enforces error handling for missing subcommands (fail non-zero, include "missing subcommand") and missing arguments (fail non-zero, include expected failure markers)
  • Docs Command Validation (hatch run check-docs-commands): extended to scan inline/YAML guidance; rejects stale legacy command references and invalid option ordering; uses longest-prefix matching against generated command-token records
  • Runtime Package-Manager Smoke Matrix (CI): validates CLI execution across hatch-source, pip wheel install, pipx install, uv run, and uvx launcher paths; each matrix leg validates root help, unknown-command guidance, module discovery, generated overview checks, and representative module help

New Test Coverage (239 lines added):

  • tests/unit/cli/test_error_guidance.py (114 lines): CLI misuse matrix covering unknown root commands, missing subcommands, missing parameters, invalid nested commands; validates contextual help and recovery guidance
  • tests/unit/cli/test_lean_help_output.py (extended): lazy-delegation tests for bare group help and missing option value handling
  • tests/unit/commands/test_update.py (207 lines added): installation-method detection (uv-run precedence via UV_RUN_RECURSION/UV), pipx launcher repair (stale/missing repair scenarios, failure on repair failure), macOS Application Support path parsing
  • tests/unit/modules/init/test_init_ide_prompt_selection.py (56 lines): Codex skill export grouping and stale per-prompt skill pruning
  • tests/unit/docs/test_docs_validation_scripts.py (71 lines): guidance-text command collection, option-order validation, placeholder ignoring, legacy command rejection
  • tests/unit/utils/test_env_manager.py (24 lines): active UV environment probing verification
  • tests/integration/scripts/test_runtime_discovery_smoke.py (125 lines): extended launcher support (hatch-source, pip-editable, uv-run, uvx); worktree layout detection

Workflow Hardening (CI/GitHub Actions):

  • docs-review.yml (+43 lines): added module-repo checkout with candidate-ref resolution (checks github.head_refref_namedev fallback); runs check-command-overview and check-command-contract
  • pr-orchestrator.yml (+83 lines): expanded tests job with pipx, uv, coverage[toml]; broadened runtime_discovery_smoke launchers (hatch-source, pip-editable, uv-run, uvx); split contract-test into scoped contract-test-contracts + contract-test-exploration-fast
  • specfact.yml (+37 lines): candidate module-repo checkout with environment export (SPECFACT_MODULES_REPO, SPECFACT_MODULES_ROOTS); stricter budget validation (regex check, early exit on invalid); explicit exit-code capture without early pipeline failure

OpenSpec Changes & Documentation

OpenSpec Change: tester-cli-reliability (NEW)

  • Added to Track D (CLI reliability) at order 0.5 (between runtime-01-discovery-reliability and cli-val-03-misuse-safety-proof)
  • Paired with tester-module-cli-reliability (companion PR Harden module command reliability gates specfact-cli-modules#307)
  • Specs defined:
    • cli-error-guidance/spec.md: unknown commands, missing subcommands, missing parameters render actionable help with usage-error exit
    • generated-command-overview/spec.md: deterministic generation of llms.txt, commands.generated.json/md; CI fails on stale artifacts; docs/prompt/template validation uses generated contract
    • command-package-runtime-validation/spec.md: validation inventory from manifests; deterministic execution order (core before bundles); CI matrix covering hatch/pip/pipx/uv/uvx
    • runtime-tool-probing/spec.md: active execution context precedence (uv-run over pipx); tool availability via active environment probing
    • core-cli-reference/spec.md: core CLI docs stay in sync with --help; IDE export structure validation; flat shims rejected unless marked historical
    • ci-integration/spec.md: package-manager launcher matrix blocking PRs on mismatch; failure reporting includes launcher, path, exit code, stdout/stderr

Generated Command Artifacts (2428 lines total):

  • llms.txt (123 lines): Jekyll front matter + Markdown command table for AI agent consumption
  • docs/reference/commands.generated.json (2185 lines): full command hierarchy with metadata (options, arguments, subcommands, owner package, source, deprecated/hidden flags)
  • docs/reference/commands.generated.md (121 lines): Jekyll documentation page with command tree table and sync warning

Hatch Scripts (Added/Updated):

  • generate-command-overview: triggers deterministic artifact generation (30 functions/classes in check-docs-commands.py, 16 in check-command-contract.py)
  • check-command-overview: validates freshness of generated artifacts
  • check-command-contract: validates command records against live --help
  • docs-validate (updated): now runs overview and contract checks before docs validation

Documentation Updates:

  • README.md: added "Command Overview" section linking to human-readable and AI-oriented (llms.txt) command overview
  • 25+ doc files: standardized specfact code import --repo . <bundle> argument ordering
  • docs/core-cli/init.md, docs/getting-started/installation.md, docs/guides/ide-integration.md: expanded IDE target descriptions
  • .github/ISSUE_TEMPLATE/*, .github/pull_request_template.md: updated example commands to use new argument patterns and hatch run smart-test-full

Changelog (v0.47.2, v0.47.1, v0.47.0):

  • v0.47.2: Typer context import removal in init callback, standalone contract validation, generated command artifacts refresh
  • v0.47.1: command overview generation/validation gates, launcher repair, workflow hardening, CLI error propagation
  • v0.47.0: generated command artifacts (llms.txt + references), runtime package-manager smoke gating, command validation regeneration/verify gates before docs/prompts/tests, contextual CLI misuse guidance, pipx upgrade launcher repair with post-upgrade validation

TDD Evidence & Tasks:

  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md (176 lines): documents failing-before evidence, passing-after outcomes across command overview generation/checks, CLI misuse matrix, runtime discovery smoke, release hygiene/version bumps, specfact code review resolution
  • openspec/changes/tester-cli-reliability/tasks.md: comprehensive checklist (all items marked complete) covering readiness/source tracking, spec-first failing evidence, CLI guidance/artifacts, docs/prompt validation, runtime/CI coverage, final quality gates

Linting & Format:

  • .markdownlint.json: explicit rules for MD024 (siblings_only), MD025 (front_matter_title), MD029 (false), MD036/MD051 (false), MD040 (true)

Walkthrough

Adds deterministic CLI command-overview generation and contract checks; updates docs/examples to new command shapes; refactors Typer/Click interop and progressive-disclosure; adds IDE skill exports; improves runtime/upgrade probing and pipx launcher repair; extends CI/workflows and pre-commit gates; and updates/tests many units and integration flows.

Changes

Tester CLI reliability and docs artifacts

Layer / File(s) Summary
Generated command overview & contract checks
scripts/generate-command-overview.py, scripts/check-command-contract.py, docs/reference/commands.generated.*, llms.txt
Deterministic CLI introspection producing JSON/MD/llms artifacts and a contract checker that validates live Typer apps (--help, missing-subcommand, missing-argument shapes`).
Docs & examples updates
docs/**, README.md, CHANGELOG.md, resources/templates/pr-template.md.j2, .markdownlint.json
Mass updates to examples and docs to use new command shapes (notably specfact code import --repo . <bundle>), added generated command overview links and artifacts.
Docs command validation
scripts/check-docs-commands.py, tests/unit/docs/*
Guidance/template scanning extended to non-Markdown assets, flag-preserving tokenization, code import ordering checks, prefix-matching against generated command contract, and tests.
CLI runtime & progressive-disclosure
src/specfact_cli/cli.py, src/specfact_cli/utils/progressive_disclosure.py, src/specfact_cli/__init__.py
Lazy-delegate refactor centralizing real-command invocation, Typer context-param detection wrapper, broadened Click/Typer monkey-patches, and dynamic progressive-disclosure import during package init.
IDE exports: skill.md
src/specfact_cli/utils/ide_setup.py, tests/unit/utils/test_ide_setup.py, tests/unit/modules/init/*
Added grouped SKILL.md export format, deterministic ordering, stale-prune behavior, and Codex/skill export tests.
Upgrade/runtime detection & launcher repair
src/specfact_cli/modules/upgrade/src/commands.py, src/specfact_cli/utils/env_manager.py, tests tests/unit/commands/test_update.py, tests/unit/utils/test_env_manager.py
Detect uv run contexts, probe tools in active env via subprocess, verify and optionally pipx reinstall repaired launchers, with tests exercising repair/failure branches.
Runtime discovery smoke & worktrees
scripts/runtime_discovery_smoke.py, tests/integration/scripts/test_runtime_discovery_smoke.py, tests/conftest.py
Added hatch-source launcher mode, child PYTHONPATH for hatch-source, and worktree-aware modules repo resolution with updated tests.
CI/workflows & pre-commit gates
.github/workflows/*.yml, scripts/pre-commit-quality-checks.sh, tests/unit/workflows/*
Workflows now resolve/checkout paired specfact-cli-modules ref, run command-overview/contract/docs checks, adjust contract-test scoping, and pre-commit regenerates/validates command artifacts when docs change.
Version, packaging & small updates
pyproject.toml, setup.py, src/__init__.py, module-package.yaml, suggestions/annotations/structure
Bumped version to 0.47.2, added Hatch scripts for generation/checks, adjusted suggestion strings, PR comment hints, and migration/help strings.
Tests: additions and updates
tests/unit/cli/*, many unit/integration tests
Added CLI error-guidance and lazy-delegate help tests, extended docs validation tests, IDE export tests, pipx/upgrade tests, workflow assertions, and helper refactors.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Note: Focus review on contract-generator correctness, validator edge cases (prefix matching and ordering), Typer/Click monkey-patch safety, pipx repair side-effects, CI paired-repo checkout security, and IDE export pruning data-loss risks.

✨ 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 feature/tester-command-reliability

@djm81 djm81 self-assigned this May 31, 2026
@djm81 djm81 added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request architecture Architecture and design changes module-system Module system and registry labels May 31, 2026
@djm81 djm81 moved this from Todo to In Progress in SpecFact CLI May 31, 2026
@djm81 djm81 marked this pull request as ready for review June 1, 2026 00:12
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5297ea5111

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/reference/commands.generated.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 18

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

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

⚠️ Outside diff range comments (2)
scripts/check-docs-commands.py (1)

115-138: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

code import option-order checks are currently bypassed for real scanned text.

The parser stops at the first flag, so scanned commands like specfact code import legacy-api --repo . never reach _invalid_code_import_order_message with --repo present. That means invalid ordering can slip through docs/guidance validation.

Suggested fix
 def _tokens_from_specfact_line(line: str) -> list[str] | None:
@@
-    out: list[str] = []
-    for part in parts:
-        if part.startswith("-"):
-            break
-        out.append(part)
-    return out if out else None
+    return parts if parts else None
 def validate_command_tokens(tokens: list[str]) -> tuple[bool, str]:
@@
-    if _generated_prefix_match(tokens):
+    command_prefix: list[str] = []
+    for token in tokens:
+        if token.startswith("-"):
+            break
+        command_prefix.append(token)
+    if _generated_prefix_match(command_prefix):
         return True, ""
@@
-    for k in range(len(tokens), 0, -1):
-        prefix = tokens[:k]
+    for k in range(len(command_prefix), 0, -1):
+        prefix = command_prefix[:k]
         ok, msg = _eval_prefix_help(runner, prefix)

As per coding guidelines, validators “must fail … on invalid documented option placement (e.g., rejected ordering for specfact code import <bundle> --repo .).”

Also applies to: 267-315

🤖 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 `@scripts/check-docs-commands.py` around lines 115 - 138,
_tokens_from_specfact_line currently stops collecting tokens at the first flag
which prevents later validation (e.g., in _invalid_code_import_order_message)
from seeing options like --repo; change the logic in _tokens_from_specfact_line
(and the similar block around lines 267-315) to collect all parts after
stripping global options (use _strip_leading_global_options(parts)) instead of
breaking on part.startswith("-"), so flags are preserved in the returned list
and downstream validators (such as _invalid_code_import_order_message and the
code import ordering checks) can enforce option placement; keep the early
returns for non-specfact lines and failed shlex parsing unchanged.
openspec/changes/tester-cli-reliability/tasks.md (1)

35-40: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update checklist status to match executed gates and review evidence.

Lines 38–39 are still unchecked even though this PR’s recorded evidence says those gates and code review were executed. This creates OpenSpec traceability drift for completion status.

As per coding guidelines, “After implementation, validate the change with openspec validate <change-id> --strict … before considering the change complete.”

🤖 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 `@openspec/changes/tester-cli-reliability/tasks.md` around lines 35 - 40,
Update the checklist in tasks.md so the status reflects the executed gates and
review evidence: mark 6.1, 6.2 and 6.3 as completed if TDD_EVIDENCE.md and the
PR show the re-run targeted tests, required quality gates (format, type-check,
lint, YAML lint, contract-test/smart-test or targeted equivalent) and SpecFact
code review were performed or document explicit exceptions for any unresolved
findings; then run openspec validate <change-id> --strict to confirm
traceability and only commit the checklist update after validation passes.
🟡 Minor comments (3)
src/specfact_cli/utils/structure.py-978-987 (1)

978-987: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix mixed code import syntax in generated README snippet.

This block still contains the legacy ordering (specfact code import <bundle-name> --repo .) while adjacent examples were migrated. Please keep the snippet fully canonical to avoid onboarding regressions in scaffolded repos.

Suggested patch
 # Analyze existing code
-specfact code import <bundle-name> --repo .
+specfact code import --repo . <bundle-name>
🤖 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 `@src/specfact_cli/utils/structure.py` around lines 978 - 987, The README
snippet contains legacy ordering for the code import command; update the example
to use the canonical flag order used elsewhere. Replace the line containing
"specfact code import <bundle-name> --repo ." with the canonical form used in
adjacent examples (i.e., put the --repo flag before the positional bundle name
or follow the project's canonical CLI ordering), ensuring consistency with other
examples like "specfact project plan init --interactive" and "specfact project
plan compare ..."; update the snippet in the generator function/schema that
emits this block (refer to the snippet around the call that constructs the
README in structure.py and the text containing "specfact code import") so all
scaffolded repos show the canonical syntax.
llms.txt-1-13 (1)

1-13: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Place front matter at the top and keep a single H1 in llms.txt.

This file currently has content before front matter and two H1 headers. If this artifact is rendered by Jekyll/docs tooling, metadata may not be parsed correctly and heading validation can fail.

As per coding guidelines, “Headers should increment by one level at a time (MD001: Header Increment)” and “Only one top-level header (H1) is allowed per document (MD025: Single H1 Header).”

🤖 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 `@llms.txt` around lines 1 - 13, Move the Jekyll front matter block (the lines
between the leading --- markers) to the very top of llms.txt so it appears
before any other content, then ensure only a single H1 remains by removing or
converting the extra "# Generated SpecFact CLI Command Overview" header to a
lower-level header (e.g., H2) or deleting it; update the remaining top-level
header so there is exactly one H1 in the file and headings increment by one
level and follow MD001/MD025 guidelines.
docs/reference/directory-structure.md-414-414 (1)

414-414: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep code import syntax examples consistent in this page.

Line 414 uses the new canonical ordering, but the earlier syntax snippet still shows the old positional-first form. Please align both to one contract form to avoid stale-command drift in docs checks.

As per coding guidelines, “docs/prompt/template/guidance examples [must] be checked against the generated command overview contract … and invalid documented option placement must fail validation.”

🤖 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 `@docs/reference/directory-structure.md` at line 414, The docs contain
inconsistent examples for the "specfact code import" command: update the earlier
snippet(s) to match the canonical option ordering used on line 414 (e.g.,
"specfact code import --repo . legacy-api --confidence 0.7"); locate other
occurrences of the old positional-first form related to the "specfact code
import" example and reorder arguments so flags (--repo, --confidence) appear in
the canonical positions and the positional target (legacy-api) stays in the same
place as in the line 414 example.
🤖 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 @.github/workflows/docs-review.yml:
- Around line 90-98: The secondary checkout step "Checkout module command
sources" that checks out repository nold-ai/specfact-cli-modules is using a
floating actions/checkout ref and leaving credentials in the cloned workspace;
update that step to use a pinned actions/checkout commit SHA (pin the action
version to a specific commit) and add persist-credentials: false to the checkout
step so the GITHUB_TOKEN is not persisted into specfact-cli-modules; keep the
same repository, path, and ref usage for the module content (or replace ref
usage with the intended module tag/commit if needed) and leave the "Export
module command source path" step unchanged.

In @.github/workflows/pr-orchestrator.yml:
- Around line 234-240: The checkout steps that pull repository
nold-ai/specfact-cli-modules (the actions/checkout@v4 blocks such as the step
named "Checkout module bundles repo" and the three other identical module
checkouts) are not hardened: pin each actions/checkout invocation to a specific
commit SHA instead of a floating ref and add with: persist-credentials: false to
each block so the checked-out code cannot use inherited repository credentials;
update all four checkout blocks (the ones using repository:
nold-ai/specfact-cli-modules) to use a fixed commit SHA for the action and
include persist-credentials: false in their with: section.

In @.github/workflows/specfact.yml:
- Around line 86-87: The workflow step currently masks failures by appending "||
true" and then recording "$?" which always yields 0; remove the "|| true" so the
real exit status of the "specfact code repro" command is preserved, and ensure
the echo that writes the step output (echo "exit_code=$?" >> "$GITHUB_OUTPUT")
runs immediately after that command so it captures the actual exit code; also
defensively quote/validate the budget interpolation by passing the budget as a
quoted argument (use the workflow expression form for the budget that the step
already references, e.g., wrap steps.validation.outputs.budget in quotes) to
avoid word-splitting or injection when invoking "specfact code repro".

In @.markdownlint.json:
- Around line 12-14: Restore enforcement for the MD040 rule by removing or
changing the "MD040": false entry in the .markdownlint.json configuration so
fenced code blocks must include a language; locate the "MD040" key in the JSON
(alongside "MD036" and "MD051") and either delete that property or set it to
true (or remove the rule from the disabled list) to re-enable the repository's
fenced-code-language requirement.

In `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`:
- Around line 1159-1162: Replace the two occurrences of the CLI invocation
"specfact --no-banner project version check" with the correct
active-baseline/plan selection and verification subcommands so the example
actually sets and then verifies the active plan used for later drift comparison;
ensure the first call (previously passing --bundle "$BUNDLE_NAME") uses the
subcommand that sets the active plan for the project from the given bundle, and
the second call (previously passing --repo .) uses the subcommand that
shows/verifies the currently active plan in the repo, preserving the same flags
(--bundle and --repo) and surrounding context so the pre-commit example compares
against the intended baseline.

In `@docs/migration/migration-cli-reorganization.md`:
- Around line 140-141: The CLI examples use an invalid flat form "specfact code
import --repo . legacy-api" but the PR defines "code import" as a command group
with subcommands "from-bridge" and "from-code"; update each example to call the
correct subcommand (e.g., replace the invalid "specfact code import --repo .
legacy-api" with "specfact code import from-code --repo . legacy-api" or the
appropriate "from-bridge" variant) and apply the same fix to the other
occurrences noted (around the later example lines). Ensure examples match the
new command contract (use "specfact code import from-code" or "specfact code
import from-bridge" as appropriate) so copy-paste will work.

In `@docs/reference/commands.generated.json`:
- Around line 645-651: The "specfact code" command's subcommands array is
missing the "review" entry which breaks the command tree consistency; update the
"subcommands" array for the "specfact code" command to include "review" so it
matches the later definition of "specfact code review" (apply the same fix where
the other occurrence appears around the other block), ensuring the "subcommands"
arrays for "specfact code" list
["analyze","drift","import","repro","validate","review"] to restore the
contract/docs tree integrity.

In `@docs/reference/commands.generated.md`:
- Line 43: The generated command overview for the `specfact code` command is
missing the `review` subcommand and therefore produces an inconsistent
parent-child tree; update the generator or the data used to render the table so
that the `specfact code` row lists all subcommands including `review` (and
ensure the subsequent rows that render `specfact code review ...` are reflected
in the parent row), and re-generate the docs so the `specfact code` entry and
the rows covering the same command (lines around the block containing `specfact
code review`) are consistent.

In `@openspec/CHANGE_ORDER.md`:
- Line 81: The CHANGE_ORDER.md row for version "0.5" (entry with
`tester-cli-reliability` and paired modules `tester-module-cli-reliability`) is
missing source bug `#593`; update that row's source bugs list to include `#593`
alongside the existing `#585,`#587`,`#588`,`#589`,`#590`` so the authoritative
cross-change plan maps all core-owned bugs consistently with the
`tester-cli-reliability` evidence.

In `@openspec/changes/tester-cli-reliability/proposal.md`:
- Around line 42-43: Update the "Source Bugs" bullet list in the proposal's
header to include issue `#593` so the proposal's source bug map matches the change
scope; specifically, edit the "Source Bugs" list (the bullet starting with
"**Source Bugs**") to add ",
[`#593`](https://github.com/nold-ai/specfact-cli/issues/593)" so the proposal
tracks that core reliability bug alongside the other referenced issues.

In `@src/specfact_cli/__init__.py`:
- Around line 65-67: The bootstrap currently inserts
_specfact_progressive_disclosure_bootstrap into sys.modules before calling
spec.loader.exec_module(module), which can leave a partially-initialized module
cached if exec_module raises; wrap the call to spec.loader.exec_module(module)
inside a try/except (or try/finally) in _install_progressive_disclosure(), and
on exception remove the entry via sys.modules.pop(module_name, None) before
re-raising so subsequent attempts can retry installation.

In `@src/specfact_cli/cli.py`:
- Around line 732-735: The except block in _invoke_real_command currently
normalizes any "*Exit" by using getattr(exc, "exit_code", 0), which loses plain
SystemExit.code (e.g., SystemExit(2) becomes 0); change the logic so that if exc
is an instance of SystemExit you re-raise SystemExit with exc.code preserved,
otherwise for other delegated "*Exit" exceptions use getattr(exc, "exit_code",
getattr(exc, "code", 0)) to derive the exit code; update the exception handling
in _invoke_real_command to prefer exc.code for SystemExit and fall back to
exit_code for custom Exit classes.

In `@src/specfact_cli/modules/init/src/commands.py`:
- Around line 714-718: The public Typer callback init is missing the `@beartype`
decorator; add `@beartype` above the function (consistent with other public
commands like init_ide) so the signature is runtime type-checked, keeping the
existing `@app.callback`, `@require`, and `@ensure` decorators in place; ensure
beartype is imported and apply it to the init function definition.

In `@src/specfact_cli/modules/upgrade/src/commands.py`:
- Around line 293-323: The code currently treats missing pipx launcher (when
shutil.which("specfact") returns falsy) as a successful upgrade and returns
True; change that so a missing launcher is handled like a repairable failure: do
not return True on missing launcher, print the existing warning, then proceed to
run _run_pipx_reinstall(), replay its stdout/stderr with
_replay_upgrade_output/_coerce_subprocess_output, check reinstall.returncode
(print the same failure message and return False on non-zero), then re-check the
launcher by calling shutil.which("specfact") again and/or calling
_run_launcher_version_check(launcher) like the stale-path branch, replay its
outputs and return success only if the post-reinstall check.returncode == 0
(otherwise print the existing failure message and return False); update or
remove the early return in the missing-launcher branch so the flow matches the
stale/broken launcher repair flow.

In `@src/specfact_cli/utils/suggestions.py`:
- Around line 93-94: The suggestion "specfact project plan select" is invalid;
update the suggestions list by removing or replacing the line added via
suggestions.append("specfact project plan select  # Select an active plan
bundle") with a valid command from the current command contract (e.g., a working
plan-list or plan-select invocation used elsewhere), e.g. modify the
suggestions.append call in src/specfact_cli/utils/suggestions.py to use the
correct command name used in the codebase (verify against the command contract
or existing commands like any "plan list" or "plan select" variants) so the
recovery suggestion is not a dead-end.

In `@tests/unit/cli/test_error_guidance.py`:
- Around line 20-24: The assertions in test_error_guidance.py are brittle
because they check raw output that may include ANSI escape sequences; before
asserting on the variable output, normalize it by stripping ANSI sequences
(e.g., with a helper like strip_ansi or using a standard utility such as
click.utils.strip_ansi or a small regex) and then run the existing contains
checks against the cleaned string (references: test variable output and the
assertion lines checking "usage: specfact", "hello", "not a valid command"/"no
such command", "try", and "specfact --help"/"specfact -h").
- Around line 92-99: The misuse-matrix in tests/unit/cli/test_error_guidance.py
includes entries like ("code missing subcommand", ["code"]) and other
module-backed commands which can produce “module not installed” guidance and
make tests flaky; restrict the matrix to guaranteed-core paths (remove or
replace "code", "backlog", "project sync bridge", etc.) or explicitly control
module availability in the test setup by mocking the CLI's module-detection
function (e.g., the function that checks whether a plugin/module is installed,
or an import check used by the CLI) using a fixture/monkeypatch so those entries
always produce the expected usage guidance instead of installation errors.
Ensure the same change is applied to the similar list referenced later in the
file (the other matrix at the end).

In `@tests/unit/cli/test_lean_help_output.py`:
- Around line 151-169: Normalize result.output by stripping ANSI color/styling
before asserting the usage banner and related substrings: in
test_lazy_delegate_bare_group_shows_full_help_and_missing_subcommand and
test_lazy_delegate_missing_option_value_shows_leaf_help, replace direct checks
against result.output with checks against a cleaned variable (e.g., cleaned =
strip_ansi(result.output) or an equivalent helper) and use cleaned for the
"Usage: specfact ..." and other substring assertions so the tests match
semantics rather than terminal styling while keeping the existing exit_code and
message checks.

---

Outside diff comments:
In `@openspec/changes/tester-cli-reliability/tasks.md`:
- Around line 35-40: Update the checklist in tasks.md so the status reflects the
executed gates and review evidence: mark 6.1, 6.2 and 6.3 as completed if
TDD_EVIDENCE.md and the PR show the re-run targeted tests, required quality
gates (format, type-check, lint, YAML lint, contract-test/smart-test or targeted
equivalent) and SpecFact code review were performed or document explicit
exceptions for any unresolved findings; then run openspec validate <change-id>
--strict to confirm traceability and only commit the checklist update after
validation passes.

In `@scripts/check-docs-commands.py`:
- Around line 115-138: _tokens_from_specfact_line currently stops collecting
tokens at the first flag which prevents later validation (e.g., in
_invalid_code_import_order_message) from seeing options like --repo; change the
logic in _tokens_from_specfact_line (and the similar block around lines 267-315)
to collect all parts after stripping global options (use
_strip_leading_global_options(parts)) instead of breaking on
part.startswith("-"), so flags are preserved in the returned list and downstream
validators (such as _invalid_code_import_order_message and the code import
ordering checks) can enforce option placement; keep the early returns for
non-specfact lines and failed shlex parsing unchanged.

---

Minor comments:
In `@docs/reference/directory-structure.md`:
- Line 414: The docs contain inconsistent examples for the "specfact code
import" command: update the earlier snippet(s) to match the canonical option
ordering used on line 414 (e.g., "specfact code import --repo . legacy-api
--confidence 0.7"); locate other occurrences of the old positional-first form
related to the "specfact code import" example and reorder arguments so flags
(--repo, --confidence) appear in the canonical positions and the positional
target (legacy-api) stays in the same place as in the line 414 example.

In `@llms.txt`:
- Around line 1-13: Move the Jekyll front matter block (the lines between the
leading --- markers) to the very top of llms.txt so it appears before any other
content, then ensure only a single H1 remains by removing or converting the
extra "# Generated SpecFact CLI Command Overview" header to a lower-level header
(e.g., H2) or deleting it; update the remaining top-level header so there is
exactly one H1 in the file and headings increment by one level and follow
MD001/MD025 guidelines.

In `@src/specfact_cli/utils/structure.py`:
- Around line 978-987: The README snippet contains legacy ordering for the code
import command; update the example to use the canonical flag order used
elsewhere. Replace the line containing "specfact code import <bundle-name>
--repo ." with the canonical form used in adjacent examples (i.e., put the
--repo flag before the positional bundle name or follow the project's canonical
CLI ordering), ensuring consistency with other examples like "specfact project
plan init --interactive" and "specfact project plan compare ..."; update the
snippet in the generator function/schema that emits this block (refer to the
snippet around the call that constructs the README in structure.py and the text
containing "specfact code import") so all scaffolded repos show the canonical
syntax.
🪄 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

Run ID: 324aa60f-e7e6-479c-adef-06e7b67e9597

📥 Commits

Reviewing files that changed from the base of the PR and between 03b742f and 5297ea5.

📒 Files selected for processing (85)
  • .github/ISSUE_TEMPLATE/augmentation_metadata.md
  • .github/ISSUE_TEMPLATE/bug_report.md
  • .github/pull_request_template.md
  • .github/workflows/docs-review.yml
  • .github/workflows/pr-orchestrator.yml
  • .github/workflows/specfact.yml
  • .markdownlint.json
  • CHANGELOG.md
  • README.md
  • docs/core-cli/debug-logging.md
  • docs/core-cli/init.md
  • docs/core-cli/modes.md
  • docs/examples/dogfooding-specfact-cli.md
  • docs/examples/integration-showcases/integration-showcases-quick-reference.md
  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
  • docs/examples/integration-showcases/integration-showcases.md
  • docs/examples/integration-showcases/setup-integration-tests.sh
  • docs/examples/quick-examples.md
  • docs/getting-started/README.md
  • docs/getting-started/installation.md
  • docs/getting-started/quickstart.md
  • docs/getting-started/tutorial-openspec-speckit.md
  • docs/getting-started/where-to-start.md
  • docs/guides/ai-ide-workflow.md
  • docs/guides/command-chains.md
  • docs/guides/copilot-mode.md
  • docs/guides/ide-integration.md
  • docs/guides/openspec-journey.md
  • docs/guides/speckit-journey.md
  • docs/guides/troubleshooting.md
  • docs/migration/migration-cli-reorganization.md
  • docs/reference/commands.generated.json
  • docs/reference/commands.generated.md
  • docs/reference/commands.md
  • docs/reference/directory-structure.md
  • docs/technical/code2spec-analysis-logic.md
  • llms.txt
  • openspec/CHANGE_ORDER.md
  • openspec/changes/tester-cli-reliability/.openspec.yaml
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • openspec/changes/tester-cli-reliability/proposal.md
  • openspec/changes/tester-cli-reliability/specs/ci-integration/spec.md
  • openspec/changes/tester-cli-reliability/specs/cli-error-guidance/spec.md
  • openspec/changes/tester-cli-reliability/specs/command-package-runtime-validation/spec.md
  • openspec/changes/tester-cli-reliability/specs/core-cli-reference/spec.md
  • openspec/changes/tester-cli-reliability/specs/generated-command-overview/spec.md
  • openspec/changes/tester-cli-reliability/specs/runtime-tool-probing/spec.md
  • openspec/changes/tester-cli-reliability/tasks.md
  • pyproject.toml
  • resources/templates/pr-template.md.j2
  • scripts/check-command-contract.py
  • scripts/check-docs-commands.py
  • scripts/generate-command-overview.py
  • scripts/pre-commit-quality-checks.sh
  • scripts/runtime_discovery_smoke.py
  • setup.py
  • src/__init__.py
  • src/specfact_cli/__init__.py
  • src/specfact_cli/cli.py
  • src/specfact_cli/modules/init/module-package.yaml
  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/module-package.yaml
  • src/specfact_cli/modules/upgrade/src/commands.py
  • src/specfact_cli/utils/bundle_loader.py
  • src/specfact_cli/utils/env_manager.py
  • src/specfact_cli/utils/github_annotations.py
  • src/specfact_cli/utils/ide_setup.py
  • src/specfact_cli/utils/progressive_disclosure.py
  • src/specfact_cli/utils/structure.py
  • src/specfact_cli/utils/suggestions.py
  • tests/conftest.py
  • tests/integration/scripts/test_runtime_discovery_smoke.py
  • tests/unit/cli/test_error_guidance.py
  • tests/unit/cli/test_lean_help_output.py
  • tests/unit/commands/test_backlog_daily.py
  • tests/unit/commands/test_update.py
  • tests/unit/docs/test_docs_validation_scripts.py
  • tests/unit/migration/test_module_migration_07_cleanup.py
  • tests/unit/modules/init/test_init_ide_prompt_selection.py
  • tests/unit/registry/test_category_groups.py
  • tests/unit/registry/test_module_installer.py
  • tests/unit/specfact_cli/registry/test_profile_presets.py
  • tests/unit/utils/test_env_manager.py
  • tests/unit/utils/test_ide_setup.py
  • tests/unit/workflows/test_trustworthy_green_checks.py

Comment thread .github/workflows/docs-review.yml
Comment thread .github/workflows/pr-orchestrator.yml
Comment thread .github/workflows/specfact.yml Outdated
Comment thread .markdownlint.json
Comment thread docs/examples/integration-showcases/integration-showcases-testing-guide.md Outdated
Comment thread src/specfact_cli/modules/upgrade/src/commands.py
Comment thread src/specfact_cli/utils/suggestions.py Outdated
Comment thread tests/unit/cli/test_error_guidance.py
Comment thread tests/unit/cli/test_error_guidance.py Outdated
Comment thread tests/unit/cli/test_lean_help_output.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
docs/examples/integration-showcases/integration-showcases-testing-guide.md (1)

1231-1247: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make the pre-commit comparison explicitly use the documented baseline.

The docs say baseline selection is explicit, but the hook command still relies on implicit plan selection (--repo . only), and the summary still describes the old plan compare --code-vs-plan flow. This can compare against the wrong plan when multiple bundles exist.

Suggested fix
-# Then compare against the explicitly named auto-derived bundle
-specfact --no-banner code drift detect auto-derived --repo .
+# Then compare explicit baseline vs explicit auto-derived bundle
+BASELINE_BUNDLE="example4_precommit"
+specfact --no-banner code drift detect auto-derived \
+  --manual ".specfact/projects/${BASELINE_BUNDLE}" \
+  --auto ".specfact/projects/auto-derived"

-- **Manual plan**: The baseline bundle named by the workflow or `main.bundle.yaml` as fallback
+- **Manual plan**: The baseline bundle path passed explicitly via `--manual`
 - **Auto plan**: The latest `auto-derived` project bundle (from `code import from-code auto-derived` or default bundle name)

-- ✅ Pre-commit hook workflow: `code import from-code` → `plan compare --code-vs-plan` works correctly
+- ✅ Pre-commit hook workflow: `code import from-code` → `code drift detect auto-derived --manual ... --auto ...` works correctly
As per coding guidelines `docs/**/*.md`: User-facing accuracy: CLI examples match current behavior; preserve Jekyll front matter; call out when README/docs index need sync.

Also applies to: 1653-1653

🤖 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 `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`
around lines 1231 - 1247, The pre-commit example uses an implicit plan selection
(`specfact --no-banner code drift detect auto-derived --repo .`) which can pick
the wrong bundle when multiple bundles exist; update the example to pass an
explicit baseline/plan bundle (e.g., add the explicit baseline argument used by
`plan compare --code-vs-plan` such as `--baseline` or the explicit bundle name
instead of relying on `--repo .` and `auto-derived`) and revise the surrounding
text that describes `--code-vs-plan` so it documents the explicit baseline
resolution (mentioning the manual plan fallback like `main.bundle.yaml` and the
auto plan `auto-derived`) to ensure the CLI example and description match
current behavior.
🤖 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 `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`:
- Around line 1153-1162: The snippet uses a hard-coded BUNDLE_NAME and an
undefined PLAN_FILE which breaks copy/paste and points health checks at the
wrong baseline; change it to derive the bundle and plan names from the actual
file variables used earlier (ensure PLAN_FILE is defined in the preceding steps
or replace PLAN_FILE with the correct existing variable), set BUNDLE_NAME from
that derived value (instead of "example4_github_actions"), compute PLAN_NAME
from the same PLAN_FILE/descriptor, and update both specfact --no-banner project
health-check calls to use these derived BUNDLE_NAME and PLAN_NAME so they target
the correct baseline.

In `@src/specfact_cli/modules/init/src/commands.py`:
- Line 16: Replace the hard dependency on the private typer internals by
removing the import of typer._click.core.Context and using the public context
type instead: change the import to a public Context (e.g., import typer and use
typer.Context or import click and use click.Context) and update the
`@beartype-decorated` init callback signature to reference that public Context
type; ensure you only modify the import and the type used in the init function
signature (symbols to update: the import of typer._click.core.Context and the
init callback that currently uses that type).

---

Outside diff comments:
In `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`:
- Around line 1231-1247: The pre-commit example uses an implicit plan selection
(`specfact --no-banner code drift detect auto-derived --repo .`) which can pick
the wrong bundle when multiple bundles exist; update the example to pass an
explicit baseline/plan bundle (e.g., add the explicit baseline argument used by
`plan compare --code-vs-plan` such as `--baseline` or the explicit bundle name
instead of relying on `--repo .` and `auto-derived`) and revise the surrounding
text that describes `--code-vs-plan` so it documents the explicit baseline
resolution (mentioning the manual plan fallback like `main.bundle.yaml` and the
auto plan `auto-derived`) to ensure the CLI example and description match
current behavior.
🪄 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

Run ID: 830ef8fc-c832-46c5-b03d-9f4e8ca02114

📥 Commits

Reviewing files that changed from the base of the PR and between 5297ea5 and 55746a3.

📒 Files selected for processing (32)
  • .github/workflows/docs-review.yml
  • .github/workflows/pr-orchestrator.yml
  • .github/workflows/specfact.yml
  • .markdownlint.json
  • CHANGELOG.md
  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
  • docs/migration/migration-cli-reorganization.md
  • docs/reference/commands.generated.json
  • docs/reference/commands.generated.md
  • llms.txt
  • openspec/CHANGE_ORDER.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • openspec/changes/tester-cli-reliability/tasks.md
  • pyproject.toml
  • scripts/check-command-contract.py
  • scripts/check-docs-commands.py
  • scripts/generate-command-overview.py
  • setup.py
  • src/__init__.py
  • src/specfact_cli/__init__.py
  • src/specfact_cli/cli.py
  • src/specfact_cli/modules/init/module-package.yaml
  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/module-package.yaml
  • src/specfact_cli/modules/upgrade/src/commands.py
  • src/specfact_cli/utils/structure.py
  • src/specfact_cli/utils/suggestions.py
  • tests/unit/cli/test_error_guidance.py
  • tests/unit/cli/test_lean_help_output.py
  • tests/unit/commands/test_update.py
  • tests/unit/docs/test_docs_validation_scripts.py
  • tests/unit/utils/test_suggestions.py
✅ Files skipped from review due to trivial changes (11)
  • tests/unit/utils/test_suggestions.py
  • openspec/CHANGE_ORDER.md
  • CHANGELOG.md
  • src/specfact_cli/utils/structure.py
  • .markdownlint.json
  • openspec/changes/tester-cli-reliability/tasks.md
  • setup.py
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • docs/reference/commands.generated.json
  • llms.txt
  • docs/reference/commands.generated.md
🚧 Files skipped from review as they are similar to previous changes (11)
  • src/init.py
  • src/specfact_cli/modules/init/module-package.yaml
  • docs/migration/migration-cli-reorganization.md
  • src/specfact_cli/init.py
  • tests/unit/cli/test_error_guidance.py
  • scripts/check-command-contract.py
  • tests/unit/docs/test_docs_validation_scripts.py
  • scripts/generate-command-overview.py
  • .github/workflows/pr-orchestrator.yml
  • tests/unit/commands/test_update.py
  • src/specfact_cli/cli.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Type Checking (basedpyright)
  • GitHub Check: CLI Command Validation
  • GitHub Check: Contract-First CI
  • GitHub Check: Tests (Python 3.12)
  • GitHub Check: Linting (ruff, pylint, safe-write guard)
🧰 Additional context used
📓 Path-based instructions (19)
**/*.yaml

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

YAML files must pass linting using: hatch run yaml-lint with relaxed policy.

Files:

  • src/specfact_cli/modules/upgrade/module-package.yaml
**/*.{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Validate YAML configuration files locally using hatch run yaml-lint before committing

**/*.{yml,yaml}: Format all YAML and workflow files using hatch run yaml-fix-all before committing
Use Prettier to fix whitespace, indentation, and final newline across YAML files
Use yamllint with the repo .yamllint configuration (line-length 140, trailing spaces and final newline enforced) to lint non-workflow YAML files

Files:

  • src/specfact_cli/modules/upgrade/module-package.yaml
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use @lru_cache and Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...

Files:

  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/src/commands.py
  • tests/unit/cli/test_lean_help_output.py
  • src/specfact_cli/utils/suggestions.py
  • scripts/check-docs-commands.py
src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

src/**/*.py: All code changes must be followed by running the full test suite using the smart test system.
All Python files in src/ and tools/ directories must have corresponding test files in tests/ directory. If you modify src/common/logger_setup.py, you MUST have tests/unit/common/test_logger_setup.py. NO EXCEPTIONS - even small changes require tests.
All new Python runtime code files must have corresponding test files created BEFORE committing the code. NO EXCEPTIONS - no code without tests.
Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
All components must support TEST_MODE=true environment variable with test-specific behavior defined as: if os.environ.get('TEST_MODE') == 'true': # test-specific behavior
Use src/common/logger_setup.py for all logging via: from common.logger_setup import get_logger; logger = get_logger(name)
Use src/common/redis_client.py with fallback for Redis operations via: from common.redis_client import get_redis_client; redis_client = get_redis_client()
Type checking must pass with no errors using: mypy .
Test coverage must meet or exceed 80% total coverage. New code must have corresponding tests. Modified code must maintain or improve coverage. Critical paths must have 100% coverage.
Use Pydantic v2 validation for all context and data schemas.

Add/update contracts on new or modified public APIs, stateful classes and adapters using icontract decorators and beartype runtime type checks

src/**/*.py: Meaningful Naming — identifiers reveal intent; avoid abbreviations. Identifiers in src/ must use snake_case (modules/functions), PascalCase (classes), UPPER_SNAKE_CASE (constants). Avoid single-letter names outside short loop variables.
KISS — keep functions and modules small and single-purpose. Maximum function length: 120 lines (Phase A error threshold). Maximum cyclomati...

Files:

  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/src/commands.py
  • src/specfact_cli/utils/suggestions.py
@(src|tests)/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Linting must pass with no errors using: pylint src tests

Files:

  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/src/commands.py
  • tests/unit/cli/test_lean_help_output.py
  • src/specfact_cli/utils/suggestions.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: hatch run format, (2) Type checking: hatch run type-check (basedpyright), (3) Contract-first approach: Run hatch run contract-test for contract validation, (4) Run full test suite: hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have @icontract decorators and @beartype type checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments

Files:

  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/src/commands.py
  • tests/unit/cli/test_lean_help_output.py
  • src/specfact_cli/utils/suggestions.py
  • scripts/check-docs-commands.py
src/specfact_cli/**/*.py

⚙️ CodeRabbit configuration file

src/specfact_cli/**/*.py: Focus on modular CLI architecture: lazy module loading, registry/bootstrap patterns, and
dependency direction. Flag breaking changes to public APIs, Pydantic models, and resource
bundling. Verify @icontract + @beartype on public surfaces; prefer centralized logging
(get_bridge_logger) over print().

Files:

  • src/specfact_cli/modules/init/src/commands.py
  • src/specfact_cli/modules/upgrade/src/commands.py
  • src/specfact_cli/utils/suggestions.py
{src/__init__.py,pyproject.toml,setup.py}

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

{src/__init__.py,pyproject.toml,setup.py}: Update src/init.py first as primary source of truth for package version, then pyproject.toml and setup.py
Maintain version synchronization across src/init.py, pyproject.toml, and setup.py

Files:

  • pyproject.toml
{pyproject.toml,setup.py,src/__init__.py}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Manually update version numbers in pyproject.toml, setup.py, and src/init.py when making a formal version change

Files:

  • pyproject.toml
pyproject.toml

📄 CodeRabbit inference engine (.cursorrules)

When updating the version in pyproject.toml, ensure it's newer than the latest PyPI version. The CI/CD pipeline will automatically publish to PyPI only if the new version is greater than the published version

Files:

  • pyproject.toml
.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Validate GitHub workflow files using hatch run lint-workflows before committing

.github/workflows/*.{yml,yaml}: Use actionlint for semantic validation of GitHub Actions workflows
Format GitHub Actions workflows using hatch run workflows-fmt and lint them with hatch run workflows-lint after editing

Files:

  • .github/workflows/specfact.yml
  • .github/workflows/docs-review.yml
.github/workflows/!(tests).{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Do not re-run the full test suite in other CI workflows; tests are enforced only in the dedicated Tests workflow (.github/workflows/tests.yml)

Files:

  • .github/workflows/specfact.yml
  • .github/workflows/docs-review.yml
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: CI safety: secrets usage, workflow dependencies, alignment with hatch test / contract-test
gates, and action versions.

Files:

  • .github/workflows/specfact.yml
  • .github/workflows/docs-review.yml
**/test_*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use @pytest.mark.asyncio decorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module

Files:

  • tests/unit/cli/test_lean_help_output.py
tests/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.

tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles

Secret redaction via LoggerSetup.redact_secrets must be covered by unit tests

Files:

  • tests/unit/cli/test_lean_help_output.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.

Files:

  • tests/unit/cli/test_lean_help_output.py
**/*.{md,mdc}

📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)

**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
docs/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md

⚙️ CodeRabbit configuration file

docs/**/*.md: User-facing accuracy: CLI examples match current behavior; preserve Jekyll front matter;
call out when README/docs index need sync.

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
**/*.md

📄 CodeRabbit inference engine (.cursorrules)

Avoid markdown linting errors (refer to markdown-rules)

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
scripts/**/*.py

⚙️ CodeRabbit configuration file

scripts/**/*.py: Deterministic tooling: subprocess safety, Hatch integration, and parity with documented
quality gates (format, type-check, module signing).

Files:

  • scripts/check-docs-commands.py
🪛 GitHub Actions: Docs Review / 0_Docs Review.txt
src/specfact_cli/modules/init/src/commands.py

[error] 16-16: Import error in commands.py: 'from typer._click.core import Context as TyperClickContext' failed with 'ModuleNotFoundError: No module named 'typer._click''.

🪛 GitHub Actions: Docs Review / Docs Review
src/specfact_cli/modules/init/src/commands.py

[error] 16-16: Import error: from typer._click.core import Context as TyperClickContext (typer._click module not found).

🪛 zizmor (1.25.2)
.github/workflows/specfact.yml

[info] 86-86: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🔀 Multi-repo context nold-ai/specfact-cli-modules

Linked repositories findings

nold-ai/specfact-cli-modules

  • Many docs and package prompts already use the new subcommand names and argument ordering introduced by the PR:

    • docs/reference/command-syntax-policy.md documents the canonical ordering "specfact code import --repo . legacy-api" and explicitly enforces options-before-positional for code import examples. [::nold-ai/specfact-cli-modules::docs/reference/command-syntax-policy.md]
    • Multiple docs and package prompt files reference specfact code import --repo . and specfact code repro --repo . (examples across docs/, packages//resources/prompts/, and openspec/). These will be validated against core’s generated command artifacts by the new checks. Representative hits: packages/specfact-project, packages/specfact-codebase, docs/guides/, docs/reference/, openspec/ . [::nold-ai/specfact-cli-modules::] (many files under docs/ and packages/)
  • Tests in this repo already exercise and expect the new command forms:

    • tests/unit/test_check_prompt_commands_script.py includes specfact code repro --repo . examples/tests. [::nold-ai/specfact-cli-modules::tests/unit/test_check_prompt_commands_script.py]
    • Other unit tests reference specfact code repro and specfact code import patterns used by the new core scripts. [::nold-ai/specfact-cli-modules::tests/unit/]
  • Dev/bootstrap and CI integration expect/produce the SPECFACT_MODULES_REPO integration used by the core workflows:

    • src/specfact_cli_modules/dev_bootstrap.py sets SPECFACT_MODULES_REPO to the modules repo root, resolves a paired core checkout via a specfact-cli-modules-worktrees marker, and exposes SPECFACT_REPO_ROOT for paired core checkouts. This aligns with the core PR’s checkout/WORKTREE resolution and environment variable usage (SPECFACT_MODULES_REPO / SPECFACT_REPO_ROOT). [::nold-ai/specfact-cli-modules::src/specfact_cli_modules/dev_bootstrap.py]
    • scripts/pre_commit_code_review.py also sets SPECFACT_MODULES_REPO for review tasks. [::nold-ai/specfact-cli-modules::scripts/pre_commit_code_review.py]
  • No conflicting references found: the modules repo already assumes the new core command names and the SPECFACT_MODULES_REPO env pattern; therefore the core PR’s workflow steps that resolve and check out the modules repo (and generate/validate command artifacts) are consistent with this repo’s expectations. (Searches for commands.generated and llms.txt returned no direct artifacts in this repo.) [::nold-ai/specfact-cli-modules::]

Conclusion: nold-ai/specfact-cli-modules is a consumer of the CLI contract artifacts and already aligns with the new command names/ordering and environment variable integration; the core PR’s changes to generate/check command-overview artifacts and to checkout modules via SPECFACT_MODULES_REPO are expected and supported by this repo.

🔇 Additional comments (8)
src/specfact_cli/modules/upgrade/module-package.yaml (1)

2-2: LGTM!

pyproject.toml (1)

7-7: LGTM!

Also applies to: 250-253, 258-258

.github/workflows/specfact.yml (1)

86-96: LGTM!

.github/workflows/docs-review.yml (1)

91-91: LGTM!

Also applies to: 96-96

src/specfact_cli/modules/upgrade/src/commands.py (1)

296-299: LGTM!

Also applies to: 310-310, 313-326

tests/unit/cli/test_lean_help_output.py (1)

5-5: LGTM!

Also applies to: 20-25, 161-167, 173-173, 176-178

src/specfact_cli/utils/suggestions.py (1)

49-49: LGTM!

Also applies to: 56-57, 93-95, 108-108, 130-130

scripts/check-docs-commands.py (1)

133-133: LGTM!

Also applies to: 265-266, 295-296

Comment thread docs/examples/integration-showcases/integration-showcases-testing-guide.md Outdated
Comment thread src/specfact_cli/modules/init/src/commands.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 `@tests/unit/modules/init/test_first_run_selection.py`:
- Around line 18-21: The test
test_init_commands_avoid_private_typer_click_import uses a hardcoded
Path("src/specfact_cli/modules/init/src/commands.py") which breaks when pytest
runs outside repo root; update the test to derive the file location from the
imported module object (e.g., use the commands module's __file__ or
inspect.getsourcefile on specfact_cli.modules.init.src.commands) and read that
path's text, then assert "typer._click" not in source so the test is
location-independent.
🪄 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

Run ID: 07002204-0694-49f0-89c4-7812b2acfa82

📥 Commits

Reviewing files that changed from the base of the PR and between 55746a3 and a07cd54.

📒 Files selected for processing (14)
  • .github/workflows/specfact.yml
  • CHANGELOG.md
  • docs/reference/commands.generated.json
  • docs/reference/commands.generated.md
  • llms.txt
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • pyproject.toml
  • setup.py
  • src/__init__.py
  • src/specfact_cli/__init__.py
  • src/specfact_cli/modules/init/module-package.yaml
  • src/specfact_cli/modules/init/src/commands.py
  • tests/unit/modules/init/test_first_run_selection.py
  • tests/unit/workflows/test_trustworthy_green_checks.py
✅ Files skipped from review due to trivial changes (3)
  • docs/reference/commands.generated.md
  • docs/reference/commands.generated.json
  • llms.txt
🚧 Files skipped from review as they are similar to previous changes (7)
  • setup.py
  • src/specfact_cli/modules/init/module-package.yaml
  • pyproject.toml
  • src/specfact_cli/modules/init/src/commands.py
  • tests/unit/workflows/test_trustworthy_green_checks.py
  • src/init.py
  • src/specfact_cli/init.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Compatibility (Python 3.11)
  • GitHub Check: Linting (ruff, pylint, safe-write guard)
  • GitHub Check: Tests (Python 3.12)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{md,mdc}

📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)

**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files

Files:

  • CHANGELOG.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
CHANGELOG.md

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

Include new version entries at the top of CHANGELOG.md when updating versions

Update CHANGELOG.md with all code changes as part of version control requirements.

Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change

Files:

  • CHANGELOG.md
**/*.md

📄 CodeRabbit inference engine (.cursorrules)

Avoid markdown linting errors (refer to markdown-rules)

Files:

  • CHANGELOG.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Validate GitHub workflow files using hatch run lint-workflows before committing

.github/workflows/*.{yml,yaml}: Use actionlint for semantic validation of GitHub Actions workflows
Format GitHub Actions workflows using hatch run workflows-fmt and lint them with hatch run workflows-lint after editing

Files:

  • .github/workflows/specfact.yml
.github/workflows/!(tests).{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)

Do not re-run the full test suite in other CI workflows; tests are enforced only in the dedicated Tests workflow (.github/workflows/tests.yml)

Files:

  • .github/workflows/specfact.yml
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: CI safety: secrets usage, workflow dependencies, alignment with hatch test / contract-test
gates, and action versions.

Files:

  • .github/workflows/specfact.yml
**/test_*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use @pytest.mark.asyncio decorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module

Files:

  • tests/unit/modules/init/test_first_run_selection.py
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use @lru_cache and Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...

Files:

  • tests/unit/modules/init/test_first_run_selection.py
tests/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.

tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles

Secret redaction via LoggerSetup.redact_secrets must be covered by unit tests

Files:

  • tests/unit/modules/init/test_first_run_selection.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.

Files:

  • tests/unit/modules/init/test_first_run_selection.py
@(src|tests)/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Linting must pass with no errors using: pylint src tests

Files:

  • tests/unit/modules/init/test_first_run_selection.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: hatch run format, (2) Type checking: hatch run type-check (basedpyright), (3) Contract-first approach: Run hatch run contract-test for contract validation, (4) Run full test suite: hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have @icontract decorators and @beartype type checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments

Files:

  • tests/unit/modules/init/test_first_run_selection.py
openspec/changes/**/*.md

📄 CodeRabbit inference engine (.cursorrules)

For /opsx:archive (Archive change): Include module signing and cleanup in final tasks. Agents MUST run openspec archive <change-id> from repo root (no manual mv under openspec/changes/archive/)

Files:

  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
openspec/**/*.md

⚙️ CodeRabbit configuration file

openspec/**/*.md: Treat as specification source of truth: proposal/tasks/spec deltas vs. code behavior,
CHANGE_ORDER consistency, and scenario coverage. Surface drift between OpenSpec and
implementation.

Files:

  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
🪛 LanguageTool
openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md

[uncategorized] ~158-~158: The official name of this software platform is spelled with a capital “H”.
Context: ... - Contract Validation failed because .github/workflows/specfact.yml ran `specfact c...

(GITHUB)


[uncategorized] ~161-~161: The official name of this software platform is spelled with a capital “H”.
Context: ...off Typer private namespaces. - Updated .github/workflows/specfact.yml to resolve the ...

(GITHUB)


[grammar] ~163-~163: Use a hyphen to join words.
Context: ...branch_when_available`. - Refreshed core generated command artifacts after the pa...

(QB_NEW_EN_HYPHEN)

🔀 Multi-repo context nold-ai/specfact-cli-modules

nold-ai/specfact-cli-modules findings

  • Multiple docs and prompt templates already use the new CLI forms (specfact code import --repo . …, specfact code repro --repo .), so they are consumers of the generated command contract and will be validated by the new core checks. Examples:
    • docs/reference/command-syntax-policy.md (enforces options-before-positional) [::nold-ai/specfact-cli-modules::docs/reference/command-syntax-policy.md]
    • many docs under docs/, e.g. docs/reference/commands.md, docs/reference/modes.md, docs/bundles/codebase/* (multiple hits) [::nold-ai/specfact-cli-modules::docs/]
    • packages/specfact-project examples and CLI help strings referencing specfact code import … --repo . [::nold-ai/specfact-cli-modules::packages/specfact-project/src/specfact_project/import_cmd/commands.py]
  • Tests in this repo already exercise the new commands/forms and will interact with core’s validation scripts:
    • tests/unit/test_check_prompt_commands_script.py contains many specfact code repro --repo . examples [::nold-ai/specfact-cli-modules::tests/unit/test_check_prompt_commands_script.py]
    • tests/unit/docs/* reference specfact code repro patterns used by new checks [::nold-ai/specfact-cli-modules::tests/unit/docs/]
  • Workflow/CI and dev helpers already integrate with the SPECFACT_MODULES_REPO env var and paired-worktree resolution that the core PR’s workflows will set/use:
    • src/specfact_cli_modules/dev_bootstrap.py sets SPECFACT_MODULES_REPO and resolves paired worktrees (matching core CI checkout behavior) [::nold-ai/specfact-cli-modules::src/specfact_cli_modules/dev_bootstrap.py]
    • scripts/pre_commit_code_review.py and pyproject.toml reference SPECFACT_MODULES_REPO usage [::nold-ai/specfact-cli-modules::scripts/pre_commit_code_review.py][::nold-ai/specfact-cli-modules::pyproject.toml]
  • Codebase import runtime/ignore policy is present in this repo and aligns with core’s code import runtime hardening spec (shared consumer of code import behavior):
    • openspec/changes/codebase-import-runtime-hardening/* spec/proposal files and packages/specfact-project import/discovery helpers reference import traversal/ignore behavior [::nold-ai/specfact-cli-modules::openspec/changes/codebase-import-runtime-hardening][::nold-ai/specfact-cli-modules::packages/specfact-project/src/specfact_project/utils/import_path_policy.py]

Conclusion: This repository is a direct consumer of the CLI command contract artifacts and the SPECFACT_MODULES_REPO checkout behavior introduced in the PR. The core PR’s generated artifacts and workflow changes align with existing usage here; expect the new core docs-validation and command-contract checks to exercise many files in this repo (docs, prompts, and unit tests).

🔇 Additional comments (3)
CHANGELOG.md (1)

13-22: LGTM!

openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md (1)

154-172: LGTM!

.github/workflows/specfact.yml (1)

50-72: ⚡ Quick win

Supply-chain sanity check: pinned actions/checkout SHA matches official releases 🕵️

The pinned actions/checkout commit 34e114876b0b11c390a56381ad16ebd13914f8d5 corresponds to the official tags v4.3.1 (and v4). The overall ref resolution + checkout (persist-credentials: false) wiring at .github/workflows/specfact.yml (lines ~50-72) remains solid.

Comment thread tests/unit/modules/init/test_first_run_selection.py
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

SpecFact CLI Validation Report

All validations passed!
Duration: 19.89s
Checks: 4 total (1 passed) (3 skipped)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

SpecFact CLI Validation Report

All validations passed!
Duration: 20.01s
Checks: 4 total (1 passed) (3 skipped)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

SpecFact CLI Validation Report

All validations passed!
Duration: 19.66s
Checks: 4 total (1 passed) (3 skipped)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/examples/integration-showcases/integration-showcases-testing-guide.md (1)

1158-1158: ⚡ Quick win

Doc consistency (not correctness): --project-name is a valid alias for --bundle in project health-check.
In specfact-project’s health_check command, --project-name is explicitly defined as “Alias for --bundle” and the code resolves resolved_bundle = bundle or project_name, so the line 1158 snippet should work as written. Optional: switch to --bundle "$BUNDLE_NAME" to match the rest of the guide and reduce reader confusion.

🤖 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 `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`
at line 1158, The docs show a command using the alias --project-name but the
rest of the guide uses --bundle; update the snippet on line 1158 to use the
canonical flag to match surrounding examples by replacing specfact --no-banner
project health-check --project-name "$BUNDLE_NAME" --repo . with specfact
--no-banner project health-check --bundle "$BUNDLE_NAME" --repo ., or
alternatively add a brief parenthetical note that --project-name is an alias for
--bundle (referencing the health_check handling where resolved_bundle = bundle
or project_name) so readers aren’t confused.
🤖 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.

Nitpick comments:
In `@docs/examples/integration-showcases/integration-showcases-testing-guide.md`:
- Line 1158: The docs show a command using the alias --project-name but the rest
of the guide uses --bundle; update the snippet on line 1158 to use the canonical
flag to match surrounding examples by replacing specfact --no-banner project
health-check --project-name "$BUNDLE_NAME" --repo . with specfact --no-banner
project health-check --bundle "$BUNDLE_NAME" --repo ., or alternatively add a
brief parenthetical note that --project-name is an alias for --bundle
(referencing the health_check handling where resolved_bundle = bundle or
project_name) so readers aren’t confused.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 327182df-02b3-4043-b308-4aab538c84d4

📥 Commits

Reviewing files that changed from the base of the PR and between a07cd54 and 664580e.

📒 Files selected for processing (5)
  • .github/workflows/specfact.yml
  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
  • tests/unit/modules/init/test_first_run_selection.py
  • tests/unit/workflows/test_trustworthy_green_checks.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/specfact.yml
  • tests/unit/workflows/test_trustworthy_green_checks.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Tests (Python 3.12)
🧰 Additional context used
📓 Path-based instructions (10)
**/test_*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use @pytest.mark.asyncio decorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module

Files:

  • tests/unit/modules/init/test_first_run_selection.py
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)

**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use @lru_cache and Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...

Files:

  • tests/unit/modules/init/test_first_run_selection.py
tests/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.

tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles

Secret redaction via LoggerSetup.redact_secrets must be covered by unit tests

Files:

  • tests/unit/modules/init/test_first_run_selection.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.

Files:

  • tests/unit/modules/init/test_first_run_selection.py
@(src|tests)/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Linting must pass with no errors using: pylint src tests

Files:

  • tests/unit/modules/init/test_first_run_selection.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: hatch run format, (2) Type checking: hatch run type-check (basedpyright), (3) Contract-first approach: Run hatch run contract-test for contract validation, (4) Run full test suite: hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have @icontract decorators and @beartype type checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments

Files:

  • tests/unit/modules/init/test_first_run_selection.py
**/*.{md,mdc}

📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)

**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
docs/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)

Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md

⚙️ CodeRabbit configuration file

docs/**/*.md: User-facing accuracy: CLI examples match current behavior; preserve Jekyll front matter;
call out when README/docs index need sync.

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
**/*.md

📄 CodeRabbit inference engine (.cursorrules)

Avoid markdown linting errors (refer to markdown-rules)

Files:

  • docs/examples/integration-showcases/integration-showcases-testing-guide.md
  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
openspec/changes/**/*.md

📄 CodeRabbit inference engine (.cursorrules)

For /opsx:archive (Archive change): Include module signing and cleanup in final tasks. Agents MUST run openspec archive <change-id> from repo root (no manual mv under openspec/changes/archive/)

Files:

  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
openspec/**/*.md

⚙️ CodeRabbit configuration file

openspec/**/*.md: Treat as specification source of truth: proposal/tasks/spec deltas vs. code behavior,
CHANGE_ORDER consistency, and scenario coverage. Surface drift between OpenSpec and
implementation.

Files:

  • openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md
🪛 LanguageTool
openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md

[uncategorized] ~162-~162: The official name of this software platform is spelled with a capital “H”.
Context: ...uns from the repository root. - Updated .github/workflows/specfact.yml to resolve the ...

(GITHUB)

🔀 Multi-repo context nold-ai/specfact-cli-modules

Linked repositories findings

nold-ai/specfact-cli-modules

  • Docs and prompts use the new CLI forms (specfact code import --repo . ... and specfact code repro --repo .), so they are direct consumers of the generated command contract and will be validated by the new core scripts:

    • docs/reference/commands.md, docs/reference/modes.md, docs/reference/command-syntax-policy.md, docs/reference/thorough-codebase-validation.md, docs/* (many) [::nold-ai/specfact-cli-modules::docs/reference/commands.md]
    • packages/specfact-project/src/specfact_project/import_cmd/commands.py (examples using specfact code import ... --repo .) [::nold-ai/specfact-cli-modules::packages/specfact-project/src/specfact_project/import_cmd/commands.py]
    • packages/specfact-codebase/resources/prompts/specfact.01-import.md (uses specfact code import from-code ...) [::nold-ai/specfact-cli-modules::packages/specfact-codebase/resources/prompts/specfact.01-import.md]
  • Tests reference and exercise specfact code repro and specfact code import examples that the core scripts will scan/validate:

    • tests/unit/test_check_prompt_commands_script.py (multiple specfact code repro --repo . examples) [::nold-ai/specfact-cli-modules::tests/unit/test_check_prompt_commands_script.py]
    • tests/unit/docs/* reference repro/import patterns used by new checks [::nold-ai/specfact-cli-modules::tests/unit/docs/]
  • This repo already implements and tests the paired-worktree / SPECFACT_MODULES_REPO pattern the core PR’s workflows will set/use:

    • src/specfact_cli_modules/dev_bootstrap.py and tests/unit/test_dev_bootstrap.py (resolve/set SPECFACT_MODULES_REPO, worktrees handling) [::nold-ai/specfact-cli-modules::src/specfact_cli_modules/dev_bootstrap.py][::nold-ai/specfact-cli-modules::tests/unit/test_dev_bootstrap.py]
    • scripts/pre_commit_code_review.py uses SPECFACT_MODULES_REPO [::nold-ai/specfact-cli-modules::scripts/pre_commit_code_review.py]
  • OpenSpec and proposal/spec files in this repo already reference code import runtime-ignore policy and command-contract validation work; these will be subject to the core-generated artifacts and freshness gates:

    • openspec/changes/codebase-import-runtime-hardening/* (specs, proposal, TDD_EVIDENCE) [::nold-ai/specfact-cli-modules::openspec/changes/codebase-import-runtime-hardening]
    • openspec/changes/prompt-command-contract-validation/* (proposal/spec) [::nold-ai/specfact-cli-modules::openspec/changes/prompt-command-contract-validation]
  • The repository contains docs & scripts that the core PR’s new CI/docs checks may validate or fail if artifacts/examples diverge (command-ordering, examples with old positional bundle usage):

    • docs/guides/command-chains.md, docs/guides/openspec-journey.md, docs/bundles/project/import-migration.md — contain legacy positional examples (some use specfact code import legacy-api --repo .) that may be flagged by core validation [::nold-ai/specfact-cli-modules::docs/guides/command-chains.md][::nold-ai/specfact-cli-modules::docs/guides/openspec-journey.md][::nold-ai/specfact-cli-modules::docs/bundles/project/import-migration.md]
  • Summary: specfact-cli-modules is a direct consumer of the new generated command contract and the SPECFACT_MODULES_REPO pairing behavior; expect the core PR’s new generation/validation scripts and CI workflow changes to exercise many docs, prompts, and tests in this repo. Relevant files and tests are present and already partially aligned, but several docs/examples still show legacy argument ordering that core checks may flag. [::nold-ai/specfact-cli-modules::]

🔇 Additional comments (4)
tests/unit/modules/init/test_first_run_selection.py (1)

19-24: LGTM!

docs/examples/integration-showcases/integration-showcases-testing-guide.md (2)

1223-1227: LGTM!


1230-1240: LGTM!

Also applies to: 1261-1282

openspec/changes/tester-cli-reliability/TDD_EVIDENCE.md (1)

161-165: LGTM!

@djm81 djm81 merged commit 47f8e19 into dev Jun 1, 2026
27 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in SpecFact CLI Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture Architecture and design changes bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request module-system Module system and registry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant