Skip to content

feat(#9536)!: resolve Jira started and closed states from status categories - #9925

Merged
ascerra merged 5 commits into
mainfrom
agent/9536-jira-started-state
Dec 3, 2026
Merged

ascerra merged 5 commits into
mainfrom
agent/9536-jira-started-state

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

fullsend issues transition --state now finds the Jira transition from status categories, so a repository no longer configures status names to start or close an issue. This adds --state started. When more than one transition fits a state, Jira's default names break the tie. If one still doesn't win, the command writes nothing, prints a skip that lists the candidates, and exits with code 11. A close that requires a resolution sends the site default when the transition allows it. The result also reports the issue type and Jira hierarchy level.

Related Issue

Changes

  • internal/tracker/transition.go
    • --state started (Jira) takes the transition whose target category is indeterminate. On an issue that is already in progress or done it leaves the status unchanged (changed: false) and still posts a requested comment. So a start never reopens a closed issue.
    • When several transitions fit started or closed, the preferred names decide: In Progress for a start; Done, then Closed, then Resolved for a close (case-insensitive). If no name leaves exactly one transition, the result is Skipped and Ambiguous with a Reason and Candidates. Nothing is written, not even the comment. Zero matching transitions is still an ordinary error.
    • --state closed with a required resolution and no --resolution: the single allowed value is still used first. Otherwise the site default is sent if it is among the allowed values. Otherwise it errors as before. --transition and --status keep their current resolution behaviour.
    • GitHub/GitLab --state started returns ErrNotSupported. --state started --resolution is rejected.
  • internal/forge/jira: IssueType.HierarchyLevel (*int, hierarchyLevel), and LiveClient.DefaultResolution (GET /rest/api/3/resolution/search?onlyDefault=true; no admin rights needed).
  • internal/cli/issues_transition.go: the JSON result adds skipped, reason, candidates[{transition,status}], issue_type and hierarchy_level, all omitted when empty. An ambiguous skip prints that JSON on stdout, then fails with exit code 11 (TransitionAmbiguousExitCode) through the existing ExitCode() hook; a JSON write error takes precedence. Other skips (for example fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534's issue-type filter) would still exit 0. The help text and --state usage are updated.
  • Docs: docs/guides/user/issues-commands.md and docs/cli/README.md.

Breaking change

fullsend issues transition --state on Jira changes three former errors:

  • --state closed used to fail with an "ambiguous" error whenever several done-category transitions were available. It now picks Done, Closed or Resolved when exactly one of them is reachable and writes. Otherwise it prints the skip JSON and exits with code 11, writing nothing. Callers must handle code 11 as "issue not moved; choose with --transition or --status".
  • The same auto-selection and exit code 11 apply when several transitions fit --state started.
  • --state closed whose required resolution could not be selected used to error. It now falls back to the site default resolution when the transition allows it, and writes.

The commit and title carry ! and a BREAKING CHANGE: trailer.

Notes for reviewers

Testing

  • Tests added/updated for new or modified logic
    • The tracker tests cover each acceptance criterion:
      • a start from new
      • In Progress preferred over Review
      • an ambiguous start or close skipping with no write and no comment
      • CLI: skip JSON plus exit code 11 for ambiguous starts and closes, write errors taking precedence, zero matches staying an ordinary error, and non-ambiguous skips and already-satisfied states exiting 0
      • several transitions to the same default name skipping
      • the ranked close names
      • an already started or done issue not changing
      • the site default sent, not allowed, absent, or failing to load
      • --transition/--status resolution handling unchanged
      • forge started not supported
    • Jira client tests cover DefaultResolution and hierarchyLevel decoding. CLI JSON contract tests cover the skip and hierarchy fields.
    • go test passes for ./internal/tracker/, ./internal/forge/jira/ and ./internal/cli/. Coverage on the changed functions is 89–100%.
  • make lint: pre-commit could not fetch its remote hook repositories in the sandbox (TLS failure). I ran the configured hooks directly: whitespace/EOF, gofmt, go vet ./..., broken-symlink, docs-link and lychee checks, and the secret scan. All passed. The semgrep hook skipped because it could not download its pinned ruleset, so CI's semgrep job is the check for that.

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO): not applicable, autonomous agent commit
  • I wrote this contribution myself and can explain all changes in it: generated by the fullsend code agent

🤖 Generated with Claude Code

Implements #9536


Closes #9536

Post-script verification

  • Branch is not main/master (agent/9536-jira-started-state)
  • Secret scan passed (gitleaks — 8e3080c9496e54a762ed3894f9cc792fc9c8d442..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

…gories

`fullsend issues transition --state` now finds the Jira transition by
status category, so repositories no longer need to configure status
names for starting or closing an issue.

- `--state started` (Jira only) takes the available transition whose
  target status category is `indeterminate`. It does nothing on an
  issue that is already in progress or done, so a re-run is safe and a
  start never reopens a closed issue. GitHub and GitLab return
  ErrNotSupported, and `--resolution` is rejected with it.
- When several transitions fit `started` or `closed`, Jira's default
  status names break the tie: In Progress for a start; Done, then
  Closed, then Resolved for a close (case-insensitive).
- If that still does not leave exactly one transition, nothing is
  written (not even the comment). The command exits 0 with a skip
  result: `skipped`, `reason`, and `candidates` (each with
  `transition` and `status`).
- When a `--state closed` transition requires a resolution and none
  was passed, and there is no single allowed value, the site default
  from GET /resolution/search?onlyDefault=true is sent if the
  transition allows it. Otherwise it still errors. `--transition` and
  `--status` keep their current resolution handling.
- jira.IssueType gains HierarchyLevel. The JSON result of `--state`
  runs includes `issue_type` and `hierarchy_level`, so callers can
  leave epics alone without listing type names.

Docs: issues-commands guide and CLI reference updated.

Note: pre-commit could not fetch its remote hook repositories (TLS
failure in the sandbox). The hooks were run directly instead:
whitespace/EOF checks, gofmt, go vet ./..., broken-symlink, docs-link
and lychee link checks, plus the scan-secrets secret scan. All passed.
The semgrep hook skipped: it could not download its pinned ruleset.

BREAKING CHANGE: `--state closed` on Jira no longer exits non-zero when
several done-category transitions are available and none targets a
unique Done, Closed, or Resolved status. It now exits 0 with
"skipped": true and lists the candidates. Callers that relied on the
error must check the `skipped` field.

Closes #9536

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner November 29, 2026 11:48
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Nov 29, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:51 AM UTC · Completed 12:02 PM UTC

Commit: cc8c7ad · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.70

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://9619090c-site.fullsend-ai.workers.dev

Commit: 34627d645765487b93354d028e7550a9e8cefee5

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 29, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (546 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate risk: well-scoped feature addressing the linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against large diff size (543 lines across 9 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Looks good to me

Earlier findings

  • docs/guides/dev/cli-internals.md:196, stale-doc, resolved: the command tree now lists both --state started (Jira only) and --state closed (incremental diff, docs/guides/dev/cli-internals.md:196-197).
  • internal/tracker/transition.go:206, breaking-cli, resolved: the exit-0 skip result for ambiguous --state runs is declared breaking (! title, BREAKING CHANGE trailer) and documented with a JSON example in docs/guides/user/issues-commands.md and docs/cli/README.md.
  • internal/cli/issues_transition.go:139, backward-incompatible, resolved: the new JSON fields (skipped, reason, candidates, issue_type, hierarchy_level) are all omitempty additions, and docs/guides/user/issues-commands.md documents them.
Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJzdGFsZS1kb2MiLCJmaWxlIjoiZG9jcy9ndWlkZXMvZGV2L2NsaS1pbnRlcm5hbHMubWQiLCJpZCI6ImZfYzNmNmFmZDkyYjA2NmMwMiIsImxpbmUiOjE5NiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiZG9jcy1jdXJyZW5jeSJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImJyZWFraW5nLWNsaSIsImZpbGUiOiJpbnRlcm5hbC90cmFja2VyL3RyYW5zaXRpb24uZ28iLCJpZCI6ImZfNWMzMjhlNDM2NTk0MTY2YSIsImxpbmUiOjIwNiwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNyb3NzLXJlcG8tY29udHJhY3RzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL2NsaS9pc3N1ZXNfdHJhbnNpdGlvbi5nbyIsImlkIjoiZl8yNzBkN2FkNTZkMTMwYmI1IiwibGluZSI6MTM5LCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY3Jvc3MtcmVwby1jb250cmFjdHMifV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmX2MzZjZhZmQ5MmIwNjZjMDIiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl81YzMyOGU0MzY1OTQxNjZhIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfMjcwZDdhZDU2ZDEzMGJiNSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= -->

Looks good to me

Earlier findings

  • docs/guides/dev/cli-internals.md:196, stale-doc, resolved: the command tree now lists both --state started (Jira only) and --state closed (incremental diff, docs/guides/dev/cli-internals.md:196-197).
  • internal/tracker/transition.go:206, breaking-cli, resolved: the exit-0 skip result for ambiguous --state runs is declared breaking (! title, BREAKING CHANGE trailer) and documented with a JSON example in docs/guides/user/issues-commands.md and docs/cli/README.md.
  • internal/cli/issues_transition.go:139, backward-incompatible, resolved: the new JSON fields (skipped, reason, candidates, issue_type, hierarchy_level) are all omitempty additions, and docs/guides/user/issues-commands.md documents them.
Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InN0YWxlLWRvYyIsImZpbGUiOiJkb2NzL2d1aWRlcy9kZXYvY2xpLWludGVybmFscy5tZCIsImlkIjoiZl9jM2Y2YWZkOTJiMDY2YzAyIiwibGluZSI6MTk2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJkb2NzLWN1cnJlbmN5In0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYnJlYWtpbmctY2xpIiwiZmlsZSI6ImludGVybmFsL3RyYWNrZXIvdHJhbnNpdGlvbi5nbyIsImlkIjoiZl81YzMyOGU0MzY1OTQxNjZhIiwibGluZSI6MjA2LCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY3Jvc3MtcmVwby1jb250cmFjdHMifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJiYWNrd2FyZC1pbmNvbXBhdGlibGUiLCJmaWxlIjoiaW50ZXJuYWwvY2xpL2lzc3Vlc190cmFuc2l0aW9uLmdvIiwiaWQiOiJmXzI3MGQ3YWQ1NmQxMzBiYjUiLCJsaW5lIjoxMzksImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjcm9zcy1yZXBvLWNvbnRyYWN0cyJ9XX0= -->

Review

Findings

Medium

  • [stale-doc] docs/guides/dev/cli-internals.md:196 — The command tree still lists only --state closed for fullsend issues transition. This PR adds --state started (Jira only) and changes the flag usage text, but this file was not updated. AGENTS.md requires every CLI flag reference to be updated.
    Remediation: Update line 196 to show both values, e.g. --state <started|closed> # Semantic lifecycle state: started (Jira only) or closed.

Low

  • [breaking-cli] internal/tracker/transition.go:206 — The BREAKING CHANGE trailer covers only the new skipped: true exit-0 case. It does not name two other changes in the same path. When exactly one done-category transition reaches Done, Closed or Resolved, it is now chosen and written instead of failing as ambiguous. A required resolution that cannot be selected now falls back to the site default and writes instead of erroring. The title ! and commit bullets do describe both behaviours, so this concerns release-note completeness.
    Remediation: Extend the BREAKING CHANGE trailer and PR body to name both.

  • [backward-incompatible] internal/cli/issues_transition.go:139 — A skip result exits 0 with changed:false, the same as the "already in target state" success path. Callers must check the new skipped field to tell them apart. The --transition and --status ambiguity error is unchanged, so the non-zero-exit convention now differs between selectors.
    Remediation: Keep skipped documented as the required check; optionally use a distinct non-zero exit code.


Labels: PR changes Go code in the issue tracker and Jira client.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the go Pull requests that update go code label Nov 29, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:04 PM UTC · Completed 12:08 PM UTC

Commit: cc8c7ad · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.21

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Updated the PR description's Breaking change section to cover all three exit-0 behaviour changes (finding 1). Declined the optional distinct exit code for skip results (finding 2) since exit 0 with a documented skipped field is the intended contract. No code changes; no commit.

Fixed (1):

  1. BREAKING CHANGE note omits the auto-selection among multiple done transitions and the site-default resolution fallback (internal/tracker/transition.go) [f_5c328e436594166a, fixed]: Extended the Breaking change section of the PR description to name the auto-selection among multiple done/started transitions and the site-default resolution fallback. The existing commit cannot be amended by the fix agent, so the BREAKING CHANGE trailer in the commit message is unchanged; the title '!' marker and commit-body bullets already describe both behaviours, and the PR description is the release-note source.

Disagreed (1):

  1. Skip result exits 0 with changed:false, same as the already-in-target-state path [f_270d7ad56d130bb5, declined]: The exit-0 skip is the intended contract for issues transition: resolve started and closed from Jira status categories, so repos keep no status names #9536 (an ambiguous --state is a no-op for the caller to resolve, not a failure), and the reviewer's primary suggestion is to keep skipped as the documented check, which issues-commands.md and the commit trailer already do. A distinct non-zero exit code was only offered as optional and would be a separate design change beyond this review's scope.

Tests: passed

Conflict update: skipped; strategy none; forge MERGEABLE; target main@8e3080c9496e54a762ed3894f9cc792fc9c8d442

PR metadata: body updated

Finding threads:

  • f_5c328e436594166a (fixed): replied and resolved — thread
  • f_270d7ad56d130bb5 (declined): replied and resolved — thread

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@codecov

codecov Bot commented Nov 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Aliciapet11

Copy link
Copy Markdown
Contributor

/fs-fix Address the medium stale-doc finding in docs/guides/dev/cli-internals.md: document both --state started and --state closed, noting started is Jira-only.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:22 PM UTC · Completed 12:27 PM UTC

Commit: cc8c7ad · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.25

Address review feedback on PR #9925: the command tree for
'fullsend issues transition' listed only --state closed. List both
values, noting that started is Jira only.

Note: pre-commit hooks were not run (infrastructure failure: could not
fetch hook repositories); trailing-whitespace, end-of-file and
line-ending checks were verified manually. Go tests/lint not run as the
change is documentation-only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed the medium stale-doc finding per the human instruction by documenting both --state values in docs/guides/dev/cli-internals.md. The two low findings (BREAKING CHANGE trailer completeness, skip exit code) were outside the instruction and were not changed. Pre-commit could not fetch hook repos; whitespace checks verified manually. Go tests not run (docs-only).

Fixed (1):

  1. stale-doc: cli-internals.md command tree lists only --state closed (docs/guides/dev/cli-internals.md): Listed both --state started (Jira only) and --state closed (portable across trackers) in the 'issues transition' command tree.

Tests: passed

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:29 PM UTC · Completed 12:37 PM UTC

Commit: 4e0bbaf · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.39

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Nov 29, 2026
@Aliciapet11

Copy link
Copy Markdown
Contributor

@ascerra, could you review this implementation of issue #9536? The review agent has approved the latest revision.

@Benkapner Benkapner left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed this against issue #9536 to help @fullsend-ai/maintainers.

What I checked:

  • All seven acceptance criteria in the issue are covered by the code and by tests.
  • It merges cleanly with current main, and the tracker, jira and cli tests pass for me after the merge.
  • Nothing else in this repo calls issues transition, so the breaking change does not break anything here.

I did not find a bug so I’d approve.

One thing for the maintainers to decide (@ascerra , since you wrote the issue):

If several transitions fit, the command now exits 0 and returns skipped. But if no transition fits, it still fails with an error. Example: an issue sitting in a status that has no direct move to In Progress.

So an agent that runs --state started at the beginning of a run would fail on that issue. Is that what we want, or should "nothing fits" also be a skip? It is easier to choose now, before other code depends on it.

Small note: the PR says the author could not confirm if Jira calls the flag default or isDefault. The issue says isDefault, and the code reads both, so this is fine either way.

@Aliciapet11

Copy link
Copy Markdown
Contributor

/fs-fix Merge the latest main into this PR branch, preserving existing commits. Resolve any merge conflicts while preserving the PR’s intended behavior, and run the required checks. Keep changes limited to updating the branch.

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (549 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Looks good to me

Earlier findings

  • internal/forge/jira/transition_test.go:83, pattern-inconsistency, resolved — TestDefaultResolution now tracks handlerCalled and asserts it, matching the mock-mux convention used in client_test.go.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 2, 2026 12:30

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Dec 2, 2026

@ascerra ascerra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review with 3 findings posted inline (comment only, no approve or request changes). Each one is checked against head f794ee1.

The PR does what #9536 asked. All three findings trace back to wording in that issue, which I filed, so they come from the issue and not from the work in this PR.

  • MEDIUM at internal/cli/issues_transition.go:139, the skip for an ambiguous --state exits 0, so a script that checks only the exit code reads it as the issue being started or closed
  • MEDIUM at docs/guides/user/issues-commands.md:349, "does nothing" isn't what happens when a comment is passed
  • MEDIUM at docs/guides/user/issues-commands.md:364, hierarchy_level comes back after the move, so it can't keep an epic from moving

@Benkapner on your question, I'd keep "no transition fits" as an error (here). In your example the issue wasn't started, and I'd want the caller to hear that, the same as in the first finding above. The same error also covers an account that lacks the Transition issues permission, because Jira returns no transitions then (Atlassian docs). I don't think the error has to fail a run. The code agent's optional start step on agents main passes a transition name today, and it logs a warning and carries on when the command fails (here). A --state started caller could do the same.

Verified: code and docs read and go test run for ./internal/tracker/, ./internal/forge/jira/ and ./internal/cli/ at f794ee1; raised by: Claude, DeepSeek

Comment thread internal/cli/issues_transition.go Resolved
Comment thread docs/guides/user/issues-commands.md Resolved
Comment thread docs/guides/user/issues-commands.md Resolved
@Aliciapet11

Copy link
Copy Markdown
Contributor

/fs-fix Address Adam’s three findings in review:
#9925 (review)

Treat Adam’s review as a revision to #9536’s original requirements.

  1. For unresolved ambiguity in Jira --state started/closed, preserve the skip JSON on stdout, including reason and candidates, then exit nonzero with a dedicated exit code using the existing ExitCode() mechanism. Preserve JSON encoding/write errors. Keep zero matching transitions as an ordinary error. Successful transitions and already-satisfied states must still exit 0. Do not establish a blanket rule that all future skips fail: intentional issue-type filter skips under fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534 should remain successful.

  2. Keep existing comment behavior. In CLI help and documentation, replace “does nothing” for an already-started/done issue with wording that says the status remains unchanged and a requested comment is still posted.

  3. Keep issue_type and hierarchy_level in the result, but remove claims that returned metadata lets callers prevent epic transitions. Correct the guide and TransitionResult comment. Leave filtering before a transition to fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534; do not add a filter or dry-run feature here.

Update CLI tests to verify skip JSON plus the dedicated exit code for ambiguous starts and closes, and verify output-write errors take precedence. Retain coverage for no writes/comments on ambiguity and comments on already-satisfied states.

Run the tracker, Jira, and CLI tests and required repository checks. Align all affected docs/help, the PR description, and BREAKING CHANGE wording with the revised contract. Keep the breaking-change marker because automatic transition selection and resolution fallback still change existing behavior.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 10:18 AM UTC · Completed 10:30 AM UTC

Commit: f794ee1 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.85

Address maintainer review on PR #9925 (revised #9536 requirements).

- An ambiguous `--state started|closed` on Jira (several transitions fit
  and no default status name picks one) still prints the skip JSON on
  stdout, including reason and candidates, then exits with the dedicated
  code 11 through the ExitCode() hook. A JSON write error takes
  precedence. Zero matching transitions stays an ordinary error;
  successful transitions and already-satisfied states still exit 0.
  tracker.TransitionResult gains Ambiguous so only this skip fails;
  other skips (for example #9534 issue-type filters) stay successful.
- Help and docs say `--state started` on an already started or done
  issue leaves the status unchanged and still posts a requested comment,
  instead of "does nothing".
- Drop the claim that issue_type and hierarchy_level let callers keep
  epics from moving: the result is built after the transition. The
  fields stay and report the kind of issue acted on.
- CLI tests cover the skip JSON plus exit code for starts and closes,
  write-error precedence, zero matches, non-ambiguous skips, and
  already-satisfied states.

Note: pre-commit could not fetch its hook repositories (TLS failure in
the sandbox), so it did not run. gofmt, go vet, and git diff --check
were run directly, and go test passed for ./internal/tracker/,
./internal/forge/jira/ and ./internal/cli/.

BREAKING CHANGE: `--state` on Jira now exits 11 (after printing the skip
JSON with "skipped": true) when several transitions fit and none reaches
a unique default status, so the issue is not moved. Earlier in this PR
`--state closed` exited non-zero as an ambiguous error here before
becoming an exit-0 skip; callers should treat code 11 as "not moved,
choose with --transition or --status". The command also now picks Done,
Closed or Resolved automatically when exactly one is reachable, and falls
back to the site default resolution when a required resolution cannot be
selected, instead of failing as before.

Addresses #9925

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 4 (human-triggered)

Addressed all three findings in one commit. Ambiguous Jira --state skips now print JSON and exit 11. The comment wording and the hierarchy_level claims are corrected in help, docs and the TransitionResult comment. PR description updated. Tracker, Jira and CLI tests pass. pre-commit could not fetch hook repos (TLS), so gofmt, go vet and git diff --check were run directly.

Fixed (3):

  1. Ambiguous --state skip exits 0, so an exit-code-only caller reads it as moved (maintainer review, issues_transition.go) (internal/cli/issues_transition.go): An ambiguous Jira --state started/closed now prints the skip JSON (reason and candidates) on stdout, then exits with dedicated code 11 through the ExitCode() hook. A JSON write error takes precedence. Zero matches stays an ordinary error, and successful or already-satisfied results still exit 0. A new Ambiguous field on the tracker result limits the failure to this case, so other skips such as fullsend issues transition: add --if-issue-type predicate to gate Jira transitions by issue type #9534 filters stay successful. CLI tests cover starts and closes, write-error precedence, zero matches, non-ambiguous skips and already-satisfied states; tracker tests still pin no write and no comment on ambiguity. Docs, help, README, PR description and the BREAKING CHANGE trailer now describe exit code 11.
  2. "Does nothing" wording is wrong when a comment is passed (maintainer review, issues-commands.md) (docs/guides/user/issues-commands.md): Kept the behaviour. The --state started table row and the --help text now say the status stays unchanged and a requested comment is still posted.
  3. hierarchy_level cannot keep an epic from moving because it is built after the transition (maintainer review, issues-commands.md) (docs/guides/user/issues-commands.md): Kept issue_type and hierarchy_level in the result. Removed the claim that they let callers leave epics alone, in the guide and in the TransitionResult comment. Both now say they report the kind of issue the command acted on, and that a moving run builds them after the transition. No filter or dry run was added.

Tests: passed

CI inspections (1):

  1. project CI on PR head (passing, success): All non-Fullsend checks (test, web, semgrep, commit-lint, behaviour jobs, codecov/patch, DCO, title lint) passed on the previous head.

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Decision points

PR metadata: body updated

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:33 AM UTC · Completed 10:46 AM UTC

Commit: 34627d6 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.53

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate risk preserved: well-scoped feature addressing linked issue acceptance criteria with strong test coverage and no protected or security paths touched, balanced against change size (657 lines across 10 files), documentation churn, and modified behavior for ambiguous transitions without a feature flag.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review December 3, 2026 10:45

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Dec 3, 2026
@ascerra
ascerra added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 4db7ae7 Dec 3, 2026
84 of 85 checks passed
@ascerra
ascerra deleted the agent/9536-jira-started-state branch December 3, 2026 12:24
@ascerra

ascerra commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

/fs-retro

@fullsend-ai-retro

fullsend-ai-retro Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 1:01 PM UTC · Completed 1:04 PM UTC

Commit: 34627d6 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.29

@fullsend-ai-retro

Copy link
Copy Markdown

PR #9925 (code agent, implements #9536: Jira issues transition --state started/closed via status categories) merged 2026-12-03 after 5 commits and about 4 days. Flow: the review agent's first pass (2026-11-29) raised a medium stale-doc finding, which the fix agent fixed, and two low findings. One of the lows said the new exit-0 skipped result for an ambiguous --state is indistinguishable by exit code from success. The fix agent declined it because the issue text asked for exit 0. The review agent then approved. On 2026-11-29 and 2026-12-02, human reviewers (Benkapner, then the issue author ascerra) found the same exit-0 problem. ascerra rated it medium and traced it to a concrete caller in another repo, fullsend-ai/agents#1998, whose fallback treats exit 0 as success. They also found two doc/help claims that contradicted the code. One said --state started 'does nothing' on an issue already in progress, but a requested comment is still posted. The other said hierarchy_level lets callers skip epics, but the result is built after the move. A fix commit (34627d6) added dedicated exit code 11, and the review agent approved the final head. The review and fix agents otherwise worked well: they caught the stale CLI-internals doc and the missing httptest handler-invoked assertion, the fix agent resolved both, and the PR included thorough tests. Time to merge was dominated by waiting for human review.

Not filed because already covered: the doc-claim-vs-code miss (two of the three human findings) matches open fullsend-ai/agents#2068 (docs-currency subagent should verify behavioral claims against control flow), agents#2173, agents#895, #3497 and agents#961. One more data point: here the false claims were copied from the human-authored issue's wording and the review agent did not check them against code. I did not file a separate proposal. The author-declined, low-severity finding that a human later upgraded is covered by the one proposal filed.

Proposals filed

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — 34627d64 Deployed Dec 3, 2026 by github-actions[bot]
forgejo-dev — 34627d64 Deployed Dec 3, 2026 by fullsend-ai-coder[bot] via forgejo-behaviour #21809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issues transition: resolve started and closed from Jira status categories, so repos keep no status names

3 participants