Fix CodeFactor duplication in CLI and SDK primitives
Merged
UN
4mo ago+267+267+012345678901234567890123456789-313-313-012345678901234567890123456789
Summary
- Single-source create/update
--unsetfield metadata inshared-unset-fields.tsand reuse it from both command handlers. - Share create/update mutation option keys and SDK bulk mutation filter contracts to remove duplicated shipped tables.
- Keep CodeFactor focused on actionable source by excluding generated package runtime loaders, generated plugin MCP launchers, and tests enforced by repo gates; update the CodeFactor docs pointer.
- Record PM evidence under
pm-92if,pm-fmjy, andpm-arzz, including GitHub/dependency/security/changelog/Sentry/telemetry findings.
Verification
pnpm buildnode scripts/run-tests.mjs test -- tests/unit/commands/create-command.spec.ts tests/unit/commands/update-command.spec.ts tests/unit/packages/runtime-loaders.spec.ts tests/unit/scripts/gen-package-runtime-loaders.spec.ts tests/unit/scripts/gen-plugin-mcp-wrappers.spec.ts tests/unit/plugins/pm-mcp-server.spec.ts tests/unit/packages/package-manifest.spec.ts(7 files, 254 tests)pnpm contracts:checkpnpm quality:staticpnpm typecheckpnpm security:scannode scripts/run-tests.mjs coverage(256 files, 5133 tests, 100% statements/branches/functions/lines)pnpm changelog:pm:check(pm-changelog 2026.6.20, CHANGELOG.md unchanged)- manual temp-dir smoke with isolated
PM_PATH/PM_GLOBAL_PATH: init, create, update--unset, package install todos, package doctor deep, contracts, health node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effortpm telemetry stats --json
GitHub / release notes
- No open Dependabot alerts and no open code scanning alerts at branch creation time.
- Existing issue #374 remains externally blocked on missing
RELEASE_PATin the release environment; this branch does not require code changes for that failure.
Summary by Sourcery
Deduplicate shared CLI unset-field metadata and bulk mutation option/filter contracts while tightening CodeFactor analysis scope and recording associated PM evidence.
Enhancements:
- Single-source unset-field definitions for create and update CLI commands via shared metadata.
- Share common mutation command option key lists between create and update item type registry entries.
- Reuse a unified bulk-mutation filter option contract across SDK update-many and close-many tool contracts.
Build:
- Refine CodeFactor configuration to exclude generated loaders, generated plugin launchers, and tests from analysis.
Chores:
- Add and update PM agent evidence files for the referenced product-management tasks and epics.
Summary by cubic
Dedupes CLI and SDK primitives flagged by CodeFactor by single-sourcing unset field metadata, shared mutation option keys, and bulk filter contracts. Updates .codefactor.yml to ignore generated loaders/launchers and tests so reports focus on shipped code; no behavior changes.
- Refactors
- Added
src/cli/commands/shared-unset-fields.tsand reused increate.ts/update.ts; replaced slice-based update ordering with named groups aroundclose-reason; keptauthorplacement for create. - Extracted
COMMON_MUTATION_COMMAND_OPTION_KEYSinsrc/core/item/type-registry.tsand reused across create/update; documented core↔CLI alignment boundary. - Unified SDK bulk mutation filter contracts via
TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACTS, reused by update-many and close-many. - Updated
.codefactor.ymldocs link and excludedpackages/**/runtime-loader.ts,plugins/**/scripts/pm-mcp-server.mjs, andtests/**from analysis.
- Added