Skip to content

fix(review): support untracked assess declarations - #1266

Merged
Alan-TheGentleman merged 1 commit into
mainfrom
fix/issue-4332-assess-boundary
Sep 20, 2026
Merged

Alan-TheGentleman merged 1 commit into
mainfrom
fix/issue-4332-assess-boundary

Conversation

@Alan-TheGentleman

@Alan-TheGentleman Alan-TheGentleman commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #1040

Type

  • Bug fix
  • New feature
  • Documentation only
  • Code refactoring
  • Maintenance/tooling
  • Breaking change

Summary

  • forwards explicit exclude and select untracked declarations through gentle_review assess
  • preserves bounded, sanitized native stderr diagnostics while retaining fail-closed verification behavior
  • adds strict regression coverage for declaration validation and sensitive diagnostic redaction

Changes

File Change
extensions/gentle-ai.ts Accepts validated ASSESS declarations and projects sanitized native diagnostics.
lib/native-review-cli.ts Validates/forwards untracked arguments and hardens diagnostic redaction.
runtime/native-review-cli.mjs Regenerates the packaged runtime mirror.
tests/review-risk-assessment.test.ts Covers diagnostics, redaction, explicit selection, and invalid declarations.

Test Plan

  • node --experimental-strip-types --test tests/review-risk-assessment.test.ts — 63 passed
  • pnpm run typecheck
  • pnpm run check:runtime-modules
  • pnpm test — 2,862 passed, 38 skipped, 0 failed
  • git diff --check
  • Four-lens native review approved and acknowledged for the exact committed tree

Contributor Checklist

  • Linked an approved issue
  • Added exactly one type:* label
  • No shell scripts changed; shellcheck is not applicable
  • Runtime integration exercised through focused and full test suites
  • Documentation impact reviewed; no user-facing documentation change required
  • Conventional commit format used
  • No Co-Authored-By trailers

Summary by CodeRabbit

  • New Features

    • Added support for explicitly selecting intended untracked files during review assessments.
    • Valid untracked-file selections are now forwarded to the native assessment process.
  • Bug Fixes

    • Improved assessment failure reporting with more accurate error codes and actionable diagnostics.
    • Sensitive environment values, credentials, and filesystem paths are redacted from assessment diagnostics.
    • Invalid untracked-file selections are rejected before assessment begins.
    • Assessment refusals now fail safely with a high-risk, unassessable result when appropriate.

@Alan-TheGentleman Alan-TheGentleman added the type:bug Bug fix label Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b27db51d-634f-427d-8613-9ad3eb734a0d

📥 Commits

Reviewing files that changed from the base of the PR and between 5454832 and 4c0bb35.

📒 Files selected for processing (4)
  • extensions/gentle-ai.ts
  • lib/native-review-cli.ts
  • runtime/native-review-cli.mjs
  • tests/review-risk-assessment.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The assess flow now accepts validated untracked-file selections, forwards them to native review, and preserves sanitized native diagnostics and error codes when assessment fails. Tests cover selection forwarding, invalid input rejection, diagnostic redaction, and fail-closed results.

Changes

Assessment selection and failure handling

Layer / File(s) Summary
Untracked selection contract
lib/native-review-cli.ts, runtime/native-review-cli.mjs, extensions/gentle-ai.ts
Assess requests accept untrackedScope, expectedUntrackedInventory, and intendedUntracked. Validation enforces supported scopes, inventory values, and repository-relative paths.
Native assess forwarding and diagnostic sanitization
lib/native-review-cli.ts, runtime/native-review-cli.mjs
Native assessment forwards validated selection flags. ASSESS diagnostics redact environment values, credentials, and absolute paths before existing sanitization and truncation.
Facade result mapping and validation coverage
extensions/gentle-ai.ts, tests/review-risk-assessment.test.ts
The facade preserves native error codes and sanitized stderr details. Tests cover forwarding, invalid declarations, empty output, stale inventory, bounded diagnostics, and sensitive-data redaction.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant gentle_review
  participant NativeReviewCliV216
  participant NativeReviewProcess
  gentle_review->>NativeReviewCliV216: submit assess request and untracked selection
  NativeReviewCliV216->>NativeReviewCliV216: validate selection
  NativeReviewCliV216->>NativeReviewProcess: run review assess with selection flags
  NativeReviewProcess-->>NativeReviewCliV216: assessment or stderr diagnostics
  NativeReviewCliV216->>NativeReviewCliV216: sanitize ASSESS diagnostics
  NativeReviewCliV216-->>gentle_review: assessment or unassessable result
Loading

Suggested reviewers: danielgap

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding support for untracked-file declarations during review assessment.
Linked Issues check ✅ Passed Issue #1040 requires validated untracked selection, native argument forwarding, selected-candidate assessment, safe stderr diagnostics, fail-closed behavior, and regression coverage. The PR extends th…
Out of Scope Changes check ✅ Passed The changed files support Issue #1040. Diagnostic sanitization protects the new public assess failure path. Runtime changes keep the packaged implementation aligned with the TypeScript source. The add…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Alan-TheGentleman
Alan-TheGentleman merged commit 951ec58 into main Sep 20, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(review): assess cannot evaluate workspaces with untracked files

1 participant