Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Reviewer's GuideCentralizes footnote blockquote-marker stripping in a borrowed, idempotent helper used by definition recognition and existing-block detection, with documented semantics plus property and snapshot coverage for nested, mixed-whitespace, and fenced cases. Flow diagram for unified footnote blockquote normalizationflowchart TD
Input["Footnote pipeline input"] --> Normalize[strip_blockquote_markers]
Normalize --> Definition[matches_definition_prefix]
Normalize --> Existing[has_existing_footnote_block]
Definition --> Recognition["Definition recognition"]
Existing --> Detection["Existing-block detection"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Add the canonical footnote helper for blockquote-prefix normalization. Route existing definition and list detection through it so nested markers and whitespace rules remain consistent.
Cover the canonical helper with generated UTF-8 inputs and pin public footnote processing for single, nested, mixed-depth, and fenced quotes.
989c451 to
05b86a1
Compare
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat o11y, code safety, documentation and validation coverage as in scope). Assessment against linked issues
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline src/footnotes/mod.rs src/footnotes/renumber.rs src/footnotes/lists.rs --items all --type function
printf '\n--- named definitions and likely marker stripping ---\n'
rg -n -C 8 -P '^\s*(pub\(crate\)\s+)?fn\s+(strip_blockquote_markers|is_fence_line|has_existing_footnote_block|matches_definition_prefix)\b|trim_start_matches\s*\(\s*['\''"]>|while.*(?:starts_with|strip_prefix).*['\''"]>'\''|strip_prefix\s*\(\s*['\''"]>'\''' src/footnotes
printf '\n--- helper call sites ---\n'
rg -n -C 3 -P '\bstrip_blockquote_markers\s*\(' src/footnotes
printf '\n--- working-tree change summary ---\n'
git status --short
git diff --check
git diff -- src/footnotes/mod.rs src/footnotes/renumber.rs src/footnotes/lists.rsLength of output: 8076 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- is_fence_line definition and calls ---'
rg -n -C 10 -P '\bis_fence_line\b' -g '*.rs' .
printf '%s\n' '--- source files with blockquote-marker operations outside the canonical helper ---'
rg -n -C 5 -P 'strip_prefix\s*\(\s*['\''"]>'\''|trim_start_matches\s*\(\s*char::is_whitespace|starts_with\s*\(\s*['\''"]>'\''' -g '*.rs' src
printf '%s\n' '--- PR changes relative to main for relevant Rust files ---'
git diff --find-renames origin/main...HEAD -- '*.rs'
printf '%s\n' '--- imports in the fence module(s) ---'
fence_files=$(rg -l -P '\bis_fence_line\b' -g '*.rs' . || true)
if [ -n "$fence_files" ]; then
while IFS= read -r file; do
printf '\n### %s\n' "$file"
sed -n '1,220p' "$file"
done <<< "$fence_files"
fiLength of output: 1129 🏁 Script executed: #!/bin/bash
set -u -o pipefail
printf '%s\n' '--- fence-related Rust symbols ---'
rg -n -i -C 6 -P '\b(?:is_)?fence(?:_line|_marker)?\b|\bin_fence\b|\bfence_state\b' -g '*.rs' . || true
printf '%s\n' '--- blockquote marker operations outside canonical helper ---'
rg -n -i -C 6 -P '(?:strip_prefix|starts_with|trim_start_matches)\s*\([^)]*['\''"]>['\'']' -g '*.rs' src || true
printf '%s\n' '--- complete Rust diff relative to origin/main ---'
git diff --find-renames origin/main...HEAD -- '*.rs' || true
printf '%s\n' '--- Rust paths changed by PR ---'
git diff --name-only origin/main...HEAD -- '*.rs' || true
exit 0Length of output: 164223 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- is_fence_line in base and PR revisions ---'
for revision in origin/main HEAD; do
printf '\n%s\n' "$revision"
git grep -n -E '\bis_fence_line\b' "$revision" -- '*.rs' || true
done
printf '%s\n' '--- fence parser and shared structural blockquote parser ---'
ast-grep outline src/wrap/fence.rs src/wrap/blockquote.rs --items all --type function,method
rg -n -C 10 -P 'fn\s+parse\s*\(|struct\s+(FenceLine|BlockquotePrefix)|impl\s+BlockquotePrefix' src/wrap/fence.rs src/wrap/blockquote.rs
printf '%s\n' '--- imports linking fence parsing to BlockquotePrefix ---'
sed -n '1,105p' src/wrap/fence.rs
sed -n '1,180p' src/wrap/blockquote.rsLength of output: 12105
The current footnotes pipeline has one canonical helper:
Fence detection uses No remaining work is required for this finding. Do not create a follow-up issue. No AI agent prompt is required. Verification used static inspection only. The sandbox policy did not permit execution of repository tests. You are interacting with an AI system. |
Summary
This branch adds one crate-private blockquote-prefix normalizer for the
footnotes pipeline, so nested markers and interleaved whitespace follow one
rule in definition recognition and existing-block detection. It documents the
internal contract and adds property and snapshot coverage to prevent drift.
Closes #357.
Kani is not added: this helper accepts unbounded UTF-8 strings, for which
property tests exercise the relevant invariants more usefully than a bounded
model-checking harness.
Review walkthrough
Validation
make check-fmt,make lint,make typecheck,make test,make markdownlint,make nixie, andmbake validate Makefile: passed.coderabbit review --agent --committed --base origin/main: completed withzero findings.
no-leading-marker property tests.
References
Summary by Sourcery
Centralize blockquote-marker stripping across footnote processing and strengthen coverage for quoted footnote scenarios.
Bug Fixes:
Enhancements:
Documentation:
Tests: