Repository navigation
Description
Goal
basectl gh project issue set-fields --risk-tier, --start-date and --target-date should set their issue fields. Today the parser stores them under keys the command doesn't recognize, so all three are dropped silently: the command writes nothing for them and reports success. Readiness requires a Risk tier before Ready, so basectl currently can't set a field that every Ready issue needs.
Background
The mismatch (main da93ba7b):
- Parser:
cli/python/base_github_projects/project_parser.pystores issue-field options asstate.field_values[option[2:]], at L209 (spaced--risk-tier Medium) and L224 (inline--risk-tier=Medium). That givesrisk-tier,start-dateandtarget-date, with hyphens. - Command:
project_issue_fields_command.pyL13–21 (ISSUE_FIELD_NAMES,DATE_FIELD_KEYS) expectsrisk_tier,start_dateandtarget_date, with underscores, and drops any other key. So does the REST path,rest_issue_set_fields_command(engine.pyL208, keys at L215–221). - Other options:
--status,--priority,--area,--initiative,--sizeand--efforthave no hyphen, so they work.
Reproduction, through the parser and the value normalization, with Base's config:
argv: project issue set-fields 2711 --project base --owner basefoundry --repo basefoundry/base
--config .github/base-project.yml --no-defaults --risk-tier Medium --target-date 2026-12-31 --area CLI
issue_field_values_for_args: {'risk-tier': 'Medium', 'target-date': '2026-12-31', 'area': 'CLI'}
None of the three hyphenated keys is in ISSUE_FIELD_NAMES, so only Area is written. The same happens with --target-date=2026-12-31, and without --config.
Side effects:
- The guard never fires. "Risk tier and date options require project.field_source to be set" (
project_issue_fields_command.pyL103–104,engine.pyL222–225) checks the underscore keys, so it never fires for these options. - An explicit start date is ignored. With
--start-date-today-if-empty, whichbasectl gh issue startpasses, the command checks for"start_date" not in values. An explicit--start-dateis therefore dropped, and today's date is written in its place. - The documentation promises otherwise:
gh.shL426 and L443–445;docs/command-reference.mdL251;docs/stability-baseline/current.jsonL708 and L726.
Why tests miss it. The command test (tests/test_project_issue_fields_command.py L485) builds ProjectArguments with underscore keys directly, so it never goes through the parser. gh.bats covers only --start-date-today-if-empty. No parser test covers the three options.
History: the bug came in with S2 (#2709, aebb26ff, 2026-11-25). Claude reviewed that PR and missed it.
Workaround in use: a REST POST repos/basefoundry/base/issues/N/issue-field-values with the Risk tier field ID (50466154). Claude set Risk tier on #2711 and #2712 this way on 2026-11-26.
Plan
Approach: the parser maps each option to the command's key explicitly, through one table built from ISSUE_FIELD_OPTIONS: --risk-tier → risk_tier, --start-date → start_date, --target-date → target_date, and the others unchanged. Both the spaced and the inline paths use the table. The command then rejects any command-line key it doesn't recognize, instead of dropping it, so a future mismatch fails loudly.
Rejected alternative: switching the command to hyphenated keys. Underscore keys are the contract elsewhere: issue_defaults in .github/base-project.yml accepts risk_tier, start_date and target_date (ALLOWED_DEFAULT_KEYS, project_config.py L22–25).
Slices: S1, one PR.
Expected behavior
- The options work:
--risk-tier,--start-dateand--target-date, spaced or inline, reach the command asrisk_tier,start_dateandtarget_dateand write their issue fields. - The guard applies: without a configured
project.field_source, these options fail with the existing "require project.field_source" error, on both the GraphQL and REST paths. - An explicit start date wins:
--start-date Dwith--start-date-today-if-emptywritesD, not today's date. - Unknown keys fail: a command-line field value (
args.field_values) whose key the command doesn't recognize is a usage error, not silently dropped. Config defaults the command doesn't write, such asassignee, are still ignored, as today. - No other change:
--status,--priority,--area,--initiative,--sizeand--effortbehave as today.
Acceptance Criteria
- Every Expected behavior item passes its validation in the map below.
- After merge,
basectl gh project issue set-fields 2711 --project base --owner basefoundry --repo basefoundry/base --config .github/base-project.yml --no-defaults --risk-tier High --dry-runprintsWould set issue field Risk tier to High.(Keep gh project doctor and configure from recreating Project Priority and Size in issue-field repositories #2711's Risk tier is Medium, and the dry run lists only changed values.)
Acceptance-to-validation map
| Expected behavior | Validation |
|---|---|
| 1 The options work | A parser test for every entry in ISSUE_FIELD_OPTIONS, in both syntaxes, asserts that the key is one the command recognizes. An end-to-end test runs from argv through requested_values and asserts the Risk tier, Start date and Target date writes. |
| 2 The guard applies | Tests from argv, with no field_source, for each option on the GraphQL and REST paths. |
| 3 Explicit start date | A test with --start-date 2026-12-01 --start-date-today-if-empty asserts 2026-12-01. |
| 4 Unknown keys fail | A test passing an unrecognized command-line key asserts a usage error. A test with an assignee config default asserts it is still ignored. |
| 5 No other change | The existing parser and command tests pass. |
Validation
pytest cli/python/base_github_projects/testsbats cli/bash/commands/basectl/tests/gh.bats- The dry run in Acceptance Criteria 2.
- The repository's hosted checks.
Affected Areas
- CLI (Python):
project_parser.py,project_issue_fields_command.py,engine.py, and tests. - Docs:
CHANGELOG.md. The reference docs already describe the intended behavior.
Scope
One PR (S1). It doesn't depend on #2704's remaining S3 steps.
Non-Goals
- New options or fields.
- Changing how Project fields are chosen (#2713).
- The stability baseline, which already lists the options.
Risks and mitigations
Proposed Risk tier: Medium. This changes CLI option behavior that agents and maintainers rely on, and it can be undone.
| Risk | Mitigation |
|---|---|
| Rejecting unknown keys breaks a caller that passes one today. | The check covers only command-line values, and the parser accepts only ISSUE_FIELD_OPTIONS. Config defaults keep today's behavior. Map row 4 pins both. |
An explicit --start-date now overrides the today-if-empty default. |
That is what the option documents. Map row 3. |
Impact and Evidence
| # | Category | Disposition |
|---|---|---|
| 1 | Product intent | No impact. |
| 2 | Architecture and contracts | The parser maps options to keys explicitly. The command rejects unknown keys. |
| 3 | User guidance | No impact. The guides already describe the intended behavior. |
| 4 | CLI/API and reference | The documented options start working. No option changes. |
| 5 | Operations and safety | basectl can set Risk tier again, so the REST workaround is no longer needed. |
| 6 | Validation and testing | Adds the missing parser-level coverage. See the map. |
| 7 | Examples and downstream use | No impact. No other repository uses field_source yet. |
| 8 | Governance and contributor process | Agents can set Risk tier, which readiness requires before Ready, with basectl. |
| 9 | Decision records | None. |
| 10 | Release notes | A CHANGELOG entry: set-fields --risk-tier, --start-date and --target-date now set their fields. Breaking / action required: no. |
Open Questions
None block Ready.
Project Fields
- Status: Triage
- Priority: High
- Effort: Small
- Risk tier: Medium (proposed)
- Area: CLI
- Initiative: Contract Hardening
- Milestone: v1.11.0
- Category: bug
- Issue Type: Bug
Agent Assignment
Assignee: codeforester. Claude Code (Opus 5.5) wrote this issue at Ramesh's request, from #2704 S3 step 6. Codex reviews the issue, and Ramesh approves it. Codex implements S1, and Claude reviews the PR.
Assisted-by: Claude-Code:claude-opus-5-5
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Start date
Target date
Risk tier
Projects
- StatusShow more project fieldsDone
Activity
codeforester commentedon Nov 26, 2026
Issue review round 1
Reviewed #2714 as Issue Type
Bug, StatusTriage, against DESIGN v1.6 at mainda93ba7b420fc042a57286c6ef3cc5bff4f5899fand IMPLEMENTATION-PLAN v4.6.Root cause verified on both transports. For spaced and inline input at the Python parser layer,
risk-tier,start-dateandtarget-datesurvive value normalization with hyphens. Running those parsed arguments through the real command functions with mocked operations, alongside--area CLI, returns success on both GraphQL and REST while writing only Area. The underscore-based source guard misses the same keys. I also reproduced an explicit2026-12-01start date being replaced by today's date when today-if-empty is requested.The fix and acceptance contract are appropriately bounded. One option-to-key table shared by both parser syntaxes restores the command/config key contract. Rejecting unknown keys only in
args.field_valuespreserves ignored config defaults such as assignee. The validation map covers parser-to-command behavior, both transport guards, explicit-date precedence, unknown-key rejection and the existing options. The planned argv regression tests exercise the boundary bypassed by today's direct-ProjectArgumentsfixtures.The live acceptance check is read-only and has a distinct expected change. Risk tier's live field ID is 50466154, and Keep gh project doctor and configure from recreating Project Priority and Size in issue-field repositories #2711's current value is Medium, so the proposed High dry run can demonstrate the fix without changing the issue. The command reference already promises these options; a CHANGELOG correction without a new option or stability-baseline change is consistent. The 57 focused command, field-source, REST and configure baseline tests passed.
No actionable findings. No live Project or issue-field writes were performed.
Verdict: Ready. No findings.
Status remains Triage.
2026-11-27. Independent reviewer: Codex (GPT-6), independent reviewer session
01a217d5-ad11-7760-a944-5afef3747203; author: Claude Code (Opus 5.5 /claude-opus-5-5; author session not supplied). Exact reviewer runtime model ID and token usage are not exposed.codeforester commentedon Nov 27, 2026
In Review: PR #2717 is non-draft and approved in review round 1. The built-in 'Pull request linked to issue' workflow set In Review when the closing link was added on 2026-11-27. In Progress wasn't recorded at start, because the issue was started with --no-project.
Merge main into #2717 and preserve both changelog fixes
Merge main into #2718 and preserve all changelog fixes