# Goal Completion Check

> When the task queue is exhausted, Foundry does not assume the project goal is met. It runs an explicit goal completion check before marking a project as…

Source: https://bifrost5.com/foundry/docs/goal-completion-check/

# Goal Completion Check

Information

Look at the actual finished work in a secure preview, then decide, instead of trusting test results alone, with Production-Grade.

[See editions](/foundry/docs/editions)

When the task queue is exhausted, Foundry does not assume the project goal is met. It runs an explicit **goal completion check** before marking a project as done.

## How It Works

- The supervisor builds a prompt listing all project goals from `state.goals` along with completed and blocked tasks.

- The prompt asks the agent: *"Given these goals and results, is the overall goal met?"*

- The agent responds with structured JSON: ``` { "goal_completed": boolean, "reasoning": "string" } ```

- If `goal_completed: true` → all goals in `state.goals` are marked complete, supervisor status becomes `COMPLETED`.

- If `goal_completed: false` → supervisor halts with the agent's reasoning surfaced to the operator.

## Important Notes

- The check runs against the **first registered project's** sandbox `cwd`.

- All goals are marked completed **together**: there is no partial completion.

- If tasks are blocked and the queue is empty, the agent's reasoning will explain what is still unresolved: giving the operator clear signal on what to fix or re-enqueue.

## Relation to HALT

A `goal_completed: false` result is a **clean halt**: not a crash. State is fully persisted. The operator can review the reasoning, add tasks, and resume.
