Skip to content

fix(work-items): bound the linear seed children reads by the list ceiling - #13119

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-13067-41782402075-1
Nov 4, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-13067-41782402075-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #13067

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The Linear seed's paged children reads, in create-item --parent (the sibling dedupe check) and in list-sub-items, now stop at WIT_LINEAR_LIST_ITEMS_MAX. That is the ceiling from capabilities.json limits.list_items_max, which the label walk already uses. When more children than the ceiling arrive, or more pages than the ceiling, each script exits 1 (EX_INTERNAL) with a message that names the parent and the ceiling, and never acts on a partial list: create-item creates nothing and list-sub-items emits no envelope. Design choice: the check runs on every page, the last one included, so any read past the ceiling fails. It also counts pages, so a server that sends empty pages with fresh cursors forever stops too.

Not verified

  • The changed bash test files (create-item.test.sh, list-sub-items.test.sh) were not executed here: the lane runs only its named wrappers. Left to the PR's CI. Per the reviewer's trace, without the change the endless-feed tests hang rather than fail an assertion, as the existing label-walk test does,…
  • tidy pass 5 (ai-slop:audit fix): the detector script and the fix flow's guard scripts are not among the lane's allowed wrappers. The changelog fragment got a manual rubric read only (no tells found) and no detector run or semantic-diff verification.
  • review-venue.txt was absent from the scratchpad, so the review ran locally in one fresh-context subagent
  • Untracked runner files at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are not part of this change and were left untouched

Fix

  • plugins/work-items/tools/work-item-tracker/seeds/linear/create-item.sh: the sibling-check children loop counts children and pages and exits EX_INTERNAL, naming the parent and creating nothing, once either count passes WIT_LINEAR_LIST_ITEMS_MAX
  • plugins/work-items/tools/work-item-tracker/seeds/linear/list-sub-items.sh: the same bound on its children loop; exits EX_INTERNAL naming the parent and emits no partial child list
  • plugins/work-items/tools/work-item-tracker/seeds/linear/common.sh: the shellcheck SC2034 comment now lists list-sub-items.sh as a reader of WIT_LINEAR_LIST_ITEMS_MAX
  • plugins/work-items/tools/work-item-tracker/seeds/linear/create-item.test.sh: an endless hasNextPage:true children feed against a fixture adapter with list_items_max 2 exits 1, issues no issueCreate, names the parent and the ceiling, and stops after 3 children requests
  • plugins/work-items/tools/work-item-tracker/seeds/linear/list-sub-items.test.sh: an endless children feed and an endless feed of empty pages each exit 1 with no output after 3 requests; exactly the ceiling passes; one child past the ceiling on a last page exits 1
  • .changes/work-items/work-resolve-issue-issue-13067-41782402075-1-28c39b6f.md: patch changelog fragment (Fixed) for the work-items plugin

Verification

The runner ran each check from the base copy against 015175f:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 25 fragments valid (run before and after tidy and after the review fix)
  • .lane/checks/bin/check-changed-skills: no changed skills, nothing to gate (run before and after tidy and after the review fix)
  • .lane/checks/bin/check-affected: 13 passed, 6 skipped, the rest CI-only, over 6 changed files (run before and after tidy and after the review fix)
  • .lane/verify/bin/cant-fail-scan --file create-item.test.sh --check: PASS, no gating findings
  • .lane/verify/bin/cant-fail-scan --file list-sub-items.test.sh --check: PASS, no gating findings
  • fresh-context review subagent over the whole diff: traced the mock routing and request counting and found no correctness bugs. It raised two low findings: a complete last page past the ceiling was still accepted, and the exactly-the-ceiling test could not discriminate. Both were fixed by moving the…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41782402075

Left out: the items under Not verified.

Related

#13067

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 015175f4f1fbfcfa828612c9c42f28f3da50aca2: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13119 (head 015175f)

I found no security issues.

What changed: The Linear seed adapter used to follow hasNextPage with no limit when it paged through a parent's children. That happened in two places: create-item.sh --parent (the sibling duplicate check) and list-sub-items.sh. Both loops now count items and pages and stop at WIT_LINEAR_LIST_ITEMS_MAX. When they pass that ceiling they exit EX_INTERNAL and do not act on a partial list. There are also tests, a shellcheck comment change in common.sh, and a changelog fragment.

What I checked:

  • Arithmetic input. The new ((... > WIT_LINEAR_LIST_ITEMS_MAX)) comparisons read a value that common.sh reads from the adapter's own capabilities.json. That value must match ^[1-9][0-9]*$, or the script exits EX_CONFIG (common.sh#L129-L134). So no unvalidated string can reach a bash arithmetic context through it.
  • Server-controlled counts. The item count comes from jq '(.nodes // []) | length' on the server's response. A malformed value (a non-integer, for example) makes the arithmetic fail, so the script fails closed. It cannot loop forever or treat a partial list as complete.
  • Fail-closed direction. The change narrows behaviour: an unbounded walk becomes a bounded one that errors out. A child list cut short at the ceiling is never treated as "no duplicate" or "nothing open".
  • Tests and fixtures. The tests copy the adapter into a temporary fixture directory and point WIT_SEAM_LIB_DIR at the in-repository lib. They don't expose any credentials or reach any external surface.
  • Instruction surface. No standing instruction, hook allowlist or trust control is deleted or softened.
  • Plugin manifests. No plugin.json or marketplace.json is touched.
  • Trusted paths. No changed file matches a trusted-path glob.
  • PR context. The description contains no embedded directives aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 015175f4f1fbfcfa828612c9c42f28f3da50aca2: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #13119, bounding the Linear seed's children reads by the list ceiling

No findings. I read every hunk of all 6 changed files (6 of 6). For context I also read the head versions of create-item.sh, list-sub-items.sh, common.sh, the test file around the new cases, and the request-recording and route-repeat logic in mock.sh.

Correctness

  • create-item.sh (children loop, L120-L144):
    • Children and pages are counted on every page, the last one included.
    • Passing WIT_LINEAR_LIST_ITEMS_MAX on either count exits EX_INTERNAL (1) before the sibling match.
    • issueCreate can't run on a partial list.
    • The check sits before the hasNextPage and cursor breaks, so a complete last page past the ceiling is also refused. That matches the stated design.
  • list-sub-items.sh (L94-L103):
    • SEEN counts raw nodes before the --state filter, so a filtered view can't slip past the ceiling.
    • The exit comes before the envelope is printed, so no partial list is emitted.
  • The ceiling value: common.sh already checks that WIT_LINEAR_LIST_ITEMS_MAX is a positive integer and exits 3 otherwise, so the arithmetic comparison is safe.
  • Page counting: counting pages as well as items stops a server that sends empty pages with fresh cursors forever.

Tests

  • Request counts: the mock writes one line per request to requests, with the query's newlines flattened, and the last route for a pattern repeats. So grep -c 'children(' = 3 is the right count for a ceiling of 2:
    • one child per page: page 3 makes SEEN 3, which is over 2;
    • empty pages: page 3 makes PAGES 3, which is over 2.
  • Fixture adapter: it copies *.sh and a patched capabilities.json, and points WIT_SEAM_LIB_DIR back at the real lib/. That matches how common.sh finds the manifest (WIT_LINEAR_ADAPTER_DIR) and the seam libraries.
  • Ceiling edges: the "exactly the ceiling → exit 0" and "one past on a last page → exit 1" cases in list-sub-items.test.sh pin the boundary from both sides.
  • No collision: in create-item.test.sh, the sibling title other work differs from --title child, so the dedupe path doesn't return early.

Closing issue #13067, acceptance criteria

  • "create-item --parent and list-sub-items stop with a non-zero exit when the children read passes the ceiling, and create nothing." Met, and covered by the new tests in both test files.
  • "A test in each script's test file seeds endless hasNextPage: true pages and shows the stop; each fails without the change." Met. Both test files seed an endless feed and assert exit 1 plus the request count. Without the change, those tests hang until the CI job times out instead of failing an assertion. That still fails the job, but slowly. This is the PR author's own trace and I haven't checked it.

Other checks

  • Verification: I couldn't run anything (no shell). The test runs and checks listed in the PR body are the author's claims and remain unverified.
  • Changelog fragment: bump: patch under ### Fixed fits a bug fix with no interface change. No plugin manifest changed, so no manifest lines apply.
  • Path rules: no rule under .claude/rules/ matches the changed paths.
  • Trusted paths: no changed file matches a TRUSTED PATHS glob.
  • Prior findings and embedded text: this lane has no prior findings on this PR (round 0 of 3). There are no settled threads, and the PR context has no embedded instructions.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 015175f4f1fbfcfa828612c9c42f28f3da50aca2.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 11254a8 Nov 4, 2026
44 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-13067-41782402075-1 branch November 4, 2026 06:53
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.

fix(work-items): bound the linear seed children reads by the list ceiling

0 participants