Update app-architecture.md to reflect actual codebase state #254

Open
ldraney wants to merge 3 commits from docs/update-app-architecture into main
Owner

Summary

  • Update ERD to reflect real db/schema.rb: add CrewMember, DailyNote, DayExclusion, FeatureFlag, ServiceRequest
  • Move aspirational models (Business, UserBusiness, PropertyComment) to a "Planned" section
  • Add missing controllers, services, and Stimulus controllers to Rails structure

Changes

  • docs/app-architecture.md -- ERD rebuilt from actual schema, model descriptions rewritten, Rails structure updated with all controllers/Stimulus controllers, key design decisions updated for global auth enforcement and schedule digestion

Test Plan

  • Docs-only change, no code impact
  • Verify mermaid ERD renders correctly
  • Confirm all listed files/models exist in codebase

Review Checklist

  • Passed automated review-fix loop
  • No secrets committed
  • No unnecessary file changes
  • Commit messages are descriptive
  • Feature flag needed? No -- docs-only change
  • Closes #253
  • landscaping-assistant -- project this affects
## Summary - Update ERD to reflect real `db/schema.rb`: add CrewMember, DailyNote, DayExclusion, FeatureFlag, ServiceRequest - Move aspirational models (Business, UserBusiness, PropertyComment) to a "Planned" section - Add missing controllers, services, and Stimulus controllers to Rails structure ## Changes - `docs/app-architecture.md` -- ERD rebuilt from actual schema, model descriptions rewritten, Rails structure updated with all controllers/Stimulus controllers, key design decisions updated for global auth enforcement and schedule digestion ## Test Plan - [ ] Docs-only change, no code impact - [ ] Verify mermaid ERD renders correctly - [ ] Confirm all listed files/models exist in codebase ## Review Checklist - [ ] Passed automated review-fix loop - [ ] No secrets committed - [ ] No unnecessary file changes - [ ] Commit messages are descriptive - [ ] Feature flag needed? No -- docs-only change ## Related Notes - Closes #253 - `landscaping-assistant` -- project this affects
Update app-architecture.md to reflect actual codebase state
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline was successful
CI / scan_ruby (pull_request) Waiting to run
CI / scan_js (pull_request) Waiting to run
CI / lint (pull_request) Waiting to run
ci/woodpecker/pr/woodpecker Pipeline was successful
c9ecf713f6
ERD and Rails structure sections were showing aspirational models
(Business, UserBusiness, PropertyComment) that don't exist yet, while
missing real models added over the past month: CrewMember, DailyNote,
DayExclusion, FeatureFlag, ServiceRequest. Controllers (DaysController,
ProfileController) and 7 Stimulus controllers were also missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

PR #254 Review

DOMAIN REVIEW

Docs-only PR updating docs/app-architecture.md. Verified all documentation claims against the actual codebase (db/schema.rb, controllers, models, services, Stimulus controllers, views).

ERD accuracy: All 11 tables in the ERD (CrewMember, Property, Service, PropertyService, WorkQueueItem, DailyNote, DayExclusion, ServiceRequest, Upload, FeatureFlag, PaperTrailVersion) match db/schema.rb column-for-column. The "Planned" section correctly identifies Business, UserBusiness, and PropertyComment as not-yet-implemented -- none of those models or tables exist.

Model descriptions: Accurate. WorkQueueItem is correctly described as keyed by property + work_date (matching the unique index). ServiceRequest state machine description matches the model. FeatureFlag caching description aligns with prior PRs.

Key Design Decisions: Updated accurately -- Auth Code + PKCE, global auth enforcement, schedule digestion via Claude Vision, DayExclusion for suggestion hygiene all reflect the current codebase.

BLOCKERS

None. This is a docs-only change with no code impact.

NITS

  1. nominatim_service.rb listed but does not exist. The services section documents nominatim_service.rb as "HTTP client for geocoding" but this file does not exist in app/services/. It may have been removed or never created. Should be removed from the docs or noted as planned.

  2. keycloak_admin_service.rb exists but is not documented. app/services/keycloak_admin_service.rb is a live service (Keycloak user lookup/update via admin API) but is not listed in the Rails Structure services section.

  3. join_crew_controller.rb and its view exist but are not documented. app/controllers/join_crew_controller.rb and app/views/join_crew/index.html.erb are present in the codebase but omitted from the Rails Structure. This may be intentional if the feature is dormant, but the architecture doc should note it or explicitly mark it as deprecated.

  4. platform/feature_flags_controller.rb not in Rails Structure. The docs mention the super_admin UI at /platform/feature_flags in the FeatureFlag model description, but the controller itself (app/controllers/platform/feature_flags_controller.rb) is not listed in the controllers section.

  5. Missing view directories. The views section omits uploads/, pwa/, shared/, and platform/ directories, all of which exist under app/views/.

SOP COMPLIANCE

  • PR body has: Summary, Changes, Test Plan, Related
  • Review Checklist present
  • No secrets committed
  • No unnecessary file changes (single file, docs-only)
  • Commit messages are descriptive
  • Scope is tight -- only docs/app-architecture.md changed

PROCESS OBSERVATIONS

Good documentation hygiene -- keeping architecture docs in sync with the codebase reduces onboarding friction and prevents stale docs from misleading future development. The ERD rebuild from db/schema.rb is the right approach. The five nits above are minor completeness gaps that would make this a fully accurate snapshot of the codebase.

VERDICT: APPROVED

The core documentation is accurate. ERD matches the schema, model descriptions match reality, design decisions reflect current state. The five nits are minor omissions that do not block merge but would improve completeness if addressed.

## PR #254 Review ### DOMAIN REVIEW Docs-only PR updating `docs/app-architecture.md`. Verified all documentation claims against the actual codebase (`db/schema.rb`, controllers, models, services, Stimulus controllers, views). **ERD accuracy**: All 11 tables in the ERD (CrewMember, Property, Service, PropertyService, WorkQueueItem, DailyNote, DayExclusion, ServiceRequest, Upload, FeatureFlag, PaperTrailVersion) match `db/schema.rb` column-for-column. The "Planned" section correctly identifies Business, UserBusiness, and PropertyComment as not-yet-implemented -- none of those models or tables exist. **Model descriptions**: Accurate. WorkQueueItem is correctly described as keyed by property + work_date (matching the unique index). ServiceRequest state machine description matches the model. FeatureFlag caching description aligns with prior PRs. **Key Design Decisions**: Updated accurately -- Auth Code + PKCE, global auth enforcement, schedule digestion via Claude Vision, DayExclusion for suggestion hygiene all reflect the current codebase. ### BLOCKERS None. This is a docs-only change with no code impact. ### NITS 1. **`nominatim_service.rb` listed but does not exist.** The services section documents `nominatim_service.rb` as "HTTP client for geocoding" but this file does not exist in `app/services/`. It may have been removed or never created. Should be removed from the docs or noted as planned. 2. **`keycloak_admin_service.rb` exists but is not documented.** `app/services/keycloak_admin_service.rb` is a live service (Keycloak user lookup/update via admin API) but is not listed in the Rails Structure services section. 3. **`join_crew_controller.rb` and its view exist but are not documented.** `app/controllers/join_crew_controller.rb` and `app/views/join_crew/index.html.erb` are present in the codebase but omitted from the Rails Structure. This may be intentional if the feature is dormant, but the architecture doc should note it or explicitly mark it as deprecated. 4. **`platform/feature_flags_controller.rb` not in Rails Structure.** The docs mention the super_admin UI at `/platform/feature_flags` in the FeatureFlag model description, but the controller itself (`app/controllers/platform/feature_flags_controller.rb`) is not listed in the controllers section. 5. **Missing view directories.** The views section omits `uploads/`, `pwa/`, `shared/`, and `platform/` directories, all of which exist under `app/views/`. ### SOP COMPLIANCE - [x] PR body has: Summary, Changes, Test Plan, Related - [x] Review Checklist present - [x] No secrets committed - [x] No unnecessary file changes (single file, docs-only) - [x] Commit messages are descriptive - [x] Scope is tight -- only `docs/app-architecture.md` changed ### PROCESS OBSERVATIONS Good documentation hygiene -- keeping architecture docs in sync with the codebase reduces onboarding friction and prevents stale docs from misleading future development. The ERD rebuild from `db/schema.rb` is the right approach. The five nits above are minor completeness gaps that would make this a fully accurate snapshot of the codebase. ### VERDICT: APPROVED The core documentation is accurate. ERD matches the schema, model descriptions match reality, design decisions reflect current state. The five nits are minor omissions that do not block merge but would improve completeness if addressed.
Address QA nits: add missing controllers and fix services list
Some checks are pending
CI / scan_ruby (pull_request) Waiting to run
CI / scan_js (pull_request) Waiting to run
CI / lint (pull_request) Waiting to run
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
bc906cece4
Add join_crew_controller, platform/feature_flags_controller. Replace
nominatim_service (doesn't exist) with keycloak_admin_service (does).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing view directories: uploads, join_crew, platform, shared
Some checks are pending
CI / scan_ruby (pull_request) Waiting to run
CI / scan_js (pull_request) Waiting to run
CI / lint (pull_request) Waiting to run
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
1b065c99c0
Addresses remaining QA nits — all view directories in app/views/
are now documented in the Rails Structure section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

PR #254 Re-Review

PREVIOUS NITS -- VERIFICATION

All 5 nits from the prior review have been resolved:

  1. nominatim_service.rb replaced with keycloak_admin_service.rb -- Services section now references keycloak_admin_service.rb, which exists in the codebase. The non-existent nominatim_service.rb is gone. RESOLVED.
  2. keycloak_admin_service.rb documented -- Now has description comment: # Keycloak user management API. RESOLVED.
  3. join_crew_controller.rb added -- Listed in controllers section with # Join-a-crew form (client role). RESOLVED.
  4. platform/feature_flags_controller.rb added -- Listed in controllers section with # Feature flag admin (super_admin). RESOLVED.
  5. View directories added -- uploads/, profile/, join_crew/, platform/feature_flags/, and shared/ all present in the views section. RESOLVED.

DOMAIN REVIEW

Docs-only change (1 file: docs/app-architecture.md). Tech stack: Ruby on Rails with Hotwire/Stimulus.

ERD vs schema.rb cross-check: All 10 tables in the ERD (CrewMember, Property, Service, PropertyService, WorkQueueItem, DailyNote, DayExclusion, ServiceRequest, Upload, FeatureFlag) plus PaperTrail::Version match db/schema.rb column-for-column. Relationships match foreign key constraints. The versions.object column (text) is omitted from the ERD, which is acceptable for a high-level diagram.

File existence verification: All 49 referenced files and directories (12 controllers, 10 models, 2 services, 13 Stimulus controllers, 12 view directories) confirmed to exist in the codebase. The removed week_move_controller.js from the old docs correctly does not exist.

BLOCKERS

None.

NITS

None remaining.

SOP COMPLIANCE

  • PR body has Summary, Changes, Test Plan, Related sections
  • No secrets committed
  • No unnecessary file changes (single docs file, scoped to issue #253)
  • Commit messages are descriptive
  • Docs-only -- no code impact, no tests required

PROCESS OBSERVATIONS

Clean documentation hygiene pass. The architecture doc now reflects the real codebase rather than aspirational designs, which reduces onboarding friction and prevents stale docs from misleading future development decisions.

VERDICT: APPROVED

## PR #254 Re-Review ### PREVIOUS NITS -- VERIFICATION All 5 nits from the prior review have been resolved: 1. **nominatim_service.rb replaced with keycloak_admin_service.rb** -- Services section now references `keycloak_admin_service.rb`, which exists in the codebase. The non-existent `nominatim_service.rb` is gone. RESOLVED. 2. **keycloak_admin_service.rb documented** -- Now has description comment: `# Keycloak user management API`. RESOLVED. 3. **join_crew_controller.rb added** -- Listed in controllers section with `# Join-a-crew form (client role)`. RESOLVED. 4. **platform/feature_flags_controller.rb added** -- Listed in controllers section with `# Feature flag admin (super_admin)`. RESOLVED. 5. **View directories added** -- `uploads/`, `profile/`, `join_crew/`, `platform/feature_flags/`, and `shared/` all present in the views section. RESOLVED. ### DOMAIN REVIEW Docs-only change (1 file: `docs/app-architecture.md`). Tech stack: Ruby on Rails with Hotwire/Stimulus. **ERD vs schema.rb cross-check**: All 10 tables in the ERD (CrewMember, Property, Service, PropertyService, WorkQueueItem, DailyNote, DayExclusion, ServiceRequest, Upload, FeatureFlag) plus PaperTrail::Version match `db/schema.rb` column-for-column. Relationships match foreign key constraints. The `versions.object` column (text) is omitted from the ERD, which is acceptable for a high-level diagram. **File existence verification**: All 49 referenced files and directories (12 controllers, 10 models, 2 services, 13 Stimulus controllers, 12 view directories) confirmed to exist in the codebase. The removed `week_move_controller.js` from the old docs correctly does not exist. ### BLOCKERS None. ### NITS None remaining. ### SOP COMPLIANCE - [x] PR body has Summary, Changes, Test Plan, Related sections - [x] No secrets committed - [x] No unnecessary file changes (single docs file, scoped to issue #253) - [x] Commit messages are descriptive - [x] Docs-only -- no code impact, no tests required ### PROCESS OBSERVATIONS Clean documentation hygiene pass. The architecture doc now reflects the real codebase rather than aspirational designs, which reduces onboarding friction and prevents stale docs from misleading future development decisions. ### VERDICT: APPROVED
Some checks are pending
CI / scan_ruby (pull_request) Waiting to run
CI / scan_js (pull_request) Waiting to run
CI / lint (pull_request) Waiting to run
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin docs/update-app-architecture:docs/update-app-architecture
git switch docs/update-app-architecture

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff docs/update-app-architecture
git switch docs/update-app-architecture
git rebase main
git switch main
git merge --ff-only docs/update-app-architecture
git switch docs/update-app-architecture
git rebase main
git switch main
git merge --no-ff docs/update-app-architecture
git switch main
git merge --squash docs/update-app-architecture
git switch main
git merge --ff-only docs/update-app-architecture
git switch main
git merge docs/update-app-architecture
git push origin main
Sign in to join this conversation.
No reviewers
No labels
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
ldraney/landscaping-assistant!254
No description provided.