Repository navigation
feat(headless): validate task tools with runtime-policy A/B #317
Description
Part of #15.
Update: A frozen construction plan & experiment design lives in this comment. It supersedes the A/B Plan and Decision Gate below on two points: (1) the non-inferiority margin is fixed at 10pp with a four-outcome readout (superior / non-inferior / inferior / inconclusive) — a 5pp margin is not resolvable at the planned ~240-pair sample; (2) the experiment runs with the existing heavy-task progress tools off in both arms, so arm A is a clean no-ledger baseline rather than "existing todo, no new
task_*".
Summary
Implement Maka task tools as a headless/runtime-policy experiment, not as a broadly enabled product feature.
The goal is to build the missing task-tracking primitive from #15, then validate it with Terminal-Bench / Harbor A/B before enabling it more widely. If structured task tools do not improve long-horizon agent performance enough to justify their token/tool overhead, keep them disabled or remove them.
Motivation
Maka already has subagents and deferred tool loading. The next missing primitive is an agent-owned task ledger: a recoverable, structured record of what the agent is doing, what remains, what is blocked, and what evidence supports completion.
But task tools are not free. They add tool schema, tool calls, context replay, and a chance for the model to over-plan instead of acting. We should prove the tool helps before making it part of the default agent surface.
Proposed Scope
Add a headless-only task tool group:
task_createtask_updatetask_listtask_get
Task records should support:
- stable task id
- title / description
- status:
pending,in_progress,blocked,completed,cancelled - priority
- owner, initially
main - blocked reason
- completion / blocker evidence refs
- created / updated / completed timestamps
Record task mutations as task-run events and project the latest task state for retry/resume prompts under a hard size cap.
A/B Plan
Run a two-arm runtime-policy comparison on the same Terminal-Bench / Harbor task set, model, prompt, timeout, and verifier.
| Arm | Description |
|---|---|
| A | Baseline: current Maka policy, no new task_* tools |
| B | Task tools enabled: task_create, task_update, task_list, task_get, plus capped task-state replay |
The only intended policy difference is whether structured task tools are available and replayed. Existing heavy-task progress mechanisms should remain whatever the current baseline uses; do not introduce a third arm for them in this issue.
Primary metric:
- official verifier pass rate
Secondary metrics:
- token usage
- cost
- duration
- tool calls / turns
- timeout / budget-exhausted / agent-incomplete rate
- activated subset pass rate
- task tool call count
- repeated or stale task update rate
Decision Gate
Promote task tools only if the task-tools arm improves official pass rate or is clearly non-inferior while materially reducing incomplete/timeout/recovery failures, without unacceptable token/step overhead.
Do not promote if:
- pass rate is flat or worse and cost/steps increase
- task tools are rarely activated
- the model spends significant turns grooming tasks instead of solving
- task-state replay bloats prompts without improving outcomes
Tie or regression means the tools stay off by default, or are removed.
Non-goals
- No desktop UI in this issue.
- No default runtime/product enablement.
- No plan reminder / automation integration.
- No goal execution integration.
- No subagent task assignment beyond an optional owner field.
- No MimoCode-style
tasks/<id>/progress.md. - No cross-session project task database yet.
- No workflow engine or scheduler.
Acceptance Criteria
- Default configuration registers no new task tools.
- Experiment configuration registers
task_create,task_update,task_list, andtask_get. - Task state is recorded in task-run events and can be projected back into retry/resume prompts.
blockedis a first-class status with reason/evidence.- Tests cover create, update, list, get, invalid transitions, duplicate IDs, prompt projection cap, and flag-off behavior.
- A/B report includes pass rate, tokens, cost, duration, task activation rate, and activated subset results.
- The final report explicitly says whether task tools should be promoted, kept experimental, or removed.
Risks
- Extra tool schema and tool calls may reduce benchmark performance.
- The model may over-plan or maintain tasks too frequently.
- Two progress systems can conflict if current heavy-task progress and
task_*are exposed together without a clear policy boundary. - Replaying too much task state can bloat prompts.
- Small/simple tasks may degrade from action-space dilution.
Mitigation: only one intended task-tracking policy difference per A/B arm, terse tool descriptions, hard replay cap, and off-by-default runtime policy.
Activity
Astro-Han commentedon Jun 29, 2026
Construction plan & frozen experiment design
This plan was pressure-tested with an independent second-opinion review before posting; the statistical and wiring corrections from that pass are folded in. It supersedes the original A/B Plan and Decision Gate wording above on two points (margin and baseline) — see §5.
0. Frozen experiment design (pre-registration — fixed before any run)
Arms (two only):
todo_update/inventory_submit) are off in both arms for this experiment, so A is a clean "no ledger" baseline rather than "existing todo, no newtask_*". This intentionally narrows the original "keep existing heavy-task progress as the baseline" wording; rationale in §5.task_create/task_update/task_list/task_get+ capped task-state replay.tool_call/tool_resultevents, and any extra steps are part of the task-tool intervention's footprint — they are not treated as confounders, but for that reason no post-treatment subset (e.g. "attempts where B actually activated tasks", "attempts where active prune fired") is used for the primary judgment.Primary decision (computed on the full accumulated sample): B−A pass-rate difference with a confidence interval, read as four outcomes:
Margin = 10pp, matching the phase-1 framing already used for the active-prune A/B (#340). This is the margin a ~240-pair sample can actually resolve. A 5pp margin was considered and rejected: at ~240 pairs the one-sided lower-bound half-width is ~7–8pp, so a true 5pp effect would not be resolvable; resolving 5pp would need on the order of 1000+ pairs per arm (~4× the cost). The run's purpose is therefore to detect a large regression, estimate the effect size, and opportunistically surface a superiority signal — not to prove a 5pp lift.
Framework gap (ships in the implementation PR as "necessary for measurability"): the current A/B decision type is
non_inferior / inferior / inconclusivewith a point-estimate rule; it has nosuperiorlabel and does not use the CI-lower-bound tiers above. Implementing this readout requires extendingab-summary.ts/ab-types.ts/ab-render.ts. The same PR should also switch the CI to a paired/clustered estimator: the design is paired (same task, both arms), but the framework currently uses an independent two-proportion (Newcombe/Wilson) interval, which discards the pairing — and precision is the binding constraint here.Diagnostics only (never gate promotion): expected-duration buckets (le30 / 30to45 / 45to60 / gt60), active-prune subset, task-activation subset. Long-horizon analysis is sliced on the pre-treatment expected-duration axis, never on realized trace/turn/token length (which is post-treatment and would bias the subgroup).
Pre-registered guards (fixed before the run):
task_listreturns ≤ 20 active tasks (≤ 1024 tokens); per-turn task-update cap surfaced as the stale/repeated-update metric; per-attempt max 50 tasks.Metrics: primary = official verifier pass rate. Secondary = tokens / cost / duration / turns, incomplete / timeout / budget-exhausted rate, task activation rate, repeated-or-stale task-update rate.
1. Phase 1 — task tool group (runtime primitive, off by default)
packages/runtime/src/task-ledger-tools.ts); not added tobuildBuiltinTools(). Made a runtime primitive (not headless-only) so desktop can enable it later once it passes the gate.task_create/task_update/task_list/task_get, with terse descriptions to discourage over-planning.pending/in_progress/blocked/completed/cancelled;blockedis first-class with reason/evidence; invalid transitions and duplicate IDs are rejected.MAKA_CONTEXT_TASK_TOOLS) to the whitelist plus its snapshot/fingerprint, and a tool-assembly point in the Harbor backend path — the existing whitelist only covers context-budget/prune/compact/archive keys, so this is net-new wiring, not a free reuse.2. Phase 2 — capped task-state replay
task_listresults may be pruned from context, so the durable signal must come from the capped replay, not from tool-result messages persisting in-context.3. Phase 3 — full run as accumulating rounds
runtime-policy-ab-run.ts). Target a full run over the reused Terminal-Bench task pool, executed as multiple accumulating rounds (the harness already has a round concept); rounds stratify into one final estimate, as the prune A/B did.result-export/ runtime-policy-ab reporting.maka-evaloutputs stay git-excluded.4. PRs, issue body, out of scope
Astro-Han commentedon Jul 5, 2026
Revised implementation scope: CRUD-lite Task tools as an experimental harness primitive
After #537, the remaining #317 work should not directly promote the desktop session task ledger, and it should not invent a benchmark-only checkpoint mechanism. The experiment should answer a narrower, more general question:
First experimental baseline
Use a single candidate arm:
The B-arm tool family should stay close to the original #317 and to common Task tool practice:
task_createtask_updatetask_listtask_getKeep the first schema deliberately small: short task title/description, status (
pending,in_progress,blocked,completed,cancelled), and minimal blocker/evidence text where needed. Defer priority, owner, dependencies, workflow semantics, cross-session task databases, and rich evidence references.Relationship to #537
#537 is useful implementation groundwork, not the completed experiment:
PR policy
The implementation can live in one draft PR so the full experiment surface is reviewable together: tools, storage/projection, Harbor/runtime-policy flag, metrics, reporting, and tests. The PR remains experimental and off by default.
Decision after the A/B run:
This keeps the experiment honest: code enters the repo only if the Task-tool harness primitive earns its keep.
feat(headless): add experimental todo task-tool baseline
Nyvo-io commentedon Jul 22, 2026
I would like to take #317. I audited the current main branch before proposing the scope: the Core/Runtime Task Ledger and task_create/task_update/task_list/task_get tools now exist, while the Headless experiment still exposes the narrower todo_write surface and its current metrics are todo_write-specific. I found no open PR, assignee, or active upstream branch implementing the remaining experiment.
My proposed implementation/evidence boundary is:
I will keep product defaults unchanged, preserve official verifier authority, and avoid Desktop UI, workflow, subagent assignment, or cross-session task-database scope.
Before opening a branch, I would like to confirm two points:
If this boundary matches the current intent, please assign me. I will wait for confirmation and assignment before starting implementation.
Astro-Han commentedon Aug 23, 2026
Closing this experiment definition as superseded by #2605. The reusable Task Ledger and CRUD tools now exist, but the Headless runtime-policy arm,
todo_writemetrics, retry projection, and benchmark wiring named here were removed with the old Headless architecture.The product question—whether Task tools earn their token and action-space cost—remains reasonable. A new experiment should reuse the current Task Ledger and run through
@maka/evaland the Runtime Host rather than restoring a benchmark-specific execution path.Triage and wording were prepared with OpenAI Codex and reviewed by the maintainer.