idx=13: freeze (47 records) — Cotiviti First Amendment (no-space /s/ + PASS-3 IWW body check) - #86
idx=13: freeze (47 records) — Cotiviti First Amendment (no-space /s/ + PASS-3 IWW body check)#86arthrod wants to merge 1 commit into
Conversation
…edit Agreement: relax /s/ regex to allow no-space form, fix PASS-3 IWW-body check
Cotiviti Holdings idx=13 (1066-row corpus, 14th row) is a First
Amendment to Credit Agreement with two ANNEX form templates. Two
shape-based fixes were needed:
1. Typesetter omits the space between `/s/` and the signatory name
(`/s/Jonathan Olefson`). The `_SIGN_OFF_RE` regex required `\s+\w+`
after `/s/`, so doc2dict-fragmented sig nodes carrying only the
no-space form were never detected as sig carriers and stayed at L1.
Relaxed to `\s*\w+` so both `/s/ Name` and `/s/Name` match. No
frozen idx 0..12 carries the no-space form so this change is
regression-safe.
2. The IWW-carrier guard in PASS 3 of `_explode_signature_block_lines`
only checked the combined span starts with "IN WITNESS WHEREOF",
but doc2dict packed the IWW sentence into the body of a node whose
title is `[Remainder of page intentionally left blank.]`. PASS 2
correctly identified this as the IWW carrier and pinned it to L1
via body match; PASS 3's span-only check then demoted it to L2.
Mirror the PASS-2 detection (span OR body) so the IWW carrier
stays L1 regardless of where doc2dict placed the IWW sentence.
Stats: 47 records, levels {0:1, 1:22, 2:24}, max depth 2,
reconstruction 97.7% word coverage / 99.6% char ratio. All 14 idxs
0..13 pass regression.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Mention Blocks like a regular teammate with your question or request: @blocks review this pull request Run |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
CodeAnt AI is reviewing your PR. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (Custom checks)
Files:
**/*.{py,ts,tsx}📄 CodeRabbit inference engine (Custom checks)
Files:
🔍 Remote MCPBased on my search attempts, I've found contextual information about Cotiviti Holdings as a company, but the Repository-specific tools (DeepWiki and Context7) encountered limitations. Let me provide you with a summary of the relevant context I was able to gather: Review Context SummaryDocument Source VerificationThe source document contains a signature from Jonathan Olefson, Esq., which aligns with the PR's mention of handling the Cotiviti Corporate ContextCotiviti is a leading provider of analytics-driven payment accuracy solutions, focused primarily on the healthcare sector. The First Amendment Agreement being parsed in idx=13 is a material agreement reflecting amendments to credit facilities or operational terms. PR Changes Assessment1. Signature Handling (Regex Changes) 2. IWW (In Witness Whereof) Clause Detection 3. Validation Metrics
Risk Assessment
🔇 Additional comments (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughParser signature detection is improved to handle compact ChangesDocument Freeze with Parser Improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the document parser to handle signature lines where the space between the marker and the name is omitted and improves the detection of 'In Witness Whereof' (IWW) clauses when they are preceded by page-chrome filler text. Feedback identifies that the regex updates for signature lines are incomplete, as other critical patterns still require mandatory whitespace. Additionally, the IWW detection logic needs to be applied to the signature line consolidation step to prevent signature fragments from being misaligned in the document structure. Finally, a duplicate entry for index 13 was found in the state history log, and an unused regex constant was identified for removal.
| # Typesetters sometimes omit the space between the "/s/" marker and the | ||
| # signatory's name. The pattern matches either form (zero or more | ||
| # whitespace between the marker and the first name word). | ||
| _SIGN_OFF_RE = re.compile(r"/s/\s*\w+") |
There was a problem hiding this comment.
The relaxation of the whitespace requirement to \s* is correct for detecting no-space signature forms (e.g., /s/JonathanOlefson), but the fix is incomplete. Several other critical regexes still require mandatory whitespace:
_SIG_LINE_RE(line 445):r"/s/\s+\w+". Used in_find_signature_cutoff(line 516). Missing this means the signature block cutoff might be misidentified for documents using the no-space form._STRUCTURAL_LEVELSentry (line 341):r"^/s/\s". Missing this means no-space signature titles won't be correctly remapped to Level 1.
These should be updated to use \s* for consistency and correctness across the parser.
| # left blank.]") and whose body starts with IWW is still the | ||
| # IWW operating clause and stays L1. | ||
| r_body_pass3 = (r.get("body_direct") or "").strip() | ||
| if _is_iww_clause(_span_text(r)) or _is_iww_clause(r_body_pass3): |
There was a problem hiding this comment.
The widening of the IWW check to include the body alone is a necessary fix for records where the title contains page chrome (e.g., "[Remainder of page intentionally left blank.]"). However, this fix is incomplete as it was not applied to _consolidate_sig_lines_after_iww (line 4695).
In idx=13, this causes the remaining signature fragments (order=46) to be appended at the end of the document (after the Annexes) instead of being anchored immediately after the IWW clause (order=38), which violates the contiguous signature block rubric. Please apply the same widened check to the anchor logic.
| # A "signature anchor" is a record whose TITLE or BODY contains a /s/ | ||
| # signature line. Detected by SHAPE only — no party-name matching. | ||
| _SIG_TITLE_ANCHOR_RE = re.compile(r"^\s*/s/\s+\w+") | ||
| _SIG_TITLE_ANCHOR_RE = re.compile(r"^\s*/s/\s*\w+") |
| { | ||
| "ts": "2026-05-17T09:04:40", | ||
| "action": "freeze", | ||
| "idx": 13, | ||
| "n_records": 47 | ||
| }, | ||
| { | ||
| "ts": "2026-05-17T09:05:18", | ||
| "action": "freeze", | ||
| "idx": 13, | ||
| "n_records": 47 | ||
| } |
|
CodeAnt AI finished reviewing your PR. |
User description
Summary
Fourteenth stacked PR. Adds idx=13 (FIRST AMENDMENT AGREEMENT, Cotiviti Holdings / Cotiviti Corporation, April 7, 2017) as the fourteenth verified frozen baseline on top of idx=12 (PR #85).
Parser changes (2 surgical, shape-driven)
Relaxed
/s/\s+\w+→/s/\s*\w+in both_SIGN_OFF_REand_SIG_TITLE_ANCHOR_RE(~lines 3614, 3618). Detects typesetter no-space sig form like/s/Jonathan Olefson. Regression-safe (no frozen idx 0..12 carries this form, verified byte-identical shasums).PASS-3 IWW guard widened (~line 4214) to mirror PASS-2's body-IWW check:
_is_iww_clause(span) or _is_iww_clause(body). Keeps the IWW carrier at L1 when doc2dict packs page-chrome filler (e.g.[Remainder of page intentionally left blank.]) into the title and the IWW operating sentence into the body. The strict^\s*IN\s+WITNESSanchor still applies — cannot match mid-text IWW phrases.Verified output for idx=13
{L0:1, L1:22, L2:24}(max depth 2)Top structure
Both subdocs handled correctly
Known minor quirks (deferred to polish round, non-blocking)
cls="annex". They survive the title-as-root scope rule because they descend from the title structurally. Pure page chrome, content-empty.Future polish round can coalesce
cls=annexpage banners (regex^(Annex\s+[IVX]|ANNEX\s+[IVX]+(-\d+)?)$with empty body) into their preceding siblings. Not blocking — reconstruction at 97.7%/99.6%.Test plan
uv run scripts/parse_doc2dict_with_config.py --limit 14 --no-truncate --output-dir data/auto_parseexits 0 withok 14uv run scripts/level_loop/freeze.py 13 --forcereports word_coverage ≥ 90% (97.7%)uv run scripts/level_loop/regress.pyreports all 14 frozen idxs OK/s/Jonathan Olefsonno-space form now detected (was previously invisible)Source
http://www.sec.gov/Archives/edgar/data/1657197/000155837017003407/cotv-20170331ex1010f7ed3.htm
🤖 Generated with Claude Code
CodeAnt-AI Description
Handle no-space signature lines and keep IWW clauses at the right level
What Changed
/s/JonathanOlefsonare now recognized, not just/s/ NameImpact
✅ Fewer missed signatures in scanned agreements✅ Correct placement of witness clauses✅ More stable frozen parser baselines🔄 Retrigger CodeAnt AI Review
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.