Background
PR 3d shipped Tier-2 event defenses with 8-K Defenses #9 (Item 4.02 hard veto) and #10 (Item 4.01 auditor change) wired but disabled behind a module-level feature flag (compute.scoring.tier2._EIGHT_K_DEFENSES_ENABLED = False).
The deferral was forced by three workflow_dispatch timeouts (#12, #13, #14) on cold-cache runs:
After three timeouts the Tier-2 budget closed; we shipped going-concern-only.
Scope
Re-enable Defenses #9 + #10 with a re-architected fetch path that does not blow the workflow ceiling.
Implementation plan
-
Pre-cache layer (off-cycle nightly job):
- New workflow
compute-pre-cache.yml runs daily (or every 2 days) outside the weekly compute window.
- Iterates the universe, fetches 8-K filing list per ticker, regex-extracts items + excerpts, writes to
compute/cache/edgar_8k/<ticker>.json (existing 7-day TTL cache shape).
- Weekly compute reads the warm cache; cold-fetch path becomes rare.
-
Flip the feature flag:
# compute/scoring/tier2.py
_EIGHT_K_DEFENSES_ENABLED = True
Existing eight_k_enabled test fixture in tests/test_scoring/test_tier2.py becomes a no-op (or is removed).
-
Re-add non_reliance_filing to active veto layer:
compute/scoring/risk_overlay.py already accepts non_reliance_by_ticker: dict[str, bool]. The wiring stays valid — only the upstream input changes from "always empty dict" to "populated dict".
- Update
compute/main.py line ~580 to repopulate the dict from tier2_results.
-
Restore tier2_coverage_pct semantics:
- With 8-K active,
Tier2Result.fetch_succeeded reverts to "BOTH 10-K and 8-K succeeded".
- Update tier2.py docstring and the relevant tests in section A.
-
Schema bump: 0.6.0-phase3d → 0.7.0-phase4-something. Active-veto count moves from 3 (PR 3d) back to 4 (PR 3e/Phase 4).
Testing requirements
@pytest.mark.network integration test confirming a known 4.02 filing surfaces the veto.
- Schema snapshot guard catches the version bump.
- Workflow_dispatch cold-cache run completes in under 45 min with 8-K events active.
Acceptance criteria
References
- PR 3d perf hotfixes: 226840d (10-K filing.html()), 12ad7ff (8-K regex-on-HTML).
- SEC Form 8-K Items 4.01 / 4.02 (Reg S-K Item 304).
- Schroeder 2024 SSRN: ~50% of Item 4.02 filings precede formal restatement within 12 months.
Background
PR 3d shipped Tier-2 event defenses with 8-K Defenses #9 (Item 4.02 hard veto) and #10 (Item 4.01 auditor change) wired but disabled behind a module-level feature flag (
compute.scoring.tier2._EIGHT_K_DEFENSES_ENABLED = False).The deferral was forced by three workflow_dispatch timeouts (#12, #13, #14) on cold-cache runs:
filing.text()routed throughhybrid_section_detector(~5-10s × 502 stocks).filing.html()fix (commit 226840d) was insufficient —EightK.items/EightK.sectionsaccess ALSO triggered the detector viaEightK.documentcached_property. Fixed in commit 12ad7ff with regex-on-raw-HTML extraction (mirroring edgartools' Strategy 3 fallback).After three timeouts the Tier-2 budget closed; we shipped going-concern-only.
Scope
Re-enable Defenses #9 + #10 with a re-architected fetch path that does not blow the workflow ceiling.
Implementation plan
Pre-cache layer (off-cycle nightly job):
compute-pre-cache.ymlruns daily (or every 2 days) outside the weekly compute window.compute/cache/edgar_8k/<ticker>.json(existing 7-day TTL cache shape).Flip the feature flag:
Existing
eight_k_enabledtest fixture intests/test_scoring/test_tier2.pybecomes a no-op (or is removed).Re-add
non_reliance_filingto active veto layer:compute/scoring/risk_overlay.pyalready acceptsnon_reliance_by_ticker: dict[str, bool]. The wiring stays valid — only the upstream input changes from "always empty dict" to "populated dict".compute/main.pyline ~580 to repopulate the dict fromtier2_results.Restore tier2_coverage_pct semantics:
Tier2Result.fetch_succeededreverts to "BOTH 10-K and 8-K succeeded".Schema bump: 0.6.0-phase3d → 0.7.0-phase4-something. Active-veto count moves from 3 (PR 3d) back to 4 (PR 3e/Phase 4).
Testing requirements
@pytest.mark.networkintegration test confirming a known 4.02 filing surfaces the veto.Acceptance criteria
compute-pre-cache.ymlworkflow exists and runs successfully on schedule._EIGHT_K_DEFENSES_ENABLED = True.non_reliance_filingappears inrisk_flagsfor at least one veto-eligible ticker in production output.eight_k_enabledfixture.References