Commit Graph

759 Commits

Author SHA1 Message Date
ي
7619604324 Harden logging config with safer overrides and optional JSON/file sinks 2026-03-11 16:31:28 +05:30
ajaysi
b410ece4ca Commit_remaining_local_changes_after_PR_407_merge 2026-03-10 17:17:04 +05:30
ajaysi
97745356ac Merge branch 'pr-407'
# Conflicts:
#	backend/services/intelligence/txtai_service.py
2026-03-10 17:14:40 +05:30
ajaysi
8c2d88efb9 Commit_all_local_changes_after_PR_406_merge 2026-03-10 17:01:36 +05:30
ajaysi
f78b5f1e04 Resolve_txtai_service_conflict_after_PR_406_merge 2026-03-10 16:55:42 +05:30
ajaysi
13e45acbf9 Merge branch 'pr-406' 2026-03-10 16:35:52 +05:30
ي
3a88d09af8 Make SIF agent workflows non-blocking and guard SSE hangs 2026-03-10 14:05:00 +05:30
ي
7e4adce55f Make SIF agent workflows non-blocking and guard SSE hangs 2026-03-10 14:04:26 +05:30
ي
bc49329ed6 Make SIF fail fast and add low-cost remote LLM fallback 2026-03-09 18:57:11 +05:30
ي
4230385e70 Make SIF fail fast and add low-cost remote LLM fallback 2026-03-09 16:26:20 +05:30
ajaysi
651bd2b5f0 fix: Fix Unicode encoding issue in backend startup script
- Changed rocket emoji to ASCII [*] for Windows CP1252 compatibility
- This allows the backend to start without UnicodeEncodeError on Windows
2026-03-09 16:25:56 +05:30
ajaysi
098424f696 fix: Make TxtaiIntelligenceService initialization non-blocking
- Modified _ensure_initialized() to run in background thread (non-blocking)
- Added _ensure_initialized_async() for truly async initialization
- Updated index_content() to return immediately without waiting for initialization
- Weights now load in background thread instead of blocking event loop
- Added initialization tracking to prevent duplicate initialization
- Modified today_workflow API to handle non-blocking indexing gracefully
- This prevents dashboard refresh from blocking other services

When a user accesses the dashboard, the indexing now happens in background
instead of blocking the HTTP response, allowing other services to function
normally while weights are being loaded.
2026-03-09 16:25:56 +05:30
ajaysi
9713af0c1b fix: Add missing columns to daily_workflow_plans table
- Added generation_mode column (VARCHAR, default: 'llm_generation')
- Added committee_agent_count column (INTEGER, default: 0)
- Added fallback_used column (BOOLEAN, default: 0)

Also fixed:
- Imported daily_workflow_models in services/database.py to ensure models are registered
- Added _create_daily_workflow_tables() to database setup
- Created migration script to add columns to 35 existing databases
- Fixed WorkflowError type in frontend to use constructor for proper 'name' property

This resolves the 'no such column' sqlite3 errors when accessing the today-workflow API.
2026-03-09 16:25:56 +05:30
ajaysi
7747174f00 Merge branch 'pr-404' 2026-03-09 16:20:06 +05:30
ajaysi
217698c2ed Merge branch 'pr-403' 2026-03-09 16:05:18 +05:30
ajaysi
c54ad409a7 Merge branch 'pr-402'
# Conflicts:
#	backend/app.py
2026-03-09 15:40:30 +05:30
ajaysi
9fe9f819d8 Merge branch 'pr-401' 2026-03-09 15:33:08 +05:30
ajaysi
1c3524964e Merge branch 'pr-400' 2026-03-09 15:19:47 +05:30
ajaysi
931127bfcf Merge branch 'pr-399' 2026-03-09 14:26:13 +05:30
ajaysi
209a723584 fix: avoid creating/initializing databases during user discovery
get_all_user_ids now checks if DB file exists before calling get_session_for_user. This prevents get_engine_for_user from triggering init_user_database and creating tables for stale workspace folders. Without this fix, a read-only ID scan creates/initializes SQLite databases and default tables as a side effect, which can silently create fresh DBs for stale workspace folders and hide missing/corrupt-database states that discovery previously surfaced.
2026-03-09 14:23:29 +05:30
ajaysi
3cfd95d179 fix: revert user_id filtering in task loaders to preserve backward compatibility
Avoid filtering loader queries by canonical user_id. Calling loaders with user_id=user_id introduces an exact-ID filter path that can drop valid legacy tasks: several loaders (e.g., load_due_market_trends_tasks) apply ...where task.user_id == user_id, but this commit also shifts discovery toward canonical IDs, so tasks persisted earlier with workspace-safe/sanitized IDs in the same per-user DB will no longer be returned and therefore never execute. Before this change, loaders were invoked as task_loader(db) and did not regress on mixed ID formats.
2026-03-09 14:20:57 +05:30
ajaysi
6c5361ce06 Merge branch 'pr-398' 2026-03-09 13:50:12 +05:30
ajaysi
b3cc83ed6e fix: resolve onboarding session not found warnings and frontend build OOM
- Use canonical Clerk user id (clerk_user_id) across all onboarding entrypoints to ensure consistent OnboardingSession.user_id lookup
- Fix API key persistence in api_key_manager.py to use correct APIKey model columns (session_id, provider, key)
- Increase Node heap for frontend build to 8GB and add build:nomap script to disable sourcemaps and reduce memory usage
- Update onboarding endpoints (endpoints_core.py, onboarding_control_service.py, step_management_service.py) to prefer clerk_user_id over id
- Fix frontend workflowStore.ts TypeScript error by returning WorkflowError instance
- Add website_automation_service.py for onboarding automation
2026-03-09 13:36:34 +05:30
ي
952824a271 Stabilize txtai nprobe handling without dropping loaded index state 2026-03-09 12:27:16 +05:30
ي
cd8582eb8c Fix txtai nprobe fallback to avoid reloading incompatible faiss index 2026-03-09 12:21:43 +05:30
ajaysi
1565551765 fix: Pass user_id to style analysis functions in website_analysis_executor
- Fix missing user_id parameter in analyze_content_style() call
- Fix missing user_id parameter in analyze_style_patterns() call
- Fix missing user_id parameter in generate_style_guidelines() call
- user_id is required for subscription checking in llm_text_gen()
- Resolves errors: 'user_id is required for subscription checking'
- All style detection functions now properly pass user_id from executor context
2026-03-09 12:09:56 +05:30
ي
e8d76cd745 Sync SEO dashboard imports and add route smoke test 2026-03-09 12:07:57 +05:30
ي
a19a18d9b4 Add competitor_analysis fallback for deep competitor task scheduling 2026-03-09 12:07:18 +05:30
ي
c3bd04e259 Fix huddle SSE auth fallback with query token support 2026-03-09 12:06:49 +05:30
ي
6b141ee554 Merge branch 'main' into codex/implement-central-visibility-for-seo-onboarding-tasks 2026-03-08 23:13:08 +05:30
ي
936dd14e0d Add consolidated onboarding SEO task health API and dashboard panel 2026-03-08 23:09:02 +05:30
ajaysi
39bc3e3008 Merge PR #397: Add typed request model for task status endpoint
- Add TaskStatusEnum to enumerate valid status values (pending, in_progress, completed, skipped, dismissed)
- Add TaskStatusUpdateRequest Pydantic model with validation
- Constrain completion_notes to max 4000 characters
- Automatically enforce schema validation and improve OpenAPI docs
- Update set_task_status endpoint to use typed request body
- Remove need for manual status validation (FastAPI handles it)
- Preserve dependencies normalization helper and all usages
- Preserve date validation and narrower exception handling from PR #396
- Keep proper feedback scoring using task.status from database
- Keep contextuality validation response fields intact
- Maintain all observability and error handling improvements
- Improve API robustness through type safety
2026-03-08 22:51:17 +05:30
ajaysi
92715661e3 Merge PR #396: Validate plan.date and add narrower exception handling
- Add date validation: validate plan.date is ISO format before computing yesterday
- Log clear warning (plan_id, user_id, plan_date, reason) if date parsing fails
- Replace silent 'except Exception: pass' with explicit SQLAlchemyError handling
- Log detailed warnings (plan_id, user_id, plan_date, yesterday_date, error details) on DB errors
- Keep failures non-fatal to indexing behavior (continue with today's indexing)
- Preserve dependencies normalization helper and its usage in yesterday payloads
- Preserve proper feedback scoring (uses task.status, handles all negative statuses)
- Keep contextuality validation response fields (quality_status, contextuality_validation)
- Improve observability while maintaining system robustness
2026-03-08 18:39:55 +05:30
ajaysi
0aaaf07900 Merge PR #395: Normalize dependencies in today workflow API payloads
- Add _normalize_dependencies() helper to handle all dependency type variations
- Handle None, list, JSON string, and invalid types with safe fallback to []
- Apply normalization to today and yesterday task payloads for consistency
- Ensure indexing pipeline receives normalized list dependencies
- Preserve task status feedback scoring logic (uses task.status, handles all negative cases)
- Keep contextuality validation and quality status response fields
- Improve data consistency across API and indexing surfaces
2026-03-08 18:31:48 +05:30
ajaysi
38444f4508 Merge PR #394: Derive task memory feedback_score from persisted task.status
- Use canonical persisted task.status (from DB) instead of incoming request parameter
- Implement explicit status-to-score mapping: completed→+1, skipped/dismissed/rejected→-1, other→0
- Normalize all negative outcomes uniformly for self-learning memory
- Ensure memory feedback aligns with backend status normalization rules
- Preserve contextuality_validation and quality_status response fields
- Keep failures non-fatal to API behavior with exception handling
- Improve code clarity with explicit conditional logic over ternary operators
2026-03-08 18:28:52 +05:30
ajaysi
74b788a353 Merge PR #392: Add contextuality validation and low-context workflow status
- Replace provenance-based quality with contextuality validation framework
- Add evidence link tracking system (onboarding:key and alert:id formats)
- Implement plan contextuality validation function with configurable thresholds
- Calculate task-level context scores based on evidence link density
- Define contextual workflows (>65% threshold) vs low-context workflows (<65%)
- Add validation in plan persistence layer before database commit
- Integrate contextuality metrics into release readiness checks
- Add recovery strategies for low-context workflows (regeneration with guidance)
- Track evidence link validity against grounding context (onboarding data, alerts)
- Provide detailed contextuality reports in quality assessments
- Maintain backward compatibility while enabling contextual workflow detection
2026-03-08 18:18:43 +05:30
ajaysi
2d4c83e79f Merge PR #391: Add workflow provenance quality metrics and classification
- Introduce task provenance tracking: agent_proposal, llm_backfill, controlled_fallback
- Add quality computation function to classify workflows as 'AI-personalized' or 'guided baseline'
- Calculate agent origin ratio, fallback ratio, and per-pillar coverage metrics
- Implement configurable agent personalization threshold (default 35%)
- Enhance plan metadata with comprehensive quality dimensions:
  - agentOriginRatio, agentOriginPercent, agentOriginTaskCount
  - agentOriginPillars, fallbackRatio, fallbackPercent, fallbackTaskCount
  - totalTaskCount and configurable thresholds
- Simplify task provenance metadata handling in sanitization
- Add backfill logic for existing plans to populate missing quality metrics
- Maintain backward compatibility with existing plan storage
2026-03-08 18:16:54 +05:30
ajaysi
56854df016 Merge PR #390: Add degraded-mode workflow regeneration criteria and endpoint
- Add POST /api/today-workflow/regenerate endpoint for on-demand plan regeneration
- Implement rate limiting (3 requests per 60 seconds) to prevent abuse
- Add regeneration quality score tracking and onboarding completion status
- Compute task hashes for deduplication and change detection
- Extract plan metadata from plan_json for cleaner API responses
- Integrate onboarding progress service to track completion status
- Return quality_score and generated_with_agents metadata in responses
- Enable manual workflow refresh in degraded mode scenarios
- Maintain backward compatibility with simplified schema
2026-03-08 18:12:43 +05:30
ajaysi
35581316a8 Merge PR #389: Committee Health Precheck and Simplified Architecture
- Simplify workflow generation by removing complex dependency coercion and metadata normalization functions
- Add committee health precheck to detect insufficient active agents before proposal gathering
- Add orchestrator initialization state metadata tracking for observability
- Downgrade fastapi to 0.104.0 for stability
- Simplify database schema (remove generation_mode, committee_agent_count, fallback_used columns from DailyWorkflowPlan)
- Remove 'skipped' from suppressed task statuses in memory service (keep only dismissed, rejected)
- Update task status normalization logic for clarity
- Return simplified metadata structure with generation_path and degradation tracking
2026-03-08 18:10:27 +05:30
ajaysi
8f6ed3a616 Merge PR #388: Daily Workflow Integration & Enhanced Reliability
- Resolve merge conflicts in backend/services/today_workflow_service.py and frontend/src/stores/workflowStore.ts
- Backend: Keep robust handling for both dict and object types in TaskProposal conversion
- Backend: Combine dependencies coercion with task metadata normalization
- Frontend: Implement graceful fallback pattern (try server first, then local generation on unavailability)
- Add provenanceSummary integration from server responses
- Ensure degraded mode handling with appropriate messaging
2026-03-08 17:47:15 +05:30
ي
52563849d5 Fix onboarding-status user ID resolution in scheduler path 2026-03-07 12:15:25 +05:30
ajaysi
a25ec8302c fix: Resolve merge conflicts in workflowStore.ts by combining normalization and fallback logic (PR #387) 2026-03-07 12:08:29 +05:30
ajaysi
4f2a3d6e2d fix: Resolve conflicts in PR #386 for per-agent timeouts and partial committee handling 2026-03-07 12:05:51 +05:30
ajaysi
f0f73eb003 Merge branch 'pr-385' 2026-03-07 12:02:50 +05:30
ajaysi
a00212ca4d refactor: Unify canonical task outcome statuses (completed, skipped) across workflow and memory services (Closes #384) 2026-03-07 12:00:04 +05:30
ajaysi
5780deff2f fix: Normalize specialized agent pillar IDs and log invalid proposals (Closes #383) 2026-03-07 11:57:26 +05:30
ajaysi
8b554a35c4 fix: Resolve dependency conflicts, scheduler status error, and frontend config (Closes #382) 2026-03-07 11:51:59 +05:30
ي
62d5cf773e Add typed request model for today workflow task status updates 2026-03-06 21:45:48 +05:30
ي
e694e6172f Validate plan date before yesterday workflow indexing 2026-03-06 21:45:25 +05:30
ي
2403d92f9d Normalize today workflow task dependencies payload 2026-03-06 21:44:23 +05:30