Skip to content

chore(quality): add CodeFactor no-regression gate and prune complexity debt - #405

Merged
unbraind merged 10 commits into
mainfrom
chore/codefactor-no-regression-gate
Jun 30, 2026
Merged

unbraind merged 10 commits into
mainfrom
chore/codefactor-no-regression-gate

Conversation

@unbraind

@unbraind unbraind commented Jun 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add the CodeFactor-aligned no-regression quality lane from pm-bkcv: ESLint complexity ceiling at CodeFactor's Complex Method threshold, suppression baseline, Greptile local review gate wiring, and run-gates integration from the branch baseline.
  • Prune four stale complexity suppressions by simplifying repeatable metadata parsing, schema field command normalization, stable serialization equality, and telemetry error-code classification.
  • Refresh typescript-eslint to 8.62.1, keep @types/node on the Node 22 support floor, and harden the Greptile gate after local Greptile findings.

pm tracking

  • Active item: pm-bkcv under CodeFactor no-regression / A+ quality epic pm-92if.
  • Linked files, tests, GitHub/security sweep, telemetry/Sentry status, temp-directory smoke, and Greptile follow-up evidence are recorded on pm-bkcv.

Verification

  • npm install -g .; pm --version 2026.6.24; node v26.4.0; pnpm 10.33.4; pnpm build.
  • PM linked test run: pm test pm-bkcv --run --progress, 6/6 passed.
  • Full coverage: node scripts/run-tests.mjs coverage, 262 files, 5245 tests, 100% statements/branches/functions/lines.
  • Focused tests: schema fields/create/update, serialization-utils, telemetry-observability, greptile-review-gate.
  • pnpm lint; pnpm typecheck; pnpm contracts:check; pnpm security:scan; pnpm audit --audit-level moderate.
  • pnpm changelog:pm:check with pm-changelog 2026.6.27 and unchanged CHANGELOG.md.
  • pm health --check-only --summary --json clean; pm validate --check-resolution --check-history-drift has no history drift and only the existing resolution-backfill warning backlog.
  • node dist/cli.js package doctor --project --detail deep --json clean.
  • node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort clean: zero critical/high Sentry issues; telemetry finish error rate 0.79%; no missing error-code rows.
  • Isolated temp smoke passed init/create/update/files/docs/test run/close/release/health/validate plus declarative package scaffold npm test and package doctor.

GitHub / dependency sweep

  • No open PRs at start of branch work.
  • GitHub issue Auto Release blocked: scheduled run failed #374 remains blocked by missing RELEASE_PAT in scheduled release environment; SENTRY_PERSONAL_ADMIN_TOKEN is configured.
  • Dependabot alerts, code scanning alerts, secret scanning alerts: none reported by gh API; pnpm audit found no known vulnerabilities.
  • pm-changelog latest available version is active: 2026.6.27.

Greptile

  • Ran greptile review --help and local review before push.
  • Initial Greptile review reported two findings: stale baseline script name and non-zero review false-clean handling. Both were fixed and covered by tests.
  • A rerun returned cached stale text; a fresh layout-diff review was dispatched but did not finish in the local polling window. The current diff contains both fixes and PR-side review agents are requested below.

Summary by cubic

Adds a CodeFactor‑aligned no‑regression gate for complex methods (CC ≥ 18) and a local Greptile review gate; prunes four complexity hotspots, stabilizes a flaky test, keeps coverage at 100%, and updates the CHANGELOG to record the gate closeout. Latest: the Greptile gate anchors “clean” detection to stdout, tolerates stderr warnings, and fails on findings from stdout or stderr, including non‑zero exits.

  • New Features

    • Enforce ESLint complexity max 17 with existing violations baselined in eslint-suppressions.json; new or worse violations fail pnpm lint.
    • Add Greptile review gate (scripts/release/greptile-review-gate.mjs) wired into scripts/release/run-gates.mjs (--skip-greptile) and review:greptile:gate; skips when CLI is missing/unauthenticated, supports --base/--branch, --timeout-ms, and report‑only; matches the clean sentinel on stdout; prints combined stdout/stderr on failures and catches stderr‑only findings; tests at 100%.
    • Add pnpm lint:eslint:prune and pnpm lint:complexity:baseline; bump typescript-eslint to ^8.62.1.
  • Refactors and Fixes

    • Prune four complexity hotspots: simplify optional text checks, extract normalizeFieldCommands, hoist stable‑equality comparators, and table‑drive telemetry error‑message classification.
    • Stabilize the context “no‑agenda” coverage test and update CHANGELOG.md with the quality gate closeout.

Written for commit 5ea5543. Summary will update on new commits.

Review in cubic

Greptile Summary

This PR adds a CodeFactor no-regression quality lane: a new Greptile review gate script wired into the release pipeline, an ESLint complexity ceiling at CC ≥ 18 with a suppression baseline, and four refactors that eliminate the pre-existing violations.

  • Greptile gate (scripts/release/greptile-review-gate.mjs): skips gracefully when the CLI is absent or unauthenticated; on a clean run anchors detection to stdout so stderr warnings don't flip the result; fails (exit 1) when findings appear on stdout or non-zero output; integrated into run-gates.mjs with --skip-greptile and tested at 18 cases covering every branch.
  • Complexity pruning: four hotspots reduced — optional-field guards in repeatable-metadata-parsers.ts, command normalization extracted to normalizeFieldCommands in fields-file.ts, stableValueEquals decomposed into per-type comparators with a shared hasUnmatchedEquivalent helper in serialization.ts, and error-message classification table-driven in observability.ts.
  • Tooling: typescript-eslint bumped to ^8.62.1; pnpm lint:complexity:baseline and pnpm lint:eslint:prune scripts added; context-command test stabilized with an explicit deadline fixture.

Confidence Score: 5/5

Safe to merge — the gate logic is well-tested and all four refactors preserve their original semantics exactly.

The Greptile gate correctly isolates the clean-sentinel check to stdout, handles all non-zero exit combinations, and skips without blocking in environments where the CLI is unavailable. The four complexity refactors were verified to be semantically equivalent: classifier order in observability.ts is preserved, stableValueEquals specialized-type dispatch follows the same precedence as the original if-chain, normalizeFieldCommands handles the undefined and empty-array cases identically to the inline logic it replaced, and the event-field guard loop in repeatable-metadata-parsers.ts is a straight extraction. No changed code path was left without test coverage.

No files require special attention.

Important Files Changed

Filename Overview
scripts/release/greptile-review-gate.mjs New gate script that wraps greptile review --agent, detects findings via a stdout-anchored clean sentinel, handles non-zero exits with vs without output, and skips gracefully when the CLI is absent or unauthenticated.
scripts/release/run-gates.mjs Adds --skip-greptile flag and wires greptile-review-gate.mjs into the gate pipeline; follows the same runCheckedStep + ok: true pattern used by all other hard gates.
src/core/shared/serialization.ts Decomposes the monolithic stableValueEquals into focused per-type comparators dispatched through SPECIALIZED_STABLE_VALUE_COMPARISONS; extracts the Set-matching helper hasUnmatchedEquivalent; semantics are preserved exactly.
src/core/telemetry/observability.ts Converts the flat if-chain error-message classifier into table-driven TELEMETRY_ERROR_MESSAGE_CLASSIFIERS and TELEMETRY_EXIT_CODE_FALLBACKS; classifier order and exit-code fallback semantics are preserved.
src/core/schema/fields-file.ts Extracts normalizeFieldCommands from normalizeAddFieldInput; the undefined and empty-array edge-cases produce DEFAULT_FIELD_COMMANDS as before.
src/cli/commands/repeatable-metadata-parsers.ts Replaces four identical if (rawValue !== undefined && !trimmedValue) throw guards with a single loop over a tuple array; behaviour unchanged.
tests/unit/scripts/release/greptile-review-gate.spec.ts 18 focused unit tests covering every gate branch: skip paths (not installed, not authenticated, timeout, non-zero clean), pass paths (clean stdout, stderr warnings, aliased --branch), and fail paths (stdout findings, stderr findings, non-zero with findings, --report-only).
eslint.config.mjs Tightens the cyclomatic-complexity ceiling from 260 to 17 to match CodeFactor's Complex Method threshold; pre-existing violations are baselined in eslint-suppressions.json.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[greptile-review-gate.mjs] --> B{greptile whoami}
    B -- spawnFailed --> C[skip: not installed, exit 0]
    B -- status ≠ 0 --> D[skip: not authenticated, exit 0]
    B -- status 0 --> E[greptile review --agent]
    E --> F{timedOut?}
    F -- yes --> G[skip: timed out, exit 0]
    F -- no --> H{status ≠ 0?}
    H -- yes, output empty OR stdout ends clean --> I[skip: did not complete, exit 0]
    H -- yes, output has findings --> J{--report-only?}
    H -- no, status 0 --> K{stdout ends with clean sentinel?}
    J -- yes --> L[ok:false skipped:false, exit 0]
    J -- no --> M[ok:false skipped:false, exit 1]
    K -- yes --> N[ok:true findings:0, exit 0]
    K -- no --> O{--report-only?}
    O -- yes --> P[ok:false, exit 0]
    O -- no --> Q[ok:false, exit 1]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[greptile-review-gate.mjs] --> B{greptile whoami}
    B -- spawnFailed --> C[skip: not installed, exit 0]
    B -- status ≠ 0 --> D[skip: not authenticated, exit 0]
    B -- status 0 --> E[greptile review --agent]
    E --> F{timedOut?}
    F -- yes --> G[skip: timed out, exit 0]
    F -- no --> H{status ≠ 0?}
    H -- yes, output empty OR stdout ends clean --> I[skip: did not complete, exit 0]
    H -- yes, output has findings --> J{--report-only?}
    H -- no, status 0 --> K{stdout ends with clean sentinel?}
    J -- yes --> L[ok:false skipped:false, exit 0]
    J -- no --> M[ok:false skipped:false, exit 1]
    K -- yes --> N[ok:true findings:0, exit 0]
    K -- no --> O{--report-only?}
    O -- yes --> P[ok:false, exit 0]
    O -- no --> Q[ok:false, exit 1]
Loading

Comments Outside Diff (1)

  1. scripts/release/greptile-review-gate.mjs, line 996-999 (link)

    P1 Non-zero exit silently swallows findings

    Any non-zero exit from greptile review — including an exit code used to signal "I found issues" — is treated as skipped (incomplete) rather than a gate failure. Because the failure branch is reached before the clean check, a run where Greptile exits, say, 1 with full finding text in stdout would be reported as { ok: true, skipped: true } and the gate would pass silently.

    Many review/lint-style CLI tools use a non-zero exit to signal findings. If that's the case here, real findings would never block the local pipeline. The PR description states the Greptile GitHub App still reviews every PR independently, which partially mitigates this, but the local gate's "fail on findings" contract only holds when status === 0. Does greptile review --agent always exit 0 when it produces findings and only exit non-zero on transport/infrastructure errors? If non-zero exits can also carry findings, the current logic needs to inspect the output even when status ≠ 0 before deciding to skip.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: scripts/release/greptile-review-gate.mjs
    Line: 996-999
    
    Comment:
    **Non-zero exit silently swallows findings**
    
    Any non-zero exit from `greptile review` — including an exit code used to signal "I found issues" — is treated as `skipped` (incomplete) rather than a gate failure. Because the failure branch is reached before the `clean` check, a run where Greptile exits, say, `1` with full finding text in stdout would be reported as `{ ok: true, skipped: true }` and the gate would pass silently.
    
    Many review/lint-style CLI tools use a non-zero exit to signal findings. If that's the case here, real findings would never block the local pipeline. The PR description states the Greptile GitHub App still reviews every PR independently, which partially mitigates this, but the local gate's "fail on findings" contract only holds when `status === 0`. Does `greptile review --agent` always exit 0 when it produces findings and only exit non-zero on transport/infrastructure errors? If non-zero exits can also carry findings, the current logic needs to inspect the output even when status ≠ 0 before deciding to skip.
    
    How can I resolve this? If you propose a fix, please make it concise.

Reviews (17): Last reviewed commit: "docs(changelog): include quality gate cl..." | Re-trigger Greptile

unbraind and others added 2 commits June 29, 2026 23:37
…int suppressions baseline + Greptile gate (pm-bkcv)

Make "no new CodeFactor issue" a mandatory, repo-controlled gate so changes only
improve the codebase. CodeFactor's ~155 issues are dominated by "Complex Method"
(cyclomatic complexity); the local ESLint parity used `complexity: max 260` and
never fired.

- Lower the complexity ceiling to 17 (errors at CC >= 18, matching CodeFactor's
  flagged range) and grandfather every pre-existing violation in
  `eslint-suppressions.json` via ESLint native bulk suppressions. A new complex
  method now fails `pnpm lint` in CI; fixing one makes its suppression unused
  (also failing lint) until pruned, so the baseline only shrinks — the path to a
  CodeFactor A+ (epic pm-92if). Scripts: `lint:eslint:prune`,
  `lint:complexity:baseline`.
- Add `scripts/release/greptile-review-gate.mjs`: runs the Greptile CLI reviewer
  over the branch and fails on findings, skipping gracefully when Greptile is
  unavailable/unauthenticated (token-less CI stays green). Wired into
  `run-gates.mjs` (`--skip-greptile`) and `package.json` (`review:greptile:gate`).
- CONTRIBUTING documents the only-improve policy; gate scripts at 100% coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137V7E9YVghu1xPZYxvASpz
Refactor four high-complexity paths so the ESLint suppression baseline drops from 161 to 157 without broad behavior changes. Refresh typescript-eslint to 8.62.1 while preserving the Node 22 type floor, and record pm-bkcv verification evidence.

Verification: pm test pm-bkcv --run --progress; node scripts/run-tests.mjs coverage; pnpm lint; pnpm typecheck; pnpm contracts:check; pnpm security:scan; pnpm audit --audit-level moderate; pnpm changelog:pm:check; pm health --check-only --summary --json; package doctor deep; sentry-telemetry gate; isolated temp smoke.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a lower ESLint complexity ceiling with a suppression baseline, wires a Greptile review gate into release gating, refactors several source modules to reduce complexity, and adds related tests plus chore/history records.

Changes

Code quality gates

Layer / File(s) Summary
ESLint complexity ceiling and baseline
eslint.config.mjs, eslint-suppressions.json, package.json, CONTRIBUTING.md
Sets the complexity threshold to 17, populates per-file suppression counts, adds lint scripts for pruning and baselining, bumps typescript-eslint, and documents the gate.
Greptile review gate
scripts/release/greptile-review-gate.mjs, scripts/release/run-gates.mjs, package.json, tests/unit/scripts/release/greptile-review-gate.spec.ts, tests/unit/scripts/release/run-gates.spec.ts
Adds the Greptile gate script, wires it into release gating, and covers the new gate flow with unit tests.

Complexity-reducing source refactors

Layer / File(s) Summary
Parser and field normalization
src/cli/commands/repeatable-metadata-parsers.ts, src/core/schema/fields-file.ts
parseEventEntries validates optional event fields through one loop, and normalizeAddFieldInput now uses normalizeFieldCommands for command list normalization.
Stable value comparison helpers
src/core/shared/serialization.ts
stableValueEquals now dispatches through specialized comparers for RegExp, Date, Set, Map, and arrays before falling back to plain-object comparison.
Telemetry error classification
src/core/telemetry/observability.ts
inferTelemetryErrorCode now uses classifier predicates and exit-code fallback tables instead of chained substring checks and conditional exit-code branches.

Agent records

Layer / File(s) Summary
PM chore and history records
.agents/pm/chores/pm-bkcv.toon, .agents/pm/history/pm-bkcv.jsonl
The new chore file records acceptance criteria, evidence, impacted files, tests, and local run data; the JSONL history file appends workflow, verification, and follow-up entries.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • unbraind/pm-cli#305: Both PRs extend scripts/release/run-gates.mjs with another release gate and corresponding CLI wiring.
  • unbraind/pm-cli#383: This PR extends the CodeFactor/ESLint complexity setup that was introduced there with a stricter ceiling and suppression baseline handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.91% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a CodeFactor no-regression gate and reducing existing complexity debt.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly matches the changeset, covering the quality gate, complexity pruning, Greptile wiring, and tooling updates.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a cyclomatic complexity ceiling gate of 17 using ESLint and a baseline of grandfathered violations in eslint-suppressions.json. It also integrates the Greptile CLI reviewer into the local CI/CD pipeline via greptile-review-gate.mjs and run-gates.mjs, and refactors several modules to reduce complexity and prune suppressions. Review feedback recommends removing an unused import and handling potential NaN timeouts in greptile-review-gate.mjs, as well as optimizing stableValueEquals in serialization.ts by moving a static array allocation outside the recursive function.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/core/shared/serialization.ts Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a CodeFactor no-regression gate by lowering the cyclomatic complexity ceiling to 17 in ESLint, baselining existing violations, and refactoring several complex methods to prune suppressions. It also integrates a best-effort Greptile review gate into the local CI/CD pipeline and documents these policies in CONTRIBUTING.md. The review feedback highlights several improvement opportunities: removing an unused import in the Greptile gate script, handling potential NaN values when parsing --timeout-ms to avoid runtime crashes, and resetting process.exitCode in an afterEach block within the test suite to prevent global state leakage from incorrectly failing the test runner.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a CodeFactor no-regression gate by lowering the cyclomatic complexity ceiling to 17, baselining existing violations in eslint-suppressions.json, and integrating a best-effort Greptile CLI reviewer gate into the local CI/CD pipeline. Additionally, several files are refactored to reduce complexity and prune suppressions. The reviewer feedback is highly constructive, identifying opportunities to print the actual findings when the Greptile gate fails in human-readable mode and to handle potential NaN values when parsing the --timeout-ms flag to prevent process hangs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@eslint.config.mjs`:
- Around line 4-11: The complexity gate description in eslint.config.mjs
overstates what the suppression baseline enforces. Update the comment near the
top-level complexity rule and the related guidance so it matches the actual
behavior of eslint-suppressions.json: bulk suppressions are file/rule-based, so
this setup only blocks net-new complexity violations per file, not every newly
added complex method. If you want to keep the stronger claim, replace the
current baseline approach in the complexity gate with a location-aware or
diff-based check.

In `@scripts/release/greptile-review-gate.mjs`:
- Line 62: Validate the parsed --timeout-ms value before it is used by the
spawnSync call in greptile-review-gate.mjs. The timeoutMs assignment using
Number.parseInt on flagString can yield NaN or a negative number, so add a check
in the timeout parsing/normalization path and fall back to a safe default or
fail with a clear message before invoking spawnSync. Use the timeoutMs variable
and the flagString parsing logic to locate the fix.

In `@src/core/shared/serialization.ts`:
- Around line 169-175: Hoist the fixed comparer array out of stableValueEquals
so it is created once at module scope instead of on every recursive call. Move
the specializedComparisons list near the other top-level comparer helpers in
serialization.ts, and keep stableValueEquals referencing that shared constant so
behavior stays unchanged while avoiding repeated allocations in hot paths.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: de0544a3-c6f7-4512-ade5-c1220a2bfb33

📥 Commits

Reviewing files that changed from the base of the PR and between 5e20910 and 86595a1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • .agents/pm/chores/pm-bkcv.toon
  • .agents/pm/history/pm-bkcv.jsonl
  • CONTRIBUTING.md
  • eslint-suppressions.json
  • eslint.config.mjs
  • package.json
  • scripts/release/greptile-review-gate.mjs
  • scripts/release/run-gates.mjs
  • src/cli/commands/repeatable-metadata-parsers.ts
  • src/core/schema/fields-file.ts
  • src/core/shared/serialization.ts
  • src/core/telemetry/observability.ts
  • tests/unit/scripts/release/greptile-review-gate.spec.ts
  • tests/unit/scripts/release/run-gates.spec.ts

Comment thread eslint.config.mjs Resolved
Comment thread src/core/shared/serialization.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

6 issues found across 15 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="eslint-suppressions.json">

<violation number="1" location="eslint-suppressions.json:339">
P2: This baseline cannot enforce the stated no-regression behavior for existing complex methods: making an already-suppressed function more complex keeps the same per-file violation count and still passes lint. Add a separate complexity-delta check or line/function-specific baseline if worsening existing debt must fail.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread eslint-suppressions.json Resolved
Comment thread .agents/pm/chores/pm-bkcv.toon Resolved
Comment thread src/core/shared/serialization.ts Resolved
Clarify the file/rule semantics of the complexity suppression baseline, harden the Greptile review gate timeout and failure output paths, and hoist the stable equality comparer list to avoid recursive allocation churn.

Verification: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts tests/unit/core/shared/serialization-utils.spec.ts; pnpm lint; pnpm typecheck.
@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@unbraind

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request lowers the cyclomatic complexity ceiling to 17 via ESLint, grandfathering existing violations in eslint-suppressions.json, and integrates the Greptile CLI reviewer into the local CI/CD pipeline via a new best-effort gate script. It also refactors several modules to prune complexity debt. The review feedback highlights two key issues in the Greptile gate script: first, treating any non-zero exit code from greptile review as a silent skip could incorrectly bypass the gate on findings; second, mapping the --base option to the Greptile CLI's --branch flag causes it to review the base branch instead of the feature branch.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a cyclomatic complexity ceiling of 17 to prevent regressions, utilizing native ESLint bulk suppressions in eslint-suppressions.json to grandfather existing violations. To support this, several complex methods are refactored and simplified across the codebase, including metadata parsing, schema field normalization, serialization, and telemetry error classification. Additionally, a Greptile CLI reviewer gate is introduced in scripts/release/greptile-review-gate.mjs and integrated into the local CI/CD run-gates pipeline. Feedback suggests renaming the --base option in the Greptile wrapper script to --branch to align with the Greptile CLI's native behavior and avoid confusion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Cover the empty-review-body human failure path so the Greptile review gate stays at 100% branch coverage after printing findings in non-JSON output.

Verification: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts; node scripts/run-tests.mjs coverage.
@unbraind

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@gemini-code-assist review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant