docs: verify #283 — cross-link hybrid route cache discount tier in invariants/skills #764

Merged
PlasticDigits merged 1 commit from cursor/verify-issue-283-cache-tier-docs-2432 into main 2026-06-05 04:14:42 +00:00
PlasticDigits commented 2026-06-05 04:03:58 +00:00 (Migrated from gitlab.com)

Summary

Verified GitLab #283 (hybrid solver cache key must include resolved discount tier). The code fix landed in MR !751 (a6ac683); this MR closes a docs/skills drift gap: invariants and agent skills still described hybrid GET cache keys as trader|none only, without the discount_tier segment added by #283.

Updates:

  • docs/indexer-invariants.md — route GET cache key row now documents discount_tier resolution (trader if set, else sender; unknown → 0) and links #283.
  • docs/integrators.md — L8 fee-discount paragraph cross-links #283 tier-based cache sharing.
  • skills/AGENTS_HYBRID_QUOTING.md — rule #7 + canonical docs + test command for hybrid_cache_key unit tests.
  • skills/AGENTS_INDEXER_HYBRID_BEST_EXECUTION.md — related invariants link.

Verification checklist (acceptance → command/output)

Item Result How verified
AC: Two senders with same trader unset but different discount eligibility get distinct cached quotes PASS resolve_discount_tier uses trader.or(sender) → traders.tier_id; hybrid_cache_key appends |t{tier}; unit test hybrid_cache_key_distinguishes_discount_tier asserts tier0 ≠ tier5
Comment: Same discount tier reuses cache regardless of address PASS Same test asserts tier5 key equals for two different sender addresses with tier 5
Comment: hybrid_cache_key stays pure/sync; tier lookup in caller PASS Code review: resolve_discount_tier async in execute_hybrid_route_solve; hybrid_cache_key is sync fn taking discount_tier: i16
Comment: maybe_simulate forwards trader + sender to router sim PASS Code review route_solver.rs maybe_simulate
Caveat (accepted): trusted-router path (sender≠trader, key on both tiers) SKIP (deferred #279) Explicitly scoped out in issue comments and MR !751
Caveat (accepted): tier_id sync staleness (~600s) PASS (accepted-class) Documented in issue; chain enforces real fee at execute
Unit tests hybrid_cache_key_* PASS cd indexer && cargo test hybrid_cache_key --lib → 2 passed
Indexer lib tests PASS cd indexer && cargo test --lib → 98 passed
Route solve integration tests PASS cd indexer && cargo test --test api_route_solve -j 1 -- --test-threads=1 → 19 passed
Fee discount tier docs drift PASS python3 scripts/check_fee_discount_tier_docs.py → OK
Docs/skills cross-links for #283 cache tier PASS (this MR) Updated 4 files

Follow-ups

  • #279: Key hybrid cache on both trader and sender tiers when is_trusted_router path applies (sender≠trader).
  • Optional integration test seeding two traders rows with different tier_id and asserting HTTP cache isolation.

Related to #283

## Summary Verified GitLab **#283** (hybrid solver cache key must include resolved discount tier). The code fix landed in MR !751 (`a6ac683`); this MR closes a **docs/skills drift** gap: invariants and agent skills still described hybrid GET cache keys as `trader|none` only, without the `discount_tier` segment added by #283. Updates: - `docs/indexer-invariants.md` — route GET cache key row now documents `discount_tier` resolution (`trader` if set, else `sender`; unknown → 0) and links #283. - `docs/integrators.md` — L8 fee-discount paragraph cross-links #283 tier-based cache sharing. - `skills/AGENTS_HYBRID_QUOTING.md` — rule #7 + canonical docs + test command for `hybrid_cache_key` unit tests. - `skills/AGENTS_INDEXER_HYBRID_BEST_EXECUTION.md` — related invariants link. ## Verification checklist (acceptance → command/output) | Item | Result | How verified | |------|--------|--------------| | **AC:** Two senders with same `trader` unset but different discount eligibility get distinct cached quotes | **PASS** | `resolve_discount_tier` uses `trader.or(sender)` → `traders.tier_id`; `hybrid_cache_key` appends `\|t{tier}`; unit test `hybrid_cache_key_distinguishes_discount_tier` asserts tier0 ≠ tier5 | | **Comment:** Same discount tier reuses cache regardless of address | **PASS** | Same test asserts `tier5` key equals for two different `sender` addresses with tier 5 | | **Comment:** `hybrid_cache_key` stays pure/sync; tier lookup in caller | **PASS** | Code review: `resolve_discount_tier` async in `execute_hybrid_route_solve`; `hybrid_cache_key` is sync fn taking `discount_tier: i16` | | **Comment:** `maybe_simulate` forwards `trader` + `sender` to router sim | **PASS** | Code review `route_solver.rs` `maybe_simulate` | | **Caveat (accepted):** trusted-router path (`sender≠trader`, key on both tiers) | **SKIP (deferred #279)** | Explicitly scoped out in issue comments and MR !751 | | **Caveat (accepted):** `tier_id` sync staleness (~600s) | **PASS (accepted-class)** | Documented in issue; chain enforces real fee at execute | | Unit tests `hybrid_cache_key_*` | **PASS** | `cd indexer && cargo test hybrid_cache_key --lib` → 2 passed | | Indexer lib tests | **PASS** | `cd indexer && cargo test --lib` → 98 passed | | Route solve integration tests | **PASS** | `cd indexer && cargo test --test api_route_solve -j 1 -- --test-threads=1` → 19 passed | | Fee discount tier docs drift | **PASS** | `python3 scripts/check_fee_discount_tier_docs.py` → OK | | Docs/skills cross-links for #283 cache tier | **PASS (this MR)** | Updated 4 files | ## Follow-ups - **#279:** Key hybrid cache on both `trader` and `sender` tiers when `is_trusted_router` path applies (`sender≠trader`). - Optional integration test seeding two `traders` rows with different `tier_id` and asserting HTTP cache isolation. Related to #283
PlasticDigits commented 2026-06-05 04:04:09 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-06-05 04:05:06 +00:00 (Migrated from gitlab.com)

Security review

Commit reviewed: faccef2512ed21801d7798e3290580b84884330b

Scope: Documentation and agent-skills updates only — 4 Markdown files (docs/indexer-invariants.md, docs/integrators.md, skills/AGENTS_HYBRID_QUOTING.md, skills/AGENTS_INDEXER_HYBRID_BEST_EXECUTION.md). Cross-links GitLab #283 (hybrid GET route cache key includes resolved discount_tier). No application code, dependencies, CI, or configuration changes in this diff.

Method: Full MR diff reviewed. Traced whether added text introduces attacker-controlled sinks (injection, XSS, SSRF, auth bypass, secret exposure, unsafe deserialization). Unchanged runtime code was not re-audited; the described #283 cache-key behavior was already implemented in MR !751.

Outcome: FINDINGS: 0 medium+

Security review: no medium+ findings on this diff.

Inline threads: None (no findings to anchor).

Notes: Changes are descriptive only (cache key composition, tier resolution, test command). They document a correctness fix that prevents cross-tier cache collision; they do not alter HTTP handlers, auth, or data paths. Residual accepted caveats (#279 trusted-router dual-tier key, tier sync staleness) are pre-existing and out of scope for this docs MR.

## Security review **Commit reviewed:** `faccef2512ed21801d7798e3290580b84884330b` **Scope:** Documentation and agent-skills updates only — 4 Markdown files (`docs/indexer-invariants.md`, `docs/integrators.md`, `skills/AGENTS_HYBRID_QUOTING.md`, `skills/AGENTS_INDEXER_HYBRID_BEST_EXECUTION.md`). Cross-links GitLab #283 (hybrid GET route cache key includes resolved `discount_tier`). No application code, dependencies, CI, or configuration changes in this diff. **Method:** Full MR diff reviewed. Traced whether added text introduces attacker-controlled sinks (injection, XSS, SSRF, auth bypass, secret exposure, unsafe deserialization). Unchanged runtime code was not re-audited; the described #283 cache-key behavior was already implemented in MR !751. **Outcome:** `FINDINGS: 0` medium+ Security review: **no medium+ findings** on this diff. **Inline threads:** None (no findings to anchor). **Notes:** Changes are descriptive only (cache key composition, tier resolution, test command). They document a correctness fix that prevents cross-tier cache collision; they do not alter HTTP handlers, auth, or data paths. Residual accepted caveats (#279 trusted-router dual-tier key, tier sync staleness) are pre-existing and out of scope for this docs MR.
PlasticDigits commented 2026-06-05 04:14:43 +00:00 (Migrated from gitlab.com)

mentioned in commit 6420a7747d

mentioned in commit 6420a7747d6465f85e980e6e3856c3ea1d6e4cdf
PlasticDigits (Migrated from gitlab.com) merged commit 6420a7747d into main 2026-06-05 04:14:43 +00:00
PlasticDigits commented 2026-06-05 05:52:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #303

mentioned in issue #303
Brouie commented 2026-06-05 06:14:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #283

mentioned in issue #283
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!764
No description provided.