Feature/Fix: Profile and optimize shadow lineage accounting#2154
Feature/Fix: Profile and optimize shadow lineage accounting#2154iam-brain wants to merge 16 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 13, 2026, 9:24 PM ET / July 14, 2026, 01:24 UTC. Summary Reproducibility: yes. at source and corpus level: the canonical investigation documents fork/interleaving overcounts, current main contains only the partial containment fix, and the PR reports a retained real-history replay. This review did not independently rerun the private corpus. Review metrics: 4 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the stack only with legacy accounting still authoritative, lineage restricted to shadow diagnostics, and explicit cache-rebuild and cancellation validation; retain the promotion gates until broader day-level accuracy evidence supports changing authority. Do we have a high-confidence way to reproduce the issue? Yes at source and corpus level: the canonical investigation documents fork/interleaving overcounts, current main contains only the partial containment fix, and the PR reports a retained real-history replay. This review did not independently rerun the private corpus. Is this the best way to solve the issue? Yes for an incremental rollout: shadow computation, a legacy fallback, atomic publication, cancellation checks, and explicit promotion gates are safer than immediately replacing production accounting. The final stack still needs exact-head upgrade-cache validation before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b41715f3e3fb. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Superseded by the consolidated four-PR review stack. This slice is now included in #2158; closing this draft to keep the upstream review surface manageable. |
Stack dependency
This is slice 15 of 15. It follows Feature/Fix: Diagnose Codex branch-frontier collisions; review and merge that PR first.
Summary
This is another isolated component of the planned scanner rearchitecture tracked in #10. It keeps lineage accounting in shadow mode and does not remove the legacy fallback.
Real-data validation
On the retained 570-document / 819,779-observation corpus, daily UTC totals stayed identical while lineage runtime fell from about 225s in the instrumented baseline to about 164s. Compared with the earlier roughly 360s replay, the current path is about 54% faster. Family reconciliation dropped from 72.4s to 15.2s; discovery and document loading remain the next performance constraints.
Tests
swift test --filter CodexLineageEngineTests --filter CodexLineageTwoPassDiscoveryTests --filter CodexLineageLedgerTestsmake checkmake test(649 selections, 55/55 groups, no failures, retries, or timeouts)Final UTC comparison
The figures below compare completed UTC days from July 9 through July 11. Positive percentages are overcounts versus OpenAI; negative percentages are undercounts.
Sources and interpretation
This is materially closer to reality in aggregate, but it is not presented as exact. July 9 remains 10.40% low and July 11 remains 4.40% high, so legacy removal stays blocked behind further real-world validation and the rollback path remains intact.
Related investigation: steipete/CodexBar#2037.