Skip to content

T-CF7M-autonomy-gated-best-effort-auto-define

Status: closed/done · Impact: high · Complexity: large

The /sdlc:orchestrate loop parks tasks at needs-definition whenever ensure-ready finds a spec gap, because the non-interactive dispatch can’t run AskUserQuestion to resolve it (observed 2026-06-02: T0001/T0002/T0015 all parked). For tasks the operator has explicitly marked high-autonomy, the agent should instead best-effort define the spec to readiness and carry the work all the way to a PR — never merging. This unblocks autonomous throughput on opted-in tasks while keeping a human at the merge gate.

LocationRole today
plugin/lib/model/entities/task/schema.jsonautonomy enum is human-only, supervised; the autonomous/<target> namespace is documented as reserved but undefined
plugin/skills/task-ensure-ready/SKILL.mdon a gap, records definition_gap and downshifts to planning/needs-definition; never auto-fixes; no autonomy awareness
plugin/skills/task-ensure-ready/ensure_ready_mutate.tsdeterministic verifier; emits ENSURE-READY-OK: / ENSURE-READY-NEEDS-DEFINITION:; never edits body content
plugin/skills/task-define/SKILL.mdinteractive (AskUserQuestion) gap-filling; no non-interactive mode
plugin/skills/task-work/SKILL.mdStep 5a calls ensure-ready and halts on NEEDS-DEFINITION
plugin/scripts/new_task.tsAUTONOMY_CHOICES is ["human-only","supervised"]
  • autonomous/pr is a valid autonomy value meaning: the agent may best-effort self-ready and implement this task autonomously up to opening a PR, and must never merge. It is one rung above supervised on the documented autonomous/<target> ladder.
  • A new /sdlc:task-auto-define skill non-interactively brings a task to readiness with best-effort, LLM-synthesized content (the autonomous sibling of the interactive /sdlc:task-define). It flags the result as machine-authored, commits it, and never calls AskUserQuestion.
  • The ensure-ready skill (not its deterministic core) gains one branch: when the verifier reports a gap AND the task’s autonomy is autonomous/pr, it dispatches /sdlc:task-auto-define, then re-runs the verifier — stamping readiness on pass, falling back to today’s needs-definition downshift on fail. ensure_ready_mutate.ts is unchanged.
  • Net: an autonomous/pr task the loop picks up self-readies and proceeds to a PR instead of parking.
  1. Schema + choices. Add autonomous/pr to the task autonomy enum with semantics documented inline; mirror in body-template.eta’s field comment and in new_task.ts AUTONOMY_CHOICES. Enum widening is backward-compatible — decide explicitly whether it warrants a schema_version bump + migration (default: no bump; record the reasoning).
  2. New skill /sdlc:task-auto-define. Reuse task-define’s gap detection; replace the AskUserQuestion elicitation with best-effort synthesis from the task’s existing prose + codebase context. Emit slug-namespaced terminal markers (TASK-AUTO-DEFINE-DEFINED: / -NO-CHANGES: / -INSUFFICIENT:). Stamp a discoverable “spec auto-defined — review carefully” marker on the result. Commit per the commit-message convention.
  3. ensure-ready skill branch. After the deterministic verify reports NEEDS-DEFINITION, read the task’s autonomy; if autonomous/pr, dispatch /sdlc:task-auto-define (one attempt), then re-run the verifier. On OK → stamp + emit ENSURE-READY-OK: (noting auto-defined); on still-failing → the existing downshift. Keep ensure_ready_mutate.ts pure.
  4. Loop guard. Exactly one auto-define attempt per ensure-ready run; if the re-verify still fails, park (no retry storm with a deterministically-failing definer).
  5. Tests. Schema accepts/round-trips autonomous/pr and still rejects unknown values; task-auto-define fills a fixture gap with zero AskUserQuestion calls; ensure-ready auto-defines+passes for autonomous/pr and parks for supervised/human-only/absent.
  6. Docs. Per-skill doc docs/skills/task-auto-define.md; note the tier in task-work + orchestrate; follow the per-skill-doc house-style.
LocationKindChange
plugin/lib/model/entities/task/schema.jsonmodifyadd autonomous/pr to the autonomy enum + doc
plugin/lib/model/entities/task/body-template.etamodifydocument autonomous/pr in the autonomy field comment
plugin/scripts/new_task.tsmodifyadd autonomous/pr to AUTONOMY_CHOICES
plugin/skills/task-auto-define/SKILL.mdnewnon-interactive best-effort define skill
plugin/skills/task-ensure-ready/SKILL.mdmodifyautonomy-gated auto-define dispatch + re-verify branch
plugin/skills/task-work/SKILL.mdmodifynote autonomous/pr self-ready behavior at Step 5a
plugin/skills/orchestrate/SKILL.mdmodifynote autonomous/pr tasks self-ready rather than park
docs/skills/task-auto-define.mdnewper-skill doc (Mermaid flowchart)
  • AC-1: frontmatter validation accepts a task with autonomy: autonomous/pr and rejects an unknown autonomy value (test).
  • AC-2: /sdlc:task-auto-define <slug> run against a fixture task with a fillable gap produces a spec that /sdlc:task-ensure-ready then passes, and it issues zero AskUserQuestion calls (test).
  • AC-3: with a gap present, the ensure-ready skill auto-defines + re-verifies to ENSURE-READY-OK: when autonomy: autonomous/pr, and parks at planning/needs-definition when autonomy is supervised / human-only / absent (test).
  • AC-4: an auto-defined spec carries a discoverable machine-authored marker, and no flow introduced by this change ever merges a PR.
  • AC-5: ensure_ready_mutate.ts’s contract is unchanged — same markers, still never edits body content (its existing tests pass untouched).
  • The autonomous/merge and autonomous/release ladder rungs (future).
  • The mechanical-vs-semantic NEEDS-DEFINITION classification of T-IW1W-needs-definition-auto-fix-vs-human-triage (a different axis; may be superseded by or composed with this task — operator’s call).
  • Auto-merging or any post-PR automation.
  • none

Designed interactively on 2026-06-02 after the /sdlc:orchestrate loop parked T0001/T0002/T0015 at needs-definition — the non-interactive dispatch can’t run AskUserQuestion, so spec gaps a human would resolve in seconds become dead-stops. The autonomous/pr name (matching the schema’s reserved ladder), its “best-effort to a PR, never merge” semantics, and the “its own skill” shape were agreed in that session. Relates to the earlier undefined stub T-IW1W-needs-definition-auto-fix-vs-human-triage.

Captured by /sdlc:task-work on 2026-06-02. PR: pending.

  • AC-1: auto — task_autonomy_enum.test.ts + new_task.test.ts (schema accepts autonomous/pr, rejects unknown values).
  • AC-2: auto — task_auto_define.test.ts (auto-defined fixture spec + AUTO-DEFINED: marker passes the real ensure-ready verifiers to ENSURE-READY-OK:; non-interactive contract enforced by AskUserQuestion’s absence from allowed-tools).
  • AC-3: auto — ensure_ready.test.ts (gate auto-defines for autonomous/pr, parks for supervised/human-only/absent; core fail-mutation stays autonomy-agnostic).
  • AC-4: auto/agent-manual — never-merge boundary asserted in skill prose (task-auto-define, task-work, orchestrate); the discoverable AUTO-DEFINED: marker verified to survive end-to-end.
  • AC-5: auto — ensure_ready_mutate.ts unmodified; its existing tests pass untouched.
  • The spec’s files-to-touch table and ACs mapped cleanly to the implementation; ensure-ready’s pure-verifier boundary made the skill-level autonomy branch a localized, low-risk change.
  • Skill directory auto-discovery ("skills": "./skills" in the plugin manifest) meant the new skill needed no manifest/index registration.
  • Step 7’s baseline-diff gate reported FAIL new-drift=15, but every flagged “finding” was non-deterministic bun test output (per-run temp-dir paths like /tmp/.../append-pr-url-*/ and fixture commit SHAs), not real drift — the baseline gate is unusable against bun test until its output is normalized. Already in flight as 2026-05-25-normalize-baseline-diff-nondeterministic-output (PR #214). → 2026-06-02-normalize-baseline-diff-nondeterministic-output
  • bun test always reports 4 failures (stale validator-golden fixtures for deleted epics/E0001.md, E0002.md, decisions/model-entities.md, plus an edited task fixture), masking the real signal regardless of the change under test. Already in flight as the stale-fixture pruning in PR #221.
  • check_skill_docs shows 4 pre-existing per-skill docs missing on main (pr-respond, spawn-task-pr, standard-new, migrate-runtime-state) — pre-existing coverage drift, not touched here. → T-OH4Y-write-missing-per-skill-docs

← Back to Tasks