Goal
Share candidate-field validation/update construction and plan application inside project_item_fields.py, leaving source-copy and default candidate selection explicit.
Background
Repository-wide duplication review against f9c18f3294873cbbcda9acc7af7f1bc6b17eed45 (2026-09-17).
The copy and defaults planners contain the same 28 normalized lines for missing-field/option validation, skip creation and update construction. Their apply functions then repeat the same mutation loop and summary construction. The source of candidate values differs; validation and application do not.
Verified source locations:
No matching open issue was found in the repository backlog.
This is a maintainability refactor. Similarity alone is not evidence of a production failure; any demonstrated differences are called out above.
Scope
Share candidate-field validation/update construction and plan application inside project_item_fields.py, leaving source-copy and default candidate selection explicit.
Acceptance Criteria
- Preserve nonempty target values and deterministic ordering.
- Preserve missing source behavior and missing field/option skip reasons.
- Preserve existing default-value behavior rather than silently changing empty-value rules.
- Apply planned updates through one implementation, preserving call order and failure propagation.
Validation
Run base_github_projects/tests/test_project_item_fields_graphql.py; exercise both planners with present targets, missing fields/options, absent source issues and mocked GraphQL calls.
Run focused checks first, then the repository-required broader checks for the actual implementation. Preserve public command contracts and review .ai-context/ impact in the PR.
Non-Goals
No Project schema changes, new transport layer, automatic overwrite policy or extra API requests.
Project Fields
- Status: Ready
- Priority: P3
- Area: CLI
- Initiative: Contract Hardening
- Size: S
- Milestone: Unscheduled; no release commitment is implied by this audit.
Agent Assignment
Implementation-ready scoped follow-up, assigned to codeforester. Follow AGENTS.md and docs/github-workflow.md: start through basectl gh issue start, use the canonical issue worktree, characterize current behavior before extraction, and open an issue-linked PR. Keep each refactor independently reviewable.
Goal
Share candidate-field validation/update construction and plan application inside
project_item_fields.py, leaving source-copy and default candidate selection explicit.Background
Repository-wide duplication review against
f9c18f3294873cbbcda9acc7af7f1bc6b17eed45(2026-09-17).The copy and defaults planners contain the same 28 normalized lines for missing-field/option validation, skip creation and update construction. Their apply functions then repeat the same mutation loop and summary construction. The source of candidate values differs; validation and application do not.
Verified source locations:
cli/python/base_github_projects/project_item_fields.py:57-143cli/python/base_github_projects/project_item_fields.py:146-193No matching open issue was found in the repository backlog.
This is a maintainability refactor. Similarity alone is not evidence of a production failure; any demonstrated differences are called out above.
Scope
Share candidate-field validation/update construction and plan application inside
project_item_fields.py, leaving source-copy and default candidate selection explicit.Acceptance Criteria
Validation
Run
base_github_projects/tests/test_project_item_fields_graphql.py; exercise both planners with present targets, missing fields/options, absent source issues and mocked GraphQL calls.Run focused checks first, then the repository-required broader checks for the actual implementation. Preserve public command contracts and review
.ai-context/impact in the PR.Non-Goals
No Project schema changes, new transport layer, automatic overwrite policy or extra API requests.
Project Fields
Agent Assignment
Implementation-ready scoped follow-up, assigned to
codeforester. FollowAGENTS.mdanddocs/github-workflow.md: start throughbasectl gh issue start, use the canonical issue worktree, characterize current behavior before extraction, and open an issue-linked PR. Keep each refactor independently reviewable.