Review: Add evening-only time filter to Live Edge

review-1846-2026-07-10 Review

review needs-refinement

Verdict: NEEDS_REFINEMENT

The ticket is well-scoped and all code claims verify against the codebase. Two traceability backing notes are missing, preventing a READY verdict.

Template Completeness

  • [x] Type (Feature)
  • [x] Lineage
  • [x] Repo
  • [x] User Story
  • [x] Context
  • [x] File Targets
  • [x] Feature Flag (none -- acceptable, no feature flag doc in repo)
  • [x] Acceptance Criteria
  • [x] Test Expectations
  • [x] Constraints
  • [x] Checklist
  • [x] Related

Traceability

  • [x] story:bot-strategy label -- present on board item
  • [ ] story note MISSING -- [SCOPE] project-botfire has no user-stories section. Create user story entry on project-botfire user-stories section.
  • [x] arch:bots label -- present on board item
  • [ ] arch note MISSING -- [SCOPE] arch-bots note does not exist in pal-e-docs. project-botfire references it but the note was never created. Create architecture note arch-bots.
  • [x] Forgejo issue -- ldraney/botfire#12, open

File Targets

  • [x] app/services/bot_engine.rb -- verified: exists (7.9k), execute_action defined at line 158, called at line 65 inside evaluate_bot. Natural gate insertion point is line 64 (before call) or top of evaluate_bot at line 44.
  • [x] app/models/bot.rb -- verified: exists (319 bytes), simple model with sports_filter serialization. No active_hours columns in schema yet. Ticket Constraints section says a BOT_ACTIVE_HOURS hash in bot_engine.rb is acceptable (no migration needed).

Repo Placement

OK. Issue says ldraney/botfire, filed on ldraney/botfire. Single-repo change, no cross-repo concerns.

Dependencies

  • Parent spike #11 (board item #1845) is complete, in QA column. This ticket was spawned from it.
  • Sibling tickets #13 (item #1847) and #14 (item #1848) were also spawned from #11 but are independent -- no ordering dependency.
  • No blocking items in in_progress column.

Acceptance Criteria

4 AC, all agent-verifiable:
  • [x] "Live Edge does not fire on games outside 12pm-midnight MDT" -- testable with time stubbing
  • [x] "Time window is configurable per bot" -- testable by checking hash/config structure
  • [x] "Skipped trades are logged with reason 'outside active hours'" -- testable by capturing log output
  • [x] "Existing trigger logic unchanged" -- testable by verifying trigger evaluation still called normally inside window
Test command bin/rails test is valid. Existing test pattern in test/services/volatility_bot_test.rb provides a fixture template. No bot_engine_test.rb exists yet -- agent will create one.
Note: Title says "evening-only" but AC defines 12pm-midnight MDT (wider than evening). The AC is the authoritative spec; the title is colloquial. Not a conflict.

Blast Radius

Low. The time gate is a pre-filter in evaluate_bot before any trigger evaluation or order placement. No downstream consumers affected. Dashboard (index.html.erb) correctly excluded from scope. App timezone is currently UTC (commented out in config/application.rb); the agent must use explicit Time.use_zone("America/Denver") or in_time_zone calls rather than relying on Time.zone.

Decomposition Assessment

No decomposition needed. 2 file targets in 1 repo, 4 AC, estimated agent work well under 5 minutes. Straightforward pre-filter gate pattern.

Recommendations

  • [SCOPE] Create user-stories section on project-botfire with the bot-strategy story entry.
  • [SCOPE] Create architecture note arch-bots for the bots component (project-botfire already references it but the note does not exist).