Review: Feature: current_team helper and Today view scoping (crew grouping 2/4)

review-1575-2026-06-23 Review

review ready

Verdict: READY

Template Completeness

  • [x] Type -- Feature
  • [x] Lineage -- Child of #260, sub-ticket 2 of 4, dependency on sub-ticket 1 documented
  • [x] Repo -- ldraney/landscaping-assistant
  • [x] User Story -- As a crew member / scoped Today view
  • [x] Context -- Explains relationship to sub-ticket 1 (Team model)
  • [x] File Targets -- 2 files to modify, 3 files explicitly excluded
  • [x] Feature Flag -- "none" (internal model/controller change, appropriate)
  • [x] Acceptance Criteria -- 6 criteria
  • [x] Test Expectations -- 3 test cases + run command
  • [x] Constraints -- memoization, fallback, model validation boundary
  • [x] Checklist -- present
  • [x] Related -- parent epic and dependency referenced

Traceability

  • [x] story:auth label -- "auth" story covers role-based features including crew grouping
  • [x] story note verified -- "auth" entry found in project-landscaping-assistant user-stories section: "Log in with Keycloak, see role-appropriate tabs and features"
  • [x] arch:rails-app label -- rails-app architecture component
  • [ ] arch note MISSING -- no arch-rails-app note found in pal-e-docs. However, this is a long-standing pattern across the board (all landscaping-assistant issues use arch:rails-app). This is a systemic gap, not specific to this ticket. Acceptable for now.
  • [x] Forgejo issue -- ldraney/landscaping-assistant#263, state: open

File Targets

  • [x] app/controllers/application_controller.rb -- verified exists (114 lines). Already has current_crew_member helper (line 45-49) using the same lookup pattern. Adding current_team following this pattern is natural.
  • [x] app/controllers/work_queue_items_controller.rb -- verified exists (285 lines). All WorkQueueItem queries confirmed unscoped (no team filtering). Actions mentioned (index, create, update, destroy, mark_other, reorder) and private helpers (compute_unqueued_this_week, recent_properties) all confirmed present.
  • [x] app/controllers/days_controller.rb -- verified exists, correctly listed as NOT to touch (sub-ticket 3)
  • [x] app/controllers/weeks_controller.rb -- verified exists, correctly listed as NOT to touch (sub-ticket 3)
  • [x] app/controllers/crew_controller.rb -- verified exists, correctly listed as NOT to touch (sub-ticket 3)
Minor note: The issue describes current_team as looking up session[:username], but the existing current_crew_member pattern uses current_user[:username]. These are equivalent (current_user reads from session), but the implementing agent should follow the existing current_crew_member pattern and use current_crew_member&.team rather than duplicating the lookup.

Repo Placement

OK. Issue filed on ldraney/landscaping-assistant, all file targets are in this repo. Single-repo change.

Dependencies

  • Hard dependency: Sub-ticket 1 (#262, "Feature: Team model, migration, and associations") must merge first. Confirmed: no Team model exists yet, no team_id column on crew_members or work_queue_items, no migration. This dependency is correctly documented in the Lineage section.
  • Board item #1574 (issue #262) is in backlog column -- sub-ticket 1 has not started yet.
  • Sub-tickets 3 (#264) and 4 (#265) depend on this ticket (documented in epic #260).

Acceptance Criteria

All 6 criteria are testable by an agent:
  • "current_team returns the Team" -- unit testable via controller test
  • "current_team returns the default team if user has no CrewMember record" -- testable with fixture setup
  • "Today view index only shows WorkQueueItems for current_team" -- controller test with two teams
  • "Creating a work queue item assigns current_team.id" -- controller test
  • "Two users on the same team see the same Today list" -- integration test
  • "bundle exec rspec passes" -- run command
Test expectations align with acceptance criteria. Run command is real.

Blast Radius

  • days_controller.rb queries WorkQueueItem (6 references) -- correctly excluded, scoped to sub-ticket 3
  • weeks_controller.rb queries WorkQueueItem (4 references) -- correctly excluded, scoped to sub-ticket 3
  • schedule_digester.rb -- correctly excluded, scoped to sub-ticket 4
  • No other controllers query WorkQueueItem directly
  • Views that render WorkQueueItem data may need team-aware partials, but since the controller scopes the data, views should work without changes

Decomposition Assessment

2 file targets in 1 repo, 6 acceptance criteria (one over threshold but simple), estimated agent work under 5 minutes. This is already a sub-ticket from a decomposed epic. No further decomposition needed.

Recommendation

No action needed. Scope is solid, file targets verified, traceability complete, dependencies documented and sequenced correctly. The ticket is blocked on sub-ticket 1 (#262) which must merge first.