chore(pre-commit): modular hooks + branch-aware module verify#501
Conversation
- Add scripts/pre-commit-quality-checks.sh (block1 stages + block2; all for manual/shim) - Replace monolithic smart-checks with shim to quality-checks all - .pre-commit-config: fail_fast, verify-module-signatures + check-version-sources, cli-block1-* hooks, cli-block2, doc frontmatter - Match modules: hatch run lint when Python staged; scoped code review paths - CLI extras: Markdown fix/lint, workflow actionlint (no packages/ bundle-import gate) - Bump to 0.46.1; docs: README, CONTRIBUTING, code-review.md, agent-rules/70 Made-with: Cursor
- Add scripts/pre-commit-verify-modules.sh and git-branch-module-signature-flag.sh - Point verify-module-signatures hook at wrapper (script); skip when no staged module paths - pre-commit-quality-checks all: delegate module step to wrapper; safe-change allowlist - Tests + CONTRIBUTING/CHANGELOG alignment Made-with: Cursor
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRefactors pre-commit into a modular, fail-fast pipeline driven by Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Git as Git (staged)
participant PreCommit as .pre-commit hook
participant Verify as pre-commit-verify-modules.sh
participant Flag as git-branch-module-signature-flag.sh
participant Version as check-version-sources / hatch
participant Quality as pre-commit-quality-checks.sh
participant Commit as Commit
Dev->>Git: stage files
Git->>PreCommit: trigger hooks
PreCommit->>Verify: run verify-module-signatures
Verify->>Flag: resolve branch policy
alt policy == require (main)
Verify->>Verify: exec verifier with --require-signature --enforce-version-bump --payload-from-filesystem
else policy == omit (non-main/detached)
Verify->>Verify: exec verifier without --require-signature (checksum-only) + --enforce-version-bump --payload-from-filesystem
end
PreCommit->>Version: run check-version-sources if version files staged
PreCommit->>Quality: run Block1 gates (format/yaml/markdown/workflows/lint)
Quality->>Quality: run Block2 (code review + contract tests) or skip if safe-change
Quality-->>Commit: allow or block commit
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c497c668b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 15-26: The changelog currently groups new hook entrypoints and
scripts under "Changed"; split these into an "Added" subsection listing the
net-new capabilities (mentioning scripts/pre-commit-quality-checks.sh,
scripts/pre-commit-smart-checks.sh shim behavior, new modular hook layout and
fail_fast parity), and keep behavioral/policy adjustments (Module verify
pre-commit policies like scripts/pre-commit-verify-modules.sh,
scripts/git-branch-module-signature-flag.sh, branch-aware signature flags,
--payload-from-filesystem and --enforce-version-bump semantics) under "Changed"
so the version bump remains auditable and consistent with release-note policy.
In `@scripts/pre-commit-quality-checks.sh`:
- Around line 46-48: The staged_files() helper currently returns all cached
names including deletions which breaks downstream tools (e.g., markdownlint
--fix and subsequent git add); update staged_files() to filter out deleted
entries by using git diff --cached --name-only --diff-filter=ACMR so only
Added/Copied/Modified/Renamed files are returned, ensuring callers like the
markdownlint invocation and git add only receive existing files.
- Around line 221-222: The script uses GNU-only xargs -r with md_files (and
similarly in other spots) which breaks on BSD/macOS; update each place using
"echo \"${md_files}\" | xargs -r ..." to first check for non-empty input or
convert to a bash array and invoke markdownlint/git directly: for example, test
[ -n "${md_files}" ] before piping to xargs or use readarray -t md_array <<<
"${md_files}" and call markdownlint --fix --config .markdownlint.json
"${md_array[@]}" and git add -- "${md_array[@]}" (apply the same pattern
wherever xargs -r is used).
- Line 14: Replace the single "set -e" with stricter shell flags ("set -euo
pipefail") and then audit and update the script's uses of unset-variable
expansions and pipeline commands: ensure intentional `${1:-all}` usages remain
safe (keep or explicitly default where needed), and add explicit guards like "||
true" or conditional checks around grep-in-pipeline patterns (e.g., any
occurrences of "grep ... || true" or pipelines like "staged_files | grep -E
...") so a failing pipeline doesn't abort unexpectedly; adjust any places that
rely on unset variables to provide safe defaults or explicit checks to satisfy
-u.
- Line 113: The loop uses unquoted expansion ("for file in ${files}; do") which
splits filenames on whitespace and corrupts counts like other_changes; replace
it with a null-delimited read loop that preserves spaces: produce a
null-delimited list (e.g., git diff --name-only -z or similar) and consume it
with while IFS= read -r -d '' file; do ... done, and ensure you always reference
"${file}" when counting or processing so other_changes increments correctly for
files with spaces.
In `@scripts/pre-commit-verify-modules.sh`:
- Around line 24-26: The script currently forwards sig_flag unconditionally to
the verifier causing an error when sig_flag is "--allow-unsigned"; update the
invocation so the flag is only passed when it equals "--require-signature".
Specifically, in scripts/pre-commit-verify-modules.sh check the value of
sig_flag (the variable set by flag_script) and only include it in the exec call
to run verify-modules-signature.py when sig_flag == "--require-signature";
otherwise call the verifier without that argument so it defaults to lenient
mode. Ensure you update the exec line that runs verify-modules-signature.py and
keep the other fixed args (--enforce-version-bump, --payload-from-filesystem)
unchanged.
In `@tests/unit/scripts/test_pre_commit_verify_modules.py`:
- Around line 58-71: The parameterized test test_git_branch_signature_flag
currently checks only named branches; add a case covering detached HEAD to
exercise the fallback path by initializing a repo via
_git_init_with_commit(repo), creating a commit, then detaching HEAD (e.g.,
subprocess.run(["git", "checkout", "--detach", "<commit>"], cwd=repo, ...)) and
assert _run_flag(cwd=repo) returns the expected fallback flag (likely
"--allow-unsigned" or the contract-specified value); update the
pytest.mark.parametrize tuple to include a ("detached", "<expected>") entry and
ensure the helper functions _git_init_with_commit and _run_flag are used to set
up and evaluate the detached scenario.
🪄 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: 0d2ec450-d5f2-4b22-908a-d66b29e32ec3
📒 Files selected for processing (18)
.pre-commit-config.yamlCHANGELOG.mdCONTRIBUTING.mdREADME.mddocs/agent-rules/70-release-commit-and-docs.mddocs/modules/code-review.mdpyproject.tomlscripts/git-branch-module-signature-flag.shscripts/pre-commit-quality-checks.shscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shscripts/setup-git-hooks.shsetup.pysrc/__init__.pysrc/specfact_cli/__init__.pytests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.pytests/unit/workflows/test_trustworthy_green_checks.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Type Checking (basedpyright)
- GitHub Check: Contract-First CI
- GitHub Check: Linting (ruff, pylint, safe-write guard)
- GitHub Check: Tests (Python 3.12)
- GitHub Check: Compatibility (Python 3.11)
🧰 Additional context used
📓 Path-based instructions (15)
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use@lru_cacheand Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...
Files:
setup.pysrc/specfact_cli/__init__.pytests/unit/scripts/test_pre_commit_smart_checks_docs.pysrc/__init__.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
{src/__init__.py,pyproject.toml,setup.py}
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
{src/__init__.py,pyproject.toml,setup.py}: Update src/init.py first as primary source of truth for package version, then pyproject.toml and setup.py
Maintain version synchronization across src/init.py, pyproject.toml, and setup.py
Files:
setup.pypyproject.tomlsrc/__init__.py
{pyproject.toml,setup.py,src/__init__.py}
📄 CodeRabbit inference engine (.cursor/rules/testing-and-build-guide.mdc)
Manually update version numbers in pyproject.toml, setup.py, and src/init.py when making a formal version change
Files:
setup.pypyproject.tomlsrc/__init__.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality:hatch run format, (2) Type checking:hatch run type-check(basedpyright), (3) Contract-first approach: Runhatch run contract-testfor contract validation, (4) Run full test suite:hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have@icontractdecorators and@beartypetype checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments
Files:
setup.pysrc/specfact_cli/__init__.pytests/unit/scripts/test_pre_commit_smart_checks_docs.pysrc/__init__.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
src/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
src/**/*.py: All code changes must be followed by running the full test suite using the smart test system.
All Python files in src/ and tools/ directories must have corresponding test files in tests/ directory. If you modify src/common/logger_setup.py, you MUST have tests/unit/common/test_logger_setup.py. NO EXCEPTIONS - even small changes require tests.
All new Python runtime code files must have corresponding test files created BEFORE committing the code. NO EXCEPTIONS - no code without tests.
Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
All components must support TEST_MODE=true environment variable with test-specific behavior defined as: if os.environ.get('TEST_MODE') == 'true': # test-specific behavior
Use src/common/logger_setup.py for all logging via: from common.logger_setup import get_logger; logger = get_logger(name)
Use src/common/redis_client.py with fallback for Redis operations via: from common.redis_client import get_redis_client; redis_client = get_redis_client()
Type checking must pass with no errors using: mypy .
Test coverage must meet or exceed 80% total coverage. New code must have corresponding tests. Modified code must maintain or improve coverage. Critical paths must have 100% coverage.
Use Pydantic v2 validation for all context and data schemas.Add/update contracts on new or modified public APIs, stateful classes and adapters using
icontractdecorators andbeartyperuntime type checks
src/**/*.py: Meaningful Naming — identifiers reveal intent; avoid abbreviations. Identifiers insrc/must usesnake_case(modules/functions),PascalCase(classes),UPPER_SNAKE_CASE(constants). Avoid single-letter names outside short loop variables.
KISS — keep functions and modules small and single-purpose. Maximum function length: 120 lines (Phase A error threshold). Maximum cyclomati...
Files:
src/specfact_cli/__init__.pysrc/__init__.py
@(src|tests)/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Linting must pass with no errors using: pylint src tests
Files:
src/specfact_cli/__init__.pytests/unit/scripts/test_pre_commit_smart_checks_docs.pysrc/__init__.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
src/specfact_cli/**/*.py
⚙️ CodeRabbit configuration file
src/specfact_cli/**/*.py: Focus on modular CLI architecture: lazy module loading, registry/bootstrap patterns, and
dependency direction. Flag breaking changes to public APIs, Pydantic models, and resource
bundling. Verify@icontract+@beartypeon public surfaces; prefer centralized logging
(get_bridge_logger) over print().
Files:
src/specfact_cli/__init__.py
pyproject.toml
📄 CodeRabbit inference engine (.cursorrules)
When updating the version in
pyproject.toml, ensure it's newer than the latest PyPI version. The CI/CD pipeline will automatically publish to PyPI only if the new version is greater than the published version
Files:
pyproject.toml
**/*.{md,mdc}
📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)
**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files
Files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdCONTRIBUTING.mddocs/modules/code-review.mdCHANGELOG.md
docs/**/*.md
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Files:
docs/agent-rules/70-release-commit-and-docs.mddocs/modules/code-review.md
⚙️ CodeRabbit configuration file
docs/**/*.md: User-facing accuracy: CLI examples match current behavior; preserve Jekyll front matter;
call out when README/docs index need sync.
Files:
docs/agent-rules/70-release-commit-and-docs.mddocs/modules/code-review.md
**/*.md
📄 CodeRabbit inference engine (.cursorrules)
Avoid markdown linting errors (refer to markdown-rules)
Files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdCONTRIBUTING.mddocs/modules/code-review.mdCHANGELOG.md
@(README.md|AGENTS.md)
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Check README.md and AGENTS.md for current project status and development guidelines. Review .cursor/rules/ for detailed development standards and testing procedures.
Files:
README.md
**/test_*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use@pytest.mark.asynciodecorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.
tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oraclesSecret redaction via
LoggerSetup.redact_secretsmust be covered by unit tests
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
⚙️ CodeRabbit configuration file
tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
CHANGELOG.md
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
Include new version entries at the top of CHANGELOG.md when updating versions
Update CHANGELOG.md with all code changes as part of version control requirements.
Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Files:
CHANGELOG.md
🧠 Learnings (41)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to @(pyproject.toml|setup.py|src/__init__.py|src/specfact_cli/__init__.py) : Maintain synchronized versions across pyproject.toml, setup.py, src/__init__.py, and src/specfact_cli/__init__.py.
Applied to files:
setup.pysrc/specfact_cli/__init__.pypyproject.tomlsrc/__init__.py
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to {src/__init__.py,pyproject.toml,setup.py} : Update src/__init__.py first as primary source of truth for package version, then pyproject.toml and setup.py
Applied to files:
src/specfact_cli/__init__.pypyproject.tomlsrc/__init__.py
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to {pyproject.toml,setup.py,src/__init__.py} : Manually update version numbers in pyproject.toml, setup.py, and src/__init__.py when making a formal version change
Applied to files:
pyproject.tomlsrc/__init__.py
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.{py,pyi} : After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: `hatch run format`, (2) Type checking: `hatch run type-check` (basedpyright), (3) Contract-first approach: Run `hatch run contract-test` for contract validation, (4) Run full test suite: `hatch test --cover -v`, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
Applied to files:
pyproject.tomlscripts/pre-commit-smart-checks.shCONTRIBUTING.mddocs/modules/code-review.md.pre-commit-config.yamltests/unit/scripts/test_pre_commit_smart_checks_docs.pyscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to src/**/*.py : Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
Applied to files:
pyproject.tomlCONTRIBUTING.mdtests/unit/workflows/test_trustworthy_green_checks.pytests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to pyproject.toml : When updating the version in `pyproject.toml`, ensure it's newer than the latest PyPI version. The CI/CD pipeline will automatically publish to PyPI only if the new version is greater than the published version
Applied to files:
pyproject.toml
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Validate GitHub workflow files using `hatch run lint-workflows` before committing
Applied to files:
pyproject.tomlREADME.mdscripts/pre-commit-smart-checks.shCONTRIBUTING.md.pre-commit-config.yaml
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Run `hatch run yaml-check-all` in CI and before pull requests to validate all YAML and workflow files
Applied to files:
pyproject.tomlREADME.mdscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shCONTRIBUTING.md.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to **/*.{yml,yaml} : Format all YAML and workflow files using `hatch run yaml-fix-all` before committing
Applied to files:
pyproject.tomlREADME.mdscripts/pre-commit-smart-checks.shCONTRIBUTING.md.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to **/*.{yml,yaml} : Validate YAML configuration files locally using `hatch run yaml-lint` before committing
Applied to files:
pyproject.tomlscripts/pre-commit-smart-checks.shCONTRIBUTING.md.pre-commit-config.yaml
📚 Learning: 2026-04-10T22:41:34.504Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T22:41:34.504Z
Learning: Treat the canonical rule docs in 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/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: Treat `docs/agent-rules/` as the canonical location for repository governance rather than relying on inline reminders or other documentation
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: For large frontmatter file changes in `docs/agent-rules/`, run `cd ../specfact-cli-internal && python3 scripts/wiki_rebuild_graph.py` from the sibling repo after merging
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to docs/**/*.md : Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdCONTRIBUTING.mddocs/modules/code-review.md
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: The full governance rules live in docs/agent-rules/; do not treat this file as a complete standalone handbook
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdCHANGELOG.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements.
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdCONTRIBUTING.mdCHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Always finish each output by listing: (1) Which rulesets have been applied (e.g., `.cursorrules`, `AGENTS.md`, specific `.cursor/rules/*.mdc`), (2) Confirmation of Git Worktree Policy compliance (if applicable), (3) Which AI (LLM) provider and model version you are using
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Read docs/agent-rules/INDEX.md before implementation
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdscripts/git-branch-module-signature-flag.shscripts/pre-commit-verify-modules.shCONTRIBUTING.mdtests/unit/scripts/test_pre_commit_verify_modules.pyCHANGELOG.md
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: For OpenSpec changes when a sibling `specfact-cli-internal/` checkout exists, read internal wiki guidance in `docs/agent-rules/40-openspec-and-tdd.md` and consult `wiki/hot.md`, `wiki/graph.md`, and relevant `wiki/concepts/*.md` files
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shCONTRIBUTING.md.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Applied to files:
docs/agent-rules/70-release-commit-and-docs.mdREADME.mdscripts/pre-commit-verify-modules.shCONTRIBUTING.mddocs/modules/code-review.md.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to @(README.md|AGENTS.md) : Check README.md and AGENTS.md for current project status and development guidelines. Review .cursor/rules/ for detailed development standards and testing procedures.
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: `AGENTS.md` is the **authoritative source** for development workflow and **OVERRIDES** any skill, command, or OpenSpec workflow instructions. When there is a conflict between AGENTS.md and any other source, **ALWAYS follow AGENTS.md**
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Before designing or scoping a new OpenSpec change, read the wiki paths listed in docs/agent-rules/40-openspec-and-tdd.md#internal-wiki-and-strategic-context using absolute paths to sibling internal repository files
Applied to files:
docs/agent-rules/70-release-commit-and-docs.md
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce the clean-code review gate through `hatch run specfact code review run --json --out .specfact/code-review.json`
Applied to files:
README.mdscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shCONTRIBUTING.mddocs/modules/code-review.md.pre-commit-config.yamltests/unit/workflows/test_trustworthy_green_checks.pyscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Format GitHub Actions workflows using `hatch run workflows-fmt` and lint them with `hatch run workflows-lint` after editing
Applied to files:
README.mdscripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: After merges shipping OpenSpec- or GitHub-related work with a sibling `specfact-cli-internal` checkout present, run wiki scripts from that sibling repo's working directory (e.g., `cd ../specfact-cli-internal && python3 scripts/wiki_openspec_gh_status.py`), not from `specfact-cli` or other directories
Applied to files:
README.mddocs/modules/code-review.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Before executing ANY workflow command (`/opsx:ff`, `/opsx:apply`, `/opsx:continue`, etc.), perform the Pre-Execution Checklist: (1) Git Worktree - create if task creates branches/modifies code, (2) TDD Evidence - create `TDD_EVIDENCE.md` if behavior changes, (3) Documentation - include documentation research if changes affect user-facing behavior, (4) Module Signing - include signature verification if changes modify bundled modules, (5) Confirmation - state clearly that pre-execution checklist is complete and AGENTS.md compliance is confirmed
Applied to files:
README.mdscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.sh.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Use actionlint for semantic validation of GitHub Actions workflows
Applied to files:
README.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:ff` (Fast-Forward Change Creation): OPSX provides change scaffolding and artifact templates. AGENTS.md requires explicitly adding: Worktree creation task as Step 1 in tasks.md (not just 'create branch'), TDD_EVIDENCE.md tracking task in section 2 (Tests), Documentation research task per `openspec/config.yaml`, Module signing quality gate if applicable, Worktree cleanup steps in final section
Applied to files:
README.mdCONTRIBUTING.mddocs/modules/code-review.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
Applied to files:
scripts/git-branch-module-signature-flag.shscripts/pre-commit-verify-modules.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Applied to files:
scripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shCONTRIBUTING.mddocs/modules/code-review.md.pre-commit-config.yamlscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Run contract-first validation locally before committing: `hatch run contract-test-contracts`, `hatch run contract-test-exploration`, and `hatch run contract-test-scenarios`
Applied to files:
CONTRIBUTING.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Run the required verification and quality gates for the touched scope before finalization
Applied to files:
CONTRIBUTING.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to **/*.yaml : YAML files must pass linting using: hatch run yaml-lint with relaxed policy.
Applied to files:
.pre-commit-config.yaml
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to {src/__init__.py,pyproject.toml,setup.py} : Maintain version synchronization across src/__init__.py, pyproject.toml, and setup.py
Applied to files:
src/__init__.py
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/test_*.py : Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Applied to files:
tests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: After implementation, run quality gates (hatch run format, hatch run type-check, hatch run contract-test, hatch test or hatch run smart-test) to ensure all tests pass and contracts are satisfied
Applied to files:
scripts/pre-commit-quality-checks.sh
🪛 LanguageTool
docs/agent-rules/70-release-commit-and-docs.md
[uncategorized] ~43-~43: The official name of this software platform is spelled with a capital “H”.
Context: ...it__.pydisagree. The **Tests** job in.github/workflows/pr-orchestrator.yml` runs the...
(GITHUB)
🔀 Multi-repo context nold-ai/specfact-cli-modules
Linked repositories findings
specfact-cli-modules [::nold-ai/specfact-cli-modules::]
-
.pre-commit-config.yaml references the modular entries and the new script entrypoints:
- .pre-commit-config.yaml: lines with entries:
- entry: ./scripts/pre-commit-quality-checks.sh block1-format
- entry: ./scripts/pre-commit-quality-checks.sh block1-yaml
- entry: ./scripts/pre-commit-quality-checks.sh block1-bundle
- entry: ./scripts/pre-commit-quality-checks.sh block1-lint
- entry: ./scripts/pre-commit-quality-checks.sh block2
[::nold-ai/specfact-cli-modules::]
- .pre-commit-config.yaml: lines with entries:
-
The repository contains scripts and docs that match the new modular pre-commit layout and will consume the changed hooks:
- scripts/pre-commit-quality-checks.sh (exists and referenced) — script guard and subcommand behavior referenced in repo docs/tests. [::nold-ai/specfact-cli-modules::]
- docs/agent-rules/50-quality-gates-and-review.md documents Block 1/Block 2 behavior and staged path lists that align with the PR’s Block 2 path filtering. [::nold-ai/specfact-cli-modules::]
- README.md documents the code review gate and Block 2 invocation that mirror the PR changes. [::nold-ai/specfact-cli-modules::]
-
Tests and tooling in this repo expect the modular script and config:
- tests/unit/test_pre_commit_quality_parity.py loads .pre-commit-config.yaml and references scripts/pre-commit-quality-checks.sh. [::nold-ai/specfact-cli-modules::]
- tools/contract_first_smart_test.py mentions the shell guard in pre-commit-quality-checks.sh and contract-test triggering logic. [::nold-ai/specfact-cli-modules::]
-
Specification / openspec artifacts assert parity with the modular pre-commit layout and signature/version checks:
- openspec/specs/modules-pre-commit-quality-parity/spec.md and related TDD_EVIDENCE describe required behavior (signature verification, formatter safety, staged gating). [::nold-ai/specfact-cli-modules::]
Conclusion: specfact-cli-modules already references and expects the modular pre-commit script and Block 1/Block 2 behavior introduced by the PR; its docs, tests, and openspec artifacts are consumers/validators of the new hook layout and will be affected if the entrypoints or arguments (e.g., require-signature / payload flags, hook ids, or pass_filenames behavior) change.
🔇 Additional comments (28)
src/specfact_cli/__init__.py (1)
48-48: Version synchronization confirmed across all canonical locations.The
0.46.1bump is correctly aligned withsrc/__init__.py,pyproject.toml, andsetup.py. The bootstrap logic for siblingspecfact-cli-modulesbundle paths remains intact, ensuring local development can load marketplace packages without installed wheels.src/__init__.py (1)
5-6: Primary version source of truth correctly updated.The explicit sync comment is helpful documentation. Version
0.46.1matchespyproject.toml,setup.py, andsrc/specfact_cli/__init__.pyas required by the repository's versioning policy.setup.py (1)
10-10: Version synchronized with package configuration.The
0.46.1version insetup.pymatches the primary source (src/__init__.py) and the other version declarations. Dependency list remains unchanged—no supply chain concerns introduced.scripts/setup-git-hooks.sh (1)
48-50: Clear guidance on the two-tier hook architecture.The updated messaging correctly steers developers toward the modular
.pre-commit-config.yamllayout while explaining the fallback behavior. This matches the PR's architectural intent: the copied shim (pre-commit-smart-checks.sh) delegates topre-commit-quality-checks.sh all, preserving backward compatibility for environments wherepre-commit installisn't feasible.pyproject.toml (2)
288-288: Pre-commit entry point aligned with modular pipeline.The
pre-commit-checksscript now delegates toscripts/pre-commit-quality-checks.sh all, matching the architecture established by the shim (pre-commit-smart-checks.sh) and the linkedspecfact-cli-modulesrepository. This ensureshatch run pre-commit-checksexercises the same pipeline as both the modular hook layout and the backward-compatible shim.
7-7: Version 0.46.1 correctly synchronized across all four locations and ready for publication.Verified: version = "0.46.1" is synchronized in pyproject.toml, setup.py, src/init.py, and src/specfact_cli/init.py. Version increment (0.46.0 → 0.46.1) exceeds the latest PyPI publication, so CI/CD will publish successfully.
docs/agent-rules/70-release-commit-and-docs.md (1)
38-43: Hook reference updated to match modular pre-commit layout.The versioning section now correctly references the
check-version-sourceshook in.pre-commit-config.yamlinstead of the legacyscripts/pre-commit-smart-checks.sh. This aligns with the PR's architectural shift to modular hooks.The header hierarchy change from
#to##appears intentional for Jekyll page composition. The static analysis hint about "GitHub" capitalization is a false positive—.github/workflows/pr-orchestrator.ymlis a filesystem path, not a brand reference.README.md (3)
30-30: Version in sample output updated to match release.The
v0.46.1version in the sample output aligns with the package version bump. The capture metadata note (line 60) references the reproducibility path for this output.
83-98: Pre-commit documentation accurately reflects the modular architecture.The two-tier approach is clearly documented:
- Modular layout (preferred): Copy
.pre-commit-config.yaml+pre-commit install— enablesfail_fast, staged gates, and granular Block 1/Block 2 hooks- Single-hook fallback: The stable
specfact-smart-checksid delegates via shim toscripts/pre-commit-quality-checks.sh allThis aligns with
specfact-cli-modulesparity expectations and maintains backward compatibility for downstream repos pinned to earlier revisions.
100-105: GitHub Actions section structure preserved.The workflow snippet remains unchanged and correctly demonstrates the minimal
govern enforce stagegate. The heading format change (### GitHub Actions) maintains consistency with the new### Pre-commitsection.scripts/pre-commit-smart-checks.sh (1)
1-5: Backward-compatible delegation shim maintains stable hook contract.The architecture is sound:
execreplaces the shell process withpre-commit-quality-checks.sh all "$@", avoiding subshell overhead while preserving arguments. Thedirname "$0"idiom ensures correct path resolution regardless of working directory.This maintains the stable
specfact-smart-checkshook id for downstream repos (as documented inspecfact-cli-modulesparity specs) while routing all execution through the new modular pipeline. The target script exists, is executable, and supports theallsubcommand, ensuring the delegation will succeed at runtime.scripts/git-branch-module-signature-flag.sh (1)
6-15: Branch-aware signature flag logic looks correct.This is clean and deterministic for both normal branches and detached-head fallback behavior.
docs/modules/code-review.md (1)
105-116: Pre-commit gate documentation is aligned with the modular pipeline.The Block 2 invocation, staged scope, and shim guidance match the current hook/script layout.
As per coding guidelines, this correctly updates configuration guidance in
docs/**/*.mdfor architecture/config changes.CONTRIBUTING.md (1)
81-97: Pre-commit contributor guidance now matches the modular gate flow.The updated sequence and manual invocation guidance are consistent with the current hook architecture.
Also applies to: 114-116
.pre-commit-config.yaml (1)
1-71: Modular, fail-fast pre-commit layout is well-structured.The hook ordering and staged scoping cleanly enforce Block 1 before Block 2 and preserve the intended gate semantics.
tests/unit/workflows/test_trustworthy_green_checks.py (1)
168-202: Strong policy regression coverage for the new pre-commit topology.This test pins the critical hook IDs and execution model, which reduces config drift risk.
tests/unit/scripts/test_pre_commit_smart_checks_docs.py (1)
6-52: Test updates correctly track the new quality-checks entrypoint and shim contract.The ordering checks and
all "$@"delegation assertion are useful compatibility guards.tests/unit/scripts/test_pre_commit_verify_modules.py (1)
16-35: Good baseline coverage for wrapper wiring and required verifier flags.This effectively protects the wrapper contract from accidental argument drift.
scripts/pre-commit-quality-checks.sh (10)
84-101: LGTM — solid safety guard for partial-fix prevention.This correctly detects when a staged Markdown file has unstaged hunks, preventing the auto-fixer from modifying content that wasn't intended for the commit. The heredoc pattern handles filenames with spaces correctly.
131-157: Version synchronization check is well-integrated.The conditional logic correctly triggers
hatch run check-version-sourcesonly when version-declaring files are staged. This aligns with the learnings about enforcing version bumps. The same word-splitting concern from Line 113 applies at Line 137, but I've already flagged that pattern above.
159-173: Clean delegation to branch-aware module verification.This correctly delegates to
pre-commit-verify-modules.sh, which implements the marketplace-06 policy (signature enforcement onmain, unsigned allowed elsewhere). The wrapper handles staged-path gating internally, keeping this function simple. Based on learnings, this enforces module signatures when signed module assets are affected.
175-191: LGTM — robust formatter safety gate.Capturing binary diffs before and after
hatch run formatensures any working-tree mutation is detected, preventing commits with unstaged formatter changes. This aligns with the contract-first quality gate expectations.
297-317: Path-scoped code review gate aligns with cross-repo contracts.The scoping to
src/,scripts/,tools/,tests/, andopenspec/changes/matches the documented behavior inspecfact-cli-modulesand provides appropriate granularity for the review gate. The array handling correctly preserves paths with spaces.
319-334: Contract-first testing flow correctly implemented.The two-phase approach (status check → conditional run) optimizes the pre-commit experience while maintaining contract guarantees. Based on learnings, this ensures contract tests run before PRs when relevant inputs change.
367-381: Block 2 handler has proper gating and pre-flight checks.The safe-change early exit provides good developer UX for doc-only commits, and the file existence check prevents cryptic errors if the repo is in an incomplete state.
383-406: Full pipeline ordering places module verification early — intentional forallmode.Running module signature verification before formatting (Line 386) ensures signature issues are caught first when running manually or in CI. This differs from the hook-by-hook order in
.pre-commit-config.yamlbut is appropriate for theallsubcommand's use case.The Block 1 → Block 2 separation with safe-change gating is well-structured.
419-454: LGTM — clean dispatch with sensible defaults.Defaulting to
allmaintains backward compatibility with the shim wrapper and provides a reasonable behavior for direct invocation. The case statement is exhaustive and maintainable.
7-12: Cross-repo contract divergence is well-documented.The header clearly explains that
specfact-clilacks thepackages/tree (hence noblock1-bundle), and CLI-specific stages (Markdown fix/lint, workflow checks) are additions. This maintains architectural parity withspecfact-cli-moduleswhile accommodating repo-specific needs. The linked repository's tests and specs should remain valid since they reference the core entrypoints.
…re policy - Emit require/omit from git-branch-module-signature-flag; pass --require-signature only on main - Resolve repo root in pre-commit-smart-checks via git rev-parse for .git/hooks copies - Harden pre-commit-quality-checks: ACMR staged paths, pipefail, no xargs -r, safe loops - CHANGELOG/CONTRIBUTING: Added vs Changed; document verifier CLI (no --allow-unsigned) - Tests: omit/require expectations, detached HEAD; shim asserts repo-root exec Made-with: Cursor
- Document checksum-only vs --require-signature; clarify --allow-unsigned is sign-modules.py only - Add pre-commit and CI branch policy to module-security, signing guide, publishing, agent gates - Refresh marketplace-06 OpenSpec proposal/design/tasks/spec delta; openspec validate --strict OK - CHANGELOG: note doc and OpenSpec alignment Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 26-34: The changelog bullets under the “Module verify
(pre-commit)” and “scripts/pre-commit-quality-checks.sh” entries exceed the
120-char markdown limit; reflow/wrap those long lines in CHANGELOG.md so each
markdown line is <=120 chars while preserving the same wording and list
structure, splitting sentences between logical boundaries and keeping referenced
symbols intact (e.g., verify-modules-signature.py,
scripts/pre-commit-verify-modules.sh,
scripts/git-branch-module-signature-flag.sh,
scripts/pre-commit-quality-checks.sh, and the flags like --require-signature,
--payload-from-filesystem, --enforce-version-bump).
In `@scripts/pre-commit-quality-checks.sh`:
- Around line 345-360: In run_contract_tests_visible, add an inline comment
above the `hatch run contract-test-status >/dev/null 2>&1` invocation explaining
that stderr and stdout are intentionally discarded so transient status-check
errors (e.g., missing deps) don't surface to the user and instead fall back to
running the full `hatch run contract-test`; keep the existing redirection
behavior but document the intent and trade-off in the comment so future
maintainers understand why errors are suppressed.
- Around line 402-405: Extract the duplicate file-existence check for
"tools/contract_first_smart_test.py" into a single helper (e.g.,
check_contract_script_exists) and call it from both run_block2 and run_all to
remove the duplicated if-block. The helper should perform the [ -f ] test and
call error with the existing message ("❌ Contract-first test script not found.
Please run: hatch run contract-test-full") and exit 1 on failure; update
run_block2 and run_all to invoke check_contract_script_exists instead of
repeating the if statement.
In `@scripts/pre-commit-verify-modules.sh`:
- Around line 24-30: The script currently treats any non-"require" sig_policy as
checksum-only, which can weaken enforcement; update the logic around sig_policy
(the variable set from bash "${flag_script}") to explicitly accept only
"require" and "omit" (or the documented valid values), using an if/elif (or
case) that runs hatch ./scripts/verify-modules-signature.py with
--require-signature for "require" and with checksum-only flags for "omit", and
add an else branch that prints a clear error mentioning sig_policy and
flag_script and exits non-zero to fail closed on unexpected outputs; ensure the
calls referencing verify-modules-signature.py and the existing flags
(--enforce-version-bump, --payload-from-filesystem) remain unchanged for the
accepted branches.
In `@tests/unit/scripts/test_pre_commit_smart_checks_docs.py`:
- Around line 20-23: The current test compares global string indices which can
be correct even if the runtime order inside the orchestrator differs; extract
the text of the orchestrating function (e.g., locate the "run_all()" block) and
search within that substring for "run_markdown_autofix_if_needed" and
"run_markdown_lint_if_needed" (use the existing variable names idx_fix and
idx_lint) and then assert 0 <= idx_fix < idx_lint to ensure the autofix step is
defined before lint in the execution block rather than elsewhere in the file.
In `@tests/unit/scripts/test_pre_commit_verify_modules.py`:
- Around line 27-37: The test helper _run_flag uses subprocess.run to execute
FLAG_SCRIPT with a 30s timeout; reduce the timeout to a shorter value (e.g.,
5–10 seconds) in the subprocess.run call to get faster test feedback and fail
faster on hangs—update the timeout argument passed to subprocess.run in
_run_flag accordingly, leaving the rest of the invocation (["bash",
str(FLAG_SCRIPT)], cwd=cwd, capture_output=True, text=True, check=False)
unchanged.
- Around line 16-25: The test
test_verify_wrapper_invokes_branch_flag_and_payload_from_filesystem uses brittle
literal string asserts against VERIFY_WRAPPER content; replace these fragile
checks by moving the expected tokens (e.g.,
"git-branch-module-signature-flag.sh", "--payload-from-filesystem",
"--enforce-version-bump", "verify-modules-signature.py", 'sig_policy=$(bash
"${flag_script}")', '[[ "${sig_policy}" == "require" ]]', "--require-signature")
into module-level constants and assert against those constants, or better, run
the wrapper in a controlled subprocess/mock environment to verify it invokes the
flag script and passes the required flags (checking stdout/exit code or mocking
the flag script) rather than asserting raw source substrings; update
test_verify_wrapper_invokes_branch_flag_and_payload_from_filesystem to use the
chosen approach and replace the direct string literals with references to the
constants or runtime behavior checks.
🪄 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: 14cf7d49-5425-4fe7-b63d-1dbf2008c76e
📒 Files selected for processing (16)
CHANGELOG.mdCONTRIBUTING.mddocs/agent-rules/50-quality-gates-and-review.mddocs/guides/module-signing-and-key-rotation.mddocs/guides/publishing-modules.mddocs/reference/module-security.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdscripts/git-branch-module-signature-flag.shscripts/pre-commit-quality-checks.shscripts/pre-commit-smart-checks.shscripts/pre-commit-verify-modules.shtests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests (Python 3.12)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{md,mdc}
📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)
**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files
Files:
docs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mddocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.mdCHANGELOG.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
docs/**/*.md
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Files:
docs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mddocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.md
⚙️ CodeRabbit configuration file
docs/**/*.md: User-facing accuracy: CLI examples match current behavior; preserve Jekyll front matter;
call out when README/docs index need sync.
Files:
docs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mddocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.md
**/*.md
📄 CodeRabbit inference engine (.cursorrules)
Avoid markdown linting errors (refer to markdown-rules)
Files:
docs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mddocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.mdCHANGELOG.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
openspec/changes/**/*.md
📄 CodeRabbit inference engine (.cursorrules)
For
/opsx:archive(Archive change): Include module signing and cleanup in final tasks. Agents MUST runopenspec archive <change-id>from repo root (no manualmvunderopenspec/changes/archive/)
Files:
openspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
openspec/**/{proposal.md,tasks.md,design.md,spec.md}
📄 CodeRabbit inference engine (.cursor/rules/automatic-openspec-workflow.mdc)
openspec/**/{proposal.md,tasks.md,design.md,spec.md}: Applyopenspec/config.yamlproject context and per-artifact rules (for proposal, specs, design, tasks) when creating or updating any OpenSpec change artifact in the specfact-cli codebase
After implementation, validate the change withopenspec validate <change-id> --strict; fix validation errors in proposal, specs, design, or tasks and re-validate until passing before considering the change complete
Files:
openspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
openspec/**/*.md
⚙️ CodeRabbit configuration file
openspec/**/*.md: Treat as specification source of truth: proposal/tasks/spec deltas vs. code behavior,
CHANGE_ORDER consistency, and scenario coverage. Surface drift between OpenSpec and
implementation.
Files:
openspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
**/test_*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use@pytest.mark.asynciodecorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use@lru_cacheand Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.
tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oraclesSecret redaction via
LoggerSetup.redact_secretsmust be covered by unit tests
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
⚙️ CodeRabbit configuration file
tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
@(src|tests)/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Linting must pass with no errors using: pylint src tests
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality:hatch run format, (2) Type checking:hatch run type-check(basedpyright), (3) Contract-first approach: Runhatch run contract-testfor contract validation, (4) Run full test suite:hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have@icontractdecorators and@beartypetype checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
CHANGELOG.md
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
Include new version entries at the top of CHANGELOG.md when updating versions
Update CHANGELOG.md with all code changes as part of version control requirements.
Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Files:
CHANGELOG.md
🧠 Learnings (42)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:ff` (Fast-Forward Change Creation): OPSX provides change scaffolding and artifact templates. AGENTS.md requires explicitly adding: Worktree creation task as Step 1 in tasks.md (not just 'create branch'), TDD_EVIDENCE.md tracking task in section 2 (Tests), Documentation research task per `openspec/config.yaml`, Module signing quality gate if applicable, Worktree cleanup steps in final section
Applied to files:
scripts/git-branch-module-signature-flag.shdocs/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdscripts/pre-commit-quality-checks.shCHANGELOG.mdtests/unit/scripts/test_pre_commit_verify_modules.pyopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
Applied to files:
scripts/git-branch-module-signature-flag.shdocs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdscripts/pre-commit-verify-modules.shdocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to **/*.{yml,yaml} : Format all YAML and workflow files using `hatch run yaml-fix-all` before committing
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Run `hatch run yaml-check-all` in CI and before pull requests to validate all YAML and workflow files
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Validate GitHub workflow files using `hatch run lint-workflows` before committing
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.{py,pyi} : After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: `hatch run format`, (2) Type checking: `hatch run type-check` (basedpyright), (3) Contract-first approach: Run `hatch run contract-test` for contract validation, (4) Run full test suite: `hatch test --cover -v`, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
Applied to files:
scripts/pre-commit-smart-checks.shdocs/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mddocs/guides/module-signing-and-key-rotation.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Before executing ANY workflow command (`/opsx:ff`, `/opsx:apply`, `/opsx:continue`, etc.), perform the Pre-Execution Checklist: (1) Git Worktree - create if task creates branches/modifies code, (2) TDD Evidence - create `TDD_EVIDENCE.md` if behavior changes, (3) Documentation - include documentation research if changes affect user-facing behavior, (4) Module Signing - include signature verification if changes modify bundled modules, (5) Confirmation - state clearly that pre-execution checklist is complete and AGENTS.md compliance is confirmed
Applied to files:
scripts/pre-commit-smart-checks.shdocs/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdscripts/pre-commit-verify-modules.shdocs/guides/module-signing-and-key-rotation.mdscripts/pre-commit-quality-checks.shopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to **/*.{yml,yaml} : Validate YAML configuration files locally using `hatch run yaml-lint` before committing
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Applied to files:
scripts/pre-commit-smart-checks.shdocs/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdscripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.pyopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Applied to files:
scripts/pre-commit-smart-checks.shdocs/agent-rules/50-quality-gates-and-review.mdCONTRIBUTING.mdscripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce the clean-code review gate through `hatch run specfact code review run --json --out .specfact/code-review.json`
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Format GitHub Actions workflows using `hatch run workflows-fmt` and lint them with `hatch run workflows-lint` after editing
Applied to files:
scripts/pre-commit-smart-checks.shCONTRIBUTING.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Applied to files:
docs/agent-rules/50-quality-gates-and-review.mddocs/guides/publishing-modules.mdopenspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdopenspec/changes/marketplace-06-ci-module-signing/proposal.mdscripts/pre-commit-verify-modules.shdocs/guides/module-signing-and-key-rotation.mddocs/reference/module-security.mdCHANGELOG.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:41:34.504Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T22:41:34.504Z
Learning: Treat the canonical rule docs in 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/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Read docs/agent-rules/05-non-negotiable-checklist.md before implementation
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to @(README.md|AGENTS.md) : Check README.md and AGENTS.md for current project status and development guidelines. Review .cursor/rules/ for detailed development standards and testing procedures.
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: The full governance rules live in docs/agent-rules/; do not treat this file as a complete standalone handbook
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: Treat `docs/agent-rules/` as the canonical location for repository governance rather than relying on inline reminders or other documentation
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Read docs/agent-rules/INDEX.md before implementation
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Read AGENTS.md file as the mandatory bootstrap governance surface for coding agents working in this repository
Applied to files:
docs/agent-rules/50-quality-gates-and-review.md
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Applies to openspec/**/{proposal.md,tasks.md,design.md,spec.md} : After implementation, validate the change with `openspec validate <change-id> --strict`; fix validation errors in proposal, specs, design, or tasks and re-validate until passing before considering the change complete
Applied to files:
docs/agent-rules/50-quality-gates-and-review.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Run the required verification and quality gates for the touched scope before finalization
Applied to files:
docs/agent-rules/50-quality-gates-and-review.mdCONTRIBUTING.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to pyproject.toml : When updating the version in `pyproject.toml`, ensure it's newer than the latest PyPI version. The CI/CD pipeline will automatically publish to PyPI only if the new version is greater than the published version
Applied to files:
docs/guides/publishing-modules.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to docs/**/*.md : Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mddocs/reference/module-security.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/design.mdopenspec/changes/marketplace-06-ci-module-signing/tasks.mdCONTRIBUTING.mdscripts/pre-commit-verify-modules.shopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:apply` (Implementation): OPSX provides task iteration and progress tracking. AGENTS.md requires verification before each task: Confirm you are IN a worktree (not primary checkout) before modifying code, Record failing test evidence in `TDD_EVIDENCE.md` BEFORE implementing, Record passing test evidence AFTER implementation, Run quality gates from worktree (format, type-check, contract-test), GPG-signed commits (`git commit -S`), PR to `dev` branch (never direct push)
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: For OpenSpec changes when a sibling `specfact-cli-internal/` checkout exists, read internal wiki guidance in `docs/agent-rules/40-openspec-and-tdd.md` and consult `wiki/hot.md`, `wiki/graph.md`, and relevant `wiki/concepts/*.md` files
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Before implementing code changes, run `openspec validate <change-id> --strict` to validate the OpenSpec change and optionally run `/wf-validate-change <change-id>` for breaking-change and dependency analysis; do not proceed to implementation until validation passes or user explicitly overrides
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/tasks.mdopenspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Perform `spec -> tests -> failing evidence -> code -> passing evidence` in that order for behavior changes
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/tasks.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements.
Applied to files:
CONTRIBUTING.mdCHANGELOG.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Run contract-first validation locally before committing: `hatch run contract-test-contracts`, `hatch run contract-test-exploration`, and `hatch run contract-test-scenarios`
Applied to files:
CONTRIBUTING.md
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: After implementation, run quality gates (hatch run format, hatch run type-check, hatch run contract-test, hatch test or hatch run smart-test) to ensure all tests pass and contracts are satisfied
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.md : Avoid markdown linting errors (refer to markdown-rules)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Ensure proper escaping of special characters in markdown files
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Lines should not have trailing spaces (MD009: No Trailing Spaces)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to src/**/*.py : Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
Applied to files:
tests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Applies to {src,tools}/**/*.{js,ts,jsx,tsx,py},**/*.test.{js,ts,jsx,tsx,py},**/*.spec.{js,ts,jsx,tsx,py} : Do not add, modify, or delete any application code in src/, tools/, tests, or significant docs until an OpenSpec change (new or delta) is created and validated, unless the user explicitly opts out with 'skip openspec', 'direct implementation', 'simple fix', or 'just fix it'
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: When implementation is complete and merged, run `openspec archive <change-id>` from the repository root to merge delta specs into openspec/specs/ and move the change under openspec/changes/archive/; do not manually move folders or use --skip-specs or --no-validate without explicit user confirmation
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Create feature, bugfix, or hotfix branches for changes; do not commit directly to dev or main branches
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: All commits must be made via Pull Requests to dev or main branches; no direct commits allowed
Applied to files:
openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md
🪛 LanguageTool
openspec/changes/marketplace-06-ci-module-signing/tasks.md
[uncategorized] ~36-~36: The official name of this software platform is spelled with a capital “H”.
Context: ...t verify by target branch - [ ] 4.1 In .github/workflows/pr-orchestrator.yml, in the ...
(GITHUB)
[uncategorized] ~37-~37: The official name of this software platform is spelled with a capital “H”.
Context: ... add branch-target detection: extract github.event.pull_request.base.ref (for PR ev...
(GITHUB)
[uncategorized] ~37-~37: The official name of this software platform is spelled with a capital “H”.
Context: ...l_request.base.ref(for PR events) and github.ref` (for push events). - [ ] 4.2 For e...
(GITHUB)
🪛 Shellcheck (0.11.0)
scripts/pre-commit-smart-checks.sh
[warning] 13-13: Remove space after = if trying to assign a value (for empty string, use var='' ... ).
(SC1007)
🔀 Multi-repo context nold-ai/specfact-cli-modules
Linked repositories findings
specfact-cli-modules [::nold-ai/specfact-cli-modules::]
-
.pre-commit-config.yaml — defines modular hooks that call the new script entrypoints and require signatures on main:
- fail_fast: true (top-level)
- Hook id verify-module-signatures: entry includes "hatch run ./scripts/verify-modules-signature.py --require-signature --payload-from-filesystem --enforce-version-bump" [::nold-ai/specfact-cli-modules::]. (See .pre-commit-config.yaml top block)
-
scripts/ — contains verifier and quality scripts referenced by the PR:
- scripts/pre-commit-quality-checks.sh — present and referenced by multiple hooks and docs; implements block1/block2/all subcommands expected by the PR [::nold-ai/specfact-cli-modules::].
- scripts/verify-modules-signature.py — existing verifier used by hooks and docs; many docs/tests reference running it with --require-signature / --payload-from-filesystem / --enforce-version-bump [::nold-ai/specfact-cli-modules::].
- scripts/pre_commit_code_review.py — used by Block 2 per README/docs [::nold-ai/specfact-cli-modules::].
-
Tests and tooling that consume the changed hooks:
- tests/unit/test_pre_commit_quality_parity.py — expects scripts/pre-commit-quality-checks.sh to exist and be used by pre-commit config [::nold-ai/specfact-cli-modules::].
- tests/unit/tools/test_contract_first_smart_test.py and tests/unit/test_verify_modules_signature_script.py — reference verify-modules-signature.py and verify wrapper behavior; test expectations around payload/signature flags are present [::nold-ai/specfact-cli-modules::].
-
Documentation consumers:
- README.md and docs/agent-rules/50-quality-gates-and-review.md — document Block 1/Block 2 behavior and explicitly reference pre-commit-quality-checks.sh block2 and staged path lists forwarded to pre_commit_code_review.py [::nold-ai/specfact-cli-modules::].
- docs/reference/module-security.md and multiple authoring docs — instruct running verify-modules-signature.py with --require-signature and related flags; these will need to align with branch-aware wrapper semantics introduced by the PR [::nold-ai/specfact-cli-modules::].
Summary: specfact-cli-modules already expects and consumes the modular pre-commit layout and the verify-modules-signature tooling. The PR’s changes (new pre-commit-quality-checks.sh entrypoints, branch-aware verify wrapper and git-branch-module-signature-flag behavior) align with this repo’s scripts, tests, and docs — but any change to hook IDs, required flags, or entry arguments (e.g., whether pre-commit invokes --require-signature on non-main) would affect its tests/docs and invoked verifier calls. [::nold-ai/specfact-cli-modules::]
…k, tests - Validate require|omit from git-branch-module-signature-flag; error on unknown policy - check_contract_script_exists for tools/contract_first_smart_test.py (run_block2 + run_all) - Comment why contract-test-status stdout/stderr are discarded - Tests: run_all-scoped markdown order; fake hatch integration for verify wrapper; 8s flag timeout Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
CHANGELOG.md (1)
30-33:⚠️ Potential issue | 🟡 MinorWrap remaining long bullet lines to satisfy markdown lint.
A few lines in this block still appear to exceed the 120-char markdown limit; please reflow these lines to avoid docs lint failures.
As per coding guidelines, “Keep line length under 120 characters in markdown files”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CHANGELOG.md` around lines 30 - 33, The markdown block that documents `scripts/pre-commit-quality-checks.sh` contains bullet lines that exceed the 120-character limit; reflow those long lines so each line is <=120 characters (wrap at logical boundaries like commas or after flags such as `--payload-from-filesystem` and `--enforce-version-bump`), preserving the bullet structure and punctuation, and ensure the sentence fragments remain readable and grammatically correct to satisfy the markdown linter.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/pre-commit-quality-checks.sh`:
- Around line 137-141: The case branch that matches files for Block 2 wrongly
exempts the new pre-commit wrapper scripts: locate the case "${file}" in ...
pattern and remove the token group
"scripts/pre-commit-quality-checks.sh|scripts/pre-commit-smart-checks.sh|scripts/pre-commit-verify-modules.sh|scripts/git-branch-module-signature-flag.sh)"
so those scripts are no longer treated as safe/ignored and will fall through
into the normal Block 2 checks; ensure the remaining file exemptions stay
unchanged.
In `@scripts/pre-commit-verify-modules.sh`:
- Around line 13-17: The git staged-files discovery masks failures by appending
"|| true" to the git diff command that sets staged_files; remove the "|| true"
fallback and instead detect errors from the git command (the git diff --cached
--name-only --diff-filter=ACMR invocation used to populate staged_files) and if
it fails, print a clear error (e.g., "Error discovering staged files") and exit
non-zero so the subsequent grep check on staged_files does not silently skip
verification; ensure the script still proceeds to the existing grep -qE
'^(src/specfact_cli/modules|modules)/' check only when staged_files was
populated successfully.
In `@tests/unit/scripts/test_pre_commit_verify_modules.py`:
- Around line 67-107: Add a new unit test that covers the "no-module-tree fast
path": create a repo using the existing helper _repo_with_verify_scripts but do
NOT stage modules (don’t run git add on modules/pkg.yaml or add a flag to
_repo_with_verify_scripts to skip staging), then invoke the wrapper script the
same way other tests do and assert it exits successfully and that the fake hatch
log (log_path created by _write_fake_hatch) contains no invocation of the verify
script (no "verify-modules-signature.py" / no hatch run entry). Reference
_repo_with_verify_scripts, _write_fake_hatch and the hatch log assertion used in
the other tests so the new test follows the same invocation/inspection pattern
as the existing tests.
---
Duplicate comments:
In `@CHANGELOG.md`:
- Around line 30-33: The markdown block that documents
`scripts/pre-commit-quality-checks.sh` contains bullet lines that exceed the
120-character limit; reflow those long lines so each line is <=120 characters
(wrap at logical boundaries like commas or after flags such as
`--payload-from-filesystem` and `--enforce-version-bump`), preserving the bullet
structure and punctuation, and ensure the sentence fragments remain readable and
grammatically correct to satisfy the markdown linter.
🪄 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: 80bc08a0-7c79-4f27-bf90-be172bfe18ea
📒 Files selected for processing (5)
CHANGELOG.mdscripts/pre-commit-quality-checks.shscripts/pre-commit-verify-modules.shtests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.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: Tests (Python 3.12)
- GitHub Check: Contract-First CI
- GitHub Check: Compatibility (Python 3.11)
- GitHub Check: Type Checking (basedpyright)
🧰 Additional context used
📓 Path-based instructions (8)
**/test_*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use@pytest.mark.asynciodecorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use@lru_cacheand Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.
tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oraclesSecret redaction via
LoggerSetup.redact_secretsmust be covered by unit tests
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
⚙️ CodeRabbit configuration file
tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
@(src|tests)/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Linting must pass with no errors using: pylint src tests
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality:hatch run format, (2) Type checking:hatch run type-check(basedpyright), (3) Contract-first approach: Runhatch run contract-testfor contract validation, (4) Run full test suite:hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have@icontractdecorators and@beartypetype checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments
Files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pytests/unit/scripts/test_pre_commit_verify_modules.py
**/*.{md,mdc}
📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)
**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files
Files:
CHANGELOG.md
CHANGELOG.md
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
Include new version entries at the top of CHANGELOG.md when updating versions
Update CHANGELOG.md with all code changes as part of version control requirements.
Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Files:
CHANGELOG.md
**/*.md
📄 CodeRabbit inference engine (.cursorrules)
Avoid markdown linting errors (refer to markdown-rules)
Files:
CHANGELOG.md
🧠 Learnings (30)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce 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 PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
Applied to files:
scripts/pre-commit-verify-modules.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Before executing ANY workflow command (`/opsx:ff`, `/opsx:apply`, `/opsx:continue`, etc.), perform the Pre-Execution Checklist: (1) Git Worktree - create if task creates branches/modifies code, (2) TDD Evidence - create `TDD_EVIDENCE.md` if behavior changes, (3) Documentation - include documentation research if changes affect user-facing behavior, (4) Module Signing - include signature verification if changes modify bundled modules, (5) Confirmation - state clearly that pre-execution checklist is complete and AGENTS.md compliance is confirmed
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Before implementing code changes, run `openspec validate <change-id> --strict` to validate the OpenSpec change and optionally run `/wf-validate-change <change-id>` for breaking-change and dependency analysis; do not proceed to implementation until validation passes or user explicitly overrides
Applied to files:
scripts/pre-commit-verify-modules.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Applied to files:
scripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Run `hatch run yaml-check-all` in CI and before pull requests to validate all YAML and workflow files
Applied to files:
scripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.{py,pyi} : After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: `hatch run format`, (2) Type checking: `hatch run type-check` (basedpyright), (3) Contract-first approach: Run `hatch run contract-test` for contract validation, (4) Run full test suite: `hatch test --cover -v`, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
Applied to files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pyscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.md : Avoid markdown linting errors (refer to markdown-rules)
Applied to files:
tests/unit/scripts/test_pre_commit_smart_checks_docs.pyCHANGELOG.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:ff` (Fast-Forward Change Creation): OPSX provides change scaffolding and artifact templates. AGENTS.md requires explicitly adding: Worktree creation task as Step 1 in tasks.md (not just 'create branch'), TDD_EVIDENCE.md tracking task in section 2 (Tests), Documentation research task per `openspec/config.yaml`, Module signing quality gate if applicable, Worktree cleanup steps in final section
Applied to files:
CHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to docs/**/*.md : Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Keep line length under 120 characters in markdown files
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Always finish each output by listing: (1) Which rulesets have been applied (e.g., `.cursorrules`, `AGENTS.md`, specific `.cursor/rules/*.mdc`), (2) Confirmation of Git Worktree Policy compliance (if applicable), (3) Which AI (LLM) provider and model version you are using
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce the clean-code review gate through `hatch run specfact code review run --json --out .specfact/code-review.json`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to **/*.{yml,yaml} : Format all YAML and workflow files using `hatch run yaml-fix-all` before committing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: After implementation, run quality gates (hatch run format, hatch run type-check, hatch run contract-test, hatch test or hatch run smart-test) to ensure all tests pass and contracts are satisfied
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Ensure proper escaping of special characters in markdown files
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Lines should not have trailing spaces (MD009: No Trailing Spaces)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Run contract-first validation locally before committing: `hatch run contract-test-contracts`, `hatch run contract-test-exploration`, and `hatch run contract-test-scenarios`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Record the contract or property that supersedes a removed test in the PR description
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to src/**/*.py : Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/*.py : Extract common patterns to avoid code duplication (DRY principle)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Format GitHub Actions workflows using `hatch run workflows-fmt` and lint them with `hatch run workflows-lint` after editing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/test_*.py : Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Applied to files:
tests/unit/scripts/test_pre_commit_verify_modules.py
🔀 Multi-repo context nold-ai/specfact-cli-modules
Linked repositories findings
nold-ai/specfact-cli-modules
-
.pre-commit-config.yaml defines modular hooks that call the new scripts:
- verify-module-signatures entry invokes verify-modules-signature.py with --require-signature --payload-from-filesystem --enforce-version-bump [::nold-ai/specfact-cli-modules::].
- Block 1/Block 2 hooks call ./scripts/pre-commit-quality-checks.sh with subcommands (block1-format, block1-yaml, block1-bundle, block1-lint, block2) [::nold-ai/specfact-cli-modules::].
- Top-level fail_fast: true present [::nold-ai/specfact-cli-modules::].
-
scripts/pre-commit-quality-checks.sh exists and implements the block1/block2/all pipeline:
- Implements staged-file detection, format safety check (hatch run format), YAML lint, bundle import checks, and lint when Python staged [::nold-ai/specfact-cli-modules::].
- Block 2 collects staged paths under packages/, registry/, scripts/, tools/, tests/, openspec/changes/ and runs pre_commit_code_review.py and contract-test/status as described in the PR summary [::nold-ai/specfact-cli-modules::].
- check_safe_change logic and staged path filtering present (skips Block 2 for docs-only/allowlisted changes) [::nold-ai/specfact-cli-modules::].
-
verify-modules-signature.py is referenced widely across docs and CI:
- README, multiple docs (docs/agent-rules, docs/authoring/module-signing.md), and .github/pr-orchestrator.yml all reference running verify-modules-signature.py with --require-signature --payload-from-filesystem --enforce-version-bump [::nold-ai/specfact-cli-modules::].
- pyproject.toml contains a hatch script entry for verify-modules-signature [::nold-ai/specfact-cli-modules::].
-
Tests and tooling reference the new scripts:
- tests/unit/test_pre_commit_quality_parity.py expects scripts/pre-commit-quality-checks.sh to exist and be used by pre-commit config [::nold-ai/specfact-cli-modules::].
- Other unit tests and TDD docs reference verify-modules-signature and contract-first test expectations [::nold-ai/specfact-cli-modules::].
Notes on missing files in this repo run
- The shell run could not read scripts/pre-commit-verify-modules.sh, scripts/git-branch-module-signature-flag.sh, or scripts/pre-commit-smart-checks.sh (sed reported they were not present). However, the repo does contain verify-modules-signature.py and pre-commit-quality-checks.sh and the pre-commit config already wired to the modular hooks above [::nold-ai/specfact-cli-modules::].
Conclusion
- specfact-cli-modules already expects and exercises the modular pre-commit layout and the verify-modules-signature tooling. The PR’s changes (new pre-commit-quality-checks.sh entrypoints and branch-aware verify wrapper) align with artifacts in this repo and will affect CI/docs/tests that validate invocation flags and hook wiring (notably presence or omission of --require-signature depending on branch). Existing docs/tests in this repo reference strict --require-signature usage in CI/README; the PR’s branch-aware wrapper needs to preserve those invocations on main while omitting on non-main as intended.
🔇 Additional comments (3)
scripts/pre-commit-verify-modules.sh (1)
27-39: Policy case-split is well hardened.Explicit
require|omithandling with a non-zero fallback for unknown output is the right trust-boundary behavior for long-term cross-repo policy parity.CHANGELOG.md (1)
15-42: Release-note structure now matches auditability requirements.Nice improvement: net-new capabilities are separated into Added and behavior/policy shifts are in Changed, which keeps the 0.46.1 entry traceable for downstream module repos and pre-commit parity checks.
Based on learnings, “Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements” and “Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change”.
tests/unit/scripts/test_pre_commit_smart_checks_docs.py (1)
16-27: Good hardening of the orchestration-order checks.Scoping these assertions to
run_all()andrun_block2()removes the old false positives from global string ordering and makes the tests match the runtime contract much more closely.Also applies to: 41-59
…skip test - check_safe_change: do not exempt pre-commit wrapper scripts from Block 2 when staged - pre-commit-verify-modules: fail if git diff --cached fails (no || true) - test: no-module-tree fast path; touch hatch log so skip path can assert empty - CHANGELOG: reflow + note git-diff failure handling and Block 2 exemption removal Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (1)
CHANGELOG.md (1)
20-20:⚠️ Potential issue | 🟡 MinorReflow overlong lines to satisfy markdown lint (
<=120).A few modified bullets still exceed the line-length rule; wrap at natural phrase boundaries.
As per coding guidelines, "Keep line length under 120 characters in markdown files."
Also applies to: 28-28, 33-34, 40-40
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CHANGELOG.md` at line 20, Several bullet lines in CHANGELOG.md (including the line mentioning `scripts/pre-commit-smart-checks.sh` and the bullets around lines 28, 33-34, and 40) exceed the markdown max line length; reflow those long bullets so no line is longer than 120 characters by wrapping at natural phrase boundaries (after commas or between logical phrases) and preserving words and Markdown punctuation, ensuring each wrapped line remains a valid list item and keeps the original meaning and emphasis.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 40-43: The changelog bullet describing "Pre-commit follow-ups" is
fix-oriented and should be moved from the "Changed" section into a new or
existing "### Fixed" subsection under the 0.46.1 entry; locate the bullet
referencing pre-commit-verify-modules.sh, pre-commit-quality-checks.sh, the
suppressed contract-test-status output, and the contract-first script existence
check, and relocate that entire bullet text into "### Fixed" (or create that
subsection if missing) so the fix-related behavior (fail closed, git diff
--cached handling, script test changes) is correctly classified.
In `@scripts/pre-commit-quality-checks.sh`:
- Around line 200-216: The run_format_safety function currently masks git diff
failures by using "git diff --binary -- . || true" for before_unstaged and
after_unstaged; change this so git diff errors are detected and cause the hook
to fail instead of producing empty strings—remove the "|| true" (or explicitly
check the exit code) when capturing before_unstaged and after_unstaged, and if
git diff returns a non-zero status, call error with a clear message and exit 1;
keep the existing comparison of before_unstaged and after_unstaged and the hatch
run format logic unchanged.
In `@tests/unit/scripts/test_pre_commit_verify_modules.py`:
- Around line 123-198: Add a new unit test that verifies the wrapper propagates
a failing `git diff --cached` (instead of swallowing it): use
_repo_with_verify_scripts(tmp_path) to build the repo, create a fake git
executable in tmp_path/"bin" that inspects its argv and returns non-zero only
when invoked as `git diff --cached` (otherwise delegates to the real git), make
it executable, run the wrapper (bash scripts/pre-commit-verify-modules.sh) with
env PATH pointing to tmp_path/"bin", and assert the process exit is non-zero and
that TOKEN_VERIFY_SCRIPT is not present in the log (ensuring hatch was not
invoked); follow the pattern from existing tests (env construction,
subprocess.run params) and name the test e.g.
test_verify_wrapper_propagates_git_diff_cached_failure.
- Around line 103-114: When stage_module_paths is False the test currently
creates and commits README.md which leaves the index empty and doesn't verify
the fast-path behavior for a staged non-module file; change the branch in
tests/unit/scripts/test_pre_commit_verify_modules.py so that instead of
committing README.md you create a non-module file (e.g., "docs/notes.txt" or
"non_module.txt"), write content to it, and run git add on that file only (no
commit) so the index contains a staged non-module path; update the logic around
the existing subprocess.run(["git", "add", "README.md"]) / git commit calls to
add but not commit the non-module file to prove the wrapper skips when a
non-module path is staged.
---
Duplicate comments:
In `@CHANGELOG.md`:
- Line 20: Several bullet lines in CHANGELOG.md (including the line mentioning
`scripts/pre-commit-smart-checks.sh` and the bullets around lines 28, 33-34, and
40) exceed the markdown max line length; reflow those long bullets so no line is
longer than 120 characters by wrapping at natural phrase boundaries (after
commas or between logical phrases) and preserving words and Markdown
punctuation, ensuring each wrapped line remains a valid list item and keeps the
original meaning and emphasis.
🪄 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: b9ce4376-1538-415b-9bd8-1961be1ae465
📒 Files selected for processing (4)
CHANGELOG.mdscripts/pre-commit-quality-checks.shscripts/pre-commit-verify-modules.shtests/unit/scripts/test_pre_commit_verify_modules.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Compatibility (Python 3.11)
- GitHub Check: Linting (ruff, pylint, safe-write guard)
- GitHub Check: Tests (Python 3.12)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{md,mdc}
📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)
**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files
Files:
CHANGELOG.md
CHANGELOG.md
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
Include new version entries at the top of CHANGELOG.md when updating versions
Update CHANGELOG.md with all code changes as part of version control requirements.
Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Files:
CHANGELOG.md
**/*.md
📄 CodeRabbit inference engine (.cursorrules)
Avoid markdown linting errors (refer to markdown-rules)
Files:
CHANGELOG.md
**/test_*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use@pytest.mark.asynciodecorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use@lru_cacheand Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.
tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oraclesSecret redaction via
LoggerSetup.redact_secretsmust be covered by unit tests
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
⚙️ CodeRabbit configuration file
tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
@(src|tests)/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Linting must pass with no errors using: pylint src tests
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality:hatch run format, (2) Type checking:hatch run type-check(basedpyright), (3) Contract-first approach: Runhatch run contract-testfor contract validation, (4) Run full test suite:hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have@icontractdecorators and@beartypetype checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
🧠 Learnings (35)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.md
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
Applied to files:
scripts/pre-commit-verify-modules.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Before executing ANY workflow command (`/opsx:ff`, `/opsx:apply`, `/opsx:continue`, etc.), perform the Pre-Execution Checklist: (1) Git Worktree - create if task creates branches/modifies code, (2) TDD Evidence - create `TDD_EVIDENCE.md` if behavior changes, (3) Documentation - include documentation research if changes affect user-facing behavior, (4) Module Signing - include signature verification if changes modify bundled modules, (5) Confirmation - state clearly that pre-execution checklist is complete and AGENTS.md compliance is confirmed
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Before implementing code changes, run `openspec validate <change-id> --strict` to validate the OpenSpec change and optionally run `/wf-validate-change <change-id>` for breaking-change and dependency analysis; do not proceed to implementation until validation passes or user explicitly overrides
Applied to files:
scripts/pre-commit-verify-modules.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Applied to files:
scripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:ff` (Fast-Forward Change Creation): OPSX provides change scaffolding and artifact templates. AGENTS.md requires explicitly adding: Worktree creation task as Step 1 in tasks.md (not just 'create branch'), TDD_EVIDENCE.md tracking task in section 2 (Tests), Documentation research task per `openspec/config.yaml`, Module signing quality gate if applicable, Worktree cleanup steps in final section
Applied to files:
scripts/pre-commit-verify-modules.shCHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Run `hatch run yaml-check-all` in CI and before pull requests to validate all YAML and workflow files
Applied to files:
scripts/pre-commit-verify-modules.shscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:apply` (Implementation): OPSX provides task iteration and progress tracking. AGENTS.md requires verification before each task: Confirm you are IN a worktree (not primary checkout) before modifying code, Record failing test evidence in `TDD_EVIDENCE.md` BEFORE implementing, Record passing test evidence AFTER implementation, Run quality gates from worktree (format, type-check, contract-test), GPG-signed commits (`git commit -S`), PR to `dev` branch (never direct push)
Applied to files:
scripts/pre-commit-verify-modules.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Keep line length under 120 characters in markdown files
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.md : Avoid markdown linting errors (refer to markdown-rules)
Applied to files:
CHANGELOG.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Always finish each output by listing: (1) Which rulesets have been applied (e.g., `.cursorrules`, `AGENTS.md`, specific `.cursor/rules/*.mdc`), (2) Confirmation of Git Worktree Policy compliance (if applicable), (3) Which AI (LLM) provider and model version you are using
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to docs/**/*.md : Update architecture documentation in docs/ for architecture changes, state machine documentation for FSM modifications, interface documentation for API changes, and configuration guides for configuration changes. DO NOT create internal docs in specfact-cli repo folder that should not be visible to end users; use the respective internal repository instead.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.{py,pyi} : After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: `hatch run format`, (2) Type checking: `hatch run type-check` (basedpyright), (3) Contract-first approach: Run `hatch run contract-test` for contract validation, (4) Run full test suite: `hatch test --cover -v`, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce the clean-code review gate through `hatch run specfact code review run --json --out .specfact/code-review.json`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to **/*.{yml,yaml} : Format all YAML and workflow files using `hatch run yaml-fix-all` before committing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:42:04.362Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/session_startup_instructions.mdc:0-0
Timestamp: 2026-04-10T22:42:04.362Z
Learning: After merges shipping OpenSpec- or GitHub-related work with a sibling `specfact-cli-internal` checkout present, run wiki scripts from that sibling repo's working directory (e.g., `cd ../specfact-cli-internal && python3 scripts/wiki_openspec_gh_status.py`), not from `specfact-cli` or other directories
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Ensure proper escaping of special characters in markdown files
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Lines should not have trailing spaces (MD009: No Trailing Spaces)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Run contract-first validation locally before committing: `hatch run contract-test-contracts`, `hatch run contract-test-exploration`, and `hatch run contract-test-scenarios`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Record the contract or property that supersedes a removed test in the PR description
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: After implementation, run quality gates (hatch run format, hatch run type-check, hatch run contract-test, hatch test or hatch run smart-test) to ensure all tests pass and contracts are satisfied
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to src/**/*.py : Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/*.py : Extract common patterns to avoid code duplication (DRY principle)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Applies to {src,tools}/**/*.{js,ts,jsx,tsx,py},**/*.test.{js,ts,jsx,tsx,py},**/*.spec.{js,ts,jsx,tsx,py} : Do not add, modify, or delete any application code in src/, tools/, tests, or significant docs until an OpenSpec change (new or delta) is created and validated, unless the user explicitly opts out with 'skip openspec', 'direct implementation', 'simple fix', or 'just fix it'
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:34.504Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T22:41:34.504Z
Learning: Treat clean-code regressions as blocking until they are fixed or explicitly justified
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Format GitHub Actions workflows using `hatch run workflows-fmt` and lint them with `hatch run workflows-lint` after editing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/test_*.py : Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Applied to files:
tests/unit/scripts/test_pre_commit_verify_modules.py
🔀 Multi-repo context nold-ai/specfact-cli-modules
Linked repositories findings
nold-ai/specfact-cli-modules
- .pre-commit config uses a modular, fail-fast layout and wires the verify-module-signatures hook to a shell wrapper:
- .pre-commit-config.yaml — hook id verify-module-signatures → entry ./scripts/pre-commit-verify-modules-signature.sh [::nold-ai/specfact-cli-modules::.pre-commit-config.yaml:7]
- pre-commit-quality-checks.sh is present and referenced by multiple Block 1/Block 2 hooks (format/yaml/bundle/lint/code-review):
- scripts/pre-commit-quality-checks.sh exists and is invoked from .pre-commit-config.yaml entries (modules-block1-*, modules-block2) [::nold-ai/specfact-cli-modules::scripts/pre-commit-quality-checks.sh; .pre-commit-config.yaml:17,24,30,37,43]
- The repository contains the verifier and related scripts; verifier supports payload-from-filesystem + enforce-version-bump and is referenced in docs/CI:
- scripts/verify-modules-signature.py — full verifier implementation; docs and workflows reference calling it with --payload-from-filesystem and --enforce-version-bump, and conditionally with --require-signature for main [::nold-ai/specfact-cli-modules::scripts/verify-modules-signature.py; .github/workflows/pr-orchestrator.yml:99; docs/reference/module-security.md:49]
- Wrapper naming: the repo's verify wrapper is named pre-commit-verify-modules-signature.sh (note the "-signature" suffix) and delegates to verify-modules-signature.py:
- scripts/pre-commit-verify-modules-signature.sh present and referenced in tests and .pre-commit-config.yaml [::nold-ai/specfact-cli-modules::scripts/pre-commit-verify-modules-signature.sh; .pre-commit-config.yaml:7]
- Tests and docs already expect the branch-aware policy: CI/spec and docs require omitting --require-signature off-main and enforcing it on main — the repo asserts parity with that behavior:
- openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md and related docs/test files assert the same branch rule and pre-commit behavior [::nold-ai/specfact-cli-modules::openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md; docs/authoring/module-signing.md]
Implication for the PR under review:
- The PR's new scripts and modular hook layout align with artifacts already present in specfact-cli-modules: pre-commit-quality-checks.sh, verify-modules-signature.py, and CI/docs expecting branch-aware --require-signature behavior. Reviewers should ensure naming/entrypoints match (e.g., pre-commit-verify-modules-signature.sh vs pre-commit-verify-modules.sh) and that the PR preserves the documented flags (--payload-from-filesystem, --enforce-version-bump) and branch policy (require on main, omit elsewhere) as exercised by tests/docs in this repo.
🔇 Additional comments (6)
scripts/pre-commit-verify-modules.sh (1)
1-43: LGTM — branch-aware module verification is well-structured.This wrapper correctly implements the marketplace-06 policy with proper fail-closed semantics:
- Strict mode (
set -euo pipefail) ensures pipeline failures surface immediately.- Git repo root and staged file discovery now fail explicitly rather than masking errors (addresses prior feedback).
- The
casedispatch onrequire/omitwith an explicit*fallback ensures unknown policy values don't silently degrade enforcement.- CR/LF sanitization (lines 28-29) is good defensive coding for cross-platform flag script output.
The design aligns with the linked
specfact-cli-modulesrepo's branch-aware behavior:--require-signatureonmain, checksum-only elsewhere, and--enforce-version-bumpalways present per the learnings about enforcing module signatures and version bumps.scripts/pre-commit-quality-checks.sh (5)
130-154: LGTM — Block 2 skip logic now correctly includes pre-commit scripts in the review surface.The prior exemption for
scripts/pre-commit-quality-checks.sh,scripts/pre-commit-smart-checks.sh,scripts/pre-commit-verify-modules.sh, andscripts/git-branch-module-signature-flag.shhas been removed, ensuring these trust-boundary scripts now trigger the code review and contract test gates when staged. This aligns with the linkedspecfact-cli-modulesrepo where stagedscripts/changes are part of the Block 2 surface.The remaining exemptions (version metadata, docs, workflows, test tooling infrastructure) are reasonable for a "safe change" classification that skips the heavier Block 2 gates.
46-102: LGTM — staged file helpers now use robust iteration patterns.The
staged_files()function correctly uses--diff-filter=ACMRto exclude deleted files (addressing the prior feedback about downstream failures when passing non-existent paths to tools).All iteration over staged files uses
while IFS= read -r lineloops, which correctly handles filenames with spaces, special characters, and empty lines. Thestaged_markdown_files()andstaged_review_gate_files()functions follow the same safe pattern.
232-291: LGTM — Markdown handling uses portable array patterns.The switch from
xargs -rtomapfile -twith direct array expansion ("${md_files[@]}") addresses the prior portability concern for BSD/macOS environments. Thefail_if_markdown_has_unstaged_hunks()guard (line 244) is a thoughtful safety check before auto-fixing.The
npx --yes markdownlint-clifallback (lines 254, 284) provides developer convenience at the cost of first-run latency, with a helpful hint at line 259 to install globally for faster subsequent runs. This is a reasonable trade-off for a pre-commit hook.
414-434: LGTM —run_allpipeline ordering is architecturally sound.The execution order correctly prioritizes trust-boundary checks:
- Module signature verification first — ensures bundled module integrity before any code transformation.
- Version sources synchronization — catches version drift early when version files are staged.
- Block 1 stages — format, lint, and validation gates that are fast and file-type scoped.
- Block 2 gates — heavier code review and contract tests, with safe-change skip logic applied only after Block 1 completes.
The
check_contract_script_exists()helper extraction (line 432) centralizes the existence check as suggested in prior feedback, improving maintainability.This design provides good incremental feedback during commit preparation while ensuring the trust-critical checks run unconditionally.
322-368: LGTM — Block 2 gates are well-implemented.The
run_code_review_gate()function correctly:
- Builds an array of staged paths matching the review-eligible prefixes (
src/,scripts/,tools/,tests/,openspec/changes/).- Passes the array to
scripts/pre_commit_code_review.pywhich handles Python-file filtering internally.- Provides actionable error messages on failure.
The
run_contract_tests_visible()function now includes the explanatory comment (lines 346-347) clarifying whycontract-test-statusoutput is suppressed — transient environmental noise shouldn't alarm developers when the fallback to fullhatch run contract-testwill surface real failures.
…y tests - Move pre-commit follow-ups under 0.46.1 ### Fixed; note git diff exit >1 handling - run_format_safety: fail only when git diff exit code > 1 (keep diff=1 as success) - Test: fake git fails on diff --cached; skip-path uses staged docs/notes.txt only Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 34-39: The rename of
scripts/pre-commit-verify-modules-signature.sh to
scripts/pre-commit-verify-modules.sh breaks downstream specfact-cli-modules
references (check .pre-commit-config.yaml) and tests
test_pre_commit_verify_modules_signature_script.py and
test_pre_commit_quality_parity.py; either restore the original canonical wrapper
name or create a compatibility shim (a symlink or small delegating script named
pre-commit-verify-modules-signature.sh that invokes
pre-commit-verify-modules.sh) and then update specfact-cli-modules to
consistently reference pre-commit-verify-modules.sh across its
.pre-commit-config.yaml, docs, and tests so unit tests and hook entries remain
valid.
In `@scripts/pre-commit-quality-checks.sh`:
- Around line 72-102: The markdown file matchers only check for “.md” and thus
miss “.mdc” files; update has_staged_markdown, has_staged_python (if
applicable), and staged_markdown_files to treat both .md and .mdc (e.g., change
the regex from \.md$ to \.(md|mdc)$), and update any user-facing skip/skip-text
messages and the safe-change allowlist pattern to reference both extensions
(e.g., /*.{md,mdc}) and ensure special characters are properly escaped in those
patterns/strings; use the function names has_staged_markdown and
staged_markdown_files to locate the changes and also update the docs-only
safe-change allowlist entry that mentions “no staged *.md” to include “*.mdc”.
- Around line 137-139: The script scripts/pre-commit-quality-checks.sh currently
treats "pyproject.toml" and "setup.py" as safe-change-only files in the case
"${file}" allowlist (and the duplicate allowlists at the other occurrences),
which skips Block 2 checks; remove "pyproject.toml" and "setup.py" from those
case patterns (and any identical allowlist blocks at the other occurrences
referenced) so edits to those files run the full checks, or alternatively make
the fast-path logic diff-aware if you intend to keep them on the fast path.
- Around line 184-197: The run_module_signature_verification function currently
calls only scripts/pre-commit-verify-modules.sh which breaks compatibility with
older parity entrypoints; update the function to try the primary script and if
missing/fails, fall back to scripts/pre-commit-verify-modules-signature.sh (or
look for either and run the first existing one), and log which script was
executed; reference the function name run_module_signature_verification and the
two script names so the change locates the call site and adds the fallback/shim
behavior and appropriate success/error messages.
- Around line 248-249: The pre-commit hook uses the Bash-only builtin mapfile
(in run_markdown_autofix_if_needed and run_markdown_lint_if_needed) which breaks
on Bash 3.2; replace each mapfile usage that populates md_files with a
POSIX/Bash‑3.2 compatible loop: read the output of staged_markdown_files using
the same pattern already used elsewhere (while IFS= read -r line || [[ -n
"$line" ]]; do md_files+=("$line"); done < <(staged_markdown_files)) so both
functions match the staged_markdown_files implementation and avoid mapfile.
In `@tests/unit/scripts/test_pre_commit_verify_modules.py`:
- Around line 16-17: Add a unit test that verifies the legacy entrypoint
delegates to the new wrapper: create a test (e.g.,
test_pre_commit_verify_modules_legacy_entrypoint) that locates the legacy script
path (REPO_ROOT / "scripts" / "pre-commit-verify-modules-signature.sh") and
asserts it exists and either is a symlink to VERIFY_WRAPPER or, when executed
(via subprocess.run or by invoking the script's shell), produces the same exit
code/output as calling VERIFY_WRAPPER (or explicitly calls VERIFY_WRAPPER by
mocking subprocess.run to capture calls); update existing tests around
FLAG_SCRIPT and VERIFY_WRAPPER to include this compatibility assertion so
downstream repos relying on the legacy path are covered.
- Around line 84-138: _repo_with_verify_scripts currently always stages only
"modules/pkg.yaml" so tests miss the bundled-tree path under
src/specfact_cli/modules/; update _repo_with_verify_scripts to accept a
parameter (e.g., staged_module_root or module_root_path) and use it to stage
either "modules/" or "src/specfact_cli/modules/" as requested, create the
corresponding directory and a pkg.yaml in that root, and adjust callers in the
test file to run parameterized cases that cover on-main and off-main behavior
for both roots so pre-commit-verify-modules.sh is exercised for the bundled-tree
path as well as the top-level modules path.
🪄 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: 0e987e7f-ef38-4d0b-a17c-1746fd4686ce
📒 Files selected for processing (3)
CHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.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). (2)
- GitHub Check: Compatibility (Python 3.11)
- GitHub Check: Tests (Python 3.12)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{md,mdc}
📄 CodeRabbit inference engine (.cursor/rules/markdown-rules.mdc)
**/*.{md,mdc}: Do not use more than one consecutive blank line anywhere in the document (MD012: No Multiple Consecutive Blank Lines)
Fenced code blocks should be surrounded by blank lines (MD031: Fenced Code Blocks)
Lists should be surrounded by blank lines (MD032: Lists)
Files must end with a single empty line (MD047: Files Must End With Single Newline)
Lines should not have trailing spaces (MD009: No Trailing Spaces)
Use asterisks (**) for strong emphasis, not underscores (__) (MD050: Strong Style)
Fenced code blocks must have a language specified (MD040: Fenced Code Language)
Headers should increment by one level at a time (MD001: Header Increment)
Headers should be surrounded by blank lines (MD022: Headers Should Be Surrounded By Blank Lines)
Only one top-level header (H1) is allowed per document (MD025: Single H1 Header)
Use consistent list markers, preferring dashes (-) for unordered lists (MD004: List Style)
Nested unordered list items should be indented consistently, typically by 2 spaces (MD007: Unordered List Indentation)
Use exactly one space after the list marker (e.g., -, *, +, 1.) (MD030: Spaces After List Markers)
Use incrementing numbers for ordered lists (MD029: Ordered List Item Prefix)
Enclose bare URLs in angle brackets or format them as links (MD034: Bare URLs)
Don't use spaces immediately inside code spans (MD038: Spaces Inside Code Spans)
Use consistent indentation (usually 2 or 4 spaces) throughout markdown files
Keep line length under 120 characters in markdown files
Use reference-style links for better readability in markdown files
Use a trailing slash for directory paths in markdown files
Ensure proper escaping of special characters in markdown files
Files:
CHANGELOG.md
CHANGELOG.md
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
Include new version entries at the top of CHANGELOG.md when updating versions
Update CHANGELOG.md with all code changes as part of version control requirements.
Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Files:
CHANGELOG.md
**/*.md
📄 CodeRabbit inference engine (.cursorrules)
Avoid markdown linting errors (refer to markdown-rules)
Files:
CHANGELOG.md
**/test_*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/test_*.py: Write tests first in test-driven development (TDD) using the Red-Green-Refactor cycle
Ensure each test is independent and repeatable with no shared state between tests
Organize Python imports in tests using unittest.mock for Mock and patch
Use setup_method() for test initialization and Arrange-Act-Assert pattern in test files
Use@pytest.mark.asynciodecorator for async test functions in Python
Organize test files in structure: tests/unit/, tests/integration/, tests/e2e/ by module
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/python-github-rules.mdc)
**/*.py: Maintain minimum 80% test coverage, with 100% coverage for critical paths in Python code
Use clear naming and self-documenting code, preferring clear names over comments
Ensure each function/class has a single clear purpose (Single Responsibility Principle)
Extract common patterns to avoid code duplication (DRY principle)
Apply SOLID object-oriented design principles in Python code
Use type hints everywhere in Python code and enable basedpyright strict mode
Use Pydantic models for data validation and serialization in Python
Use async/await for I/O operations in Python code
Use context managers for resource management in Python
Use dataclasses for simple data containers in Python
Enforce maximum line length of 120 characters in Python code
Use 4 spaces for indentation in Python code (no tabs)
Use 2 blank lines between classes and 1 blank line between methods in Python
Organize imports in order: Standard library → Third party → Local in Python files
Use snake_case for variables and functions in Python
Use PascalCase for class names in Python
Use UPPER_SNAKE_CASE for constants in Python
Use leading underscore (_) for private methods in Python classes
Use snake_case for Python file names
Enable basedpyright strict mode with strict type checking configuration in Python
Use Google-style docstrings for functions and classes in Python
Include comprehensive exception handling with specific exception types in Python code
Use logging with structured context (extra parameters) instead of print statements
Use retry logic with tenacity decorators (@retry) for operations that might fail
Use Pydantic BaseSettings for environment-based configuration in Python
Validate user input using Pydantic validators in Python models
Use@lru_cacheand Redis-based caching for expensive calculations in Python
Run code formatting with Black (120 character line length) and isort in Python
Run type checking with basedpyright on all Python files
Run linting with ruff and pylint on all Pyth...
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
tests/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Tests must be meaningful and test actual functionality, cover both success and failure cases, be independent and repeatable, and have clear, descriptive names. NO EXCEPTIONS - no placeholder or empty tests.
tests/**/*.py: Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Delete tests that only assert input validation, datatype/shape enforcement, or raises on negative conditions now guarded by contracts and runtime typing
Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oraclesSecret redaction via
LoggerSetup.redact_secretsmust be covered by unit tests
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
⚙️ CodeRabbit configuration file
tests/**/*.py: Contract-first testing: meaningful scenarios, not redundant assertions already covered by
contracts. Flag flakiness, environment coupling, and missing coverage for changed behavior.
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
@(src|tests)/**/*.py
📄 CodeRabbit inference engine (.cursor/rules/spec-fact-cli-rules.mdc)
Linting must pass with no errors using: pylint src tests
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{py,pyi}: After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality:hatch run format, (2) Type checking:hatch run type-check(basedpyright), (3) Contract-first approach: Runhatch run contract-testfor contract validation, (4) Run full test suite:hatch test --cover -v, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
All public APIs must have@icontractdecorators and@beartypetype checking
Use Pydantic models for all data structures with data validation
Only write high-value comments if at all. Avoid talking to the user through comments
Files:
tests/unit/scripts/test_pre_commit_verify_modules.py
🧠 Learnings (32)
📓 Common learnings
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Enforce module signatures and version bumps when signed module assets or manifests are affected
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md with all code changes as part of version control requirements.
Applied to files:
CHANGELOG.md
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to CHANGELOG.md : Update CHANGELOG.md to document all significant changes under Added, Fixed, Changed, or Removed sections when making a version change
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:ff` (Fast-Forward Change Creation): OPSX provides change scaffolding and artifact templates. AGENTS.md requires explicitly adding: Worktree creation task as Step 1 in tasks.md (not just 'create branch'), TDD_EVIDENCE.md tracking task in section 2 (Tests), Documentation research task per `openspec/config.yaml`, Module signing quality gate if applicable, Worktree cleanup steps in final section
Applied to files:
CHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to openspec/changes/**/*.md : For `/opsx:archive` (Archive change): Include module signing and cleanup in final tasks. Agents MUST run `openspec archive <change-id>` from repo root (no manual `mv` under `openspec/changes/archive/`)
Applied to files:
CHANGELOG.mdtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Keep line length under 120 characters in markdown files
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Before executing ANY workflow command (`/opsx:ff`, `/opsx:apply`, `/opsx:continue`, etc.), perform the Pre-Execution Checklist: (1) Git Worktree - create if task creates branches/modifies code, (2) TDD Evidence - create `TDD_EVIDENCE.md` if behavior changes, (3) Documentation - include documentation research if changes affect user-facing behavior, (4) Module Signing - include signature verification if changes modify bundled modules, (5) Confirmation - state clearly that pre-execution checklist is complete and AGENTS.md compliance is confirmed
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.md : Avoid markdown linting errors (refer to markdown-rules)
Applied to files:
CHANGELOG.mdscripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: When creating implementation plans, task lists, or OpenSpec tasks.md, ALWAYS explicitly verify and include: (1) Worktree creation from `origin/dev` (not `git checkout -b`), (2) `hatch env create` in the worktree, (3) Pre-flight checks (`hatch run smart-test-status`, `hatch run contract-test-status`), (4) Worktree cleanup steps post-merge, (5) Self-check: 'Have I followed AGENTS.md Git Worktree Policy section?'
Applied to files:
CHANGELOG.mdscripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Always finish each output by listing: (1) Which rulesets have been applied (e.g., `.cursorrules`, `AGENTS.md`, specific `.cursor/rules/*.mdc`), (2) Confirmation of Git Worktree Policy compliance (if applicable), (3) Which AI (LLM) provider and model version you are using
Applied to files:
CHANGELOG.md
📚 Learning: 2026-04-10T22:41:26.519Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-04-10T22:41:26.519Z
Learning: Enforce the clean-code review gate through `hatch run specfact code review run --json --out .specfact/code-review.json`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: Applies to **/*.{py,pyi} : After any code changes, follow these steps in order: (1) Apply linting and formatting to ensure code quality: `hatch run format`, (2) Type checking: `hatch run type-check` (basedpyright), (3) Contract-first approach: Run `hatch run contract-test` for contract validation, (4) Run full test suite: `hatch test --cover -v`, (5) Verify all tests pass and contracts are satisfied, (6) Fix any issues and repeat steps until all tests pass
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Run `hatch run yaml-check-all` in CI and before pull requests to validate all YAML and workflow files
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to **/*.{yml,yaml} : Format all YAML and workflow files using `hatch run yaml-fix-all` before committing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Before making a pull request, locally run format, lint, contract tests, and full test suite: `hatch run format`, `hatch run lint`, `hatch run contract-test`, `hatch test --cover -v`
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: After implementation, run quality gates (hatch run format, hatch run type-check, hatch run contract-test, hatch test or hatch run smart-test) to ensure all tests pass and contracts are satisfied
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: All development work MUST use git worktrees per AGENTS.md Git Worktree Policy. Never create branches with `git checkout -b` in the primary checkout. Create worktree from origin/dev: `git worktree add ../specfact-cli-worktrees/<type>/<slug> -b <branch-name> origin/dev` where allowed types are: `feature/`, `bugfix/`, `hotfix/`, `chore/`. Forbidden in worktrees: `dev`, `main`. After creating worktree: `cd ../specfact-cli-worktrees/<type>/<slug>`. Bootstrap Hatch in worktree: `hatch env create`. Run pre-flight checks: `hatch run smart-test-status` and `hatch run contract-test-status`. Do all implementation work from the worktree, never from primary checkout. After PR merge: cleanup with `git worktree remove`, `git branch -d`, `git worktree prune`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Validate GitHub workflow files using `hatch run lint-workflows` before committing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Ensure proper escaping of special characters in markdown files
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:08.987Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/markdown-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:08.987Z
Learning: Applies to **/*.{md,mdc} : Lines should not have trailing spaces (MD009: No Trailing Spaces)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Run contract-first validation locally before committing: `hatch run contract-test-contracts`, `hatch run contract-test-exploration`, and `hatch run contract-test-scenarios`
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Record the contract or property that supersedes a removed test in the PR description
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:57.944Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/spec-fact-cli-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:57.944Z
Learning: Applies to src/**/*.py : Test Coverage Validation: Run hatch run smart-test-unit for modified files, hatch run smart-test-folder for modified directories, and hatch run smart-test-full before committing. ALL TESTS MUST PASS.
Applied to files:
scripts/pre-commit-quality-checks.shtests/unit/scripts/test_pre_commit_verify_modules.py
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Trim low-value unit tests when a contract covers the same assertion (type/shape/raises on negative checks)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to tests/**/*.py : Convert repeated edge-case permutations into one Hypothesis property with contracts acting as oracles
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:32:29.182Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/python-github-rules.mdc:0-0
Timestamp: 2026-03-25T21:32:29.182Z
Learning: Applies to **/*.py : Extract common patterns to avoid code duplication (DRY principle)
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:54.419Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/automatic-openspec-workflow.mdc:0-0
Timestamp: 2026-04-10T22:41:54.419Z
Learning: Applies to {src,tools}/**/*.{js,ts,jsx,tsx,py},**/*.test.{js,ts,jsx,tsx,py},**/*.spec.{js,ts,jsx,tsx,py} : Do not add, modify, or delete any application code in src/, tools/, tests, or significant docs until an OpenSpec change (new or delta) is created and validated, unless the user explicitly opts out with 'skip openspec', 'direct implementation', 'simple fix', or 'just fix it'
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:34.504Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-10T22:41:34.504Z
Learning: Treat clean-code regressions as blocking until they are fixed or explicitly justified
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:42:21.849Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-10T22:42:21.849Z
Learning: Fix SpecFact code review findings, including warnings, unless a rare explicit exception is documented
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:15.296Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/testing-and-build-guide.mdc:0-0
Timestamp: 2026-03-25T21:33:15.296Z
Learning: Applies to **/*.{yml,yaml} : Validate YAML configuration files locally using `hatch run yaml-lint` before committing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-03-25T21:33:22.650Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursor/rules/yaml-and-workflows.md:0-0
Timestamp: 2026-03-25T21:33:22.650Z
Learning: Applies to .github/workflows/*.{yml,yaml} : Format GitHub Actions workflows using `hatch run workflows-fmt` and lint them with `hatch run workflows-lint` after editing
Applied to files:
scripts/pre-commit-quality-checks.sh
📚 Learning: 2026-04-10T22:41:19.077Z
Learnt from: CR
Repo: nold-ai/specfact-cli PR: 0
File: .cursorrules:0-0
Timestamp: 2026-04-10T22:41:19.077Z
Learning: For `/opsx:apply` (Implementation): OPSX provides task iteration and progress tracking. AGENTS.md requires verification before each task: Confirm you are IN a worktree (not primary checkout) before modifying code, Record failing test evidence in `TDD_EVIDENCE.md` BEFORE implementing, Record passing test evidence AFTER implementation, Run quality gates from worktree (format, type-check, contract-test), GPG-signed commits (`git commit -S`), PR to `dev` branch (never direct push)
Applied to files:
tests/unit/scripts/test_pre_commit_verify_modules.py
🔀 Multi-repo context nold-ai/specfact-cli-modules
Linked repositories findings
nold-ai/specfact-cli-modules
-
.pre-commit config uses the modular, fail-fast layout and invokes the verify hook via:
- .pre-commit-config.yaml: entry: ./scripts/pre-commit-verify-modules-signature.sh [::nold-ai/specfact-cli-modules::.pre-commit-config.yaml:9]
-
The canonical verifier and wrapper scripts exist and are exercised in tests/docs:
- scripts/verify-modules-signature.py — verifier implementation supporting --payload-from-filesystem and --enforce-version-bump (present) [::nold-ai/specfact-cli-modules::scripts/verify-modules-signature.py]
- scripts/pre-commit-verify-modules-signature.sh — wrapper that decides whether to add --require-signature (uses GITHUB_BASE_REF / branch detection) and execs verifier with or without --require-signature [::nold-ai/specfact-cli-modules::scripts/pre-commit-verify-modules-signature.sh]
-
The repo contains the Block 1/Block 2 quality pipeline and hook entrypoints:
- scripts/pre-commit-quality-checks.sh — implements block1-format, block1-yaml, block1-bundle, block1-lint, block2, and all [::nold-ai/specfact-cli-modules::scripts/pre-commit-quality-checks.sh]
- .pre-commit-config.yaml hooks call pre-commit-quality-checks.sh for block1-* and block2 (see entries) [::nold-ai/specfact-cli-modules::.pre-commit-config.yaml:17,24,30,37,43]
-
Policy parity and docs/tests:
- The repository docs and openspec require the branch-aware policy: omit --require-signature off-main; require on main (CI and pre-commit mirror this) [::nold-ai/specfact-cli-modules::docs/reference/module-security.md; ::openspec/changes/marketplace-06-ci-module-signing/specs/ci-integration/spec.md]
- Tests reference the modular quality layout and the verify wrapper name pre-commit-verify-modules-signature.sh (unit tests and workflow tests expect that name) [::nold-ai/specfact-cli-modules::tests/unit/test_pre_commit_quality_parity.py; ::tests/unit/test_pre_commit_verify_modules_signature_script.py]
Potential cross-repo issue to surface in review
- Naming/entrypoint mismatch risk: this PR adds scripts named pre-commit-verify-modules.sh and scripts/git-branch-module-signature-flag.sh (per PR description), while specfact-cli-modules uses pre-commit-verify-modules-signature.sh and references verify-modules-signature.py. Ensure the PR preserves the expected wrapper name or provides compatible shim/updates downstream repos/tests that reference pre-commit-verify-modules-signature.sh so they still find the hook entrypoint and flags (--payload-from-filesystem, --enforce-version-bump) [::nold-ai/specfact-cli-modules::.pre-commit-config.yaml; ::nold-ai/specfact-cli-modules::scripts/pre-commit-verify-modules-signature.sh; ::nold-ai/specfact-cli-modules::scripts/verify-modules-signature.py]
Conclusion: relevant cross-repo artifacts found (verifier script, quality pipeline, pre-commit config, tests/docs asserting branch-aware --require-signature). Review should verify hook filenames/entrypoints and preserved flags/branch policy to avoid breaking consumers/tests. [::nold-ai/specfact-cli-modules::]
🔇 Additional comments (3)
tests/unit/scripts/test_pre_commit_verify_modules.py (1)
159-179: Good edge-path coverage here.The
git diff --cachedhard-failure case and detached-HEAD fallback are exactly the branches that tend to regress first; keeping both in this file materially strengthens the wrapper contract.Also applies to: 257-268
CHANGELOG.md (2)
13-33: Release-note taxonomy is now correctly structured for 0.46.1.Good split into Added / Fixed / Changed with concrete script-level traceability; this is auditable and release-friendly.
40-48: Scope and behavior notes are clear and sufficiently specific.The staged-file gating and docs/OpenSpec alignment callouts are precise and useful for operator/developer traceability.
- Add pre-commit-verify-modules-signature.sh delegating to canonical verify - run_module_signature_verification: prefer canonical, fallback legacy, log path - Treat staged *.mdc like *.md; replace mapfile for Bash 3.2; drop pyproject/setup from Block 2 safe-change skip; extend tests for bundled module tree + legacy - Split pre-commit layout assertions to satisfy code-review complexity gate Made-with: Cursor
* fix(version): sync manifests to 0.36.1 and archive backlog-core-04 (#297) * fix(backlog): restore installed runtime discovery and add backlog prompt * Archive bugfix change * fix(version): sync built-in module manifests to 0.36.1 --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden module lifecycle bootstrap and signing workflows (#299) * fix: harden module lifecycle bootstrap and signing workflows * fix: stabilize module signature hashing across environments * fix: stabilize bundle module signature verification in CI --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * test: simplify monkeypatch callables in module_security tests * Fix duplicate with statement * chore(release): bump to v0.37.1 and harden signature gates * test: fix init command regression assertions * fix: release v0.37.2 with runtime crypto deps * fix: address signature-backend warning and module version drift * fix: use hatch build in PyPI publish workflow script (#304) * fix: resolve startup module freshness home path dynamically (#306) * fix: harden module signing workflow and reduce startup log noise * test: align module migration compatibility with decoupled module versions * fix: fail fast on invalid base ref in changed-only module signing * fix: stabilize module precedence and backlog github mapping flow * fix(module-registry): persist disables and correct bundled availability * Re-sign module registry and fix / ignore local temp artifacts * bump module registry version to 0.1.3 * fix(registry): restore protocol reporting logs in debug mode * fix(backlog): harden refine writeback, prompts, and any-filter semantics (#311) * fix(backlog): harden refine writeback, prompts, and daily any filters * fix(github): default story type fallback to feature * Fix format * Fix codex review findings * bump and sign changed modules * chore(hooks): enforce module signature verification in pre-commit * chore(hooks): add markdownlint to pre-commit checks --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix(hooks,ado): correct format gate and enforce iteration on direct id lookup * Apply review findings and fix tests * Pin virtualenv < 21 to avoid incaopatibility failure * fix: finalize backlog-core-06 ado comment API versioning (#314) * fix(backlog): harden refine writeback, prompts, and daily any filters * fix(github): default story type fallback to feature * Fix format * Fix codex review findings * bump and sign changed modules * chore(hooks): enforce module signature verification in pre-commit * chore(hooks): add markdownlint to pre-commit checks * fix: finalize backlog-core-06 ado comment api versioning and ci hatch pins * fix: address review findings for formatter safety and ado metric patch guards * docs(openspec): update CHANGE_ORDER status tracking * fix(ado): apply iteration filter for direct issue_id lookup --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: Advanced marketplace features (marketplace-02) - dependency resolution, aliases, custom registries, publishing (#318) * feat: advanced marketplace features (marketplace-02) - dependency resolution, aliases, custom registries, namespace enforcement, publishing - dependency_resolver: resolve_dependencies(), --skip-deps, --force on install - alias_manager: alias create/list/remove (no top-level alias commands) - custom_registries: add-registry, list-registries, remove-registry; fetch_all_indexes; search Registry column - module_installer: namespace/name enforcement, collision detection - scripts/publish-module.py + .github/workflows/publish-modules.yml (optional signing) - docs: publishing-modules, custom-registries, dependency-resolution; updated installing-modules, module-marketplace, commands - version 0.38.0, CHANGELOG Made-with: Cursor * docs(openspec): defer 6.2.4 and 6.2.5 (index update/PR, workflow test) to later Made-with: Cursor * Add follow-up change proposals for marketplace * Fix codex review findings --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: complete marketplace publish registry PR flow and bump (#320) 0.38.1 Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: update init ide hint and repair publish workflow condition * feat(backlog): normalize daily summarize Markdown output (#323) * feat(backlog): summarize Markdown normalization and TTY/CI rendering * chore(openspec): drop implementation snapshot from change * Update title --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update version * Add github skills * Add new marketplace changes * feat(cli): category groups and flat shims using real module Typer (#331) * feat(cli): category groups and flat shims using real module Typer - Add category groups (code, backlog, project, spec, govern) with flatten same-name member - Sort commands under backlog/project groups A–Z - Fix flat shims to expose real module Typer so 'specfact sync bridge' and 'specfact plan update-idea' work - Add first-run init, module grouping, OpenSpec change for 0.40.x remove-flat-shims - Bump version to 0.39.0, CHANGELOG and OpenSpec updates Made-with: Cursor * Fix signature * fix: resolve module grouping regressions and stabilize CI tests * fix: keep uncategorized modules flat during grouped registration --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update docs regarding module migration change * feat: module-migration-02 bundle extraction (#332) * docs: add module-migration-02-bundle-extraction to CHANGE_ORDER.md * feat: implement module-migration-02 bundle extraction * fix(ci): checkout module bundles repo for test jobs * Fix test failures * fix(modules): load local bundle sources in compatibility aliases * fix: run worktree policy code in tests/CI and silence reexport deprecation - Prefer src/<name>/main.py over app.py when SPECFACT_REPO_ROOT is set so policy init uses worktree templates.py (SPECFACT_POLICY_TEMPLATES_DIR). - Policy engine module-package.yaml: version 0.1.5 and re-signed checksum. - conftest: set SPECFACT_REPO_ROOT, SPECFACT_POLICY_TEMPLATES_DIR; add bundle package roots when specfact-cli-modules present. - Policy engine integration tests: rely on conftest env, clear registry and re-register before invoke so loader uses worktree. - test_reexport_shims: filter deprecation warning for legacy analyze import. Made-with: Cursor * fix: defer specfact_backlog import in shims so CI can register bridges - backlog and policy_engine __init__.py: import specfact_backlog only in __getattr__ (cached), not at module load. Allows loading .src.adapters.* for bridge registration without requiring specfact_backlog installed. - Re-sign backlog and policy_engine module-package.yaml after init changes. - openspec: update module-migration-02 tasks.md. Made-with: Cursor * fix: defer bundle import in all module shims to fix CI collection errors - Apply deferred import (only in __getattr__, cached) to analyze, contract, drift, enforce, generate, import_cmd, migrate, patch_mode, plan, project, repro, sdd, spec, sync, validate. Matches backlog and policy_engine. - Prevents ImportError when tests import specfact_cli.modules.<name>.src.* without specfact_backlog/specfact_govern/specfact_project/specfact_spec installed (e.g. CI). Fixes 78 collection errors. - Re-sign all affected module-package.yaml manifests. Made-with: Cursor * fix(ci): include module shims in hatch cache key so CI uses current code * feat(modules): registry descriptions, --bump-version for publish, tasks and format fixes - Add description to registry index entries in publish-module.py (module search) - Add --bump-version patch|minor|major for bundle re-publish in publish-module.py - Format fixes in validate-modules-repo-sync.py (SIM108, B007) - Mark completed tasks in module-migration-02-bundle-extraction tasks.md - Update test for publish_bundle(bump_version=) signature Made-with: Cursor * Add missing migration tasks to the open change to completely isolate modules into specfact-cli-modules repo. * Add gap analysis and update changes * Update follow-up changes to avoid ambiguities and overlaps * docs: complete migration-02 section-18 parity and 17.8 gate evidence * docs: mark migration-02 import-categorization commit checkpoint done * Update change constraints and blockers for module migration * docs: add migration-05 issue #334 and complete task 17.10.4 * Update change constraints and blockers for module migration --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Implement blockers to prepare for module-migration-03 change. (#336) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: module-migration-03 core slimming closeout and registry fixes (#317) (#341) * Prepare module-migration-03 removal of old built-in modules * feat(core): delete specfact-project module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-backlog module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-codebase module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-spec module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-govern module source from core (migration-03) Made-with: Cursor * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Finalize module-migration-02 change * docs(backlog-auth): update auth docs and OpenSpec task status (#342) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * chore(openspec): archive completed changes and sync main specs * docs(openspec): prefix module migration proposal titles with IDs * Add bug change for ado required fields setting and update change order * Update change order * feat(core): finalize migration-03 auth removal and 3-core slim package (#317) (#343) * Prepare module-migration-03 removal of old built-in modules * feat(core): delete specfact-project module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-backlog module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-codebase module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-spec module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-govern module source from core (migration-03) Made-with: Cursor * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests * Prepare module-migration-03 removal of old built-in modules * Prepare module-migration-03 removal of old built-in modules * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests * feat(core): remove auth module from core and route auth via backlog (migration-03) * docs(openspec): update migration-03 PR status and tracking * docs(openspec): finalize migration-03 checklist and defer non-blocking gates * Fix remaining auth findings and dependency in core cli --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive module-migration-03 change * feat: remove flat command shims (category-only CLI) (#344) * feat: remove flat command shims from grouped registry * Finalize change module-migration-04 implementation --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived module-migration-04 and updated specs * docs(openspec): finalize module-migration-05 tracking after modules PR merge (#345) * Implement blockers to prepare for module-migration-03 change. * Update migration change * docs(openspec): close migration-05 PR tracking and change order --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive module-migration-05 change and update specs * test(migration-06): move legacy sync tests out of core (#346) * feat(migration-06): core decoupling cleanup - boundary tests and inventory - Add test_core_does_not_import_from_bundle_packages boundary regression test - Update spec with ownership boundary and migration acceptance criteria - Add CORE_DECOUPLING_INVENTORY.md (keep/move/interface classification) - Record TDD evidence in TDD_EVIDENCE.md - Update docs/reference/architecture.md with core vs modules-repo boundary - Update openspec/CHANGE_ORDER.md status No move candidates identified; core already decoupled from bundle packages. Boundary test prevents future core->bundle coupling. Refs #338 Made-with: Cursor * chore(migration-06): mark all tasks complete Made-with: Cursor * feat(migration-06): extend scope - migrate package-specific artifacts per #338 - Add MIGRATION_REMOVAL_PLAN.md with phased removal of MIGRATE-tier code - Add test_core_modules_do_not_import_migrate_tier boundary test - Remove templates.bridge_templates (dead code; only tests used it) - Remove tests/unit/templates/test_bridge_templates.py - Update CORE_DECOUPLING_INVENTORY.md with removal status - Update spec with MIGRATE-tier enforcement and package-specific removal Phase 1 complete. Further MIGRATE-tier removal documented in plan. Refs #338 Made-with: Cursor * test(migration-06): move legacy sync tests out of core --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived module-migration-06 change and updated specs * test: module-migration-07 core test ownership cleanup (#347) * test: finalize module-migration-07 core test ownership cleanup * docs: mark module-migration-07 quality and PR tasks complete * test: fix CI isolation failures for project and persona merge * test: narrow migrated skips and restore core registry guardrails * test: stabilize core CI by refining skips and bootstrap checks * test: fix remaining PR failures via targeted core filtering * fix: harden module package checks against import-mode class identity * test: stabilize core slimming integration assertions --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived backlog-core-07 change and updated specs * Update some docs and archive latest finished changes and specs * Add docs update change * feat: add agile-01-feature-hierarchy change and update CHANGE_ORDER.md (#376) - Create openspec/changes/agile-01-feature-hierarchy/ with proposal.md and tasks.md - Add Epics #256 (Architecture Layer Integration), #257 (AI IDE Integration), and #258 (Integration Governance and Dogfooding) to CHANGE_ORDER.md parent issues table - 25 GitHub Feature issues created (#351-#375), linked to their parent Epics - Feature label created; issue #185 closed (ceremony-cockpit-01, archived 2026-02-18) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: align core docs and sync pending changes (#377) * docs: align core docs and sync pending changes * fix: preserve partial staging in markdown autofix hook --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: stabilize release test suite after module migration * Update module * Fix module install * Fix module install * Fix failed tests * Fix marketplace client regression * Fix install regression for specfact-cli (#380) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add changes to improve runtime validation and backlog module remaining migration to module * refactor: remove backlog ownership from core cli (#384) * refactor: remove backlog ownership from core cli * fix: align CI marketplace validation paths * test: stabilize command audit validation and add command-surface change --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add new command alignment change * fix: finalize cli runtime validation regressions (#387) * fix: finalize cli runtime validation regressions * test: align satisfied dependency logging assertions --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive cli-val-07 change * Archive changes and update specs * Add code-review change proposals * test: align command surface regression coverage * docs: add OpenSpec change for backlog-core commands migration (#390) * feat: add OpenSpec change for backlog-core commands migration Change: backlog-02-migrate-core-commands - Add proposal, design, tasks, specs - Add TDD_EVIDENCE.md with implementation progress - GitHub Issue: #389 Rules applied: AGENTS.md Git Worktree Policy, TDD Hard Gate Made-with: Cursor * docs: update TDD_EVIDENCE and tasks for quality gate results Made-with: Cursor * docs: update TDD_EVIDENCE with test fix results Made-with: Cursor * docs: update TDD_EVIDENCE with all test fixes complete Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: use POST instead of PATCH for ADO work item creation (#391) * fix: use POST instead of PATCH for ADO work item creation Azure DevOps API requires POST (not PATCH) for creating work items. Also fixed category grouping to always register group commands. Made-with: Cursor * docs: add changelog entry for ADO POST fix Made-with: Cursor * chore: bump version to 0.40.4 Made-with: Cursor * fix: update test mocks from PATCH to POST for ADO create - Reverted incorrect unconditional _mount_installed_category_groups call - Updated test_create_issue mocks to use requests.post instead of requests.patch Made-with: Cursor * test: skip category group test when bundles not installed The test_bootstrap_with_category_grouping_disabled_registers_flat_commands test expects bundles like specfact-codebase to be installed, but in CI they may not be. Added pytest.skip() when 'code' command is not available. Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive backlog-02-migrate-core-commands change - Archived backlog-02-migrate-core-commands change - Updated CHANGE_ORDER.md with implementation status - Updated main specs with backlog-add, backlog-analyze-deps, backlog-delta, backlog-sync, backlog-verify-readiness Made-with: Cursor * feat: document code-review module scaffold (#410) * feat: document code-review module scaffold * chore: sync 0.41.0 release version artifacts --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add change for project codebase ownership * Realign code import ownership surface (#412) * Realign code import ownership surface * Harden temp registry command audit test --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update code review changes * docs: update reward ledger OpenSpec tracking (#413) Link the existing change issue, record TDD evidence, and align the OpenSpec artifacts with the bundle-owned DDL and paired worktree implementation flow. Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Track house-rules skill OpenSpec changes (#414) Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: Update change-proposal for code-review-07 (#415) * Track house-rules skill OpenSpec changes Made-with: Cursor * Cursor: Apply local changes for cloud agent --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Finalize code-review-07 status * Finalize code-review-08 status * feat: apply code-review-09 pre-commit integration * fix: fall back when cached hatch test env is broken * fix: avoid hatch env for coverage xml export * fix: install type-check and lint tools directly in CI * fix: install pytest fallback deps in test job * fix: install pytest-cov for test fallback path * Finalize code-review-09 status * [Change] Align core docs with modules site ownership (#419) * Align core docs with modules site ownership * Close docs portal change PR task --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden docs parity URL assertions * Archive finished changes and update specs * docs: fix command syntax parity after lean-core/modules split (v0.42.2) (#421) Replace all stale CLI syntax families in authored docs with current shipped commands. Adds docs parity tests that guard against regression. Removed syntax families corrected: - specfact project plan → project devops-flow / project snapshot / govern enforce sdd - project import from-bridge → code import from-bridge - specfact backlog policy → backlog verify-readiness / backlog refine - specfact spec contract → spec validate / spec generate-tests / spec mock - specfact spec sdd constitution → govern enforce sdd [BUNDLE] - spec generate <prompt-subcommands> → AI IDE skills or removed Updated docs: README.md, docs/index.md, docs/README.md, docs/reference/commands.md (+4 reference docs), docs/getting-started/ (4 files), docs/guides/ (21 files), docs/examples/ (5 files), docs/prompts/ (2 files). Added 11 new docs parity tests in test_release_docs_parity.py: - 7 tests asserting removed syntax families stay absent - 4 tests asserting current command families remain documented Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Archive finished changes and update specs - Archive docs-03-command-syntax-parity (2026-03-18) - Sync delta specs: cli-output + documentation-alignment updated with post-split command-surface alignment requirements and scenarios - Update CHANGE_ORDER.md: mark docs-03 as archived Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update evidence * Potential fix for pull request finding 'Unused global variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * docs: align core docs ownership and parity (#424) * docs: fix command syntax parity after lean-core/modules split (v0.42.2) Replace all stale CLI syntax families in authored docs with current shipped commands. Adds docs parity tests that guard against regression. Removed syntax families corrected: - specfact project plan → project devops-flow / project snapshot / govern enforce sdd - project import from-bridge → code import from-bridge - specfact backlog policy → backlog verify-readiness / backlog refine - specfact spec contract → spec validate / spec generate-tests / spec mock - specfact spec sdd constitution → govern enforce sdd [BUNDLE] - spec generate <prompt-subcommands> → AI IDE skills or removed Updated docs: README.md, docs/index.md, docs/README.md, docs/reference/commands.md (+4 reference docs), docs/getting-started/ (4 files), docs/guides/ (21 files), docs/examples/ (5 files), docs/prompts/ (2 files). Added 11 new docs parity tests in test_release_docs_parity.py: - 7 tests asserting removed syntax families stay absent - 4 tests asserting current command families remain documented Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: align core docs ownership and parity --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: fix quickstart install guidance * docs: remove generated project plan docs * Add code-review change * fix: preserve native backlog import payloads (#429) * fix: preserve native backlog import payloads * fix: preserve imported proposal ids on reimport --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: add docs review workflow and repair docs links (#428) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: keep imported change ids stable across title changes (#431) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: remove conflicting pages file copies * Add docs sync changs * docs: update openspec clean-code planning * Update change status * fix: code-review-zero-findings dogfood remediation (v0.42.3) (#435) * fix: continue code review remediation and align module signing * fix: complete code-review-zero-findings dogfood remediation (v0.42.3) Eliminates full-scope code review findings (types, Radon CC, contracts, lint) and records OpenSpec change code-review-zero-findings with tests and CHANGELOG. Module manifests may need re-signing before merge per project policy. Made-with: Cursor * chore: re-sign bundled modules after content changes * fix: resolve review follow-up regressions * fix: run ci smart-test directly * fix: restore ci test progress output * fix: stabilize command audit ci test --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add docs refactoring changes * Add bug change tracking for encoding and resources * docs: restructure core site IA to 6-section progressive nav (#442) * docs: restructure core site IA from 5 flat sections to 6 progressive sections Restructure docs.specfact.io from a flat 5-section sidebar to a 6-section progressive navigation: Getting Started, Core CLI, Module System, Architecture, Reference, Migration. - Create docs/core-cli/, docs/module-system/, docs/migration/ directories - Move 12 files to correct new sections with jekyll-redirect-from entries - Write 3 new CLI reference pages: init.md, module.md, upgrade.md - Replace first-steps.md with focused 5-minute quickstart - Rewrite index.md as portal landing with core vs modules delineation - Rewrite getting-started/README.md to link module tutorials to modules site - Update sidebar navigation in _layouts/default.html - Delete 6 obsolete files (competitive-analysis, ux-features, common-tasks, workflows, testing-terminal-output, guides/README) - Add documentation-alignment delta spec for core-only focus policy Implements: #438 OpenSpec: docs-05-core-site-ia-restructure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: fix broken internal links after IA restructure Update all relative links across 40 files to point to new file locations: - ../reference/architecture.md → ../architecture/overview.md - ../reference/debug-logging.md → ../core-cli/debug-logging.md - ../reference/modes.md → ../core-cli/modes.md - guides/ sibling links → ../module-system/ or ../migration/ - module-system/ back-links → ../guides/ - Remove links to deleted files (common-tasks, workflows) - first-steps.md → quickstart.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update test path for moved bootstrap-checklist and fix remaining broken links - Update test_module_bootstrap_checklist_uses_current_bundle_ids to use new path docs/module-system/bootstrap-checklist.md - Fix 2 remaining command-chains.md anchor links in migration-guide.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: harden cross-platform runtime and IDE resource discovery (#443) * fix: harden cross-platform runtime and IDE resource discovery * fix: bump patch version to 0.42.4 * fix: restore init lifecycle compatibility --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: resolve review type-safety findings * Improve clarity and scope of ide prompt change * feat(init): IDE prompt source catalog, --prompts, namespaced exports (#445) * feat(init): IDE prompt source catalog, --prompts, namespaced exports Implement init-ide-prompt-source-selection: discover core + module prompts, default export all sources, interactive multi-select, non-interactive --prompts, source-namespaced IDE paths. Fix project module roots to use metadata source project. Extend discovery roots with user/marketplace. Update startup_checks for nested exports. Bump init module to 0.1.14 with signed manifest. Made-with: Cursor * fix(init): scope VS Code prompt recommendations to exported sources - Pass prompts_by_source into create_vscode_settings from copy_prompts_by_source_to_ide - Strip prior .github/prompts/* recommendations on selective export to avoid stale paths - Extract helpers for catalog paths and fallbacks; keep code review clean Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix tests * release: bump version to 0.42.5 and update CHANGELOG - Remove [Unreleased] sections; fold historical arch-08 notes under [0.34.0] - Document init ide catalog, VS Code recommendations, integration test isolation Made-with: Cursor * Fix review findings * feat(init): selective IDE prompt export cleanup and VS Code recommendation strip - Prune stale exports and unselected catalog segments in copy_prompts_by_source_to_ide - Strip only specfact*.prompt.md under .github/prompts/ when merging VS Code settings - Tighten e2e missing-templates assertions to match CLI output - Add unit tests for prompt path helper and selective export behavior Made-with: Cursor * Fix review findings * Add missing import * Bump patch version and changelog * Fix failed tests * Fix review findings * docs: core vs modules URL contract and OpenSpec alignment (#448) * docs: add core vs modules URL contract and OpenSpec alignment Document cross-site permalink rules in docs/reference, extend documentation-alignment and module-docs-ownership specs, update docs-07 and openspec config, and note the dependency on modules URL policy in CHANGE_ORDER. Made-with: Cursor * docs: convert core handoff pages to modules canonical links (docs-07) - Replace 20 duplicate guides/tutorials with thin summaries, prerequisites, and links to modules.specfact.io per URL contract - Add docs/reference/core-to-modules-handoff-urls.md mapping table - Align OpenSpec documentation-alignment spec delta with ADDED Requirements - Complete docs-07-core-handoff-conversion tasks checklist Refs: #439 Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat(docs-12): docs command validation and cross-site link checks (#449) * feat(docs-12): docs command validation and cross-site link checks - Add check-docs-commands (Typer CliRunner prefix + --help) and exclusions for migration/illustrative pages - Add check-cross-site-links with robust URL extraction; warn-only in docs-validate and CI while live site may lag - Extend docs-review: Hatch env, validation steps, pytest tests/unit/docs/ - Opt-in handoff map HTTP test (SPECFACT_RUN_HANDOFF_URL_CHECK=1) - OpenSpec deltas, TDD_EVIDENCE, tasks complete; CHANGELOG [Unreleased] Made-with: Cursor * fix(docs-validate): strip leading global flags before command path - Parse --mode/--input-format/--output-format + value, then other root flags - Add test for specfact --mode copilot import from-code … - Fix showcase docs: hatch run contract-test-exploration (not specfact) Made-with: Cursor * fix(docs-12): harden link/command validators and spec wording - Capitalize Markdown in cross-site link spec requirement - Cross-site: redirect-only HTTP success, UTF-8 read failures, URL delimiter/trim fixes - Docs commands: catch Typer exceptions on --help, UTF-8 read failures - Tests: shared loader for check-cross-site-links module Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix(scripts): CliRunner without mix_stderr for Click 8.3+ compatibility (#451) Default CliRunner() merges stderr into stdout; read stdout only so accessing result.stderr does not raise when streams are combined. Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: review gates (semgrep print, radon CC, icontract, questionary types) (#452) * fix: satisfy review gates for docs scripts and module_lifecycle typing - Replace print() with Rich Console in docs validation scripts (semgrep) - Split HTTP URL checks and doc scans to reduce cyclomatic complexity (radon) - Add icontract require/ensure on public helpers; use CliRunner() without mix_stderr - Cast questionary API for basedpyright reportUnknownMemberType Made-with: Cursor * fix(scripts): address #452 review (HTTP helpers, icontract, CLI streams) - _http_success_code: use int directly after None guard - _response_status: safe getcode via getattr/callable - check-docs: drop @require preconditions duplicated by beartype - _cli_invoke_streams_text: merge stdout + stderr for not-installed detection Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add speckit adapter alignment change and update affected change specs * feat(adapters): spec-kit v0.4.x adapter alignment (#454) * feat(adapters): spec-kit v0.4.x adapter alignment — extensions, presets, hooks, version detection, 7-command presets Update SpecKitAdapter, ToolCapabilities, BridgeConfig presets, and SpecKitScanner for spec-kit v0.4.3 compatibility: - ToolCapabilities: 5 new optional fields (extensions, extension_commands, presets, hook_events, detected_version_source) - SpecKitScanner: scan_extensions(), scan_presets(), scan_hook_events() with .extensionignore support and defensive JSON parsing - SpecKitAdapter: 3-tier version detection (CLI → heuristic → None), refactored get_capabilities() with reduced cyclomatic complexity - BridgeConfig: all 3 speckit presets expanded from 2 to 7 command mappings (specify, plan, tasks, implement, constitution, clarify, analyze) - 42 new tests across 4 test files (110 targeted, 2248 full suite pass) - Docs updated: comparison matrix, journey guide, integrations overview, adapter development guide Closes #453 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings - Use get_bridge_logger instead of logging.getLogger in speckit adapter and scanner (production command path convention) - Narrow except Exception to except OSError in _load_extensionignore - Simplify redundant base_path conditional in get_capabilities - Use SimpleNamespace instead of dynamic type() in tests - Add subprocess.TimeoutExpired and OSError exception tests for CLI version detection - Fix duplicate MD heading in bridge-adapter spec - Add blank lines after markdown headings in proposal (MD022) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump version to 0.43.0 for spec-kit v0.4.x alignment (#455) * chore: bump version to 0.43.0 and add changelog entry Minor version bump for spec-kit v0.4.x adapter alignment feature. Syncs version across pyproject.toml, setup.py, and __init__.py. Adds changelog entry documenting new capabilities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Sync deps and fix changelog * Sync deps and fix changelog --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(packaging): remove workflow prompts from core wheel (packaging-02 #441, v0.43.1) (#456) * fix(packaging): drop duplicate workflow prompts from core wheel (packaging-02 3.5) Remove resources/prompts from wheel force-include and repo tree; canonical copies remain in specfact-cli-modules bundles. Align startup IDE drift checks and init template resolution with discover_prompt_template_files. Bump to 0.43.1; re-sign init module 0.1.19. Update CHANGELOG, docs, OpenSpec. Made-with: Cursor * fix: address PR review (changelog, TDD evidence, startup checks, tests) - Changelog 0.43.1 header uses Unreleased until release tag - TDD_EVIDENCE: pre-fail block for Task 3.5 before passing verification - TemplateCheckResult.sources_available; skip last_checked_version bump when no discoverable prompts; drift missing only when source exists - Integration _fake_discover respects include_package_fallback - test_validate_all_prompts uses tmp_path; re-enable file in default test run - test_print_startup_checks_version_update_no_type uses stale version timestamp Made-with: Cursor * fix: address follow-up PR review (startup metadata, tests) - Use ide_dir directly in TemplateCheckResult when IDE folder exists - Set last_checked_version only after successful template-source checks - Integration test: assert discover_prompt_template_files fallback + stable startup patches - validate_all_prompts test: valid vs invalid specfact.*.md outcomes Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Fix changelog version * docs: unify core docs portal UX (#459) * docs: unify core docs portal UX * Fix docs-13 core review findings * Address docs-13 PR review feedback * Address follow-up docs review feedback --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Harden docs home URL test assertion * feat: doc frontmatter validation, v0.43.2 review JSON gate, and pre-commit review UX (#463) * chore(release): v0.43.2 pre-commit review JSON + OpenSpec dogfood rules - Pre-commit gate writes ReviewReport JSON to .specfact/code-review.json - openspec/config.yaml: require fresh review JSON and remediate findings - Docs and unit tests updated Made-with: Cursor * fix: CodeRabbit — changelog, openspec TDD_EVIDENCE freshness, review hook timeout - CHANGELOG 0.43.2: expanded entries, line wrap - openspec/config.yaml: exclude TDD_EVIDENCE.md from review JSON staleness - pre_commit_code_review: timeout 300s, TimeoutExpired handling - tests: exact cwd, timeout assertion and timeout failure test Made-with: Cursor * Add code review to pre-commit and frontmatter docs validation * Improve pre-commit script output * Improve specfact code review findings output * Fix review findings * Improve pre-commit hook output * Enable dev branch code review * Update code review hook * Fix contract review findings * Fix review findings * Fix review warnings * feat: doc frontmatter hardening and code-review gate fixes - Typer CLI for doc-frontmatter-check; safer owner resolution (split helpers for CC) - Strict exempt handling; pre-commit hook matches USAGE-FAQ.md; review script JSON typing - Shared test fixtures/types; integration/unit test updates; OpenSpec tasks and TDD evidence - Changelog: pre-commit code-review-gate UX note Made-with: Cursor * Fix test failures and add docs review to github action runner * Fix test failure due to UTF8 encoding * Apply review findings * Optimize pr orchestrator runtime * Optimize pr orchestrator runtime * Fix caching on pr-orchestrator --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive doc-frontmatter-schema openspec change * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * fix: restore protocol stubs for type checking * Add frontamtter check * fix: harden protocol stubs for code quality * Add PR test hardening change * fix: remediate review findings and harden review gates * fix: rebuild review report model for pydantic * Add story and onboarding change * Update change tracking * Improve scope for ci/cd requirements * docs: sharpen first-contact story and onboarding (#467) * docs: sharpen first-contact story and onboarding * docs: address first-contact review feedback * docs: address onboarding review fixes * test: accept default-filtered site tokens in docs parity * docs: record completed onboarding quality gates * test: improve first-contact assertion failures --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden review blockers and bump patch version * test: harden modules docs url assertions * fix: harden trustworthy green checks (#469) * fix: harden trustworthy green checks * fix: restore contract-first ci repro command * fix: apply CodeRabbit auto-fixes Fixed 3 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * fix: resolve CI failures for trustworthy green checks PR - Use hatch run contract-test instead of specfact code repro in CI (CLI bundle not available in CI environment) - Allow test_bundle_import.py in migration cleanup legacy-import check (_bundle_import is an internal helper, not a removed module package) - Fix formatting in test_trustworthy_green_checks.py (CodeRabbit commit was unformatted) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings - Add trailing newline to TDD_EVIDENCE.md (MD047) - Make _load_hooks() search for repo: local instead of assuming index 0 - Replace fragile multi-line string assertion in actionlint test with semantic line-by-line checks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings for ci-02 (#471) - Widen workflow_changed filter to include scripts/run_actionlint.sh and scripts/yaml-tools.sh so Workflow Lint triggers on script changes - Pin actionlint default to v1.7.11 (matches CI) instead of latest - Fix run_actionlint.sh conflating "not installed" with "lint failures" by separating availability check from execution - Restore sys.path after test_bundle_import to avoid cross-test leakage - Normalize CHANGE_ORDER.md status format to semicolon convention Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: propagate docker actionlint exit code instead of masking failures (#472) Simplify run_actionlint.sh control flow so both local and docker execution paths propagate actionlint's exit code via `exit $?`. Previously the docker path used `if run_with_docker; then exit 0; fi` which treated lint errors as "docker unavailable" and fell through to install guidance. Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: assert hook id stability and cd to repo root for local actionlint (#473) - Assert hook id == "specfact-smart-checks" to prevent silent renames - cd to REPO_ROOT before running local actionlint so it finds workflows regardless of caller's cwd Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * feat: clean-code-01-principle-gates — 7-principle charter gates, v0.44.0 (#474) * feat: clean-code-01-principle-gates — 7-principle charter gates, v0.44.0 Implements openspec/changes/clean-code-01-principle-gates: - Rewrote .cursor/rules/clean-code-principles.mdc as a canonical alias surface for the 7-principle clean-code charter (naming, kiss, yagni, dry, solid) defined in nold-ai/specfact-cli-modules. Documents Phase A KISS thresholds (>80 warning / >120 error LOC), nesting-depth and parameter-count checks active, and Phase B (>40/80) explicitly deferred. - Added Clean-Code Review Gate sections to AGENTS.md and CLAUDE.md listing all 5 expanded review categories and the Phase A thresholds. - Created .github/copilot-instructions.md as a lightweight alias (< 30 lines) referencing the canonical charter without duplicating it inline. - Added unit tests (test_clean_code_principle_gates.py) covering all three spec scenarios: charter references, compliance gate, LOC/nesting thresholds. - TDD evidence recorded in openspec/changes/clean-code-01-principle-gates/TDD_EVIDENCE.md. - Bumped version 0.43.3 → 0.44.0 (minor — feature branch). - Updated CHANGELOG.md and openspec/CHANGE_ORDER.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: clean-code-01-principle-gates review findings and broad exception handling\n\n- Fix coderabbitai review findings:\n - Clarify T20 and W0718 are aspirational in clean-code-principles.mdc\n - Add language specifier to TDD_EVIDENCE.md fenced code block\n - Update test to check all 7 canonical principles\n - Make LOC threshold assertion more specific\n- Improve exception handling throughout codebase:\n - Replace broad except Exception with specific exceptions\n - Apply SOLID principle for better error handling\n- Update tasks.md to reflect completion status\n\nFixes #434\n\nGenerated by Mistral Vibe.\nCo-Authored-By: Mistral Vibe <vibe@mistral.ai> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: archive completed openspec changes and update main specs Archive 11 completed OpenSpec changes: - bugfix-02-ado-import-payload-slugging - ci-02-trustworthy-green-checks - clean-code-01-principle-gates - code-review-zero-findings - docs-04-docs-review-gate-and-link-integrity - docs-05-core-site-ia-restructure - docs-07-core-handoff-conversion - docs-12-docs-validation-ci - docs-13-core-nav-search-theme-roles - docs-14-first-contact-story-and-onboarding - init-ide-prompt-source-selection - packaging-02-cross-platform-runtime-and-module-resources - speckit-02-v04-adapter-alignment Fix spec validation errors: - Add proper delta headers (ADDED/MODIFIED/REMOVED/RENAMED) - Use correct scenario format with GIVEN/WHEN/THEN bullets - Ensure requirement headers match between delta and main specs - Use correct operation type based on existing requirements Update main specs with archived changes: - backlog-adapter: various updates - bridge-adapter: Spec-Kit v0.4.x capabilities - bridge-registry: BridgeConfig preset updates - code-review-module: new requirements - debug-logging: enhancements - devops-sync: improvements - documentation-alignment: core vs modules separation - review-cli-contracts: new contracts - review-run-command: command updates Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> * Add new user onboarding change * docs & tooling: new user onboarding + smart-test and pre-commit review fixes (#477) * Fix content for install, sync, uninstallä * test(docs): align first-contact contracts and stabilize module CLI tests - docs/index: restore Why does it exist?, tagline, OpenSpec, canonical core CLI story - Update init profile tests for solo-developer + install all (code-review, six bundles) - Lean help test accepts uvx init hint; upgrade/core_compatibility tests match runtime - Autouse fixture re-bootstraps CommandRegistry after category-group tests - Rebase tasks conflict resolved; TDD_EVIDENCE + tasks for gates 7.1/7.2/12.1/12.2 Made-with: Cursor * fix(tools): smart-test baseline and pre-commit single code-review run - Run full suite when smart-test cache has no last_full_run; force+auto falls back to full when incremental is a no-op - Pre-commit: invoke pre_commit_code_review.py once (no xargs split) so .specfact/code-review.json is not clobbered - Tests and OpenSpec tasks for docs-new-user-onboarding Made-with: Cursor * test: fix CI backlog copy assertions and module install test isolation - Align backlog not-installed tests with solo-developer init guidance (no <profile> placeholder) - Autouse: reset CommandRegistry, register_builtin_commands, rebuild_root_app_from_registry so module install tests work after registry-only clears Made-with: Cursor * docs: README wow path + tests locking entrypoint with docs - README leads with uvx init + code review run --scope full; pip install secondary - Unit contract tests: README and docs/index.md share canonical uvx strings and order - E2E: init --profile solo-developer in temp git repo; registry ready for step two with mock bundles Made-with: Cursor * feat(init): solo-developer includes code-review bundle and marketplace install - Add specfact-code-review to canonical bundles and solo-developer preset - Install marketplace module nold-ai/specfact-code-review via install_bundles_for_init - Docs index: core CLI story and default starting point copy for parity tests - CLI: missing-module hint references solo-developer profile - smart_test_coverage: icontract requires use (self, test_level) for method contracts - Re-sign init and module_registry manifests; tests and registry updates Made-with: Cursor * fix(tools): align _run_changed_only with tuple return and baseline full run - Return (success, ran_any) from _run_changed_only; run full suite when no last_full_run - run_smart_tests(auto, force): fall back to full tests when incremental ran nothing - Fix wow e2e fixture typing (Iterator[None]) for basedpyright Unblocks PR #477 CI: type-check, tests, lint job. Made-with: Cursor * chore(release): bump to 0.45.1 and update OpenSpec tasks status - Sync version across pyproject.toml, setup.py, and __init__ modules - Changelog: 0.45.1 entry for dependency profiles, smart-test baseline, CI, UX - openspec: rolling status snapshot and task checkboxes for PR verification - Includes prior branch work: init/profile, module registry, docs entry path, workflows Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: code-review gate (Typer params), typer<0.24 vs semgrep, module upgrade tests (#479) * fix: code-review gate (Typer params), typer<0.24 vs semgrep, module upgrade tests - Split root/install Typer callbacks into merged param stubs (KISS param count). - Patch typer.main via importlib; merge install param specs in module_registry. - Cap typer<0.24 to stay compatible with semgrep click~=8.1.8. - Invoke module_registry app directly in upgrade CLI tests (root app may lack module group). - Refactors for first_run_selection, module_packages, registry tests, semgrep README. Worktree: specfact-cli-worktrees/bugfix/code-review-cli-tests Made-with: Cursor * docs: use code import in examples (flat import removed from CLI) Replace specfact [--flags] import from-code with specfact [--flags] code import from-code so check-docs-commands matches the nested Typer path after removing the flat import shim. Made-with: Cursor * Fix review findings --------- Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: restructure README for star conversion (#480) * docs: restructure readme for star conversion Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: sync readme change tracking Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: relocate readme support artifacts Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: fix readme workflow snippet and pin demo capture Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: address remaining readme review findings Co-authored-by: Dom <djm81@users.noreply.github.com> --------- Co-authored-by: Dom <djm81@users.noreply.github.com> * archived implemented changes * Archive and remove outdated changes * Split and refactor change proposals between both repos * Archive alignment change * Add changes and github hierarchy scripts * feat: add GitHub hierarchy cache sync (#492) * feat: add github hierarchy cache sync * Backport improvements from modules scripts * Fix review findings * Make github sync script executable --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * [codex] Compact agent governance loading (#493) * feat: compact agent governance loading * docs: mark governance PR task complete * docs: sync governance-03 github issue metadata * fix: restore dev branch governance block * Apply review findings * docs: add sibling internal wiki context for OpenSpec design Point AGENTS.md, Claude/Copilot/Cursor surfaces, and the OpenSpec rule at docs/agent-rules/40-openspec-and-tdd.md to read-only wiki paths (hot.md, graph.md, concepts) via absolute paths when specfact-cli-internal is present. Update INDEX applicability notes and extend governance tests. Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived github hierarchy change * Update rules for openspec archive * Potential fix for pull request finding 'Unused local variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Add wiki update notes * Archive governance-03 change, format markdown, add wiki instructions for update * Fix review findings * Fix type errors * fix: safe VS Code settings merge and project artifact writes (#490) (#496) * fix: safe merge for VS Code settings.json on init ide (profile-04) - Add project_artifact_write.merge_vscode_settings_prompt_recommendations with fail-safe on invalid JSON / bad chat shape; --force backs up to .specfact/recovery/ then replaces. - Route ide_setup create_vscode_settings through helper; thread force; catch errors for CLI exit. - Lint gate: scripts/verify_safe_project_writes.py blocks json.load/dump in ide_setup.py. - Tests, installation docs, 0.45.2 changelog and version pins. OpenSpec: profile-04-safe-project-artifact-writes Made-with: Cursor * fix(profile-04): satisfy review gate, pin setuptools for semgrep - Refactor project_artifact_write merge path (KISS); icontract predicates - Deduplicate ide_setup prompt helpers; import from project_artifact_write - verify_safe_project_writes: ast.walk, contracts, beartype - Pin setuptools<82 for Semgrep pkg_resources chain - Update TDD_EVIDENCE and tasks checklist Made-with: Cursor * ci: run safe-write verifier in PR orchestrator lint job Match hatch run lint by invoking scripts/verify_safe_project_writes.py after ruff/basedpyright/pylint. Use set -euo pipefail so the first lint failure is not masked by later commands. Made-with: Cursor * fix(profile-04): address CodeRabbit review (docs, guard, contracts, tests) - Wrap installation.md VS Code merge paragraph to <=120 chars per line - tasks 4.7 + TDD_EVIDENCE: openspec validate --strict sign-off - verify_safe_project_writes: detect from-json import and aliases - settings_relative_nonblank: reject absolute paths and .. segments - ide_setup: _handle_structured_json_document_error for duplicate handlers - ProjectWriteMode docstring (reserved policy surface); backup stamp + collision loop - Tests: malformed settings preserved on init ide exit; force+chat coercion; AST guard tests Made-with: Cursor * fix(profile-04): JSON5 settings, repo containment, review follow-ups - merge_vscode_settings: resolve containment before mkdir/write; JSON5 load/dump (JSONC comments; trailing_commas=False for strict JSON output) - ide_setup: empty prompts_by_source skips catalog fallback (_finalize allow_empty_fallback) - verify_safe_project_writes: detect import json as js attribute calls - contract_predicates: prompt_files_all_strings accepts list[Any] for mixed-type checks - Tests: symlink escape, JSONC merge, empty export strip, import-json-as-js guard - tasks.md / TDD_EVIDENCE: wrap lines to <=120 chars; CHANGELOG + json5 dep + setup.py sync Made-with: Cursor * docs(profile-04): tasks pre-flight + full pytest; narrow icontract ensure - tasks 1.1: hatch env create then smart-test-status and contract-test-status - tasks 4.3: add hatch test --cover -v to quality gates - TDD_EVIDENCE: shorter module-signatures and report lines (<=120 cols) - project_artifact_write: isinstance(result, Path) in @ensure postconditions Made-with: Cursor * fix: clear specfact code review on safe-write modules - verify_safe_project_writes: flatten json binding helpers; stderr writes instead of print; inline Import/ImportFrom loops to drop duplicate-shape DRY - project_artifact_write: _VscodeChatMergeContext dataclass (KISS param count); typed chat_body cast before .get for pyright Made-with: Cursor * docs(profile-04): record hatch test --cover -v in TDD_EVIDENCE Align passing evidence with tasks.md 4.3 full-suite coverage gate. Made-with: Cursor * fix: reduce KISS blockers (bridge sync contexts, tools, partial adapters) Refactors high-parameter call sites into dataclasses/context objects and splits hot spots (export devops pipeline, smart_test_coverage incremental run, suggest_frontmatter, crosshair summary loop). API: BridgeSync.export_change_proposals_to_devops(adapter_type, ExportChangeProposalsOptions | None); LoggerSetup.create_logger(name, LoggerCreateOptions | None); run_crosshair(path, CrosshairRunOptions | None). Full specfact code review --scope full still reports error-severity kiss/radon findings (remaining nesting/LOC and param counts in ADO, analyzers, generators, source_scanner, module_installer, bundle-mapper, etc.). Gate PASS requires follow-up. Made-with: Cursor * Fix review findings and sign modules * fix(tests): register dynamic check_doc_frontmatter module; align _update_cache tests - Insert check_doc_frontmatter into sys.modules before exec_module so dataclasses can resolve string annotations (fixes Docs Review / agent rules governance fixture). - Call SmartCoverageManager._update_cache with _SmartCacheUpdate after signature refactor (fixes basedpyright reportCallIssue). Made-with: Cursor * fix(tests): align install_module mocks with InstallModuleOptions; register verify_bundle script - Monkeypatch/patch fakes now accept (module_id, options=None) matching install_module(module_id, InstallModuleOptions(...)). - Read install_root, trust_non_official, non_interactive, reinstall from InstallModuleOptions in CLI command tests. - Dynamic load of verify-bundle-published registers sys.modules before exec_module (same dataclass annotation issue as check_doc_frontmatter). Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Fix review findings (#498) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat(openspec): add marketplace-06-ci-module-signing change proposal Moves module signing from local interactive requirement to CI step triggered by PR approval (pull_request_review). Eliminates local private key dependency for non-interactive development on feature/dev branches. Trust boundary remains at main. Scope: - NEW .github/workflows/sign-modules-on-approval.yml - MODIFY scripts/pre-commit-smart-checks.sh (branch-aware policy) - MODIFY .github/workflows/pr-orchestrator.yml (split verify by target) - MODIFY .github/workflows/sign-modules.yml (main-only enforcement) GitHub: #500 Parent Feature: #353 (Marketplace Module Distribution) → #194 (Architecture Epic) Paired modules change: specfact-cli-modules#185 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(pre-commit): modular hooks + branch-aware module verify (#501) * chore(pre-commit): modular hooks aligned with specfact-cli-modules - Add scripts/pre-commit-quality-checks.sh (block1 stages + block2; all for manual/shim) - Replace monolithic smart-checks with shim to quality-checks all - .pre-commit-config: fail_fast, verify-module-signatures + check-version-sources, cli-block1-* hooks, cli-block2, doc frontmatter - Match modules: hatch run lint when Python staged; scoped code review paths - CLI extras: Markdown fix/lint, workflow actionlint (no packages/ bundle-import gate) - Bump to 0.46.1; docs: README, CONTRIBUTING, code-review.md, agent-rules/70 Made-with: Cursor * fix(pre-commit): branch-aware module verify hook (marketplace-06 policy) - Add scripts/pre-commit-verify-modules.sh and git-branch-module-signature-flag.sh - Point verify-module-signatures hook at wrapper (script); skip when no staged module paths - pre-commit-quality-checks all: delegate module step to wrapper; safe-change allowlist - Tests + CONTRIBUTING/CHANGELOG alignment Made-with: Cursor * fix(pre-commit): address r…
…#509) * fix: address signature-backend warning and module version drift * fix: use hatch build in PyPI publish workflow script (#304) * fix: resolve startup module freshness home path dynamically (#306) * fix: harden module signing workflow and reduce startup log noise * test: align module migration compatibility with decoupled module versions * fix: fail fast on invalid base ref in changed-only module signing * fix: stabilize module precedence and backlog github mapping flow * fix(module-registry): persist disables and correct bundled availability * Re-sign module registry and fix / ignore local temp artifacts * bump module registry version to 0.1.3 * fix(registry): restore protocol reporting logs in debug mode * fix(backlog): harden refine writeback, prompts, and any-filter semantics (#311) * fix(backlog): harden refine writeback, prompts, and daily any filters * fix(github): default story type fallback to feature * Fix format * Fix codex review findings * bump and sign changed modules * chore(hooks): enforce module signature verification in pre-commit * chore(hooks): add markdownlint to pre-commit checks --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix(hooks,ado): correct format gate and enforce iteration on direct id lookup * Apply review findings and fix tests * Pin virtualenv < 21 to avoid incaopatibility failure * fix: finalize backlog-core-06 ado comment API versioning (#314) * fix(backlog): harden refine writeback, prompts, and daily any filters * fix(github): default story type fallback to feature * Fix format * Fix codex review findings * bump and sign changed modules * chore(hooks): enforce module signature verification in pre-commit * chore(hooks): add markdownlint to pre-commit checks * fix: finalize backlog-core-06 ado comment api versioning and ci hatch pins * fix: address review findings for formatter safety and ado metric patch guards * docs(openspec): update CHANGE_ORDER status tracking * fix(ado): apply iteration filter for direct issue_id lookup --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: Advanced marketplace features (marketplace-02) - dependency resolution, aliases, custom registries, publishing (#318) * feat: advanced marketplace features (marketplace-02) - dependency resolution, aliases, custom registries, namespace enforcement, publishing - dependency_resolver: resolve_dependencies(), --skip-deps, --force on install - alias_manager: alias create/list/remove (no top-level alias commands) - custom_registries: add-registry, list-registries, remove-registry; fetch_all_indexes; search Registry column - module_installer: namespace/name enforcement, collision detection - scripts/publish-module.py + .github/workflows/publish-modules.yml (optional signing) - docs: publishing-modules, custom-registries, dependency-resolution; updated installing-modules, module-marketplace, commands - version 0.38.0, CHANGELOG Made-with: Cursor * docs(openspec): defer 6.2.4 and 6.2.5 (index update/PR, workflow test) to later Made-with: Cursor * Add follow-up change proposals for marketplace * Fix codex review findings --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: complete marketplace publish registry PR flow and bump (#320) 0.38.1 Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: update init ide hint and repair publish workflow condition * feat(backlog): normalize daily summarize Markdown output (#323) * feat(backlog): summarize Markdown normalization and TTY/CI rendering * chore(openspec): drop implementation snapshot from change * Update title --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update version * Add github skills * Add new marketplace changes * feat(cli): category groups and flat shims using real module Typer (#331) * feat(cli): category groups and flat shims using real module Typer - Add category groups (code, backlog, project, spec, govern) with flatten same-name member - Sort commands under backlog/project groups A–Z - Fix flat shims to expose real module Typer so 'specfact sync bridge' and 'specfact plan update-idea' work - Add first-run init, module grouping, OpenSpec change for 0.40.x remove-flat-shims - Bump version to 0.39.0, CHANGELOG and OpenSpec updates Made-with: Cursor * Fix signature * fix: resolve module grouping regressions and stabilize CI tests * fix: keep uncategorized modules flat during grouped registration --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update docs regarding module migration change * feat: module-migration-02 bundle extraction (#332) * docs: add module-migration-02-bundle-extraction to CHANGE_ORDER.md * feat: implement module-migration-02 bundle extraction * fix(ci): checkout module bundles repo for test jobs * Fix test failures * fix(modules): load local bundle sources in compatibility aliases * fix: run worktree policy code in tests/CI and silence reexport deprecation - Prefer src/<name>/main.py over app.py when SPECFACT_REPO_ROOT is set so policy init uses worktree templates.py (SPECFACT_POLICY_TEMPLATES_DIR). - Policy engine module-package.yaml: version 0.1.5 and re-signed checksum. - conftest: set SPECFACT_REPO_ROOT, SPECFACT_POLICY_TEMPLATES_DIR; add bundle package roots when specfact-cli-modules present. - Policy engine integration tests: rely on conftest env, clear registry and re-register before invoke so loader uses worktree. - test_reexport_shims: filter deprecation warning for legacy analyze import. Made-with: Cursor * fix: defer specfact_backlog import in shims so CI can register bridges - backlog and policy_engine __init__.py: import specfact_backlog only in __getattr__ (cached), not at module load. Allows loading .src.adapters.* for bridge registration without requiring specfact_backlog installed. - Re-sign backlog and policy_engine module-package.yaml after init changes. - openspec: update module-migration-02 tasks.md. Made-with: Cursor * fix: defer bundle import in all module shims to fix CI collection errors - Apply deferred import (only in __getattr__, cached) to analyze, contract, drift, enforce, generate, import_cmd, migrate, patch_mode, plan, project, repro, sdd, spec, sync, validate. Matches backlog and policy_engine. - Prevents ImportError when tests import specfact_cli.modules.<name>.src.* without specfact_backlog/specfact_govern/specfact_project/specfact_spec installed (e.g. CI). Fixes 78 collection errors. - Re-sign all affected module-package.yaml manifests. Made-with: Cursor * fix(ci): include module shims in hatch cache key so CI uses current code * feat(modules): registry descriptions, --bump-version for publish, tasks and format fixes - Add description to registry index entries in publish-module.py (module search) - Add --bump-version patch|minor|major for bundle re-publish in publish-module.py - Format fixes in validate-modules-repo-sync.py (SIM108, B007) - Mark completed tasks in module-migration-02-bundle-extraction tasks.md - Update test for publish_bundle(bump_version=) signature Made-with: Cursor * Add missing migration tasks to the open change to completely isolate modules into specfact-cli-modules repo. * Add gap analysis and update changes * Update follow-up changes to avoid ambiguities and overlaps * docs: complete migration-02 section-18 parity and 17.8 gate evidence * docs: mark migration-02 import-categorization commit checkpoint done * Update change constraints and blockers for module migration * docs: add migration-05 issue #334 and complete task 17.10.4 * Update change constraints and blockers for module migration --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Implement blockers to prepare for module-migration-03 change. (#336) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat: module-migration-03 core slimming closeout and registry fixes (#317) (#341) * Prepare module-migration-03 removal of old built-in modules * feat(core): delete specfact-project module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-backlog module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-codebase module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-spec module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-govern module source from core (migration-03) Made-with: Cursor * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Finalize module-migration-02 change * docs(backlog-auth): update auth docs and OpenSpec task status (#342) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * chore(openspec): archive completed changes and sync main specs * docs(openspec): prefix module migration proposal titles with IDs * Add bug change for ado required fields setting and update change order * Update change order * feat(core): finalize migration-03 auth removal and 3-core slim package (#317) (#343) * Prepare module-migration-03 removal of old built-in modules * feat(core): delete specfact-project module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-backlog module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-codebase module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-spec module source from core (migration-03) Made-with: Cursor * feat(core): delete specfact-govern module source from core (migration-03) Made-with: Cursor * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests * Prepare module-migration-03 removal of old built-in modules * Prepare module-migration-03 removal of old built-in modules * chore(tests): skip tests for removed modules when source absent (migration-03) Add pytest.importorskip() for backlog, plan, sync, enforce, generate, patch_mode, import_cmd so tests are skipped when module source was removed from core. Preserves tests for later move to specfact-cli-modules. Update tasks.md and TDD_EVIDENCE.md for Task 10 completion. Made-with: Cursor * feat(bootstrap): remove flat shims and non-core module registrations (migration-03) - Remove _register_category_groups_and_shims (unconditional category/shim registration). - Trim CORE_MODULE_ORDER to 4 core: init, auth, module-registry, upgrade. - Add @beartype to _mount_installed_category_groups. - Category groups and flat shims only for installed bundles via _mount_installed_category_groups. Made-with: Cursor * docs(openspec): mark Task 11.4 done in tasks.md Made-with: Cursor * feat(cli): conditional category group mount from installed bundles (migration-03) - Add _RootCLIGroup (extends ProgressiveDisclosureGroup) with resolve_command override: unknown commands in KNOWN_BUNDLE_GROUP_OR_SHIM_NAMES show actionable error (not installed + specfact init / specfact module install). - Root app uses cls=_RootCLIGroup. Main help docstring adds init/module install hint for workflow bundles. Made-with: Cursor * docs(openspec): mark Task 12.4 done in tasks.md Made-with: Cursor * feat(init): enforce mandatory bundle selection and profile presets (migration-03) * Add module removal core tests * docs(openspec): record Task 14 module signing gate (migration-03) * feat: complete module-migration-03 core slimming and follow-up alignment (#317) * Fix format error * fix: handle detached HEAD registry branch selection and stabilize migration-03 CI tests * feat(core): remove auth module from core and route auth via backlog (migration-03) * docs(openspec): update migration-03 PR status and tracking * docs(openspec): finalize migration-03 checklist and defer non-blocking gates * Fix remaining auth findings and dependency in core cli --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive module-migration-03 change * feat: remove flat command shims (category-only CLI) (#344) * feat: remove flat command shims from grouped registry * Finalize change module-migration-04 implementation --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived module-migration-04 and updated specs * docs(openspec): finalize module-migration-05 tracking after modules PR merge (#345) * Implement blockers to prepare for module-migration-03 change. * Update migration change * docs(openspec): close migration-05 PR tracking and change order --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archive module-migration-05 change and update specs * test(migration-06): move legacy sync tests out of core (#346) * feat(migration-06): core decoupling cleanup - boundary tests and inventory - Add test_core_does_not_import_from_bundle_packages boundary regression test - Update spec with ownership boundary and migration acceptance criteria - Add CORE_DECOUPLING_INVENTORY.md (keep/move/interface classification) - Record TDD evidence in TDD_EVIDENCE.md - Update docs/reference/architecture.md with core vs modules-repo boundary - Update openspec/CHANGE_ORDER.md status No move candidates identified; core already decoupled from bundle packages. Boundary test prevents future core->bundle coupling. Refs #338 Made-with: Cursor * chore(migration-06): mark all tasks complete Made-with: Cursor * feat(migration-06): extend scope - migrate package-specific artifacts per #338 - Add MIGRATION_REMOVAL_PLAN.md with phased removal of MIGRATE-tier code - Add test_core_modules_do_not_import_migrate_tier boundary test - Remove templates.bridge_templates (dead code; only tests used it) - Remove tests/unit/templates/test_bridge_templates.py - Update CORE_DECOUPLING_INVENTORY.md with removal status - Update spec with MIGRATE-tier enforcement and package-specific removal Phase 1 complete. Further MIGRATE-tier removal documented in plan. Refs #338 Made-with: Cursor * test(migration-06): move legacy sync tests out of core --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived module-migration-06 change and updated specs * test: module-migration-07 core test ownership cleanup (#347) * test: finalize module-migration-07 core test ownership cleanup * docs: mark module-migration-07 quality and PR tasks complete * test: fix CI isolation failures for project and persona merge * test: narrow migrated skips and restore core registry guardrails * test: stabilize core CI by refining skips and bootstrap checks * test: fix remaining PR failures via targeted core filtering * fix: harden module package checks against import-mode class identity * test: stabilize core slimming integration assertions --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived backlog-core-07 change and updated specs * Update some docs and archive latest finished changes and specs * Add docs update change * feat: add agile-01-feature-hierarchy change and update CHANGE_ORDER.md (#376) - Create openspec/changes/agile-01-feature-hierarchy/ with proposal.md and tasks.md - Add Epics #256 (Architecture Layer Integration), #257 (AI IDE Integration), and #258 (Integration Governance and Dogfooding) to CHANGE_ORDER.md parent issues table - 25 GitHub Feature issues created (#351-#375), linked to their parent Epics - Feature label created; issue #185 closed (ceremony-cockpit-01, archived 2026-02-18) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: align core docs and sync pending changes (#377) * docs: align core docs and sync pending changes * fix: preserve partial staging in markdown autofix hook --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: stabilize release test suite after module migration * Update module * Fix module install * Fix module install * Fix failed tests * Fix marketplace client regression * Fix install regression for specfact-cli (#380) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add changes to improve runtime validation and backlog module remaining migration to module * refactor: remove backlog ownership from core cli (#384) * refactor: remove backlog ownership from core cli * fix: align CI marketplace validation paths * test: stabilize command audit validation and add command-surface change --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add new command alignment change * fix: finalize cli runtime validation regressions (#387) * fix: finalize cli runtime validation regressions * test: align satisfied dependency logging assertions --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive cli-val-07 change * Archive changes and update specs * Add code-review change proposals * test: align command surface regression coverage * docs: add OpenSpec change for backlog-core commands migration (#390) * feat: add OpenSpec change for backlog-core commands migration Change: backlog-02-migrate-core-commands - Add proposal, design, tasks, specs - Add TDD_EVIDENCE.md with implementation progress - GitHub Issue: #389 Rules applied: AGENTS.md Git Worktree Policy, TDD Hard Gate Made-with: Cursor * docs: update TDD_EVIDENCE and tasks for quality gate results Made-with: Cursor * docs: update TDD_EVIDENCE with test fix results Made-with: Cursor * docs: update TDD_EVIDENCE with all test fixes complete Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: use POST instead of PATCH for ADO work item creation (#391) * fix: use POST instead of PATCH for ADO work item creation Azure DevOps API requires POST (not PATCH) for creating work items. Also fixed category grouping to always register group commands. Made-with: Cursor * docs: add changelog entry for ADO POST fix Made-with: Cursor * chore: bump version to 0.40.4 Made-with: Cursor * fix: update test mocks from PATCH to POST for ADO create - Reverted incorrect unconditional _mount_installed_category_groups call - Updated test_create_issue mocks to use requests.post instead of requests.patch Made-with: Cursor * test: skip category group test when bundles not installed The test_bootstrap_with_category_grouping_disabled_registers_flat_commands test expects bundles like specfact-codebase to be installed, but in CI they may not be. Added pytest.skip() when 'code' command is not available. Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive backlog-02-migrate-core-commands change - Archived backlog-02-migrate-core-commands change - Updated CHANGE_ORDER.md with implementation status - Updated main specs with backlog-add, backlog-analyze-deps, backlog-delta, backlog-sync, backlog-verify-readiness Made-with: Cursor * feat: document code-review module scaffold (#410) * feat: document code-review module scaffold * chore: sync 0.41.0 release version artifacts --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add change for project codebase ownership * Realign code import ownership surface (#412) * Realign code import ownership surface * Harden temp registry command audit test --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Update code review changes * docs: update reward ledger OpenSpec tracking (#413) Link the existing change issue, record TDD evidence, and align the OpenSpec artifacts with the bundle-owned DDL and paired worktree implementation flow. Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Track house-rules skill OpenSpec changes (#414) Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: Update change-proposal for code-review-07 (#415) * Track house-rules skill OpenSpec changes Made-with: Cursor * Cursor: Apply local changes for cloud agent --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Finalize code-review-07 status * Finalize code-review-08 status * feat: apply code-review-09 pre-commit integration * fix: fall back when cached hatch test env is broken * fix: avoid hatch env for coverage xml export * fix: install type-check and lint tools directly in CI * fix: install pytest fallback deps in test job * fix: install pytest-cov for test fallback path * Finalize code-review-09 status * [Change] Align core docs with modules site ownership (#419) * Align core docs with modules site ownership * Close docs portal change PR task --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden docs parity URL assertions * Archive finished changes and update specs * docs: fix command syntax parity after lean-core/modules split (v0.42.2) (#421) Replace all stale CLI syntax families in authored docs with current shipped commands. Adds docs parity tests that guard against regression. Removed syntax families corrected: - specfact project plan → project devops-flow / project snapshot / govern enforce sdd - project import from-bridge → code import from-bridge - specfact backlog policy → backlog verify-readiness / backlog refine - specfact spec contract → spec validate / spec generate-tests / spec mock - specfact spec sdd constitution → govern enforce sdd [BUNDLE] - spec generate <prompt-subcommands> → AI IDE skills or removed Updated docs: README.md, docs/index.md, docs/README.md, docs/reference/commands.md (+4 reference docs), docs/getting-started/ (4 files), docs/guides/ (21 files), docs/examples/ (5 files), docs/prompts/ (2 files). Added 11 new docs parity tests in test_release_docs_parity.py: - 7 tests asserting removed syntax families stay absent - 4 tests asserting current command families remain documented Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Archive finished changes and update specs - Archive docs-03-command-syntax-parity (2026-03-18) - Sync delta specs: cli-output + documentation-alignment updated with post-split command-surface alignment requirements and scenarios - Update CHANGE_ORDER.md: mark docs-03 as archived Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update evidence * Potential fix for pull request finding 'Unused global variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * docs: align core docs ownership and parity (#424) * docs: fix command syntax parity after lean-core/modules split (v0.42.2) Replace all stale CLI syntax families in authored docs with current shipped commands. Adds docs parity tests that guard against regression. Removed syntax families corrected: - specfact project plan → project devops-flow / project snapshot / govern enforce sdd - project import from-bridge → code import from-bridge - specfact backlog policy → backlog verify-readiness / backlog refine - specfact spec contract → spec validate / spec generate-tests / spec mock - specfact spec sdd constitution → govern enforce sdd [BUNDLE] - spec generate <prompt-subcommands> → AI IDE skills or removed Updated docs: README.md, docs/index.md, docs/README.md, docs/reference/commands.md (+4 reference docs), docs/getting-started/ (4 files), docs/guides/ (21 files), docs/examples/ (5 files), docs/prompts/ (2 files). Added 11 new docs parity tests in test_release_docs_parity.py: - 7 tests asserting removed syntax families stay absent - 4 tests asserting current command families remain documented Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: align core docs ownership and parity --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: fix quickstart install guidance * docs: remove generated project plan docs * Add code-review change * fix: preserve native backlog import payloads (#429) * fix: preserve native backlog import payloads * fix: preserve imported proposal ids on reimport --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: add docs review workflow and repair docs links (#428) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: keep imported change ids stable across title changes (#431) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: remove conflicting pages file copies * Add docs sync changs * docs: update openspec clean-code planning * Update change status * fix: code-review-zero-findings dogfood remediation (v0.42.3) (#435) * fix: continue code review remediation and align module signing * fix: complete code-review-zero-findings dogfood remediation (v0.42.3) Eliminates full-scope code review findings (types, Radon CC, contracts, lint) and records OpenSpec change code-review-zero-findings with tests and CHANGELOG. Module manifests may need re-signing before merge per project policy. Made-with: Cursor * chore: re-sign bundled modules after content changes * fix: resolve review follow-up regressions * fix: run ci smart-test directly * fix: restore ci test progress output * fix: stabilize command audit ci test --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add docs refactoring changes * Add bug change tracking for encoding and resources * docs: restructure core site IA to 6-section progressive nav (#442) * docs: restructure core site IA from 5 flat sections to 6 progressive sections Restructure docs.specfact.io from a flat 5-section sidebar to a 6-section progressive navigation: Getting Started, Core CLI, Module System, Architecture, Reference, Migration. - Create docs/core-cli/, docs/module-system/, docs/migration/ directories - Move 12 files to correct new sections with jekyll-redirect-from entries - Write 3 new CLI reference pages: init.md, module.md, upgrade.md - Replace first-steps.md with focused 5-minute quickstart - Rewrite index.md as portal landing with core vs modules delineation - Rewrite getting-started/README.md to link module tutorials to modules site - Update sidebar navigation in _layouts/default.html - Delete 6 obsolete files (competitive-analysis, ux-features, common-tasks, workflows, testing-terminal-output, guides/README) - Add documentation-alignment delta spec for core-only focus policy Implements: #438 OpenSpec: docs-05-core-site-ia-restructure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: fix broken internal links after IA restructure Update all relative links across 40 files to point to new file locations: - ../reference/architecture.md → ../architecture/overview.md - ../reference/debug-logging.md → ../core-cli/debug-logging.md - ../reference/modes.md → ../core-cli/modes.md - guides/ sibling links → ../module-system/ or ../migration/ - module-system/ back-links → ../guides/ - Remove links to deleted files (common-tasks, workflows) - first-steps.md → quickstart.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update test path for moved bootstrap-checklist and fix remaining broken links - Update test_module_bootstrap_checklist_uses_current_bundle_ids to use new path docs/module-system/bootstrap-checklist.md - Fix 2 remaining command-chains.md anchor links in migration-guide.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: harden cross-platform runtime and IDE resource discovery (#443) * fix: harden cross-platform runtime and IDE resource discovery * fix: bump patch version to 0.42.4 * fix: restore init lifecycle compatibility --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: resolve review type-safety findings * Improve clarity and scope of ide prompt change * feat(init): IDE prompt source catalog, --prompts, namespaced exports (#445) * feat(init): IDE prompt source catalog, --prompts, namespaced exports Implement init-ide-prompt-source-selection: discover core + module prompts, default export all sources, interactive multi-select, non-interactive --prompts, source-namespaced IDE paths. Fix project module roots to use metadata source project. Extend discovery roots with user/marketplace. Update startup_checks for nested exports. Bump init module to 0.1.14 with signed manifest. Made-with: Cursor * fix(init): scope VS Code prompt recommendations to exported sources - Pass prompts_by_source into create_vscode_settings from copy_prompts_by_source_to_ide - Strip prior .github/prompts/* recommendations on selective export to avoid stale paths - Extract helpers for catalog paths and fallbacks; keep code review clean Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix tests * release: bump version to 0.42.5 and update CHANGELOG - Remove [Unreleased] sections; fold historical arch-08 notes under [0.34.0] - Document init ide catalog, VS Code recommendations, integration test isolation Made-with: Cursor * Fix review findings * feat(init): selective IDE prompt export cleanup and VS Code recommendation strip - Prune stale exports and unselected catalog segments in copy_prompts_by_source_to_ide - Strip only specfact*.prompt.md under .github/prompts/ when merging VS Code settings - Tighten e2e missing-templates assertions to match CLI output - Add unit tests for prompt path helper and selective export behavior Made-with: Cursor * Fix review findings * Add missing import * Bump patch version and changelog * Fix failed tests * Fix review findings * docs: core vs modules URL contract and OpenSpec alignment (#448) * docs: add core vs modules URL contract and OpenSpec alignment Document cross-site permalink rules in docs/reference, extend documentation-alignment and module-docs-ownership specs, update docs-07 and openspec config, and note the dependency on modules URL policy in CHANGE_ORDER. Made-with: Cursor * docs: convert core handoff pages to modules canonical links (docs-07) - Replace 20 duplicate guides/tutorials with thin summaries, prerequisites, and links to modules.specfact.io per URL contract - Add docs/reference/core-to-modules-handoff-urls.md mapping table - Align OpenSpec documentation-alignment spec delta with ADDED Requirements - Complete docs-07-core-handoff-conversion tasks checklist Refs: #439 Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat(docs-12): docs command validation and cross-site link checks (#449) * feat(docs-12): docs command validation and cross-site link checks - Add check-docs-commands (Typer CliRunner prefix + --help) and exclusions for migration/illustrative pages - Add check-cross-site-links with robust URL extraction; warn-only in docs-validate and CI while live site may lag - Extend docs-review: Hatch env, validation steps, pytest tests/unit/docs/ - Opt-in handoff map HTTP test (SPECFACT_RUN_HANDOFF_URL_CHECK=1) - OpenSpec deltas, TDD_EVIDENCE, tasks complete; CHANGELOG [Unreleased] Made-with: Cursor * fix(docs-validate): strip leading global flags before command path - Parse --mode/--input-format/--output-format + value, then other root flags - Add test for specfact --mode copilot import from-code … - Fix showcase docs: hatch run contract-test-exploration (not specfact) Made-with: Cursor * fix(docs-12): harden link/command validators and spec wording - Capitalize Markdown in cross-site link spec requirement - Cross-site: redirect-only HTTP success, UTF-8 read failures, URL delimiter/trim fixes - Docs commands: catch Typer exceptions on --help, UTF-8 read failures - Tests: shared loader for check-cross-site-links module Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix(scripts): CliRunner without mix_stderr for Click 8.3+ compatibility (#451) Default CliRunner() merges stderr into stdout; read stdout only so accessing result.stderr does not raise when streams are combined. Made-with: Cursor Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: review gates (semgrep print, radon CC, icontract, questionary types) (#452) * fix: satisfy review gates for docs scripts and module_lifecycle typing - Replace print() with Rich Console in docs validation scripts (semgrep) - Split HTTP URL checks and doc scans to reduce cyclomatic complexity (radon) - Add icontract require/ensure on public helpers; use CliRunner() without mix_stderr - Cast questionary API for basedpyright reportUnknownMemberType Made-with: Cursor * fix(scripts): address #452 review (HTTP helpers, icontract, CLI streams) - _http_success_code: use int directly after None guard - _response_status: safe getcode via getattr/callable - check-docs: drop @require preconditions duplicated by beartype - _cli_invoke_streams_text: merge stdout + stderr for not-installed detection Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Add speckit adapter alignment change and update affected change specs * feat(adapters): spec-kit v0.4.x adapter alignment (#454) * feat(adapters): spec-kit v0.4.x adapter alignment — extensions, presets, hooks, version detection, 7-command presets Update SpecKitAdapter, ToolCapabilities, BridgeConfig presets, and SpecKitScanner for spec-kit v0.4.3 compatibility: - ToolCapabilities: 5 new optional fields (extensions, extension_commands, presets, hook_events, detected_version_source) - SpecKitScanner: scan_extensions(), scan_presets(), scan_hook_events() with .extensionignore support and defensive JSON parsing - SpecKitAdapter: 3-tier version detection (CLI → heuristic → None), refactored get_capabilities() with reduced cyclomatic complexity - BridgeConfig: all 3 speckit presets expanded from 2 to 7 command mappings (specify, plan, tasks, implement, constitution, clarify, analyze) - 42 new tests across 4 test files (110 targeted, 2248 full suite pass) - Docs updated: comparison matrix, journey guide, integrations overview, adapter development guide Closes #453 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings - Use get_bridge_logger instead of logging.getLogger in speckit adapter and scanner (production command path convention) - Narrow except Exception to except OSError in _load_extensionignore - Simplify redundant base_path conditional in get_capabilities - Use SimpleNamespace instead of dynamic type() in tests - Add subprocess.TimeoutExpired and OSError exception tests for CLI version detection - Fix duplicate MD heading in bridge-adapter spec - Add blank lines after markdown headings in proposal (MD022) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump version to 0.43.0 for spec-kit v0.4.x alignment (#455) * chore: bump version to 0.43.0 and add changelog entry Minor version bump for spec-kit v0.4.x adapter alignment feature. Syncs version across pyproject.toml, setup.py, and __init__.py. Adds changelog entry documenting new capabilities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Sync deps and fix changelog * Sync deps and fix changelog --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix(packaging): remove workflow prompts from core wheel (packaging-02 #441, v0.43.1) (#456) * fix(packaging): drop duplicate workflow prompts from core wheel (packaging-02 3.5) Remove resources/prompts from wheel force-include and repo tree; canonical copies remain in specfact-cli-modules bundles. Align startup IDE drift checks and init template resolution with discover_prompt_template_files. Bump to 0.43.1; re-sign init module 0.1.19. Update CHANGELOG, docs, OpenSpec. Made-with: Cursor * fix: address PR review (changelog, TDD evidence, startup checks, tests) - Changelog 0.43.1 header uses Unreleased until release tag - TDD_EVIDENCE: pre-fail block for Task 3.5 before passing verification - TemplateCheckResult.sources_available; skip last_checked_version bump when no discoverable prompts; drift missing only when source exists - Integration _fake_discover respects include_package_fallback - test_validate_all_prompts uses tmp_path; re-enable file in default test run - test_print_startup_checks_version_update_no_type uses stale version timestamp Made-with: Cursor * fix: address follow-up PR review (startup metadata, tests) - Use ide_dir directly in TemplateCheckResult when IDE folder exists - Set last_checked_version only after successful template-source checks - Integration test: assert discover_prompt_template_files fallback + stable startup patches - validate_all_prompts test: valid vs invalid specfact.*.md outcomes Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Potential fix for pull request finding 'Empty except' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Fix changelog version * docs: unify core docs portal UX (#459) * docs: unify core docs portal UX * Fix docs-13 core review findings * Address docs-13 PR review feedback * Address follow-up docs review feedback --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Harden docs home URL test assertion * feat: doc frontmatter validation, v0.43.2 review JSON gate, and pre-commit review UX (#463) * chore(release): v0.43.2 pre-commit review JSON + OpenSpec dogfood rules - Pre-commit gate writes ReviewReport JSON to .specfact/code-review.json - openspec/config.yaml: require fresh review JSON and remediate findings - Docs and unit tests updated Made-with: Cursor * fix: CodeRabbit — changelog, openspec TDD_EVIDENCE freshness, review hook timeout - CHANGELOG 0.43.2: expanded entries, line wrap - openspec/config.yaml: exclude TDD_EVIDENCE.md from review JSON staleness - pre_commit_code_review: timeout 300s, TimeoutExpired handling - tests: exact cwd, timeout assertion and timeout failure test Made-with: Cursor * Add code review to pre-commit and frontmatter docs validation * Improve pre-commit script output * Improve specfact code review findings output * Fix review findings * Improve pre-commit hook output * Enable dev branch code review * Update code review hook * Fix contract review findings * Fix review findings * Fix review warnings * feat: doc frontmatter hardening and code-review gate fixes - Typer CLI for doc-frontmatter-check; safer owner resolution (split helpers for CC) - Strict exempt handling; pre-commit hook matches USAGE-FAQ.md; review script JSON typing - Shared test fixtures/types; integration/unit test updates; OpenSpec tasks and TDD evidence - Changelog: pre-commit code-review-gate UX note Made-with: Cursor * Fix test failures and add docs review to github action runner * Fix test failure due to UTF8 encoding * Apply review findings * Optimize pr orchestrator runtime * Optimize pr orchestrator runtime * Fix caching on pr-orchestrator --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * docs: archive doc-frontmatter-schema openspec change * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * fix: restore protocol stubs for type checking * Add frontamtter check * fix: harden protocol stubs for code quality * Add PR test hardening change * fix: remediate review findings and harden review gates * fix: rebuild review report model for pydantic * Add story and onboarding change * Update change tracking * Improve scope for ci/cd requirements * docs: sharpen first-contact story and onboarding (#467) * docs: sharpen first-contact story and onboarding * docs: address first-contact review feedback * docs: address onboarding review fixes * test: accept default-filtered site tokens in docs parity * docs: record completed onboarding quality gates * test: improve first-contact assertion failures --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: harden review blockers and bump patch version * test: harden modules docs url assertions * fix: harden trustworthy green checks (#469) * fix: harden trustworthy green checks * fix: restore contract-first ci repro command * fix: apply CodeRabbit auto-fixes Fixed 3 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * fix: resolve CI failures for trustworthy green checks PR - Use hatch run contract-test instead of specfact code repro in CI (CLI bundle not available in CI environment) - Allow test_bundle_import.py in migration cleanup legacy-import check (_bundle_import is an internal helper, not a removed module package) - Fix formatting in test_trustworthy_green_checks.py (CodeRabbit commit was unformatted) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings - Add trailing newline to TDD_EVIDENCE.md (MD047) - Make _load_hooks() search for repo: local instead of assuming index 0 - Replace fragile multi-line string assertion in actionlint test with semantic line-by-line checks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review findings for ci-02 (#471) - Widen workflow_changed filter to include scripts/run_actionlint.sh and scripts/yaml-tools.sh so Workflow Lint triggers on script changes - Pin actionlint default to v1.7.11 (matches CI) instead of latest - Fix run_actionlint.sh conflating "not installed" with "lint failures" by separating availability check from execution - Restore sys.path after test_bundle_import to avoid cross-test leakage - Normalize CHANGE_ORDER.md status format to semicolon convention Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: propagate docker actionlint exit code instead of masking failures (#472) Simplify run_actionlint.sh control flow so both local and docker execution paths propagate actionlint's exit code via `exit $?`. Previously the docker path used `if run_with_docker; then exit 0; fi` which treated lint errors as "docker unavailable" and fell through to install guidance. Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * fix: assert hook id stability and cd to repo root for local actionlint (#473) - Assert hook id == "specfact-smart-checks" to prevent silent renames - cd to REPO_ROOT before running local actionlint so it finds workflows regardless of caller's cwd Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * feat: clean-code-01-principle-gates — 7-principle charter gates, v0.44.0 (#474) * feat: clean-code-01-principle-gates — 7-principle charter gates, v0.44.0 Implements openspec/changes/clean-code-01-principle-gates: - Rewrote .cursor/rules/clean-code-principles.mdc as a canonical alias surface for the 7-principle clean-code charter (naming, kiss, yagni, dry, solid) defined in nold-ai/specfact-cli-modules. Documents Phase A KISS thresholds (>80 warning / >120 error LOC), nesting-depth and parameter-count checks active, and Phase B (>40/80) explicitly deferred. - Added Clean-Code Review Gate sections to AGENTS.md and CLAUDE.md listing all 5 expanded review categories and the Phase A thresholds. - Created .github/copilot-instructions.md as a lightweight alias (< 30 lines) referencing the canonical charter without duplicating it inline. - Added unit tests (test_clean_code_principle_gates.py) covering all three spec scenarios: charter references, compliance gate, LOC/nesting thresholds. - TDD evidence recorded in openspec/changes/clean-code-01-principle-gates/TDD_EVIDENCE.md. - Bumped version 0.43.3 → 0.44.0 (minor — feature branch). - Updated CHANGELOG.md and openspec/CHANGE_ORDER.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: clean-code-01-principle-gates review findings and broad exception handling\n\n- Fix coderabbitai review findings:\n - Clarify T20 and W0718 are aspirational in clean-code-principles.mdc\n - Add language specifier to TDD_EVIDENCE.md fenced code block\n - Update test to check all 7 canonical principles\n - Make LOC threshold assertion more specific\n- Improve exception handling throughout codebase:\n - Replace broad except Exception with specific exceptions\n - Apply SOLID principle for better error handling\n- Update tasks.md to reflect completion status\n\nFixes #434\n\nGenerated by Mistral Vibe.\nCo-Authored-By: Mistral Vibe <vibe@mistral.ai> --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: archive completed openspec changes and update main specs Archive 11 completed OpenSpec changes: - bugfix-02-ado-import-payload-slugging - ci-02-trustworthy-green-checks - clean-code-01-principle-gates - code-review-zero-findings - docs-04-docs-review-gate-and-link-integrity - docs-05-core-site-ia-restructure - docs-07-core-handoff-conversion - docs-12-docs-validation-ci - docs-13-core-nav-search-theme-roles - docs-14-first-contact-story-and-onboarding - init-ide-prompt-source-selection - packaging-02-cross-platform-runtime-and-module-resources - speckit-02-v04-adapter-alignment Fix spec validation errors: - Add proper delta headers (ADDED/MODIFIED/REMOVED/RENAMED) - Use correct scenario format with GIVEN/WHEN/THEN bullets - Ensure requirement headers match between delta and main specs - Use correct operation type based on existing requirements Update main specs with archived changes: - backlog-adapter: various updates - bridge-adapter: Spec-Kit v0.4.x capabilities - bridge-registry: BridgeConfig preset updates - code-review-module: new requirements - debug-logging: enhancements - devops-sync: improvements - documentation-alignment: core vs modules separation - review-cli-contracts: new contracts - review-run-command: command updates Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> * Add new user onboarding change * docs & tooling: new user onboarding + smart-test and pre-commit review fixes (#477) * Fix content for install, sync, uninstallä * test(docs): align first-contact contracts and stabilize module CLI tests - docs/index: restore Why does it exist?, tagline, OpenSpec, canonical core CLI story - Update init profile tests for solo-developer + install all (code-review, six bundles) - Lean help test accepts uvx init hint; upgrade/core_compatibility tests match runtime - Autouse fixture re-bootstraps CommandRegistry after category-group tests - Rebase tasks conflict resolved; TDD_EVIDENCE + tasks for gates 7.1/7.2/12.1/12.2 Made-with: Cursor * fix(tools): smart-test baseline and pre-commit single code-review run - Run full suite when smart-test cache has no last_full_run; force+auto falls back to full when incremental is a no-op - Pre-commit: invoke pre_commit_code_review.py once (no xargs split) so .specfact/code-review.json is not clobbered - Tests and OpenSpec tasks for docs-new-user-onboarding Made-with: Cursor * test: fix CI backlog copy assertions and module install test isolation - Align backlog not-installed tests with solo-developer init guidance (no <profile> placeholder) - Autouse: reset CommandRegistry, register_builtin_commands, rebuild_root_app_from_registry so module install tests work after registry-only clears Made-with: Cursor * docs: README wow path + tests locking entrypoint with docs - README leads with uvx init + code review run --scope full; pip install secondary - Unit contract tests: README and docs/index.md share canonical uvx strings and order - E2E: init --profile solo-developer in temp git repo; registry ready for step two with mock bundles Made-with: Cursor * feat(init): solo-developer includes code-review bundle and marketplace install - Add specfact-code-review to canonical bundles and solo-developer preset - Install marketplace module nold-ai/specfact-code-review via install_bundles_for_init - Docs index: core CLI story and default starting point copy for parity tests - CLI: missing-module hint references solo-developer profile - smart_test_coverage: icontract requires use (self, test_level) for method contracts - Re-sign init and module_registry manifests; tests and registry updates Made-with: Cursor * fix(tools): align _run_changed_only with tuple return and baseline full run - Return (success, ran_any) from _run_changed_only; run full suite when no last_full_run - run_smart_tests(auto, force): fall back to full tests when incremental ran nothing - Fix wow e2e fixture typing (Iterator[None]) for basedpyright Unblocks PR #477 CI: type-check, tests, lint job. Made-with: Cursor * chore(release): bump to 0.45.1 and update OpenSpec tasks status - Sync version across pyproject.toml, setup.py, and __init__ modules - Changelog: 0.45.1 entry for dependency profiles, smart-test baseline, CI, UX - openspec: rolling status snapshot and task checkboxes for PR verification - Includes prior branch work: init/profile, module registry, docs entry path, workflows Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * fix: code-review gate (Typer params), typer<0.24 vs semgrep, module upgrade tests (#479) * fix: code-review gate (Typer params), typer<0.24 vs semgrep, module upgrade tests - Split root/install Typer callbacks into merged param stubs (KISS param count). - Patch typer.main via importlib; merge install param specs in module_registry. - Cap typer<0.24 to stay compatible with semgrep click~=8.1.8. - Invoke module_registry app directly in upgrade CLI tests (root app may lack module group). - Refactors for first_run_selection, module_packages, registry tests, semgrep README. Worktree: specfact-cli-worktrees/bugfix/code-review-cli-tests Made-with: Cursor * docs: use code import in examples (flat import removed from CLI) Replace specfact [--flags] import from-code with specfact [--flags] code import from-code so check-docs-commands matches the nested Typer path after removing the flat import shim. Made-with: Cursor * Fix review findings --------- Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: restructure README for star conversion (#480) * docs: restructure readme for star conversion Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: sync readme change tracking Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: relocate readme support artifacts Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: fix readme workflow snippet and pin demo capture Co-authored-by: Dom <djm81@users.noreply.github.com> * docs: address remaining readme review findings Co-authored-by: Dom <djm81@users.noreply.github.com> --------- Co-authored-by: Dom <djm81@users.noreply.github.com> * archived implemented changes * Archive and remove outdated changes * Split and refactor change proposals between both repos * Archive alignment change * Add changes and github hierarchy scripts * feat: add GitHub hierarchy cache sync (#492) * feat: add github hierarchy cache sync * Backport improvements from modules scripts * Fix review findings * Make github sync script executable --------- Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * [codex] Compact agent governance loading (#493) * feat: compact agent governance loading * docs: mark governance PR task complete * docs: sync governance-03 github issue metadata * fix: restore dev branch governance block * Apply review findings * docs: add sibling internal wiki context for OpenSpec design Point AGENTS.md, Claude/Copilot/Cursor surfaces, and the OpenSpec rule at docs/agent-rules/40-openspec-and-tdd.md to read-only wiki paths (hot.md, graph.md, concepts) via absolute paths when specfact-cli-internal is present. Update INDEX applicability notes and extend governance tests. Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Archived github hierarchy change * Update rules for openspec archive * Potential fix for pull request finding 'Unused local variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dom <39115308+djm81@users.noreply.github.com> * Add wiki update notes * Archive governance-03 change, format markdown, add wiki instructions for update * Fix review findings * Fix type errors * fix: safe VS Code settings merge and project artifact writes (#490) (#496) * fix: safe merge for VS Code settings.json on init ide (profile-04) - Add project_artifact_write.merge_vscode_settings_prompt_recommendations with fail-safe on invalid JSON / bad chat shape; --force backs up to .specfact/recovery/ then replaces. - Route ide_setup create_vscode_settings through helper; thread force; catch errors for CLI exit. - Lint gate: scripts/verify_safe_project_writes.py blocks json.load/dump in ide_setup.py. - Tests, installation docs, 0.45.2 changelog and version pins. OpenSpec: profile-04-safe-project-artifact-writes Made-with: Cursor * fix(profile-04): satisfy review gate, pin setuptools for semgrep - Refactor project_artifact_write merge path (KISS); icontract predicates - Deduplicate ide_setup prompt helpers; import from project_artifact_write - verify_safe_project_writes: ast.walk, contracts, beartype - Pin setuptools<82 for Semgrep pkg_resources chain - Update TDD_EVIDENCE and tasks checklist Made-with: Cursor * ci: run safe-write verifier in PR orchestrator lint job Match hatch run lint by invoking scripts/verify_safe_project_writes.py after ruff/basedpyright/pylint. Use set -euo pipefail so the first lint failure is not masked by later commands. Made-with: Cursor * fix(profile-04): address CodeRabbit review (docs, guard, contracts, tests) - Wrap installation.md VS Code merge paragraph to <=120 chars per line - tasks 4.7 + TDD_EVIDENCE: openspec validate --strict sign-off - verify_safe_project_writes: detect from-json import and aliases - settings_relative_nonblank: reject absolute paths and .. segments - ide_setup: _handle_structured_json_document_error for duplicate handlers - ProjectWriteMode docstring (reserved policy surface); backup stamp + collision loop - Tests: malformed settings preserved on init ide exit; force+chat coercion; AST guard tests Made-with: Cursor * fix(profile-04): JSON5 settings, repo containment, review follow-ups - merge_vscode_settings: resolve containment before mkdir/write; JSON5 load/dump (JSONC comments; trailing_commas=False for strict JSON output) - ide_setup: empty prompts_by_source skips catalog fallback (_finalize allow_empty_fallback) - verify_safe_project_writes: detect import json as js attribute calls - contract_predicates: prompt_files_all_strings accepts list[Any] for mixed-type checks - Tests: symlink escape, JSONC merge, empty export strip, import-json-as-js guard - tasks.md / TDD_EVIDENCE: wrap lines to <=120 chars; CHANGELOG + json5 dep + setup.py sync Made-with: Cursor * docs(profile-04): tasks pre-flight + full pytest; narrow icontract ensure - tasks 1.1: hatch env create then smart-test-status and contract-test-status - tasks 4.3: add hatch test --cover -v to quality gates - TDD_EVIDENCE: shorter module-signatures and report lines (<=120 cols) - project_artifact_write: isinstance(result, Path) in @ensure postconditions Made-with: Cursor * fix: clear specfact code review on safe-write modules - verify_safe_project_writes: flatten json binding helpers; stderr writes instead of print; inline Import/ImportFrom loops to drop duplicate-shape DRY - project_artifact_write: _VscodeChatMergeContext dataclass (KISS param count); typed chat_body cast before .get for pyright Made-with: Cursor * docs(profile-04): record hatch test --cover -v in TDD_EVIDENCE Align passing evidence with tasks.md 4.3 full-suite coverage gate. Made-with: Cursor * fix: reduce KISS blockers (bridge sync contexts, tools, partial adapters) Refactors high-parameter call sites into dataclasses/context objects and splits hot spots (export devops pipeline, smart_test_coverage incremental run, suggest_frontmatter, crosshair summary loop). API: BridgeSync.export_change_proposals_to_devops(adapter_type, ExportChangeProposalsOptions | None); LoggerSetup.create_logger(name, LoggerCreateOptions | None); run_crosshair(path, CrosshairRunOptions | None). Full specfact code review --scope full still reports error-severity kiss/radon findings (remaining nesting/LOC and param counts in ADO, analyzers, generators, source_scanner, module_installer, bundle-mapper, etc.). Gate PASS requires follow-up. Made-with: Cursor * Fix review findings and sign modules * fix(tests): register dynamic check_doc_frontmatter module; align _update_cache tests - Insert check_doc_frontmatter into sys.modules before exec_module so dataclasses can resolve string annotations (fixes Docs Review / agent rules governance fixture). - Call SmartCoverageManager._update_cache with _SmartCacheUpdate after signature refactor (fixes basedpyright reportCallIssue). Made-with: Cursor * fix(tests): align install_module mocks with InstallModuleOptions; register verify_bundle script - Monkeypatch/patch fakes now accept (module_id, options=None) matching install_module(module_id, InstallModuleOptions(...)). - Read install_root, trust_non_official, non_interactive, reinstall from InstallModuleOptions in CLI command tests. - Dynamic load of verify-bundle-published registers sys.modules before exec_module (same dataclass annotation issue as check_doc_frontmatter). Made-with: Cursor --------- Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * Fix review findings (#498) Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com> * feat(openspec): add marketplace-06-ci-module-signing change proposal Moves module signing from local interactive requirement to CI step triggered by PR approval (pull_request_review). Eliminates local private key dependency for non-interactive development on feature/dev branches. Trust boundary remains at main. Scope: - NEW .github/workflows/sign-modules-on-approval.yml - MODIFY scripts/pre-commit-smart-checks.sh (branch-aware policy) - MODIFY .github/workflows/pr-orchestrator.yml (split verify by target) - MODIFY .github/workflows/sign-modules.yml (main-only enforcement) GitHub: #500 Parent Feature: #353 (Marketplace Module Distribution) → #194 (Architecture Epic) Paired modules change: specfact-cli-modules#185 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(pre-commit): modular hooks + branch-aware module verify (#501) * chore(pre-commit): modular hooks aligned with specfact-cli-modules - Add scripts/pre-commit-quality-checks.sh (block1 stages + block2; all for manual/shim) - Replace monolithic smart-checks with shim to quality-checks all - .pre-commit-config: fail_fast, verify-module-signatures + check-version-sources, cli-block1-* hooks, cli-block2, doc frontmatter - Match modules: hatch run lint when Python staged; scoped code review paths - CLI extras: Markdown fix/lint, workflow actionlint (no packages/ bundle-import gate) - Bump to 0.46.1; docs: README, CONTRIBUTING, code-review.md, agent-rules/70 Made-with: Cursor * fix(pre-commit): branch-aware module verify hook (marketplace-06 policy) - Add scripts/pre-commit-verify-modules.sh and git-branch-module-signature-flag.sh - Point verify-module-signatures hook at wrapper (script); skip when no staged module paths - pre-commit-quality-checks all: delegate module step to wrapper; safe-change allowlist - Tests + CONTRIBUTING/CHANGELOG alignment Made-with: Cursor * fix(pre-commit): address review — portable quality checks and signature policy - Emit require/omit from git-branch-module-signature-flag; pass --require-signature only on main - Resolve repo root in pre-commit-smart-checks via git rev-parse for .git/hooks copies - Harden pre-commit-quality-checks: ACMR staged paths, pipefail, no xargs -r, safe loops - CHANGELOG/CONTRIBUTING: Added vs Changed; document verifier CLI (no --allow-unsigned) - Tests: omit/require expectations, detached HEAD; shim asserts repo-root exec Made-with: Cursor * docs: align signing and verification docs with verifier CLI - Document checksum-only vs --require-signature; clarify --allow-unsigned is sign-modules.py only - Add pre-commit and CI branch policy to module-security, signing guide, publishing, agent gates - Refresh marketplace-06 OpenSpec proposal/design/tasks/spec delta; openspec validate --strict OK - CHANGELOG: note d…
Summary
Align local pre-commit with specfact-cli-modules (modular hooks,
fail_fast, staged gates,hatch run lintwhen Python is staged, Block 2 review + contract tests) while keeping CLI-only stages (Markdown, workflows, version hook).Follow-up: Branch-aware module verification (
marketplace-06policy) viascripts/pre-commit-verify-modules.shandscripts/git-branch-module-signature-flag.sh— skip when no staged module tree paths;--allow-unsignedoffmain,--require-signatureonmain;--payload-from-filesystem+--enforce-version-bumpwhen run.Commits
chore(pre-commit): modular hooks aligned with specfact-cli-modulesfix(pre-commit): branch-aware module verify hook (marketplace-06 policy)Quality gates (local)
hatch run format,hatch run type-check,hatch run lint,hatch run contract-testNotes
specfact-smart-checks→pre-commit-smart-checks.shshim (pre-commit-quality-checks.sh all).Made with Cursor