docs(phase4): defer PR 4b §3 to Phase 5 — surface 4.5a.1 + 4h as the real next tracks#88
Merged
Merged
Conversation
… Sloan as next Earlier this session I recommended PR 4b §3 polish (decay_report.json writer + UI) as the next deliverable. Reading `compute/validation/ic_decay.py:51` + `defense-infrastructure/ PLAN.md:7` reveals the §3 output writer was always intended to wait for Phase 5 backtest infrastructure to accumulate the per-pillar monthly IC time series. > Phase 5 backtest infrastructure will accumulate it during > walk-forward training; until then, this module ships as a > callable library that the user (or a future Phase 5+ harness) > feeds with historical IC data. — `ic_decay.py:51` So §3 isn't "polish work blocked on someone writing 200 LOC" — it's "Phase 5 backtest infra prerequisite." Issue #75's remaining 2 acceptance criteria are Phase-5 work, not next-deliverable work. ## Triple-doc updates | File | Change | |---|---| | `CLAUDE.md` | §Phase status — `Next deliverable` reframed from "PR 4b §3 polish" to "Phase 4.5a.1 — sector-relative Sloan" (folds in issue #7); §3 marked Phase-5-blocked; production stats (23 stocks / 4.6%) preserved | | `PHASE_STATUS.md` | Phase 4 table row trims "PR 4b §3 polish next" → "PR 4b §3 IC-decay output deferred to Phase 5 (needs pillar time-series harness)"; the §3 sub-section status row in the PR 4b status table updated 🟡 PARTIAL → 🟡 DEFERRED to Phase 5 with the `ic_decay.py:51` rationale quoted; "Next deliverable" block rewritten to surface the two unblocked tracks (4h-4k factor integrations + Phase 4.5a.1) running in parallel | | `WORKFLOW.md` | Phase 4 Acceptance Criteria — IC decay checkbox `[ ]` stays unchecked, footnote updated from "MISSING: writer wiring" → "DEFERRED to Phase 5" with `ic_decay.py:51` quote | ## Real next-deliverable options (after this docs PR) 1. **Phase 4.5a.1 — sector-relative Sloan** (issue #7 fold-in). ~80 LOC + AAER backtest, ~3 days. First sub-PR of Phase 4.5 manipulation-defense cluster. 2. **4h OSAP factor integration** — first factor integration toward v1.1.0, gated by the now-callable `pbo_dsr.factor_passes_gates()` harness. ~1 week. Both unblocked. Both touch disjoint code paths so they can ship in parallel. ## Verification - No code changes; docs only - `grep "§3 polish" CLAUDE.md PHASE_STATUS.md WORKFLOW.md` returns 0 hits - `grep "deferred to Phase 5\|DEFERRED to Phase 5"` appears in all three docs - Issue #75 remains open (separate manual relabel as a tracking issue for Phase 5) https://claude.ai/code/session_015649aRyi2bvciQYZVNACd2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks
dackclup
added a commit
that referenced
this pull request
May 16, 2026
#92) Phase 4.5a manipulation-defense quick-wins shipped 2026-05-16 across 3 sub-PRs (#89/#90/#91). Production verified on run #47 (commit `8cdf4886`). This commit bumps the triple-doc lockstep so future sessions read the actual current state instead of the in-progress plan. ## What shipped (per-sub-PR) | Sub-PR | PR | Delivered | Production effect | |---|---|---|---| | **4.5a.1** | #89 | Sloan accruals top-decile within sector; `SLOAN_MIN_POPULATION_SECTOR=15` floor; cross-sectional fallback for under-floor sectors. Closes issue #7. | Financials Sloan rate 21.3% → 11.7%. Cross-sector spread 7.7× → 1.4×. Total Sloan flagged 51 → 56. | | **4.5a.2** | #90 | `beneish_manipulation_veto` active-veto path at M > −1.78 (Beneish 1999 Table 4 PPV crossover). | 11 new vetoed tickers: SMCI · WAT · PODD · WDC · NVDA · CAT · PLTR · SNDK · BG · STX · LLY. | | **4.5a.3** | #91 | `dechow_manipulation_veto` active-veto path at F > 3.0 (Dechow 2011 Table 7 4× baseline crossover) + `manipulation_triple_flag` joint-gate annotate. | 1 Dechow veto (SMCI F=6.65); 2 triple_flag tickers (SMCI + WAT). | ## End-state defense layer - **Active vetoes**: 5 → **7** (added `beneish_manipulation_veto`, `dechow_manipulation_veto`) - **Annotate flags**: 4 → **5** (added `manipulation_triple_flag`) - **Tier-3 forensic**: still 2 (Beneish + Dechow operating at two thresholds each — annotate + veto) - **Reason taxonomy**: 24 → **29 stable identifiers** No schema delta — new flag IDs are strings in the existing `risk_flags: list[str]` and `valuation_warnings: list[str]` arrays. `SCHEMA_VERSION` stays `0.7.1-phase4g`. ## Triple-doc lockstep changes | File | Change | |---|---| | `CLAUDE.md` | §Phase status — "Next deliverable" reframed from "4.5a.1 sector-relative Sloan" to "4.5b disclosure-driven catches". Defense layer count "9 → 18 target" updated to "9 → 11 after 4.5a; target 18 after 4.5f". Issue #7 marked ✅ closed by 4.5a.1. | | `PHASE_STATUS.md` | Phase Overview table: Phase 4.5 row flipped ⚪ → 🟡 IN PROGRESS with the 4.5a wave landed; duplicate ⚪ row removed. "Phase 4.5 plan" section §4.5a replaced "1-2 weeks, +2 active veto + 1 badge" header with "✅ DONE 2026-05-16" + a results table showing per-sub-PR production effect. Original plan text preserved below the results table for audit. | | `WORKFLOW.md` | Phase 4.5 §Tasks §4.5a — all 4 checkboxes flipped [ ] → [x] with per-sub-PR PR-number citations (PR #89 / #90 / #91), LOC counts, test deltas, production verification numbers. | ## Audit trail This is the 4th doc-correction PR in the post-v1.0 cleanup pattern, this time legitimate (the work actually shipped). Earlier ones in this session were correcting drift between intent and state: - PR #81 — 4g status correct (factual) - PR #86 — added Phase 4.5 roadmap (planning) - PR #87 — corrected "PR 4b next" → "§3 polish next" (was wrong) - PR #88 — corrected "§3 polish next" → "deferred to Phase 5" (was wrong) - **This PR** — 4.5a wave ✅ DONE (factual, not drift-correction) ## Verification - No code changes; docs only - `grep "4.5a.1" CLAUDE.md PHASE_STATUS.md WORKFLOW.md` returns only DONE/closed references in active sections - `grep "Next deliverable.*4.5a"` returns 0 hits (all moved to 4.5b) - `grep "9 → 11"` appears in CLAUDE.md (new defense layer count) https://claude.ai/code/session_015649aRyi2bvciQYZVNACd2 Co-authored-by: Claude <noreply@anthropic.com>
dackclup
added a commit
that referenced
this pull request
May 17, 2026
#94) Phase 4.5b disclosure-driven catches shipped via PR #93. Production verified on run #48 (commit `849b7ca8`, workflow 2h08m due to cold-cache populating both new `edgar_amendments` + `edgar_late_filings` dirs; warm runs return to ~1h30m). ## What shipped | Flag | Lookback | Production fire | Notes | |---|---|---|---| | `restatement_history` | 5y 10-K/A + 10-Q/A | **60 / 502 (12.0%)** | within expected 6-16% — AMD, DIS, CVX, BSX, EBAY etc. (mostly mature firms with periodic amendments) | | `late_filing_notification` | 365d Form 12b-25 | **2 / 502 (0.4%)** | HAS + Q — slightly under expected 1-4% (S&P 500 firms tend to be more compliant than broader Bartov-Lai-Yeung sample) | ## End-state defense layer - Active vetoes: **7** (unchanged — 4.5b is annotate-only) - Annotate flags: 5 → **7** (+ `restatement_history`, `late_filing_notification`) - Reason taxonomy: 29 → **31** - **Defense layer 9 → 13 layers after 4.5a + 4.5b** No schema delta — both new flags are strings in existing `valuation_warnings: list[str]`. `SCHEMA_VERSION` stays `0.7.1-phase4g`. ## Triple-doc lockstep changes | File | Change | |---|---| | `CLAUDE.md` | "Next deliverable" reframed from 4.5b to 4.5c (Roychowdhury REM). Defense layer count "9 → 11 after 4.5a" → "9 → 13 after 4.5a + 4.5b". 4.5b results summary appended. | | `PHASE_STATUS.md` | Phase 4.5 table row updated with 4.5b results + tickers + 60/2 counts. §4.5b header flipped to ✅ DONE 2026-05-16 with results table + workflow time note (cold-cache 2h08m). Original plan text preserved below for audit. | | `WORKFLOW.md` | §Tasks §4.5b — all 4 checkboxes [ ] → [x] with PR-number + LOC + test-count + production-verification citations. SEC Filing Roadmap table: 4 new rows for 10-K/A, 10-Q/A, NT 10-K, NT 10-Q (all ✅ active with PR #93 / 2026-05-16 production-fire-rate footnotes). Form 4 status flipped from "❌ not used" to "⬜ planned (Phase 4.5e)" to reflect the upcoming sub-PR. | ## Next deliverable **Phase 4.5c — Real Earnings Management (Roychowdhury 2006 REM)**: - 3 abnormal proxies per ticker: - `abnormal_CFO` = actual − model(Sales, ΔSales) - `abnormal_production` = actual − model(Sales, ΔSales, ΔSales_t−1) - `abnormal_discretionary_expenses` = actual − model(Sales_t−1) - Flag `rem_suspect` fires when 2 of 3 proxies sit in worst decile within sector - ~250 LOC + golden tests against Roychowdhury 2006 paper Table 6 - Catches REAL manipulation (cutting R&D, channel stuffing, deferring maintenance) — invisible to Sloan/Beneish/Dechow which target accrual manipulation ## Audit trail (post-v1.0 doc PRs) | PR | Purpose | |---|---| | #81 | 4g ✅ DONE | | #86 | Phase 4.5 roadmap added | | #87 | "PR 4b next" → "§3 polish next" (was wrong) | | #88 | "§3 polish next" → "Phase-5 blocked" (was wrong) | | #92 | 4.5a wave ✅ DONE | | **this PR** | 4.5b wave ✅ DONE | ## Verification - No code changes; docs only - `grep "Next deliverable.*4.5b"` returns 0 hits (all moved to 4.5c) - `grep "9 → 13"` appears in CLAUDE.md (new defense layer count) - `grep "10-K/A.*✅ active"` returns the new WORKFLOW.md filing-roadmap row https://claude.ai/code/session_015649aRyi2bvciQYZVNACd2 Co-authored-by: Claude <noreply@anthropic.com>
dackclup
added a commit
that referenced
this pull request
May 17, 2026
#96) Phase 4.5c Roychowdhury REM shipped via PR #95. Production verified on run #49 (commit `65097703`, warm-cache 6m25s — all 9 cache layers populated). ## What shipped `rem_suspect` annotate via per-sector OLS regressions on 3 abnormal proxies (CFO, Production, Discretionary Expenses). Module `compute/scoring/rem.py` (~420 LOC, pure-numpy via `np.linalg.lstsq`, no sklearn/statsmodels dep). 14 offline tests including golden numerical test recovering known-DGP coefficients. ## Production verification | Metric | Value | |---|---| | Fire rate | **16 / 502 (3.2%)** — within H0-to-correlation expected 2.8-7% | | Tickers fired | SMCI · WAT · ADM · TSN · HRL · STLD · FSLR · JBL · COHR · LII · LDOS · POOL · OMC · WY · TECH · RVTY | | Orthogonality check | NVDA / PLTR (Beneish-veto fired) **NOT** in REM list — confirms 4.5c captures real-manipulation signal orthogonal to accrual targets | | Real-world coverage | ADM (2024 SEC investigation) · SMCI (2024 investigation) · TSN / HRL (periodic scrutiny) · FSLR (solar channel-stuffing history) | ## End-state defense layer - Active vetoes: **7** (unchanged — 4.5c is annotate-only) - Annotate flags: 7 → **8** (+ `rem_suspect`) - Reason taxonomy: 31 → **32** - **Defense layer 9 → 14 after 4.5a + 4.5b + 4.5c** No schema delta — `rem_suspect` is a string in existing `valuation_warnings: list[str]`. `SCHEMA_VERSION` stays `0.7.1-phase4g`. ## Triple-doc lockstep changes | File | Change | |---|---| | `CLAUDE.md` | "Next deliverable" 4.5c → 4.5d. Defense layer "9 → 13 after 4.5a+4.5b" → "9 → 14 after 4.5a+4.5b+4.5c". 4.5c results + ticker list + orthogonality note inserted between 4.5b and the post-completion roadmap. | | `PHASE_STATUS.md` | Phase 4.5 row updated with 4.5c production stats. §4.5c header flipped to ✅ DONE 2026-05-17 with results table + orthogonality note. Original plan text preserved below for audit. | | `WORKFLOW.md` | §4.5c checkboxes [ ] → [x] with PR-number / LOC / test-count / production-verification citations + golden-test reference. | ## Next deliverable **Phase 4.5d — earnings-quality time-series + Burgstahler-Dichev kink at zero** (~180 LOC, ~7 days): - `m_score_deteriorating` annotate — Δ(Beneish M-score) > +0.5 over trailing 3y (manipulation gathering steam) - `loss_avoidance_pattern` annotate — NI ∈ [0, $5M] OR EPS ∈ [0, $0.05] for 3+ consecutive years (Burgstahler-Dichev 1997 kink) ## Audit trail (post-v1.0 doc PRs) | PR | Purpose | |---|---| | #81 | 4g ✅ DONE | | #86 | Phase 4.5 roadmap added | | #87 | "PR 4b next" → "§3 polish next" (was wrong) | | #88 | "§3 polish next" → "Phase-5 blocked" (was wrong) | | #92 | 4.5a wave ✅ DONE | | #94 | 4.5b wave ✅ DONE | | **this PR** | 4.5c wave ✅ DONE | ## Verification - No code changes; docs only - `grep "Next deliverable.*4.5c"` returns 0 hits (all moved to 4.5d) - `grep "9 → 14"` appears in CLAUDE.md (new defense layer count) - `grep "rem_suspect"` appears in PHASE_STATUS.md + WORKFLOW.md active-flags references https://claude.ai/code/session_015649aRyi2bvciQYZVNACd2 Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Earlier this session I recommended PR 4b §3 polish (decay_report.json writer + UI card) as the next deliverable. Reading
compute/validation/ic_decay.py:51+defense-infrastructure/PLAN.md:7reveals the §3 output writer was always intended to wait on Phase 5 backtest infrastructure:So §3 isn't "polish work blocked on someone writing 200 LOC" — it's a Phase 5 prerequisite. Issue #75's remaining 2 acceptance criteria are Phase-5 work, not next-deliverable work.
Triple-doc updates
CLAUDE.mdPHASE_STATUS.mdic_decay.py:51quote; "Next deliverable" block rewritten to show the two unblocked tracks (4h-4k factor integrations + Phase 4.5a.1) running in parallelWORKFLOW.md[ ], footnote updated from "MISSING: writer wiring" → "DEFERRED to Phase 5"Real "next deliverable" options after this PR
pbo_dsr.factor_passes_gates()harness. ~1 week.Both unblocked. Both touch disjoint code paths so they can ship in parallel.
Doc audit trail (3rd doc-correction PR this week)
Test plan
grep "§3 polish"returns 0 hits in CLAUDE.md / PHASE_STATUS.md / WORKFLOW.mdgrep "deferred to Phase 5\|DEFERRED to Phase 5"appears in all three docsNot in this PR
defense-infrastructure/PLAN.mdskill text — internal planning doc; can be updated when 4.5a.1 kicks offhttps://claude.ai/code/session_015649aRyi2bvciQYZVNACd2
Generated by Claude Code