$ fssg build --deterministic --validate |

Why I Define Done Before Giving an AI Agent a Goal

Logs

A goal tells an AI agent where to move. It does not tell the agent when the work is true.

That distinction matters more than another paragraph of prompting. “Improve the API,” “finish the migration,” and “make the article production-ready” all sound actionable. They are not completion criteria. They are directions with enough semantic space for a model to stop at the most persuasive interpretation of progress.

I prefer to define done before goal execution begins. Not because I expect every task to proceed exactly as planned. I do it because an agent needs a boundary stronger than its own confidence.

The dangerous ambiguity of “finished”

Humans often carry an implicit definition of done. We know that changing a route also means running tests, checking the generated contract, preserving unrelated files, and reporting a blocked deployment honestly. An agent sees only the words we externalize and the state its tools reveal.

Without an explicit boundary, several different states collapse into the same final sentence:

  • a file was edited;
  • a command ran;
  • a test passed;
  • the requested behavior was verified;
  • the change is live;
  • the agent could not verify the last step but inferred success.

These are not equivalent. Yet conversational interfaces reward a smooth ending, so “implemented” can become a linguistic shortcut over missing evidence.

This is why I do not treat completion as prose. I treat it as a small artifact.

The completion envelope

Before execution, I want five fields:

completion:
  outcomes:
    - health endpoint returns HTTP 200
    - existing API response shape remains valid
  evidence:
    - test command and exit status
    - response sample with secrets removed
  non_goals:
    - no dependency upgrades
    - no unrelated refactoring
  stop_conditions:
    - schema validation fails
    - required credential is unavailable
  blocker_behavior:
    - report the unmet outcome
    - do not describe partial work as complete

I call this a completion envelope. It is not a universal schema and not a claim that five fields solve agent reliability. It is my compact way to separate what should change from what must be proven about the change.

The mechanism is simple:

  1. Outcomes define observable postconditions, not activities.
  2. Evidence defines what can justify each postcondition.
  3. Non-goals prevent helpful expansion from becoming scope drift.
  4. Stop conditions identify states where continuing would make the result less trustworthy.
  5. Blocker behavior makes incomplete work an allowed, structured result.

A goal can remain ambitious. The envelope makes completion conservative.

Evidence belongs next to the outcome

A checklist is useful, but a detached checklist still invites retrospective storytelling. The stronger pattern is to bind each outcome to evidence.

Outcome Acceptable evidence Not enough
Build is valid named build command exits 0 source looks correct
Route works request to the intended environment returns the expected status and shape handler file was edited
Localizations exist generated EN/RU/ZH pages pass metadata checks three source files were created
No unrelated damage scoped diff review plus relevant regression checks “only a small change”

This is the same reason I keep returning to evidence confidence: a metric and the confidence of its proof are different variables. A green value from the wrong environment is not stronger because it is green.

The completion envelope therefore does not ask only, “What result do we want?” It asks, “What observation would let us say that result exists?”

A blocker is a valid terminal state

One of the worst agent habits is converting missing access into implied success. The build passed locally, deployment credentials were unavailable, and the final answer says the feature was delivered. The prose closes the loop that reality left open.

I want a different state machine:

PENDING -> EXECUTING -> VERIFIED
                    \-> BLOCKED
                    \-> FAILED

BLOCKED is not a weaker spelling of VERIFIED. It carries the unmet outcome, the attempted checks, and the minimum condition needed to continue. FAILED records that a check disproved an expected condition. Both are more useful than a confident summary with no terminal evidence.

This position is visible in IOSM CLI’s current execution guidance: it tells the runtime not to declare completion without evidence and to state explicitly when verification was impossible. Its system prompt also requires completion to be checked against explicit task outcomes. Those are implementation choices in a public repository, not proof that every agent will behave perfectly. They show the boundary I am trying to make executable.

The broader ecosystem is moving in the same direction. OpenAI’s Agents SDK represents sensitive tool approvals as interruptions and provides serializable run state for resume. That design does not establish my completion model, but it reinforces a useful architectural point: pause, approval, resume, and completion need explicit states rather than conversational implication.

Done is not the same as exhausted

An agent can spend every token and still not be done. It can also satisfy the requested outcome in three operations without exploring every possible improvement.

This is why I separate completion from effort. “Try hard,” “be thorough,” and “continue until perfect” describe an optimization posture. They do not define a terminal state. In open-ended tasks they can even create destructive persistence: more edits, broader scope, and repeated retries after the evidence has stopped improving.

A good stop condition is not pessimism. It is an engineering control. It tells the system when another action would be speculation, duplication, or unauthorized expansion.

I made a related argument in The Acceptable Surprise Budget: uncertainty can be useful in exploration, but authority and effects need tighter bounds. The completion envelope applies that distinction to the end of work. The agent may surprise me in how it reaches an outcome. It may not improvise the meaning of verified.

Define done first, then let the agent work

I do not want to turn every small task into ceremony. The envelope should scale with consequence. Renaming a local variable may need one outcome and one test. A deployment may need environment identity, rollback readiness, health checks, and public verification. The artifact should be smaller than the ambiguity it removes.

There are also limits. Completion criteria can be wrong, incomplete, or gamed. Evidence can be stale. A passing test can encode the wrong requirement. Human review remains necessary where consequences justify it. The envelope does not prove correctness; it prevents the system from quietly changing the meaning of completion after execution.

That is enough to make it valuable.

I built my engineering workflow around artifacts because memory and confidence are poor substitutes for inspectable state. A recoverable agent must know where execution stopped. A trustworthy agent must also know which promised outcomes remain unproven.

So I now begin with a deliberately unfashionable question:

Before the agent decides what to do, what would let us truthfully say it is done?

The goal creates motion. The completion envelope creates an accountable ending.

Sources and boundaries

This article is an engineering position grounded in those public artifacts. It reports no benchmark, adoption figure, or production-performance result. The completion envelope is a proposed practice; its boundary is that explicit criteria improve inspectability but cannot guarantee that the criteria themselves are correct.

FACET AI CLI Terminal
facet@ai:~$