Skip to content

Promote dev to main#299

Merged
djm81 merged 28 commits into
mainfrom
dev
May 24, 2026
Merged

Promote dev to main#299
djm81 merged 28 commits into
mainfrom
dev

Conversation

@djm81
Copy link
Copy Markdown
Contributor

@djm81 djm81 commented May 24, 2026

Summary

Promotes current dev to main, including the cleanup forecast / AI bloat handoff code review module updates from PR #298 and the signed module/registry artifacts already landed on dev.

Refs:

Scope

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

Bundle Impact

  • nold-ai/specfact-code-review: promoted through 0.47.30
  • nold-ai/specfact-project: promoted through 0.41.18

Validation Evidence

Validation was completed on PR #298 before merge to dev. The dev push workflows also ran after merge:

  • Module Signature Hardening: run 26374026766, success
  • publish-modules: run 26374026765, success
  • Docs Review: run 26374026780, success

Required local gates

  • hatch run format
  • hatch run type-check
  • hatch run lint
  • hatch run yaml-lint
  • hatch run check-bundle-imports
  • hatch run contract-test
  • hatch run smart-test / hatch run test covered by PR Implement cleanup forecast handoff #298 gates

Signature + version integrity

  • hatch run verify-modules-signature --payload-from-filesystem --enforce-version-bump passed on PR Implement cleanup forecast handoff #298
  • Targeting main: manifests include CI signatures from Module Signature Hardening
  • Changed bundle versions were bumped when module payloads changed
  • Manifests signed before promotion

CI and Branch Protection

  • PR orchestrator jobs expected
  • Branch protection required checks expected on this PR

Docs / Pages

  • Bundle/module docs updated in this repo (docs/)
  • Pages workflow impact reviewed by Docs Review
  • Cross-links from specfact-cli docs updated (not part of this modules promotion)

Checklist

@strix-security
Copy link
Copy Markdown

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Review Change Stack

Warning

Review limit reached

@djm81, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 5 reviews of capacity. Refill in 20 minutes and 59 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f02c192-f8f2-4f7a-b7ec-6d1bf763b905

📥 Commits

Reviewing files that changed from the base of the PR and between fe1689e and 4ffdd16.

⛔ Files ignored due to path filters (2)
  • registry/modules/specfact-code-review-0.47.33.tar.gz is excluded by !**/*.gz
  • registry/modules/specfact-code-review-0.47.34.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (8)
  • packages/specfact-code-review/module-package.yaml
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • registry/index.json
  • registry/modules/specfact-code-review-0.47.33.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.34.tar.gz.sha256
  • registry/signatures/specfact-code-review-0.47.33.tar.sig
  • registry/signatures/specfact-code-review-0.47.34.tar.sig
  • tests/unit/specfact_code_review/run/test_forecast.py
📝 Walkthrough

Walkthrough

Adds simplify-focused cleanup_forecast and AI‑IDE remediation handoff: new report schema fields, non‑mutating preview and optional mutation evidence, preserve‑reason detection and enrichment, CLI flags/validation, forecast aggregation, docs/skill updates, tests, and package/registry updates.

Changes

Cleanup forecast & remediation handoff

Layer / File(s) Summary
OpenSpec, docs, prompts, skill updates
openspec/changes/code-review-13-cleanup-forecast-agent-handoff/*, openspec/CHANGE_ORDER.md, docs/*, packages/*/SKILL.md, packages/specfact-project/resources/prompts/specfact.08-simplify.md
Adds proposal/design/specs/tasks and updates docs/quickstart/prompts/SKILL to document --preview-fixes/--with-mutation, .specfact/code-review-simplify.json, cleanup_forecast, remediation_packet, and preserve rules.
Finding & report schema
packages/specfact-code-review/src/specfact_code_review/run/findings.py
Adds PRESERVE_REASONS; models: SignalTraceEntry, PreserveReasonEvidence, RemediationPacket, ReviewedLoc, DeletionEstimate, AiBloatIndex, GuidanceKindForecast, CleanupForecast; extends ReviewFinding (signal_trace,preserve_reasons,remediation_packet) and ReviewReport.cleanup_forecast; schema-version selects 1.3 when present.
Cleanup forecast computation
packages/specfact-code-review/src/specfact_code_review/run/forecast.py
Implements build_cleanup_forecast computing reviewed LOC (prod/tests), per-guidance aggregations, low/expected/high deletion estimates, expected yield, weighted bloat points, and evidence counts.
Preview & mutation evidence helpers
packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
Adds with_previewed_simplification_findings, with_mutation_evidence, with_refreshed_cleanup_forecast and helpers to produce non-mutating patch previews, compute line deltas, append preview:{file}:{line} refs, and record inconclusive mutation signals.
Runner enrichment (preserve detection)
packages/specfact-code-review/src/specfact_code_review/run/runner.py
AST-backed preserve detection (contract decorators, all, CLI decorators, spec markers, Protocol/abstracts); synthesizes remediation_packet, enriches findings, and attaches cleanup_forecast for simplify runs.
CLI flags, validation & run wiring
packages/specfact-code-review/src/specfact_code_review/review/commands.py, packages/specfact-code-review/src/specfact_code_review/run/commands.py
Adds --preview-fixes and --with-mutation; extends ReviewRunRequest/_ReviewLoopFlags; validates invalid combinations (--preview-fixes+--fix, and both new flags require --focus simplify); threads flags through interactive/non-interactive flows and applies simplify-enforce verdicts.
Tests: CLI contract, model, forecast, preserve, preview/mutation
tests/cli-contracts/*, tests/unit/specfact_code_review/run/*, tests/unit/specfact_code_review/review/*
Adds contract and unit tests covering invalid CLI combos, preview evidence in JSON, mutation inconclusive signals, cleanup_forecast metrics and invariants, preserve-detection scenarios, and that preview is non-mutating and shadow mode preserves CI exit code.
Package & registry updates
packages/*/module-package.yaml, registry/index.json, registry/modules/*.tar.gz.sha256, registry/signatures/*.tar.sig
Bumps package versions and updates integrity checksums and registry signatures for published artifacts.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Runner
  participant CleanupEvidence
  participant Forecast
  participant Report

  CLI->>Runner: run --focus simplify [--preview-fixes|--with-mutation]
  Runner->>CleanupEvidence: preview fixes / record mutation evidence
  CleanupEvidence->>Forecast: recompute build_cleanup_forecast(findings, files)
  Forecast->>Runner: attach cleanup_forecast
  Runner->>Report: emit JSON report (cleanup_forecast, signal_trace, remediation_packet)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

Focus notes (correctness/security/regressions)

  • Verify schema-version branching: ensure legacy consumers tolerate additive fields when schema 1.3 appears and that derivation logic covers all emission paths.
  • Confirm preserve-reason taxonomy is closed and validation prevents unknown reasons from enabling auto-fix.
  • Check early CLI validation rejects invalid flag combos before tool execution to avoid partial side effects.
  • Confirm preview path is non-mutating (tests added) and temp-file I/O failure modes return safe no-op behavior.
  • Ensure registry/package integrity updates match published artifacts atomically (signatures/checksums correspond to released bundle).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

@djm81 djm81 self-assigned this May 24, 2026
@djm81 djm81 added enhancement New feature or request codebase Specfact codebase related topic dependencies Pull requests that update a dependency file labels May 24, 2026
@djm81 djm81 moved this from Todo to In Progress in SpecFact CLI May 24, 2026
@djm81 djm81 linked an issue May 24, 2026 that may be closed by this pull request
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17b0e62560

ℹ️ About Codex in GitHub

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

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

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

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

Comment thread packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (1)
registry/index.json (1)

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

Fix registry artifact integrity: add/prune missing sha256 sidecars

  • The originally called-out intermediate versions aren’t orphaned: specfact-code-review-0.47.28.tar.gz and specfact-code-review-0.47.29.tar.gz both have matching *.sha256 sidecars.
  • Registry integrity is still off: 80/177 registry/modules/*.tar.gz tarballs are missing corresponding *.tar.gz.sha256, while the latest_version entries in registry/index.json do have checksums.
  • Either add the missing sha256 sidecars for those tarballs or remove the unverifiable tarballs to avoid checksum/verification failures for older pinned versions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@registry/index.json` around lines 1 - 96, The registry index references
checksum_sha256 values (e.g., in module entries "nold-ai/specfact-code-review"
with latest_version "0.47.30" and other modules like
"nold-ai/specfact-codebase"/"specfact-project") but many tarballs under
registry/modules/*.tar.gz lack corresponding .tar.gz.sha256 sidecar files;
update the registry by either adding the missing SHA256 sidecar files for each
tarball that has an entry in index.json (ensuring the sidecar contents match the
checksum_sha256 field for the corresponding module id/latest_version) or remove
the unverifiable tarballs that don't have matching sidecars so older pinned
versions are not left unverifiable — apply this to the affected modules (e.g.,
specfact-code-review v0.47.28/0.47.29 and the ~80 missing artifacts) and ensure
index.json checksums remain consistent with the added/removed artifacts.
🧹 Nitpick comments (4)
packages/specfact-code-review/src/specfact_code_review/run/runner.py (1)

419-434: ⚡ Quick win

Cache parsed AST per file in preserve-reason enrichment.

_preserve_reasons_for_finding reparses the same file for every simplify finding. On large reports this becomes a hot path and can noticeably slow --focus simplify runs.

♻️ Suggested change
-from functools import partial
+from functools import lru_cache, partial
@@
+@lru_cache(maxsize=256)
+def _parsed_source_for_preserve(path: str) -> tuple[ast.Module, list[str]] | None:
+    try:
+        source = Path(path).read_text(encoding="utf-8")
+        return ast.parse(source, filename=path), source.splitlines()
+    except (OSError, SyntaxError, UnicodeDecodeError):
+        return None
+
 def _preserve_reasons_for_finding(finding: ReviewFinding, *, load_bearing: bool) -> list[PreserveReasonEvidence]:
@@
-    try:
-        source = Path(finding.file).read_text(encoding="utf-8")
-        tree = ast.parse(source, filename=finding.file)
-    except (OSError, SyntaxError, UnicodeDecodeError):
+    parsed = _parsed_source_for_preserve(finding.file)
+    if parsed is None:
         return reasons
-    lines = source.splitlines()
+    tree, lines = parsed
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/specfact-code-review/src/specfact_code_review/run/runner.py` around
lines 419 - 434, _preserve_reasons_for_finding currently reparses the same file
for every finding which is slow; introduce a cache for parsed ASTs (e.g., a
module-level dict or a `@functools.lru_cache-decorated` helper) and use it from
_preserve_reasons_for_finding instead of calling Path(...).read_text/ast.parse
each time; add a helper like _get_parsed_ast(file_path: str) ->
Optional[ast.AST] (or similar) that returns the parsed tree or None on
OSError/SyntaxError/UnicodeDecodeError and reference that helper inside
_preserve_reasons_for_finding so multiple calls for the same finding.file reuse
the cached AST.
tests/unit/specfact_code_review/run/test_commands.py (1)

315-341: ⚡ Quick win

Add the missing negative-path test for --preview-fixes without simplify focus.

The new validation branch for preview-without-simplify should have a direct unit assertion, mirroring the mutation-focus rejection test, so this CLI guard can’t regress silently.

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

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/specfact_code_review/run/test_commands.py` around lines 315 - 341,
Add a negative-path unit test that asserts the CLI rejects using --preview-fixes
without --focus simplify: create a function (e.g.,
test_run_command_rejects_preview_fixes_without_simplify_focus) that calls
runner.invoke(app, ["review", "run", "--preview-fixes",
"tests/fixtures/review/clean_module.py"]) and then asserts result.exit_code == 2
and that the output contains the validation message "Use --preview-fixes only
with --focus simplify"; place this new test alongside the existing tests such as
test_run_command_rejects_preview_fixes_with_fix and
test_run_command_rejects_with_mutation_without_simplify_focus so it covers the
new validation branch.
packages/specfact-code-review/src/specfact_code_review/run/forecast.py (1)

82-85: 💤 Low value

Test directory detection may miss test/ directories.

The check "tests" in file_path.parts only matches the exact string "tests". Some Python projects use test/ (singular) as their test directory. This could misclassify test code as production LOC.

If this is intentional for consistency with repo conventions, no change needed. Otherwise, consider:

♻️ Optional: broaden test detection
-        if "tests" in file_path.parts:
+        if "tests" in file_path.parts or "test" in file_path.parts:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/specfact-code-review/src/specfact_code_review/run/forecast.py`
around lines 82 - 85, The current LOC classification only treats paths
containing the segment "tests" as test files which misses directories named
"test"; update the detection in the code that uses file_path.parts (the branch
that increments tests vs production) to consider both "test" and "tests" (e.g.,
check if any part is in the set {"test","tests"}) so files under either
directory are counted toward tests rather than production; adjust the condition
where tests += loc and production += loc accordingly (preserving existing
variables/tests and production accumulation).
tests/unit/specfact_code_review/run/test_forecast.py (1)

36-58: ⚡ Quick win

Expand this test to pin all fixed guidance weights.

The current assertion only locks safe_mechanical and preserve. Add needs_tests and design_judgment cases so the V1 weight contract (1.0/0.6/0.25/0.0) can’t drift silently.

As per coding guidelines, openspec/changes/code-review-13-cleanup-forecast-agent-handoff/design.md defines fixed V1 forecast weights that should be preserved.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/specfact_code_review/run/test_forecast.py` around lines 36 - 58,
Add two additional findings to the
test_build_cleanup_forecast_counts_loc_and_weighted_bloat (use _finding with
guidance_kind="needs_tests" and guidance_kind="design_judgment") so the
build_cleanup_forecast input covers all four guidance kinds, and add assertions
on forecast.by_guidance_kind[...] to pin the V1 weights: safe_mechanical == 1.0,
needs_tests == 0.6, design_judgment == 0.25, preserve == 0.0; reference the test
name test_build_cleanup_forecast_counts_loc_and_weighted_bloat, the helper
_finding, and the forecast.by_guidance_kind mapping and weight property to
locate where to add the new findings and assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/bundles/code-review/run.md`:
- Around line 104-106: The docs changed the output path to
.specfact/code-review-simplify.json which will break existing consumers that
expect .specfact/code-review.json; update the documented commands so they either
write simplify output to both paths (e.g., run specfact code review with --out
.specfact/code-review-simplify.json and also --out .specfact/code-review.json)
or explicitly call out that callers must be updated, and coordinate updates to
the consumer artifacts referenced (scripts/pre_commit_code_review.py,
openspec/config.yaml, and any TDD evidence scripts that hardcode
.specfact/code-review.json) so they accept the new simplify path or the docs
state that simplify writes to the canonical .specfact/code-review.json as well.

In `@packages/specfact-code-review/src/specfact_code_review/review/commands.py`:
- Around line 34-35: Update the user-facing example/instructions so they also
emit or recommend the canonical review JSON path to stay compatible with
existing consumers: when showing the run invocation (the example containing
"specfact code review run --scope changed --focus simplify --preview-fixes
--json --out .specfact/code-review-simplify.json"), include guidance to write to
the canonical file ".specfact/code-review.json" as well (either by changing
"--out" to that path or by showing a dual-output/merge pattern), and apply the
same change to the other examples referenced around the same section (the
occurrences noted at lines 53-55).

In `@tests/unit/specfact_code_review/run/test_findings.py`:
- Around line 460-486: Add a second assertion path that constructs a
ReviewReport whose findings include handoff metadata (create a Finding instance
with signal_trace, preserve_reasons and remediation_packet populated) and assert
report.schema_version == "1.3" and that at least one finding exposes the handoff
fields (e.g., check finding.signal_trace is not None and
finding.preserve_reasons is not None and finding.remediation_packet is not
None); update
test_review_report_uses_schema_1_3_when_cleanup_forecast_is_present to include
or add a new test that uses ReviewReport, Finding, and the
signal_trace/preserve_reasons/remediation_packet symbols so the suite fails if
emitting finding-level handoff metadata does not bump schema to "1.3".

---

Outside diff comments:
In `@registry/index.json`:
- Around line 1-96: The registry index references checksum_sha256 values (e.g.,
in module entries "nold-ai/specfact-code-review" with latest_version "0.47.30"
and other modules like "nold-ai/specfact-codebase"/"specfact-project") but many
tarballs under registry/modules/*.tar.gz lack corresponding .tar.gz.sha256
sidecar files; update the registry by either adding the missing SHA256 sidecar
files for each tarball that has an entry in index.json (ensuring the sidecar
contents match the checksum_sha256 field for the corresponding module
id/latest_version) or remove the unverifiable tarballs that don't have matching
sidecars so older pinned versions are not left unverifiable — apply this to the
affected modules (e.g., specfact-code-review v0.47.28/0.47.29 and the ~80
missing artifacts) and ensure index.json checksums remain consistent with the
added/removed artifacts.

---

Nitpick comments:
In `@packages/specfact-code-review/src/specfact_code_review/run/forecast.py`:
- Around line 82-85: The current LOC classification only treats paths containing
the segment "tests" as test files which misses directories named "test"; update
the detection in the code that uses file_path.parts (the branch that increments
tests vs production) to consider both "test" and "tests" (e.g., check if any
part is in the set {"test","tests"}) so files under either directory are counted
toward tests rather than production; adjust the condition where tests += loc and
production += loc accordingly (preserving existing variables/tests and
production accumulation).

In `@packages/specfact-code-review/src/specfact_code_review/run/runner.py`:
- Around line 419-434: _preserve_reasons_for_finding currently reparses the same
file for every finding which is slow; introduce a cache for parsed ASTs (e.g., a
module-level dict or a `@functools.lru_cache-decorated` helper) and use it from
_preserve_reasons_for_finding instead of calling Path(...).read_text/ast.parse
each time; add a helper like _get_parsed_ast(file_path: str) ->
Optional[ast.AST] (or similar) that returns the parsed tree or None on
OSError/SyntaxError/UnicodeDecodeError and reference that helper inside
_preserve_reasons_for_finding so multiple calls for the same finding.file reuse
the cached AST.

In `@tests/unit/specfact_code_review/run/test_commands.py`:
- Around line 315-341: Add a negative-path unit test that asserts the CLI
rejects using --preview-fixes without --focus simplify: create a function (e.g.,
test_run_command_rejects_preview_fixes_without_simplify_focus) that calls
runner.invoke(app, ["review", "run", "--preview-fixes",
"tests/fixtures/review/clean_module.py"]) and then asserts result.exit_code == 2
and that the output contains the validation message "Use --preview-fixes only
with --focus simplify"; place this new test alongside the existing tests such as
test_run_command_rejects_preview_fixes_with_fix and
test_run_command_rejects_with_mutation_without_simplify_focus so it covers the
new validation branch.

In `@tests/unit/specfact_code_review/run/test_forecast.py`:
- Around line 36-58: Add two additional findings to the
test_build_cleanup_forecast_counts_loc_and_weighted_bloat (use _finding with
guidance_kind="needs_tests" and guidance_kind="design_judgment") so the
build_cleanup_forecast input covers all four guidance kinds, and add assertions
on forecast.by_guidance_kind[...] to pin the V1 weights: safe_mechanical == 1.0,
needs_tests == 0.6, design_judgment == 0.25, preserve == 0.0; reference the test
name test_build_cleanup_forecast_counts_loc_and_weighted_bloat, the helper
_finding, and the forecast.by_guidance_kind mapping and weight property to
locate where to add the new findings and assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 13891b8a-32e6-4934-94d7-3d1364b145f6

📥 Commits

Reviewing files that changed from the base of the PR and between 4bcb9b9 and 17b0e62.

⛔ Files ignored due to path filters (4)
  • registry/modules/specfact-code-review-0.47.28.tar.gz is excluded by !**/*.gz
  • registry/modules/specfact-code-review-0.47.29.tar.gz is excluded by !**/*.gz
  • registry/modules/specfact-code-review-0.47.30.tar.gz is excluded by !**/*.gz
  • registry/modules/specfact-project-0.41.18.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (38)
  • docs/bundles/code-review/run.md
  • docs/modules/code-review.md
  • docs/quickstart-ai-bloat.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/code-review-12-guided-simplification-enforcement/TDD_EVIDENCE.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/.openspec.yaml
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/README.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/TDD_EVIDENCE.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/design.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/ai-ide-remediation-handoff/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/cleanup-forecast-review/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-finding-model/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-run-command/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/tasks.md
  • packages/specfact-code-review/module-package.yaml
  • packages/specfact-code-review/src/specfact_code_review/resources/skills/specfact-code-review/SKILL.md
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • packages/specfact-code-review/src/specfact_code_review/rules/updater.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • packages/specfact-project/module-package.yaml
  • packages/specfact-project/resources/prompts/specfact.08-simplify.md
  • registry/index.json
  • registry/modules/specfact-code-review-0.47.28.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.29.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.30.tar.gz.sha256
  • registry/modules/specfact-project-0.41.18.tar.gz.sha256
  • tests/cli-contracts/specfact-code-review-run.scenarios.yaml
  • tests/unit/specfact_code_review/review/test_commands.py
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • tests/unit/specfact_code_review/run/test_findings.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • tests/unit/specfact_code_review/run/test_runner.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
openspec/**/*.md

⚙️ CodeRabbit configuration file

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

Files:

  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/README.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/TDD_EVIDENCE.md
  • openspec/CHANGE_ORDER.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/cleanup-forecast-review/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/tasks.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/design.md
  • openspec/changes/code-review-12-guided-simplification-enforcement/TDD_EVIDENCE.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/ai-ide-remediation-handoff/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-run-command/spec.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-finding-model/spec.md
packages/**/module-package.yaml

⚙️ CodeRabbit configuration file

packages/**/module-package.yaml: Validate metadata: name, version, commands, dependencies, and parity with packaged src.
Call out semver and signing implications when manifests or payloads change.

Files:

  • packages/specfact-project/module-package.yaml
  • packages/specfact-code-review/module-package.yaml
registry/**

⚙️ CodeRabbit configuration file

registry/**: Registry and index consistency: bundle listings, version pins, and compatibility with
published module artifacts.

Files:

  • registry/index.json
  • registry/modules/specfact-code-review-0.47.28.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.30.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.29.tar.gz.sha256
  • registry/modules/specfact-project-0.41.18.tar.gz.sha256
docs/**/*.md

⚙️ CodeRabbit configuration file

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

Files:

  • docs/quickstart-ai-bloat.md
  • docs/bundles/code-review/run.md
  • docs/modules/code-review.md
**/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/specfact-code-review/src/specfact_code_review/rules/updater.py
  • tests/unit/specfact_code_review/review/test_commands.py
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • tests/unit/specfact_code_review/run/test_runner.py
  • packages/specfact-code-review/src/specfact_code_review/run/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_findings.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
packages/**/src/**/*.py

⚙️ CodeRabbit configuration file

packages/**/src/**/*.py: 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.

Files:

  • packages/specfact-code-review/src/specfact_code_review/rules/updater.py
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • packages/specfact-code-review/src/specfact_code_review/run/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
tests/**/*.py

⚙️ CodeRabbit configuration file

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

Files:

  • tests/unit/specfact_code_review/review/test_commands.py
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • tests/unit/specfact_code_review/run/test_runner.py
  • tests/unit/specfact_code_review/run/test_findings.py
🪛 LanguageTool
openspec/changes/code-review-13-cleanup-forecast-agent-handoff/tasks.md

[grammar] ~25-~25: Use a hyphen to join words.
Context: .... ## 4. Preview, preserve, and mutation proof - [x] 4.1 Implement non-mutating ...

(QB_NEW_EN_HYPHEN)


[grammar] ~29-~29: Use a hyphen to join words.
Context: ...alculated. - [x] 4.3 Add opt-in mutation proof scaffolding for simplify candidate...

(QB_NEW_EN_HYPHEN)

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md

[style] ~36-~36: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... required fields remain compatible. - Affected command surface: `specfact code revie...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

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

Findings (nold-ai/specfact-cli)

  • Pre-commit hook and repo gates expect the canonical review JSON at .specfact/code-review.json; changes that write an alternate simplify file (.specfact/code-review-simplify.json) could be ignored by existing consumers unless callers are updated to point at the new file:

    • scripts/pre_commit_code_review.py — prints/reads REVIEW_JSON_OUT and expects the review JSON report path; used by pre-commit hook and scripts/pre-commit-quality-checks.sh [::nold-ai/specfact-cli::scripts/pre_commit_code_review.py:210-256, 336-347]
    • scripts/setup-git-hooks.sh — documents running specfact code review as staged-file pre-commit gate [::nold-ai/specfact-cli::scripts/setup-git-hooks.sh:58-75]
    • scripts/pre-commit-quality-checks.sh — orchestration of code review gate in pre-commit pipeline [::nold-ai/specfact-cli::scripts/pre-commit-quality-checks.sh:39-41,116,389-397]
  • Openspec / CI expectations reference the canonical .specfact/code-review.json; consumers of code-review output in openspec tasks and TDD evidence may need updates or parallel expectations for simplify-focused output:

    • openspec/config.yaml — mandates code review JSON (dogfood) at .specfact/code-review.json for OpenSpec validations and gates [::nold-ai/specfact-cli::openspec/config.yaml:64-66,178-185]
    • multiple openspec change/TDD files call hatch run specfact code review run --json --out .specfact/code-review.json in CI/docs evidence — these runs will not pick up a new .specfact/code-review-simplify.json unless explicitly changed [::nold-ai/specfact-cli::openspec/** (many TDD/docs entries referencing the exact command)]
  • Docs and module-install/onboarding references expect the existing code review report path and behavior; new flags/outputs (--preview-fixes, --with-mutation, cleanup_forecast, remediation_packet, preserve_reasons) are not automatically visible to existing documentation consumers unless docs/examples are updated to point to the simplify JSON:

    • docs/modules/code-review.md — documents specfact code review run --json --out .specfact/code-review.json and the ai_bloat simplify workflow [::nold-ai/specfact-cli::docs/modules/code-review.md]
    • tests/scripts/docs/tests assert presence of specfact code review run and review JSON in repo docs and test fixtures (dogfood self-review tests expect the canonical JSON) [::nold-ai/specfact-cli::tests/unit/scripts/test_code_review_module_docs.py; tests/unit/specfact_cli/test_dogfood_self_review.py]
  • Risk/impact summary:

    • If the new simplify-focused output is emitted only to .specfact/code-review-simplify.json, automation and CI gates (pre-commit, openspec TDD evidence, docs/tests) that still read .specfact/code-review.json will not see the simplify-only findings/cleanup_forecast unless callers are adjusted to request or merge the simplify output.
    • Any automation that expects schema versioning/fields in the canonical code-review JSON may need to tolerate the new optional fields (cleanup_forecast, remediation_packet, preserve_reasons, signal_trace) or be updated to read the simplify file.

Recommendation (concise): Ensure CI/pre-commit scripts and openspec/TDD instructions that currently read .specfact/code-review.json are updated (or accept) the new simplify JSON path or that specfact code review run --focus simplify --preview-fixes can also write/update the canonical .specfact/code-review.json as needed.

🔇 Additional comments (51)
packages/specfact-project/module-package.yaml (1)

2-2: LGTM!

Also applies to: 30-31

tests/unit/specfact_code_review/run/test_runner.py (1)

10-17: LGTM!

Also applies to: 231-317, 349-442

packages/specfact-code-review/src/specfact_code_review/review/commands.py (1)

148-157: LGTM!

Also applies to: 198-200

packages/specfact-code-review/src/specfact_code_review/run/commands.py (1)

19-22: LGTM!

Also applies to: 70-71, 84-85, 332-341, 658-660, 678-680, 697-704, 745-750, 866-867, 901-907, 923-924, 977-979

tests/cli-contracts/specfact-code-review-run.scenarios.yaml (1)

171-192: LGTM!

tests/unit/specfact_code_review/run/test_commands.py (1)

343-395: LGTM!

Also applies to: 616-617

packages/specfact-code-review/src/specfact_code_review/run/findings.py (6)

32-97: LGTM!


99-147: LGTM!


149-202: LGTM!


293-340: LGTM!


408-420: LGTM!


471-502: LGTM!

packages/specfact-code-review/src/specfact_code_review/run/forecast.py (3)

1-36: LGTM!


39-69: LGTM!


97-121: LGTM!

packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py (2)

23-58: LGTM!


60-185: LGTM!

tests/unit/specfact_code_review/run/test_cleanup_evidence.py (1)

11-67: LGTM!

tests/unit/specfact_code_review/run/test_findings.py (1)

9-234: LGTM!

Also applies to: 488-499

tests/unit/specfact_code_review/run/test_forecast.py (1)

1-34: LGTM!

Also applies to: 60-68

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

125-125: Cross-repository breaking change: duplicate concern.

Same issue flagged in docs/bundles/code-review/run.md lines 104-106: the new .specfact/code-review-simplify.json path is not compatible with existing specfact-cli automation that expects .specfact/code-review.json. See first comment for coordination checklist.

Also applies to: 202-206


62-66: LGTM!

Also applies to: 83-85, 136-143

docs/quickstart-ai-bloat.md (2)

26-27: Cross-repository breaking change: duplicate concern.

Same issue flagged in docs/bundles/code-review/run.md lines 104-106: the .specfact/code-review-simplify.json path won't be picked up by existing specfact-cli automation. See first comment for coordination checklist.

Also applies to: 91-91


13-13: LGTM!

Also applies to: 23-29, 33-34

packages/specfact-code-review/src/specfact_code_review/resources/skills/specfact-code-review/SKILL.md (2)

11-11: Cross-repository breaking change: duplicate concern.

Same issue flagged in docs/bundles/code-review/run.md lines 104-106: the .specfact/code-review-simplify.json path won't be visible to specfact-cli automation. See first comment for coordination checklist.


12-14: LGTM!

Also applies to: 26-26, 29-29

packages/specfact-code-review/src/specfact_code_review/rules/updater.py (2)

35-37: Cross-repository breaking change: duplicate concern.

Same issue flagged in docs/bundles/code-review/run.md lines 104-106: the .specfact/code-review-simplify.json path hardcoded in default rules won't be visible to specfact-cli automation. See first comment for coordination checklist.


65-65: LGTM!

packages/specfact-project/resources/prompts/specfact.08-simplify.md (2)

59-60: Cross-repository breaking change: duplicate concern.

Same issue flagged in docs/bundles/code-review/run.md lines 104-106: the .specfact/code-review-simplify.json path in the prompt won't be compatible with specfact-cli automation. See first comment for coordination checklist.

Also applies to: 127-127


62-65: LGTM!

Also applies to: 79-79

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

42-43: LGTM!

Also applies to: 58-60

tests/unit/specfact_code_review/review/test_commands.py (1)

44-50: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/design.md (1)

1-38: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/ai-ide-remediation-handoff/spec.md (1)

1-20: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/cleanup-forecast-review/spec.md (1)

1-41: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-finding-model/spec.md (1)

1-26: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/specs/review-run-command/spec.md (1)

1-27: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/tasks.md (1)

1-45: LGTM!

openspec/CHANGE_ORDER.md (1)

106-106: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md (1)

35-35: 🏗️ Heavy lift

Clarify simplify-report output vs CI gate artifact

The “Affected JSON” statement for openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md is aligned with the implementation: --focus simplify only populates simplify-specific fields like cleanup_forecast, and the JSON output path is determined by the caller’s --out (there’s no implicit redirection based on focus). Promotion/touched-scope gates for this change still run specfact code review run --bug-hunt --json --out .specfact/code-review.json --scope changed, so core automation remains tied to .specfact/code-review.json, not the simplify file.
Optional: add a short clarifier that .specfact/code-review-simplify.json is the simplify/IDE aux artifact, while .specfact/code-review.json is the mandatory gate evidence.

			> Likely an incorrect or invalid review comment.
openspec/changes/code-review-13-cleanup-forecast-agent-handoff/.openspec.yaml (1)

1-2: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/README.md (1)

1-3: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/TDD_EVIDENCE.md (1)

1-56: LGTM!

openspec/changes/code-review-12-guided-simplification-enforcement/TDD_EVIDENCE.md (1)

127-129: ⚡ Quick win

Fix the scope of the signing-evidence concern: the 0.47.27 note in code-review-12 is PR #289-specific, not the 0.47.30 promotion version.
openspec/changes/code-review-12-guided-simplification-enforcement/TDD_EVIDENCE.md is describing the PR #289 follow-up updating specfact-code-review to 0.47.27 and the intended integrity model (source payload vs published tarball sidecar). The code-review-13 promotion of 0.47.30 is handled by its required version-bump/signature verification gate (e.g., verify-modules-signature --payload-from-filesystem --enforce-version-bump), so adding prose about 0.47.30 into the code-review-12 file is unnecessary.

registry/modules/specfact-code-review-0.47.28.tar.gz.sha256 (1)

1-1: Intermediate version checksum without registry entry.

This sidecar file exists for version 0.47.28, but the registry index only lists 0.47.30 as the latest version. If the tarball artifact is retained for rollback or historical purposes, consider documenting the retention policy; otherwise, this file should be removed to match the registry index state.

registry/modules/specfact-code-review-0.47.29.tar.gz.sha256 (1)

1-1: Intermediate version checksum without registry entry.

Same issue as 0.47.28: version 0.47.29 sidecar exists but is not indexed in registry/index.json.

packages/specfact-code-review/module-package.yaml (1)

2-2: LGTM!

Also applies to: 26-27

registry/index.json (1)

5-7: LGTM!

Also applies to: 81-83

registry/modules/specfact-code-review-0.47.30.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-project-0.41.18.tar.gz.sha256 (2)

1-1: LGTM!


1-1: ⚡ Quick win

Fix release-integrity parity check for specfact-project (manifest exists, checksum mismatch).

packages/specfact-project/module-package.yaml is present and matches the promoted version: 0.41.18, but its integrity.checksum (sha256:4f2905d8…9d99a2) does not match the registry/promoted tarball checksum (58d5652c6c5e…a51cd, same as registry/index.json and registry/modules/specfact-project-0.41.18.tar.gz.sha256). Confirm what artifact integrity.checksum is supposed to cover; if it’s meant to represent the promoted tarball, this is a release-integrity mismatch.

Comment thread docs/bundles/code-review/run.md Outdated
Comment thread packages/specfact-code-review/src/specfact_code_review/review/commands.py Outdated
Comment thread tests/unit/specfact_code_review/run/test_findings.py
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py (1)

54-59: 💤 Low value

Redundant schema_version override—validator already handles this.

ReviewReport._derive_governance_fields runs after model_copy and unconditionally sets schema_version = "1.3" when cleanup_forecast is present. The explicit "schema_version": "1.3" here is therefore redundant. Not a bug—just unnecessary.

♻️ Optional cleanup
 def with_refreshed_cleanup_forecast(report: ReviewReport, files: list[Path]) -> ReviewReport:
     return report.model_copy(
         update={
             "cleanup_forecast": build_cleanup_forecast(report.findings, files),
-            "schema_version": "1.3",
         }
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py`
around lines 54 - 59, The code is redundantly setting "schema_version": "1.3" in
the dict passed to report.model_copy; remove that key so model_copy only sets
"cleanup_forecast": build_cleanup_forecast(report.findings, files) and let
ReviewReport._derive_governance_fields set schema_version when cleanup_forecast
is present; update the return statement that calls report.model_copy(...) and
delete the explicit schema_version override.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/specfact-code-review/src/specfact_code_review/run/forecast.py`:
- Around line 82-83: The current test-path detection (if any("test" in
part.lower() for part in file_path.parts): tests += loc) is too broad and
misclassifies production files; update the check to only flag true test
paths/names (e.g., path segment equals "tests", segment startswith or equals
"test", filename startswith "test_" or endswith "_test" or filename endswith
common test suffixes like "_test.py" or ".spec.py") and leave other segments
alone so tests, reviewed_loc and ai_bloat_index are computed correctly; locate
the logic around file_path.parts, tests and loc in forecast.py and replace the
substring check with a stricter regex/explicit conditions that match typical
test directory/file naming patterns.

---

Nitpick comments:
In
`@packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py`:
- Around line 54-59: The code is redundantly setting "schema_version": "1.3" in
the dict passed to report.model_copy; remove that key so model_copy only sets
"cleanup_forecast": build_cleanup_forecast(report.findings, files) and let
ReviewReport._derive_governance_fields set schema_version when cleanup_forecast
is present; update the return statement that calls report.model_copy(...) and
delete the explicit schema_version override.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 66b824c7-e09a-4c1f-bb39-b74a3dc11874

📥 Commits

Reviewing files that changed from the base of the PR and between 17b0e62 and fe1689e.

⛔ Files ignored due to path filters (2)
  • registry/modules/specfact-code-review-0.47.31.tar.gz is excluded by !**/*.gz
  • registry/modules/specfact-code-review-0.47.32.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (96)
  • docs/bundles/code-review/run.md
  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md
  • packages/specfact-code-review/module-package.yaml
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • registry/index.json
  • registry/modules/specfact-backlog-0.39.0.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.0.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.1.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.10.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.11.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.13.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.14.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.15.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.2.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.3.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.4.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.5.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.6.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.7.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.8.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.9.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.31.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.32.tar.gz.sha256
  • registry/modules/specfact-codebase-0.39.0.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.0.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.1.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.10.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.11.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.12.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.13.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.14.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.2.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.3.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.4.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.5.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.6.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.7.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.8.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.9.tar.gz.sha256
  • registry/modules/specfact-codebase-0.41.0.tar.gz.sha256
  • registry/modules/specfact-govern-0.39.0.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.0.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.1.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.10.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.11.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.12.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.13.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.2.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.3.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.4.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.5.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.6.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.7.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.8.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.9.tar.gz.sha256
  • registry/modules/specfact-project-0.39.0.tar.gz.sha256
  • registry/modules/specfact-project-0.40.0.tar.gz.sha256
  • registry/modules/specfact-project-0.40.1.tar.gz.sha256
  • registry/modules/specfact-project-0.40.11.tar.gz.sha256
  • registry/modules/specfact-project-0.40.12.tar.gz.sha256
  • registry/modules/specfact-project-0.40.13.tar.gz.sha256
  • registry/modules/specfact-project-0.40.14.tar.gz.sha256
  • registry/modules/specfact-project-0.40.15.tar.gz.sha256
  • registry/modules/specfact-project-0.40.2.tar.gz.sha256
  • registry/modules/specfact-project-0.40.20.tar.gz.sha256
  • registry/modules/specfact-project-0.40.3.tar.gz.sha256
  • registry/modules/specfact-project-0.40.4.tar.gz.sha256
  • registry/modules/specfact-project-0.40.5.tar.gz.sha256
  • registry/modules/specfact-project-0.40.6.tar.gz.sha256
  • registry/modules/specfact-project-0.40.7.tar.gz.sha256
  • registry/modules/specfact-project-0.40.8.tar.gz.sha256
  • registry/modules/specfact-project-0.40.9.tar.gz.sha256
  • registry/modules/specfact-spec-0.39.0.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.0.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.1.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.10.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.11.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.12.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.13.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.2.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.3.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.4.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.5.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.6.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.7.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.8.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.9.tar.gz.sha256
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • tests/unit/specfact_code_review/run/test_findings.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • tests/unit/specfact_code_review/run/test_runner.py
✅ Files skipped from review due to trivial changes (61)
  • registry/modules/specfact-codebase-0.41.0.tar.gz.sha256
  • registry/modules/specfact-project-0.40.12.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.6.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.2.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.13.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.5.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.7.tar.gz.sha256
  • registry/modules/specfact-project-0.40.5.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.9.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.12.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.8.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.9.tar.gz.sha256
  • registry/modules/specfact-project-0.40.9.tar.gz.sha256
  • registry/modules/specfact-project-0.40.13.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.13.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.4.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.0.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.15.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.12.tar.gz.sha256
  • registry/modules/specfact-project-0.40.4.tar.gz.sha256
  • registry/modules/specfact-project-0.40.14.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.10.tar.gz.sha256
  • registry/modules/specfact-project-0.40.2.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.8.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.10.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.13.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.8.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.13.tar.gz.sha256
  • registry/modules/specfact-project-0.40.1.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.1.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.14.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.32.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.5.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.3.tar.gz.sha256
  • registry/modules/specfact-project-0.39.0.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.7.tar.gz.sha256
  • registry/modules/specfact-project-0.40.0.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.5.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.6.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.3.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.4.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.1.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.2.tar.gz.sha256
  • registry/modules/specfact-govern-0.39.0.tar.gz.sha256
  • registry/modules/specfact-project-0.40.7.tar.gz.sha256
  • registry/modules/specfact-project-0.40.20.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.11.tar.gz.sha256
  • registry/modules/specfact-project-0.40.8.tar.gz.sha256
  • registry/modules/specfact-project-0.40.15.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.0.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.6.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.4.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.9.tar.gz.sha256
  • registry/modules/specfact-project-0.40.11.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.2.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.10.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.4.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.6.tar.gz.sha256
  • registry/modules/specfact-project-0.40.3.tar.gz.sha256
  • packages/specfact-code-review/module-package.yaml
  • docs/bundles/code-review/run.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: quality (3.12)
  • GitHub Check: quality (3.13)
  • GitHub Check: quality (3.11)
🧰 Additional context used
📓 Path-based instructions (5)
registry/**

⚙️ CodeRabbit configuration file

registry/**: Registry and index consistency: bundle listings, version pins, and compatibility with
published module artifacts.

Files:

  • registry/modules/specfact-codebase-0.40.2.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.3.tar.gz.sha256
  • registry/modules/specfact-code-review-0.47.31.tar.gz.sha256
  • registry/modules/specfact-backlog-0.39.0.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.1.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.7.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.0.tar.gz.sha256
  • registry/modules/specfact-codebase-0.39.0.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.11.tar.gz.sha256
  • registry/modules/specfact-spec-0.39.0.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.5.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.0.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.1.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.14.tar.gz.sha256
  • registry/modules/specfact-project-0.40.6.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.3.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.11.tar.gz.sha256
  • registry/modules/specfact-spec-0.40.8.tar.gz.sha256
  • registry/index.json
  • registry/modules/specfact-govern-0.40.12.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.10.tar.gz.sha256
  • registry/modules/specfact-backlog-0.40.9.tar.gz.sha256
  • registry/modules/specfact-codebase-0.40.7.tar.gz.sha256
  • registry/modules/specfact-govern-0.40.11.tar.gz.sha256
openspec/**/*.md

⚙️ CodeRabbit configuration file

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

Files:

  • openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md
**/*.{js,ts,tsx,jsx,py,java,cs,go,rb,php,cpp,c,h}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • tests/unit/specfact_code_review/run/test_runner.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • tests/unit/specfact_code_review/run/test_findings.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
tests/**/*.py

⚙️ CodeRabbit configuration file

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

Files:

  • tests/unit/specfact_code_review/run/test_runner.py
  • tests/unit/specfact_code_review/run/test_forecast.py
  • tests/unit/specfact_code_review/run/test_cleanup_evidence.py
  • tests/unit/specfact_code_review/run/test_commands.py
  • tests/unit/specfact_code_review/run/test_findings.py
packages/**/src/**/*.py

⚙️ CodeRabbit configuration file

packages/**/src/**/*.py: 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.

Files:

  • packages/specfact-code-review/src/specfact_code_review/run/forecast.py
  • packages/specfact-code-review/src/specfact_code_review/review/commands.py
  • packages/specfact-code-review/src/specfact_code_review/run/runner.py
  • packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py
  • packages/specfact-code-review/src/specfact_code_review/run/findings.py
🔀 Multi-repo context nold-ai/specfact-cli

Findings for nold-ai/specfact-cli

  • Pre-commit / commit-gate consumers expect canonical report at .specfact/code-review.json:

    • scripts/pre_commit_code_review.py — REVIEW_JSON_OUT = ".specfact/code-review.json" and writes/reads that path; used by hooks/tests. [::nold-ai/specfact-cli::scripts/pre_commit_code_review.py:3,31]
    • scripts/pre-commit-quality-checks.sh — instructs running pre_commit_code_review and references .specfact/code-review.json in warnings. [::nold-ai/specfact-cli::scripts/pre-commit-quality-checks.sh:393-398]
  • CI / OpenSpec gates and docs require .specfact/code-review.json (multiple specs reference the exact out path):

    • openspec/config.yaml — mandates .specfact/code-review.json as mandatory evidence and example command uses --out .specfact/code-review.json. [::nold-ai/specfact-cli::openspec/config.yaml:64-66,179-185]
    • Many openspec specs/tasks expect the canonical JSON (examples: dogfood-self-review, review-run-command, pre-commit-review-gate). [::nold-ai/specfact-cli::openspec/specs/dogfood-self-review/spec.md:29][::nold-ai/specfact-cli::openspec/specs/review-run-command/spec.md:9-17][::nold-ai/specfact-cli::openspec/specs/pre-commit-review-gate/spec.md:11]
  • Tests & docs assert presence/use of .specfact/code-review.json and a specific review command:

    • tests/unit/scripts/test_code_review_module_docs.py — asserts docs contain "specfact code review run" and ".specfact/code-review.json". [::nold-ai/specfact-cli::tests/unit/scripts/test_code_review_module_docs.py:14-15]
    • docs/modules/code-review.md, README.md, and multiple docs/examples show specfact code review run --json --out .specfact/code-review.json. [::nold-ai/specfact-cli::docs/modules/code-review.md:28,43,50][::nold-ai/specfact-cli::README.md:57,62]
  • Risk: the PR introduces simplify-focused output (.specfact/code-review-simplify.json and new preview flags) and new optional fields (cleanup_forecast, remediation_packet, preserve_reasons). Existing automation, CI gates, pre-commit hooks, OpenSpec tasks, tests and docs currently read the canonical .specfact/code-review.json and will not see the simplify-only output unless callers are updated or the simplify run can also produce/merge into the canonical path.

    • Evidence: many scripts/specs/tests explicitly reference the canonical path and command; pre-commit helper uses REVIEW_JSON_OUT constant. [::nold-ai/specfact-cli::scripts/pre_commit_code_review.py:31][::nold-ai/specfact-cli::openspec/config.yaml:64-66]

Recommendation (concise): Update CI/pre-commit scripts, OpenSpec commands, and tests to either:

  • call the new simplify run with --out .specfact/code-review.json when appropriate, or
  • accept/merge /.specfact/code-review-simplify.json into existing consumers, and ensure docs/tests are updated to the new canonical usage.
🔇 Additional comments (38)
registry/modules/specfact-codebase-0.40.2.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.40.3.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-code-review-0.47.31.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-backlog-0.39.0.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.40.1.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-govern-0.40.7.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-govern-0.40.0.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.39.0.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.40.11.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.39.0.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-backlog-0.40.5.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.40.0.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.40.1.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.40.14.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-project-0.40.6.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.40.3.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-backlog-0.40.11.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-spec-0.40.8.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-govern-0.40.12.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.40.10.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-backlog-0.40.9.tar.gz.sha256 (1)

1-1: LGTM!

registry/modules/specfact-codebase-0.40.7.tar.gz.sha256 (1)

1-1: LGTM!

openspec/changes/code-review-13-cleanup-forecast-agent-handoff/proposal.md (1)

35-35: LGTM!

registry/index.json (1)

81-83: ⚡ Quick win

Registry release-integrity check looks good for 0.47.32registry/index.json’s latest_version/checksum_sha256 for nold-ai/specfact-code-review matches the corresponding registry/modules/specfact-code-review-0.47.32.tar.gz.sha256 contents (no missing or mismatched checksum files across the index).

tests/unit/specfact_code_review/run/test_runner.py (1)

273-317: LGTM!

Also applies to: 445-466

tests/unit/specfact_code_review/run/test_forecast.py (1)

6-91: LGTM!

registry/modules/specfact-govern-0.40.11.tar.gz.sha256 (1)

1-2: LGTM!

tests/unit/specfact_code_review/run/test_cleanup_evidence.py (1)

7-13: LGTM!

Also applies to: 42-78, 99-136, 150-159

packages/specfact-code-review/src/specfact_code_review/run/forecast.py (1)

107-125: LGTM!

tests/unit/specfact_code_review/run/test_commands.py (1)

3-4: LGTM!

Also applies to: 28-33, 322-348, 357-358, 414-466

packages/specfact-code-review/src/specfact_code_review/review/commands.py (1)

34-37: LGTM!

Also applies to: 56-57, 150-202

tests/unit/specfact_code_review/run/test_findings.py (1)

83-119: LGTM!

Also applies to: 526-539

packages/specfact-code-review/src/specfact_code_review/run/runner.py (2)

497-503: Caching AST parses with full source content as key—memory bounded but worth noting.

The lru_cache uses (file_path, source) as the key, meaning the entire file content string is retained for each cached entry. With maxsize=256, this bounds memory to ~256 source files. For typical use (multiple findings per file), this is a reasonable tradeoff, but callers processing many distinct large files in a single run could see elevated memory usage.

Confirmed that callers only read the AST (no mutations), so cache correctness is preserved.


357-386: LGTM!

Also applies to: 944-947

packages/specfact-code-review/src/specfact_code_review/run/cleanup_evidence.py (1)

62-95: LGTM!

Also applies to: 128-160, 163-186

packages/specfact-code-review/src/specfact_code_review/run/findings.py (3)

185-202: LGTM!


294-305: LGTM!

Also applies to: 336-341, 409-421


472-475: LGTM!

Also applies to: 492-503

Comment thread packages/specfact-code-review/src/specfact_code_review/run/forecast.py Outdated
@djm81 djm81 merged commit 5f3820d into main May 24, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in SpecFact CLI May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codebase Specfact codebase related topic dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Change] Cleanup forecast and AI IDE handoff for code review

1 participant