Docs: bulk delete legacy TimeCurve / FeeRouter invariant sections
Summary
Remove retired TimeCurve v1 sale, FeeRouter five-sink CL8Y routing, and closely coupled Burrow / Leprechaun / TimeCurveBuyRouter documentation from the contributor invariant corpus. Arena v2 economics and tests are authoritative in docs/product/arena-v2.md and the ## TimeArena v2 (GitLab #260) section of docs/testing/invariants-and-business-logic.md. The remainder of that file (~1,600+ lines) still documents retired surfaces and misleads agents, QA, and implementers.
Parent epic: #238 (closed). Follow-up from #260 (closed) (Arena QA closure note).
Current codebase
Primary target
| Asset | State |
|---|---|
docs/testing/invariants-and-business-logic.md |
~1,668 lines. Kept: Stage 2 run matrix, TimeArena v2 INV-TIME-ARENA-* table (#260 (closed)), cross-cutting indexer/frontend invariants (#95 (closed), #96 (closed), #140 (closed), #157 (closed), …), Anvil E2E (#87 (closed)). Stale: large Business logic table rows and hundreds of anchored subsections for TimeCurve sale-end/redemption/presale, FeeRouter / five-sink CL8Y, Rabbit/Burrow, Leprechaun, TimeCurveBuyRouter / Kumbaya single-tx matrix, post-end gates (endSale, redeemCharms, distributePrizes), legacy WarBow finalize / refresh-candidates flows, and Contract test suite inventory rows for retired *.t.sol files. |
docs/testing/manual-qa-checklists.md |
Many checklist sections still target /timecurve/arena, post-end settlement, FeeRouter, and retired flows (#79 (closed), #78 (closed), #129 (closed), …). |
docs/testing/e2e-anvil.md |
Partially updated for anvil-arena-*; may still reference retired env or specs. |
docs/frontend/timecurve-views.md |
Extensive v1 sale-phase and Arena PvP copy; overlaps with /arena + TimeArenaPage after #256 (closed). |
docs/testing/contract-fork-smoke.md |
Documents TimeCurveFork smoke. |
docs/onchain/fee-routing-and-governance.md |
FeeRouter-centric; retired per #244 (closed). |
docs/product/primitives.md |
TimeCurve redemption / envelope sections still linked from invariant anchors. |
Already aligned (do not regress)
| Layer | Arena v2 state |
|---|---|
| Contracts | DeployDev.s.sol deploys TimeArena + vaults only; retired cores removed from dev path. |
| Indexer | Arena-only DecodedEvent variants; baseline migrations; GET /v1/arena/*; no TimeCurve* decode (#260 (closed)). |
| Frontend | Primary route /arena; arenaV2SaleSessionBridge; e2e/anvil-arena-*.spec.ts. |
| Guardrails | .cursor/skills/yieldomega-guardrails/SKILL.md lists retired components (#241 (closed)–#244 (closed)). |
Scale (grep snapshot)
invariants-and-business-logic.md: 215+ mentions of TimeCurve / FeeRouter / related retired terms.- 31
INV-TIME-ARENA-*/ indexer-260 rows already live at top of file; must remain the canonical arena economics map.
Why this is needed
- Agent and contributor safety: Stale invariant IDs (
INV-INDEXER-*foridx_timecurve_*, post-end gate harnesses, FeeRouter rescue paths) instruct automation to preserve or test behavior that is explicitly retired in Arena v2. - Single source of truth: Product rules live in
arena-v2.md; duplicative TimeCurve prose creates contradictory guidance (e.g. sale-end vs always-live Arena, CL8Y fee splits vs DOUB 40/30/30 routing). - #260 (closed) completion: QA epic added the Arena table but deferred bulk deletion; reviewers still wade through ~1,400 lines of v1 material.
- Link hygiene: Manual QA and frontend docs link to anchors that will move or vanish; broken anchors fail CI/markdown checks and waste review time.
Constraints and guardrails
- Delete, do not archive: No
docs/testing/archive/, no “see retired doc” stub paragraphs that duplicate Arena content (#260 plan). - Keep cross-cutting invariants that still apply to Arena: per-block indexer tx (#140 (closed)), wrong-network writes (#95 (closed)), indexer offline backoff (#96 (closed)), Anvil E2E concurrency (#87 (closed)), wallet session drift (#144 (closed)), public API 500 redaction (#157 (closed)), ERC-20 approval sizing (#143 (closed)), etc. Rewrite wording from “TimeCurve Simple” to “
/arena/ Arena buy surface” where the behavior is unchanged. - Do not reintroduce retired onchain systems (#241 (closed)–#244 (closed), #243 (closed)).
- Referrals + presale vesting: Keep docs/tests for ReferralRegistry and DoubPresaleVesting if still deployed; strip only TimeCurve-attached sale/redemption/podium semantics.
- WarBow: Arena v2 WarBow is DOUB-based (#252 (closed)); delete v1 CL8Y WarBow / finalize-ladder / refresh-candidate governance sections unless re-homed under Arena with updated INV IDs.
- AGPL unchanged; docs-only issue (no license impact).
- Prefer one PR with mechanical deletion + link-rewrite; split only if diff exceeds reviewable size (>~800 lines deleted → consider PR A: invariants file, PR B: satellite docs).
Relevant files (non-exhaustive)
Must touch
docs/testing/invariants-and-business-logic.mddocs/testing/manual-qa-checklists.mddocs/testing/strategy.mddocs/testing/e2e-anvil.md.cursor/skills/yieldomega-guardrails/SKILL.md
Likely touch (grep-driven)
docs/frontend/timecurve-views.md— trim to/arena, protocol panels still used, or delete file if fully supersededdocs/testing/contract-fork-smoke.mddocs/onchain/fee-routing-and-governance.md— delete or replace with pointer to Arena vault routingdocs/product/primitives.md— remove / relocate TimeCurve-only anchorsdocs/indexer/design.md— removeGET /v1/timecurve/*sections superseded by/v1/arena/*docs/README.md,docs/agent-phases.md,docs/glossary.md- Repo-wide links:
rg 'invariants-and-business-logic\.md#'andrg 'timecurve-views\.md#'
Out of scope (unless dead code confirmed)
- Deleting
contracts/src/TimeCurve.sol/FeeRouter.solfrom repo (may remain for history/fork tests until separate retirement issue) - Changing runtime code behavior
Recommended solution direction
- Inventory: Script or
rglist of###/<a id=anchors ininvariants-and-business-logic.mdtaggedTimeCurve,FeeRouter,Burrow,Leprechaun,TimeCurveBuyRouter,endSale,redeemCharms,distributePrizes,idx_timecurve. - Deletion pass: Remove retired sections and table rows; collapse Business logic table to: TimeArena (link #260 (closed) table), ReferralRegistry, DoubPresaleVesting (if kept), Indexer (Arena events), Frontend (Arena routes), Dev stack, cross-cutting UX.
- Contract inventory: Replace Contract test suite inventory with TimeArena.t.sol, ArenaPrizeRouting.t.sol, retained referral/vesting tests; move retired file list to a one-line “historical tests in tree, not mapped” note in
strategy.mdif needed. - Link rewrite: Update manual QA TOC — drop or rewrite sections #79 (closed), #78 (closed), #129 (closed), #188 (closed), etc.; keep #260 (closed), #87 (closed), #95 (closed), referrals.
- Anchor stability: For kept cross-cutting sections, preserve existing
<a id=where possible; add redirect notes only when external links exist (prefer updating callers over redirects). - Verification script (optional):
scripts/check-doc-anchors.sh— fail CI if markdown links to missing#anchorsin invariants file.
Acceptance criteria
-
invariants-and-business-logic.mdhas no standalone sections whose primary subject is retired TimeCurve sale lifecycle, FeeRouter five-sink distribution, Burrow/Rabbit treasury, or Leprechaun (except a single cross-link to epic #238 (closed) /arena-v2.mdif needed). - TimeArena v2 (#260 (closed)) section remains complete; Business logic and spec
↔️ test tables reference TimeArena / ArenaPrizeRouting /anvil-arena-*, notTimeCurve.t.solfor arena economics. - No new
docs/testing/archive/or “removed, see below” stub paragraphs. -
rg -i 'FeeRouter|TimeCurve\.endSale|redeemCharms|idx_timecurve' docs/testing/invariants-and-business-logic.mdreturns zero matches, or only matches inside an explicit “Historical (pre–Arena v2)” appendix of ≤20 lines listing retired issue numbers (optional; default is zero). - All internal markdown links from
docs/to deleted anchors are updated or removed (CI or script green). -
manual-qa-checklists.mdTOC has no duplicate rows; retired-only checklists removed or marked superseded by #260 (closed) with link. -
yieldomega-guardrailsSKILL anddocs/testing/strategy.mdagree with post-deletion doc map.
Test plan — documentation paths
| Path | Steps | Expected |
|---|---|---|
| Invariant file read-through | Maintainer reads invariants-and-business-logic.md start-to-finish |
Every INV-* row maps to current code or manual QA; no instruction to run removed APIs |
| Agent smoke | Run Cursor agent with guardrails SKILL on “how do I test a buy?” | Agent cites /arena, TimeArena.t.sol, anvil-arena-*; does not cite endSale or FeeRouter splits |
| Link crawl | rg 'invariants-and-business-logic\.md#' docs/ + manual click sample |
No 404 anchors in GitLab rendered markdown |
| Manual QA alignment | Cross-check #260 (closed) checklist vs deleted sections | No checklist step references removed anchors |
| E2E doc | Follow e2e-anvil.md verbatim |
Matches scripts/e2e-anvil.sh env (Arena addresses only) |
| External issue refs | Open linked GitLab issues #79 (closed), #78 (closed), #129 (closed) from old docs (if any remain) | Either issue closed with link to this cleanup or doc note added on those issues |
Test plan — misuse / “attack” vectors (doc integrity)
Documentation errors are not onchain exploits but can cause wrong deployments, wrong tests, or revived retired code.
| Vector | Risk | Test |
|---|---|---|
| Revived FeeRouter wiring | Operator configures VITE_FEE_ROUTER_* from old runbooks |
`rg 'VITE_FEE_ROUTER |
| Sale-end harness | Contributor runs verify-timecurve-post-end-gates-anvil.sh from stale doc |
Script either deleted from docs or doc states obsolete; rg 'post-end-gates' docs/testing/ |
| Indexer decode regression | Doc tells indexer to persist TimeCurve Buy |
invariants states INV-INDEXER-260-NO-TIMECURVE-DECODE only; decoder.rs unchanged in same PR |
| Wrong route QA | QA tests /timecurve/arena PvP instead of /arena |
Manual QA and E2E docs primary path /arena |
| Broken anchor DoS | Broken links hide real Arena invariants | Anchor check script / markdown-link-check if available |
| Partial deletion | Half the file deleted, tables still mention TimeCurveBuyRouter |
Automated rg gates in acceptance criteria |
Verification criteria (definition of done)
- Quantitative:
wc -l docs/testing/invariants-and-business-logic.mdreduced by ≥40% vs pre-change baseline (~1,668 → target ≤1,000 lines, adjust if cross-cutting sections grow). - Qualitative: Two reviewers (or author + agent with guardrails) confirm no retired economic rule remains without “retired” label.
- Automated:
cd frontend && npm testandcd indexer && cargo testunchanged (docs-only PR). If anchor script added, it passes in CI. - Regression:
bash scripts/e2e-anvil.shstill passes (no doc-driven env drift). - Epic linkage: Closing comment on this issue lists deleted section count and any follow-up issues (e.g. delete
timecurve-views.mdentirely).
Suggested labels / links
- Epic: #238 (closed)
- Related: #260 (closed), #243 (closed), #244 (closed), #256 (closed)