fix(#59): recognize tilde code fences in parse_update_instructions - #60
Conversation
The code fence detection added in PR #58 for issue #57 only handled backtick fences (```). Tilde fences (~~~) are equally valid per the CommonMark spec but were not recognized, causing lines matching the file-pattern inside ~~~ blocks to be incorrectly extracted as per-file instructions instead of preserved as global instructions. Extend the fence detection condition to also match lines starting with ~~~. Add two test cases: one for basic tilde fences and one for tilde fences with a language specifier. Closes #59
|
🤖 Finished Review · ✅ Success · Started 11:05 AM UTC · Completed 11:15 AM UTC Commit: |
ReviewFindingsLow
Labels: PR fixes a bug in comment parsing (tilde code fence recognition) in Python source files |
| # Toggle code fence state on lines starting with triple backticks | ||
| # (handles language specifiers like ```python) | ||
| if stripped.startswith("```"): | ||
| # or triple tildes (handles language specifiers like ```python) |
There was a problem hiding this comment.
[low] edge-case
The fence toggle treats backtick and tilde delimiters interchangeably: a block opened with ``` can be closed by ~~~ and vice versa. Per CommonMark, a closing fence must use the same character as the opener. In practice this is unlikely in user comments and was already a pre-existing limitation for nested backtick fences of different lengths.
Suggested fix: Track which fence character opened the block (e.g., store the delimiter in a variable instead of a boolean) and only toggle off when the same character is encountered.
|
🤖 Finished Retro · ✅ Success · Started 12:01 PM UTC · Completed 12:11 PM UTC Commit: |
Retro: PR #60 — Tilde code fence supportPR #60 was a fully agent-driven lifecycle: the retro agent on PR #58 identified a gap (tilde fences not handled), filed issue #59, the triage agent confirmed it, the code agent implemented the fix, the review agent approved with one valid low-severity finding, and a human merged it. Total time: ~76 minutes from issue creation to merge. Timeline
Key findings1. False-positive skip (corroborates fullsend-ai/fullsend#5900). The code agent's 2. Review agent quality was strong. The review agent identified a real CommonMark compliance issue: the fence toggle uses a boolean that treats backtick and tilde delimiters interchangeably, allowing a block opened with 3. No human review comments. The human reviewer merged the PR without adding review comments. The review agent's analysis was the only substantive review performed, and it caught a finding the code agent missed. This suggests strong review agent performance for small, well-tested bug fixes in this repo. 4. Three-level agent improvement chain. Issue #57 → PR #58 → retro creates issue #59 → PR #60. The retro agent's ability to identify gaps in its own prior work product and file follow-up issues demonstrates effective autonomous improvement loops. The only human intervention in this chain was the Proposals filed
|
Summary
parse_update_instructions()insrc/comments.pyto recognize tilde code fences (~~~) in addition to backtick fences (```), per the CommonMark spectests/test_comment_parsing.py: basic tilde fence and tilde fence with language specifierContext
PR #58 added code fence tracking to prevent
filename.ext: textlines inside fenced code blocks from being misclassified as per-file instructions. However, it only handled backtick fences. Tilde fences (~~~) are equally valid CommonMark delimiters and were not detected, leaving the same bug class open for tilde-fenced blocks.Testing
test_comment_parsing.pypass, including 2 new tilde fence testsruff checkpasses with no warningsCloses #59
Post-script verification
agent/59-tilde-code-fence-support)52290e8f55a69f5cddf0920ee6b95718b6f30fff..HEAD)