Skip to content

Keep displayed issue fields out of Project field resolution - #2721

Merged
codeforester merged 5 commits into
mainfrom
bug/2713-20261128-basectl-mistakes-an-issue-field-shown-in-a-project-for-the-p
Nov 28, 2026
Merged

codeforester merged 5 commits into
mainfrom
bug/2713-20261128-basectl-mistakes-an-issue-field-shown-in-a-project-for-the-p

Conversation

@codeforester

@codeforester codeforester commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Keep displayed organization issue fields out of Project-field resolution and item values. A genuine standard Priority/Size field wins before its Legacy field; issue-only name collisions fail closed. Configure checks existing/template fields before any copy, rename or other write. Readiness and both Intake copies use the same precedence, including unset mode, and Intake reads/verifies values using selected field IDs.

Issue

Part of #2713 — S1.

Approved contract: amendment review round 2, fingerprint sha256:b65f3144440ecf7ee65e777ec4cb8518f280818b8931a0db73ea38813e75a889.

Based on main cb4fdc03, including #2716's schema resolver and #2718's by-ID item reads. The issue stays open for Ramesh's acceptance of the after-merge evidence.

Validation

Map row Evidence
1 Marker GraphQL/REST parser and query regressions retain isIssueField / issue_field_id, with missing markers preserving existing behavior.
2–3 Resolution and commands A1/A2 (including synthetic coexistence), B1/B2, C/D1/D2 and M cover doctor on both transports, configure, set-fields in unset/rollback modes on both transports, and both copy directions across all three source modes. Tests assert selected IDs, errors/findings, creation versus rejection, and suppression/readback safety.
4 Preflight Existing, new-from-template and replacement paths, each in normal/dry-run mode, reject a clash before Project copy/rename, field writes, linking, backfill or default writes.
5 Readiness and Intake Readiness BATS checks all 18 fixture/mode combinations and the selected Priority/Size values. Both workflow copies run every fixture on GraphQL/unset, REST/rollback and REST/unset fallback, with missing/existing values. Additional GraphQL cases reject issue-only readback.
6 Item values Both Python adapters exclude issue values; REST verification rejects an issue-only match. Copy/default adapters preserve standard-over-Legacy precedence. A read-only live observation found Project #7 has zero items, so whether GitHub includes populated issue-field values in item responses remains inconclusive. Synthetic recorded-response variants cover both possibilities.
7 Base unchanged Existing issue-field tests and new Intake regressions cover both workflow copies and both transports, missing/existing issue defaults, Status/Area/Initiative and absence of Project Priority/Size writes. Claude's after-merge readiness/#2704 and set-fields dry-run/#2711 comparisons remain pending.

Local results:

  • pytest cli/python/base_github_projects/tests: 350 passed.
  • bats cli/bash/commands/basectl/tests/gh.bats: 87 passed; the matrix test contains 18 mode/fixture checks.
  • pytest tests/test_project_intake_workflow.py: 145 passed.
  • CI-equivalent tracked-file Pylint (git ls-files -z '*.py' | xargs -0 pylint --rcfile=.pylintrc): passed.
  • ShellCheck (warning severity) for readiness and the extracted Intake Bash script: passed.
  • git diff --check: passed.
  • Broader Base validation: 2,199 Python tests passed, plus 1,091 BATS cases passed across the documented full file list, including integration tests. The BATS phase ran in four file shards; the corrected JSON fixture was rechecked with all 11 inspection-JSON tests passing. basectl test base itself stopped at the new worktree's local manifest-trust gate; its documented ./bin/base-test Python phase and equivalent full BATS list were run directly without changing persistent trust settings.
  • Hosted checks at 36f286f3f6289aff1c448774538bb2238d855fb9: 23 passed, including Tests and both provider suites, all four Python versions, all Pylint jobs, security, compatibility, integration, macOS and Windows. The conditional hosted release-train readback was skipped. The issue-branch-policy status also passes.

All regression testing uses isolated recorded/synthetic responses. Live Project field mutations are limited to the authorized lifecycle Status transitions.

Impact and Evidence

# Category Disposition
1 Product intent Existing Project/issue-field separation; no product-boundary change.
2 Architecture and contracts Shared marker-aware standard/Legacy resolver; metadata retained on both transports; configure preflight.
3 User guidance docs/github-workflow.md explains source modes, Legacy fallback in unset mode and clash outcomes.
4 CLI/API and reference No new options. Conflict messages identify the source/Legacy remedies.
5 Operations and safety No Project migration. Prevents writes to displayed issue fields and protects the #2704 rollback layout.
6 Validation and testing Acceptance mapping, counts and remaining evidence are in Validation above.
7 Examples and downstream use Shipped Intake template stays byte-identical to the repository workflow; both execute the full matrix.
8 Governance and contributor process .ai-context/COMMANDS.md updated for implemented resolution; issue lifecycle follows DESIGN §§5.2/8.2.
9 Decision records Implements the approved interpretation of decision 24; no new decision.
10 Release notes Unreleased CHANGELOG entry supplied below.

Risk, rollback and reviewer notes

Medium risk: field selection changes across Python, Bash and Intake. Start review with project_field_resolution.py, configure preflight, and Intake's selected-ID read/verification. Revert this PR to restore command behavior; this PR performs no live schema/value migration.

Not verified: GitHub's populated issue-value item response (Project #7 has no items); after-merge public doctor readback; acceptance criterion 3's post-Part-B reverse dry run; and map row 7's live comparisons. Ramesh accepts the after-merge evidence before closing the issue.

Docs Impact

Updated workflow guidance, CHANGELOG and tracked AI command context. The generated field-source default remains unchanged.

Demo Impact

No demo behavior change. Both copies of the downstream Intake workflow are covered by the same executable matrix.

Release note

Basectl no longer mistakes an organization issue field displayed in a Project for a Project field. Genuine standard fields take precedence over Legacy fields, including unset-source readiness and Intake; configure rejects unresolved clashes before writes.

Breaking / action required: no.

Assisted-by: Codex:GPT-6

Codex reports the GPT-6 model family; this session does not expose an exact runtime model ID.

@codeforester
codeforester marked this pull request as ready for review November 28, 2026 10:57
@codeforester
codeforester requested a review from a team as a code owner November 28, 2026 10:57

@codeforester codeforester left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review round 1 at 36f286f3

Verdict: Approved at 36f286f

Provenance: author Codex; reviewer Claude Code (Opus 5.5, claude-opus-5-5), in a session with no Codex context. Round 1 covers all five commits (24 files) against #2713's Expected behavior 1–7, Acceptance Criteria and acceptance-to-validation map, at the approved fingerprint b65f3144….

What's right

  • One resolver (EB1, EB2). resolve_project_field tries the standard name, then the Legacy name, and skips any field with is_issue_field. has_issue_field_clash limits case C to the two roles.
    • Both transports set the marker: GraphQL from isIssueField, REST from issue_field_id.
    • The lookups share it: find_schema_field and resolve_issue_field_updates use it, as do project_field_name and make_copy_plan in copy-fields, and select_fields_by_name.
    • Every listed site is covered. I checked each one in the issue's site table against the diff.
  • Item values never come from an issue field (EB6).
    • GraphQL: find_project_item_state, fetch_project_issue_items and single_select_values drop values whose field is an issue field.
    • REST: _item_field_values drops values with issue_field_id and keeps only the managed Project field IDs, which include both Legacy names. Update suppression and verification use the same filter.
    • Copy: the copy adapters key values by role, using the field the resolver picked, and test_standard_empty_value_is_not_replaced_with_legacy_value pins A2's order.
  • Preflight (EB4). On the copy and --replace-project paths, configure plans against the template's fields, which it reads from the same owner's base-project-template that copy_template_project copies. An error action returns before the dry-run branch and before any write. The test covers all three paths, each with and without --dry-run.
  • Readiness and Intake (EB5, EB7).
    • Readiness: filters out issue_field_id and applies cases A–D in unset mode too. It reads item values by field ID.
    • Intake's GraphQL path: replaces gh project field-list with a GraphQL query that reads isIssueField. It drops issue fields, uses a standard field before its Legacy one, fails closed when a role is missing, and reads and verifies item values by field ID.
    • Intake's REST path: handles unset mode like project_fields.
    • Both workflow copies are identical.
    • The tests cover the GraphQL cases. The Intake matrix seeds the issue field Priority with a value and asserts the selected Project field is still filled. test_intake_issue_value_cannot_satisfy_legacy_readback shows an issue-only match fails verification. The issue_fields regression uses B1, which is #10's layout after Part B.
  • Fixtures follow the map. A1–D2 and M, plus the synthetic A2 variant. test_role_resolution_and_schema_clash pins each case's expected field IDs independently of the resolver, which the command matrix then reuses.

Live checks at this head (read-only)

  • Acceptance criterion 2: doctor --project base-project-template --owner basefoundry reports Priority as a conflict and Size as missing, and exits 1. Main prints four MISSING-OPTION lines for P0–P3 instead.
  • Preflight against the real template: I ran configure --project <unused title> --repo basefoundry/base --dry-run with no config. It exits 1 with the Priority clash before any other step. With --config .github/base-project.yml it previews normally and exits 0.
  • Map row 7 (Base unchanged): I compared this head with main for three commands: readiness on #2704, readiness on #2713, and a set-fields --dry-run on #2711 with Base's config. The output was identical.

Local runs

  • pytest cli/python/base_github_projects/tests: 350 passed.
  • pytest tests/test_project_intake_workflow.py tests/test_documentation_links.py: 146 passed.
  • bats gh.bats inspection-json.bats: 98/98.
  • git diff --check: clean.

Hosted checks are green.

Blocking

None.

Not blocking

  1. The copy-path dry run gains two misleading lines. The copy path now prints the template plan's actions. Live, with Base's config, the preview for a new Project adds:

    • [DRY-RUN] Would Create GitHub Project., next to Would copy GitHub Project 'base-project-template' …;
    • [DRY-RUN] Would Add missing options: Contract Hardening, Agentic Coding Platform., which repeats the "Would ensure Initiative option" lines.

    Consider leaving out create-project when the run copies the template. Or say in the PR that the preview now includes the template plan.

  2. CONFLICT runs into the field name. The kind is exactly as wide as doctor's 8-character kind column, so the output reads CONFLICTPriority. Main has the same flaw with MISSING-OPTION. A separating space in the formatter would fix both.

After merge

  • Acceptance criterion 3 and map row 6: when Part B runs on #10, I'll run the reverse dry run. I'll also record whether GitHub returns issue-field values among item values. #7 has no items, so it can't show this.
  • Map row 7: I'll repeat the readiness and set-fields --dry-run comparison on merged main.
  • Link keyword: Part of #2713 is right, because acceptance criterion 3 and map row 7 need evidence after merge.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

basectl mistakes an issue field shown in a Project for the Project field of the same name

1 participant