Commit Graph

89 Commits

Author SHA1 Message Date
Paul Huliganga 2af1459d25 security(harness): restrict /api/harness/* routes to localhost only
Add requireLocalhost middleware that returns 403 for non-localhost requests (127.0.0.1/::1 only). Prevents external access to diagnostic endpoints.
2026-03-30 09:56:25 -04:00
Paul Huliganga 597e5c94c8 refactor(logging): replace remaining console statements with structured logger
- migrate.ts: console.log → logInfo
- seed.ts: console.log/logError → logInfo/logError
- CopyMeThatHtmlParser.ts/TxtParser.ts: console.error → logError
- index.ts: remove redundant console.error (already logged)

Aligns all server-side output with Winston logger conventions for consistency and observability.
2026-03-30 09:56:16 -04:00
Paul Huliganga b62b8061f7 fix(build): resolve TypeScript errors and stabilize test suite
- Dependencies: add @types/debug; fix logger argument typing
- Core: add middleware.ts (asyncHandler), create logger.ts
- Error handling: global middleware in index.ts maps Zod/service errors to proper HTTP status codes (400/413/502/504/415)
- Import route: catch UrlImportError and return mapped responses
- Tests: add error handlers to test setups to match production behavior
- Tags: duplicate/empty name errors now return 400
- Tests expectations: CopyMeThatImportService tests updated to match parser behavior (invalid recipes filtered, not counted as failures)
- Numerous route refactors (asyncHandler, validation, pagination links) and test expansions

Result: npm run build succeeds, all 90 tests pass.

Next: review low-priority items (FTS, harness auth), commit when ready.
2026-03-30 00:45:05 -04:00
Paul Huliganga 4b4848c541 fix(backend): resolve TypeScript build errors and improve test coverage
- Fix db.run monkey-patch return type to match sql.js signature
- Add .js extensions to all cross-module imports (node16 resolution)
- Add explicit types for callback parameters in test files
- Resolve PhaseProgressLogger type name mismatch
- All tests pass (46/46) and build succeeds

Skipped status/ artifacts (test runtime files)
2026-03-29 23:24:53 -04:00
Paul Huliganga 8b729d7fc4 chore(backend): implement high-priority improvements from code review
- Configuration: dotenv support, env vars for PORT, DB_PATH, CORS_ORIGIN, rate limits
- Security: API key auth for write endpoints, rate limiting on import, configurable CORS, image URL normalization
- Reliability: DB transactions for create/update, dirty flag for saves, foreign key enforcement (PRAGMA), duplicate detection O(1) optimization
- Features: health check endpoint (/api/health)
- Bugfix: corrected tag assignment/removal routes (param order)
- Testing: added tests for PUT/DELETE recipes, tag CRUD and assignment, enabled foreign keys in tests
- All 46 backend tests passing

Closes #<ticket-if-any>
2026-03-29 23:11:27 -04:00
Paul Huliganga 163455f834 Recipe Manager: Add harness status artifacts 2026-03-28 19:59:24 -04:00
Paul Huliganga 18bb0ae069 Recipe Manager: Add schema migrations and seed file updates 2026-03-28 19:59:18 -04:00
Paul Huliganga b5a2588bc4 feat(ui): redesign homepage visuals and hierarchy (T04) 2026-03-26 17:51:52 -04:00
Paul Huliganga 4af20eaf91 feat(ui): add design tokens and visual style guide (T02) 2026-03-26 17:49:34 -04:00
Paul Huliganga 3931455e64 feat(ui): add visual asset pack and documentation (T03) 2026-03-26 17:47:12 -04:00
Paul Huliganga 469b4b78a1 chore(harness): add visual redesign execution board 2026-03-26 17:44:39 -04:00
Paul Huliganga 363c4258fa feat(ui): baseline visual audit and checklist (T01) 2026-03-26 17:44:01 -04:00
Paul Huliganga adf8386daf feat(frontend): add visual asset fallback strategy and QA notes 2026-03-26 16:39:18 -04:00
Paul Huliganga 012a5362bb feat(ui): add subtle motion and icon polish 2026-03-26 16:36:34 -04:00
Paul Huliganga 79d10730a2 feat(frontend): polish recipe detail and import flow visuals 2026-03-26 16:32:12 -04:00
Paul Huliganga ca11d9d878 feat(frontend): refresh homepage and recipe list visuals 2026-03-26 16:28:01 -04:00
Paul Huliganga f42bd53cff feat(ui): establish theme tokens and global base styles 2026-03-26 16:24:40 -04:00
Paul Huliganga 83e2b95501 docs(runbook): add periodic workflow automation and failure troubleshooting 2026-03-26 15:56:52 -04:00
Paul Huliganga 9744a7ac23 test(workflow): add scheduler and health-check script tests 2026-03-26 15:55:12 -04:00
Paul Huliganga 0d61ac70fc feat(workflow): add health check status detector 2026-03-26 15:53:25 -04:00
Paul Huliganga 61846b5d2a feat(workflow): add scheduled resume-and-report runner 2026-03-26 15:50:50 -04:00
Paul Huliganga 0510009597 fix(workflow): align orchestrator API and workflow runner 2026-03-26 15:44:45 -04:00
Paul Huliganga 476ca0b0c2 test: full-suite stabilization for orchestrator and progress logging 2026-03-26 14:23:28 -04:00
Paul Huliganga 1516ef87d2 fix(task5): make morning report vitest-compatible and deterministic 2026-03-26 13:48:32 -04:00
Paul Huliganga 012cfb1ddc Task 5: Add morning consolidated report script, stalled-state detection, blockers, relays pending detection, tests, and docs. Implements requirements for commit/report inclusion, phase update monitoring, stalled-status detection, and integration tests covering deterministic output. See docs/morning-report.md for usage. 2026-03-26 13:44:00 -04:00
Paul Huliganga 87ee00dcb5 Task 4: Add local phase update queue (JSONL) with event schema, helper functions, orchestrator emission, and tests. Integrates phase_started, phase_succeeded, phase_failed, workflow_completed events; helper functions for reading pending and marking sent. All tests passing. See tests/phase-updates-queue-README.md for usage. 2026-03-26 13:42:26 -04:00
Paul Huliganga f54468e471 Task 3: Implement robust SequentialOrchestrator + WorkflowStatusManager integration with atomic status file writes, correct status fields, and phase boundary tracking. Fix logic, fully restore run method, ensure all orchestrator status tests pass. 2026-03-26 13:39:54 -04:00
Paul Huliganga 2288849f66 feat(orchestrator): add phase progress JSONL logging with failureReason and nextAction; reader helper and robust tests for Task 2 2026-03-26 13:34:37 -04:00
Paul Huliganga 1c3d697af7 fix(harness): stabilize orchestrator resume semantics and checkpoint test behavior 2026-03-26 13:33:24 -04:00
Paul Huliganga 8afac385b0 Fix resume test: assert orchestrator checkpoint and retry semantics correctly for mid-run resumes (Task 1 remediation) 2026-03-26 13:31:06 -04:00
Paul Huliganga c434733f0c feat(harness): sequential orchestrator with checkpoint/retry/restart, tests + docs
- Add SequentialOrchestrator service for ordered phase execution, per-phase retry/backoff, and restart-safe checkpointing
- Persist phase attempt metadata (success/fail, attempts, timestamp, error)
- Expose importable callable interface
- Add full coverage unit tests for execution order, retry, checkpoint, and resume scenarios
- Update docs and README for usage and dev guidance
2026-03-26 13:28:19 -04:00
Paul Huliganga edc5ce03ad Visual polish: CookModePage + ImportUrlPage, global header/nav consistency, theme token styling, improved states (spacing, cards, buttons, empty/error/complete) 2026-03-25 18:38:50 -04:00
Paul Huliganga 855dc62207 feat(ui): visually polish RecipeDetailPage and RecipeForm with consistent theme tokens, improved layout, card sections, and input styling for UX parity with RecipeList 2026-03-25 18:31:07 -04:00
Paul Huliganga b7e7e9955e UI polish: Introduce visual theme tokens, refreshed RecipeList page & cards, improved empty/loading states 2026-03-25 18:25:37 -04:00
Paul Huliganga 2ffb1da919 Fix ImportUrlPage.tsx ingredient draft-edit type bridging: safe conversion between string[] UI state and RecipeDraft object[] shape. Preserves step 4 search+tag. 2026-03-25 16:59:41 -04:00
Paul Huliganga 14c0cbb94c Unify backend/frontend recipe search+tag filtering: backend search matches title, ingredient, tag; frontend list page has unified search input and tag filter bar wired to backend; tests for combined/ingredient/tag search; preserves existing features. 2026-03-25 14:17:45 -04:00
Paul Huliganga 055c7ddd1f fix(recipe-repo): normalize SQL params to avoid undefined binds 2026-03-25 11:09:25 -04:00
Paul Huliganga 3248e52057 Refactor backend to normalized ingredients/steps schema, remove tag color, update types/routes/services/tests. Blocking TS build error: all SQL params must be string|null; remaining bug is undefined may leak in RecipeRepository ingredient/step creation. See code for status. In-progress commit to checkpoint work. 2026-03-25 10:33:37 -04:00
Paul Huliganga fa2cceddc3 [migration] Normalize schema to MVP target: split recipes into ingredients and steps tables, drop JSON columns, adjust tags, update migration docs. WARNING: Tests fail until API and tests are refactored for new structure. 2026-03-25 10:25:45 -04:00
Paul Huliganga 23aa097458 feat(extension): add configurable Recipe Manager base URL settings 2026-03-25 04:42:25 -04:00
Paul Huliganga 272ce1d2f0 feat(mission-control): add live harness progress status panel 2026-03-25 00:46:21 -04:00
Paul Huliganga feb10fdb8b feat(extension): send page URL to import API from context menu 2026-03-25 00:37:18 -04:00
Paul Huliganga 97e55ab6c2 feat(extension): scaffold Manifest v3 browser extension 2026-03-25 00:22:33 -04:00
Paul Huliganga 9f49223df3 Add import telemetry logging for success and failure reasons 2026-03-25 00:07:38 -04:00
Paul Huliganga 1ca21889ca Add URL import retry/timeout handling and friendly failure messaging 2026-03-24 23:54:23 -04:00
Paul Huliganga d3eeeb2833 feat(import): add heuristic fallback parser for recipe URL imports 2026-03-24 23:43:41 -04:00
Paul Huliganga 3d07ff6a49 chore(harness): update recipe iteration keepalive status 2026-03-24 23:35:50 -04:00
Paul Huliganga 15ada9cb52 feat(frontend): add URL import error states 2026-03-24 23:24:30 -04:00
Paul Huliganga e1f5019006 feat(frontend): add edit-before-save flow for URL imports 2026-03-24 23:20:42 -04:00
Paul Huliganga 4c512a5161 docs(ops): add INCIDENT_LOG and link from RUNBOOK 2026-03-24 22:41:49 -04:00