Repository navigation
Description
Agent Brief
Type: Task
Summary: Move the tracker verb CLI helpers wit_help_if_requested and wit_usage_error into one seam lib file, plugins/work-items/tools/work-item-tracker/lib/verb-cli.sh, and fold the jira JQL value-list copy into jira/common.sh (part of restructuring pass #14823).
Current behavior:
The five adapter common.sh files under plugins/work-items/tools/work-item-tracker/ repeat two helpers:
wit_help_if_requested: identical inadapters/github/common.sh:108-115,adapters/local-markdown/common.sh:60-67,seeds/jira/common.sh:120-127andseeds/linear/common.sh:169-176.seeds/gitea/common.sh:159-163tests${2:-}where the othersshiftand test${1:-}; every caller passes the usage text and then"$@"(for exampleseeds/jira/list-items.sh:10), so both forms print and exit alike.wit_usage_error: identical inlocal-markdown/common.sh:54-57,gitea/common.sh:138-141,jira/common.sh:114-117andlinear/common.sh:148-151, namingBASH_SOURCE[1]. github's (github/common.sh:87-94) names the bottom of the source stack, which differs when alib/id.shfunction calls it (lib/id.sh:32-57).
The jira JQL value-list builder exists twice: jql_value_list at seeds/jira/list-items.sh:62-68, called at :75, :76 and :80, and the same jq filter inline at seeds/jira/common.sh:382.
Each common.sh loads seam libs as a <prefix>_require_seam_lib check, a # shellcheck source= line and source; the json.sh lines are github :30-32, local-markdown :36-38, gitea :49-51, jira :37-39 and linear :51-53. A seed run as a consumer copy finds the lib directory through WIT_SEAM_LIB_DIR (jira/common.sh:20-26).
Desired behavior:
- New
lib/verb-cli.sh, mode 100644, sourced only, with the source guard of the other seam libs (lib/id.sh:5-6,lib/json.sh:4-5). It holdswit_help_if_requestedand theBASH_SOURCE[1]form ofwit_usage_error, which reads the caller'sEX_USAGE; that read takes a reasoned SC2154 disable, as atgitea/common.sh:186. - Each
common.shloads it beside itsjson.shlines, in the same three-line form. local-markdown, gitea, jira and linear then delete both helpers; github deletes onlywit_help_if_requested, and its ownwit_usage_error, defined after the source line, still wins. - The
EX_*constants stay in each file: they arereadonlyand the sets differ (github:75-81, local-markdown:45-48, gitea:59-65, jira:48-53, linear:61-67). jql_value_listmoves intojira/common.shaswit_jira_value_list;:382and the threelist-items.shcall sites call it.- No
verb-cli.test.shis added. No repository check pairs a seam lib with a test (lib/labels.shandlib/recurrence.shhave none), and the test selector maps the new file through eachcommon.shthat sources it (scripts/affected-tests.sh:93-97,192-196) and through thetest-scope: plugins/work-items/tools/work-item-tracker/lib/*lines ofadapters/github/list-items.test.sh:3,adapters/local-markdown/list-items.test.sh:3andseeds/jira/list-items.test.sh:6(scripts/affected-tests.sh:133-145).
Files:
plugins/work-items/tools/work-item-tracker/lib/verb-cli.sh(new)plugins/work-items/tools/work-item-tracker/adapters/github/common.shplugins/work-items/tools/work-item-tracker/adapters/local-markdown/common.shplugins/work-items/tools/work-item-tracker/seeds/gitea/common.shplugins/work-items/tools/work-item-tracker/seeds/jira/common.shplugins/work-items/tools/work-item-tracker/seeds/linear/common.shplugins/work-items/tools/work-item-tracker/seeds/jira/list-items.sh- a new
patchfragment in.changes/work-items/:### Changed, "Internal restructuring, no behavior change."
Key interfaces:
- Each verb's
--helptext, usage-error text and exit codes: unchanged. - Each
common.test.shchecks withdeclare -Fthatwit_help_if_requestedis defined after sourcingcommon.sh(github:20, local-markdown:17, gitea:47, jira:13, linear:47); it still is. - Outside the tracker tree only
plugins/work-items/skills/onboard-adapter/scripts/generate-adapter.shand itstemplates/name these helpers, and generated adapters keep their own copies.
Acceptance criteria:
-
wit_help_if_requestedis defined once, inlib/verb-cli.sh;wit_usage_erroris defined inlib/verb-cli.shandadapters/github/common.shonly; the JQL value-list filter exists once, inwit_jira_value_list. - Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines and 15 hand-edited files.
- The
*.test.shsuites underplugins/work-items/tools/work-item-tracker/pass, includingadapters/*/,seeds/*/,lib/,conformance/,work-item-tracker.test.shandseed-copy.test.sh. - ci-status is green.
Out of scope:
- The
EX_*constants, gitea's and linear'swit_<provider>_unimplemented, the onboard-adapter generator and templates, a new test file, other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity
melodic-automation-lanes commentedon Nov 12, 2026
{"v":1,"actor_id":337595936,"title_sha256":"a8c9e2e396eb581fada190746bcffd618c667650392f584a2d67d60c1a467168","body_sha256":"cfcc3bbd38f44c2a7e2c0341dfa4fc7a3d12fdd5acf2a93e7e30055dd1ac8a19"}
github-actions commentedon Nov 12, 2026