Skip to content

chore(code): record Jira origin in PR metadata - #2178

Open
Aliciapet11 wants to merge 12 commits into
mainfrom
feat/aisdlc-835-fix-jira-context
Open

Aliciapet11 wants to merge 12 commits into
mainfrom
feat/aisdlc-835-fix-jira-context

Conversation

@Aliciapet11

@Aliciapet11 Aliciapet11 commented Nov 25, 2026 •

Copy link
Copy Markdown

Fix agent runs need a reliable way to distinguish Jira-originated PRs from PRs that merely mention a Jira ticket.

This change adds a hidden fullsend:work-item record to the managed verification footer of new Jira-originated GitHub PRs and GitLab MRs. It contains the source tracker, issue key, and URL. Tests verify that fix-agent description updates preserve the record and incidental Jira links do not create one.

This is a prerequisite for AISDLC-835. Reading Jira context during fix runs will follow separately. Existing PRs are not backfilled.

Validation:

  • Post-code shell suite and all 157 fix-result tests passed.
  • Bundle consistency, pre-commit checks, and lint passed.
  • Full make test is in progress; its result will be updated when the run finishes.

Persist the source tracker, key, and URL in the managed PR/MR footer.
Cover both forges, incidental Jira links, and preservation by fix updates.

Related to AISDLC-835.

Signed-off-by: apetruni <apetruni@redhat.com>
@Aliciapet11
Aliciapet11 requested a review from a team as a code owner November 25, 2026 13:05
@qodo-code-review

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

Copy link
Copy Markdown

PR Summary by Qodo

Record Jira origin in new PR and MR metadata

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Record Jira source, key, and URL in new Jira-originated PR and MR verification footers.
• Preserve origin metadata through fix-agent description updates without marking incidental Jira
 links.
• Document the creation-only behavior and test both forges and repeated fix updates.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 3 capabilities

  • 3 affected capabilities span independent functional scopes: Fix-agent PR/MR metadata integration, Jira-to-code agent integration.
  • The validation is on the Jira code-run path before repository processing and push, so the affected end-to-end outcome is publication of the generated branch and PR/MR, not an independent implementation layer.
  • The producer writes the Jira origin record into the managed footer and later metadata processing preserves that same record; these are producer and consumer hops of one provenance behavior.
  • This behavior independently updates a live PR/MR description after a fix run, preserving closing references, verification content, and Jira origin metadata while leaving title handling separate.
Sources

scripts/post-code.sh[3873-3876]

# Reject inconsistent Jira identity before repository processing or any push.
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
  validate_jira_work_item_identity || exit 1
fi

scripts/post-code.sh[4896-4903]

# Keep the originating work item in the managed footer so later fix runs
# can distinguish Jira-originated work from an incidental link in the body.
WORK_ITEM_ORIGIN=""
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
  WORK_ITEM_ORIGIN="$(jq -nr --arg key "${WORK_ITEM_KEY}" --arg url "${WORK_ITEM_URL}" \
    '{source: "jira", key: $key, url: $url} | tojson | gsub("<"; "\\u003c") | gsub(">"; "\\u003e")')"
  WORK_ITEM_ORIGIN=$'\n'"<!-- fullsend:work-item ${WORK_ITEM_ORIGIN} -->"
fi

scripts/post-code.sh[4815-4835]

_WORK_ITEM_STRIP_JQ='gsub(
  "(?<keep>"
  + "\\\\[\\\\`]"
  + "|(?<![^\\n]) {0,3}(?<bf>`{3,})[^\\n`]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<bf>[`~]*[ \\t]*(?![^\\n])"
  + "|(?<![^\\n]) {0,3}(?<tf>~{3,})[^\\n]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<tf>[`~]*[ \\t]*(?![^\\n])"
  + "|<!--(?!\\s*fullsend:work-item\\b)(?:(?!<!--\\s*fullsend:work-item\\b)[\\s\\S])*?(?:-->|(?=<!--\\s*fullsend:work-item\\b)|\\z)"
  + "|<\\?[\\s\\S]*?\\?>"
  + "|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
  + "|<![A-Za-z]+\\s[^>]*>"
  + "|</[A-Za-z][A-Za-z0-9-]*\\s*>"
  + "|<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s\"\\x27=<>`]+|\\x27[^\\x27]*\\x27|\"[^\"]*\"))?)*\\s*/?>"
  + "|<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\\s<>]*>"
  + "|<[A-Za-z0-9.!#$%&\\x27*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>"
  + "|(?<!`)(?<t>`+)(?!`)[^\\n]*?(?<!`)\\k<t>(?!`)"
  + ")|<!--\\s*fullsend:work-item\\b(?:[\\s\\S]*?-->)?"
  ; (.keep // ""); "i")'
while :; do
  _commit_body_clean="$(printf '%s' "${COMMIT_BODY}" | jq -Rrs "${_WORK_ITEM_STRIP_JQ}")"
  [ "${_commit_body_clean}" = "${COMMIT_BODY}" ] && break
  COMMIT_BODY="${_commit_body_clean}"
done

scripts/process-fix-result.py[1181-1209]

def scan_public_text(text):
    """Scan text bound for a public PR/MR description with gitleaks.

    Returns "clean", "found" or "error" ("error" covers a missing scanner).
    Built-in rules only, as in post-code's scan_public_text: a file source skips
    .gitleaks.toml discovery, and the private working directory and explicit
    ignore path prevent .gitleaksignore discovery. No scanner output is kept,
    since even a failure may echo sensitive input.
    """
    binary = os.environ.get("GITLEAKS_BIN") or shutil.which("gitleaks")
    if not binary:
        return "error"
    env = {k: v for k, v in os.environ.items() if k not in ("GITLEAKS_CONFIG", "GITLEAKS_CONFIG_TOML")}
    try:
        with tempfile.TemporaryDirectory() as scan_dir:
            path = os.path.join(scan_dir, "text")
            with open(path, "w") as f:
                f.write(text + "\n")
            result = subprocess.run(
                [
                    binary, "detect", "--source", path, "--no-git", "--redact",
                    "--exit-code", "2", "--ignore-gitleaks-allow",
                    "--gitleaks-ignore-path", scan_dir,
                ],
                cwd=scan_dir, env=env, capture_output=True, check=False,
            )
    except OSError:
        return "error"
    return {0: "clean", 2: "found"}.get(result.returncode, "error")
Behavioral complexity 🟡 Medium 🧩 Multiple interactions

  • Before: Jira identity validation was tied to Jira writes and descriptions used simpler origin handling.
  • After: identity validation gates publication, origin records are created in a managed footer, and agent text is normalized with Markdown, HTML, multiline, nested, and repeated-removal cases.
  • New correctness conditions are that valid and invalid identity states take different pre-push paths, only live comments are removed, code examples remain literal, and the managed record is neither duplicated nor relocated.
  • The transformation uses a large ordered jq expression and repeated normalization, introducing interacting parsing and preservation cases rather than a straightforward mapping.
Sources

scripts/post-code.sh[3873-3876]

# Reject inconsistent Jira identity before repository processing or any push.
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
  validate_jira_work_item_identity || exit 1
fi

scripts/post-code.sh[4896-4903]

# Keep the originating work item in the managed footer so later fix runs
# can distinguish Jira-originated work from an incidental link in the body.
WORK_ITEM_ORIGIN=""
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
  WORK_ITEM_ORIGIN="$(jq -nr --arg key "${WORK_ITEM_KEY}" --arg url "${WORK_ITEM_URL}" \
    '{source: "jira", key: $key, url: $url} | tojson | gsub("<"; "\\u003c") | gsub(">"; "\\u003e")')"
  WORK_ITEM_ORIGIN=$'\n'"<!-- fullsend:work-item ${WORK_ITEM_ORIGIN} -->"
fi

scripts/post-code.sh[4815-4835]

_WORK_ITEM_STRIP_JQ='gsub(
  "(?<keep>"
  + "\\\\[\\\\`]"
  + "|(?<![^\\n]) {0,3}(?<bf>`{3,})[^\\n`]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<bf>[`~]*[ \\t]*(?![^\\n])"
  + "|(?<![^\\n]) {0,3}(?<tf>~{3,})[^\\n]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<tf>[`~]*[ \\t]*(?![^\\n])"
  + "|<!--(?!\\s*fullsend:work-item\\b)(?:(?!<!--\\s*fullsend:work-item\\b)[\\s\\S])*?(?:-->|(?=<!--\\s*fullsend:work-item\\b)|\\z)"
  + "|<\\?[\\s\\S]*?\\?>"
  + "|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
  + "|<![A-Za-z]+\\s[^>]*>"
  + "|</[A-Za-z][A-Za-z0-9-]*\\s*>"
  + "|<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s\"\\x27=<>`]+|\\x27[^\\x27]*\\x27|\"[^\"]*\"))?)*\\s*/?>"
  + "|<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\\s<>]*>"
  + "|<[A-Za-z0-9.!#$%&\\x27*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>"
  + "|(?<!`)(?<t>`+)(?!`)[^\\n]*?(?<!`)\\k<t>(?!`)"
  + ")|<!--\\s*fullsend:work-item\\b(?:[\\s\\S]*?-->)?"
  ; (.keep // ""); "i")'
while :; do
  _commit_body_clean="$(printf '%s' "${COMMIT_BODY}" | jq -Rrs "${_WORK_ITEM_STRIP_JQ}")"
  [ "${_commit_body_clean}" = "${COMMIT_BODY}" ] && break
  COMMIT_BODY="${_commit_body_clean}"
done
Potential damage 🟡 Medium 🩹 Temporary loss

  • A false rejection or validation failure can stop a valid Jira code run before branch publication or PR/MR creation.
  • The failed run has no supported persistent publication effect.
  • Correcting the inputs or reverting the script permits a rerun; no branch or PR/MR created by the rejected run requires repair.
Sources

scripts/post-code.sh[3873-3876]

# Reject inconsistent Jira identity before repository processing or any push.
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
  validate_jira_work_item_identity || exit 1
fi
Assessed commit ea922d3
Diagram

graph TD
  S["Work item source"] --> P["Post-code script"] --> M["Managed footer"] --> G["GitHub PR"] --> F["Fix body merge"]
  M --> L["GitLab MR"] --> F
Loading
High-Level Assessment

Putting origin metadata in the existing managed footer is appropriate: both forges receive it through the current creation path, and fix-result updates already preserve that footer. Inferring origin from Jira links would misclassify forge-originated work; adding separate forge-specific metadata storage would increase integration complexity.

Files changed (5) +54 / -3

Enhancement (2) +20 / -2
post-code.shAdd Jira origin to the generated post-code script +10/-1

Add Jira origin to the generated post-code script

• Adds a JSON work-item comment to the managed verification footer when the resolved source tracker is Jira. Escapes angle brackets in the serialized values.

scripts/post-code.sh

post-code.src.shAdd Jira origin to the post-code source +10/-1

Add Jira origin to the post-code source

• Builds the same conditional work-item comment in the source script so newly created PR and MR descriptions carry Jira origin metadata.

scripts/post-code.src.sh

Tests (2) +28 / -1
post-code-test.shTest origin metadata across forge creation flows +12/-1

Test origin metadata across forge creation flows

• Checks that Jira-originated GitHub PRs and GitLab MRs contain the expected record. Confirms a forge-originated PR retains an incidental Jira link without receiving origin metadata.

scripts/post-code-test.sh

process-fix-result-test.pyTest origin preservation through repeated fix updates +16/-0

Test origin preservation through repeated fix updates

• Verifies that two successive description merges retain exactly one Jira-origin record, the issue reference, and the exposed managed sections.

scripts/process-fix-result-test.py

Documentation (1) +6 / -0
code.mdDocument Jira origin metadata +6/-0

Document Jira origin metadata

• Explains the hidden work-item record, its preservation during fix updates, and why incidental links and existing PRs do not acquire it.

docs/code.md

@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:08 PM UTC · Completed 1:16 PM UTC

Commit: b2a630b · View workflow run →

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

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Agent text can spoof Jira origin ✓ Resolved Bug Security

Resolving commit: e2421b0

Resolution reason
Agent-written fullsend:work-item comments are stripped from the description in
post-code.sh/post-code.src.sh and from proposed descriptions in process-fix-result.py's
build_pr_body; ambiguous origin records block body updates; tests cover forged comments on both
forges.
Description
PR_BODY places agent-controlled DESCRIPTION ahead of the new fullsend:work-item comment
without removing copies of that comment from the description. On a forge-originated run, an
agent-supplied comment can become the only apparent Jira-origin record; on a Jira run, it can appear
before and conflict with the generated record.

2. Fix updates can erase Jira origin ✓ Resolved Bug Correctness

Resolving commit: e2421b0

Resolution reason
managed_sections_exposed() now returns False whenever a fullsend:work-item origin record found in
the current body is not entirely inside the selected verification footer tail (or is altered in the
merged body), so build_pr_body's caller skips the description update with a warning instead of
writing a body that drops the Jira record. Agent-written work-item comments are also stripped from
descriptions.
Description
build_pr_body() preserves the tail beginning at the last ### Post-script verification heading,
rather than preserving the new origin comment independently. If someone adds another such heading
after the genuine footer, a subsequent fix description update selects that later heading and writes
a body without the original Jira record.

3. Mismatched Jira origin reaches new PRs ✓ Resolved Bug Correctness

Resolving commit: e2421b0

Resolution reason
The commit extracts the identity check into validate_jira_work_item_identity() and calls it early in
post-code.sh and post-code.src.sh (right after WORK_ITEM_KEY is set and before repository processing
or any push) when WORK_ITEM_TRACKER is jira, exiting 1 on mismatch. Thus an inconsistent
key/URL/host pair is rejected before the origin metadata is built or any PR/MR is created. Tests
were added to confirm mismatches fail before any push or PR/MR creation.
Description
WORK_ITEM_ORIGIN serializes WORK_ITEM_KEY and WORK_ITEM_URL without checking that the key
identifies the issue in the URL. If those runner values disagree, forge_create_pr publishes the
mismatched record before the Jira comment writer rejects the pair and fails the run.

Grey Divider

Context sources
❌ 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/fullsend (sha: 0e4a1b9a) — View relationship
  Explored: repo: fullsend-ai/react-shopping-cart (sha: ed0e8495) — View relationship
  Explored: repo: fullsend-ai/metrics (sha: 49c0b781) — View relationship
✅ Context preparation
  Past issues: summarized; full text retained for this review
Review mode: Auto: ⚖️ Balanced: Runtime metadata behavior spans forge integrations and fix-result preservation.

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread scripts/post-code.src.sh Resolved
Comment thread scripts/post-code.src.sh Resolved
Comment thread scripts/post-code.src.sh Resolved
@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 25, 2026
@fullsend-ai-review

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

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

Previous run

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

Previous run (2)

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

Previous run (3)

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

Previous run (4)

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, but touches protected script paths exhibiting high historical churn and regression frequency, maintaining moderate risk.

Previous run (5)

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, but touches protected script paths exhibiting high historical churn and regression frequency, maintaining moderate risk.

Previous run (6)

Risk Assessment: moderate (2/5)

Details

Small diff with solid test coverage and no security-sensitive changes, but touches protected script paths with high historical churn and regression frequency, resulting in moderate risk.

@fullsend-ai-review

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

Copy link
Copy Markdown

Review

Findings

Medium

  • [injection-vuln] scripts/post-code.src.sh:1418 — HTML blocks still let agent-written origin records bypass stripping. For example <div> followed by a line holding a backtick-wrapped fullsend:work-item comment is retained: the jq filter consumes the opening tag, then shelters the comment as an inline code span. In CommonMark this is an HTML block, so the comment remains a live hidden origin record. process-fix-result.py has the same gap, so a fix update can publish it too. The latest commit handles backticks inside individual tags/comments/autolinks but not HTML-block content.
    Remediation: Track HTML-block context before recognizing code spans in both implementations (or conservatively remove origin comments wherever literal-code status cannot be established); regenerate scripts/post-code.sh; add creation and fix-update regression tests for a closed <div> block containing a backtick-wrapped origin comment.
  • [logic-error] scripts/post-code.src.sh:1412 — The global case-insensitive flag of the jq gsub also applies to the CDATA alternative, although CommonMark requires literal uppercase CDATA. A lowercase <![cdata[ &lt;!-- fullsend:work-item ... --> ]]> is kept whole by jq, leaving a live work-item comment in the published description, while the Python path removes it. On a Jira-originated PR the extra record makes later fix-agent body updates fail the ambiguous-origin check.
    Remediation: Make the CDATA delimiter case-sensitive while keeping case-insensitive matching for the work-item identifier, regenerate scripts/post-code.sh, and add a regression for lowercase/mixed-case CDATA lookalikes.
  • [protected-path] scripts/post-code.src.sh — This PR modifies protected paths: scripts/post-code-test.sh, scripts/post-code.sh, scripts/post-code.src.sh, scripts/process-fix-result-test.py, scripts/process-fix-result.py, scripts/public-text-scan-test.sh. The description explains the rationale, but human approval is always required for protected-path changes regardless of context.

Low

  • [edge-case] scripts/post-code.src.sh:1418 — The jq inline-code alternative cannot cross a newline, so it deletes legitimate multiline code-span examples that the Python path preserves, making creation and fix normalization inconsistent (the failure direction is safe: content is removed).
    Remediation: Recognize multiline code spans within a paragraph without crossing paragraph/block boundaries, and add the same multiline example to the shell and Python regression cases.
  • [missing-authorization] PR-level — No linked GitHub issue authorizes this change; the PR cites external Jira issue AISDLC-835, which cannot be fetched or verified from the GitHub forge context.

Earlier findings

  • scripts/post-code.src.sh:1421, logic-error — resolved by change (no longer present in the updated code).
  • scripts/process-fix-result.py:1051, logic-error and injection-vuln — resolved by change.
  • scripts/post-code.src.sh:1418, data-exposure — resolved by change.
  • docs/fix.md:118, incomplete-doc — resolved by change.

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

<!-- fullsend:review-findings-v2:eyJ2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has no alternative for ordinary HTML comments, so a backtick inside one opens a code span that shields a live fullsend:work-item record. I reproduced this with the filter and loop at the PR head. The input <!-- note --> <!-- fullsend:work-item {"source":"jira","key":"EVIL-1"} --> (literal backticks) is returned unchanged. Under CommonMark the <!-- opens first, so the record is live metadata, not a code example. An agent-written description or commit body can therefore carry a forged origin record, or a record that competes with the real one. The fix-path masking in process-fix-result.py masks comments before treating backticks as code, so the two paths disagree. The new tests cover only plain inline and fenced examples.
    Remediation: Add an ordinary HTML comment alternative (<!--[\s\S]*?-->) ahead of the inline-code alternative, or reuse the Markdown-aware masking from the fix path. Add regression tests for this payload on GitHub and GitLab, then regenerate scripts/post-code.sh.
  • [protected-path] scripts/post-code.src.sh — This PR modifies protected paths (scripts/post-code.src.sh, scripts/post-code.sh, scripts/process-fix-result.py, scripts/post-code-test.sh, scripts/process-fix-result-test.py, scripts/public-text-scan-test.sh). The description gives a rationale and cites the external Jira ticket AISDLC-835. Human approval is always required for protected-path changes, regardless of context.

Low

  • [missing-authorization] PR-level — This is a non-trivial change to post-code and fix-result processing, and it has no linked repository issue that establishes its scope. The authorization cited is the external Jira ticket AISDLC-835.
    Remediation: Link a repository issue that defines the scope for recording and preserving Jira work-item origin metadata.

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 (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJtaXNzaW5nLWF1dGhvcml6YXRpb24iLCJmaWxlIjpudWxsLCJpZCI6ImZfMjJlMmUxYWUwNTFlMTQ1ZiIsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJpbnRlbnQtY29oZXJlbmNlIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVn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3kifV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmX2NhMzUyZWZhNDFhNWU3MDkiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9mOWJlNjY0ZjlmYzg0NWVlIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfMmYwZmIwODIyOGY4MTc3NCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzU0YTExMzJiMTA5Yzg4OGIiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9kNmVlNjQ4ZjYwMzEwOTY3Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Medium

  • [protected-path] scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-code-test.sh, scripts/process-fix-result.py, scripts/process-fix-result-test.py, scripts/public-text-scan-test.sh — This PR modifies files under the protected scripts/ path. The description explains the rationale (Jira origin metadata, a prerequisite for AISDLC-835), but human approval is always required for protected-path changes, regardless of context.

Low

  • [missing-authorization] PR-level — The change is non-trivial (8 files, ~560 changed lines) and has no linked GitHub issue in this repository. It cites Jira ticket AISDLC-835 as the driver, and its scope matches that description. A maintainer should confirm the Jira ticket is sufficient authorization.
    Remediation: Have a maintainer confirm that AISDLC-835 authorizes this scope, or link a tracking issue in this repository.
Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJzY3JpcHRzL3Bvc3QtY29kZS5zcmMuc2giLCJpZCI6ImZfY2EzNTJlZmE0MWE1ZTcwOSIsImxpbmUiOjE0MjEsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJ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yZjBmYjA4MjI4ZjgxNzc0Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfNTRhMTEzMmIxMDljODg4YiIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2Q2ZWU2NDhmNjAzMTA5NjciLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifV19 -->

Review

Findings

Medium

  • [protected-path] scripts/post-code.src.sh — This PR modifies protected governance/infrastructure paths: scripts/post-code.src.sh, scripts/post-code.sh, scripts/process-fix-result.py, scripts/post-code-test.sh, scripts/process-fix-result-test.py, scripts/public-text-scan-test.sh. The description explains the rationale (recording Jira origin for fix-agent runs, prerequisite for AISDLC-835), but human approval is always required for protected-path changes, regardless of context.
    Remediation: A human maintainer with authority over scripts/ must approve this PR.

Earlier findings

  • scripts/process-fix-result.py:1051, logic-error — resolved: build_pr_body() now removes origin comments before stripping closing keywords and repeats the whole normalization until stable, with tests for split and separated keywords.
  • scripts/process-fix-result.py:1051, injection-vuln — resolved: same normalization reorder; the final merged body is additionally scanned for secrets before publication.
  • scripts/post-code.src.sh:1418, data-exposure — resolved: origin comments are removed from the description before the final normalized-text secret scan, and the scan covers the joined text.
  • scripts/post-code.src.sh:1421, logic-error — resolved: the removal pattern now matches newlines ([\\s\\S]*?), so multiline origin comments go whole; regression test added.
  • docs/fix.md:118, incomplete-doc — resolved: docs describe the second secret scan and origin-record preservation/removal behavior.
Previous run (4)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNjcmlwdHMvcG9zdC1jb2RlLnNyYy5zaCIsImlkIjoiZl9jYTM1MmVmYTQxYTVlNzA5IiwibGluZSI6MTQyMSwiYWN0aW9uY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yJpZCI6ImZfY2EzNTJlZmE0MWE1ZTcwOSIsInN0YXR1cyI6Im9wZW4ifV19 -->

Review

Findings

Medium

  • [injection-vuln] scripts/process-fix-result.py:1051 — Removing origin comments after closing-keyword sanitization can assemble a new issue-closing instruction (e.g. Fi&lt;!-- fullsend:work-item {} -->xes #999 becomes Fixes #999); the normalization loop only checks whitespace stability, and the managed-section checks do not reject the extra closing reference.
    Remediation: Strip origin comments before closing-keyword sanitization and repeat the whole pipeline until the text is unchanged; add a regression test.
  • [logic-error] scripts/process-fix-result.py:1051 — Same code path: Fixes &lt;!-- fullsend:work-item {} -->#999 becomes Fixes #999 and managed_sections_exposed accepts it, contradicting the sanitizer's documented guarantee that agent-added closing keywords are removed. See also: [injection-vuln] finding at this location.
    Remediation: Remove origin comments before stripping closing keywords, or iterate both transformations to a fixed point; add a regression test.
  • [data-exposure] scripts/post-code.src.sh:1418 — The work-item comment removal pass runs after the final description secret scan and the result is not rescanned, so a credential split by &lt;!-- fullsend:work-item {} --> can be reassembled just before publication. The generated scripts/post-code.sh has the same ordering.
    Remediation: Strip origin comments before the final scan, or rescan the transformed description; add a regression test and rebuild the bundle.
  • [protected-path] scripts/ — The PR modifies protected paths (scripts/post-code.sh, scripts/post-code.src.sh, scripts/process-fix-result.py, and test scripts). The description explains the rationale, but human approval is always required for protected-path changes.

Low

  • [logic-error] scripts/post-code.src.sh:1421 — Same ordering problem seen from the correctness side: comment removal happens after the final scan while the footer still reports the final description scan passed. See also: [data-exposure] finding at this location.
    Remediation: Strip work-item comments before the final scan or rescan after normalization; rebuild the bundle and add a regression test.
  • [incomplete-doc] docs/fix.md:118 — The "Updating the PR title and description" section does not mention that description updates preserve the fullsend:work-item origin record, strip agent-written work-item comments, and skip the body update when origin metadata is ambiguous (documented only in docs/code.md).
    Remediation: Document these behaviors in docs/fix.md or link to the docs/code.md bullet.

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 (5)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImluamVjdGlvbi12dWxuIiwiZmlsZSI6InNjcmlwdHMvcHJvY2Vzcy1maXgtcmVzdWx0LnB5IiwiaWQiOiJmXzJmMGZiMDgyMjhmODE3NzQiLCJsaW5lIjoxMDY5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzZWN1cml0eSJ9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImRhdGEtZXhwb3N1cmUiLCJmaWxlIjoic2NyaXB0cy9wb3N0LWNvZGUuc3JjLnNoIiwiaWQiOiJmXzU0YTExMzJiMTA5Yzg4OGIiLCJsaW5lIjoxNDEzLCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJzZWN1cml0eSJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6InNjcmlwdHMvcG9zdC1jb2RlLnNyYy5zaCIsImlkIjoiZl9jYTM1MmVmYTQxYTVlNzA5IiwibGluZSI6MTQxNiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifV19 -->

Review

Findings

Medium

  • [injection-vuln] scripts/process-fix-result.py:1069 — Stripping fullsend:work-item comments after closing-keyword sanitization can assemble a live closing keyword (Fix&lt;!-- fullsend:work-item x -->es #999 becomes Fixes #999) that is never re-sanitized, so an agent-controlled pr_body can make the PR close an unrelated issue on merge.
    Remediation: Strip work-item comments before sanitizing closing keywords, and loop the whole normalization pipeline until the text stops changing. Add a regression test with a keyword split by a work-item comment.
  • [data-exposure] scripts/post-code.src.sh:1413 — The new comment-stripping loop runs after the final description secret scan, so a secret split by &lt;!-- fullsend:work-item x --> is scanned as two fragments but published reassembled while the footer claims the final scan passed. Same ordering in the bundled scripts/post-code.sh; the fix-result path (process-fix-result.py build_pr_body) also strips after relying on the raw-result scan and never rescans the merged body.
    Remediation: Strip before the final scan_public_text call (or rescan the final description), regenerate the bundle with make script-build, and scan the final merged fix-result body before sending it to the forge. Add regression tests with a synthetic token split by an origin comment.
  • [protected-path] scripts/post-code.src.sh — This PR modifies protected paths (scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-code-test.sh, scripts/process-fix-result.py, scripts/process-fix-result-test.py). The description explains the rationale, but human approval is always required for protected-path changes regardless of context.

Low

  • [logic-error] scripts/post-code.src.sh:1416 — The gsub uses jq flags "is"; s does not make . match newlines, so a multiline fullsend:work-item comment leaves its JSON payload and a dangling --> visible in the published description (verified with jq 1.7). Same in scripts/post-code.sh; shell tests cover only single-line comments, and the Python path (DOTALL) behaves differently.
    Remediation: Use a dot-matches-newline flag (e.g. "ip"; "im" also works on jq 1.7), regenerate the bundle, and add a multiline forged-comment test for both forges.

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 (6)

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

Review

Findings

Medium

  • [protected-path] scripts/post-code.sh, scripts/post-code.src.sh, scripts/post-code-test.sh, scripts/process-fix-result-test.py — This PR modifies files under the protected scripts/ path. The description explains the rationale (record Jira origin in the managed PR/MR footer, as a prerequisite for AISDLC-835), but human approval is always required for protected-path changes regardless of context.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Nov 25, 2026
@Aliciapet11

Copy link
Copy Markdown
Author

/fs-fix Verify Qodo’s three findings and fix the confirmed issues:

  1. Agent-written descriptions can inject fullsend:work-item origin comments.
  2. Inconsistent Jira keys and URLs can reach a newly created PR/MR before validation fails.
  3. A later verification heading can cause fix-description updates to drop existing origin metadata.

Use minimal changes, add regression tests for GitHub and GitLab, and run the required checks. Keep this PR scoped to origin metadata; Jira fetching is separate. Keep the PR title and description unchanged.

@fullsend-ai-coder

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

Copy link
Copy Markdown
Contributor

🤖 Finished Fix · ✅ Success · Started 1:37 PM UTC · Completed 1:45 PM UTC

Commit: b2a630b · View workflow run →

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

Drop fullsend:work-item comments from agent-written PR/MR descriptions,
validate the Jira key, URL and base URL before the PR/MR is created, and
keep the origin record when a later verification heading is present.

Regression tests cover GitHub and GitLab. Not run locally: pre-commit
(hook repositories unreachable) and shellcheck (not installed).

Addresses #2178

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

Copy link
Copy Markdown
Contributor

🔧 Fix agent — iteration 1 (human-triggered)

All three findings were confirmed and fixed with regression tests for GitHub and GitLab. Scope stays on origin metadata, and the PR title and description are unchanged. The only other edit is a one-sentence update to docs/code.md. process-fix-result tests pass (165). post-code-test.sh passes the new cases against both the source and the bundle, and the bundle is current. Four unrelated tests in post-code-test.sh fail the same way on the base commit: harness signed-commits and pr-ready checks. pre-commit could not fetch its hook repos (certificate error) and shellcheck is not installed, so I ran gitleaks (scan-secrets), bash -n and a whitespace check by hand.

Fixed (3):

  1. Agent-written descriptions can inject fullsend:work-item origin comments (confirmed) (scripts/post-code.src.sh): post-code now strips fullsend:work-item comments (any spacing/case, multi-line, unclosed openers, repeated until stable) from the agent description before the managed footer is added. build_pr_body in process-fix-result.py does the same for fix-agent pr_body proposals. Regression tests cover GitHub and GitLab for both paths.
  2. Inconsistent Jira keys and URLs can reach a newly created PR/MR before validation fails (confirmed) (scripts/post-code.src.sh): Extracted the key/URL/JIRA_BASE_URL checks into validate_jira_work_item_identity, shared with the Jira comment writer, and call it before the origin record is built, so the run stops before PR/MR creation. GitHub and GitLab tests cover url, key and host mismatches.
  3. A later verification heading can cause fix-description updates to drop existing origin metadata (confirmed) (scripts/process-fix-result.py): _managed_parts now finds the origin record on the line after the first live verification heading and re-inserts it under the preserved tail's heading when a later heading starts the tail. Only a record in that position is preserved. Tests cover build_pr_body plus GitHub and GitLab apply paths.

Tests: passed

CI inspections (1):

  1. project CI (behaviour, behaviour-github-emulator, commit-lint, detect, DCO) (passing, success): All non-dispatch checks on the PR head passed; the remaining checks were skipped.

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 25, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:47 PM UTC · Completed 1:56 PM UTC

Commit: 38c5354 · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot removed the requires-manual-review Review requires human judgment label Nov 25, 2026

@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 pass, posted inline.

Comment thread scripts/process-fix-result.py Outdated
return refs, tail_text


def _origin_marker(current):

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.

[MEDIUM] _origin_marker reads the first verification heading but the tail uses the last, so the Jira origin record can still be dropped (the qodo #3 fix is incomplete)

_origin_marker only looks at the line right after the FIRST live ### Post-script verification heading. _managed_parts keeps the tail from the LAST heading (_managed_tail_start(current, last=True)). post-code.sh does not strip a live verification heading from the agent-written description: the only occurrence in post-code.src.sh is the footer at line 1468.

So take a body with an agent heading in the description, then the genuine footer carrying the record, then a later heading (the qodo #3 scenario). _origin_marker returns "" from the agent heading, and the record is dropped. The reverse case can also happen: a pre-change PR whose description has a live heading with a well-formed marker under it gets that agent-controlled record promoted into the managed tail.

Reproduced: build_pr_body('New description', <agent heading / genuine footer with record / human heading>) returns a body without the record.

Suggestion: take the origin record from the genuine footer, not from the first heading. For example, scan every live verification heading for a _WORK_ITEM_ORIGIN_RE line directly under it and pick the one in, or nearest before, the selected tail. Or decline the update when it is unclear which heading is the footer. Add tests for two cases:

  • a description heading, then the footer, then a later heading (the record is kept)
  • a description heading carrying a marker while the footer has none (nothing is promoted)

Verified: reproduced with a standalone script against process-fix-result.py (RECORD KEPT: False) at 38c5354; raised by: DeepSeek, Claude

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in e2421b0. I removed the first-heading marker recovery. If an existing origin record falls outside the retained footer, the description update is now skipped with a warning, preventing both record loss and promotion of an agent-written marker. Added regression coverage for both scenarios you described, on GitHub and GitLab.

Comment thread scripts/post-code.src.sh Outdated
WORK_ITEM_ORIGIN=""
if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then
# Never publish an identity the Jira write would later reject.
validate_jira_work_item_identity || \

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.

[MEDIUM] The Jira identity check runs after the branch push, so an inconsistent key/URL leaves a pushed branch with no PR/MR

validate_jira_work_item_identity || post_fail_to_issue setup-error ... runs while the PR body is being built (here). By then step 7 has already pushed the agent branch (forge_push_branch at line 1190, force-with-lease at 1219). WORK_ITEM_URL, WORK_ITEM_KEY and JIRA_BASE_URL are all known in the setup block (lines 443-452), where the other external-tracker checks already exit 1 before checkout, scan or push. With a misconfigured identity the run now publishes the branch and then aborts.

The new create-rejects-{url,key,host} tests only assert that no PR/MR was created and no Jira write happened, so they do not catch the push. The earlier qodo thread asked for the check to run before forge_create_pr, which it now does. This finding is about the push that happens before that, which the thread did not cover.

Suggestion: when WORK_ITEM_TRACKER is jira, call validate_jira_work_item_identity in the setup block right after WORK_ITEM_KEY is derived, and exit 1 there. Keep the later call as a defence-in-depth assertion if you want it. Extend the create-rejects-* tests to assert that the forge log has no push. Regenerate scripts/post-code.sh with make script-build.

Verified: read code at head (push at L1190, check at L1455, setup at L443-452) at 38c5354; raised by: Claude, DeepSeek

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in e2421b0. Jira identity validation now runs during setup, after the work-item key is resolved and before repository processing or any push. The URL/key/host mismatch tests now track actual Git pushes and assert no push, PR/MR creation, or Jira write occurs. Regenerated scripts/post-code.sh and verified the tests on both forges.

Reject inconsistent Jira identity during setup before any branch push.
Skip description updates when origin records fall outside the retained
footer, preventing record loss or promotion from agent-written text.

Cover both forges and no-op/failure paths, and use a valid Jira Cloud
URL in the scanner fixture.

Signed-off-by: apetruni <apetruni@redhat.com>
@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:46 PM UTC · Completed 2:56 PM UTC

Commit: e2421b0 · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

@Aliciapet11

Copy link
Copy Markdown
Author

/fs-fix Address the current review findings about Jira-origin metadata handling.

  1. In process-fix-result.py, remove reserved origin comments before stripping closing keywords. Repeat normalization until the entire text stops changing. Add tests for both a split keyword and a comment between the keyword and issue reference.

  2. Ensure secret scanning checks the final normalized content before publication, for both PR creation and fix-agent description updates. Add regression tests using a synthetic credential split by an origin comment.

  3. Correct multiline origin-comment removal in the shell implementation. Test that the entire comment is removed without leaving its payload or closing delimiter visible.

  4. Update docs/fix.md to describe origin preservation, removal of agent-written markers, and skipped ambiguous description updates.
    Keep the existing protection against losing or promoting origin metadata. Cover GitHub and GitLab, regenerate the shell bundle, and run the required checks. Report any checks that could not run.
    Keep this PR focused on metadata creation and preservation. Do not implement Jira-context retrieval or unrelated refactoring. The protected-path finding requires human review; no code workaround is needed.

@fullsend-ai-coder

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

Copy link
Copy Markdown
Contributor

🤖 Finished Fix · ✅ Success · Started 3:28 PM UTC · Completed 3:37 PM UTC

Commit: e2421b0 · View workflow run →

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

Address review feedback on PR #2178 (human /fs-fix).

- process-fix-result.py: remove fullsend:work-item comments before
  stripping closing keywords and repeat the whole normalization until
  the text is stable, so a keyword split by, or separated from its
  reference by, an origin comment is still removed.
- Scan the final normalized description before publication: new
  scan_public_text in process-fix-result.py for fix-agent description
  updates, and post-code now scans after origin removal for PR/MR
  creation. A credential split by an origin comment is no longer
  published.
- post-code: match newlines when removing origin comments (jq "s"
  flag does not make "." match newlines), so multiline comments go
  whole.
- docs/fix.md: document origin preservation, removal of agent-written
  markers and skipped ambiguous description updates.
- Regenerate scripts/post-code.sh.

Checks not run: pre-commit (hook repos unreachable), shellcheck/ruff
(not installed), make targets (sandbox blocks make); the bundle was
regenerated with scripts/bundle-sh.sh directly. post-code-test.sh and
post-fix-test.sh have failures that also occur without these changes
(yq missing, signed-commit/env cases).

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

Copy link
Copy Markdown
Contributor

🔧 Fix agent — iteration 2 (human-triggered)

Addressed all four requested items. Python and shell tests added for each pass locally (process-fix-result-test.py 174 OK; public-text-scan-test.sh all pass). Could not run: make targets (sandbox blocks make; bundle regenerated via scripts/bundle-sh.sh), pre-commit (hook repos unreachable), shellcheck/ruff/skillsaw (not installed). post-code-test.sh (4 failures) and post-fix-test.sh (7 failures) have failures that also occur without these changes (missing yq, signed-commit and env cases). The protected-path finding needs human review; no code workaround was made.

Fixed (4):

  1. Origin comments removed after closing keywords are stripped (scripts/process-fix-result.py): build_pr_body now removes fullsend:work-item comments first and repeats the full origin+keyword normalization until the text stops changing. Tests cover a keyword split by a comment (Fixes chore: update fullsend shim workflow #5) and a comment between keyword and reference, in the build_pr_body tests.
  2. Secret scan does not cover the final normalized content (scripts/process-fix-result.py): Added scan_public_text (gitleaks, built-in rules, mirroring post-code) and apply it to the merged body just before a fix-agent description update on GitHub and GitLab; a found secret or missing scanner skips only the body update. In post-code.src.sh the origin-comment removal now runs before the final description scan, so PR/MR creation scans the normalized text. Regression tests use a synthetic token split by an origin comment (real gitleaks in process-fix-result-test.py, AKIA-style credential in public-text-scan-test.sh for GitHub and GitLab).
  3. Multiline origin-comment removal in shell leaves payload and closing delimiter (scripts/post-code.src.sh): jq flag s does not make . match newlines, so multiline comments were not removed. The pattern now uses [\s\S]*? and the origin-comment loop is applied to COMMIT_BODY. post-code-test.sh adds GitHub and GitLab cases asserting no payload line or extra --> remains. scripts/post-code.sh regenerated with scripts/bundle-sh.sh.
  4. docs/fix.md does not describe origin preservation (docs/fix.md): Documented origin record preservation, removal of agent-written fullsend:work-item markers (before keyword stripping, repeated to stability), skipped ambiguous description updates, and the final-description secret scan, for GitHub and GitLab.

Tests: passed

CI inspections (3):

  1. commit-lint (passing, success): Passed.
  2. DCO (passing, success): Passed.
  3. behaviour-github-emulator (passing, success): All shards passed.

Conflict update: skipped; strategy none; forge MERGEABLE; target main@95c86504a88e7bf4998fbfb903f085f76a4ab7a9

Decision points
  • How to run the final-description scan in process-fix-result.py (alternatives: Rely on the earlier scan of agent-result.json, Scan the merged body in Python just before publishing; rationale: Origin-comment removal can join text split during the earlier scan, so the final merged body must be scanned. The scan reuses the post-code public-text flags.)

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 26, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:41 PM UTC · Completed 3:48 PM UTC

Commit: 917ba43 · View workflow run →

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

@fullsend-ai-review
fullsend-ai-review Bot dismissed stale reviews from themself November 26, 2026 15:48

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Nov 26, 2026

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

The 2 points by @waynesun09 are fixed, I checked both in the code.

Two things block merging:

  1. script-test fails in CI (it passed before this PR). The new secret scan needs gitleaks, CI doesn't have it, so 10 older tests in process-fix-result-test.py fail. They need a fake scanner, like the new tests already do. I got the same failure locally without gitleaks.

  2. There is a conflict with main in scripts/process-fix-result.py.

@Aliciapet11 try run fix with this message (i can do it but its your PR so your call):

“…/fs-fi.. Fix the two problems blocking this PR. Do not open a new PR.

  1. Merge main and resolve the conflict in scripts/process-fix-result.py. Keep both main's changes and this PR's changes.

  2. In scripts/process-fix-result-test.py, make the existing PR description tests pass when gitleaks is not installed. Give them a fake scanner that returns "clean" (the same way the new scan tests fake it). Do not change scripts/process-fix-result.py to make the tests pass.

Do not change the order of the description cleanup or the secret scan, that part is already correct. Run python3 scripts/process-fix-result-test.py without gitleaks on PATH and report the result.״

@fullsend-ai-review fullsend-ai-review Bot removed the requires-manual-review Review requires human judgment label Nov 30, 2026
@Aliciapet11

Copy link
Copy Markdown
Author

Thanks @waynesun09, I’ve addressed your finding in 3f26bfd. Inline and fenced code examples are now preserved and excluded from origin-record detection, with regression tests for GitHub and GitLab. Could you take another look and approve the PR?

@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 pass, posted inline.

a misparsed block must not shelter a comment. text must have normalized
newlines.
"""
masked = _mask_code(text, comment_fill=_COMMENT_FILL)

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.

[MEDIUM] Fix-path masking treats a backtick inside an HTML tag or autolink as code, so a forged work-item record is kept and also missed by the ambiguity check

_live_work_item_spans skips an opener when _mask_code marks its < as code. _mask_code lets a backtick inside an earlier autolink or HTML tag open an inline code span, but CommonMark ranks tags and autolinks above code spans. At head, _strip_work_item_origin returns both of these inputs unchanged, and _work_item_origins returns []:

  • See <https://e.com/`> <!-- fullsend:work-item {"key":"EVIL-7"} --> and `x`
  • See <a title="`"> <!-- fullsend:work-item {"key":"EVIL-6"} --> `x`

GitHub's gfm renderer hides the work-item comment in both cases, so it is a live record and not shown as code. Because the origin count misses it, managed_sections_exposed sees matching origins and allows the update. A fix agent can then publish a second, forged fullsend:work-item record into an existing PR description, which contradicts docs/fix.md ("cannot add, change or promote one"). The comment-with-backtick case is handled correctly on this path; it fails only on the jq creation path, which already has an open thread at post-code.src.sh:1406.

Suggestion: When looking for live work-item openers, let HTML tags and autolinks that start earlier on the line take precedence over inline code spans, as CommonMark does. A simpler option is to mask only fenced and indented code, plus spans that do not overlap a <...> construct. Add both inputs to test_origin_comment_not_sheltered_by_code_lookalikes. The jq filter has the same tag and autolink gap (<a title="`">, <https://e.com/`>), so the fix for the open line-1406 thread should cover those inputs too, not just HTML comments.

_Verified: reproduced: python3 -I script calling _strip_work_item_origin/work_item_origins from head file (UNCHANGED, origins []); gh api markdown -f mode=gfm shows the comment hidden at 3f26bfd; raised by: Claude

self.assertIn(reason, log)
self.assertIn("body not updated", forge.comment_body())

@unittest.skipUnless(_HAVE_GITLEAKS, "gitleaks is not installed")

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.

[MEDIUM] Real-scanner tests are skipped in CI, so the second scan of the joined text is never checked there

test_secret_split_by_origin_comment_not_published, test_clean_description_passes_real_scan and the TestScanPublicText class are all skipUnless(_HAVE_GITLEAKS). script-test.yml never installs gitleaks. The head CI run (script-test 46431076239) reports Ran 235 tests ... OK (skipped=5) for both the source and bundled runs. One property is the point of the second scan: after the origin comments are removed, the scanner sees the halves of a token as contiguous text. No CI test checks it. With scan=0, the fake scanner returns a status without reading the --source file. test_final_description_scan_blocks_body_not_title only proves that a non-zero status skips the body.

Suggestion: Add a fake-scanner test that reads the file passed to --source and asserts that it holds the joined description, with the token halves contiguous once the comment is removed. It should also assert that the agent-result.json scan did not see them joined. This needs no gitleaks. Alternatively, install gitleaks in script-test with scripts/lib/gitleaks-install.lib.sh so the real-scan tests run.

Verified: read code at head; CI log of script-test run 46431076239 shows OK (skipped=5); script-test.yml has no gitleaks install at 3f26bfd; raised by: DeepSeek

@Aliciapet11

Copy link
Copy Markdown
Author

/fs-fix Address Wayne’s two latest findings on this existing PR.

  1. Fix origin-marker detection and stripping in both Python and the shell creation path. Backticks inside HTML comments, HTML tags, or autolinks must not shield genuine fullsend:work-item comments. Cover Wayne’s tag and autolink examples and the review bot’s HTML-comment example. Preserve valid inline and fenced code examples and existing metadata safeguards. Add regression tests for GitHub and GitLab.

  2. Add a test that runs without Gitleaks installed and inspects the actual file passed to the fake scanner via --source. Verify that the original proposal contains separated token fragments, the final scanned text contains them joined after origin-comment removal, and a detected secret prevents the body update. Keep the optional real-scanner tests and production scanning behavior unchanged.

Regenerate the shell bundle, run required checks, and report anything that could not run. Keep the PR focused on origin metadata and leave its title and description unchanged.

@fullsend-ai-coder

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

Copy link
Copy Markdown
Contributor

🤖 Finished Fix · ✅ Success · Started 2:55 PM UTC · Completed 3:02 PM UTC

Commit: 3f26bfd · View workflow run →

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

A backtick inside an HTML comment, tag or autolink opened a code span in
the work-item origin scan, so a live fullsend:work-item comment after it
was kept and missed by the ambiguity check. Skip inline HTML and
autolinks whole when masking code spans in process-fix-result.py and in
the post-code jq filter, as CommonMark does, and regenerate post-code.sh.

Add regression tests for the creation and fix-update paths on GitHub and
GitLab, and a fake-scanner test that reads the --source file to check
the final scan sees the token joined after origin-comment removal.

Addresses #2178

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

Copy link
Copy Markdown
Contributor

🔧 Fix agent — iteration 7 (human-triggered)

Addressed Wayne's two latest findings and the open review-bot finding on HTML comments. Backticks inside HTML comments, tags and autolinks no longer shelter live work-item comments, in the Python fix-update path and the jq creation path. Added regression tests on GitHub and GitLab, plus a no-gitleaks test that reads the file passed to the scanner via --source. process-fix-result-test.py passes (241 tests, 5 skipped without gitleaks, 0 skipped with it). post-code-test.sh passes the new cases, and its 4 other failures (signed-commits harness and pr-ready checks) are unrelated. pre-commit could not fetch its hooks, shellcheck and ruff are not installed, and make is blocked, so I ran bundle-sh.sh, bash -n and py_compile directly. The PR title and description are unchanged.

Fixed (4):

  1. Fix-path masking treats a backtick inside an HTML tag or autolink as code, so a forged work-item record is kept and missed by the ambiguity check (Wayne) (scripts/process-fix-result.py): Inline code-span masking now skips HTML comments, tags and autolinks whole (CommonMark precedence), so a backtick inside one opens no span. Both of Wayne's examples (the autolink and the quoted-attribute tag) are now found as live origins, stripped from agent text and counted by managed_sections_exposed. Backticks that precede or follow the markup still make real code spans, so examples in code are kept.
  2. Same tag and autolink gap in the jq creation-path filter (Wayne) (scripts/post-code.src.sh): The jq filter now consumes ordinary HTML comments, tags, autolinks and processing instructions or declarations before the inline-code alternative, so they cannot shelter a live work-item comment. scripts/post-code.sh was regenerated with scripts/bundle-sh.sh because make is blocked in the sandbox, and it matches a fresh bundle.
  3. Real-scanner tests are skipped in CI, so the second scan of the joined text is never checked there (Wayne) (scripts/process-fix-result-test.py): FakeForge now records the file passed to the scanner via --source. New GitHub and GitLab tests run without gitleaks. They check that the proposal holds the token halves apart and that the scanned text holds the token joined with no origin comment. They also check that a detected secret leaves the body unpublished. The optional real-scanner tests and production scanning are unchanged.
  4. Inline-code exemption in the jq filter has no alternative for ordinary HTML comments, so a backtick inside one shields a live work-item record (scripts/post-code.src.sh) [f_6d8c3ea92fb70a9f, fixed]: The jq filter now has an ordinary HTML comment alternative ahead of the inline-code alternative, as well as tag and autolink alternatives. An unclosed ordinary comment runs to the end of the text or stops before a work-item opener, which is still removed, matching the Python path. Regression tests for the comment, autolink and tag payloads cover creation on GitHub and GitLab, and the fix-update path is covered too. post-code.sh was regenerated.

Disagreed (3):

  1. Closing keyword split by a work-item comment is assembled after sanitization (build_pr_body) [f_2f0fb08228f81774, declined]: Already addressed in an earlier commit: build_pr_body strips origin comments before closing keywords and repeats the whole pipeline until the text is stable, with regression tests. This run did not touch that logic.
  2. Work-item comment removal runs after the final description secret scan [f_54a1132b109c888b, declined]: Already addressed in an earlier commit: origin comments are removed before the final description scan in post-code, and process-fix-result.py scans the merged body before a description update. Regression tests cover both. This run only adds a test that inspects the scanned text.
  3. Multiline work-item comment not removed by the jq filter / removal after final scan [f_ca352efa41a5e709, declined]: Already addressed in an earlier commit: the pattern matches newlines explicitly, and multiline comment tests exist for both forges. Origin-comment removal also runs before the final description scan.

Tests: passed

CI inspections (3):

  1. functional-tests (fix/code) (passing, success): Passing at the previous head.
  2. behaviour-github-emulator (a-e) (passing, success): Passing at the previous head.
  3. commit-lint, DCO (passing, success): Passing at the previous head.

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

Decision points
  • How to stop markup backticks sheltering origin comments (alternatives: Mask only fenced and indented code, Skip inline HTML and autolinks whole before opening code spans; rationale: Skipping inline HTML and autolinks whole follows CommonMark precedence. It keeps the existing example-in-code behavior, since a backtick before the markup still opens a real span.)

Finding threads:

  • f_6d8c3ea92fb70a9f (fixed): replied and resolved — thread

Finding threads that need attention (3):

  1. f_2f0fb08228f81774 (declined): more than one review-bot thread carries this ID; none was changed — thread. Next step: resolve the matching thread manually.
  2. f_54a1132b109c888b (declined): more than one review-bot thread carries this ID; none was changed — thread. Next step: resolve the matching thread manually.
  3. f_ca352efa41a5e709 (declined): more than one review-bot thread carries this ID; none was changed — thread. Next step: resolve the matching thread manually.

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 30, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:05 PM UTC · Completed 3:14 PM UTC

Commit: ac44e71 · View workflow run →

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

fullsend-ai-review[bot]

This comment was marked as outdated.

@Aliciapet11

Copy link
Copy Markdown
Author

@waynesun09, I’ve addressed your two latest findings in ac44e71: HTML-tag/autolink handling is updated, and scanner tests now inspect the actual normalized input without requiring Gitleaks. CI is green.

Integrate current main while preserving Jira origin metadata handling.

Signed-off-by: apetruni <apetruni@redhat.com>
Include the clean-approval re-review changes merged during verification.

Signed-off-by: apetruni <apetruni@redhat.com>
@fullsend-ai-review

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

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:08 AM UTC · Completed 10:17 AM UTC

Commit: ea922d3 · View workflow run →

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

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [logic-error] scripts/post-code.src.sh:1412 — The creation sanitizer keeps fullsend:work-item comments inside CDATA/processing-instruction constructs, while the fix processor (_work_item_origins) counts them as origin records. Example: <![CDATA[\n&lt;!-- fullsend:work-item {} -->\n]]>. A Jira-created PR then has two origin records, and every later fix-agent description update is refused as ambiguous.
    Remediation: Make creation match the fix processor (drop the CDATA/PI/declaration keep alternatives or strip the comment wherever the Python side counts it), add a test running the example through both paths, and regenerate scripts/post-code.sh.

  • [protected-path] scripts/post-code.src.sh — This PR modifies protected paths (scripts/post-code.src.sh, scripts/post-code.sh, scripts/post-code-test.sh, scripts/process-fix-result.py, scripts/process-fix-result-test.py, scripts/public-text-scan-test.sh). The PR body explains the rationale, but human approval is always required for protected-path changes.

Low

  • [edge-case] scripts/post-code.src.sh:1418 — The jq inline-code alternative uses [^\n]*? and cannot span a newline, whereas Markdown code spans and the fix processor can. A literal multiline example loses its work-item comment at creation but keeps it on the fix path.
    Remediation: Let the inline-span alternative cross single newlines within a paragraph (stop at a blank line) and add a creation-path regression test.

  • [injection-vuln] scripts/post-code.src.sh:1418 — Backticks inside a raw HTML block such as <div> are treated as a code span by both parsers, so a forged fullsend:work-item comment inside it survives creation and fix-update stripping, though CommonMark renders it as a hidden HTML comment. No current reader counts it (_work_item_origins masks the same span), so impact is limited today.
    Remediation: Track HTML-block context (or strip origin comments conservatively in ambiguous contexts) in both the jq path and process-fix-result.py; add creation and fix-update regression cases on both forges and regenerate scripts/post-code.sh.

Earlier findings

  • PR-level, missing-authorization — reclassified to informational: the repository supports Jira as a work-item tracker and the PR body states its scope and tracking item (docs/code.md documents the Jira tracker).

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

1 finding(s) below the low severity threshold were not posted.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

Copy link
Copy Markdown

Finding threads left open (3):

  1. Thread: the explanation was posted in this older copy of a finding thread, but it could not be resolved. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  2. Thread: the explanation was posted in this older copy of a finding thread, but it could not be resolved. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  3. Thread: the explanation was posted in this older copy of a finding thread, but it could not be resolved. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.

Outdated review threads left open (6):

  1. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  2. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  3. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  4. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  5. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.
  6. Thread: the review bot could not resolve this outdated thread. Reason: FORBIDDEN: Resource not accessible by integration. Next step: resolve it manually.

@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 on the creation-path work-item stripping filter: both are parser disagreements with CommonMark that leave a live origin record in the rendered description.

Comment thread scripts/post-code.src.sh Outdated
_WORK_ITEM_STRIP_JQ='gsub(
"(?<keep>"
+ "\\\\[\\\\`]"
+ "|(?<![^\\n]) {0,3}(?<bf>`{3,})[^\\n`]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<bf>[`~]*[ \\t]*(?![^\\n])"

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.

[MEDIUM] The fence closer accepts a trailing ~ or backtick, so jq and CommonMark pair fences differently and a live work-item record survives PR creation

The fence alternatives end with \k<bf>[~][ \t]and\k[~]*[ \t]*. So jq treats a ```~ line as the end of a backtick fence, and ~~~`` `` as the end of a tilde fence. CommonMark 4.5 allows only spaces or tabs after a closing fence, so ```~ does not close the fence. After that one disagreement, jq and the renderer pair every later fence differently. A comment that is live text in the rendered page then sits inside what jq treats as code.

Input (one item per line):

intro
```
x
```~
```

<!-- fullsend:work-item {"key":"EVIL-1"} -->

```
y
```

The jq filter returns this text unchanged. cmark-gfm in unsafe mode renders <pre><code>x\n```~\n</code></pre>\n<!-- fullsend:work-item {"key":"EVIL-1"} -->\n<pre><code>y, so the record is a live HTML comment in the published description. That breaks the documented guarantee that the agent cannot add an origin record (docs/code.md:364-367, docs/fix.md:125). The Python fix path also counts it as a live origin, so managed_sections_exposed then refuses every later fix description update. The comment above the filter and the docs claim CommonMark behaviour, but no test renders the output with a real forge renderer. The existing HTML-block, CDATA and multi-line-span threads do not cover this fence-closer mismatch.

Suggestion: make the closer match CommonMark: \k<bf>[ \t](?![^\n])for backtick fences and\k~[ \t](?![^\n])for tilde fences. A simpler and safer option: on the creation path, strip every<!--\s*fullsend:work-itemopener even inside code. Losing a literal example in a new PR description costs little. Add this input as a regression case. Also add a differential test that renders the stripped description with cmark-gfm and checks that nofullsend:work-itemcomment appears outsideor

`.

Verified: reproduced: ran the jq filter extracted from post-code.src.sh (jq 1.7.1, input unchanged), then rendered with cmark-gfm, which shows a live comment at ea922d372; raised by: Claude

Comment thread scripts/post-code.src.sh Outdated
+ "|<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s\"\\x27=<>`]+|\\x27[^\\x27]*\\x27|\"[^\"]*\"))?)*\\s*/?>"
+ "|<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\\s<>]*>"
+ "|<[A-Za-z0-9.!#$%&\\x27*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>"
+ "|(?<!`)(?<t>`+)(?!`)[^\\n]*?(?<!`)\\k<t>(?!`)"

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.

[MEDIUM] The one-line inline-span matcher pairs backticks across lines differently from CommonMark and shelters a live work-item comment

The inline-span alternative (?<!)(?+)(?!)[^\n]*?(?<!)\k<t>(?!)` only matches spans that stay on one line. CommonMark 6.1 lets a code span continue onto the next line of the same paragraph. So the problem is more than the missed multi-line span in the existing LOW thread (r4768001840), which only over-strips. The matcher also pairs backticks differently from the renderer.

Input: x `a\nb` <!-- fullsend:work-item {"key":"EVIL-2"} --> `c` . jq skips the unclosed backtick on line 1 and pairs the backtick after b with the one before c. So it treats the comment as code and keeps it. cmark-gfm renders <p>x <code>a b</code> <!-- fullsend:work-item {"key":"EVIL-2"} --> <code>c</code></p>, which is a live comment. The impact matches the fence case: an agent can plant an origin record at PR creation, and fix-agent description updates can then be blocked as ambiguous. The filter comment says the scan works "left to right, so the earliest construct wins as in CommonMark". That holds only within a single line.

Suggestion: let spans cross single newlines within a paragraph but never a blank line, so they match _mask_span_segment. For example: (?<t>+)(?!)(?:[^\n]|\n(?![ \t]*\n))*?(?<!)\k(?!). Or drop sheltering on the creation path and strip every work-item opener. Add this input as a regression case and check it against cmark-gfm, not only against the Python masker.

Verified: reproduced: ran the jq filter (comment kept), then rendered with cmark-gfm, which shows the comment outside at ea922d372; raised by: Claude

@Aliciapet11

Copy link
Copy Markdown
Author

/fs-fix Address Wayne’s two findings from his latest review:

  1. Fence-closer mismatch:
    chore(code): record Jira origin in PR metadata #2178 (comment)
  2. Multiline inline-span mismatch:
    chore(code): record Jira origin in PR metadata #2178 (comment)

Verify both against the current code and make minimal targeted fixes. Preserve the documented behavior for literal code examples, and keep normalization before the final secret scan.

Add regression tests using Wayne’s exact payloads, including both fence types. Verify with cmark-gfm that sanitized output contains no live fullsend:work-item comment outside code. Cover the overlapping review-agent multiline-example case with the same fix.

Regenerate bundled scripts with make script-build, verify make check-bundle, and run the repository-required tests and lint checks.

Keep this pass limited to these two findings.
Update this PR; do not open a new one.

@fullsend-ai-coder

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

Copy link
Copy Markdown
Contributor

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

Commit: ea922d3 · View workflow run →

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

…in strip

The jq origin-comment filter let a fence closer carry a trailing backtick
or tilde and limited inline code spans to one line, so it paired fences
and spans differently from CommonMark and sheltered live work-item
comments. Closers now take only spaces or tabs, and spans cross single
newlines but not blank lines. Adds creation-path and fix-update
regression tests; scripts/post-code.sh regenerated.

Addresses #2178

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

Copy link
Copy Markdown
Contributor

🔧 Fix agent — iteration 8 (human-triggered)

Fixed Wayne's two findings (fence closer and multiline span) in the jq origin-comment filter, which also resolves the overlapping f_30e5b962b3dcd881, regenerated scripts/post-code.sh, and added regression tests. Unrelated open threads are marked needs_human because the instruction limited this pass. cmark-gfm is not installed in the sandbox and the network is blocked, so the cmark-gfm render check was not run; the payloads were checked against the jq filter and the Python masker only. make could not run (/bin/sh not permitted), so the bundle was regenerated and compared by calling scripts/bundle-sh.sh directly. pre-commit could not fetch hooks, and make lint needs uvx and the network. post-code-test.sh has 4 failures, the same 4 as on the unmodified branch.

Fixed (8):

  1. Fence closer accepts a trailing ~ or backtick, so jq and CommonMark pair fences differently (discussion_r4771681323) (scripts/post-code.src.sh): Verified against the jq filter: a ```~ line closed a backtick fence and ~~~ closed a tilde fence, so later fences were paired differently and a live origin comment stayed. Closers now allow only spaces or tabs after them (backtick fence: \k<bf>, tilde fence: \k~, then [ \t]* to end of line). Added creation-path regression tests with both fence types on GitHub and GitLab, and fix-update tests in process-fix-result-test.py (the Python fence closer was already CommonMark-correct). scripts/post-code.sh regenerated. Normalization still runs before the final secret scan.
  2. Inline-span matcher pairs backticks across lines differently from CommonMark (discussion_r4771681337) (scripts/post-code.src.sh): Verified: the one-line span matcher skipped the unclosed backtick on line 1 and paired the one after b with the one before c, sheltering the live comment. Spans may now cross single newlines but not a blank line, matching _mask_span_segment. Added Wayne's exact payload as a creation-path regression test on both forges and a fix-update test; scripts/post-code.sh regenerated.
  3. Multiline code-span examples removed on creation but kept on fix (overlapping review-agent finding) (scripts/post-code.src.sh) [f_30e5b962b3dcd881, fixed]: Fixed by the same span change: a code span now crosses single newlines within a paragraph, so a multiline literal example is kept on creation as on the fix path. Regression tests added for both forges (creation) and for the Python path.
  4. Outdated origin-comment ordering/closing-keyword threads (f_2f0fb08228f81774, f_54a1132b109c888b, f_ca352efa41a5e709) (scripts/process-fix-result.py) [f_2f0fb08228f81774, needs_human]: Outside this pass: the instruction limited it to the fence-closer and multiline-span findings. Not re-verified or changed here; the thread is outdated, so please confirm it can be resolved.
  5. Origin comment removed after final secret scan (outdated thread) (scripts/post-code.src.sh) [f_54a1132b109c888b, needs_human]: Outside this pass: not re-verified or changed here. The current source scans the description after origin-comment removal, and the thread is outdated, so please confirm it can be resolved.
  6. Multiline work-item comment gsub flags (outdated thread) (scripts/post-code.src.sh) [f_ca352efa41a5e709, needs_human]: Outside this pass: not re-verified or changed here. The thread is outdated, so please confirm it can be resolved.
  7. HTML-block content shelters a work-item comment (scripts/post-code.src.sh) [f_6d8c3ea92fb70a9f, needs_human]: Outside this pass: the instruction limited it to the two fence-closer and multiline-span findings. HTML-block awareness is unchanged and still needs a decision.
  8. CDATA/processing-instruction alternatives differ between creation and fix paths (scripts/post-code.src.sh) [f_10cd016115857288, needs_human]: Outside this pass: the instruction limited it to the two fence-closer and multiline-span findings. The CDATA alternatives are unchanged and still need a decision.

Tests: passed

CI inspections (1):

  1. project CI (checks on ea922d3) (passing, success): No failing project jobs; remaining entries are skipped dispatch jobs.

Conflict update: skipped; strategy none; forge MERGEABLE; target main@9061835aeec30091fe8d2813a8de8782ec5127f4

Decision points
  • How to fix the jq pairing mismatches (alternatives: Strip every work-item opener even inside code, Match CommonMark fence closers and multiline spans; rationale: The instruction asked to preserve literal code examples, so the matcher was corrected rather than removing sheltering.)

Finding threads:

  • f_30e5b962b3dcd881 (fixed): replied and resolved — thread
  • f_30e5b962b3dcd881 (fixed): older copy of the thread; pointed to the newest thread and resolved — thread
  • f_2f0fb08228f81774 (needs_human): older copy of the thread; pointed to the newest thread and resolved — thread
  • f_54a1132b109c888b (needs_human): older copy of the thread; pointed to the newest thread and resolved — thread
  • f_ca352efa41a5e709 (needs_human): older copy of the thread; pointed to the newest thread and resolved — thread
  • f_6d8c3ea92fb70a9f (needs_human): older copy of the thread; pointed to the newest thread and resolved — thread
  • f_10cd016115857288 (needs_human): older copy of the thread; pointed to the newest thread and resolved — thread

Finding threads that need attention (5):

  1. f_2f0fb08228f81774 (needs_human): replied; left open for a human decision — thread. Next step: read the reply, then resolve the thread or rerun /fs-fix <instructions>.
  2. f_54a1132b109c888b (needs_human): replied; left open for a human decision — thread. Next step: read the reply, then resolve the thread or rerun /fs-fix <instructions>.
  3. f_ca352efa41a5e709 (needs_human): replied; left open for a human decision — thread. Next step: read the reply, then resolve the thread or rerun /fs-fix <instructions>.
  4. f_6d8c3ea92fb70a9f (needs_human): replied; left open for a human decision — thread. Next step: read the reply, then resolve the thread or rerun /fs-fix <instructions>.
  5. f_10cd016115857288 (needs_human): replied; left open for a human decision — thread. Next step: read the reply, then resolve the thread or rerun /fs-fix <instructions>.

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 12:38 PM UTC · Completed 12:46 PM UTC

Commit: b7d5c3c · View workflow run →

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

@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate diff size with solid test coverage and no security-sensitive files, balanced against protected script paths with high historical churn and regression frequency, preserving moderate risk.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] scripts/post-code.src.sh — This PR modifies protected paths (scripts/post-code.src.sh, scripts/post-code.sh, scripts/post-code-test.sh, scripts/process-fix-result.py, scripts/process-fix-result-test.py, scripts/public-text-scan-test.sh). The description explains the rationale (a Jira origin record for fix-agent runs, tracked under Jira AISDLC-835), but there is no linked GitHub issue. Human approval is always required for protected-path changes, regardless of context.

Low

  • [injection-vuln] scripts/post-code.src.sh:1418 — The new multi-line inline-code-span alternative in _WORK_ITEM_STRIP_JQ stops only at a blank line, so a span can cross a block boundary such as an ATX heading. A description like `a\n# Heading &lt;!-- fullsend:work-item {...} --> ` is kept whole. CommonMark ends the first paragraph at the heading, so the comment is live outside any code span and a forged origin record can be published beside the trusted one. The same expression is in the bundled scripts/post-code.sh.
    Remediation: Restrict inline-span matching to a single Markdown paragraph, accounting for block boundaries (headings, list items, blockquotes, fences) and not only blank lines. Prefer sharing the paragraph-aware parsing used by the Python implementation. Add creation-path regression tests for each interrupting block type, then rebuild the bundle with make script-build.

Earlier findings

  • scripts/post-code.src.sh:1412, logic-error — resolved: fence closers now accept only the opening fence's character, so ````~and~~~`` no longer close a fence.
  • scripts/post-code.src.sh:1418, edge-case — resolved: the inline-span alternative now matches across a single non-blank newline.
  • PR-level, missing-authorization — reclassified, remains informational (no linked GitHub issue; the work is traced to Jira AISDLC-835).

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

1 finding(s) below the low severity threshold were not posted.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

Comment thread scripts/post-code.src.sh
+ "|<[A-Za-z][A-Za-z0-9-]*(?:\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s\"\\x27=<>`]+|\\x27[^\\x27]*\\x27|\"[^\"]*\"))?)*\\s*/?>"
+ "|<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\\s<>]*>"
+ "|<[A-Za-z0-9.!#$%&\\x27*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>"
+ "|(?<!`)(?<t>`+)(?!`)(?:[^\\n]|\\n(?![ \\t]*\\n))*?(?<!`)\\k<t>(?!`)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] injection-vuln

The new multi-line inline-code-span alternative in _WORK_ITEM_STRIP_JQ stops only at a blank line, so a span can cross a block boundary such as an ATX heading. A description like "a\n# Heading <!-- fullsend:work-item {...} --> " is kept whole; CommonMark ends the first paragraph at the heading, so the comment is live outside any code span and a forged origin record can be published beside the trusted one. The bundled scripts/post-code.sh has the same expression.

Suggested fix: Restrict inline-span matching to a single Markdown paragraph, accounting for block boundaries (headings, list items, blockquotes, fences) and not only blank lines. Prefer sharing the paragraph-aware parsing used by the Python implementation. Add creation-path regression tests for each interrupting block type, then rebuild the bundle with make script-build.

@fullsend-ai-review

Copy link
Copy Markdown

Finding threads left open (1):

  1. Thread: someone other than the review bot commented in the thread. Next step: answer the comment, then resolve the thread when settled.

@Aliciapet11

Copy link
Copy Markdown
Author

@waynesun09 thanks for the careful reviews. I’ve addressed your two latest comments - the fence-closer and multiline inline-span mismatches - in b7d5c3c, with regression coverage for both.

I’d also like to check where we draw the line for this PR. It started as a focused change to record Jira origin metadata, and the iterations have grown into increasingly detailed Markdown parsing behavior. I appreciate the issues being caught, but I’m concerned we’re drifting beyond the original scope.

Could you take a final look and help us agree on what still needs to block merging, versus what we can track separately? I’d like to get this prerequisite wrapped up so we can move forward with the Jira context work. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants