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
2 changes: 1 addition & 1 deletion .agents/pm/extensions/.managed-extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 1,
"updated_at": "2026-06-30T08:15:50.258Z",
"updated_at": "2026-07-01T08:01:46.535Z",
"entries": [
{
"name": "pm-changelog",
Expand Down
30 changes: 30 additions & 0 deletions .agents/pm/history/pm-0n6p.jsonl

Large diffs are not rendered by default.

38 changes: 36 additions & 2 deletions .agents/pm/tasks/pm-0n6p.toon
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,47 @@ id: pm-0n6p
title: "CodeFactor/Complexity: decompose runUpdate, the update mutate apply-callback, and register-mutation MCP arrows"
description: "Follow-up to pm-g7vl. Reduce the remaining item-mutation Complex Methods to <=17: runUpdate (CC 77) and the nested mutate apply-callback (CC 148) in src/cli/commands/update.ts, and the 6 shared register-mutation.ts arrows (CC 18-28). Behavior-preserving extraction; prune suppressions; 100% coverage; contracts/full.json byte-identical. Prefer extracting shared create/update field-resolution helpers into a common module to also cut duplication."
type: Task
status: open
status: closed
priority: 2
tags[4]: "area:cli",code-quality,codefactor,tech-debt
created_at: "2026-07-01T05:35:48.850Z"
updated_at: "2026-07-01T05:35:57.943Z"
updated_at: "2026-07-01T11:20:40.685Z"
author: claude-code-agent
parent: pm-92if
resolution: fixed
expected_result: Update and register-mutation command paths stay behavior-compatible while the CodeFactor complex-method suppressions are removed and review feedback is resolved.
actual_result: "runUpdate, its mutation callback, and register-mutation actions were decomposed into focused helpers; canceled-status assignee cleanup and runtime field set/unset conflict handling are covered; PR #413 passed local/manual verification and all GitHub checks and AI reviews."
dependencies[1]{id,kind,created_at,author,source_kind}:
pm-g7vl,related,"2026-07-01T05:35:57.931Z",null,null
comments[11]{created_at,author,text}:
"2026-07-01T07:10:59.487Z",claude-code-agent,"Implementation start: duplicate-safe all-status search reused existing CodeFactor child pm-0n6p under pm-92if. Live sweep on 2026-07-01: no open PRs, no open GitHub issues, no open Dependabot alerts, no open code-scanning alerts; scheduled Auto Release run 28499297083 succeeded on main b2617dac and npm latest is @unbrained/pm-cli 2026.7.1. Scope is behavior-preserving complexity decomposition for update command and MCP register-mutation handlers with contracts unchanged and 100% coverage."
"2026-07-01T08:04:10.045Z",claude-code-agent,"Evidence: implemented CodeFactor complexity remediation for update/register-mutation. Removed target complexity suppressions, added register-mutation schema repeatable alias/role coverage, and manually smoke-tested installed pm in /tmp/tmp.3bglbDFU7O with custom status aliases, custom type, runtime schema field CLI flags, create/update/list/health. Gates: linked pm test run passed all 4 commands under tracker context (coverage 100/100/100/100, focused update/register tests, contracts check, lint/static quality); direct pnpm typecheck, pnpm build, pnpm contracts:check, pnpm lint, pnpm changelog:pm:check, secrets scan, pnpm audit, pm health summary, git diff --check passed. GitHub: no open PRs/issues, no Dependabot/code-scanning alerts, latest Auto Release 28499297083 success on 2026-07-01T06:52:39Z. Sentry: issue list reachable; sampled unresolved PM-CLI-16 and PM-CLI-1Q are stale with lastSeen 2026-06-13, not new current-regression evidence; telemetry status enabled with last successful flush 2026-07-01T08:03:07.606Z. pm validate strict-exit still reports pre-existing closed-item resolution metadata warnings, but command references and history drift are clean."
"2026-07-01T08:13:20.768Z",claude-code-agent,"Greptile pre-push review ee898fbd-4a0d-48f9-9fce-5b22c99f77c5 found one P2 cleanup: unused sprintReleasePolicy in src/cli/commands/update.ts after helper extraction. Removed the dead local and reran focused gates: unsuppressed ESLint for update/register/test files passed; pnpm typecheck passed; node scripts/run-tests.mjs test -- tests/unit/commands/update-command.spec.ts tests/unit/commands/register-commands.spec.ts passed (174 tests)."
"2026-07-01T08:29:51.374Z",claude-code-agent,"Greptile follow-up review 3df1cc5f-6934-4d13-b26e-4a26ea2dea8a found two P2 behavior-preservation concerns. Fixed both before push: restored defensive string-to-array coercion for programmatic schema alias/role option inputs in register-mutation, and changed replace-tests helper behavior so an empty defensive replacement uses the existing empty-array cleanup path instead of assigning undefined. Added focused register-command coverage for the programmatic string coercion path. Verification after fixes: unsuppressed ESLint for update/register/test files passed; pnpm typecheck passed; node scripts/run-tests.mjs test -- tests/unit/commands/update-command.spec.ts tests/unit/commands/register-commands.spec.ts passed (175 tests); node scripts/run-tests.mjs coverage passed 262 files / 5265 tests with Statements 100%, Branches 100%, Functions 100%, Lines 100%."
"2026-07-01T08:43:05.047Z",claude-code-agent,"Greptile final pre-push review 4cd22b0a-0678-40ee-b5e5-f24b4863ced0 returned COMMENTS=0 and confidence 4 after the prior findings were fixed. Greptile summary: behavior-preserving complexity refactor, contracts unchanged, 100% branch coverage retained, and prior issues resolved before push."
"2026-07-01T09:06:34.568Z",claude-code-agent,"CodeRabbit PR #413 review follow-up: verified thread-aware review data and fixed all still-valid comments. Moved canceled-status assignee cleanup after ownership mutations and records assignee in changed_fields; made runtime schema field set/unset conflicts explicit and taught update command option-policy presence to resolve runtime unset fields with the runtime registry; replaced the register-command test's private Commander _actionHandler access with the public parseAsync path while retaining defensive string coercion coverage. Verification so far: unsuppressed ESLint for changed update/register tests passed; pnpm typecheck passed; node scripts/run-tests.mjs test -- tests/unit/commands/update-command.spec.ts tests/unit/commands/register-commands.spec.ts passed (176 tests); node scripts/run-tests.mjs coverage passed 262 files / 5266 tests with 100% statements, branches, functions, and lines."
"2026-07-01T09:12:55.600Z",claude-code-agent,"Final PR #413 review-fix verification: linked pm test run passed all 4 registered commands under tracker context after CodeRabbit fixes: node scripts/run-tests.mjs coverage, focused update/register test suites, pnpm contracts:check, and pnpm lint. Coverage remained 100/100/100/100 and lint/static quality gate passed."
"2026-07-01T09:19:56.850Z",claude-code-agent,Greptile review-fix pre-push review 57d09f62-a984-4c4f-9632-ddbfb38162ef returned COMMENTS=0 and confidence 4 after CodeRabbit fixes. Greptile noted the canceled-status assignee ordering and runtime-field unset conflict behavior as intentional correctness improvements with dedicated tests.
"2026-07-01T09:34:19.512Z",claude-code-agent,"Evidence: merged origin/main release commit a4ee2a15 into the PR branch without conflicts; post-merge focused tests and typecheck passed; linked pm test run passed coverage, focused update/register tests, contracts, and lint. Local Greptile review against origin/main returned zero comments and confidence 4 before committing this evidence."
"2026-07-01T10:57:22.497Z",claude-code-agent,"Review follow-up: addressed Gemini current-head feedback by removing the non-null assertion from the runtime schema field unset-conflict path and using the normalized runtime field flag in the conflict message. Verification: ESLint on src/cli/commands/update.ts passed; pnpm typecheck passed; focused update/register tests passed (176 tests); full coverage passed 262 files / 5266 tests with 100% statements, branches, functions, and lines."
"2026-07-01T11:20:40.684Z",claude-code-agent,"Review follow-up: addressed CodeRabbit current-head feedback by using the runtime field definition cli_flag in the unset/value conflict message and covering the distinct metadata_key vs cli_flag case in update-command tests. Verification: ESLint on changed update files passed; pnpm typecheck passed; focused update/register tests passed (176 tests); full coverage passed 262 files / 5266 tests with 100% statements, branches, functions, and lines."
files[4]{path,scope,note}:
eslint-suppressions.json,project,Prune update/register-mutation complexity suppression baseline after refactor
src/cli/commands/update.ts,project,Decompose runUpdate and update mutate callback to remove CodeFactor complexity suppressions
src/cli/register-mutation.ts,project,Extract complex mutation command action handlers into focused helpers
tests/unit/commands/register-commands.spec.ts,project,Cover repeatable schema alias/role routing after register-mutation extraction
tests[4]{command,scope,timeout_seconds}:
node scripts/run-tests.mjs coverage,project,900
node scripts/run-tests.mjs test -- tests/unit/commands/update-command.spec.ts tests/unit/commands/register-commands.spec.ts,project,240
"pnpm contracts:check",project,180
pnpm lint,project,240
test_runs[5]{run_id,kind,status,started_at,finished_at,recorded_at,passed,failed,skipped}:
test-local-mr1rfk6w-uuqerr,test,failed,"2026-07-01T07:28:34.578Z","2026-07-01T07:34:35.000Z","2026-07-01T07:34:35.000Z",2,2,0
test-local-mr1scxge-78a0xc,test,passed,"2026-07-01T07:54:30.248Z","2026-07-01T08:00:31.838Z","2026-07-01T08:00:31.838Z",4,0,0
test-local-mr1tmtbv-72ybib,test,passed,"2026-07-01T08:30:08.968Z","2026-07-01T08:36:12.668Z","2026-07-01T08:36:12.668Z",4,0,0
test-local-mr1uxtmt-7nb6at,test,passed,"2026-07-01T09:06:40.419Z","2026-07-01T09:12:45.893Z","2026-07-01T09:12:45.893Z",4,0,0
test-local-mr1vorkh-fd5a65,test,passed,"2026-07-01T09:27:42.377Z","2026-07-01T09:33:42.929Z","2026-07-01T09:33:42.929Z",4,0,0
docs[1]{path,scope,note}:
CHANGELOG.md,project,Generated pm-changelog entry after closing pm-0n6p
close_reason: "Implemented CodeFactor complexity remediation for update/register-mutation, fixed review feedback, and verified PR #413 green on head dfb8d641 with coverage/typecheck/static/smoke/Windows/CodeQL/CodeFactor/CodeRabbit/Gemini/Greptile all clean; manual installed-package temp smoke and linked pm tests passed."
body: ""
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Changed

- CodeFactor/Complexity: decompose runUpdate, the update mutate apply-callback, and register-mutation MCP arrows ([pm-0n6p](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-0n6p.toon))

## 2026.7.1 - 2026-07-01

### Changed
Expand Down
10 changes: 0 additions & 10 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@
"count": 1
}
},
"src/cli/commands/update.ts": {
"complexity": {
"count": 2
}
},
"src/cli/commands/validate.ts": {
"complexity": {
"count": 5
Expand All @@ -239,11 +234,6 @@
"count": 2
}
},
"src/cli/register-mutation.ts": {
"complexity": {
"count": 6
}
},
"src/cli/register-operations.ts": {
"complexity": {
"count": 1
Expand Down
Loading
Loading