-
Notifications
You must be signed in to change notification settings - Fork 0
Promote dev branch updates to main #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9168415
Add openspec changes for docs improvements
djm81 e70d983
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli-modules…
djm81 87a1bee
Merge branch 'main' into dev
djm81 ec0a6cc
Add config for coderabbitai review
djm81 616d16a
Enable dev branch code review
djm81 cff043a
Fix review findings
djm81 0094be4
Improve config and review instructions
djm81 2c22ebe
Add openspec code review skill for mistral vibe2
djm81 a6fc898
expand code review clean-code checks
djm81 488f39f
Fix clean-code review findings
djm81 52f2290
Merge pull request #128 from nold-ai/feature/clean-code-02-expanded-r…
djm81 97e94f5
chore(registry): publish changed modules [skip ci]
github-actions[bot] f7e7ebd
Merge pull request #129 from nold-ai/auto/publish-dev-23772821097
djm81 009106a
Potential fix for pull request finding 'Unused global variable'
djm81 aeb8697
Fix lint issues and improve test coverage as part of clean-code refac…
djm81 dd96cae
Apply suggestions from code review
djm81 7aae2fd
apply codeql fixes
djm81 53c4c3e
Fix code review errors
djm81 b688b49
chore(registry): publish changed modules [skip ci]
github-actions[bot] e551e16
Merge pull request #134 from nold-ai/auto/publish-dev-23823651511
djm81 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
| # | ||
| # CodeRabbit aligns with AGENTS.md: bundle contracts, adapter boundaries to specfact_cli, Hatch gates. | ||
| # `reviews.auto_review.base_branches` includes `dev` so PRs into `dev` are auto-reviewed (not only the | ||
| # repo default branch). See https://docs.coderabbit.ai/reference/configuration (auto_review). | ||
| # Pre-push / finalize: run `cr --base dev` (or `coderabbit review`) from repo root; see | ||
| # https://docs.coderabbit.ai/cli/overview | ||
| # PR description: include `@coderabbitai summary` (default placeholder) for the high-level summary. | ||
| # Linked analysis: pair with nold-ai/specfact-cli (install CodeRabbit app on both repos). | ||
| # | ||
| language: "en-US" | ||
| early_access: false | ||
| tone_instructions: >- | ||
| Prioritize adapter boundaries between bundled modules and specfact_cli core: registry, | ||
| module-package.yaml, signing, and docs parity with modules.specfact.io. Flag cross-repo impact when | ||
| core APIs or contracts change. | ||
|
|
||
| reviews: | ||
| profile: assertive | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| high_level_summary_in_walkthrough: true | ||
| review_details: true | ||
| sequence_diagrams: true | ||
| estimate_code_review_effort: true | ||
| assess_linked_issues: true | ||
| related_issues: true | ||
| related_prs: true | ||
| poem: false | ||
| collapse_walkthrough: true | ||
| changed_files_summary: true | ||
| review_status: true | ||
| commit_status: true | ||
| high_level_summary_instructions: | | ||
| Structure the summary for specfact-cli-modules maintainers: | ||
| - Bundle and module surface: commands, adapters, bridge/runtime behavior vs. specfact_cli APIs. | ||
| - Manifest and integrity: module-package.yaml, semver, signature verification, registry impacts. | ||
| - Cross-repo: required specfact-cli changes, import/contract alignment, dev-deps path assumptions. | ||
| - Docs: modules.specfact.io / GitHub Pages accuracy, documentation-url-contract, CHANGELOG. | ||
| - If applicable: OpenSpec change ID and scenario coverage for module-specific behavior. | ||
| auto_review: | ||
| enabled: true | ||
| drafts: false | ||
| auto_incremental_review: true | ||
| base_branches: | ||
| - "^dev$" | ||
| path_instructions: | ||
| - path: "packages/**/src/**/*.py" | ||
| instructions: | | ||
| Focus on adapter and bridge patterns: imports from specfact_cli (models, runtime, validators), | ||
| Typer/Rich command surfaces, and clear boundaries so core upgrades do not silently break bundles. | ||
| Flag breaking assumptions about registry loading, lazy imports, and environment/mode behavior. | ||
| - path: "packages/**/module-package.yaml" | ||
| instructions: | | ||
| Validate metadata: name, version, commands, dependencies, and parity with packaged src. | ||
| Call out semver and signing implications when manifests or payloads change. | ||
| - path: "registry/**" | ||
| instructions: | | ||
| Registry and index consistency: bundle listings, version pins, and compatibility with | ||
| published module artifacts. | ||
| - path: "src/**/*.py" | ||
| instructions: | | ||
| Repo infrastructure (not bundle code): keep parity with specfact-cli quality patterns; | ||
| contract-first public helpers where applicable; avoid print() in library paths. | ||
| - path: "openspec/**/*.md" | ||
| instructions: | | ||
| Specification truth: proposal/tasks/spec deltas vs. bundle behavior, CHANGE_ORDER, and | ||
| drift vs. shipped modules or docs. | ||
| - path: "tests/**/*.py" | ||
| instructions: | | ||
| Contract-first and integration tests: migration suites, bundle validation, and flakiness. | ||
| Ensure changes to adapters or bridges have targeted coverage. | ||
| - path: ".github/workflows/**" | ||
| instructions: | | ||
| CI: secrets, hatch/verify-modules-signature gates, contract-test alignment, action versions. | ||
| - path: "scripts/**/*.py" | ||
| instructions: | | ||
| Deterministic tooling: signing, publishing, docs generation; subprocess and path safety. | ||
| - path: "tools/**/*.py" | ||
| instructions: | | ||
| Developer tooling aligned with pyproject Hatch scripts and CI expectations. | ||
| - path: "docs/**/*.md" | ||
| instructions: | | ||
| User-facing and cross-site accuracy: Jekyll front matter, links per documentation-url-contract, | ||
| CLI examples matching bundled commands. | ||
|
|
||
| tools: | ||
| ruff: | ||
| enabled: true | ||
| semgrep: | ||
| enabled: true | ||
| yamllint: | ||
| enabled: true | ||
| actionlint: | ||
| enabled: true | ||
| shellcheck: | ||
| enabled: true | ||
|
|
||
| pre_merge_checks: | ||
| title: | ||
| mode: warning | ||
| requirements: "Prefer Conventional Commits-style prefixes (feat:, fix:, docs:, test:, refactor:, chore:)." | ||
| issue_assessment: | ||
| mode: warning | ||
|
|
||
| knowledge_base: | ||
| learnings: | ||
| scope: local | ||
| linked_repositories: | ||
| - repository: "nold-ai/specfact-cli" | ||
| instructions: >- | ||
| Core CLI and shared runtime: Typer app, module registry/bootstrap, specfact_cli public APIs, | ||
| contract-test and bundled-module signing flows. When modules change adapters or contracts, | ||
| flag required core changes, import paths, and coordinated version or signature updates. | ||
|
|
||
| chat: | ||
| auto_reply: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| name: specfact-code-review | ||
| description: House rules for AI coding sessions derived from review findings | ||
| allowed-tools: [] | ||
| --- | ||
|
|
||
| # House Rules - AI Coding Context (v3) | ||
|
|
||
| Updated: 2026-03-16 | Module: nold-ai/specfact-code-review | ||
|
|
||
| ## DO | ||
| - Ask whether tests should be included before repo-wide review; default to excluding tests unless test changes are the target | ||
| - Keep functions under 120 LOC and cyclomatic complexity <= 12 | ||
| - Add @require/@ensure (icontract) + @beartype to all new public APIs | ||
| - Run hatch run contract-test-contracts before any commit | ||
| - Guard all chained attribute access: a.b.c needs null-check or early return | ||
| - Return typed values from all public methods | ||
| - Write the test file BEFORE the feature file (TDD-first) | ||
| - Use get_logger(__name__) from common.logger_setup, never print() | ||
|
djm81 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## DON'T | ||
| - Don't enable known noisy findings unless you explicitly want strict/full review output | ||
| - Don't mix read + write in the same method; split responsibilities | ||
| - Don't use bare except: or except Exception: pass | ||
| - Don't add # noqa / # type: ignore without inline justification | ||
| - Don't call repository.* and http_client.* in the same function | ||
| - Don't import at module level if it triggers network calls | ||
| - Don't hardcode secrets; use env vars via pydantic.BaseSettings | ||
| - Don't create functions > 120 lines | ||
|
djm81 marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## TOP VIOLATIONS (auto-updated by specfact code review rules update) | ||
| <!-- auto-managed: do not edit manually --> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
openspec/changes/clean-code-02-expanded-review-module/TDD_EVIDENCE.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # TDD Evidence | ||
|
|
||
| ## 2026-03-31 | ||
|
|
||
| - `2026-03-31T00:56:00+02:00` Bootstrap: | ||
| `hatch run dev-deps` | ||
| linked the local `specfact-cli` checkout into this worktree so the bundle tests and review runner could execute against the live code. | ||
| - `2026-03-31T01:02:00+02:00` Red phase: | ||
| `SPECFACT_ALLOW_UNSIGNED=1 hatch run pytest tests/unit/specfact_code_review/run/test_runner.py tests/unit/specfact_code_review/tools/test_ast_clean_code_runner.py tests/unit/specfact_code_review/tools/test_radon_runner.py tests/unit/specfact_code_review/tools/test_semgrep_runner.py -q` | ||
| failed with 5 targeted regressions that matched the new spec change: | ||
| - `test_run_review_requires_explicit_pr_mode_token_for_clean_code_reasoning` | ||
| expected `clean-code.pr-checklist-missing-rationale` but `_checklist_findings()` returned `[]`. | ||
| - `test_run_ast_clean_code_reports_mixed_dependency_roles_for_injected_dependencies` | ||
| expected `solid.mixed-dependency-role` for `self.repo.save()` / `self.client.get()` but the leftmost dependency was still treated as `self`. | ||
| - `test_run_ast_clean_code_continues_after_parse_error` | ||
| expected a per-file `tool_error` plus later-file findings, but the parser branch returned early. | ||
| - `test_run_radon_uses_dedicated_tool_identifier_for_kiss_findings` | ||
| expected `tool="radon-kiss"` but the emitted finding still used `tool="radon"`. | ||
| - `test_run_semgrep_returns_tool_error_when_results_key_is_missing` | ||
| expected a `tool_error` for malformed Semgrep JSON, but the runner treated a missing `results` key as a clean run. | ||
| - `2026-03-31T01:04:30+02:00` Implementation: | ||
| updated `packages/specfact-code-review/src/specfact_code_review/run/runner.py`, | ||
| `packages/specfact-code-review/src/specfact_code_review/tools/ast_clean_code_runner.py`, | ||
| `packages/specfact-code-review/src/specfact_code_review/tools/radon_runner.py`, | ||
| `packages/specfact-code-review/src/specfact_code_review/tools/semgrep_runner.py`, | ||
| `packages/specfact-code-review/src/specfact_code_review/resources/skills/specfact-code-review/SKILL.md`, | ||
| `packages/specfact-code-review/src/specfact_code_review/resources/policy-packs/specfact/clean-code-principles.yaml`, | ||
| `docs/modules/code-review.md`, | ||
| and the targeted unit tests so the new clean-code checks, strict PR-mode gating, dependency-root detection, KISS tool labeling, and Semgrep parsing behavior matched the review comments. | ||
| - `2026-03-31T01:06:30+02:00` Green phase: | ||
| `SPECFACT_ALLOW_UNSIGNED=1 hatch run pytest tests/unit/specfact_code_review/run/test_runner.py tests/unit/specfact_code_review/tools/test_ast_clean_code_runner.py tests/unit/specfact_code_review/tools/test_radon_runner.py tests/unit/specfact_code_review/tools/test_semgrep_runner.py -q` | ||
| passed with `50 passed in 20.26s`. | ||
| - `2026-03-31T01:08:11+02:00` Release validation: | ||
| `hatch run verify-modules-signature --require-signature --payload-from-filesystem --enforce-version-bump` | ||
| passed after the module was signed again. | ||
| - `2026-03-31T01:10:42+02:00` Review validation: | ||
| `SPECFACT_ALLOW_UNSIGNED=1 hatch run specfact code review run --json --out .specfact/code-review.json` | ||
| passed with `findings: []`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.