Skip to content

docs(docs-15): modules docs validation guardrails and code-review parity#203

Merged
djm81 merged 3 commits intodevfrom
feature/docs-15-code-review-validation-guardrails
Apr 15, 2026
Merged

docs(docs-15): modules docs validation guardrails and code-review parity#203
djm81 merged 3 commits intodevfrom
feature/docs-15-code-review-validation-guardrails

Conversation

@djm81
Copy link
Copy Markdown
Contributor

@djm81 djm81 commented Apr 15, 2026

Summary

This change hardens the modules documentation site and quality gates for the OpenSpec work tracked as docs-15-code-review-validation-guardrails. It adds shared validation for published-route link semantics, front matter completeness, and optional bundle check coverage for docs/Gemfile.lock, wires those checks into pre-commit (when docs or validation scripts change) and into docs-review / docs-pages workflows, fixes bundle overview and guide links that broke under Jekyll permalinks, refreshes docs/Gemfile.lock for resolvable Ruby deps, and aligns Code Review bundle and module docs with the current specfact code review run surface. A regression test fix ensures isolated git subprocesses in tests never inherit GIT_DIR / GIT_WORK_TREE from the environment (which could otherwise mutate the outer worktree).

Refs:

Scope

  • Bundle source changes under packages/
  • Registry/manifest changes (registry/index.json, packages/*/module-package.yaml)
  • CI/workflow changes (.github/workflows/*)
  • Documentation changes (docs/*, README.md, AGENTS.md)
  • Security/signing changes (scripts/sign-modules.py, scripts/verify-modules-signature.py)

Bundle Impact

No bundle or module manifest version changes in this PR (docs, scripts, tests, and workflows only).

Validation Evidence

Local runs on this branch (2026-04-15):

  • hatch run format — pass
  • hatch run type-check — pass
  • hatch run lint — pass
  • hatch run yaml-lint — pass
  • hatch run check-bundle-imports — pass (via pre-commit Block 1)
  • hatch run contract-test — pass (618 tests; invoked from pre-commit Block 2)
  • hatch run test — pass (618 tests)
  • python scripts/check-docs-commands.py — pass (no findings)
  • hatch run verify-modules-signature --payload-from-filesystem --enforce-version-bump — pass
  • hatch run specfact code review run --json --out .specfact/code-review.json --scope changedPASS, ci_exit_code 0, empty findings (full-repo --scope full remains red on unrelated historical complexity elsewhere)

Required local gates

  • hatch run format
  • hatch run type-check
  • hatch run lint
  • hatch run yaml-lint
  • hatch run check-bundle-imports
  • hatch run contract-test
  • hatch run smart-test (or hatch run test)

Signature + version integrity (required)

  • hatch run verify-modules-signature --payload-from-filesystem --enforce-version-bump passes (matches PRs targeting dev)
  • If this PR targets main, also confirmed: hatch run verify-modules-signature --require-signature --payload-from-filesystem --enforce-version-bump (and/or approval triggered sign-modules-on-approval for same-repo PRs)
  • Changed bundle versions were bumped when module payloads changed (N/A — no payload changes)
  • Manifests signed when required by your target branch (CI may sign on approval for dev/main same-repo PRs) (N/A for this diff)

CI and Branch Protection

  • PR orchestrator jobs expected:
    • verify-module-signatures
    • sign-modules-on-approval (on approval, same-repo PRs to dev/main only)
    • quality (3.11)
    • quality (3.12)
    • quality (3.13)
  • Branch protection required checks are aligned with the above (no change expected)

Docs / Pages

  • Bundle/module docs updated in this repo (docs/)
  • Pages workflow impact reviewed (docs-pages.yml, if changed)
  • Cross-links from specfact-cli docs updated (if applicable)

Checklist

  • Self-review completed
  • No unrelated files or generated artifacts included
  • Backward-compatibility/rollout notes documented (if needed) — not required; validation is stricter for authors but behavior is additive for readers

…rity

Add shared docs site validation (published routes, front matter, optional
bundle check), wire pre-commit and docs CI, fix overview/guide links and
Gemfile.lock, align code-review module docs with the run guide. Harden the
git-branch signature flag test: use git commit --no-verify in the fixture
repo and scrub inherited GIT_DIR-style env vars so nested git never touches
the outer worktree. Tracks openspec change docs-15-code-review-validation-guardrails.

Made-with: Cursor
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a83fd3f1-40d5-4e8f-b474-72d3b630faf8

📥 Commits

Reviewing files that changed from the base of the PR and between 5108467 and 35d5388.

📒 Files selected for processing (13)
  • docs/bundles/code-review/run.md
  • docs/getting-started/README.md
  • docs/guides/README.md
  • docs/guides/openspec-journey.md
  • docs/reference/README.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • scripts/docs_site_validation.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/test_check_docs_commands_script.py
📜 Recent 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: quality (3.12)
  • GitHub Check: quality (3.13)
  • GitHub Check: quality (3.11)
🧰 Additional context used
📓 Path-based instructions (5)
docs/**/*.md

⚙️ CodeRabbit configuration file

docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract,
CLI examples matching bundled commands.

Files:

  • docs/guides/openspec-journey.md
  • docs/reference/README.md
  • docs/getting-started/README.md
  • docs/bundles/code-review/run.md
  • docs/guides/README.md
openspec/**/*.md

⚙️ CodeRabbit configuration file

openspec/**/*.md: Specification truth: proposal/tasks/spec deltas vs. bundle behavior, CHANGE_ORDER, and
drift vs. shipped modules or docs.

Files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
**/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h}

📄 CodeRabbit inference engine (CLAUDE.md)

Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Files:

  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • scripts/docs_site_validation.py
tests/**/*.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first and integration tests: migration suites, bundle validation, and flakiness.
Ensure changes to adapters or bridges have targeted coverage.

Files:

  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
scripts/**/*.py

⚙️ CodeRabbit configuration file

scripts/**/*.py: Deterministic tooling: signing, publishing, docs generation; subprocess and path safety.

Files:

  • scripts/docs_site_validation.py
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Treat the clean-code compliance gate as mandatory: the review surface enforces `naming`, `kiss`, `yagni`, `dry`, and `solid` categories and blocks regressions
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • docs/bundles/code-review/run.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • tests/unit/docs/test_code_review_docs_parity.py
  • docs/bundles/code-review/run.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • tests/unit/docs/test_code_review_docs_parity.py
  • docs/bundles/code-review/run.md
📚 Learning: 2026-04-13T10:38:15.842Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • tests/unit/test_check_docs_commands_script.py
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Treat the clean-code compliance gate as mandatory: the review surface enforces `naming`, `kiss`, `yagni`, `dry`, and `solid` categories and blocks regressions

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • docs/guides/README.md
📚 Learning: 2026-04-02T21:49:11.371Z
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: Signed module or manifest changes require version-bump review and verify-modules-signature

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Applies to **/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h} : Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
🪛 LanguageTool
openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md

[grammar] ~19-~19: Use a hyphen to join words.
Context: ...ew page ## Requirement: Bundle overview related links SHALL be covered by docs v...

(QB_NEW_EN_HYPHEN)

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

nold-ai/specfact-cli

  • scripts/docs_site_validation.py — New public API (ValidationFinding type and many helpers: build_route_index, build_path_to_canonical_route, scan_published_route_body_links, scan_frontmatter_findings, scan_gemfile_lock_installability, resolve_internal_link_hybrid, etc.). Consumers:

    • scripts/check-docs-commands.py imports and delegates to docs_site_validation (type alias change to ValidationFinding). [::nold-ai/specfact-cli::scripts/docs_site_validation.py]
    • tests/unit/docs/test_docs_review.py and tests/unit/test_check_docs_commands_script.py updated to call docs_site_validation helpers. [::nold-ai/specfact-cli::tests/unit/docs/test_docs_review.py] [::nold-ai/specfact-cli::tests/unit/test_check_docs_commands_script.py]
  • scripts/check-docs-commands.py — Entrypoint changed to accept argv; delegates validation work to scripts/docs_site_validation. Tests import this module via path-loading:

    • tests/unit/docs/test_docs_validation_scripts.py loads scripts/check-docs-commands.py for assertions. [::nold-ai/specfact-cli::scripts/check-docs-commands.py] [::nold-ai/specfact-cli::tests/unit/docs/test_docs_validation_scripts.py]
  • CI / Workflows — Docs validation deps and execution:

    • .github/workflows/docs-review.yml now lists scripts/check-docs-commands.py and installs requirements-docs-ci.txt (workflow asserts present). Failing findings from the validator will affect PR docs-review job. [::nold-ai/specfact-cli::.github/workflows/docs-review.yml]
    • .github/workflows/docs-pages.yml (docs publishing) runs python scripts/check-docs-commands.py --jekyll-bundle-check after installing requirements-docs-ci.txt; a docs-site validation failure can block Pages upload. [::nold-ai/specfact-cli::.github/workflows/docs-pages.yml]
  • pyproject.toml — 'check-docs-commands' and 'docs-validate' script tasks point to scripts/check-docs-commands.py, tying tooling to the new validator. [::nold-ai/specfact-cli::pyproject.toml]

  • Tests asserting CLI/docs parity / code review usage:

    • tests/unit/docs/test_code_review_docs_parity.py enforces that all public Click/Typer option flags of the review_app run command appear in docs/bundles/code-review/run.md; changes to review_app flags will break this test until docs are updated. [::nold-ai/specfact-cli::tests/unit/docs/test_code_review_docs_parity.py] [::nold-ai/specfact-cli::docs/bundles/code-review/run.md]
    • Multiple openspec/docs files and tests reference "specfact code review run" (numerous files under docs/ and openspec/), so any change to that CLI surface or its error messages must be synchronized with docs to avoid test failures. [::nold-ai/specfact-cli::openspec/] [::nold-ai/specfact-cli::docs/]
  • pre-commit hook wiring:

    • scripts/pre-commit-quality-checks.sh added a staged-docs detection gate that invokes the docs validator (hatch run python scripts/check-docs-commands.py). Local commits touching docs/*, *.md, requirements-docs-ci.txt or validator scripts will run the validator and can be blocked by findings. [::nold-ai/specfact-cli::scripts/pre-commit-quality-checks.sh]
    • tests/unit/test_pre_commit_quality_parity.py updated to require these new fragments. [::nold-ai/specfact-cli::tests/unit/test_pre_commit_quality_parity.py]

Risk / review notes (observed in repo files):

  • Changing signatures, return shape, or field names of ValidationFinding or any exported helper in scripts/docs_site_validation.py will break scripts/check-docs-commands.py and multiple unit tests that import and assert on its findings. [::nold-ai/specfact-cli::scripts/docs_site_validation.py] [::nold-ai/specfact-cli::scripts/check-docs-commands.py] [::nold-ai/specfact-cli::tests/]
  • Changes to the review_app command options, or to the runtime error messages produced by its flag validation/resolvers, will cause tests/enforcement to fail until docs/bundles/code-review/run.md is updated to match. [::nold-ai/specfact-cli::tests/unit/docs/test_code_review_docs_parity.py] [::nold-ai/specfact-cli::docs/bundles/code-review/run.md]
  • CI/workflow behavior: workflows now install pinned docs CI deps (requirements-docs-ci.txt) and run the validator; any environment differences (missing bundler for Gemfile checks, timeouts) can surface as docs-build-dependency findings and block docs Pages and PR docs-review jobs. [::nold-ai/specfact-cli::.github/workflows/docs-review.yml] [::nold-ai/specfact-cli::.github/workflows/docs-pages.yml] [::nold-ai/specfact-cli::requirements-docs-ci.txt]

Conclusion: The PR introduces a new validator API and wires it into scripts, tests, pre-commit, and GitHub Actions. Cross-repo impact is contained within this repository (consumers and tests live here), but reviewers should pay attention to:

  • API stability of scripts/docs_site_validation.py (ValidationFinding and helper function names/behaviors).
  • Parity between review_app CLI surface and docs/bundles/code-review/run.md (tests enforce exact flag strings and resolver/error messages).
  • Workflow/runtime dependencies (requirements-docs-ci.txt and optional bundle check) that can cause CI to fail if environment lacks required tooling.
🔇 Additional comments (22)
docs/reference/README.md (1)

72-73: LGTM! Published-route links align with the docs validation contract.

The switch from relative README paths (../getting-started/README.md) to absolute site-relative URLs (/getting-started/, /guides/) ensures these links resolve correctly under Jekyll's published permalink structure—exactly what scripts/docs_site_validation.py now validates.

docs/guides/openspec-journey.md (1)

479-479: LGTM! Consistent with published-route link semantics.

The link update from ../getting-started/README.md to /getting-started/ aligns with the PR's published-route validation model and matches the target page's declared permalink.

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md (1)

1-27: LGTM! Spec aligns with implementation and follows proper heading structure.

The requirements correctly specify:

  1. Docs-only pre-commit validation before safe-bypass (wired in scripts/pre-commit-quality-checks.sh)
  2. Category parity between local and CI gates (the published-link category matches scripts/docs_site_validation.py line 432)

Heading levels (H1→H2→H3) now satisfy markdownlint MD001.

scripts/docs_site_validation.py (6)

1-48: LGTM! Clean module structure with proper type contracts.

The ValidationFinding and DocsLinkResolutionContext NamedTuples provide stable API surfaces that scripts/check-docs-commands.py and unit tests depend on. The beartype/icontract decorators add runtime verification without excessive overhead.


337-380: LGTM! Hybrid link resolution handles both authoring styles.

The resolve_internal_link_hybrid function correctly prioritizes filesystem-relative resolution for repo-authored links (containing /, .., or .md) while falling back to published URL semantics. This matches the spec requirement to "resolve internal authored links using the page's published permalink as the URL base."


383-402: LGTM! HTML anchor extraction now included.

The function correctly extracts both Markdown-style links and HTML <a href="..."> anchors, addressing the prior review concern about bypassing published-route scans. Per-line deduplication via seen_urls prevents redundant validation of the same URL.


490-532: LGTM! Timeout now surfaces as a categorized finding.

The bundle check timeout no longer silently passes—it emits a docs-build-dependency finding per the prior review feedback. The 120-second timeout and 500-character detail truncation are reasonable operational defaults.


71-81: LGTM! README handling now respects Jekyll front matter presence.

READMEs are correctly treated as publishable directory indexes only when they start with --- (Jekyll front matter), addressing the prior review concern about missing front-matter validation for landing pages.


441-467: LGTM! Front matter validation now enforces all required keys uniformly.

The redirect-stub title waiver has been removed, ensuring all publishable pages require layout, title, and permalink per the spec contract.

docs/getting-started/README.md (2)

1-6: LGTM! Front matter makes this page publishable.

The addition of required keys (layout, title, permalink) ensures this directory index passes the new scan_frontmatter_findings validation.


90-90: LGTM! Journey guide links target existing pages.

Both ../guides/openspec-journey.md and ../guides/speckit-journey.md exist with proper front matter (confirmed in context snippets). The hybrid link resolver handles these source-relative paths correctly.

openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md (1)

1-27: LGTM! Spec correctly defines published-route link validation for bundle overviews.

The scenarios align with scripts/docs_site_validation.py implementation:

  • Links resolve against the published permalink, not the source path
  • Cross-bundle links must resolve to canonical routes
  • Test coverage catches "source-valid but published-broken" links

Minor grammar nit: Line 19 could use "overview-related links" for consistency, but this doesn't affect spec clarity.

docs/guides/README.md (2)

1-6: LGTM! Front matter enables publishable page validation.

Required keys (layout, title, permalink) are present, satisfying the scan_frontmatter_findings contract.


39-47: All link targets verified. The updated paths in lines 39–47 point to existing documentation files, including the module-signing.md guide.

openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md (1)

1-27: LGTM! Spec aligns with review run CLI contract and addresses prior feedback.

Key improvements:

  • Heading levels now follow H1→H2→H3 (MD001 compliant)
  • Line 15 correctly uses --path for targeting (not duplicate --focus)
  • Line 17 documents the user-facing targeting alternatives (positional files vs --scope/--path)

This spec is enforced by tests/unit/docs/test_code_review_docs_parity.py which validates that docs/bundles/code-review/run.md covers all public Typer options and invalid combinations.

docs/bundles/code-review/run.md (1)

17-53: Strong CLI/docs parity update for run behavior and validation errors.

This update clearly matches the current specfact code review run option surface and runtime conflict messages, including the --json + --score-only and positional-files with --scope/--path cases.

As per coding guidelines, docs/**/*.md: "User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands."

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md (1)

3-27: Spec requirements are crisp and enforceable for publish/review workflow guardrails.

The scenarios are concrete enough to drive deterministic CI behavior and prevent deploys with unresolved generated-site route issues.

tests/unit/test_check_docs_commands_script.py (2)

37-39: Good migration to shared scanning helpers in test coverage.

These updates keep the tests aligned with the shared docs-validation scanning surface and preserve category assertions at the finding level.

Also applies to: 97-100, 115-118, 136-139


143-154: Workflow contract assertions are materially stronger now.

The ordering checks (install before validation, validation before upload) and docs-review test-path assertions directly enforce the docs CI parity contract.

As per coding guidelines, tests/**/*.py: "Contract-first and integration tests: migration suites, bundle validation, and flakiness. Ensure changes to adapters or bridges have targeted coverage."

Also applies to: 159-163

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md (1)

3-54: The validation-spec contract is complete and category-stable.

The scenarios cleanly encode published-route resolution, front-matter completeness, multi-category reporting, and docs build dependency gating in a way CI can assert deterministically.

tests/unit/docs/test_code_review_docs_parity.py (2)

54-106: Invalid-combination parity checks are well-grounded against resolver/runtime messages.

Exercising both Typer resolver errors and run-command validation errors gives robust docs-contract coverage at the adapter boundary.


35-43: Remove the concern about secondary_opts—it does not apply to this codebase.

Click's secondary_opts attribute is used for paired boolean flags defined with the --flag/--no-flag syntax. The review command uses simple boolean Typer options (typer.Option(False, "--flag")), which convert to single Click options without paired variants. No secondary_opts are populated for any parameters, and the test correctly extracts all documented public flags using only param.opts. The proposed fix would add unnecessary code that checks an always-empty attribute.

			> Likely an incorrect or invalid review comment.

📝 Walkthrough

Bundle and Module Surface

No module manifest or API surface changes. All module-package.yaml files remain unchanged (specfact-code-review at 0.47.9, backlog at 0.41.17, codebase at 0.41.9, govern at 0.40.20, project at 0.41.3, spec at 0.40.17). This PR updates documentation to align with the current specfact code review run command surface already shipped in specfact-cli; no new CLI flags or behaviors are introduced to the modules' own command implementations.

Manifest and Integrity

No version bumps or signature changes required. Module manifests and their signatures remain untouched. The PR scope is CI/workflow and documentation only. Local validation (documented in openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md) confirms passing: format, type-check, lint, yaml-lint, check-bundle-imports, contract-test (618 tests), unit tests, docs command checks, signature verification, and specfact code review run --scope changed.

Cross-Repo: specfact-cli Contract Alignment

specfact-cli 0.46.2 pinned in requirements-docs-ci.txt and pr-orchestrator.yml. This is a docs-CI dependency version constraint, not a module API contract change. The Code Review bundle docs are updated to document the current surface exposed by specfact-cli 0.46.2's code review run command (already released), covering:

  • New/clarified flags: --bug-hunt, --mode (shadow|enforce), --focus (repeatable: source/tests/docs), --level (reporting override)
  • JSON output behavior (ReviewReport envelope, --json flag with --out path support, default review-report.json)
  • Progress output to terminal during pipeline execution
  • Invalid flag combination validation (captured in new "Invalid combinations" section with exact Typer error messages)
  • Clarified targeting semantics: positional FILES... or --scope/--path auto-discovery, not both

The new test module tests/unit/docs/test_code_review_docs_parity.py enforces parity between docs/bundles/code-review/run.md and the Typer Click command surface, extracting public flags and resolver error messages to ensure docs remain in sync.

Docs: modules.specfact.io Accuracy and Documentation Contract

Published-route link semantics hardened via new scripts/docs_site_validation.py module. This shared validation library (used by both pre-commit checks and CI workflows) resolves internal Markdown and HTML <a> links relative to each page's published Jekyll permalink route (browser semantics), not source file paths, catching links that appear valid in source but break when rendered under published routes.

Bundle and module overview links fixed to use parent-relative paths (../run/, ../rules/, etc.) to account for Jekyll permalink structures. Affected docs: code-review (overview, ledger, rules, run), codebase (overview, analyze, repro), backlog (overview), govern (overview), project (overview), spec (generate-tests, mock).

Guide front-matter completeness: added missing title fields to redirect stub guides (brownfield-engineer, brownfield-faq, brownfield-journey, brownfield-roi, ide-integration), treated as publishable pages requiring layout/title/permalink metadata or explicit exemptions.

Navigation and "Getting Started" links updated in guides/README.md, getting-started/README.md, openspec-journey.md, and reference/README.md to use correct relative or site-root-relative paths (/getting-started/, /guides/) to resolve against generated Jekyll site structure.

Test Infrastructure: Signature Verification Isolation

Regression test fix in test_git_branch_module_signature_flag_script_omits_when_base_ref_unset: isolated subprocess git invocations now scrub GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_COMMON_DIR, and GITHUB_BASE_REF from the environment. This prevents CI/tooling-set git control variables from mutating the outer module worktree when test subprocess git calls execute in a temporary isolated repo. Commit message also changed from git commit -m init to git commit --no-verify -m init to suppress pre-commit hooks in test repos.

OpenSpec Change Coverage

OpenSpec change ID: docs-15-code-review-validation-guardrails (GitHub issue #202, parent epic #162, parent feature #163).

Specifications defined:

  • bundle-overview-pages/spec.md: published-route link resolution for overview pages and cross-bundle references, with test scenarios for source-valid/published-broken link detection
  • review-run-command/spec.md: docs parity for all public code review run options and runtime behavior including JSON output, shadow/enforce modes, focus/filtering, and invalid flag combinations
  • modules-docs-command-validation/spec.md: stable finding categories (published-link, frontmatter, command, cross-site-link, nav-link, docs-build-dependency), link resolution via published permalinks, required front-matter validation, and bundler lockfile health checks
  • modules-docs-publishing/spec.md: CI workflow guardrails requiring docs dependency installation, Jekyll build, and generated-site validation before Pages artifact upload
  • modules-pre-commit-quality-parity/spec.md: docs-only staged changes run deterministic docs validation before pre-commit safe-change bypass; finding categories matched between local and CI gates

Coverage: 618 contract tests passed; docs command checks, format/lint, and specfact code review run --scope changed all validated locally.

Walkthrough

Adds a published-route-aware docs validation system (new scripts/docs_site_validation.py), integrates it into scripts/check-docs-commands.py, CI workflows, pre-commit gates, and unit tests, and updates documentation links and front-matter to match published permalink semantics.

Changes

Cohort / File(s) Summary
Workflows
.github/workflows/docs-pages.yml, .github/workflows/docs-review.yml, .github/workflows/pr-orchestrator.yml
Install pinned Python deps from requirements-docs-ci.txt, run python scripts/check-docs-commands.py --jekyll-bundle-check in docs-pages, expand docs-review triggers/tests, and pin specfact-cli in pr-orchestrator.
Docs: Code Review & Modules
docs/bundles/code-review/run.md, docs/bundles/code-review/*, docs/modules/code-review.md
Update Code Review run documentation to match CLI option surface, JSON/out behavior, progress output, invalid flag combos, and align module docs.
Docs: Link corrections & front-matter
docs/bundles/..., docs/guides/*, docs/getting-started/README.md, docs/guides/README.md, docs/reference/README.md
Fix internal links to parent-relative or site-relative targets and add title front-matter for redirect stubs.
Docs validation infra
scripts/docs_site_validation.py, scripts/check-docs-commands.py, requirements-docs-ci.txt
Add shared published-route link resolver, front-matter checks, optional Gemfile.lock installability check; refactor checker CLI to accept args and delegate to new module; add pinned Python requirements for docs CI.
Pre-commit hooks & gating
scripts/pre-commit-quality-checks.sh
Detect staged docs changes and run docs-site validation gate, blocking safe-change bypass when docs validation fails.
Tests
tests/unit/docs/test_code_review_docs_parity.py, tests/unit/docs/test_docs_review.py, tests/unit/test_check_docs_commands_script.py, tests/unit/test_pre_commit_quality_parity.py, tests/unit/test_git_branch_module_signature_flag_script.py, tests/unit/workflows/test_pr_orchestrator_signing.py
Add parity tests to ensure docs match CLI options; refactor tests to use new validation module; update tests asserting workflow and pre-commit behavior and pinned CLI install.
OpenSpec metadata
openspec/CHANGE_ORDER.md, openspec/changes/docs-15-code-review-validation-guardrails/...
Add OpenSpec change entry, design, proposal, specs, tasks, and TDD evidence for the docs validation/guardrails effort.

Sequence Diagram(s)

sequenceDiagram
    participant Author as Docs (Markdown)
    participant Index as Route Index (build_route_index)
    participant Resolver as Link Resolver (resolve_internal_link_hybrid)
    participant Checker as Validator (scan_published_route_body_links / scan_frontmatter_findings)
    participant CI as CI / Pre-commit Gate

    Author->>Index: Extract front matter (permalink, redirect_from)
    Index-->>Index: Build canonical route mappings
    Author->>Resolver: Extract links with line numbers
    Resolver->>Index: Resolve link against published routes
    alt Resolved
        Resolver-->>Checker: OK (no finding)
    else Unresolved
        Resolver-->>Checker: Emit [published-link] finding (path:line)
    end
    Author->>Checker: Validate required front-matter keys
    alt Missing required keys
        Checker-->>Checker: Emit [frontmatter] finding
    end
    Checker->>CI: Return findings (non-zero if blocking)
    CI->>CI: Fail pre-commit / block deploy if findings present
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • Issue #202: Implements the docs-15 code-review validation guardrails (published-route validation, front-matter checks, dependency health, and docs parity), which this PR realizes.

Possibly related PRs

  • PR #109: Related docs-validation and test-surface changes (touches tests under tests/unit/docs/test_docs_review.py) and overlaps on published-route/front-matter behavior.
  • PR #120: Modifies docs validation tooling and CI wiring; closely related to the new docs-site validator and workflow changes.
  • PR #197: Changes the Code Review CLI option surface; this PR’s parity tests and docs updates aim to track those contract changes.

Suggested labels

project

✨ 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/docs-15-code-review-validation-guardrails

@djm81 djm81 self-assigned this Apr 15, 2026
@djm81 djm81 added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file enhancement New feature or request labels Apr 15, 2026
@djm81 djm81 moved this from Todo to In Progress in SpecFact CLI Apr 15, 2026
@djm81 djm81 linked an issue Apr 15, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@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: 8

Caution

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

⚠️ Outside diff range comments (1)
.github/workflows/docs-review.yml (1)

57-62: ⚠️ Potential issue | 🟠 Major

Pin specfact-cli to stabilize docs-parity CI gates at line 55.

This workflow depends directly on specfact-cli's CLI option contracts via test_code_review_docs_parity.py. Installing an unpinned version can break this CI step on unrelated upstream releases, creating non-deterministic test failures when the code-review command surface changes in specfact-cli.

-          python -m pip install pytest click typer PyYAML beartype icontract rich pydantic specfact-cli
+          python -m pip install pytest click typer PyYAML beartype icontract rich pydantic "specfact-cli>=0.46.2"

Note: docs-pages.yml (line 63) and pr-orchestrator.yml (line 143) also install unpinned specfact-cli and may need the same constraint.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs-review.yml around lines 57 - 62, The docs CI installs
an unpinned specfact-cli which can break tests due to upstream CLI changes;
update the workflow step that runs the docs review suite (the job containing
"Run docs review suite" and the DOCS_REVIEW_LOG handling) to install
specfact-cli with an explicit pinned version (e.g., add pip install
specfact-cli==<fixed-version> before running pytest) so the tests in
tests/unit/docs/test_code_review_docs_parity.py use a stable CLI contract; apply
the same pin to the specfact-cli installs in the other workflows mentioned
(docs-pages.yml and pr-orchestrator.yml) to stabilize the gates.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/docs-pages.yml:
- Around line 62-64: Replace the floating pip installs on the CI step that runs
"python -m pip install click typer PyYAML beartype icontract rich pydantic
specfact-cli" with a pinned requirements file: add a requirements-docs.txt (or
similar) containing exact versions for those packages (including specfact-cli)
and update the workflow to run "python -m pip install -r requirements-docs.txt"
before invoking "python scripts/check-docs-commands.py --jekyll-bundle-check" so
the docs-validation step is deterministic.

In `@docs/bundles/code-review/run.md`:
- Around line 46-47: Update the user docs to state that positional FILES plus
--path is an invalid combination (in addition to the existing note about
--scope) to match the runtime validation in specfact_code_review.run.commands
that rejects positional files when either --scope or --path is provided; then
extend the unit test test_code_review_docs_parity to assert that the docs
mention --path as an invalid combination so future drifts are caught
automatically.

In
`@openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md`:
- Line 1: The file currently begins with a level-2 heading "## ADDED
Requirements" which triggers markdownlint MD041; change that first heading to a
level-1 heading by replacing "## ADDED Requirements" with "# ADDED Requirements"
so the document starts with an H1 and satisfies the rule.

In `@scripts/docs_site_validation.py`:
- Around line 73-75: is_publishable_page currently excludes README.md which
prevents front-matter validation for directory landing pages; update
is_publishable_page so README.md files are considered publishable when they are
treated as published index pages by published_route_for_doc/build_route_index
(either remove the path.name != "README.md" exclusion or incorporate the same
published-index detection logic or call
published_route_for_doc/build_route_index to decide); ensure the function still
only returns True for actual docs markdown and that README landing pages trigger
front-matter checks for layout/title/permalink.
- Around line 379-386: The helper extract_markdown_links_with_lines only finds
Markdown-style links and misses HTML <a href="..."> anchors, so update it to
also parse and return href values from HTML anchors per-line; inside
extract_markdown_links_with_lines iterate lines as now (skipping "<!-- TODO:")
and after finding MARKDOWN_LINK_RE matches also parse each line for HTML anchor
hrefs (use Python's html.parser.HTMLParser or urllib.parse + a small regex) and
append (line_number, href) for every found anchor so
scan_published_route_body_links() sees both Markdown and HTML links; keep return
type list[tuple[int,str]] and preserve existing behavior for Markdown matches
(use match.group(1)) while adding href strings from the HTML anchors.
- Around line 492-502: The code currently swallows both FileNotFoundError and
subprocess.TimeoutExpired and returns [] on timeout, masking a hung bundle
check; change the except to only catch FileNotFoundError so missing local
Bundler still returns [] but a subprocess.TimeoutExpired raised by
subprocess.run (the call building proc) will propagate (or be handled upstream)
and thus surface as a docs-build-dependency failure rather than a clean pass;
update the try/except around the subprocess.run(...) that assigns proc
accordingly.
- Around line 441-444: The current logic in scripts/docs_site_validation.py
silently removes "title" from the missing keys when a page is a redirect
stub/only (variables: stub, missing, _REQUIRED_PAGE_KEYS and keys
"redirect_stub"/"redirect_only"), which contradicts the updated spec that a
published redirect page without a title must fail; revert that waiver by
removing the branch that filters out "title" when stub is true (or explicitly
enforce that "title" remains required regardless of stub) so that validation
fails if "title" is not present in missing for any page type.

In `@scripts/pre-commit-quality-checks.sh`:
- Around line 97-107: In run_docs_site_validation_gate, the docs validator is
invoked with plain python which can bypass the Hatch venv; change the invocation
to use Hatch like the other gates by replacing calls to "python
scripts/check-docs-commands.py" with "hatch run python
scripts/check-docs-commands.py" (update the info log, the conditional that runs
the script, and the warn Run hint) so the script runs inside the Hatch
environment and dependencies (click/typer/beartype, etc.) are resolved.

---

Outside diff comments:
In @.github/workflows/docs-review.yml:
- Around line 57-62: The docs CI installs an unpinned specfact-cli which can
break tests due to upstream CLI changes; update the workflow step that runs the
docs review suite (the job containing "Run docs review suite" and the
DOCS_REVIEW_LOG handling) to install specfact-cli with an explicit pinned
version (e.g., add pip install specfact-cli==<fixed-version> before running
pytest) so the tests in tests/unit/docs/test_code_review_docs_parity.py use a
stable CLI contract; apply the same pin to the specfact-cli installs in the
other workflows mentioned (docs-pages.yml and pr-orchestrator.yml) to stabilize
the gates.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: feddb35f-2c65-4fce-b03a-0f6e390cd34f

📥 Commits

Reviewing files that changed from the base of the PR and between fa5a27d and f46d6b5.

⛔ Files ignored due to path filters (1)
  • docs/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (39)
  • .github/workflows/docs-pages.yml
  • .github/workflows/docs-review.yml
  • docs/bundles/backlog/overview.md
  • docs/bundles/code-review/ledger.md
  • docs/bundles/code-review/overview.md
  • docs/bundles/code-review/rules.md
  • docs/bundles/code-review/run.md
  • docs/bundles/codebase/analyze.md
  • docs/bundles/codebase/overview.md
  • docs/bundles/codebase/repro.md
  • docs/bundles/govern/overview.md
  • docs/bundles/project/overview.md
  • docs/bundles/spec/generate-tests.md
  • docs/bundles/spec/mock.md
  • docs/guides/brownfield-engineer.md
  • docs/guides/brownfield-faq.md
  • docs/guides/brownfield-journey.md
  • docs/guides/brownfield-roi.md
  • docs/guides/ide-integration.md
  • docs/modules/code-review.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/docs-15-code-review-validation-guardrails/.openspec.yaml
  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/design.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
  • scripts/check-docs-commands.py
  • scripts/docs_site_validation.py
  • scripts/pre-commit-quality-checks.sh
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/docs/test_docs_review.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/test_git_branch_module_signature_flag_script.py
  • tests/unit/test_pre_commit_quality_parity.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). (4)
  • GitHub Check: quality (3.11)
  • GitHub Check: quality (3.12)
  • GitHub Check: quality (3.13)
  • GitHub Check: Socket Security: Pull Request Alerts
🧰 Additional context used
📓 Path-based instructions (6)
docs/**/*.md

⚙️ CodeRabbit configuration file

docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract,
CLI examples matching bundled commands.

Files:

  • docs/bundles/code-review/overview.md
  • docs/bundles/code-review/rules.md
  • docs/bundles/codebase/overview.md
  • docs/bundles/spec/mock.md
  • docs/bundles/govern/overview.md
  • docs/guides/brownfield-journey.md
  • docs/guides/ide-integration.md
  • docs/bundles/codebase/repro.md
  • docs/guides/brownfield-engineer.md
  • docs/bundles/codebase/analyze.md
  • docs/guides/brownfield-roi.md
  • docs/bundles/backlog/overview.md
  • docs/bundles/project/overview.md
  • docs/bundles/code-review/ledger.md
  • docs/guides/brownfield-faq.md
  • docs/modules/code-review.md
  • docs/bundles/code-review/run.md
  • docs/bundles/spec/generate-tests.md
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: CI: secrets, hatch/verify-modules-signature gates, contract-test alignment, action versions.

Files:

  • .github/workflows/docs-pages.yml
  • .github/workflows/docs-review.yml
openspec/**/*.md

⚙️ CodeRabbit configuration file

openspec/**/*.md: Specification truth: proposal/tasks/spec deltas vs. bundle behavior, CHANGE_ORDER, and
drift vs. shipped modules or docs.

Files:

  • openspec/CHANGE_ORDER.md
  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/design.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
**/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h}

📄 CodeRabbit inference engine (CLAUDE.md)

Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Files:

  • tests/unit/test_pre_commit_quality_parity.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/test_git_branch_module_signature_flag_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/docs/test_docs_review.py
  • scripts/check-docs-commands.py
  • scripts/docs_site_validation.py
tests/**/*.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first and integration tests: migration suites, bundle validation, and flakiness.
Ensure changes to adapters or bridges have targeted coverage.

Files:

  • tests/unit/test_pre_commit_quality_parity.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/test_git_branch_module_signature_flag_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/docs/test_docs_review.py
scripts/**/*.py

⚙️ CodeRabbit configuration file

scripts/**/*.py: Deterministic tooling: signing, publishing, docs generation; subprocess and path safety.

Files:

  • scripts/check-docs-commands.py
  • scripts/docs_site_validation.py
🧠 Learnings (16)
📓 Common learnings
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: Signed module or manifest changes require version-bump review and verify-modules-signature
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json

Applied to files:

  • docs/bundles/code-review/overview.md
  • docs/bundles/code-review/rules.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • docs/bundles/code-review/ledger.md
  • scripts/pre-commit-quality-checks.sh
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • docs/modules/code-review.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Perform `spec -> tests -> failing evidence -> code -> passing evidence` in that order for behavior changes

Applied to files:

  • docs/bundles/spec/mock.md
  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: Use docs/agent-rules/INDEX.md as the canonical governance dispatcher for governance rules

Applied to files:

  • docs/bundles/govern/overview.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Finalize completed OpenSpec changes with `openspec archive <change-id>` and do not manually move change folders under `openspec/changes/archive/`

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/.openspec.yaml
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules

Applied to files:

  • docs/bundles/backlog/overview.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • docs/bundles/code-review/ledger.md
  • scripts/pre-commit-quality-checks.sh
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/design.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:15.842Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`

Applied to files:

  • docs/bundles/backlog/overview.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • docs/bundles/code-review/ledger.md
  • scripts/pre-commit-quality-checks.sh
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: Full governance rules live in docs/agent-rules/; do not treat this file (GitHub Copilot Instructions) as a complete standalone handbook

Applied to files:

  • docs/bundles/backlog/overview.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics

Applied to files:

  • openspec/CHANGE_ORDER.md
  • .github/workflows/docs-review.yml
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • docs/modules/code-review.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Treat the clean-code compliance gate as mandatory: the review surface enforces `naming`, `kiss`, `yagni`, `dry`, and `solid` categories and blocks regressions

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • openspec/changes/docs-15-code-review-validation-guardrails/design.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • docs/modules/code-review.md
  • openspec/changes/docs-15-code-review-validation-guardrails/proposal.md
  • docs/bundles/code-review/run.md
📚 Learning: 2026-04-02T21:49:11.371Z
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • tests/unit/test_git_branch_module_signature_flag_script.py
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Applies to **/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h} : Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • scripts/pre-commit-quality-checks.sh
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat clean-code regressions (naming, kiss, yagni, dry, solid violations) as blocking until they are fixed or explicitly justified

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/design.md
  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Read docs/agent-rules/05-non-negotiable-checklist.md before implementation

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Run the required verification and quality gates for the touched scope before finalization

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/tasks.md
🪛 LanguageTool
docs/bundles/codebase/overview.md

[grammar] ~77-~77: Ensure spelling is correct
Context: ...se --repo . ``` ## Deep dives - Code analyze contracts - [Code drift d...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

docs/bundles/codebase/repro.md

[grammar] ~66-~66: Ensure spelling is correct
Context: ...tall-crosshair ``` ## Related - Code analyze contracts - [Code drift d...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md

[grammar] ~19-~19: Use a hyphen to join words.
Context: ...w page ### Requirement: Bundle overview related links SHALL be covered by docs v...

(QB_NEW_EN_HYPHEN)

openspec/changes/docs-15-code-review-validation-guardrails/proposal.md

[style] ~33-~33: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...on helper if consolidation is needed. - Affected CI and local gates include `.github/wor...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[uncategorized] ~33-~33: The official name of this software platform is spelled with a capital “H”.
Context: .... - Affected CI and local gates include .github/workflows/docs-review.yml, `.github/wo...

(GITHUB)


[uncategorized] ~33-~33: The official name of this software platform is spelled with a capital “H”.
Context: ...de .github/workflows/docs-review.yml, .github/workflows/docs-pages.yml, `.github/wor...

(GITHUB)


[uncategorized] ~33-~33: The official name of this software platform is spelled with a capital “H”.
Context: ...l, .github/workflows/docs-pages.yml, .github/workflows/pr-orchestrator.yml, .pre-c...

(GITHUB)

openspec/changes/docs-15-code-review-validation-guardrails/design.md

[style] ~22-~22: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...inistic and usable before publishing. - Do not change bundle runtime behavior or r...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...directly from signed module payloads. - Do not replace the existing Jekyll stack o...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~55-~55: Consider an alternative for the overused word “exactly”.
Context: ...ly on review. Rejected because this was exactly the failure mode. ## Risks / Trade-off...

(EXACTLY_PRECISELY)


[style] ~69-~69: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tly incomplete redirect/guide pages. 3. Add failing tests for Code Review run optio...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~82-~82: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ndency maintenance change updates it? - Should generated _site link validation be ma...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

openspec/changes/docs-15-code-review-validation-guardrails/tasks.md

[uncategorized] ~4-~4: The official name of this software platform is spelled with a capital “H”.
Context: ...e work is required, refresh and consult .specfact/backlog/github_hierarchy_cache.md and verify parent, ...

(GITHUB)


[uncategorized] ~44-~44: The official name of this software platform is spelled with a capital “H”.
Context: ...visible hook or stage. - [x] 6.3 Update .github/workflows/docs-review.yml so it runs t...

(GITHUB)


[uncategorized] ~45-~45: The official name of this software platform is spelled with a capital “H”.
Context: ...ogs for each category. - [x] 6.4 Update .github/workflows/docs-pages.yml so dependency...

(GITHUB)

🪛 markdownlint-cli2 (0.22.0)
openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/proposal.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/design.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

openspec/changes/docs-15-code-review-validation-guardrails/tasks.md

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

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

[::nold-ai/specfact-cli::] scripts/check-docs-commands.py

  • New CLI parsing (_main(argv: list[str] | None = None)) and import dependency on scripts/docs_site_validation.py (script now calls build_valid_internal_routes, scan_published_route_body_links, scan_frontmatter_findings). Relevant caller sites must pass argv or rely on entrypoint behavior.

[::nold-ai/specfact-cli::] scripts/docs_site_validation.py

  • New shared validation library exposing ValidationFinding, build_route_index, build_path_to_canonical_route, resolve_internal_link_hybrid, scan_published_route_body_links, scan_frontmatter_findings, scan_gemfile_lock_installability, format_findings — these are consumed by tests and scripts (above).

[::nold-ai/specfact-cli::] scripts/pre-commit-quality-checks.sh

  • Now invokes python scripts/check-docs-commands.py when staged docs changes are present (new helper run_docs_site_validation_gate). Pre-commit flow changes mean commits touching docs/scripts may fail if the new validators find issues.

[::nold-ai/specfact-cli::] .github/workflows/docs-review.yml and .github/workflows/docs-pages.yml

  • Workflows now list/execute scripts/check-docs-commands.py and (docs-pages) run python scripts/check-docs-commands.py --jekyll-bundle-check. CI will run the new validators; failing findings will fail CI jobs that previously passed.

[::nold-ai/specfact-cli::] tests/unit/docs/test_code_review_docs_parity.py (new)

  • Tests extract Typer/Click options from the Code Review run command and assert parity with docs/bundles/code-review/run.md (looks for flags like --bug-hunt, --mode, --focus, --level, --json/--out and invalid-combination documentation). Any divergence between actual CLI surface and docs will fail unit tests.

[::nold-ai/specfact-cli::] tests/unit/docs/test_docs_review.py and tests/unit/test_check_docs_commands_script.py (modified)

  • These tests now import and call functions from scripts/docs_site_validation (via scripts/check-docs-commands.py). They rely on the new exported scanning helpers and the new ValidationFinding shape.

[::nold-ai/specfact-cli::] docs/* (multiple files e.g., docs/bundles/code-review/run.md, docs/modules/code-review.md)

  • Doc content was updated to include new flags/behaviors (progress output, --json default output file, --mode shadow|enforce, --focus, --bug-hunt, invalid combinations). Tests enforce docs/CLI parity — changes to the CLI flags will require corresponding docs updates or tests will fail.

Other cross-cutting notes (observed)

  • Many tests and tooling reference "specfact code review run" and its flags (rg hits across tests and docs). The new docs validation and parity tests create a coupling: changes to the code-review CLI surface, scripts/check-docs-commands.py signature, or the ValidationFinding shape must be reflected in docs and tests and/or in the new docs_site_validation API.

Conclusion

  • The PR introduces a new shared validation API (scripts/docs_site_validation.py) consumed by check-docs-commands.py, CI workflows, pre-commit hooks, and unit tests that assert parity between CLI and docs. These are direct consumers and will need updates if the new APIs/signatures, ValidationFinding fields, or the Code Review CLI option surface change.
🔇 Additional comments (29)
tests/unit/test_git_branch_module_signature_flag_script.py (1)

31-75: Good isolation of the git subprocess boundary.

Creating a nested temp repo and scrubbing git-control environment variables makes this regression test deterministic and protects the outer modules worktree from accidental mutation. As per coding guidelines, "Contract-first and integration tests: migration suites, bundle validation, and flakiness. Ensure changes to adapters or bridges have targeted coverage."

docs/bundles/spec/mock.md (1)

53-54: Related links now correctly use published-route-relative targets.
Looks correct and consistent with nested bundle routing semantics.

docs/bundles/codebase/analyze.md (1)

43-45: Good fix for nested docs navigation links.
These paths now resolve correctly from the analyze route.

docs/bundles/code-review/ledger.md (1)

48-49: Link target correction is accurate for ledger page context.
Nice alignment with the code-review docs parity guardrails.

docs/guides/brownfield-journey.md (1)

3-3: Front-matter completeness fix is correct.
Adding an explicit title for the redirect page matches the docs validation guardrail intent.

docs/bundles/spec/generate-tests.md (1)

50-51: Related links are now route-correct for this spec bundle page.
This change is consistent with the new published-link validation behavior.

docs/bundles/code-review/overview.md (1)

63-65: See-also navigation fix is correct for the overview route depth.
Good parity with the code review bundle command docs structure.

docs/bundles/code-review/rules.md (1)

45-46: Related links are correctly adjusted for nested routing.
This is consistent with the guardrail-driven docs link model.

openspec/changes/docs-15-code-review-validation-guardrails/.openspec.yaml (1)

1-2: OpenSpec manifest metadata looks valid and complete for change initialization.

docs/guides/brownfield-roi.md (1)

3-3: Good front-matter completion for redirect stub.

Line 3 adds the missing title and keeps redirect wiring intact.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/bundles/codebase/repro.md (1)

66-68: Related-link route fix looks correct.

These parent-relative links should resolve correctly from /bundles/codebase/repro/ in published docs.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/guides/brownfield-engineer.md (1)

3-3: Front matter update is solid.

Line 3 correctly adds a title without altering redirect behavior.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/bundles/codebase/overview.md (1)

77-80: Deep-dive link normalization is correct.

The ../ link targets align with published Jekyll route resolution from the overview page.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/bundles/govern/overview.md (1)

48-49: See-also links are fixed appropriately.

These parent-relative paths should resolve correctly under /bundles/govern/overview/.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/guides/brownfield-faq.md (1)

3-3: Redirect stub metadata is now complete.

Line 3 adds the missing title cleanly.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

docs/guides/ide-integration.md (1)

3-3: Nice front-matter parity fix.

Line 3 adds title metadata while preserving the existing redirect contract.

As per coding guidelines: docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, CLI examples matching bundled commands.

openspec/CHANGE_ORDER.md (1)

81-81: Change-order addition is consistent and traceable.

The new docs + validation pending row is well-formed and keeps dependency context explicit.

docs/bundles/backlog/overview.md (1)

69-69: Link target corrections look good.

These parent-relative routes are the right direction for published bundle navigation.

Also applies to: 114-117

tests/unit/test_pre_commit_quality_parity.py (1)

38-40: Coverage update is appropriate for the new docs gate.

The added required fragments correctly lock in the docs-site validation path.

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

13-16: Workflow trigger expansion is solid.

Including the shared validator and parity test paths is the right CI coupling for docs gate coverage.

Also applies to: 25-28

docs/bundles/project/overview.md (1)

79-79: These cross-bundle link fixes look correct.

The parent-relative targets are consistent with the docs site route structure.

Also applies to: 96-97

openspec/changes/docs-15-code-review-validation-guardrails/TDD_EVIDENCE.md (1)

1-19: Evidence log is clear and complete for this scope.

The command-level pass evidence is well documented and aligned with the docs-validation guardrail objective.

scripts/pre-commit-quality-checks.sh (1)

258-261: Good ordering: docs validation runs before safe-change bypass.

This is the right control-flow placement for docs-only commits.

Also applies to: 271-280

openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md (1)

3-27: Spec guardrails are clear and enforceable.

The scenarios are concrete and map well to published-route validation behavior.

tests/unit/test_check_docs_commands_script.py (1)

97-117: Good migration to shared docs-validation test flow.

These assertions strengthen parity between script behavior and workflow wiring.

Also applies to: 136-146, 154-156

openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md (1)

3-27: Parity requirements are well scoped.

The scenarios are measurable and suitable for CI-level enforcement.

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md (1)

3-27: Publishing and review gate requirements look solid.

The fail-before-deploy behavior is explicitly captured.

docs/modules/code-review.md (1)

28-73: Great parity detail at module-doc level.

The option semantics, invalid combinations, and output-mode examples are substantially clearer and operationally useful.

Also applies to: 131-147

openspec/changes/docs-15-code-review-validation-guardrails/proposal.md (1)

5-35: Proposal scope and impact framing are strong.

This captures the validation-contract shift and CI/local parity goals clearly.

Comment thread .github/workflows/docs-pages.yml
Comment thread docs/bundles/code-review/run.md Outdated
Comment thread scripts/docs_site_validation.py
Comment thread scripts/docs_site_validation.py
Comment thread scripts/docs_site_validation.py Outdated
Comment thread scripts/docs_site_validation.py
Comment thread scripts/pre-commit-quality-checks.sh
…parity

Add requirements-docs-ci.txt and use it in docs workflows; pin specfact-cli in
pr-orchestrator. Harden docs_site_validation (README publishability, HTML
hrefs, bundle timeout, redirect title). Run check-docs-commands via hatch in
pre-commit; fix OpenSpec spec H1s; align run.md and tests with CLI rules.

Made-with: Cursor
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​specfact-cli@​0.46.278100100100100
Addedpypi/​pytest@​9.0.387100100100100
Addedpypi/​click@​8.1.896100100100100
Addedpypi/​rich@​13.5.398100100100100
Addedpypi/​beartype@​0.22.999100100100100
Addedpypi/​typer@​0.23.199100100100100
Addedpypi/​pydantic@​2.13.1100100100100100
Addedpypi/​pyyaml@​6.0.3100100100100100
Addedpypi/​icontract@​2.7.3100100100100100

View full report

Copy link
Copy Markdown

@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: 8

♻️ Duplicate comments (2)
scripts/docs_site_validation.py (2)

505-523: ⚠️ Potential issue | 🟠 Major

Return a categorized finding on bundle check timeout.

A hung bundle check now escapes as subprocess.TimeoutExpired, which crashes the docs gate with a traceback instead of emitting the stable docs-build-dependency category the validator is supposed to report.

🛠️ Suggested fix
     try:
         proc = subprocess.run(
             ["bundle", "check"],
             cwd=str(docs_dir),
             capture_output=True,
             text=True,
             timeout=120,
             check=False,
         )
     except FileNotFoundError:
         return []
+    except subprocess.TimeoutExpired:
+        return [
+            ValidationFinding(
+                "docs-build-dependency",
+                gemfile_lock,
+                1,
+                "bundle check timed out in docs/; dependency health is unknown",
+            )
+        ]

     if proc.returncode != 0:
         detail = (proc.stderr or proc.stdout or "").strip()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/docs_site_validation.py` around lines 505 - 523, The try/except
around subprocess.run currently only catches FileNotFoundError and lets
subprocess.TimeoutExpired raise a traceback; update the block around
subprocess.run (the call to subprocess.run in scripts/docs_site_validation.py)
to also catch subprocess.TimeoutExpired and return a ValidationFinding with
category "docs-build-dependency" (using the existing ValidationFinding
constructor and gemfile_lock variable) containing a short message indicating the
`bundle check` timed out (include a brief detail like "bundle check timed out
after 120s"), so the validator emits the same categorized finding instead of
crashing.

171-197: ⚠️ Potential issue | 🟠 Major

Keep route indexing aligned with is_publishable_page() for README landings.

is_publishable_page() now requires README front matter, but both route builders still admit any README.md when split_yaml_front_matter() returns {}. That lets published-link validation treat a frontmatter-less landing page as a valid target while scan_frontmatter_findings() never reports it.

🛠️ Suggested fix
 def build_route_index(docs_root: Path) -> dict[str, Path]:
     """Map every published and redirect alias route to its declaring markdown file."""
     route_to_path: dict[str, Path] = {}

     for path in iter_docs_markdown_paths(docs_root):
         text = path.read_text(encoding="utf-8")
         fm, _, _ = split_yaml_front_matter(text)
-        if not fm and path.name.lower() != "readme.md":
+        if not fm or not is_publishable_page(path, docs_root):
             continue
         canonical = published_route_for_doc(path, docs_root, fm)
         route_to_path[canonical] = path
         for alias in list_redirect_from_routes(fm):
             route_to_path[alias] = path
     return route_to_path

 def build_path_to_canonical_route(docs_root: Path) -> dict[Path, str]:
     mapping: dict[Path, str] = {}
     for path in iter_docs_markdown_paths(docs_root):
         fm, _, _ = split_yaml_front_matter(path.read_text(encoding="utf-8"))
-        if not fm and path.name.lower() != "readme.md":
+        if not fm or not is_publishable_page(path, docs_root):
             continue
         mapping[path.resolve()] = published_route_for_doc(path, docs_root, fm)
     return mapping
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/docs_site_validation.py` around lines 171 - 197, Both
build_route_index and build_path_to_canonical_route currently special-case
README.md by allowing empty front matter, which diverges from
is_publishable_page() and lets frontmatter-less README landings slip through
validation; update both functions to require non-empty front matter for all
files (i.e., remove the path.name.lower() != "readme.md" exception and treat
README like any other file by continuing when split_yaml_front_matter returns
empty), leaving published_route_for_doc, iter_docs_markdown_paths, and
path.resolve() usage unchanged so routing and path mapping align with
scan_frontmatter_findings and is_publishable_page().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/bundles/code-review/run.md`:
- Around line 42-50: Add a new invalid-combination bullet under the "Invalid
combinations" section documenting that the CLI rejects using --json together
with --score-only (e.g., "- **`--json` with `--score-only`**: do not combine
output JSON mode with score-only mode"), mirroring the runtime validation;
update the surrounding list so the wording/format matches existing bullets for
flags like `--out`/`--json` and reference the flags `--json` and `--score-only`
so the docs and CLI validation are consistent.

In
`@openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md`:
- Around line 3-27: Update the markdown heading levels so they increment by one
level at a time: change the top-level "### Requirement: Docs-only pre-commit
changes SHALL run docs validation before safe bypass" headings from "###" to
"##" and change the nested "#### Scenario: ..." headings to "###" accordingly;
do the same for the second requirement header "### Requirement: Pre-commit and
CI docs gates SHALL share validation categories" and its "#### Scenario: Same
broken docs route reports same category locally and in CI" so all headings
follow a single-level increment sequence (e.g., H1 -> H2 -> H3).

In
`@openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md`:
- Around line 3-13: The markdown uses inconsistent heading levels causing
markdownlint heading-increment violations; change the "Requirement: Code Review
run docs SHALL cover the public option surface" heading from H3 to H2 and change
the "Scenario: Newly added review options are documented" and "Scenario: Invalid
option combinations are documented" headings from H4/H3 to H3 so requirements
are H2 and scenarios are H3; apply the same normalization to the other related
spec files referenced (19-27) so all requirement headings use H2 and scenario
headings use H3 to satisfy the lint rule.
- Around line 15-17: The spec example incorrectly uses the CLI flag --focus
while the runtime contract expects --path; update the spec text and all examples
in the review-run-command document to use --path (and any related examples of
positional files vs --scope/--include-tests) so the docs/tests reflect the
actual command contract, and add the user-facing alternative targeting paragraph
that shows using positional file arguments or --path consistently as the
supported targeting style; ensure references to the invalid combination describe
positional files with --scope or --path with --include-tests as the rejected
cases.

In `@tests/unit/docs/test_code_review_docs_parity.py`:
- Around line 60-69: The test currently only checks for flag names; change it to
assert the actual incompatible pairings/messages produced by the code by
importing and using the resolver: call _resolve_review_run_flags() (or the
function that returns/enforces incompatible flag combinations) inside
test_code_review_run_doc_describes_invalid_flag_combinations, extract the list
of incompatible pair tuples/messages, and for each pairing assert that
RUN_DOC.read_text(...) contains the expected human-readable string (e.g., a
formatted "flagA and flagB" or the exact message returned by the resolver). Keep
references to RUN_DOC and _resolve_review_run_flags so the test fails if the
docs drift from the actual incompatible-flag logic.
- Around line 35-58: Replace the hardcoded tuple of expected flags in
test_code_review_run_doc_mentions_public_ty_options with assertions derived from
the command: call _public_option_flags(_review_run_click_command()) to get the
actual public flags and then assert each flag from that flags collection appears
in RUN_DOC.read_text(); i.e., remove the fixed list of "--bug-hunt", "--mode",
... and instead iterate over flags to assert flag in text (and optionally assert
flags is a subset of the documented tokens) so CLI surface changes fail the
module↔CLI parity test.

In `@tests/unit/test_check_docs_commands_script.py`:
- Around line 152-157: The test in tests/unit/test_check_docs_commands_script.py
is asserting an implementation detail by requiring
"scripts/docs_site_validation.py" to appear in the generated workflow; remove
that assertion so the contract only requires the public invocation
"scripts/check-docs-commands.py" (and the other workflow lines already checked
like the pip install and test paths). Specifically, delete the assert that
matches "scripts/docs_site_validation.py" and leave the other assertions intact
so the test validates the workflow's public command usage without coupling to
the helper module path.
- Around line 143-146: The test
test_docs_pages_workflow_runs_python_docs_validation currently only checks
presence of two commands; update it to assert ordering: read the docs-pages
workflow text (as current variable workflow), find the index positions of the
strings "python -m pip install -r requirements-docs-ci.txt" and "python
scripts/check-docs-commands.py --jekyll-bundle-check" and assert install_index <
check_index, then locate the Pages upload/deploy step name (e.g. the job/step
that uploads or deploys Pages artifact) by matching its key or a distinctive
string and assert check_index < pages_upload_index so install -> check -> upload
ordering is enforced. Ensure assertions raise clear messages referencing those
three strings.

---

Duplicate comments:
In `@scripts/docs_site_validation.py`:
- Around line 505-523: The try/except around subprocess.run currently only
catches FileNotFoundError and lets subprocess.TimeoutExpired raise a traceback;
update the block around subprocess.run (the call to subprocess.run in
scripts/docs_site_validation.py) to also catch subprocess.TimeoutExpired and
return a ValidationFinding with category "docs-build-dependency" (using the
existing ValidationFinding constructor and gemfile_lock variable) containing a
short message indicating the `bundle check` timed out (include a brief detail
like "bundle check timed out after 120s"), so the validator emits the same
categorized finding instead of crashing.
- Around line 171-197: Both build_route_index and build_path_to_canonical_route
currently special-case README.md by allowing empty front matter, which diverges
from is_publishable_page() and lets frontmatter-less README landings slip
through validation; update both functions to require non-empty front matter for
all files (i.e., remove the path.name.lower() != "readme.md" exception and treat
README like any other file by continuing when split_yaml_front_matter returns
empty), leaving published_route_for_doc, iter_docs_markdown_paths, and
path.resolve() usage unchanged so routing and path mapping align with
scan_frontmatter_findings and is_publishable_page().
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 1d8c6893-e654-4ef9-b35f-ad7df4a6fc65

📥 Commits

Reviewing files that changed from the base of the PR and between f46d6b5 and 5108467.

📒 Files selected for processing (17)
  • .github/workflows/docs-pages.yml
  • .github/workflows/docs-review.yml
  • .github/workflows/pr-orchestrator.yml
  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • requirements-docs-ci.txt
  • scripts/docs_site_validation.py
  • scripts/pre-commit-quality-checks.sh
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/docs/test_docs_review.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/test_pre_commit_quality_parity.py
  • tests/unit/workflows/test_pr_orchestrator_signing.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). (4)
  • GitHub Check: quality (3.11)
  • GitHub Check: quality (3.12)
  • GitHub Check: quality (3.13)
  • GitHub Check: Socket Security: Pull Request Alerts
🧰 Additional context used
📓 Path-based instructions (6)
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: CI: secrets, hatch/verify-modules-signature gates, contract-test alignment, action versions.

Files:

  • .github/workflows/pr-orchestrator.yml
  • .github/workflows/docs-pages.yml
  • .github/workflows/docs-review.yml
**/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h}

📄 CodeRabbit inference engine (CLAUDE.md)

Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Files:

  • tests/unit/workflows/test_pr_orchestrator_signing.py
  • tests/unit/test_pre_commit_quality_parity.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • scripts/docs_site_validation.py
  • tests/unit/docs/test_docs_review.py
tests/**/*.py

⚙️ CodeRabbit configuration file

tests/**/*.py: Contract-first and integration tests: migration suites, bundle validation, and flakiness.
Ensure changes to adapters or bridges have targeted coverage.

Files:

  • tests/unit/workflows/test_pr_orchestrator_signing.py
  • tests/unit/test_pre_commit_quality_parity.py
  • tests/unit/test_check_docs_commands_script.py
  • tests/unit/docs/test_code_review_docs_parity.py
  • tests/unit/docs/test_docs_review.py
openspec/**/*.md

⚙️ CodeRabbit configuration file

openspec/**/*.md: Specification truth: proposal/tasks/spec deltas vs. bundle behavior, CHANGE_ORDER, and
drift vs. shipped modules or docs.

Files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
docs/**/*.md

⚙️ CodeRabbit configuration file

docs/**/*.md: User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract,
CLI examples matching bundled commands.

Files:

  • docs/bundles/code-review/run.md
scripts/**/*.py

⚙️ CodeRabbit configuration file

scripts/**/*.py: Deterministic tooling: signing, publishing, docs generation; subprocess and path safety.

Files:

  • scripts/docs_site_validation.py
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Treat the clean-code compliance gate as mandatory: the review surface enforces `naming`, `kiss`, `yagni`, `dry`, and `solid` categories and blocks regressions
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: When a change is paired with work in specfact-cli, review the paired public change artifacts there before widening scope or redefining shared workflow semantics

Applied to files:

  • .github/workflows/pr-orchestrator.yml
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
  • .github/workflows/docs-review.yml
📚 Learning: 2026-04-13T10:38:22.837Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-13T10:38:22.837Z
Learning: This repository enforces the clean-code review gate through hatch run specfact code review run --json --out .specfact/code-review.json

Applied to files:

  • .github/workflows/pr-orchestrator.yml
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • scripts/pre-commit-quality-checks.sh
  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
📚 Learning: 2026-04-13T10:38:15.842Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-13T10:38:15.842Z
Learning: Adhere to worktree policy, OpenSpec gating, GitHub hierarchy-cache refresh, TDD order, quality gates, versioning, and documentation rules as defined in `docs/agent-rules/`

Applied to files:

  • .github/workflows/docs-pages.yml
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • scripts/pre-commit-quality-checks.sh
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Treat canonical rule docs (docs/agent-rules/INDEX.md) as the source of truth for worktree policy, OpenSpec gating, GitHub completeness checks, TDD order, quality gates, versioning, and documentation rules

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
📚 Learning: 2026-04-02T21:49:11.371Z
Learnt from: djm81
Repo: nold-ai/specfact-cli-modules PR: 136
File: registry/modules/specfact-spec-0.40.17.tar.gz.sha256:1-1
Timestamp: 2026-04-02T21:49:11.371Z
Learning: In nold-ai/specfact-cli-modules, module tarball signatures (registry/signatures/*.tar.sig) are generated by the `publish-modules` GitHub Actions runner during the publish workflow, not committed locally to the branch. Missing signature files should NOT be flagged as a pre-merge blocker in PRs.

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-publishing/spec.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Treat the clean-code compliance gate as mandatory: the review surface enforces `naming`, `kiss`, `yagni`, `dry`, and `solid` categories and blocks regressions

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
📚 Learning: 2026-04-13T10:38:29.379Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-13T10:38:29.379Z
Learning: Applies to **/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h} : Preserve the clean-code compliance gate and its category references (naming, kiss, yagni, dry, and solid)

Applied to files:

  • openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md
📚 Learning: 2026-04-13T10:38:43.524Z
Learnt from: CR
Repo: nold-ai/specfact-cli-modules PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-13T10:38:43.524Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented

Applied to files:

  • docs/bundles/code-review/run.md
  • openspec/changes/docs-15-code-review-validation-guardrails/specs/review-run-command/spec.md
🪛 LanguageTool
openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md

[grammar] ~19-~19: Use a hyphen to join words.
Context: ...w page ### Requirement: Bundle overview related links SHALL be covered by docs v...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.22.0)
openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-pre-commit-quality-parity/spec.md

[warning] 3-3: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

openspec/changes/docs-15-code-review-validation-guardrails/specs/bundle-overview-pages/spec.md

[warning] 3-3: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

openspec/changes/docs-15-code-review-validation-guardrails/specs/modules-docs-command-validation/spec.md

[warning] 3-3: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

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

[::nold-ai/specfact-cli::] .github/workflows/docs-review.yml — runs "scripts/check-docs-commands.py" and installs requirements-docs-ci.txt (CI consumer of the new docs validator).

[::nold-ai/specfact-cli::] .github/workflows/docs-pages.yml / .github/workflows/github-pages.yml — docs workflow now invokes check-docs-commands.py (with --jekyll-bundle-check) after installing pinned docs requirements (CI consumer that will fail on validator findings).

[::nold-ai/specfact-cli::] scripts/check-docs-commands.py — entrypoint now imports and delegates to scripts/docs_site_validation (ValidationFinding type, build/scan helpers). (file present and modified in PR.)

[::nold-ai/specfact-cli::] scripts/docs_site_validation.py — new shared validation API (exports ValidationFinding, build_route_index, resolve_internal_link_hybrid, scan_published_route_body_links, scan_frontmatter_findings, scan_gemfile_lock_installability). Consumed by check-docs-commands and unit tests.

[::nold-ai/specfact-cli::] scripts/pre-commit-quality-checks.sh — added staged-docs gating and run_docs_site_validation_gate that invokes "hatch run python scripts/check-docs-commands.py" when docs/ or related paths change (local pre-commit consumer of the validator).

[::nold-ai/specfact-cli::] pyproject.toml (tool scripts) — defines check-docs-commands script entry (hatch task) pointing to scripts/check-docs-commands.py (build/test tooling consumer).

[::nold-ai/specfact-cli::] tests/unit/docs/test_code_review_docs_parity.py — new unit test that imports the Code Review Typer app (review_app) via review_commands.review_app and asserts parity between public Typer/Click --* option flags and docs/bundles/code-review/run.md (ties docs content to CLI surface; will break if CLI flags change without docs update).

[::nold-ai/specfact-cli::] tests/unit/docs/test_docs_review.py and tests/unit/test_check_docs_commands_script.py — updated to import and call functions from scripts/docs_site_validation (tests directly depend on the new API/ValidationFinding shape and exported helpers).

[::nold-ai/specfact-cli::] .github/workflows/pr-orchestrator.yml — now pins specfact-cli==0.46.2 when installing CLI in CI (affects which CLI version tests/workflows run against).

[::nold-ai/specfact-cli::] docs/* (multiple docs including docs/bundles/code-review/run.md and docs/modules/code-review.md) — docs were updated to reflect CLI flags (e.g., --bug-hunt, --mode, --focus, --level, --json/--out, invalid combinations); tests enforce parity between these docs and the actual Typer command surface.

[::nold-ai/specfact-cli::] many tests and openspec specs (examples: tests/unit/specfact_cli/test_dogfood_self_review.py, openspec/specs/review-run-command/spec.md, docs/modules/code-review.md) — repository contains numerous references to "specfact code review run" and its flags; the new parity tests and docs-validator increase coupling between CLI option surface, docs, CI, and pre-commit gating.

Implications / risk areas observed:

  • Changes to scripts/docs_site_validation API (ValidationFinding shape or exported function names) will break check-docs-commands.py and unit tests that call it ([::nold-ai/specfact-cli::scripts/check-docs-commands.py], [::nold-ai/specfact-cli::tests/unit/docs/test_docs_review.py], [::nold-ai/specfact-cli::tests/unit/test_check_docs_commands_script.py]).
  • Changes to the Code Review Typer command flags (review_app) must be mirrored in docs/bundles/code-review/run.md or tests/unit/docs/test_code_review_docs_parity.py will fail ([::nold-ai/specfact-cli::tests/unit/docs/test_code_review_docs_parity.py], [::nold-ai/specfact-cli::docs/bundles/code-review/run.md]).
  • Pre-commit and CI now run the docs validator for docs-only changes; failing findings from docs_site_validation will block commits and CI Pages deploys ([::nold-ai/specfact-cli::scripts/pre-commit-quality-checks.sh], [::nold-ai/specfact-cli::.github/workflows/docs-pages.yml]).
🔇 Additional comments (8)
.github/workflows/pr-orchestrator.yml (1)

143-143: Pinned specfact-cli install is a good CI stability guardrail.

This keeps workflow behavior deterministic and aligned with contract-test tooling expectations. As per coding guidelines ".github/workflows/**: CI: secrets, hatch/verify-modules-signature gates, contract-test alignment, action versions".

tests/unit/workflows/test_pr_orchestrator_signing.py (1)

37-40: Nice targeted regression test for workflow contract pinning.

This directly guards the adapter boundary expectation that CI installs the intended specfact-cli version. As per coding guidelines "tests/**/*.py: Contract-first and integration tests: migration suites, bundle validation, and flakiness. Ensure changes to adapters or bridges have targeted coverage."

requirements-docs-ci.txt (1)

1-11: Pinned docs CI dependencies are deterministic and coherent.

This manifest is clear, fully pinned, and fits the docs-validation CI contract.

tests/unit/test_pre_commit_quality_parity.py (1)

38-40: Pre-commit parity coverage correctly includes the docs validation gate.

The added required fragments align with the new gate function and invocation path.

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

8-8: Docs-pages validation wiring looks correct and release-safe.

The new trigger and the pinned docs-validation step (including --jekyll-bundle-check) are aligned with the shared validator flow.

Also applies to: 56-65

scripts/pre-commit-quality-checks.sh (1)

76-109: Docs gate ordering is correct for adapter-boundary parity.

Running docs validation before safe-change bypass closes the local/CI parity gap for docs-only changes.

Also applies to: 260-260, 279-279

docs/bundles/code-review/run.md (1)

30-37: Option-surface documentation update is well aligned with the current run command.

Nice parity improvement for the bundled-module docs.

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

12-17: Docs-review workflow changes are consistent with parity guardrails.

The trigger expansion, pinned install, and parity test inclusion line up with the new docs-validation contract.

Also applies to: 25-30, 57-57, 63-63

Comment thread docs/bundles/code-review/run.md
Comment thread tests/unit/docs/test_code_review_docs_parity.py
Comment thread tests/unit/docs/test_code_review_docs_parity.py Outdated
Comment thread tests/unit/test_check_docs_commands_script.py Outdated
Comment thread tests/unit/test_check_docs_commands_script.py
Document invalid --json/--score-only pairing in the code-review run bundle.
Normalize OpenSpec delta spec headings for markdownlint increment rules and
align review-run-command spec with --path targeting and published-link cases.

Harden docs_site_validation: treat README like other pages for route indexing,
catch bundle check timeouts as categorized findings, and fix README links so
check-docs-commands passes.

Update parity and workflow tests to follow resolver/CLI flags and public
check-docs-commands ordering without coupling to helper script paths.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Change] Docs validation guardrails for Code Review docs and module links

1 participant