Skip to content

BACK-472 - Refactor config to shared descriptor map, fix config list visibility#639

Open
lenucksi wants to merge 1 commit into
MrLesk:mainfrom
lenucksi:fix/back-472-config-list-descriptor-map
Open

BACK-472 - Refactor config to shared descriptor map, fix config list visibility#639
lenucksi wants to merge 1 commit into
MrLesk:mainfrom
lenucksi:fix/back-472-config-list-descriptor-map

Conversation

@lenucksi
Copy link
Copy Markdown

@lenucksi lenucksi commented May 7, 2026

Summary

  • config get/config list used a hardcoded switch statement and hardcoded console.log sequence respectively — adding any new config key required editing three separate places in a 3700-line file
  • config get taskPrefix was unsupported (taskPrefix only appeared in config list)
  • Root fix: introduce CONFIG_DESCRIPTORS map as single source of truth — config get dispatches through it, config list loops over it; new fields are a one-liner in the map

Changes

  • src/cli.ts: Add CONFIG_DESCRIPTORS record as single source of truth. Replace config get switch with map lookup. Replace config list hardcoded block with descriptor loop. Derive config set error message from map automatically. config get taskPrefix now works.
  • src/test/config-commands.test.ts: 3 new tests — config get taskPrefix, unknown-key error includes taskPrefix, config list shows all descriptor keys including optional unset ones.

Designed to be extended with terminalStatuses/blockedStatuses entries once BACK-466 (PR #635) and BACK-468 (PR #637) are merged — adding them will be a one-liner in the descriptor map.

Test plan

  • bun test src/test/config-commands.test.ts → 11 pass
  • bunx tsc --noEmit → clean
  • bun run check . → clean (pre-existing package.json formatting issue in upstream excluded)
  • Manual: backlog config get taskPrefix → returns task
  • Manual: backlog config get __nonexistent__ → error lists taskPrefix in available keys
  • Manual: backlog config list → shows all keys including unset optional ones

🤖 Generated with Claude Code

@lenucksi lenucksi force-pushed the fix/back-472-config-list-descriptor-map branch from ebe7108 to 5c8ac7b Compare May 7, 2026 16:14
Copy link
Copy Markdown
Owner

@MrLesk MrLesk left a comment

Choose a reason for hiding this comment

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

Alex's Agent: Thanks for the PR. I agree there is a real usability issue around config visibility, but I do not think this is ready to merge as-is yet.

A few things need to be addressed:

  1. The PR references BACK-472, but I do not see a matching Backlog task in the branch. The GitHub issue with that number is unrelated, and the PR diff does not include a task file. Please add the task details so the PR matches the project workflow.

  2. terminalStatuses is exposed through config get/set/list and stored in YAML, but the product behavior still ignores it. Cleanup and terminal-status behavior still use the last configured status from statuses through getTerminalStatus(statuses) / isTerminalStatus(status, statuses). If this config key is added, it should be wired into the actual terminal-status behavior everywhere it matters, with tests for cleanup and the web cleanup affordance. If that is not intended for this PR, I would avoid adding this config field.

  3. blockedStatuses has the same issue: it can be set and listed, but web/TUI styling still uses the existing hardcoded status-name heuristics. That makes the setting look supported even though it has no effect.

  4. config list still hides both new keys when they are unset. Since this PR is specifically about omitted config values, please make the intended discovery behavior explicit and consistent with the existing optional entries, or keep the PR focused on fields that already have real behavior.

I would recommend narrowing this PR to a small, behavior-backed fix: either make the new config keys actually drive the terminal/blocked status behavior end to end, or remove those new keys and only refactor/list config values that already exist and are supported.

…visibility

Introduce CONFIG_DESCRIPTORS as a single source of truth for all config keys.
config get now dispatches through the map; config list loops over it instead of
hardcoded console.log calls. config get now supports taskPrefix (was list-only).
config set error message derives available keys from the descriptor map.
No terminalStatuses or blockedStatuses entries — designed for trivial extension
once BACK-480/BACK-481 land (adding a new key is a one-liner in the map).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lenucksi lenucksi force-pushed the fix/back-472-config-list-descriptor-map branch from 5c8ac7b to 3f59ff8 Compare May 11, 2026 16:09
@lenucksi lenucksi changed the title BACK-472 - Fix config list missing terminalStatuses/blockedStatuses and refactor to shared descriptor map BACK-472 - Refactor config to shared descriptor map, fix config list visibility May 11, 2026
@lenucksi
Copy link
Copy Markdown
Author

Force-push note: This PR has been narrowed in scope per the review feedback.

What changed:

  • Removed terminalStatuses and blockedStatuses from the CONFIG_DESCRIPTORS map and from config set — those keys are not yet wired into real behavior and will land via separate PRs (BACK-480/BACK-481) once the full wiring is in place
  • Removed the src/types/index.ts and src/file-system/operations.ts changes (type additions and YAML parse/serialize for the two new fields) — those belong with their respective behavior PRs
  • The diff is now 3 files only: src/cli.ts, src/test/config-commands.test.ts, and a task tracking file

What stayed / was added:

  • CONFIG_DESCRIPTORS map for all currently-supported keys
  • config get dispatches through the map instead of the switch statement
  • config list loops over the map instead of hardcoded console.log calls
  • config get taskPrefix now works (was silently missing from get, only appeared in list)
  • config set unknown-key error derives available keys from the map
  • The map is designed for trivial extension: adding terminalStatuses/blockedStatuses will be a one-liner once the behavior PRs merge

@lenucksi lenucksi requested a review from MrLesk May 11, 2026 20:43
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.

2 participants