Repository navigation
Closed as not planned
Labels
automatedAutomatically generated by scheduled taskscomplexity-lowComplexity: low (board points 1-3)priority-p1Critical paththeme-reliabilityTheme: Reliabilitytype-bugBug fix
Description
Automated Architecture Validation Report
Date: 2026-04-30
Result: 5 critical violations require attention (4 P0-P1 invariants failing)
Critical Findings (P0-P1)
Invariant 1: Three-Layer Backend — Router → Service → DB (FAIL)
Routers contain raw SQL that belongs in the DB layer:
src/backend/routers/voice.py:177—cursor.execute("UPDATE agent_ownership...")src/backend/routers/voice.py:306—cursor.execute("SELECT voice_system_prompt...")src/backend/routers/triggers.py:254—cursor.execute("SELECT * FROM process_schedules...")src/backend/routers/processes.py:780—CREATE TABLE IF NOT EXISTS process_schedulessrc/backend/routers/processes.py:819—INSERT OR REPLACE INTO process_schedulessrc/backend/routers/processes.py:865—DELETE FROM process_schedules
Invariant 3: Schema in db/schema.py, Migrations in db/migrations.py (FAIL)
CREATE TABLE statements found outside the designated schema files:
src/backend/routers/processes.py:780— createsprocess_schedulestable ad-hocsrc/backend/services/process_engine/services/templates.py:117— createsprocess_templatestable ad-hocsrc/backend/services/process_engine/services/alerts.py:163,178— createscost_thresholdsandcost_alertstables ad-hoc
Invariant 8: Auth Pattern — Missing authentication (FAIL)
Route handlers found without get_current_user, AuthorizedAgent, or OwnedAgentByName:
src/backend/routers/executions.py:320—@router.post("/processes/{process_id}/execute")missing auth dependency (HIGH RISK — unauthenticated process execution)
Invariant 13: Credentials Never Stored in DB (FAIL)
Plaintext credential found in schema:
src/backend/db/schema.py:537—slack_bot_token TEXT NOT NULLinslack_link_connectionstable stores Slack bot token as plaintextsrc/backend/db/slack.py:38-42— Direct INSERT without encryption- Should follow the
subscription_credentialspattern using AES-256-GCM encryption
Additional Non-Critical Findings (P2-P3)
- Invariant 6 (Frontend Store Pattern):
ProcessList.vue,ProcessWizard.vue,ProcessEditor.vueimportapidirectly instead of routing through Pinia stores - Invariant 7 (Single API Client): Multiple views use raw
fetch()instead ofapiclient (ApiKeys.vue,AgentDetail.vue,Approvals.vue,ExecutionTimeline.vue,ProcessEditor.vue,ProcessDocs.vue) - Invariant 15 (Pydantic Models Centralized): 91+ Pydantic models scattered across 25+ router files instead of centralized in
models.py
Recommended Actions
- [P1] Fix SQL in routers — Move
voice.pyandtriggers.pySQL to DB layer classes; refactorprocesses.pyprocess_schedules operations intodb/module - [P1] Fix ad-hoc CREATE TABLE — Move
process_schedules,process_templates,cost_thresholds,cost_alertsDDL intodb/schema.pywith versioned migration indb/migrations.py - [P1] Fix missing auth on process execute endpoint — Add
current_user: CurrentUserdependency toexecutions.py:320 - [P0] Encrypt slack_bot_token — Use AES-256-GCM encryption (same pattern as
subscription_credentials) forslack_link_connections.slack_bot_token - [P2] Refactor Process views — Move API calls from
ProcessList.vue,ProcessWizard.vue,ProcessEditor.vueinto Pinia stores - [P3] Replace fetch() with api client — Standardize views to use
api.jsAxios instance - [P3] Centralize Pydantic models — Migrate models from router files to
models.py
Generated by scheduled /validate-architecture run
Metadata
Metadata
Assignees
Labels
automatedAutomatically generated by scheduled taskscomplexity-lowComplexity: low (board points 1-3)priority-p1Critical paththeme-reliabilityTheme: Reliabilitytype-bugBug fix
Activity
vybe commentedon May 5, 2026
Closing as duplicate of #654 (Architecture drift). The daily validation process should update a single tracking issue rather than creating new ones each run.