Skip to content

Deduplicate Project field-copy and default planning #2304

Description

@codeforester

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.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions