Skip to content

Goal-scoped capability improvement (M1 backend preview)

Language: δΈ­ζ–‡.

This capability owns improvement intent, not capability enablement. It adds bounded advisory guidance to the existing coordinator before_plan entry. The quota path discloses a pending replan through that same entry. There is no new phase, scheduler, memory/adoption store, installer or execution driver. Applicable enabled capabilities remain directly usable without membership in a portfolio and without opting into this policy.

Original owner and configuration

The existing Goal registry owns control_plane.capability_improvement. configure-goal and the Goal settings preview/apply/CAS API share the same writer, configuration catalog, source revision and readback. Python adapts IO; normalization, bounds and advisory decisions have one TypeScript owner in loopx/control_plane/capabilities/goal_capability_organization.ts, inside the packaged runtime fingerprint boundary. No machine-level override is introduced.

loopx configure-goal --goal-id example --capability-improvement-mode bounded \
  --capability-discovery-budget-minutes 5 --capability-max-trials 1
# Inspect preview, then explicitly repeat with --execute to apply.
loopx capability inspect --goal-id example --format json
loopx configure-goal --goal-id example --clear-capability-improvement-configuration
# Explicit --execute clears the override and restores default off.

Absent configuration means off. mode is off or bounded; discovery_budget_minutes is 1–30 (default 5); max_trials is 0–2 (default 1). These bound the proposed discovery work, not a reservation or proof of quota consumption. Existing Todo, lease, quota, capability/provider readiness and protected-effect admission still apply. Changing this intent enables no other capability. Invalid authoring fails before persistence; a corrupt stored policy is visible as invalid, fails open in advice, and can be explicitly cleared.

Progressive disclosure

An ordinary wake with no explicit Goal gap returns no_goal_gap and recommends continuing current work. It does not scan a catalog, query a provider or create work. A replan tag discloses context; it is not itself proof of a capability gap. An explicit cold-path read can pass a public-safe stable gap reference and at most eight candidate observations from their original owners:

loopx agent-context --goal-id example --agent-id coordinator --phase before_plan \
  --capability-planning-trigger replan --capability-gap-ref example/gap \
  --capability-candidate-json '{"capability_id":"example-source","applicable":true,"enabled":false,"configuration_ref":"owner/config-v1","effect_ref":"experiment/baseline","rollback_ref":"owner/rollback"}'

The policy recommends inspecting an applicable already-enabled capability first. If none exists, a trial proposal requires explicit applicability, disabled state, configuration-owner reference, effect-baseline reference and rollback reference. Missing/unknown observations or zero trial budget recommend continuing current work. No candidate list permits bounded discovery within the configured budget. References and caller observations are not authenticated execution grants; re-read the original owners before acting. Advice never authorizes a provider call, installation, configuration mutation, order, signing or transfer.

Trial feedback through the same planning entry

Trial proposals now return trial_basis_digest. After its original owner records the outcome, the caller can attach optional trial_feedback to the same candidate in --capability-candidate-json, for example:

{"outcome_ref":"owner/outcome-v1","trial_basis_digest":"sha256:0000000000000000000000000000000000000000000000000000000000000000","status":"failed"}

Replace the illustrative digest with the previous proposal's digest. The planning provider hashes UTF-8 JSON.stringify of an object in this order: goal_id, agent_id, todo_id, gap_ref, capability_id, candidate_revision, configuration_ref, effect_ref, rollback_ref. Absent scope fields or revision are null. candidate_revision is optional; it and outcome_ref follow the existing bounded reference format. The digest has 64 lowercase hexadecimal characters after sha256:. Existing applicability and enabled-state requirements still apply.

Caller-declared feedback Advice for that candidate
Exact basis, failed or no_evidence Continue work; do not propose the unchanged trial again
Exact basis, succeeded Inspect the original owner's outcome; no utility or adoption inference
Different scope, revision or reference Inspect stale feedback with the original owner
No feedback Preserve the existing trial proposal behavior
Malformed feedback Isolate optional advice failure; a fresh owner observation can recover it

A later independent candidate without feedback remains eligible. An enabled direct candidate wins before feedback validation; off skips feedback entirely. This deterministic advice consumer neither verifies receipts nor persists a retry gate. The digest identifies declarations, not their authenticity. Renaming a revision does not prove improvement; original admission and effect review remain required. Records, retirement and rollback stay with their existing owners.

Scope refinement references Rethinking the Evaluation of Harness Evolution for Agents: bounded tool feedback, task improvement, transfer and total development/evaluation cost need separate evidence. Deterministic tests establish no empirical utility.

Retain the use/result/effect and retirement decision through existing Todo, outcome and capability owners. A useful result must improve a declared outcome or cost against its baseline; invocation, a PR or a successful test is not utility. Unknown effect remains unknown. Roll back via the original capability owner, without deleting historical evidence. Empty, invalid or over-budget advice stays isolated and must not block useful work or weaken existing admission.

Delivery and qualification boundary

CLI configuration, readback, shared Goal settings API and live quota injection are implemented. The existing schema-driven App editor receives the new fields; packaged App interaction/localization and Lark control/guidance are companion work, so this is partial product delivery. The same projection must be reused, not copied into a new UI/chat source. No real-domain utility, default adoption, autonomous evolution or complete portfolio milestone is claimed.

This is the improvement-intent M1 backend slice, not the similarly numbered external-evidence/connector milestone in the portfolio RFC. It supports that RFC's direct-first path without a new composition DSL. Validate deterministic policy and real CLI/configuration behavior with:

node --experimental-strip-types --test tests/control_plane_ts/goal_capability_organization.test.ts
LOOPX_USAGE_PING=0 uv run --extra test python -m pytest tests/capabilities/test_capability_improvement.py -q