Review: Tighten Live Edge ceiling from 92c to 89c

review-1848-2026-07-10 Review

review needs-refinement

Verdict: NEEDS_REFINEMENT

Template Completeness

  • [x] Type -- Feature
  • [x] Lineage -- references Spike #11, supersedes #7
  • [x] Repo -- ldraney/botfire
  • [x] User Story
  • [x] Context -- includes P&L data by price band
  • [x] File Targets
  • [x] Feature Flag -- none (appropriate for DB-only change)
  • [x] Acceptance Criteria
  • [x] Test Expectations
  • [x] Constraints
  • [x] Checklist
  • [x] Related

Traceability

  • [x] story:bot-strategy label present
  • [ ] story note MISSING -- project-botfire page has no user-stories section. [SCOPE] Create user story entry on project-botfire user-stories section.
  • [x] arch:bots label present
  • [ ] arch note MISSING -- no arch-bots note found in pal-e-docs. [SCOPE] Create architecture note arch-bots for component bots.
  • [x] Forgejo issue -- ldraney/botfire#14, state: open

File Targets

  • [x] app/services/bot_engine.rb -- verified: line 135 contains return false if trigger.condition_max.present? && value > trigger.condition_max.to_f. Issue correctly says NOT to touch this file.
  • [x] db/seeds.rb -- verified: file exists but does NOT seed triggers (only users and bots). Issue correctly says "optionally if trigger defaults are seeded there" -- no change needed.
  • [x] DB change Trigger.find_by(name: "Live Edge").update!(condition_max: 89) -- the condition_max column exists (migration 20260708130000_add_condition_max_to_triggers.rb, schema.rb line 107). The Trigger model references are consistent.

Repo Placement

OK. Issue specifies ldraney/botfire and is filed on ldraney/botfire. Single-repo change.

Dependencies

  • Supersedes Issue #7 (board item #1842, marked closed/superseded)
  • Spawned from Spike #11 (board item #1845, currently in qa column, title: "Spike: Live Edge deep dive -- COMPLETED, spawned #12 #13 #14")
  • No blockers identified. No items currently in_progress that this depends on.
  • Sibling issues from same spike: #12 (board item #1846, 3pt) and #13 (board item #1847, 5pt) -- no blocking relationship.

Acceptance Criteria

3 criteria, all agent-verifiable:
  • condition_max set to 89 -- verifiable via rails runner command provided in Test Expectations
  • No entries above 89c after deploy -- verifiable by monitoring BotFire records post-deploy
  • Dashboard confirms new trades stay in 85-89c band -- verifiable via the analytics dashboard
Test command is real and correct: bin/rails runner "puts Trigger.find_by(name: 'Live Edge').condition_max"

Blast Radius

Low. condition_max is referenced in exactly 2 places:
  • bot_engine.rb:135 -- the check_late_game guard (already correct)
  • db/schema.rb:107 -- column definition
Only the Live Edge trigger uses the late_game trigger type. No other bots, services, or downstream consumers are affected. No sibling services share this pattern.

Decomposition Assessment

No decomposition needed. 1 effective file target (DB record update), 3 acceptance criteria, estimated agent time well under 5 minutes. This is a single rails runner command or a data migration.

Recommendation

  • [SCOPE] Create user-stories section on project-botfire page and add the "bot-strategy" user story entry.
  • [SCOPE] Create architecture note arch-bots for the bots component in pal-e-docs.
Core scope is solid. File targets verified, acceptance criteria testable, blast radius minimal. The two [SCOPE] items are traceability hygiene -- they do not affect the implementability of this ticket.