Repository navigation
chore(code): record Jira origin in PR metadata - #2178
Aliciapet11 wants to merge 12 commits into
Conversation
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>
PR Summary by QodoRecord Jira origin in new PR and MR metadata
AI Description
Merge Risk
|
|
🤖 Finished Review · ✅ Success · Started 1:08 PM UTC · Completed 1:16 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.68 |
Code Review by Qodo
1.
|
|
Risk Assessment: moderate (2/5) DetailsModerate 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 runRisk Assessment: moderate (2/5) DetailsModerate 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) DetailsModerate 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) DetailsModerate 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) DetailsModerate 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) DetailsModerate 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) DetailsSmall 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. |
ReviewFindingsMedium
Low
Earlier findings
Next steps:
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeS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CIsImlkIjoiZl9jYTM1MmVmYTQxYTVlNzA5IiwibGluZSI6MTQxNiwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifV19 --> ReviewFindingsMedium
Low
Next steps:
Previous run (6)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOltdfQ== --> ReviewFindingsMedium
|
|
/fs-fix Verify Qodo’s three findings and fix the confirmed issues:
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. |
|
🤖 Finished Fix · ✅ Success · Started 1:37 PM UTC · Completed 1:45 PM UTC Commit: 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>
🔧 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), Fixed (3):
Tests: passed CI inspections (1):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 1:47 PM UTC · Completed 1:56 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.69 |
waynesun09
left a comment
There was a problem hiding this comment.
Two medium findings from a review pass, posted inline.
| return refs, tail_text | ||
|
|
||
|
|
||
| def _origin_marker(current): |
There was a problem hiding this comment.
[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
There was a problem hiding this comment.
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.
| WORK_ITEM_ORIGIN="" | ||
| if [ "${WORK_ITEM_TRACKER}" = "jira" ]; then | ||
| # Never publish an identity the Jira write would later reject. | ||
| validate_jira_work_item_identity || \ |
There was a problem hiding this comment.
[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
There was a problem hiding this comment.
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>
|
🤖 Finished Review · ✅ Success · Started 2:46 PM UTC · Completed 2:56 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.03 |
|
/fs-fix Address the current review findings about Jira-origin metadata handling.
|
|
🤖 Finished Fix · ✅ Success · Started 3:28 PM UTC · Completed 3:37 PM UTC Commit: 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>
🔧 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):
Tests: passed CI inspections (3):
Conflict update: skipped; strategy Decision points
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 3:41 PM UTC · Completed 3:48 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.36 |
Superseded by updated review
Benkapner
left a comment
There was a problem hiding this comment.
The 2 points by @waynesun09 are fixed, I checked both in the code.
Two things block merging:
-
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.
-
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.
-
Merge main and resolve the conflict in scripts/process-fix-result.py. Keep both main's changes and this PR's changes.
-
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.״
|
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
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
[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") |
There was a problem hiding this comment.
[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
|
/fs-fix Address Wayne’s two latest findings on this existing PR.
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. |
|
🤖 Finished Fix · ✅ Success · Started 2:55 PM UTC · Completed 3:02 PM UTC Commit: 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>
🔧 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):
Disagreed (3):
Tests: passed CI inspections (3):
Conflict update: skipped; strategy Decision points
Finding threads:
Finding threads that need attention (3):
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 3:05 PM UTC · Completed 3:14 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.85 |
|
@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>
|
🤖 Finished Review · ✅ Success · Started 10:08 AM UTC · Completed 10:17 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.91 |
|
Risk Assessment: moderate (2/5) DetailsModerate 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. |
ReviewFindingsMedium
Low
Earlier findings
Next steps:
1 finding(s) below the |
|
Finding threads left open (3):
Outdated review threads left open (6):
|
waynesun09
left a comment
There was a problem hiding this comment.
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.
| _WORK_ITEM_STRIP_JQ='gsub( | ||
| "(?<keep>" | ||
| + "\\\\[\\\\`]" | ||
| + "|(?<![^\\n]) {0,3}(?<bf>`{3,})[^\\n`]*\\n(?:[\\s\\S]*?\\n)? {0,3}\\k<bf>[`~]*[ \\t]*(?![^\\n])" |
There was a problem hiding this comment.
[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
| + "|<[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>(?!`)" |
There was a problem hiding this comment.
[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
|
/fs-fix Address Wayne’s two findings from his latest review:
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. |
|
🤖 Finished Fix · ✅ Success · Started 12:27 PM UTC · Completed 12:34 PM UTC Commit: 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>
🔧 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):
Tests: passed CI inspections (1):
Conflict update: skipped; strategy Decision points
Finding threads:
Finding threads that need attention (5):
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 12:38 PM UTC · Completed 12:46 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.73 |
|
Risk Assessment: moderate (2/5) DetailsModerate 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. |
ReviewFindingsMedium
Low
Earlier findings
Next steps:
1 finding(s) below the |
| + "|<[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>(?!`)" |
There was a problem hiding this comment.
[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.
|
Finding threads left open (1):
|
|
@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! |
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-itemrecord 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:
make testis in progress; its result will be updated when the run finishes.