refactor: tech debt reduction sprint #41

Merged
chihlasm merged 2 commits from refactor/tech-debt-q1 into main 2026-02-08 19:23:49 +00:00
chihlasm commented 2026-02-08 18:29:21 +00:00 (Migrated from github.com)

Summary

  • Extract useCustomStepFlow hook from TreeNavigationPage.tsx (1,040 → 759 lines), consolidating custom step creation, continuation flow, fork flow, and branch mode state
  • Deduplicate backend helpers: created core/filters.py (shared visibility filters) and services/export_service.py (markdown/text/HTML export generation) — extracted from trees.py, steps.py, and sessions.py
  • Add GitHub Actions CI/CD pipeline with parallel backend (pytest + PostgreSQL) and frontend (lint + build) jobs
  • Add GIN index migration for full-text search on trees table (idx_trees_fts)
  • Update 8 critical Python dependencies: FastAPI 0.128.5, Pydantic 2.12.5, SQLAlchemy 2.0.46, Uvicorn 0.40.0, Alembic 1.18.3, asyncpg 0.31.0, python-multipart 0.0.22, pydantic-settings 2.12.0
  • Fix regex=pattern= deprecation in FastAPI Query() params (3 occurrences in steps.py)

Net change: +786 / -557 lines (12 files). Production code reduced by ~229 lines through extraction and deduplication.

Test plan

  • npm run build passes (zero TypeScript errors)
  • Backend imports successfully (from app.main import app)
  • Run alembic upgrade head to apply FTS index migration
  • Run full pytest suite after migration
  • Verify tree search still works in UI
  • Verify custom step flow in tree navigation (create → save → continue → fork)
  • Verify session export (markdown, text, HTML)

🤖 Generated with Claude Code

## Summary - **Extract `useCustomStepFlow` hook** from TreeNavigationPage.tsx (1,040 → 759 lines), consolidating custom step creation, continuation flow, fork flow, and branch mode state - **Deduplicate backend helpers**: created `core/filters.py` (shared visibility filters) and `services/export_service.py` (markdown/text/HTML export generation) — extracted from trees.py, steps.py, and sessions.py - **Add GitHub Actions CI/CD pipeline** with parallel backend (pytest + PostgreSQL) and frontend (lint + build) jobs - **Add GIN index migration** for full-text search on trees table (`idx_trees_fts`) - **Update 8 critical Python dependencies**: FastAPI 0.128.5, Pydantic 2.12.5, SQLAlchemy 2.0.46, Uvicorn 0.40.0, Alembic 1.18.3, asyncpg 0.31.0, python-multipart 0.0.22, pydantic-settings 2.12.0 - **Fix `regex=` → `pattern=` deprecation** in FastAPI Query() params (3 occurrences in steps.py) Net change: +786 / -557 lines (12 files). Production code reduced by ~229 lines through extraction and deduplication. ## Test plan - [x] `npm run build` passes (zero TypeScript errors) - [x] Backend imports successfully (`from app.main import app`) - [ ] Run `alembic upgrade head` to apply FTS index migration - [ ] Run full pytest suite after migration - [ ] Verify tree search still works in UI - [ ] Verify custom step flow in tree navigation (create → save → continue → fork) - [ ] Verify session export (markdown, text, HTML) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-02-08 18:29:39 +00:00 (Migrated from github.com)

🚅 Deployed to the patherly-pr-41 environment in selfless-grace

Service Status Web Updated (UTC)
patherly Success (View Logs) Feb 8, 2026 at 7:22 pm
hopeful-liberation Success (View Logs) Feb 8, 2026 at 7:22 pm
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [patherly-pr-41](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=1bb280f2-c116-462e-a907-862caf494dcb) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=2e7fa305-28d5-40fa-9130-8a9d7a459134&environmentId=1bb280f2-c116-462e-a907-862caf494dcb)) | | Feb 8, 2026 at 7:22 pm | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=1024053b-a904-4873-be8b-4581a98ca03e&environmentId=1bb280f2-c116-462e-a907-862caf494dcb)) | | Feb 8, 2026 at 7:22 pm |
Sign in to join this conversation.