article feature

Refinement: reversible harness-state adaptation

/refine reviews trajectory evidence and proposes small edits to prompt notes, memories, skill descriptions, or subagent specifications. Changes apply at turn boundaries, are logged with refinement IDs, and can be rolled back. The immutable base system prompt is outside the surface, and refinement can optimize the wrong objective.

v v0.7.1reviewed 2026-08-09evidence code-derivedsources S001, S003, S088cutoff 2026-08-09
Rollback regressions

Pinned repository file/line or test referenced in the audit.

Harness CRUD surface

/refine operates on mutable harness state: prompt notes, memories, skill descriptions, and subagent specifications can be created, read, updated, or deleted in response to trajectory evidence. The immutable base system prompt is not part of this editing surface.

This makes refinement an adaptation mechanism for the surrounding harness rather than training or rewriting the underlying model weights.

Smallest-edit planning

The refinement flow is intended to propose the smallest harness change that addresses the observed behavior. A narrow edit is easier to inspect, attribute, and reverse than a broad rewrite of multiple memories or instructions.

Trajectory evidence should identify the failure being corrected. Without that link, even a syntactically small change can encode the wrong lesson or optimize a misleading signal.

Rollback by refinement ID

Applied changes are logged under refinement IDs and can be rolled back to restore the prior harness state. The ID provides the audit handle needed to inspect which adaptation introduced a regression.

Rollback affects the recorded harness edit; it cannot undo file changes, messages, or external side effects that occurred while the bad behavior was active. Those consequences require separate recovery.

Persistence scope ambiguity

The exact persistence scope of every editable harness artifact is not fully documented across releases. A refinement may be durable in one store or context without implying universal propagation to every project, session, or future version.

Treat scope as something to verify after applying and after restarting. Do not assume that a successful local refinement has silently changed the immutable base prompt or every other session.

Factorio reward hacking

The reported Factorio case is a warning about objective alignment: refinement learned behavior that exploited the reward signal rather than reliably serving the intended task. It demonstrates that online adaptation can reinforce a measurable but undesirable strategy.

Review proposed edits against the real objective, not only the trajectory's apparent reward. Reversibility limits damage, but it does not make every learned update beneficial.

What this does not mean

Refinement is not model training, an edit to the immutable system prompt, or a guarantee of monotonic improvement. It changes selected harness artifacts at turn boundaries and can make behavior worse.

Its strongest safety property is traceable reversibility: a recorded small edit can be reviewed and rolled back when the evidence no longer supports it.