Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .agents/pm/chores/pm-bkcv.toon
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
id: pm-bkcv
title: "CodeFactor no-regression gate: complexity ceiling + ESLint suppressions baseline + Greptile in local CI/CD"
description: "Make 'no new CodeFactor issue' a mandatory guardrail so the codebase only improves. CodeFactor grade is A with ~155 issues dominated by 'Complex Method' (cyclomatic complexity) findings; the local ESLint parity used complexity max 260 (never fired). Lower the complexity ceiling to 17 (errors at CC>=18, matching CodeFactor's flagged range) and grandfather pre-existing violations in eslint-suppressions.json via ESLint native bulk suppressions. This blocks net-new per-file complexity debt while the baseline is maintained and pruned, but it is not a location-aware delta check for worsening an already-suppressed function. Fixing complex methods requires pruning stale suppressions, so the baseline can shrink toward zero — the path to a CodeFactor A+. This item wires the Greptile CLI reviewer into local CI/CD via scripts/release/greptile-review-gate.mjs (best-effort: fails on findings when authenticated, skips gracefully in token-less CI) and run-gates.mjs. Current committed suppression debt is 157; driving that to zero remains under this epic."
type: Chore
status: closed
priority: 1
tags[5]: "area:ci","area:quality",codefactor,living-map,pm-cli
created_at: "2026-06-29T21:31:08.795Z"
updated_at: "2026-06-30T00:27:21.014Z"
author: claude-code-agent
acceptance_criteria: complexity ceiling lowered to 17 with committed eslint-suppressions.json baseline; pnpm lint passes on existing code and blocks net-new per-file complexity debt as the baseline is maintained; fixing a method forces a stale suppression prune where the file's baseline count drops (only-improve); greptile-review-gate.mjs added (best-effort skip when unauthenticated) and wired into run-gates.mjs + package.json; CONTRIBUTING documents the policy and its file/rule baseline semantics; all gates green; net A+ path documented.
parent: pm-92if
resolution: "Delivered a CodeFactor no-regression quality gate, reduced the committed complexity suppression baseline from 161 to 157, hardened the Greptile local review gate after AI review feedback, stabilized hosted coverage, and recorded full local/hosted validation evidence."
expected_result: "The repository blocks net-new local complexity debt through the committed ESLint suppression baseline, runs the Greptile review gate in local release checks, keeps package-author and temp-project workflows working, and has green PR checks before merge."
actual_result: "PR #405 implements the quality gate, Greptile gate, docs, tests, dependency refresh, and regression fixes; local lint/typecheck/coverage and temp-project smokes passed; hosted PR checks were green before PM closeout; remaining resolution warnings are pre-existing closed-item backlog outside this item."
comments[14]{created_at,author,text}:
"2026-06-29T22:12:15.408Z",claude-code-agent,"Evidence: pruned CodeFactor complexity suppressions from 161 to 157 by simplifying repeatable metadata parsing, schema field command normalization, stable serialization equality, and telemetry error-code classification; refreshed typescript-eslint to 8.62.1 while keeping @types/node at the Node 22 support floor. Verification passed: npm install -g .; pm --version 2026.6.24; pnpm build; focused linked pm test run 6/6 passed; node scripts/run-tests.mjs coverage passed 262 files, 5245 tests, 100% statements/branches/functions/lines; 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 clean; pm validate --check-history-drift clean with existing resolution-backfill warnings only; package doctor project deep clean; sentry-telemetry gate clean with zero critical/high Sentry issues and telemetry finish error rate 0.79%; 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 sweep found no open PRs at start, issue #374 still blocked by missing RELEASE_PAT, and no Dependabot/code scanning/secret scanning alerts."
"2026-06-29T22:19:43.192Z",claude-code-agent,"Greptile follow-up evidence: fixed stale eslint.config.mjs regeneration command, hardened greptile-review-gate so non-zero review exits cannot be reported clean even when output contains 'No review comments', and mapped the wrapper base option to the installed Greptile CLI's --branch flag. Verification passed: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts (10 tests), pnpm lint, pnpm typecheck."
"2026-06-29T22:27:11.715Z",claude-code-agent,"Greptile pre-push status: ran greptile review --help; initial committed review b53f47fd-26cf-4ab8-99da-f90a813844dc reported two findings and both were fixed. A rerun without layout returned the cached stale review text; a fresh layout-diff review 5b011ee8-ee9b-48bb-9bb0-2e4f440d7367 was dispatched but did not finish in the local polling window. Current diff confirms both original findings are fixed, and focused Greptile gate tests, lint, and typecheck pass; PR-side review agents will run on the pushed head."
"2026-06-29T22:41:31.757Z",claude-code-agent,"AI review response evidence: addressed CodeRabbit, Gemini, and Cubic comments by clarifying file/rule suppression-baseline semantics in eslint.config.mjs and pm-bkcv, validating invalid/negative Greptile --timeout-ms values with a safe default, removing the unused fail import, printing Greptile review findings in human failure output, moving the clean-review regex after non-zero exit handling, and hoisting the stableValueEquals comparer list to module scope. Verification passed: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts tests/unit/core/shared/serialization-utils.spec.ts (17 tests), pnpm lint, pnpm typecheck."
"2026-06-29T23:00:29.764Z",claude-code-agent,"CI coverage follow-up evidence: GitHub Gates (coverage) on run 28407762351 failed because the new Greptile human failure-output branch left branch coverage at 99.99% (scripts/release/greptile-review-gate.mjs line 50). Added a focused test for the empty-review-body failure path. Verification passed locally: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts (12 tests) and node scripts/run-tests.mjs coverage (262 files, 5248 tests, 100% statements/branches/functions/lines)."
"2026-06-29T23:25:23.361Z",claude-code-agent,"AI review response evidence: tightened Greptile review gate after latest Gemini feedback. Clean-review detection is now anchored to terminal output; nonzero review exits with findings output fail the gate instead of skipping; --branch is accepted as a wrapper alias while --base compatibility remains and both forward to Greptile's native comparison --branch flag. Verification passed: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts (15 tests before coverage fix); focused coverage run confirmed the spec passed but global partial coverage thresholds intentionally failed; node scripts/run-tests.mjs coverage passed 262 files, 5252 tests, 100% statements/branches/functions/lines."
"2026-06-29T23:25:31.422Z",claude-code-agent,"Evidence correction: final Greptile gate focused suite is 16 tests after adding the nonzero findings --report-only branch case; final full coverage evidence remains node scripts/run-tests.mjs coverage passing 262 files, 5252 tests, 100% statements/branches/functions/lines."
"2026-06-29T23:37:23.462Z",claude-code-agent,"AI review response evidence: CodeRabbit follow-up addressed by using combined stdout/stderr output for the successful-exit Greptile findings failure path and adding stderr-only findings coverage. Also linked missing PR-scope files CONTRIBUTING.md, scripts/release/run-gates.mjs, and tests/unit/scripts/release/run-gates.spec.ts via pm files so the item manifest matches the full PR scope."
"2026-06-29T23:42:52.131Z",claude-code-agent,"Verification evidence: CodeRabbit follow-up passed node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts (17 tests), pnpm lint, pnpm typecheck, and node scripts/run-tests.mjs coverage (262 files, 5253 tests, 100% statements/branches/functions/lines)."
"2026-06-29T23:52:40.285Z",claude-code-agent,"AI review response evidence: Cubic clean-review edge addressed by matching the Greptile clean sentinel on stdout only, so stderr progress/warnings do not turn a clean review into findings while stderr-only findings still fail. Verification passed: node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts (18 tests), pnpm lint, pnpm typecheck, and node scripts/run-tests.mjs coverage (262 files, 5254 tests, 100% statements/branches/functions/lines)."
"2026-06-30T00:04:35.874Z",claude-code-agent,"CI follow-up: hosted Gates (coverage) failed on the context no-agenda markdown test because the helper default +1d deadline crossed into the July 1 query window after the runner clock reached 2026-06-30 UTC. Fixed the test seed to use an explicit out-of-window 2026-06-01 deadline and verified the focused regression locally."
"2026-06-30T00:10:00.304Z",claude-code-agent,"Verification evidence: CI no-agenda regression fix passed focused node scripts/run-tests.mjs test -- tests/unit/commands/context-command.spec.ts -t 'renders markdown guidance when agenda has no events'; pnpm lint; pnpm typecheck; and node scripts/run-tests.mjs coverage (262 files, 5254 tests, 100% statements/branches/functions/lines)."
"2026-06-30T00:13:37.996Z",claude-code-agent,"Greptile pre-push status: current-head local greptile review dispatched as 1f2aa176-ed51-4430-9701-f0c5ea93ad85 against main with layout diff/agent output, but the CLI timed out after 180s without returning findings. Proceeding with PR-side @greptileai retrigger on the pushed head plus green local lint/typecheck/coverage evidence."
"2026-06-30T00:27:21.007Z",claude-code-agent,"Changelog evidence: regenerated CHANGELOG.md with pm-changelog 2026.6.27 after closing pm-bkcv so pnpm changelog:pm:check reflects the actual closed-item set."
files[14]{path,scope,note}:
CONTRIBUTING.md,project,Document complexity baseline policy and file/rule suppression semantics
eslint-suppressions.json,project,Prune stale complexity suppression after local debt reduction
eslint.config.mjs,project,Fix Greptile-reviewed complexity baseline regeneration guidance
package.json,project,Refresh typescript-eslint quality tooling dependency to latest patch
pnpm-lock.yaml,project,Lock latest typescript-eslint patch dependency graph
scripts/release/greptile-review-gate.mjs,project,Fix Greptile-reviewed nonzero-exit handling and branch flag mapping
scripts/release/run-gates.mjs,project,Wire Greptile review gate into release gate runner
src/cli/commands/repeatable-metadata-parsers.ts,project,Prune one CodeFactor complexity suppression without adding one-use helpers
src/core/schema/fields-file.ts,project,Prune schema field normalization complexity debt while preserving inline logic
src/core/shared/serialization.ts,project,Split stable equality comparison paths and remove another complexity suppression
src/core/telemetry/observability.ts,project,Table-drive telemetry error classification and remove another complexity suppression
tests/unit/commands/context-command.spec.ts,project,Stabilize no-agenda context regression after UTC date rollover exposed by hosted coverage
tests/unit/scripts/release/greptile-review-gate.spec.ts,project,Cover Greptile nonzero clean-text edge case and branch flag mapping
tests/unit/scripts/release/run-gates.spec.ts,project,Cover run-gates integration of the Greptile review gate
tests[9]{command,path,scope,timeout_seconds,pm_context_mode,env_set,env_clear,shared_host_safe,assert_stdout_contains,assert_stdout_regex,assert_stderr_contains,assert_stderr_regex,assert_stdout_min_lines,assert_json_field_equals,assert_json_field_gte,note}:
node scripts/run-tests.mjs coverage,null,project,420,null,null,null,null,null,null,null,null,null,null,null,null
"node scripts/run-tests.mjs test -- tests/unit/commands/context-command.spec.ts -t \"renders markdown guidance when agenda has no events\"",null,project,120,null,null,null,null,null,null,null,null,null,null,null,Focused regression for date-independent no-agenda markdown guidance
node scripts/run-tests.mjs test -- tests/unit/core/schema/fields-file.spec.ts tests/unit/commands/create-command.spec.ts tests/unit/commands/update-command.spec.ts,null,project,240,null,null,null,null,null,null,null,null,null,null,null,null
node scripts/run-tests.mjs test -- tests/unit/core/shared/serialization-utils.spec.ts,null,project,120,null,null,null,null,null,null,null,null,null,null,null,null
node scripts/run-tests.mjs test -- tests/unit/core/telemetry/telemetry-observability.spec.ts,null,project,120,null,null,null,null,null,null,null,null,null,null,null,null
node scripts/run-tests.mjs test -- tests/unit/scripts/release/greptile-review-gate.spec.ts,null,project,120,null,null,null,null,null,null,null,null,null,null,null,null
pnpm audit --audit-level moderate,null,project,180,null,null,null,null,null,null,null,null,null,null,null,null
pnpm lint,null,project,240,null,null,null,null,null,null,null,null,null,null,null,null
pnpm typecheck,null,project,240,null,null,null,null,null,null,null,null,null,null,null,null
test_runs[1]{run_id,kind,status,started_at,finished_at,recorded_at,attempt,resumed_from,passed,failed,skipped,items,linked_tests,fail_on_skipped_triggered}:
test-local-mqzrqceq-kk9bi5,test,passed,"2026-06-29T22:06:05.208Z","2026-06-29T22:07:25.778Z","2026-06-29T22:07:25.778Z",null,null,6,0,0,null,null,null
docs[1]{path,scope,note}:
CHANGELOG.md,project,Generated changelog entry for closed quality-gate work
close_reason: "Delivered CodeFactor no-regression quality gate and Greptile local review gate. Evidence: local bootstrap/build and broad gates passed; local coverage passed 262 files / 5254 tests with 100% statements, branches, functions, and lines; hosted PR #405 checks green including Gates coverage, static, typecheck, compat, smokes, Windows, CodeQL, CodeFactor, CodeRabbit status, Hound, and Cubic; unresolved review threads resolved after verifying latest code; manual temp-project/package-author smoke passed earlier and is recorded in comments."
body: ""
Loading
Loading