Skip to content

fix(documents): end an 8-K's last item at the signature statement when there is no SIGNATURES heading - #1393

Merged
dgunning merged 2 commits into
mainfrom
fix/8k-signature-statement-boundary
Oct 1, 2026
Merged

dgunning merged 2 commits into
mainfrom
fix/8k-signature-statement-boundary

Conversation

@dgunning

@dgunning dgunning commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What this changes

This fixes the red network job on main: tests/company_reports/test_eightK.py::test_eightk_with_no_signature_header.

Root cause. Bisecting points to da38745 (#1386, the gh-1370 whitespace collapse), but that commit isn't the regression. On the commit before it (c5bfcff), AmeriServ's Item 9.01 already contained the whole signature block. The test passed only because the hard-wrapped "Pursuant to the\nrequirements" didn't match its substring. #1370 collapsed the wrap and exposed it.

Fix. Strategy 5c in pattern_section_extractor handles 8-K / 8-K/A filings with no bare SIGNATURES line. The first paragraph after the last Item header that opens with the prescribed sentence ("Pursuant to the requirements of the Securities Exchange Act of 1934 … caused this report to be signed") becomes the terminal header. It's labelled SIGNATURES, so later stages treat it like a real one. Requiring it to come after the last Item header keeps the cover page's "Pursuant to Section 13 or 15(d)" line from ever ending an item.

The test now compares whitespace-normalized text and asserts where the item ends, so it can't pass by accident again. It fails without the fix.

Verification

  • Blast radius: I extracted sections from 90 8-Ks (12 fixtures plus 78 sampled from 2010Q2, 2018Q3 and 2024Q1) with and without the change. 3 changed, each a pure truncation of the last item by exactly its signature block, which moves to a signatures section (80 of the 90 already have one). Nothing else moved.
  • Section network regression files: 60 files, one per call, 559 passed and 0 failed.
  • Fast tests for tests/documents, tests/company_reports and tests/meta: 869 passed.
  • 8-K test files, including network tests: 21 and 31 passed.

Known gap, not fixed here: 2 sampled filings keep the block because their SIGNATURES heading and statement sit inside a table. Filed as bead edgartools-6qmq.

🤖 Generated with Claude Code

…n there is no SIGNATURES heading

test_eightk_with_no_signature_header failed in the post-merge network job
after #1386 (gh-1370 whitespace collapse). Bisected to da38745, but it is not
a regression: on c5bfcff Item 9.01 already contained the whole signature
block. The test passed only because the hard-wrapped "Pursuant to the\nrequirements"
did not match its substring. #1370 collapsed the wrap and exposed it.

Strategy 5c in pattern_section_extractor: for 8-K/8-K/A, when Strategy 5b
found no bare SIGNATURES line, the first ParagraphNode after the last Item
header whose whitespace-normalized text matches the prescribed opening ("Pursuant
to the requirements of the Securities Exchange Act of 1934 ... caused this
report|amendment to be signed") becomes the terminal header, labelled
SIGNATURES so later stages treat it exactly like a real one. "After the last
Item header" keeps the cover page's "Pursuant to Section 13 or 15(d)" line
from ever ending an item.

Measured on 90 8-Ks (12 fixtures + 78 sampled from 2010Q2/2018Q3/2024Q1),
with and without the change: 3 changed, each a pure truncation of the last
item by exactly its signature block, which moves to a `signatures` section
(80 of 90 already have one). Nothing else moved. 2 filings still carry the
block because it sits inside a table; filed as edgartools-6qmq.

The test now compares whitespace-normalized text and asserts where the item
ends, so it cannot pass by accident again; it fails without the fix.
Section network regression files (60, one per call): 559 passed, 0 failed.
tests/documents + company_reports + meta fast: 869 passed. 8-K test files
including network: 21 + 31 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgunning
dgunning enabled auto-merge (squash) October 1, 2026 19:42
…udit

#1393 changed only tests/company_reports/test_eightK.py, whose 21 tests are
all network-marked. `-m fast` deselected every one, the output held no
"passed", and check_offline_audit.py took that for a run that produced no
result: exit 2, so the required test-fast job failed in 77 s, before the
fast suite ran. Any PR editing only network test files would hit it.

nothing_to_audit() recognizes "N deselected" with no passed/failed/error
count as a clean result. The "produced no result" guard still catches
collection errors and empty runs. The real case now prints "nothing to
audit" and exits 0; a fast file (test_vcr_interception_guard.py) still
audits normally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgunning

dgunning commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Pushed 6183ed7. The first run failed in the offline-audit step, not in this fix. check_offline_audit.py exited 2 because every test in the only changed test file is network-marked, so -m fast deselected all 21 and the output had no "passed". The script now treats "N deselected" with no passed, failed or error count as nothing to audit. Collection errors still fail. Unit tests are added in tests/meta/test_offline_audit_ratchet.py.

@dgunning
dgunning merged commit af2565d into main Oct 1, 2026
10 checks passed
@dgunning
dgunning deleted the fix/8k-signature-statement-boundary branch October 1, 2026 20:02
@dgunning dgunning mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant