Skip to content

feat(retro): add Jira support to the retro agent - #2109

Merged
waynesun09 merged 45 commits into
fullsend-ai:mainfrom
andrewevansrh:feat/retro-jira-support
Nov 23, 2026
Merged

waynesun09 merged 45 commits into
fullsend-ai:mainfrom
andrewevansrh:feat/retro-jira-support

Conversation

@andrewevansrh

@andrewevansrh andrewevansrh commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Jira Cloud issue creation and Jira-originated retrospective support to the Retro agent, implementing the capability requested in fullsend-ai/fullsend#2267 using the patterns established by the Scribe agent (#1676 / #1678). Teams using Jira Cloud for work tracking can receive retro findings directly as Jira issues, and run retrospectives against Jira-originated work items via a host-side context fetch that preserves sandbox isolation.

What changed in this repo

  • scripts/lib/jira-retro-ops.lib.sh (new): When FULLSEND_TRACKER=jira, defines Jira Cloud tracker operations:
    • Create: delegates to fullsend issues create --tracker jira --project <RETRO_JIRA_PROJECT>, followed by a REST PUT /issue/{key} for sanitized labels.
    • tracker_validate_create: reads createmeta paginated with startAt. Fails clearly if the issue type is missing, if required fields retro cannot populate are present, or if the create screen lacks a Description field. Labels are not decided here: an update is validated against the edit screen, so _retro_jira_labels_editable probes editmeta once per run.
    • tracker_find_existing_issue: finds Unicode-aware exact-summary matches in the project across paginated /search/jql results. A title with no terms left after the stop-word and token filter falls back to a project-wide project = KEY search with a client-side exact-summary comparison. Creation is refused only when that search is cut off by RETRO_JIRA_MAX_PAGES or returns a malformed response. /search/jql lags behind writes, so the run also keeps the titles it has already filed or matched and skips those before searching.
    • Input & gate checks: validates JIRA_BASE_URL (https://<site>.atlassian.net), the project key format, and RETRO_JIRA_MAX_PAGES / RETRO_JIRA_CONTEXT_MAX_PAGES as plain positive integers, since both are bash arithmetic bounds.
    • _retro_jira_write_context: for a Jira-originated run, fetches the issue and every comment host-side (comments with an explicit orderBy=created), converts ADF to plain text, and writes a bounded JSON context file to RETRO_JIRA_CONTEXT_FILE, which the harness mounts as RETRO_JIRA_CONTEXT. Comments are capped per body, by total bytes (oldest dropped first) and by page count; both cap paths set comments_truncated. The issue document is passed to jq with --slurpfile, not as a 128 KiB-limited argv value.
    • Originating URL & comment dispatch: validates and parses both Jira issue URLs (https://<site>.atlassian.net/browse/<project>-123) and GitHub/GitLab PR/MR URLs. Dispatches summary comment posting to Jira (fullsend issues post-comment) or the originating forge.
    • Rerun handling: passes --keep-history=false when the CLI's flag table lists it without "deprecated".
    • REST routing: mirrors fullsend's Jira Scoped client. tracker.jira.api_url from FULLSEND_DIR's config is the gateway base (default https://api.atlassian.com), the cloud ID is discovered from tracker.jira.base_url, and every REST call goes to <api_url>/ex/jira/<cloudId>/rest/api/3. No JIRA_API_URL environment variable is read, so reads and CLI writes cannot land on different tenants.
    • Credentials: supports both Basic auth (bot user email + token) and Bearer auth (service account token), masks JIRA_TOKEN, and disables xtrace around every credential expansion so bash -x cannot print the token.
  • scripts/lib/retro-ops.lib.sh: sources jira-retro-ops.lib.sh after the forge library when FULLSEND_TRACKER=jira. FULLSEND_TRACKER defaults to FULLSEND_FORGE. RETRO_MODE is validated here, before the tracker library is sourced, so pre and post both reject a typo up front — the Jira library branches on it at source time.
  • scripts/pre-retro.src.sh: validates FULLSEND_DIR when FULLSEND_TRACKER=jira, requires RETRO_JIRA_CONTEXT_FILE for a Jira-originated run (the harness mounts exactly that path), removes a stale file at that path on every run, fetches the originating issue and comments host-side with the runner's credentials, and masks JIRA_TOKEN.
  • scripts/post-retro.src.sh:
    • Adds RETRO_MODE support: all (default), summary_only (skips issue creation and folds validated proposals into the summary comment), and issues_only (creates issues without posting summary, and therefore does not require a forge token).
    • Validates createmeta once per run before any create call; a failed check is not retried for later proposals. A failed Jira init (for example a client-credentials mint) marks proposals as not filed and still posts the summary.
    • Skips exact-summary duplicates on live runs, keeping the titles it filed or matched in this run so a second proposal with the same summary cannot be filed twice, and reports both cases under ### Already filed (existing issue) rather than ### Proposals filed.
    • Reads the Jira allowlist and primary project from FULLSEND_DIR (the directory the CLI reads), from the merged tracker block only, so a base-layer project is never re-added when the overlay replaces tracker.
    • Caps a proposal body at the CLI's 32 KiB Jira limit, measured in bytes with the originating-URL footer preserved, and caps a Jira summary comment the same way.
    • Maps validated proposals into RETRO_JIRA_PROJECT and preserves the originating PR/MR URL in the issue body; related-issue links use the configured GitHub server URL rather than a hard-coded github.com.
  • harness/retro.yaml: mounts the context file as host_files src: ${RETRO_JIRA_CONTEXT_FILE} (optional: true) into /sandbox/workspace/jira-origin.json, exposed to the agent as RETRO_JIRA_CONTEXT, and registers skills/retro-analysis/jira. The src is env-expanded because fullsend rejects a literal absolute path in any harness loaded from a URL or composed with base:.
  • agents/retro.md: declares RETRO_JIRA_CONTEXT as a valid input.
  • skills/retro-analysis/jira/SKILL.md (new): recipes for reading the host-fetched issue context and tracing the workflow graph on the forge using the issue key, with lowercase placeholders so scripts/skill-env-reachability-test.sh does not read them as env vars.
  • docs/retro.md: documents FULLSEND_TRACKER, RETRO_MODE, RETRO_JIRA_CONTEXT_FILE and the Jira integration, including harness base: composition, the host-fetch/sandbox-tracing split, CLI delegation, REST routing, idempotency and in-run dedupe, allowlist configuration, and the upstream dispatch gap for forge-originated runs.
  • Rebuilt bundles: scripts/pre-retro.sh and scripts/post-retro.sh.

Cross-agent change: shared Jira OAuth token masking

scripts/lib/jira-auth.lib.sh is shared by code, prioritize, scribe, triage and
retro. Its OAuth mint printed ::add-mask::<access token> unconditionally.
::add-mask:: is a GitHub Actions workflow command, so on any other runner that
line is ordinary log output and prints the minted token. This PR gates the mask
on GITHUB_ACTIONS, so code, prioritize, scribe and triage no longer write a
minted token to the log on a non-GitHub-Actions runner. The mask helper the
library now calls (_jira_auth_gha_mask) also escapes %, CR and LF in the
masked value; that escaping is a no-op here because the token regex above it
already rejects those characters.

The non-retro bundle diffs in this PR are only the regenerated
make script-build output for that one library change:
pre-code-jira.sh, post-code.sh, pre-prioritize.sh, post-prioritize.sh,
pre-scribe.sh, post-scribe.sh, pre-triage.sh and post-triage.sh. The
only behavior change for those agents is the mask gate described above.
make check-bundle passes.

Tests: pre-code-jira-test.sh, post-prioritize-test.sh,
pre-scribe-test.sh and post-triage-test.sh export GITHUB_ACTIONS=true
so their existing "the mint is masked" assertions do not depend on the caller's
environment. scripts/jira-auth-test.sh runs every case with
GITHUB_ACTIONS=true unless the case overrides it, and adds a client-no-gha
case asserting that a mint with GITHUB_ACTIONS unset emits no ::add-mask::
line and prints no token.

This shared-library change stays in this PR rather than being split out, and is
called out here so the code, prioritize, scribe and triage owners can review it.

Testing

  • scripts/post-retro-test.sh includes Jira cases with a stubbed Jira API and a mocked fullsend CLI:
    • A live run invokes fullsend issues create --tracker jira --project PROJ and sets labels via a REST PUT, returning the browse URL without forge issue creation.
    • The token is passed via environment, not command-line arguments; Basic auth with a bot user email and Bearer auth with a service account token both work.
    • Duplicate search skips creation when an exact-match issue exists and reports it under ### Already filed (existing issue).
    • Two proposals with the same summary in one run file a single issue; the second is reported as already filed.
    • Creation is refused when the duplicate search returns a malformed response, and when the page cap prevents ruling out a duplicate.
    • createmeta validation fails early on extra required fields or a missing Description field; labels are decided from edit metadata, and an issue type whose edit screen lacks Labels gets no labels and a warning.
    • RETRO_MODE=summary_only makes zero issue creations and lists proposals in the summary comment; issues_only creates issues and suppresses summary posting.
    • Retrospectives on GitLab MRs with a Jira tracker create Jira issues and post notes to the GitLab MR.
    • REST reads and label writes route through <api_url>/ex/jira/<cloudId>, and a tracker.jira.base_url that disagrees with JIRA_BASE_URL denies creation instead of crossing tenants.
    • The Jira allowlist and primary project come from the merged tracker block in FULLSEND_DIR: overlay-without-project denies, a base project is not re-added when the overlay replaces tracker, and a multi-provider mapping still permits the primary project.
    • A proposal body over the 32 KiB Jira limit is truncated in bytes and keeps its footer; RETRO_MODE=issues_only files issues with no forge token set.
    • RETRO_MODE is also covered on the GitHub tracker: summary_only creates no issue and lists the proposal in the summary comment, issues_only files the issue and posts no comment.
    • A token mint prints nothing outside ::add-mask:: with xtrace enabled; a failed createmeta check is probed once, not once per proposal; related-issue links in a Jira body use the configured GitHub server URL.
  • scripts/pre-retro-test.sh covers the host-side context file end to end:
    • FULLSEND_DIR is enforced when FULLSEND_TRACKER=jira; an invalid RETRO_MODE is rejected before any Jira work.
    • A Jira-originated run without RETRO_JIRA_CONTEXT_FILE fails; a failed issue read and a failed comment read both fail closed.
    • The written file has the flat description and comment text, ADF headings flattened to Markdown, per-body clipping marked, comments_truncated set by the byte cap and by the page cap, orderBy=created on the comment fetch, and no truncation flags on a complete read.
    • A stale context file is removed on a forge-originated run.
    • GitHub PR and GitLab MR URLs are validated under the Jira tracker, and JIRA_TOKEN is masked.
  • scripts/jira-auth-test.sh covers the shared-library mask gate, as described above.
  • make check-bundle, make lint (skillsaw, strict), pre-commit run (check-yaml, shellcheck, agent-doc lints), scripts/skill-env-reachability-test.sh, scripts/harness-jira-test.sh and scripts/jira-auth-test.sh pass.

Caveats

  • Jira event polling and automated webhook triggers remain platform-level infrastructure: a Jira-originated retro is a manually dispatched fullsend run. For that run, export RETRO_JIRA_CONTEXT_FILE in the environment fullsend run starts in — fullsend expands the host_files src from its own environment, so a value that only reaches the pre-script would leave the mount unset.
  • Duplicate detection is an exact summary match within the configured project plus the titles this run already filed. /search/jql is eventually consistent, so a concurrent run can still file a duplicate; edited summaries are not detected.
  • Forge-originated Jira filing (PR/MR close on GitHub or GitLab) is blocked on dispatch: dispatch passes no Jira credentials to those runs and unsets FULLSEND_JIRA_TOKEN/FULLSEND_JIRA_EMAIL, so the documented overlay fails harness env validation before the pre-script runs. No upstream issue tracks that dispatch change yet; fullsend-ai/fullsend#2267 is the feature request this PR implements. Summary-only forge runs and manually dispatched forge runs are unaffected.
  • The forge-originated Jira path has not run once against a test Jira project with real credentials yet.

Relates to fullsend-ai/fullsend#2267

Add Jira issue creation, idempotency/duplicate detection, and comment
support to the retro agent when FULLSEND_TRACKER=jira.

- Add scripts/lib/jira-retro-ops.lib.sh for Jira Cloud REST operations
  and CLI delegation.
- Support filing retro proposals directly into a configured Jira Cloud
  project (RETRO_JIRA_PROJECT) via fullsend issues create.
- Implement preflight createmeta validation and JQL exact-summary
  duplicate search to prevent duplicate tickets on retries.
- Support RETRO_MODE (all, summary_only, issues_only) to allow summary
  posting without issue creation.
- Support both Jira-originated issues and GitHub/GitLab PRs/MRs associated
  with Jira work, preserving PR URLs and created issue links in summaries.
- Add unit tests in pre-retro-test.sh and post-retro-test.sh.

Signed-off-by: anevans <anevans@redhat.com>
- Treat label PUT failure (exit code 2) as created issue rather than failed creation.
- Fail closed in Jira allowlist checks when config is invalid, yq is missing, or targets are empty.
- Validate that Jira originating URL matches JIRA_BASE_URL tenant.
- Eliminate runtime eval function wrapping by using named platform helpers.
- Rename _jira_retro_post_comment to _retro_jira_post_comment.
- Replace open-coded token mask in pre-retro with forge_mask_token.
- Allow summary-only runs without Jira credentials when originating from forge, and collect proposals before allowlist/receipt gates.
- Update docs/retro.md and agents/retro.md inputs and variable tables.

Signed-off-by: anevans <anevans@redhat.com>
- Parse and validate originating URL before requiring forge tokens in post-retro, avoiding false errors when running on Jira items without GH_TOKEN.
- Allow Jira issue creation when tracker.jira is configured without an allowed_targets.projects list.
- Only emit ::add-mask:: for JIRA_TOKEN when running under GITHUB_ACTIONS.
- Sanitize ISSUE_URL when emitting workflow warning on label failure.
- Document advisory behavior when tracker.jira.allowed_targets.projects is omitted.
- Add test coverage for Jira origin without forge token, missing allowed_targets, and token masking under GitHub Actions.

Signed-off-by: anevans <anevans@redhat.com>
- In _forge_mask_token for GitHub and GitLab, guard token expansion with
  presence checks to prevent unbound variable errors under set -u when
  running under GITHUB_ACTIONS.
- In jira-retro-ops.lib.sh, do not delegate to _forge_mask_token on Jira-
  originated runs.
- In pre-retro.src.sh, validate and parse originating URL before masking.
- Add regression tests in pre-retro-test.sh and post-retro-test.sh with
  GITHUB_ACTIONS=true and forge tokens genuinely unset.
- Rebuild script bundles.

Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
… body

Signed-off-by: anevans <anevans@redhat.com>
… and allowlist

Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
Signed-off-by: anevans <anevans@redhat.com>
@andrewevansrh
andrewevansrh requested a review from a team as a code owner November 19, 2026 11:26
@qodo-code-review

qodo-code-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add Jira Cloud issue and comment support to the retro agent

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• File validated retro proposals in a configured Jira Cloud project while retaining GitHub and
 GitLab origins.
• Add create-screen checks, project allowlisting, duplicate detection, and configurable issue and
 summary output modes.
• Document Jira setup and test creation, comments, authentication, failure handling, and existing
 forge behavior.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 4 capabilities

  • 4 affected capabilities within one bounded functional scope: retro_jira_delivery.
  • The host post flow validates, transforms, deduplicates, preflights, creates, labels, and reports proposal issues.
  • These are stages of one end-to-end proposal-delivery behavior, not independent capabilities.
  • Summary posting is a distinct user-visible result within the same bounded retro delivery integration.
  • It is separate from proposal filing because it has a different recipient and can fail after issues are created.
  • The fetch, serialization, mount, and agent consumption are propagation hops of one Jira-originated retrospective analysis behavior.
  • They share the same bounded retro integration and produce one analysis outcome.
  • The changed helper is a shared authentication safeguard used by the retro and other bundled agent operations.
  • It changes secret-handling behavior, not a separate user-facing integration scope.
Sources

scripts/lib/jira-retro-ops.lib.sh[70-75]

RETRO_JIRA_PROJECT="${RETRO_JIRA_PROJECT:-}"
RETRO_MODE="${RETRO_MODE:-all}"
if [[ "${RETRO_MODE}" != "summary_only" ]]; then
  : "${JIRA_BASE_URL:?JIRA_BASE_URL must be set}"
  : "${RETRO_JIRA_PROJECT:?RETRO_JIRA_PROJECT must be set}"
fi
Behavioral complexity 🔴 High 🧩 Multiple interactions

  • Before, the sandbox did not need a host-managed Jira context resource.
  • After, correctness depends on fetch, bounded serialization, absolute host-file validation, host-file mount, sandbox read, and cleanup, plus Jira-originating versus forge-originating branching and truncation metadata.
  • The absolute-path check is a straightforward fail-closed rule, but the existing ordering condition remains: cleanup for one run must not remove or replace a resource another run has not uploaded or consumed.
  • Serialization still transforms Jira ADF and paginated comments into bounded plain text.
  • The follow-up only adds tests and does not change these correctness conditions.
Potential damage 🔴 High 🩹 Confidentiality

  • If the changed masking behavior regresses and a minted token is printed in a GitHub Actions log, the token may be exposed and usable until expiry or revocation.
  • The source adds gating and escaping, but the assessment covers the capability when the changed token-handling path is active.
  • The follow-up test-only changes do not alter this premise.
  • Revoking or waiting for token expiry limits exposure, but log copies cannot be recalled.
  • Restoring code prevents future exposure but does not remove already-published logs; operator secret rotation is required.
Assessed commit 38e5f34
Diagram

graph TD
  Origin["GitHub GitLab Jira"] --> Pre["Retro pre-script"] --> Post["Retro post-script"] --> Gate{"Creation gates"} --> CLI["Fullsend Jira CLI"] --> Jira["Jira Cloud"]
  Post --> Comments["Summary comments"] --> Origin
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Implement all Jira writes through REST
  • ➕ Would remove the runtime dependency on Jira-capable fullsend CLI commands.
  • ➖ Would duplicate Markdown-to-ADF conversion, comment replacement, and tracker configuration already handled by the CLI.

Recommendation: Keep the CLI for Jira writes and host-side REST reads for retro-specific preflight and deduplication. This reuses established issue and comment behavior without moving credentials into the sandbox; a fully REST-based implementation would add substantial duplicated integration logic.

Files changed (20) +4033 / -200

Enhancement (17) +2994 / -188
github-retro-ops.lib.shExpose GitHub operations for Jira-aware dispatch +26/-8

Expose GitHub operations for Jira-aware dispatch

• Preserves GitHub URL, token, comment-limit, and comment operations as named helpers that the Jira tracker can delegate to. Masks a GitHub token only when one is set.

scripts/lib/github-retro-ops.lib.sh

gitlab-retro-ops.lib.shExpose GitLab operations for Jira-aware dispatch +26/-8

Expose GitLab operations for Jira-aware dispatch

• Adds named helpers so Jira tracking can retain GitLab origin parsing and MR or issue comments. Avoids attempting to mask an unset GitLab token.

scripts/lib/gitlab-retro-ops.lib.sh

jira-auth.lib.shUse the shared masking helper for Jira OAuth tokens +4/-4

Use the shared masking helper for Jira OAuth tokens

• Routes minted-token masking through the workflow-command escaping helper, including when token minting occurs in a subshell.

scripts/lib/jira-auth.lib.sh

jira-retro-ops.lib.shAdd Jira Cloud tracker operations for retro +543/-0

Add Jira Cloud tracker operations for retro

• Adds tenant and credential validation, paginated create-metadata checks, exact-summary duplicate detection, and controlled label updates. Delegates issue creation and Jira-originated summary comments to the fullsend CLI while retaining forge comment dispatch.

scripts/lib/jira-retro-ops.lib.sh

retro-ops.lib.shDispatch retro tracker operations independently of forge +21/-0

Dispatch retro tracker operations independently of forge

• Defaults the tracker to the originating forge and loads Jira operations when selected. Adds a shared escaped masking helper for workflow commands.

scripts/lib/retro-ops.lib.sh

post-code.shRegenerate bundled Jira OAuth token masking in code post-script +4/-4

Regenerate bundled Jira OAuth token masking in code post-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/post-code.sh

post-prioritize.shRegenerate bundled Jira OAuth token masking in prioritize post-script +4/-4

Regenerate bundled Jira OAuth token masking in prioritize post-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/post-prioritize.sh

post-retro.shBundle Jira tracker and output handling into retro post-script +1158/-68

Bundle Jira tracker and output handling into retro post-script

• Includes Jira operations and the updated host-side proposal workflow in the executable script. Supports Jira issue links, preflight and duplicate gates, and configurable issue and summary outputs.

scripts/post-retro.sh

post-retro.src.shRoute validated retro proposals to Jira when selected +254/-52

Route validated retro proposals to Jira when selected

• Adds Jira project allowlisting, metadata and duplicate checks before creation, plus Jira-aware proposal bodies and summary links. Implements summary-only and issues-only modes while preserving forge-originated comments.

scripts/post-retro.src.sh

post-scribe.shRegenerate bundled Jira OAuth token masking in scribe post-script +4/-4

Regenerate bundled Jira OAuth token masking in scribe post-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/post-scribe.sh

post-triage.shRegenerate bundled Jira OAuth token masking in triage post-script +4/-4

Regenerate bundled Jira OAuth token masking in triage post-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/post-triage.sh

pre-code-jira.shRegenerate bundled Jira OAuth token masking in code pre-script +4/-4

Regenerate bundled Jira OAuth token masking in code pre-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/pre-code-jira.sh

pre-prioritize.shRegenerate bundled Jira OAuth token masking in prioritize pre-script +4/-4

Regenerate bundled Jira OAuth token masking in prioritize pre-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/pre-prioritize.sh

pre-retro.shBundle Jira-aware validation into retro pre-script +917/-16

Bundle Jira-aware validation into retro pre-script

• Includes the tracker dispatch and Jira operations in the executable pre-script. Parses origins early and checks required CLI configuration while allowing forge summary-only runs without Jira setup.

scripts/pre-retro.sh

pre-retro.src.shValidate tracker context before retro execution +13/-0

Validate tracker context before retro execution

• Parses the originating URL, masks available tokens, and requires FULLSEND_DIR for Jira operations that need the CLI.

scripts/pre-retro.src.sh

pre-scribe.shRegenerate bundled Jira OAuth token masking in scribe pre-script +4/-4

Regenerate bundled Jira OAuth token masking in scribe pre-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/pre-scribe.sh

pre-triage.shRegenerate bundled Jira OAuth token masking in triage pre-script +4/-4

Regenerate bundled Jira OAuth token masking in triage pre-script

• Uses the shared masking helper in bundled Jira authentication code.

scripts/pre-triage.sh

Tests (2) +979 / -1
post-retro-test.shTest Jira retro creation, comments, and safety gates +889/-1

Test Jira retro creation, comments, and safety gates

• Mocks the fullsend CLI and Jira REST responses to cover issue creation, deduplication, pagination, metadata, allowlists, labels, authentication, output modes, and forge or Jira comment destinations.

scripts/post-retro-test.sh

pre-retro-test.shTest Jira-origin validation and credential requirements +90/-0

Test Jira-origin validation and credential requirements

• Covers Jira and forge originating URLs, tenant mismatch, missing CLI configuration, token masking, and Jira-originated runs without forge credentials.

scripts/pre-retro-test.sh

Documentation (1) +60 / -11
retro.mdDocument Jira delivery and retro output modes +60/-11

Document Jira delivery and retro output modes

• Explains Jira project, credentials, CLI configuration, allowlisting, duplicate behavior, and output modes. Clarifies that Jira-originated runs require manual dispatch rather than a new automatic trigger.

docs/retro.md

@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ⚠️ Cancelled · Started 11:28 AM UTC · Completed 11:31 AM UTC

Commit: e4f6998 · View workflow run →

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

This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging.

@andrewevansrh
andrewevansrh force-pushed the feat/retro-jira-support branch from e4f6998 to 640ebc8 Compare November 19, 2026 11:30
@qodo-code-review

qodo-code-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (1)

Grey Divider


Action required

1. Traced Jira runs expose the token ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The commit adds _jira_retro_xtrace_off/_jira_retro_xtrace_restore helpers and wraps the
credential-bearing expansions in jira_auth_select, _retro_jira_api, _retro_jira_api_with_status,
forge_create_issue, _retro_jira_post_comment, and forge_mask_token with xtrace off/restore. A bash
-x regression test (jira/xtrace-does-not-leak-token) is also added. This addresses the finding with
a helper-based approach rather than the suggested inline wrapping, and covers the create, REST, and
comment paths the finding named.
Description
forge_create_issue expands JIRA_TOKEN into a shell function argument without first disabling
xtrace, and the new REST and comment paths do the same. When the host runs the post-script with
bash -x or set -x, Bash writes the expanded credential to its trace; masking is emitted only for
GitHub Actions logs.

2. Other agents' Jira token mint breaks ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Added a self-contained _jira_auth_gha_mask emitter to jira-auth.lib.sh with the same %/CR/LF
escaping, and changed all three _gha_mask call sites in _jira_auth_mint_now to use it, so
minting emits ::add-mask:: in every bundle without depending on retro-ops.lib.sh.
Description
_jira_auth_mint_now in the shared jira-auth.lib.sh calls _gha_mask, but only
retro-ops.lib.sh defines it, leaving the rebuilt code, scribe, triage and prioritize bundles
without the helper. When those agents mint an OAuth token, the call reports command not found
instead of emitting ::add-mask::; jira_auth_mint absorbs the error through || rc=$?, so the
token remains unmasked and the failure goes unnoticed.

3. Preflight can check the wrong Jira tenant ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Replaced the file-existence-only config lookup with a layered reader that follows the overlay/base
whole-object tracker merge, and validates the configured base_url against JIRA_BASE_URL before any
REST call, so preflight and REST use the same tenant. Added a null-tracker-inherits test.
Description
The Jira URL consistency check reads config.base.yaml only when config.yaml does not exist,
rather than resolving an overlay whose tracker is null to the base tracker. With such an overlay,
REST metadata and duplicate checks use the environment tenant while the CLI can inherit a different
tenant from the base config for issue creation.

View high (2)
4. PR retros cannot authenticate to Jira ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Documents and wires a FULLSEND_JIRA_TOKEN/FULLSEND_JIRA_EMAIL credential path for PR/MR-close runs
targeting Jira, with an explicit credential error when neither the token nor client credentials are
supplied; restructures the credential check in jira-retro-ops.lib.sh accordingly.
Description
jira-retro-ops.lib.sh requires Jira credentials for issue-creating runs, but Fullsend's retro
dispatch passes them to the action only when the originating event is from Jira. A GitHub or GitLab
PR-close event keeps its forge origin when FULLSEND_TRACKER=jira, so the action passes no Jira
credentials and retro exits before creating issues.

5. Documented Jira credentials resolve empty ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The docs example now maps JIRA_TOKEN from ${FULLSEND_JIRA_TOKEN} and JIRA_USER_EMAIL from
${FULLSEND_JIRA_EMAIL}, with a comment explaining that fullsend exposes the Jira credentials to the
runner as FULLSEND_JIRA_*. This matches the suggested fix. The prose also states that the overlay
maps them from FULLSEND_JIRA_TOKEN and FULLSEND_JIRA_EMAIL and that retro stops with a credential
error if the dispatch supplies neither.
Description
docs/retro.md maps the runner's JIRA_TOKEN and JIRA_USER_EMAIL from same-named variables
instead of Fullsend's FULLSEND_JIRA_TOKEN and FULLSEND_JIRA_EMAIL. Even when the action receives
Jira credentials, an operator following this overlay does not pass them to the retro host script,
which then rejects issue creation.


Remediation recommended

6. Jira issue bodies link to github.com on Enterprise ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Before building the body, the script computes GH_ORIGIN from _github_server_url (defaulting to
https://github.com) when the forge is GitHub, passes it to jq as $gh_origin, and uses it in place of
the literal https://github.com for Jira-tracker numeric related-issue links. GitHub Enterprise
deployments now link to their own host.
Description
The new Considered: rendering for $tracker == "jira" with a GitHub forge always builds
https://github.com/<target_repo>/issues/N. It ignores GITHUB_SERVER_URL, which
github-host.lib.sh uses for every other generated link. On a GitHub Enterprise Server deployment,
every related-issue reference in a Jira proposal points at a non-existent or wrong github.com
repository.

7. Jira reruns retain old summaries ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The commit adds _jira_retro_keep_history_args, which probes fullsend issues post-comment --help
and sets --keep-history=false when the CLI lists the flag without "deprecated".
_retro_jira_post_comment then splices ${_RETRO_JIRA_KEEP_HISTORY_ARGS[@]} into the post-comment
call. The flag is passed on CLIs that support it, so reruns replace the prior summary instead of
accumulating history. This is a conditional implementation rather than an unconditional flag, but it
addresses the same issue.
Description
_retro_jira_post_comment supplies a sticky marker but does not set Fullsend's
--keep-history=false option. When a rerun finds its existing Jira comment, the CLI's default
history behavior folds the previous summary into the updated comment instead of replacing its
contents.

8. Label docs misstate accepted label names ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The valid-values column for RETRO_JIRA_LABELS now states the accepted pattern (1–64 characters from
letters, digits, '.', '_', '-') instead of "Alphanumeric label names", so the docs no longer
contradict the code or the hyphenated default.
Description
The RETRO_JIRA_LABELS row in docs/retro.md says valid values are "Alphanumeric label names", but
the library accepts [A-Za-z0-9._-]{1,64} and its own documented default ready-for-triage
contains hyphens, so the table contradicts both the code and its default. An operator who reads the
table and avoids hyphens or dots will be needlessly restricted, and one who uses the default may
think it is invalid.

View medium (5)
9. Unsupported clients pass Jira preflight ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The check is inverted to fail preflight unless the help output contains "Usage: fullsend issues
create", "--fullsend-dir", and "--tracker" (each missing flag now triggers the upgrade error). This
matches the suggested fix; the rest of the diff's preflight is unchanged in the same function.
Description
tracker_validate_create rejects successful help output only when it contains the expected usage
string and lacks both --fullsend-dir and --tracker, so output missing just one required flag
passes preflight. With an incompatible installed CLI, metadata validation succeeds, but each
subsequent proposal reaches issues create with both flags and fails with an unknown-flag error
instead of the preflight upgrade message.

10. Unexplained edits reach other agents 📜 Skill insight ✧ Quality
Description
The PR rewrites the ::add-mask:: block in eight bundles for scribe, triage, code and prioritize,
which fall outside the retro scope the PR description covers. Those edits are not called out, so
reviewers of the retro feature cannot see that other agents are affected.
Code

scripts/post-code.sh[1931]

+    _gha_mask "${token}"
Relevance

●● Moderate

Scope-creep critiques were mixed; a similar scope-creep suggestion was rejected, but the bundle
edits are regenerated output.

PR-#1377

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR description lists only retro-related changes, but the diff also rewrites the masking block in
rebuilt bundles for other agents. These edits come from the shared jira-auth.lib.sh change and are
not justified in the description, so the change is not scoped to the stated issue.

scripts/post-code.sh[1919-1936]
scripts/post-scribe.sh[972-990]
scripts/pre-code-jira.sh[2056-2073]
Skill: code-implementation

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The PR rewrites the `::add-mask::` block in eight bundles for scribe, triage, code and prioritize. The PR description describes only retro changes, so these edits are unexplained and affect other agents.

Fix Focus Areas
- scripts/post-code.sh[1919-1936]
- scripts/post-scribe.sh[972-990]
- scripts/pre-code-jira.sh[2056-2073]

Recommended Fix
Either move the shared `jira-auth.lib.sh` change and the regenerated bundles for the other agents into a separate PR, or add a PR description section that justifies each cross-agent edit and names the consumers. Fix the defect in the first finding in the same change.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


11. Issue-only runs require a forge token ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Adds an early return in forge_require_token when RETRO_MODE is issues_only, so the forge token check
is skipped for issue-only runs. Applied in jira-retro-ops.lib.sh and mirrored in post-retro.sh and
post-retro.src.sh. Also adds a test (jira/issues-only-no-forge-token) that unsets GH_TOKEN and
expects issue creation to succeed. The fix is placed in the Jira-origin path of forge_require_token
rather than gated on whether a forge comment will be posted, but it addresses the same premise.
Description
forge_require_token delegates to the originating forge's token check for GitHub or GitLab URLs
even when RETRO_MODE=issues_only. In that mode the post-script skips the forge summary comment, so
a Jira-backed run with Jira credentials but no forge token stops before filing its proposals.

12. Two unused Jira helpers add dead code ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
Both unused function definitions (forge_issue_url_base and forge_normalize_labels) were deleted from
the retro Jira library and from the bundled post-retro.sh and pre-retro.sh copies, eliminating the
dead code the finding flagged.
Description
forge_issue_url_base and forge_normalize_labels are added to scripts/lib/jira-retro-ops.lib.sh
but no retro script calls them: the retro post/pre scripts and post-retro.src.sh never reference
either name, and the only other callers in the repo are in the Scribe scripts. Because they are
defined as forge-interface names, a later reader will assume the retro flow relies on them and may
change them without realizing nothing depends on them.

13. Valid gateway setups cannot file issues ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The old config consistency block comparing JIRA_API_URL against tracker.jira.base_url (including the
"api_url is unset" error) is removed from post-retro/jira-retro-ops. JIRA_API_URL is no longer read
at all; REST routing now uses tracker.jira.api_url (default https://api.atlassian.com) plus the
discovered cloud ID, and tracker.jira.base_url is only checked against JIRA_BASE_URL.
Client-credential runs no longer require a separate gateway URL, so a base-url-only config no longer
triggers the rejected check.
Description
The Jira config check rejects a gateway JIRA_API_URL whenever tracker.jira.base_url is set but
tracker.jira.api_url is absent. This blocks an OAuth setup that supplies the required Atlassian
gateway URL through the environment while leaving the optional config API URL unset, before any
proposal reaches creation.


Informational

14. Failed project check repeats for every proposal ✓ Resolved

Resolving commit: cf13ce7

Resolution reason
The variable is replaced by a three-state JIRA_CREATEMETA_STATE ("unknown"/"ok"/"failed").
tracker_validate_create runs only while the state is "unknown"; on failure the state is set to
"failed" and later proposals skip the CLI/createmeta probe and go straight to the warning and
FAILED_PROPOSALS record via the if [[ "${JIRA_CREATEMETA_STATE}" != "ok" ]] check, then continue.
This is the suggested fix, applied in post-retro.src.sh and mirrored in post-retro.sh.
Description
When tracker_validate_create fails, the loop records the proposal and continues without
remembering the failure, because JIRA_CREATEMETA_VALIDATED stays false. Each later proposal
re-runs the CLI help probe and the paginated createmeta reads, and emits the same warning. A
misconfigured project therefore makes one round of Jira API calls per proposal instead of failing
once.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #1678
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 55 rules
✅ Skills: 4 invoked
  code-review
  code-implementation
  pr-review
  docs-review
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/autonomy-analysis (sha: 46717359) — View relationship
  Explored: repo: fullsend-ai/fullsend (sha: d0dd3f3a) — View relationship
  Explored: repo: fullsend-ai/devlake (sha: ba0670f2) — View relationship
  Explored: repo: fullsend-ai/pi-anthropic-vertex (sha: c3319edf) — View relationship
  Explored: repo: fullsend-ai/pi-xai-vertex (sha: 8a2bad19) — View relationship
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: 🧠 Deep: Large, bug-dense shell logic spans Jira, forge, auth, modes, and writes.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread scripts/post-scribe.sh Resolved
Comment thread scripts/post-code.sh Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Comment thread docs/retro.md Resolved
Comment thread scripts/post-retro.src.sh Resolved
Comment thread scripts/post-retro.src.sh Resolved
Comment thread scripts/post-retro.src.sh Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Comment thread docs/retro.md Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ⚠️ Cancelled · Started 11:33 AM UTC · Completed 11:40 AM UTC

Commit: 640ebc8 · View workflow run →

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

This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging.

@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:42 AM UTC · Completed 12:07 PM UTC

Commit: 6450b35 · View workflow run →

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

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

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

Copy link
Copy Markdown

Risk Assessment: elevated (3/5)

Details

Large changeset touching 25 protected script paths with high recent churn and regression history, balanced by an established contributor, no CI or dependency modifications, and opt-in rollout behavior.

Previous run

Risk Assessment: elevated (3/5)

Details

Large changeset touching 25 protected script paths with high recent churn and regression history, balanced by an established contributor, no CI or dependency modifications, and opt-in rollout behavior.

Previous run (2)

Risk Assessment: elevated (3/5)

Details

Large changeset touching 19 protected script paths with high recent churn and regression history, balanced by an established contributor, no CI/dependency modifications, and opt-in rollout behavior.

Previous run (3)

Risk Assessment: elevated (3/5)

Details

Large changeset touching 19 protected script paths with high recent churn and regression history, balanced by an established contributor, no CI/dependency modifications, and opt-in rollout behavior.

@fullsend-ai-review

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

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] scripts/ — This PR modifies files under the protected scripts/ path (e.g. scripts/lib/jira-retro-ops.lib.sh, scripts/lib/jira-auth.lib.sh, scripts/post-retro.src.sh, scripts/pre-retro.src.sh, their regenerated bundles and tests). The description explains the rationale (Jira support for the retro agent, tracked in Add JIRA support to the retro agent fullsend#2267), but human approval is always required for protected-path changes, regardless of context.
    Remediation: A human maintainer with authority over governance and infrastructure paths must review and approve the scripts/ changes.
Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoiaGlnaCIsImNhdGVnb3J5IjoiYXBpLWNvbnRyYWN0IiwiZmlsZSI6InNjcmlwdHMvbGliL2ppcmEtYXV0aC5saWIuc2giLCJpZCI6ImZfMDczZDhlMTY1MDZmYmUyOSIsImxpbmUiOjIwNSwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJmYWlsLW9wZW4iLCJmaWxlIjoic2NyaXB0cy9wb3N0LXJldHJvLnNyYy5zaCIsImlkIjoiZl9iNTQxZjMxZmY4ZTUxNjE2IiwibGluZSI6MjM5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzZWN1cml0eSJ9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNjcmlwdHMvcG9zdC1yZXRyby5zcmMuc2giLCJpZCI6ImZfYjM5YWNjZTBkMGEwNmI0ZSIsImxpbmUiOjI0NSwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJwYXR0ZXJuLWluY29uc2lzdGVuY3kiLCJmaWxlIjoic2NyaXB0cy9wb3N0LXJldHJvLnNyYy5zaCIsImlkIjoiZl9hMjVkYWIwNWQ2ZDY2YmY1IiwibGluZSI6MjM0LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzdHlsZS1jb252ZW50aW9ucyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6Im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ifSx7ImlkIjoiZl9iMzlhY2NlMGQwYTA2YjRlIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfYTI1ZGFiMDVkNmQ2NmJmNSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2IyZDkzZDA0YTI4NGNhZDAiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9mYTM5NjE0YTkxMzlkYzkzIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Medium

  • [protected-path] scripts/ — This PR modifies 25 files under the protected scripts/ path (including scripts/lib/jira-auth.lib.sh, scripts/lib/jira-retro-ops.lib.sh, scripts/lib/retro-ops.lib.sh, scripts/post-retro.src.sh, scripts/pre-retro.src.sh and the regenerated bundles for the code, prioritize, scribe, triage and retro agents). The description explains the rationale and references the upstream request (Add JIRA support to the retro agent fullsend#2267). Human approval is always required for protected-path changes, regardless of context.

Earlier findings

  • scripts/lib/jira-retro-ops.lib.sh:400, api-contract — resolved: the CLI preflight now matches the Cobra command path (*"fullsend issues create"*) instead of a contiguous Usage: fullsend issues create string.
  • scripts/lib/jira-auth.lib.sh:205, secret-exposure — resolved: ::add-mask:: emission is now gated on GITHUB_ACTIONS, so it is not printed as plain log output on other runners; a client-no-gha test covers it.
  • scripts/lib/jira-auth.lib.sh:217, secret-exposure — resolved: same gating change (the subshell/stderr fallbacks run only under GITHUB_ACTIONS).
  • scripts/lib/jira-retro-ops.lib.sh:223, pattern-inconsistency — resolved: helpers renamed from _jira_retro_* to _retro_jira_* for consistency with the other _retro_jira_* functions.
  • scripts/lib/jira-retro-ops.lib.sh:476, naming-convention — resolved: the unused repo parameter in forge_create_issue is now _repo.
Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5k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8tb3BzLmxpYi5zaCIsImlkIjoiZl9iMmQ5M2QwNGEyODRjYWQwIiwibGluZSI6NDE2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzdHlsZS1jb252ZW50aW9ucyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImRvYy1zdHlsZSIsImZpbGUiOiJzY3JpcHRzL3ByZS1yZXRyby5zcmMuc2giLCJpZCI6ImZfZmEzOTYxNGE5MTM5ZGM5MyIsImxpbmUiOjEzLCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzdHlsZS1jb252ZW50aW9ucyJ9XSwiZGlzcG9zaXRpb25zIjpbeyJpZCI6ImZfMDczZDhlMTY1MDZmYmUyOSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzhlMDY5NzJhMmViNDAyMTYiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfYjU0MWYzMWZmOGU1MTYxNiIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2IzOWFjY2UwZDBhMDZiNGUiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9hMjVkYWIwNWQ2ZDY2YmY1Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfYjJkOTNkMDRhMjg0Y2FkMCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2ZhMzk2MTRhOTEzOWRjOTMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifV19 -->

Review

Findings

High

  • [api-contract] scripts/lib/jira-retro-ops.lib.sh:400 — The CLI capability check in tracker_validate_create requires the contiguous string Usage: fullsend issues create. The installed fullsend issues create --help prints Usage: and then fullsend issues create [flags] on the next line, so the check always fails. tracker_validate_create then reports an upgrade error and every Jira proposal is skipped. The test mock in scripts/post-retro-test.sh prints a single-line usage string, which hides the failure.
    Remediation: Match the real multiline help format, or check the command signature without the Usage: prefix. Keep the --fullsend-dir and --tracker checks. Change the mock in scripts/post-retro-test.sh to real help formatting, then run make script-build to regenerate the bundles.

Medium

  • [secret-exposure] scripts/lib/jira-auth.lib.sh:217 — _jira_auth_mint_now prints the full OAuth access token inside ::add-mask:: with no GITHUB_ACTIONS check, on all three output paths (lines 217, 220 and 222). On GitLab and other non-GHA runners this is ordinary log output, so it exposes the token. The _gha_mask callers in github-retro-ops.lib.sh, gitlab-retro-ops.lib.sh and jira-retro-ops.lib.sh do guard on GITHUB_ACTIONS.
    Remediation: Emit the masking command only when GITHUB_ACTIONS is set. On other runners, keep the token without printing it. Run make script-build to regenerate the bundles.
  • [protected-path] scripts/lib/jira-retro-ops.lib.sh — The PR modifies protected paths under scripts/: scripts/lib/*.lib.sh, scripts/post-retro.src.sh, scripts/pre-retro.src.sh, the regenerated bundles (post-code.sh, post-prioritize.sh, post-retro.sh, post-scribe.sh, post-triage.sh, pre-code-jira.sh, pre-prioritize.sh, pre-retro.sh, pre-scribe.sh, pre-triage.sh) and the retro tests. The description explains the rationale, but human approval is always required for protected-path changes.

Low

  • [naming-convention] scripts/lib/jira-retro-ops.lib.sh:476 — forge_create_issue() declares local repo="$1" but never uses it. Other forge libraries prefix parameters kept only for interface parity with an underscore (for example _repo). Sibling retro libraries use repo and do reference it, so the convention evidence is mixed.
    Remediation: Rename it to _repo.
  • [pattern-inconsistency] scripts/lib/jira-retro-ops.lib.sh:223 — Private helpers use two inverted prefixes: _jira_retro_* (for example _jira_retro_rest_root) and _retro_jira_* (for example _retro_jira_api). jira-scribe-ops.lib.sh uses one prefix, _scribe_jira_*.
    Remediation: Pick one prefix for all private helpers in this file.

Earlier findings

  • scripts/lib/jira-auth.lib.sh:205, api-contract — resolved. The library now defines _jira_auth_gha_mask and calls it at the mint sites, so the non-retro bundles no longer depend on a retro-only helper. The bundles were regenerated.
  • scripts/post-retro.src.sh:239, fail-open — resolved. JIRA_PRIMARY_PROJECT is now taken from the already-resolved TRACKER_JSON. The per-call overlay-to-base yq fallback in is_target_allowed is gone.
  • scripts/post-retro.src.sh:245, logic-error — resolved by the same change.
  • scripts/post-retro.src.sh:234, pattern-inconsistency — resolved. The duplicated primary_project lookups in is_target_allowed were removed.
  • scripts/lib/jira-retro-ops.lib.sh:416, api-shape — resolved. forge_normalize_labels and forge_issue_url_base are no longer defined in the Jira library or referenced elsewhere.
  • scripts/pre-retro.src.sh:13, doc-style — resolved. The header now documents the Jira requirements and RETRO_MODE=summary_only.

Labels: The PR adds Jira support to the retro agent, which is a new feature.


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
Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJhcGktY29udHJhY3QiLCJmaWxlIjoic2NyaXB0cy9saWIvamlyYS1hdXRoLmxpYi5zaCIsImlkIjoiZl8wNzNkOGUxNjUwNmZiZTI5IiwibGluZSI6MjA1LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InNlY3JldC1leHBvc3VyZSIsImZpbGUiOiJzY3JpcHRzL2xpYi9qaXJhLWF1dGgubGliLnNoIiwiaWQiOiJmXzhlMDY5NzJhMmViNDAyMTYiLCJsaW5lIjoyMDUsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6InNlY3VyaXR5In0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZmFpbC1vcGVuIiwi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ib/jira-auth.lib.sh:205 — _jira_auth_mint_now now calls _gha_mask (lines 205, 208, 210), but that helper is defined only in scripts/lib/retro-ops.lib.sh, so only the retro bundles have it. The 8 rebuilt non-retro bundles (pre-code-jira, post-code, pre-prioritize, post-prioritize, pre-scribe, post-scribe, pre-triage, post-triage) call it without defining it, so a successful OAuth mint hits _gha_mask: command not found. Depending on caller errexit handling, the script either aborts or stores the token without masking. This retro PR also changes 8 unrelated agents' bundles.
    Remediation: make jira-auth.lib.sh self-contained (restore the inline printf '::add-mask::%s\n' "${token}" or define the helper there), run make script-build / make check-bundle, and add a mint test that runs without retro-ops and asserts add-mask is emitted.

Medium

  • [secret-exposure] scripts/lib/jira-auth.lib.sh:205 — Same root cause as above, security view: when the caller suppresses errexit (jira_auth_mint || return 1), the minted token is stored and success returned without being registered for masking in non-retro bundles.
    Remediation: define/source the masking helper in the shared library, rebuild bundles, test add-mask emission from a non-retro bundle.
  • [fail-open] scripts/post-retro.src.sh:239 — is_target_allowed re-reads .tracker.jira.project from CONFIG_FILE and falls back to BASE_CONFIG_FILE when empty (lines 238-241 and 249-252), ignoring the whole-object tracker merge policy already applied in TRACKER_JSON/ALLOWED_REPOS. An overlay with allowed_targets.projects: [] and no project should grant nothing, yet the base primary project is still allowed. Impact is bounded to the operator-configured base project; whether the downstream CLI also enforces policy could not be verified.
    Remediation: derive the primary project only from the selected TRACKER_JSON; add a test with a populated base project and an overlay with no/empty project and empty targets.
  • [logic-error] scripts/post-retro.src.sh:245 — The Jira allowlist gate reads CONFIG_FILE from the forge workspace, while Jira operations and the CLI read config from FULLSEND_DIR; nothing enforces they coincide. Jira config present only under FULLSEND_DIR makes every proposal be skipped as disallowed, and a differing workspace config can block a valid destination or apply a different policy than the CLI. Tests always install a second Jira policy in the workspace, hiding this.
    Remediation: for FULLSEND_TRACKER=jira, resolve the allowlist/primary project from FULLSEND_DIR with the CLI's layering (or enforce the paths coincide); add a test with config only under FULLSEND_DIR.
  • [protected-path] scripts/ — The PR modifies protected paths (19 of 20 files under scripts/). The description explains the rationale and references Add JIRA support to the retro agent fullsend#2267 (cross-repo, not fetched), but human approval is always required for protected-path changes.

Low

  • [pattern-inconsistency] scripts/post-retro.src.sh:234 — is_target_allowed() runs yq on CONFIG_FILE/BASE_CONFIG_FILE per proposal and duplicates primary-project extraction across branches, unlike the parse-once pattern used elsewhere in the script.
    Remediation: resolve the primary project once from TRACKER_JSON and drop the per-call yq reads.
  • [api-shape] scripts/lib/jira-retro-ops.lib.sh:416 — forge_issue_url_base and forge_normalize_labels are defined but never called by retro and are not part of the github/gitlab retro ops interface.
    Remediation: remove the unused functions.
  • [doc-style] scripts/pre-retro.src.sh:13 — Header comment omits the Jira variables enforced by jira-retro-ops.lib.sh (JIRA_BASE_URL, RETRO_JIRA_PROJECT unless RETRO_MODE=summary_only).
    Remediation: document them or reference scripts/lib/jira-retro-ops.lib.sh.

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.

@waynesun09 waynesun09 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.

Review findings on the Jira support for the retro agent: 1 high, 3 medium. Each one is an inline comment below.

Comment thread scripts/post-retro.src.sh Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Comment thread scripts/post-retro.src.sh Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Follow-up to the review of fullsend-ai#2109. Each item below is a small robustness or
consistency fix; no behavior change for the existing forge paths.

- Guard the two unchecked `mv` calls in the Jira context writer. They run
  under `if !`, so errexit is off: a failed page accumulation silently lost a
  comment page, and a failed replacement in the byte-trim loop left the file
  over the cap and looped forever.
- Drop the unreachable Jira branch in `forge_get_comment_max_len`. post-retro
  applies the Jira comment cap with `_retro_jira_fit_comment` and only calls
  this function for a forge comment.
- Fix the editmeta comment: the label probe is cached only after a successful
  read, and a failed probe is retried for the next issue.
- Return an error from `forge_validate_originating_url` when JIRA_BASE_URL is
  missing instead of exiting the shell through `:?`.
- Use `-` rather than `:-` in the Jira label gate so an explicitly empty
  RETRO_JIRA_LABELS is not treated as `ready-for-triage`.
- Detect a post-comment 401/403 without relying on the CLI's error prefix, and
  ignore `-NNN` issue-key suffixes and digit runs. fullsend's Jira error text
  was not covered by the previous patterns, which turned a permission failure
  into a fatal exit on a Jira-originated run.
- Remove the originating-issue context file at the end of post-retro, and
  document a per-run RETRO_JIRA_CONTEXT_FILE path so concurrent runs on a
  reused runner cannot delete each other's file.
- Document the four RETRO_JIRA_CONTEXT_* caps in the variables table, and note
  the summary_only caveat in the Jira skill.

Tests: `jira/originating-issues-only-no-comment` asserts no Jira comment in
issues_only mode; `jira/originating-comment-401-graceful` drives a mocked 401
through a format the old regex missed and expects the warning path;
`jira/originating-context-file-gone` asserts post-retro removes the file.

Signed-off-by: anevans <anevans@redhat.com>
@andrewevansrh

Copy link
Copy Markdown
Contributor Author

Follow-up review: fixes committed

I ran another review pass over this branch after the latest changes and found a set of minor robustness and consistency items. No blocking issues. The fixes are committed to this branch in efea22cb (fix(retro): harden Jira context and comment handling from review); the existing forge paths are unchanged.

Findings addressed

  • Unchecked mv calls in the Jira context writer. Both run under if !, so errexit is off: a failed page accumulation silently dropped a comment page, and a failed replacement in the byte-trim loop left the file over the cap and looped forever. Both now clean up and return 1.
  • The Jira branch in forge_get_comment_max_len was unreachable: post-retro applies the Jira comment cap with _retro_jira_fit_comment and only calls that function for a forge comment. Removed.
  • The editmeta label-probe comment claimed the result was always cached; the state is only cached after a successful read and a failed probe is retried for the next issue. Comment corrected.
  • forge_validate_originating_url exited the shell via :? when JIRA_BASE_URL was missing; it now returns an error like every other branch.
  • The Jira label gate used :-, so an explicitly empty RETRO_JIRA_LABELS read as ready-for-triage. Now uses -, matching the library and the documented "set empty for no labels".
  • Post-comment 401/403 detection relied on CLI error prefixes and did not cover fullsend's Jira error text, so a permission failure became a fatal exit on a Jira-originated run. It now matches a standalone status code (ignoring -NNN issue-key suffixes) plus unauthorized/forbidden, case-insensitively.
  • The originating-issue context file was left on disk after the run. post-retro now removes it, and the docs recommend a per-run path so concurrent retros on a reused runner cannot delete each other's file.
  • Documented the four RETRO_JIRA_CONTEXT_* caps in the variables table and noted the RETRO_MODE=summary_only caveat in the Jira skill.

Verification

make check-bundle, make lint, pre-commit (including shellcheck), and the full scripts/post-retro-test.sh and scripts/pre-retro-test.sh suites pass. Three new tests lock the fixes: jira/originating-issues-only-no-comment, jira/originating-comment-401-graceful (fails under the previous regex), and jira/originating-context-file-gone (fails without the cleanup).

Note: Generated with assistance from Gemini

@waynesun09 waynesun09 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.

Two findings from a review-only pass at 69cd0e5, both inline.

Comment thread skills/retro-analysis/jira/SKILL.md Resolved
Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Jira createmeta reports `reporter` as required with no default for an
account that holds Modify Reporter permission, even though Jira fills
the field with the calling account when the create omits it. The
preflight treated that as a field retro cannot satisfy, so every
proposal was reported as not filed with "requires fields retro does
not set: reporter".

Add `reporter` to the exempt list and cover it with a post-retro
fixture where reporter is required without a default.

Also reword the Jira skill so it no longer names `RETRO_MODE`, which
the harness does not pass into the sandbox; naming it failed
skill-env-reachability-test.

Signed-off-by: anevans <anevans@redhat.com>
`_retro_jira_write_context` accepted any `RETRO_JIRA_CONTEXT_FILE` value,
but `harness/retro.yaml` mounts that value as a host path and the docs
call it an absolute path. A relative value wrote the file under the
script's working directory, passed the `-s` check, and left the sandbox
mount pointing somewhere else, so the agent ran without the originating
issue — the failure the surrounding fail-closed checks exist to prevent.
Require an absolute path and cover it in `pre-retro-test.sh`.

`RETRO_JIRA_PROJECT` also fell back to `JIRA_PROJECT`, which nothing in
this repo sets and no doc mentions. Drop the alias so the project key
comes only from the documented variable.

While here, the library header now lists the four documented
`RETRO_JIRA_CONTEXT_*` knobs it validates and uses.

Signed-off-by: anevans <anevans@redhat.com>
@andrewevansrh

Copy link
Copy Markdown
Contributor Author

Review findings (fixed in 016bc42e)

A fresh review pass over the PR's 29 files turned up three defects. All three are fixed in 016bc42e, with the two behavior-relevant ones covered by tests.

1. A relative RETRO_JIRA_CONTEXT_FILE let a Jira-originated run proceed without its context (fail-open)

_retro_jira_write_context only rejected an empty value. harness/retro.yaml mounts that value as a host path (src: ${RETRO_JIRA_CONTEXT_FILE}) and docs/retro.md calls it an absolute path, but nothing enforced it. With a relative value, pre-retro wrote the file under its own working directory, its -s check passed, and the sandbox mount expanded to a different path — so the agent ran the retrospective with no originating issue, which is exactly the outcome the surrounding fail-closed checks ("a retrospective that cannot read its subject would file proposals it cannot substantiate") exist to prevent.

_retro_jira_write_context now requires an absolute path, and scripts/pre-retro-test.sh covers it with jira-context-relative-path-fails.

2. RETRO_JIRA_PROJECT silently fell back to an undocumented JIRA_PROJECT

RETRO_JIRA_PROJECT="${RETRO_JIRA_PROJECT:-${JIRA_PROJECT:-}}" read a second name that appears nowhere in this repo (no harness, env file, provider, script or doc sets it) and nowhere in the docs table or the library header. A leftover alias on a security-relevant input invites an unrelated variable of that name to pick the destination project. The fallback is gone; the project key comes only from the documented variable.

3. The library header omitted the four RETRO_JIRA_CONTEXT_* knobs it validates

jira-retro-ops.lib.sh validates RETRO_JIRA_CONTEXT_MAX_BYTES, _MAX_PAGES, _COMMENT_CHARS and _DESCRIPTION_CHARS at source time (they exit 1 on a bad value) and docs/retro.md documents all four, but the file's own "Optional env vars" list named only RETRO_JIRA_CONTEXT_FILE. Added, with their defaults.

Verification

  • scripts/pre-retro-test.sh, scripts/post-retro-test.sh, scripts/jira-auth-test.sh, scripts/skill-env-reachability-test.sh: pass.
  • make script-build regenerated pre-retro.sh and post-retro.sh; make check-bundle passes.
  • make lint (skillsaw, strict) and shellcheck -x over the changed scripts: clean.

Checked and left alone

  • Allowlist state machine (tracker merge, multi-provider mapping, base-layer project not resurrected, primary project permitted): matches docs/retro.md.
  • REST routing (<api_url>/ex/jira/<cloudId>/rest/api/3, base_url/JIRA_BASE_URL tenant check, _retro_jira_init caching in the main shell): matches the CLI's routing, and the context writes/trims/--slurpfile paths ignore mkdir/mv failures only where they return non-zero.
  • Size caps: body (32768 bytes, footer preserved), summary comment (32000 bytes with headroom for marker neutralization) and summary title (255 code points, whitespace collapsed) all measured in the unit the CLI/Jira enforces.
  • Shared jira-auth.lib.sh change: the GITHUB_ACTIONS gate and _jira_auth_gha_mask are correct, and each bundle's diff is regeneration only.
  • scripts/lib/jira-scribe-ops.lib.sh has the same reporter createmeta behaviour fixed here for retro, but it is pre-existing and outside this PR; it should get its own change rather than widen this one.

Note: Generated with assistance from Gemini

@waynesun09 waynesun09 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.

Two MEDIUM findings from a review-only pass, posted inline.

Comment thread scripts/lib/jira-retro-ops.lib.sh Resolved
Comment thread scripts/post-retro.src.sh Resolved
@waynesun09

Copy link
Copy Markdown
Member

/ok-to-test 016bc42

@github-actions

Copy link
Copy Markdown

Functional tests authorized for 016bc42ee18af96452b87566acec68e9b09cd2e3 (run). A new push needs a new /ok-to-test <sha>.

efea22c widened the post-comment 401/403 detection to match the words
"unauthorized" and "forbidden" for every target, so an unrelated GitHub or
GitLab failure whose text happens to contain "forbidden" was downgraded from a
fatal error to a warning.

Keep the narrow `HTTP (401|403)|error: (401|403)` match for forge comment
targets and apply the word/bare-status match only when the comment target is
Jira, which is what `forge_post_comment` already uses to route the call. Add a
post-retro test that a GitHub failure containing "forbidden" but no HTTP 403
still exits 1.

Signed-off-by: anevans <anevans@redhat.com>
@waynesun09

Copy link
Copy Markdown
Member

/ok-to-test c497b65

@github-actions

Copy link
Copy Markdown

Functional tests authorized for c497b65115403f8fe761eeb5efe823dd8e1dce16 (run). A new push needs a new /ok-to-test <sha>.

@waynesun09 waynesun09 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.

Approving at c497b65. The 401/403 fix keeps the narrow HTTP pattern for GitHub and GitLab and applies the word match only to Jira targets, with a regression test; post-retro and bundle tests pass locally, and CI is green (one script-test flake passed on re-run). The live Jira run is tracked in #2168. Please add the docs/retro.md note that the Jira-originated path is not yet live-verified, here or in #2168.

@waynesun09
waynesun09 added this pull request to the merge queue Nov 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 23, 2026
@waynesun09

Copy link
Copy Markdown
Member

The merge queue dropped this on a script-test failure: jira/client-credentials-creates-issue, -bearer-auth and -resolves-cloud-id-once fail in 2 of the 3 CI runs on c497b65 (they pass locally and passed on 016bc42).

Cause: the new curl mock in scripts/post-retro-test.sh answers the https://auth.atlassian.com/oauth/token call without reading stdin. _jira_auth_mint_now pipes the request body from jq into curl --data @-, so when the mock exits before jq writes, jq fails with writing output failed: Broken pipe and, under pipefail, the mint reports curl exit 2. The other Jira test mocks already drain stdin there (post-triage-test.sh, pre-scribe-test.sh).

Fix: add cat > /dev/null as the first line of the token branch in the post-retro mock (before both the JIRA_MOCK_TOKEN_FAIL and the success printf). I'll approve again and re-queue once that is in and CI is green.

@waynesun09

Copy link
Copy Markdown
Member

/fs-fix-stop

@github-actions github-actions Bot added the fullsend-no-fix Skip bot-triggered fix agent runs label Nov 23, 2026
@github-actions

Copy link
Copy Markdown

Fix agent disabled for this PR. Remove the fullsend-no-fix label or use /fs-fix to re-engage.

The post-retro curl mock answered the `https://auth.atlassian.com/oauth/token`
call without reading stdin. `_jira_auth_mint_now` pipes the request body from
`jq` into `curl --data @-`, so when the mock exits before jq writes, jq fails
with `writing output failed: Broken pipe` and, under `pipefail`, the mint
reports a non-zero curl exit. That made
`jira/client-credentials-creates-issue`, `-bearer-auth` and
`-resolves-cloud-id-once` fail intermittently in CI.

Drain stdin as the first step of the token branch, before both the
`JIRA_MOCK_TOKEN_FAIL` and the success `printf`, matching the other Jira test
mocks (`post-triage-test.sh`, `pre-scribe-test.sh`).

Signed-off-by: anevans <anevans@redhat.com>
@waynesun09

Copy link
Copy Markdown
Member

/ok-to-test 38e5f34

@github-actions

Copy link
Copy Markdown

Functional tests authorized for 38e5f3492b206013e148f9ed6c96648da2d7c3b4 (run). A new push needs a new /ok-to-test <sha>.

@waynesun09
waynesun09 added this pull request to the merge queue Nov 23, 2026
@andrewevansrh

andrewevansrh commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Confirmed and fixed in 38e5f34.

_jira_auth_mint_now (scripts/lib/jira-auth.lib.sh:182-189) builds the token body as jq -cn ... | curl ... --data @-, so a mock that answers and exits without reading stdin leaves jq writing into a closed pipe. Under set -o pipefail the pipeline then reports jq's non-zero status (141/SIGPIPE here, 2 from writing output failed: Broken pipe in CI) as the mint's exit, which is where the "curl exit 2" errors came from.

scripts/post-retro-test.sh now drains stdin as the first statement of the token branch, ahead of both the JIRA_MOCK_TOKEN_FAIL failing response and the success printf, matching post-triage-test.sh and pre-scribe-test.sh. It is the only branch in that mock fed a body on stdin: the token mint is the only --data @- call in the Jira libs, and the other Jira mocks in this PR (scripts/jira-auth-test.sh, scripts/pre-code-jira-test.sh) already drain.

Verification on 38e5f34:

  • script-test passes (14m48s), and the job log shows All post-retro tests passed. for both the source and bundled targets.
  • test, skillsaw, commit-lint and DCO pass.
  • pre-commit run --files scripts/post-retro-test.sh (shellcheck, EOF, whitespace, secrets) passes locally. No bundle rebuild: post-retro-test.sh is not a bundle source.

The one red functional-tests-complete entry is the check run created before your /ok-to-test 38e5f349...; authorization landed at 22:34 and its re-run completed success on the same SHA at 22:34:41, so the gate is satisfied and nothing further is needed there.

Note: Generated with assistance from Gemini

Merged via the queue into fullsend-ai:main with commit d0a3983 Nov 23, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fullsend-no-fix Skip bot-triggered fix agent runs requires-manual-review Review requires human judgment risk/elevated PR risk: elevated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants