Review: Crew tab: admin oversight of team members and their daily lists
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type
- [x] Lineage
- [x] Repo
- [x] User Story
- [x] Context
- [x] File Targets
- [x] Acceptance Criteria
- [x] Test Expectations
- [x] Constraints
- [x] Out of Scope
- [x] Checklist
- [x] Related
Traceability
- [x] story:auth label -- present on board item
- [ ] story note MISSING -- no "auth" entry in project-landscaping-assistant user-stories section. [SCOPE] Create user story entry for "auth" on project-landscaping-assistant. Known gap, deferred per caller context.
- [x] arch:rails-app label -- present on board item
- [ ] arch note MISSING -- no arch-rails-app note found in pal-e-docs. [SCOPE] Create architecture note arch-rails-app. Known gap, deferred per caller context.
- [x] Forgejo issue -- ldraney/landscaping-assistant#117, open
File Targets
Files to modify (all verified to exist):
- [x]
app/controllers/crew_controller.rb-- verified: placeholder controller withrequire_role :admin, :super_adminand empty index action - [x]
app/views/crew/index.html.erb-- verified: placeholder view with "coming soon" text - [x]
config/routes.rb-- verified:resources :crew, only: [:index]at line 37, needs :show added - [x]
app/assets/stylesheets/application.css-- verified: exists
Files to create (all verified to not yet exist):
- [x]
db/migrate/YYYYMMDD_create_crew_members.rb-- does not exist yet, correct - [x]
app/models/crew_member.rb-- does not exist yet, correct - [x]
app/views/crew/show.html.erb-- does not exist yet, correct - [x]
spec/requests/crew_spec.rb-- exists (60 lines from PR #136), ticket says "expand existing specs", correct - [x]
spec/models/crew_member_spec.rb-- does not exist yet, correct - [x]
lib/tasks/crew.rake-- does not exist yet, correct. Pattern matches existingfeature_flags.rakewith find_or_create_by! idiom.
Repo Placement
OK. Issue filed on ldraney/landscaping-assistant, all file targets are in the same repo. Single-repo change.
Dependencies
- PR #136 (done) -- created the Crew tab skeleton. Board item #1354 is in done column. Dependency satisfied.
- Board item #1317 (#107, done) -- parent issue for role-based tab visibility. Dependency satisfied.
- Board item #1337 (#115, done) -- Phase 1 Keycloak login. Dependency satisfied.
- #137 (backlog) -- Person icon views. Sibling phase:2 work, no blocking dependency.
- Solid Cable #2 (backlog) -- correctly listed as out of scope.
- No undocumented blocking dependencies found.
Acceptance Criteria
Critical data model gap found.
- [x] "Crew index shows list of all active crew members with their role" -- testable, depends on CrewMember model (will be created)
- [ ] "Clicking a crew member shows their Today queue (work_queue_items for that user's date)" -- PROBLEM:
WorkQueueItemcurrently has no user/username/crew_member_id column. The model only hasproperty_id,work_date,position,completed. There is no way to filter work_queue_items by crew member without adding a migration to add a foreign key. The ticket does not mention this prerequisite migration. - [x] "Admin and super_admin can access Crew tab; all other roles get 404" -- testable, role gating already in place
- [x] "CrewMember model with validations and crew:sync rake task" -- testable
- [ ] "Crew member list shows completion count (X/Y properties done today)" -- same problem as AC #2: without a user column on work_queue_items, there is no way to attribute completed properties to a specific crew member
Blast Radius
WorkQueueItemis used byWorkQueueItemsController(member+ access), Today tab views, and Week tab views. Adding a username/crew_member column would affect queries in those controllers. The ticket's Out of Scope correctly excludes real-time updates and Week tab per-member breakdown, limiting blast radius.- Existing
spec/requests/role_access_spec.rbhas crew access tests that will need updating if the show action is added. - Nav layout in
app/views/layouts/application.html.erbalready handles crew tab visibility (line 85-86), no changes needed there.
Decomposition Assessment
6 files to create + 4 to modify = 10 file targets. 5 acceptance criteria. Single repo. Estimated agent work: ~8-10 minutes due to new model, migration, two views, rake task, and expanded specs. This is borderline but manageable as a single pass if the data model gap is resolved in the ticket scope. No decomposition needed -- the work is cohesive and tightly coupled.
Recommendations
- [BODY] Add a migration to the File Targets section:
db/migrate/YYYYMMDD_add_username_to_work_queue_items.rbadding ausername(string, nullable, indexed) column towork_queue_items. Without this, AC #2 and AC #5 (per-member Today queue and completion counts) are impossible. Alternatively, clarify in Context that the show view queries all work_queue_items for the date (not per-member), and adjust AC #2 and #5 accordingly. - [BODY] Add
spec/requests/role_access_spec.rbto "Files to modify" -- the new/crew/:idshow route will need role access test coverage in the existing role matrix spec. - [SCOPE] (deferred) Create user story entry for "auth" on project-landscaping-assistant user-stories section.
- [SCOPE] (deferred) Create architecture note arch-rails-app.