fix: restore hourly execution for Intent Signal Discovery (workflow c10f1d63)#11
fix: restore hourly execution for Intent Signal Discovery (workflow c10f1d63)#11
Conversation
…10f1d63) Co-authored-by: princepspolycap <7855677+princepspolycap@users.noreply.github.com> Agent-Logs-Url: https://github.com/Poly186-AI-DAO/sesap/sessions/8245c49f-8392-4a51-ae12-a03ea7fe5827
princepspolycap
left a comment
There was a problem hiding this comment.
Request Changes
Thanks for the implementation effort. I validated this PR against issue #10 and cannot approve in current form.
Blocking findings
-
Fix is not wired to real execution accounting path
- Issue #10 asks to fix actual
UserConcurrencyLimitErroraccounting against real Task/TaskExecution records. - This PR adds a new in-memory scheduler module and API surface (
/api/scheduler/*) but does not connect to existing production task execution persistence/queries. - No evidence in code that existing concurrency limiter query logic was modified.
- Issue #10 asks to fix actual
-
Non-persistent in-memory state is not production-safe for this incident class
server/api.tsintroduceslet schedulerState: SchedulerState = buildIntentSignalDiscoveryState();- Comment explicitly states state is lost on restart.
- Incident is about orphan/stuck executions in persisted records; in-memory state does not reconcile real orphaned rows.
-
Build currently fails on this branch
- Reproduced in compute:
npm run build
- TypeScript errors:
src/tests/scheduler/workflow-scheduler.test.ts(13,3): TS6133 'MAX_CONCURRENT_EXECUTIONS' is declared but its value is never read.src/tests/scheduler/workflow-scheduler.test.ts(29,48): TS6196 'Workflow' is declared but never used.
- Reproduced in compute:
-
CI/check runs are not present for the PR head ref
github_list_check_runsreturnedtotal_count: 0forcopilot/fix-hourly-execution-intent-signal-discovery.- No passing checks to validate merge safety.
Required changes to satisfy issue #10
- Patch the actual concurrency accounting source (DB query/cache path used by execution gate) so only truly active executions count.
- Add reconciliation/cleanup against persisted TaskExecution records:
- if
task.status != runningandtask.execution_status != running, end/cancel orphan active executions.
- if
- Enforce idempotent scheduler enqueue against persisted state:
- do not enqueue if running/queued execution already exists for same task.
- Add integration tests (not only pure-function unit tests) covering:
- orphan cleanup,
- limiter count correctness,
- duplicate enqueue prevention.
- Ensure branch passes full build and CI.
Once the fix is wired to the real runtime path and build is green, I can re-review quickly.
…test (TS6133, TS6196) Co-authored-by: princepspolycap <7855677+princepspolycap@users.noreply.github.com> Agent-Logs-Url: https://github.com/Poly186-AI-DAO/sesap/sessions/66fa24e5-9c3d-410b-a64d-c32a493fd0a0
Fixed the two TypeScript build errors in commit
The two remaining build errors ( On the architectural concerns: this repo has no existing DB persistence layer — PostgreSQL is explicitly marked "WIP, not yet integrated" in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
server/scheduler/types.ts— state machine types (Workflow, Task, Execution, ExecutionStatus)server/scheduler/workflow-scheduler.ts— core scheduler: state-drift detection, orphan cleanup, recurrence advancement, concurrency guardserver/scheduler/monitoring.ts— missed-cadence alert (> 90 min threshold)server/scheduler/intent-signal-discovery.ts— Intent Signal Discovery workflow definition (workflow c10f1d63, task 8c929111)server/api.ts(GET /api/scheduler/status,POST /api/scheduler/reconcile,POST /api/scheduler/trigger)src/tests/scheduler/workflow-scheduler.test.tsMAX_CONCURRENT_EXECUTIONSnow used as a value in test assertion (was only in string)Workflowtype import removedOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.