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`](docs/product/arena-v2.md) and the **`## TimeArena v2 (GitLab #260)`** section of [`docs/testing/invariants-and-business-logic.md`](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](https://gitlab.com/PlasticDigits/yieldomega/-/issues/238). Follow-up from [#260](https://gitlab.com/PlasticDigits/yieldomega/-/issues/260) (Arena QA closure note). --- ## Current codebase ### Primary target | Asset | State | |-------|--------| | [`docs/testing/invariants-and-business-logic.md`](docs/testing/invariants-and-business-logic.md) | ~1,668 lines. **Kept:** Stage 2 run matrix, **TimeArena v2** `INV-TIME-ARENA-*` table (#260), cross-cutting indexer/frontend invariants (#95, #96, #140, #157, …), Anvil E2E (#87). **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`](docs/testing/manual-qa-checklists.md) | Many checklist sections still target `/timecurve/arena`, post-end settlement, FeeRouter, and retired flows (#79, #78, #129, …). | | [`docs/testing/e2e-anvil.md`](docs/testing/e2e-anvil.md) | Partially updated for `anvil-arena-*`; may still reference retired env or specs. | | [`docs/frontend/timecurve-views.md`](docs/frontend/timecurve-views.md) | Extensive v1 sale-phase and Arena PvP copy; overlaps with `/arena` + `TimeArenaPage` after #256. | | [`docs/testing/contract-fork-smoke.md`](docs/testing/contract-fork-smoke.md) | Documents `TimeCurveFork` smoke. | | [`docs/onchain/fee-routing-and-governance.md`](docs/onchain/fee-routing-and-governance.md) | FeeRouter-centric; retired per [#244](https://gitlab.com/PlasticDigits/yieldomega/-/issues/244). | | [`docs/product/primitives.md`](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`](contracts/script/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](https://gitlab.com/PlasticDigits/yieldomega/-/issues/260)). | | **Frontend** | Primary route **`/arena`**; `arenaV2SaleSessionBridge`; `e2e/anvil-arena-*.spec.ts`. | | **Guardrails** | [`.cursor/skills/yieldomega-guardrails/SKILL.md`](.cursor/skills/yieldomega-guardrails/SKILL.md) lists retired components ([#241](https://gitlab.com/PlasticDigits/yieldomega/-/issues/241)–[#244](https://gitlab.com/PlasticDigits/yieldomega/-/issues/244)). | ### 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 1. **Agent and contributor safety:** Stale invariant IDs (`INV-INDEXER-*` for `idx_timecurve_*`, post-end gate harnesses, FeeRouter rescue paths) instruct automation to preserve or test behavior that is **explicitly retired** in Arena v2. 2. **Single source of truth:** Product rules live in [`arena-v2.md`](docs/product/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). 3. **#260 completion:** QA epic added the Arena table but deferred bulk deletion; reviewers still wade through ~1,400 lines of v1 material. 4. **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 1. **Delete, do not archive:** No `docs/testing/archive/`, no “see retired doc” stub paragraphs that duplicate Arena content ([#260 plan](https://gitlab.com/PlasticDigits/yieldomega/-/issues/260)). 2. **Keep cross-cutting invariants** that still apply to Arena: per-block indexer tx ([#140](https://gitlab.com/PlasticDigits/yieldomega/-/issues/140)), wrong-network writes ([#95](https://gitlab.com/PlasticDigits/yieldomega/-/issues/95)), indexer offline backoff ([#96](https://gitlab.com/PlasticDigits/yieldomega/-/issues/96)), Anvil E2E concurrency ([#87](https://gitlab.com/PlasticDigits/yieldomega/-/issues/87)), wallet session drift ([#144](https://gitlab.com/PlasticDigits/yieldomega/-/issues/144)), public API 500 redaction ([#157](https://gitlab.com/PlasticDigits/yieldomega/-/issues/157)), ERC-20 approval sizing ([#143](https://gitlab.com/PlasticDigits/yieldomega/-/issues/143)), etc. **Rewrite** wording from “TimeCurve Simple” to “`/arena` / Arena buy surface” where the behavior is unchanged. 3. **Do not reintroduce retired onchain systems** ([#241](https://gitlab.com/PlasticDigits/yieldomega/-/issues/241)–[#244](https://gitlab.com/PlasticDigits/yieldomega/-/issues/244), [#243](https://gitlab.com/PlasticDigits/yieldomega/-/issues/243)). 4. **Referrals + presale vesting:** Keep docs/tests for **ReferralRegistry** and **DoubPresaleVesting** if still deployed; strip only **TimeCurve-attached** sale/redemption/podium semantics. 5. **WarBow:** Arena v2 WarBow is DOUB-based ([#252](https://gitlab.com/PlasticDigits/yieldomega/-/issues/252)); delete v1 CL8Y WarBow / finalize-ladder / refresh-candidate governance sections unless re-homed under Arena with updated INV IDs. 6. **AGPL** unchanged; docs-only issue (no license impact). 7. **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.md`](docs/testing/invariants-and-business-logic.md) - [`docs/testing/manual-qa-checklists.md`](docs/testing/manual-qa-checklists.md) - [`docs/testing/strategy.md`](docs/testing/strategy.md) - [`docs/testing/e2e-anvil.md`](docs/testing/e2e-anvil.md) - [`.cursor/skills/yieldomega-guardrails/SKILL.md`](.cursor/skills/yieldomega-guardrails/SKILL.md) **Likely touch (grep-driven)** - [`docs/frontend/timecurve-views.md`](docs/frontend/timecurve-views.md) — trim to `/arena`, protocol panels still used, or delete file if fully superseded - [`docs/testing/contract-fork-smoke.md`](docs/testing/contract-fork-smoke.md) - [`docs/onchain/fee-routing-and-governance.md`](docs/onchain/fee-routing-and-governance.md) — delete or replace with pointer to Arena vault routing - [`docs/product/primitives.md`](docs/product/primitives.md) — remove / relocate TimeCurve-only anchors - [`docs/indexer/design.md`](docs/indexer/design.md) — remove `GET /v1/timecurve/*` sections superseded by `/v1/arena/*` - [`docs/README.md`](docs/README.md), [`docs/agent-phases.md`](docs/agent-phases.md), [`docs/glossary.md`](docs/glossary.md) - Repo-wide links: `rg 'invariants-and-business-logic\.md#'` and `rg 'timecurve-views\.md#'` **Out of scope (unless dead code confirmed)** - Deleting `contracts/src/TimeCurve.sol` / `FeeRouter.sol` from repo (may remain for history/fork tests until separate retirement issue) - Changing runtime code behavior --- ## Recommended solution direction 1. **Inventory:** Script or `rg` list of `###` / `<a id=` anchors in `invariants-and-business-logic.md` tagged `TimeCurve`, `FeeRouter`, `Burrow`, `Leprechaun`, `TimeCurveBuyRouter`, `endSale`, `redeemCharms`, `distributePrizes`, `idx_timecurve`. 2. **Deletion pass:** Remove retired sections and table rows; collapse **Business logic** table to: TimeArena (link #260 table), ReferralRegistry, DoubPresaleVesting (if kept), Indexer (Arena events), Frontend (Arena routes), Dev stack, cross-cutting UX. 3. **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.md` if needed. 4. **Link rewrite:** Update manual QA TOC — drop or rewrite sections #79, #78, #129, #188, etc.; keep #260, #87, #95, referrals. 5. **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). 6. **Verification script (optional):** `scripts/check-doc-anchors.sh` — fail CI if markdown links to missing `#anchors` in invariants file. --- ## Acceptance criteria - [ ] `invariants-and-business-logic.md` has **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 / `arena-v2.md` if needed). - [ ] **TimeArena v2 (#260)** section remains complete; **Business logic** and **spec ↔ test** tables reference **TimeArena** / **ArenaPrizeRouting** / `anvil-arena-*`, not `TimeCurve.t.sol` for 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.md` returns **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.md` TOC has no duplicate rows; retired-only checklists removed or marked **superseded by #260** with link. - [ ] `yieldomega-guardrails` SKILL and `docs/testing/strategy.md` agree 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 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, #78, #129 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|FeeRouter' docs/` → zero in operator-facing paths; `.env.example` unchanged | | **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) 1. **Quantitative:** `wc -l docs/testing/invariants-and-business-logic.md` reduced by **≥40%** vs pre-change baseline (~1,668 → target **≤1,000** lines, adjust if cross-cutting sections grow). 2. **Qualitative:** Two reviewers (or author + agent with guardrails) confirm no retired economic rule remains without “retired” label. 3. **Automated:** `cd frontend && npm test` and `cd indexer && cargo test` unchanged (docs-only PR). If anchor script added, it passes in CI. 4. **Regression:** `bash scripts/e2e-anvil.sh` still passes (no doc-driven env drift). 5. **Epic linkage:** Closing comment on this issue lists deleted section count and any follow-up issues (e.g. delete `timecurve-views.md` entirely). --- ## Suggested labels / links - Epic: [#238](https://gitlab.com/PlasticDigits/yieldomega/-/issues/238) - Related: [#260](https://gitlab.com/PlasticDigits/yieldomega/-/issues/260), [#243](https://gitlab.com/PlasticDigits/yieldomega/-/issues/243), [#244](https://gitlab.com/PlasticDigits/yieldomega/-/issues/244), [#256](https://gitlab.com/PlasticDigits/yieldomega/-/issues/256)
issue