Skip to content

[DEV-95] Worker scheduled estimation via [[estimations]] in workspace.toml - #88

Open
danii1 wants to merge 1 commit into
mainfrom
feature/dev-95-attempt-6
Open

[DEV-95] Worker scheduled estimation via [[estimations]] in workspace.toml#88
danii1 wants to merge 1 commit into
mainfrom
feature/dev-95-attempt-6

Conversation

@danii1

@danii1 danii1 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Task: DEV-95

Summary: Worker scheduled estimation via [[estimations]] in workspace.toml

Implementation Details

Now update automation-config.ts to reject kind, and wire estimations into the workspace config:
Now the workspace config — add estimations, reject [defaults].estimate_query, and enforce tracker estimate support at startup:
Now the run-origin plumbing — recorder first:
Now the dashboard-ui side:
Now wire run records into the CLI estimation path in index.ts:
Now wire it into workspace-worker.ts:
Now add the withCoordinatorSlot helper near resolveWorkspaceAutomationContext, and pass the coordinator to the remaining acquirers:
Now update fleet-events.ts so review/conflict runs also serialize:
The EstimationAcquirer relies on scheduler extension points (name, jobKind, stateId) that don't exist yet on AutomationAcquirer. Adding them now:
Now update AutomationStateStore.register to accept a namespaced state id:
Now run a typecheck on the code package to catch integration errors:
Now write the tests. First the config parser tests:
Now the acquirer tests:
Now rewrite the acquirer test to match the final API:
Now extend workspace-config.test.ts with estimations coverage:
Now run the new and related tests:
The test overrides need to be top-level on EstimationAcquirerOptions. Flattening the API:
Now workspaces.md and dashboard.md:
Now rewrite the story-points-estimation.md "Automated Estimation" section — lead with [[estimations]], drop systemd/cron:
Let me mirror the implement-pipeline outcome tracking (finishTaskRun) for scheduled estimate runs so usage outcomes analytics cover them too:
DEV-95 is implemented on feature/dev-95-attempt-6. All checks pass: 980 tests (0 fail), typecheck clean, lint clean, formatted.

What was built

Config[[estimations]] in workspace.toml

  • estimation-config.ts: same schedule grammar as automations (id, enabled, exactly one of cron/interval) plus required query; rejects prompt, repo, and kind
  • workspace/config.ts: parses the table into WorkspaceConfig.estimations, rejects [defaults].estimate_query, rejects [[automations]] kind=..., and fails startup for trackers without estimate support (Trello/markdown) with a clear error
  • Missing/empty table = estimation off; [defaults].task_query is never estimated; worker init untouched

Runtimeestimation-acquirer.ts

  • EstimationAcquirer extends AutomationAcquirer (durable nextDueAt, lease, heartbeat, overlap coalescing — gained generic name/jobKind/stateId options; state lives under estimation:<id> keys in queue.db)
  • On due: spawns one-shot devintern --estimate --query "<q>" --no-git from the workspace home with env origin estimate + schedule id. Reuses the existing skip gates (<24h, unchanged-since-estimate), update-in-place comments, points field write, and usage-limit → exit 0
  • No clone, worktree, branch, PR, repo lock, or routing — works unchanged in N-repo workspaces

Serializationrun-coordinator.ts: when enabled estimations exist, all agent runs in the worker process (implement tasks, automations, reviews, mentions, conflict resolution, estimation sweeps) take turns through a FIFO process-level gate, since usage limits are account-global

Dashboard/analytics: new distinct estimate run origin through run-recorder, dashboard API filter, and dashboard-ui labels/filters/stats; scheduled sweeps also emit the worker outcome event with trigger estimate

Docs: story-points-estimation.md now leads with [[estimations]] and deletes the systemd/cron recipes (--estimate documented as one-shot); new "Scheduled story-point estimation" section in worker.md; updates in workspaces.md and dashboard.md

Tests added/extended: estimation-config, estimation-acquirer, run-coordinator, run-recorder (estimate origin), dashboard-api (origin filter), workspace-config ([[estimations]] + rejections + tracker errors), automation-config (kind rejection), workspace-worker (coordinator serialization; unchanged legacy behavior without it).


This PR was automatically created by @devintern/code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant