Repository navigation
Improve Rust test fixtures and assertions - #706
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (8)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. Summary
ValidationThe author reports that formatting, lint, typecheck, workflow-contract checks and workspace tests passed sequentially on the final tree. The author also reports that CodeScene passed all six gates on the current head. Docstring Coverage remains unverified; no current-head count or pass result was confirmed. WalkthroughThis change updates test helpers and assertions across inbound decoding, client callbacks and streaming, fragmentation, message assembly, server runtime, and response tests. It replaces several assertion-based checks with propagated or descriptive errors, and uses reusable futures and compile-time non-zero budget construction. ChangesTest Helper and Assertion Updates
Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to No concrete correctness or runtime risk was identified in the test-only changes; the PR is mergeable with normal checks. 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
Full details: Developer DocumentationExplanation Fail the check. The pull request adds the shared internal Resolution Update Count each callback when its future wakes. Comment |
Reviewer's GuideThe PR hardens Rust test code by surfacing setup and assertion failures with context, simplifying redundant checks, replacing lint-suppressed callback and byte-generation patterns, and enforcing non-zero fixture budgets at compile time without changing tested behavior or callback first-poll timing. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
CodeScene’s duplication finding for The original finding was posted as a CodeScene review/check rather than an inline review thread, so this top-level comment records its disposition. |
de891fa to
b8b9da5
Compare
b8b9da5 to
0e1e29a
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@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. Previously failed pre-merge checks
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'HEAD: '; git rev-parse HEAD
printf 'Target exists: '; git rev-parse aeeeea38f26ae9c3265d3ef9677ed0eff2a641c2 || true
printf '\nChanged files on target commit:\n'
git show --format=fuller --stat --no-renames aeeeea38f26ae9c3265d3ef9677ed0eff2a641c2 | head -95
printf '\nRelevant filenames:\n'
fd '^(error_handling\.rs|non_zero\.rs|compile_error\.rs|.*non_zero.*\.stderr|.*non_zero.*\.rs|budget_tests\.rs|budget_enforcement_tests\.rs)$' .
printf '\nCoverage configuration and references:\n'
rg -n -i -C2 'docstring.coverage|docstring_coverage|79\.59|80\.00|documentation coverage|compile_error|trybuild' -g '!Cargo.lock' -g '!*.stderr' . | head -220
printf '\nOutlines:\n'
for f in src/client/tests/error_handling.rs tests/support/non_zero.rs tests/compile_error.rs src/message_assembler/budget_tests.rs; do if test -f "$f"; then echo "== $f"; ast-grep outline "$f" --items all | head -100; fi; doneLength of output: 7085 🏁 Script executed: #!/bin/bash
set -u
printf 'HEAD and parents:\n'; git rev-list --parents -n 1 HEAD
printf '\nRelevant files:\n'; fd '^(error_handling\.rs|non_zero\.rs|compile_error\.rs|.*non_zero.*\.stderr|budget_tests\.rs|budget_enforcement_tests\.rs)$' .
printf '\nCoverage references:\n'; rg -n -i -C2 'docstring.coverage|docstring_coverage|79\.59|80\.00|documentation coverage|trybuild' --glob '!Cargo.lock' --glob '!*.stderr' . | sed -n '1,150p'
printf '\nFile outlines:\n'
for f in src/client/tests/error_handling.rs tests/support/non_zero.rs tests/compile_error.rs src/message_assembler/budget_tests.rs; do if test -f "$f"; then echo "== $f"; ast-grep outline "$f" --items all | sed -n '1,75p'; fi; done
printf '\nTargeted file contents:\n'
for f in src/client/tests/error_handling.rs tests/support/non_zero.rs tests/compile_error.rs src/message_assembler/budget_tests.rs; do if test -f "$f"; then echo "== $f"; nl -ba "$f" | sed -n '1,130p'; fi; done
printf '\nMacro-related uses:\n'; rg -n -C2 'non_zero\.rs|nz!\(|compile_fail|E0080|record_setup' src/client/tests src/message_assembler tests | sed -n '1,195p'Length of output: 29212 🏁 Script executed: #!/bin/bash
set -u
printf 'PR metadata:\n'
gh pr view 706 --repo leynos/wireframe --json headRefOid,baseRefOid,mergeBaseRefOid,statusCheckRollup,files --jq '{headRefOid,baseRefOid,mergeBaseRefOid,checks: [.statusCheckRollup[]? | {name,conclusion,status}],files:[.files[] | {path,additions,deletions}]}' 2>&1 | sed -n '1,180p'
printf '\nChanged callback helper and UI file:\n'
nl -ba src/client/tests/lifecycle.rs | sed -n '1,65p'
nl -ba tests/ui/zero_test_budget.rs
cat tests/ui/zero_test_budget.stderr
printf '\nPR diff callbacks and new compile case:\n'
gh api repos/leynos/wireframe/pulls/706/files --paginate --jq '.[] | select(.filename == "src/client/tests/error_handling.rs" or .filename == "src/client/tests/lifecycle.rs" or .filename == "tests/support/non_zero.rs" or .filename == "tests/compile_error.rs" or .filename == "tests/ui/zero_test_budget.rs") | {filename,patch}' 2>&1 | sed -n '1,205p'
printf '\nLocal documentation/coverage guidance:\n'
rg -n -i -C2 'docstring|coverage threshold|document.*helper|80%' AGENTS.md docs/documentation-style-guide.md .github Makefile | sed -n '1,135p'Length of output: 15430 🏁 Script executed: #!/bin/bash
set -u
printf 'PR metadata and checks:\n'
gh pr view 706 --repo leynos/wireframe --json headRefOid,baseRefOid,statusCheckRollup,files --jq '{headRefOid,baseRefOid,checks: [.statusCheckRollup[]? | {name,conclusion,status}],files:[.files[] | .path]}' 2>&1
printf '\nCheck runs:\n'
gh api repos/leynos/wireframe/commits/aeeeea38f26ae9c3265d3ef9677ed0eff2a641c2/check-runs --jq '.check_runs[] | {name,conclusion,status,details_url}' 2>&1
printf '\nDeclarations introduced in PR (plus immediate preceding doc comments):\n'
gh api repos/leynos/wireframe/pulls/706/files --paginate | python -c '
import json,sys,re
files=json.load(sys.stdin)
for f in files:
patch=f.get("patch","")
if not patch: continue
arr=patch.splitlines()
hits=[]
for i,line in enumerate(arr):
if re.match(r"^\+\s*(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:fn|macro_rules!)\s+",line):
k=i-1
while k>=0 and arr[k].startswith("+") and not arr[k][1:].strip():k-=1
docs=[]
while k>=0 and arr[k].startswith("+") and arr[k][1:].lstrip().startswith(("///","//!")):
docs.append(arr[k][1:].strip());k-=1
hits.append((line[1:].strip(),bool(docs)))
if hits:
print(f["filename"],"added declarations:",len(hits),"documented:",sum(d for _,d in hits))
for decl,doc in hits:print(" ", "DOC" if doc else "UNDOC", decl[:100])
' 2>&1 | sed -n '1,195p'Length of output: 5798 🏁 Script executed: #!/bin/bash
set -u
printf 'Commit metadata:\n'
gh api repos/leynos/wireframe/commits/aeeeea38f26ae9c3265d3ef9677ed0eff2a641c2 --jq '{parents:[.parents[].sha], files:[.files[]|{filename,patch}]}' | sed -n '1,140p'
printf '\nPR comments containing coverage or UI concerns:\n'
gh api repos/leynos/wireframe/issues/706/comments --paginate --jq '.[] | select(.body | test("79.59|Docstring Coverage|compile.failure|zero.test.budget";"i")) | {user:.user.login,body:.body}' | sed -n '1,145p'
printf '\nPR review bodies with metric:\n'
gh api repos/leynos/wireframe/pulls/706/reviews --paginate --jq '.[] | select((.body // "") | test("79.59|Docstring Coverage|80.00";"i")) | {user:.user.login,body:.body}' | sed -n '1,110p'
printf '\nPR inline review comments with metric:\n'
gh api repos/leynos/wireframe/pulls/706/comments --paginate --jq '.[] | select((.body // "") | test("79.59|Docstring Coverage|80.00";"i")) | {user:.user.login,body:.body}' | sed -n '1,110p'Length of output: 22131 🏁 Script executed: #!/bin/bash
set -u
printf 'Function documentation vicinity in new touched files:\n'
nl -ba tests/compile_error.rs | sed -n '1,25p'
nl -ba tests/ui/zero_test_budget.rs | sed -n '1,25p'
printf '\nDoc coverage in previously selected 11 files (simple declaration count with immediate doc comments):\n'
python - <<'PY'
import re
paths = ["src/app/inbound_handler/tests.rs","src/client/tests/error_handling.rs","src/client/tests/lifecycle.rs","src/client/tests/send_streaming_infra.rs","src/client/tests/streaming.rs","src/fragment/tests/adapter_tests.rs","src/message_assembler/budget_enforcement_tests.rs","src/message_assembler/budget_tests.rs","src/message_assembler/tests.rs","src/server/runtime/tests.rs","tests/response.rs"]
total=doc=0
for p in paths:
a=open(p).read().splitlines()
functions=[]
for i,line in enumerate(a):
if re.match(r'^\s*(?:(?:pub(?:\([^)]*\))?|async|unsafe|const)\s+)*fn\s+[A-Za-z_]\w*\b',line):
j=i-1
while j>=0 and (a[j].strip().startswith('#[') or a[j].strip()==''): j-=1
documented= j>=0 and a[j].lstrip().startswith('///')
functions.append((i+1,documented,line.strip()))
total+=len(functions);doc+=sum(x[1] for x in functions)
print(p, len(functions), sum(x[1] for x in functions))
print("Total all declared functions:",total,"documented:",doc)
PY
printf '\nLatest commit function additions:\n'
gh api repos/leynos/wireframe/commits/aeeeea38f26ae9c3265d3ef9677ed0eff2a641c2 --jq '.files[] | [.filename, .status, .patch] | `@tsv`' | grep -E 'tests/compile_error.rs|tests/ui/zero_test_budget.rs|src/client/tests/lifecycle.rs' | cut -c1-700Length of output: 4897 🏁 Script executed: #!/bin/bash
set -u
printf 'CI test job relevant log lines:\n'
gh run view 35954609642 --repo leynos/wireframe --job 107490147090 --log 2>&1 | rg -n -i -C2 'zero_test_budget|compile_tests|compile_error|trybuild|cargo test|test result|error:|unable to' | sed -n '1,155p'
printf '\nPrior pre-merge check scope from review summary:\n'
gh api repos/leynos/wireframe/issues/706/comments --paginate --jq '.[] | select(.user.login == "coderabbitai[bot]") | .body' | rg -n -C2 'Docstring coverage is 79.59|Analyzed 49 functions|Files selected for processing' | sed -n '1,60p'Length of output: 16245
If the original count was 39/49, documenting one function gives 40/49 (81.63%) only if the scope stays fixed. If the two newly touched functions also count and remain undocumented, the result is 40/51 (78.43%). Do not use either conditional calculation as a passing result. AI agent prompt for the remaining work: You are interacting with an AI system. |
|
@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. Remaining failed pre-merge check
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -u
printf 'HEAD '; git rev-parse HEAD
printf 'PR metadata:\n'
gh pr view 706 --repo leynos/wireframe --json headRefOid,baseRefOid,files,statusCheckRollup --jq '{headRefOid,baseRefOid,files:[.files[].path],checks:[.statusCheckRollup[]? | {name,conclusion,status}]}'
printf '\nTarget commit summary:\n'
git show --format=fuller --stat --no-renames 6ac653bad30576e167f2191fef433365a70efaad | head -75
printf '\nFile outlines:\n'
for f in src/client/tests/error_handling.rs src/client/tests/lifecycle.rs tests/compile_error.rs tests/ui/zero_test_budget.rs tests/support/non_zero.rs; do
if test -f "$f"; then echo "== $f"; ast-grep outline "$f" --items all | head -65; fi
done
printf '\nPrior coverage source context:\n'
gh api repos/leynos/wireframe/issues/706/comments --paginate --jq '.[] | select(.user.login == "coderabbitai[bot]") | .body' | rg -n -C4 'Docstring coverage is 79.59|Analyzed 49 functions|Files selected for processing|Docstring Coverage' | head -115
printf '\nCoverage configs:\n'
rg -n -i -C2 'docstring.coverage|docstring_coverage|79\.59|documentation coverage|coverage.*80' -g '!Cargo.lock' . | head -100Length of output: 16742 🏁 Script executed: #!/bin/bash
set -u
echo 'Original report files and context:'
gh api repos/leynos/wireframe/issues/706/comments --paginate --jq '.[] | select(.user.login == "coderabbitai[bot]" and (.body | contains("79.59%"))) | .body' | sed -n '47,95p'
echo 'Function vicinity in changed helper files:'
for f in src/client/tests/error_handling.rs src/client/tests/lifecycle.rs tests/compile_error.rs tests/ui/zero_test_budget.rs tests/support/non_zero.rs; do
echo "== $f"; nl -ba "$f" | head -55
done
echo 'Per-file full-function counts, immediate Rustdoc and undocumented functions:'
python - <<'PY'
import re, subprocess
paths=subprocess.check_output(['git','diff','--name-only','742a718452f42df6fc373dbdabfbc613a497a4c0','HEAD'],text=True).splitlines()
total=doc=0
for p in paths:
if not p.endswith('.rs') or p.endswith('.stderr'):continue
a=open(p).read().splitlines()
functions=[]
for i,line in enumerate(a):
if re.match(r'^\s*(?:(?:pub(?:\([^)]*\))?|async|unsafe|const)\s+)*fn\s+[A-Za-z_]\w*\b',line):
j=i-1
while j>=0 and (a[j].strip().startswith('#[') or a[j].strip()==''): j-=1
documented= j>=0 and a[j].lstrip().startswith('///')
functions.append((i+1,documented,line.strip()))
total+=len(functions);doc+=sum(x[1] for x in functions)
print(p, len(functions), sum(x[1] for x in functions))
for line,hasdoc,decl in functions:
if not hasdoc: print(' UNDOC', line,decl[:100])
print('TOTAL',doc,total,round(doc/total*100,2) if total else 0)
PY
echo 'Changed-file diff summary:'
git diff --stat 742a718452f42df6fc373dbdabfbc613a497a4c0 HEAD | tail -20Length of output: 9882 🏁 Script executed: #!/bin/bash
set -euo pipefail
python - <<'PY'
import re, subprocess, json
files=json.loads(subprocess.check_output(['gh','pr','view','706','--repo','leynos/wireframe','--json','files'],text=True))['files']
total=doc=0
for f in files:
p=f['path']
if not p.endswith('.rs'): continue
a=open(p).read().splitlines()
functions=[]
for i,line in enumerate(a):
if re.match(r'^\s*(?:(?:pub(?:\([^)]*\))?|async|unsafe|const)\s+)*fn\s+[A-Za-z_]\w*\b',line):
j=i-1
while j>=0 and (a[j].strip().startswith('#[') or a[j].strip()==''): j-=1
documented= j>=0 and a[j].lstrip().startswith('///')
functions.append((i+1,documented,line.strip()))
total+=len(functions);doc+=sum(x[1] for x in functions)
print(p, f'{sum(x[1] for x in functions)}/{len(functions)}')
for line,hasdoc,decl in functions:
if not hasdoc: print(' UNDOC', line,decl[:110])
print('WHOLE_CHANGED_FILES_TOTAL',doc,total,f'{doc/total*100:.2f}%' if total else '')
PY
printf '\nLatest PR check names from API:\n'
gh api repos/leynos/wireframe/commits/6ac653bad30576e167f2191fef433365a70efaad/check-runs --jq '.check_runs[] | [.name,.status,.conclusion] | `@tsv`'Length of output: 7502 🏁 Script executed: #!/bin/bash
set -u
echo 'Outline options:'
ast-grep outline --help | head -105
echo 'Expanded sample:'
ast-grep outline src/client/tests/lifecycle.rs --items all --view expanded | head -105
echo 'PR patch sample (plus declarations):'
gh api repos/leynos/wireframe/pulls/706/files --paginate --jq '.[] | select(.filename == "src/client/tests/lifecycle.rs" or .filename == "tests/response.rs" or .filename == "tests/compile_error.rs") | {filename,patch}' | head -110
echo 'GitHub base comparison availability:'
gh api 'repos/leynos/wireframe/compare/742a718452f42df6fc373dbdabfbc613a497a4c0...0e1e29a5d93fa24728cef4ffd007fbc532146616' --jq '{status,files:[.files[]|{filename,changes}]}' 2>&1 | head -75Length of output: 18449 🏁 Script executed: #!/bin/bash
echo 'Outline JSON sample:'
ast-grep outline src/client/tests/lifecycle.rs --items all --json=stream | head -8
echo 'ast-grep function match JSON sample:'
ast-grep run --lang rust --pattern 'fn $NAME($$$ARGS) { $$$BODY }' src/client/tests/lifecycle.rs --json=stream | head -2 | cut -c1-1300
echo 'Original compared patches preview:'
gh api 'repos/leynos/wireframe/compare/742a718452f42df6fc373dbdabfbc613a497a4c0...0e1e29a5d93fa24728cef4ffd007fbc532146616' --jq '.files[] | [.filename, (.patch // "" | split("\n") | map(select(startswith("@@"))) | join(" | "))] | `@tsv`' | head -15Length of output: 7741 🏁 Script executed: #!/bin/bash
set -euo pipefail
python - <<'PY'
import subprocess,json,re,base64
repo='leynos/wireframe'; base='742a718452f42df6fc373dbdabfbc613a497a4c0'; old='0e1e29a5d93fa24728cef4ffd007fbc532146616'
def api(endpoint):
return json.loads(subprocess.check_output(['gh','api',f'repos/{repo}/{endpoint}'],text=True))
def lines_added(patch):
lines=set(); n=0
for line in patch.splitlines():
m=re.match(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@',line)
if m:n=int(m[1]);continue
if line.startswith('+') and not line.startswith('+++'):lines.add(n);n+=1
elif line.startswith(' '):n+=1
return lines
def outline(text):
result=subprocess.run(['ast-grep','outline','--lang','rust','--items','all','--json=stream'],input=text,text=True,capture_output=True)
if result.returncode:raise RuntimeError(result.stderr[:500])
data=json.loads(result.stdout.strip().splitlines()[-1])
return [x for x in data['items'] if x['symbolType']=='function']
def count(files, ref, original=False):
totals=[0,0]; found=[]
for f in files:
path=f['filename']
if not path.endswith('.rs'):continue
if original:
blob=api(f'contents/{path}?ref={ref}')
content=base64.b64decode(blob['content']).decode()
else:
content=open(path).read()
added=lines_added(f.get('patch') or '')
entries=outline(content)
a=content.splitlines()
selected=[]
for x in entries:
s=x['range']['start']['line']+1
e=x['range']['end']['line']+1
# Count changed body, signature, or contiguous preceding Rustdoc and attributes.
i=s-2
while i>=0 and (a[i].strip().startswith(('///','#[','//!')) or not a[i].strip()): i-=1
start=i+2
if not any(start<=n<=e for n in added):continue
i=s-2
while i>=0 and (a[i].strip().startswith('#[') or not a[i].strip()):i-=1
documented=i>=0 and a[i].lstrip().startswith('///')
selected.append((x['name'],s,documented))
totals[0]+=documented;totals[1]+=1
print(path, sum(x[2] for x in selected),len(selected), 'UNDOC',[(x[0],x[1]) for x in selected if not x[2]])
found.extend((path,*x) for x in selected)
print('TOTAL',*totals, f'{totals[0]/totals[1]*100:.2f}%' if totals[1] else '', 'files', len(files))
return found
print('ORIGINAL HEAD (added-line/function overlap):')
prior=api(f'compare/{base}...{old}')['files']
count(prior,old,True)
print('CURRENT HEAD (added-line/function overlap):')
latest=json.loads(subprocess.check_output(['gh','api',f'repos/{repo}/pulls/706/files','--paginate'],text=True))
count(latest,'HEAD')
PYLength of output: 3308 🏁 Script executed: #!/bin/bash
set -u
python - <<'PY'
import subprocess,json,base64
ref='0e1e29a5d93fa24728cef4ffd007fbc532146616'
for path in ['src/app/inbound_handler/tests.rs','src/client/tests/error_handling.rs']:
blob=json.loads(subprocess.check_output(['gh','api',f'repos/leynos/wireframe/contents/{path}?ref={ref}'],text=True))
txt=base64.b64decode(blob['content']).decode()
output=subprocess.run(['ast-grep','outline','--lang','rust','--items','all','--json=stream'],input=txt,text=True,capture_output=True)
print(path, 'source_lines',len(txt.splitlines()), 'outline_status',output.returncode, 'output_lines',len(output.stdout.splitlines()))
print('outline_begin',output.stdout[:400])
print('outline_end',output.stdout[-400:])
print('err',output.stderr[:100])
PYLength of output: 2785 🏁 Script executed: #!/bin/bash
set -euo pipefail
python - <<'PY'
import subprocess,json,re,base64,tempfile,os
repo='leynos/wireframe'; base='742a718452f42df6fc373dbdabfbc613a497a4c0'; old='0e1e29a5d93fa24728cef4ffd007fbc532146616'
def api(endpoint):
return json.loads(subprocess.check_output(['gh','api',f'repos/{repo}/{endpoint}'],text=True))
def lines_added(patch):
lines=set(); n=0
for line in patch.splitlines():
m=re.match(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@',line)
if m:n=int(m[1]);continue
if line.startswith('+') and not line.startswith('+++'):lines.add(n);n+=1
elif line.startswith(' '):n+=1
return lines
def outline(path):
result=subprocess.run(['ast-grep','outline',path,'--lang','rust','--items','all','--json=stream'],text=True,capture_output=True,check=True)
data=json.loads(result.stdout.strip().splitlines()[-1])
return [x for x in data['items'] if x['symbolType']=='function']
def count(files,original=False):
totals=[0,0]
for f in files:
path=f['filename']
if not path.endswith('.rs'):continue
if original:
blob=api(f'contents/{path}?ref={old}')
content=base64.b64decode(blob['content']).decode()
with tempfile.NamedTemporaryFile(suffix='.rs',mode='w',encoding='utf8') as tmp:
tmp.write(content);tmp.flush();entries=outline(tmp.name)
else:
content=open(path).read();entries=outline(path)
added=lines_added(f.get('patch') or '')
a=content.splitlines(); selected=[]
for x in entries:
s=x['range']['start']['line']+1;e=x['range']['end']['line']+1
if s>len(a):raise RuntimeError((path,s,len(a)))
i=s-2
while i>=0 and (a[i].strip().startswith(('///','#[','//!')) or not a[i].strip()): i-=1
start=i+2
if not any(start<=n<=e for n in added):continue
i=s-2
while i>=0 and (a[i].strip().startswith('#[') or not a[i].strip()):i-=1
documented=i>=0 and a[i].lstrip().startswith('///')
selected.append((x['name'],s,documented))
totals[0]+=documented;totals[1]+=1
print(path, sum(x[2] for x in selected),len(selected),'UNDOC',[(x[0],x[1]) for x in selected if not x[2]])
print('TOTAL',*totals, f'{totals[0]/totals[1]*100:.2f}%' if totals[1] else '', 'files', len(files))
print('ORIGINAL HEAD:')
count(api(f'compare/{base}...{old}')['files'],True)
print('CURRENT HEAD:')
latest=json.loads(subprocess.check_output(['gh','api',f'repos/{repo}/pulls/706/files','--paginate'],text=True))
count(latest)
PYLength of output: 6544
I confirmed that PR The earlier result was 39/49 (79.59%). If the original counting rules still select those 49 functions and also select the two documented functions in the new files, the result is 45/51 (88.24%). That is a projection, not a verified check result. I could not reproduce the original 39/49 count from the available diff and AST data. GitHub also does not report a current-head Docstring Coverage result. Therefore, I cannot give an exact current count or identify the Organization UI’s remaining undocumented functions. Keep the warning unresolved until the check reports at least 80.00%. AI agent prompt for the remaining verification work: You are interacting with an AI system. |
6ac653b to
fc3268d
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Keep fixed test inputs non-zero at compile time, propagate fallible helper errors, and preserve callback timing without nested closures. Replace redundant assertions and numeric lint expectations with equivalent source-level test logic.
Extract fallible frame and payload-length checks shared by response tests. Keep the same predicates and diagnostic text while reducing CodeScene duplication in the test-quality layer.
Share the const non-zero guard across budget fixtures and a trybuild UI case, so a zero budget has a checked compile error. Document when the client setup helper records its invocation and returns teardown state.
Explain when the client callback futures mutate their counters and state. Document the trybuild runner and zero-budget entry point to address the PR's changed-function documentation warning. Keep the compile-fail snapshot aligned with the new source line.
Explain both nz! forms, their compile-time zero check, and the shared include sites. Record the trybuild UI contract so new fixture values retain compile-fail coverage.
fc3268d to
08c834f
Compare
|
@coderabbitai The Developer Documentation warning in #706 (comment) is addressed on current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -u
printf 'Local HEAD and PR head:\n'
git rev-parse HEAD
gh pr view 706 --repo leynos/wireframe --json headRefOid,statusCheckRollup --jq '{headRefOid, checks:[.statusCheckRollup[]? | {name,status,conclusion}]}'
printf '\nGuide location and outline:\n'
fd '^developers-guide\.md$' .
ast-grep outline docs/developers-guide.md --items all | head -75
printf '\nGuide cited section:\n'
nl -ba docs/developers-guide.md | sed -n '962,1035p'
printf '\nMacro and fixture references:\n'
rg -n -C2 'macro_rules! nz|include!|zero_test_budget|compile_fail|test budget must be non-zero' tests/support/non_zero.rs tests/compile_error.rs tests/ui/zero_test_budget.rs src/fragment/tests/adapter_tests.rs src/message_assembler/budget_tests.rs src/message_assembler/budget_enforcement_tests.rs | head -150
printf '\nOriginal warning and current summary excerpts:\n'
gh api repos/leynos/wireframe/issues/comments/5802047210 --jq '{user:.user.login, body:.body}' | head -110
gh api repos/leynos/wireframe/issues/706/comments --paginate --jq '.[] | select((.body // "") | test("88.24|Developer Documentation";"i")) | {user:.user.login,body:.body}' | tail -135
printf '\nCommit checks:\n'
gh api repos/leynos/wireframe/commits/08c834f76b138757d41b9722ef93ea3019b628d5/check-runs --jq '.check_runs[] | [.name,.status,.conclusion] | @tsv' | head -65Length of output: 56520 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Developer-guide test-infrastructure section:\n'
nl -ba docs/developers-guide.md | sed -n '1148,1205p'
printf '\nDeveloper-guide diff in PR:\n'
gh api repos/leynos/wireframe/pulls/706/files --paginate --jq '.[] | select(.filename == "docs/developers-guide.md") | {filename,patch}'
printf '\nCompile-time fixture expectations:\n'
nl -ba tests/compile_error.rs | head -17
nl -ba tests/ui/zero_test_budget.rs | head -18
rg -n -C2 'E0080|test budget must be non-zero' tests/ui/zero_test_budget.stderr
printf '\nOriginal summary docstring entry:\n'
gh api repos/leynos/wireframe/issues/comments/5802047210 --jq '.body' | rg -n -C2 'Docstring coverage is 88.24|Developer Documentation|Analyzed 51'Length of output: 9223
Treat the earlier unverified Docstring Coverage comment as superseded. The CodeRabbit summary reports 88.24%, above the required 80.00% threshold. GitHub still showed some checks in progress when I inspected this head, so I cannot independently confirm that every current-head CI check has completed. You are interacting with an AI system. |
|
@coderabbitai approve |
✅ Action performedComments resolved and changes approved. |
Summary
This branch makes test setup and assertions fallible where failure is possible, replaces redundant assertion and extraction sequences, and removes twelve source-level lint expectations. Fixed non-zero test budgets now fail at compile time if changed to zero. The callback helpers retain their original first-poll timing.
This is the test-quality layer above #705 (
harden-dev-tooling). Spelling, structural module moves, production lint fixes, and final enforcement remain in later layers.Review walkthrough
Validation
On
08c834f76b138757d41b9722ef93ea3019b628d5against the merged #705landing commit
1dadc1c, the full own-configuration commit gates passedsequentially:
make check-fmt,make spelling,make lint,make typecheck,make test,make markdownlint,make nixie,make test-doc,make test-workflow-contracts,make formal-pr, andmbake validate Makefile.The test suite includes the
zero_test_budgettrybuild contract. The fivechild commits replayed with exact
=range-diff results; the PR changes theoriginal 15 test paths and
docs/developers-guide.md. Current-headbuild-test
and CodeQL
completed successfully.
Notes
This layer is above merged #705
and below #708. Spelling follows
in #709, then module moves in
#710. CodeRabbit's current
Docstring Coverage check passes at 88.24% (51 functions). Its Developer
Documentation warning is resolved by the new guide section, and
CodeRabbit confirmed approval.
References