# Verify the outcome of an AI task Check exit status, terminal output, the machine record and the expected result before treating an agent report as finished work. When an agent reports that a job is done, check the machine result before acting on the report. A tool call, a finished process and a verified outcome are different things. ## Before you start Choose one online Mac or Linux computer that you own. Connect your agent and leave its grant read-only for inspection. If a command or task must run, the owner must allow the exec class and the machine's ceiling must allow it too. Agree on one observable result before the work begins. For a test run, decide which tests should run and what passing means. For a file-producing job, decide which output file or report should exist. Do not give the agent broader access just to obtain evidence. ## Check a one-shot command 1. Ask for the exact machine, command and working folder. 2. Read the returned exit code, stdout and stderr, and check whether the call timed out or was cancelled. 3. Compare the actual output with the agreed result. The [exec_run tool](https://docs.cmdop.ai/reference/tools/exec_run) returns a non-zero exit code as a result, not necessarily as a tool error. A zero exit code is useful evidence, but it does not by itself prove that the expected tests ran or that the intended file was produced. ## Check a longer task 1. Keep the machine identity and the task ID returned by task_start. See the [task lifecycle](https://docs.cmdop.ai/concepts/tasks) for the distinction between running and completed tasks. 2. Use tasks_list to find running tasks, and task_output to read the selected task's terminal text. 3. If the task has ended, check its recorded ending and the expected outcome. The machine journal can contain the task's end event, including its exit code or signal. 4. Read the resulting report or file where the agent's grant allows it. The running flag becoming false means the task ended. It does not mean the job passed. If the result is missing or the task stopped, keep that distinction visible. ## Read the record The owner's page and history_search can show who called a tool, on which machine and when. The machine's journal_search can provide more detail about calls and task endings, subject to the caller's access. The server's record does not store the full call arguments; the machine's own record holds them as documented. Terminal output is separate from the journal. The retained output of the last 50 tasks is available until the machine program restarts. ## Compare the result on two computers The same successful command can report different results on two filesystems. In a controlled CMDOP exercise, a Mac found a synthetic file using either spelling of its name, while a Linux computer found it only with the exact spelling. These are observations of those two temporary filesystems, not rules for every Mac or Linux computer. For this optional exercise, choose two online Mac or Linux computers you own, each with Python 3 available. Follow [Work with several computers](https://docs.cmdop.ai/guides/use-cases/several-computers) and name the target explicitly for each call. You need the exec grant and a machine ceiling that permits exec on each computer. Commands run with the machine user's authority; file-tool directory limits do not sandbox exec. Ask your agent to run the same reviewed Python script separately on each selected computer. It creates one synthetic file in a temporary directory, checks two spellings, prints the results and removes only its temporary files. Do not run it against an existing project. ```python from pathlib import Path import tempfile,platform,json,hashlib with tempfile.TemporaryDirectory(prefix="cmdop-v031-filename-case-") as tmp: p=Path(tmp);original=p/"Settings.json";original.write_bytes(b'{"mode":"demo"}\n') def check(name): try: data=(p/name).read_bytes() return {"requested":name,"status":"FOUND","sha256":hashlib.sha256(data).hexdigest()} except FileNotFoundError: return {"requested":name,"status":"NOT_FOUND"} out={"schema":1,"fixture":"cmdop-v031-filename-case","system":platform.system(),"machine":platform.machine(),"actualFilename":original.name,"checks":[check("settings.json"),check("Settings.json")],"synthetic":True} assert len(list(p.iterdir()))==1 print(json.dumps(out,sort_keys=True)) ``` Compare the exit status, lookup results and SHA-256 values. The recorded exercise returned exit 0 on both computers: | Observed temporary filesystem | settings.json | Settings.json | | --- | --- | --- | | Mac | FOUND | FOUND | | Linux | NOT_FOUND | FOUND | The successful lookups returned matching content hashes. For your own run, expect the exact-name lookup to find the file. The lowercase lookup may differ. A NOT_FOUND result in this experiment is a finding, not a failed command. Exit 0 alone does not tell you whether the lowercase lookup succeeded. If a target is offline or access is refused, record its result as unknown. Do not change its grants or substitute another machine to obtain a pass. Verify the spelling required on the intended target before proposing any change to a real project. This exercise does not rename project files or demonstrate that a real build will pass. ## Report the outcome For your own notes, record the target, task or call identity, observed result and anything that is still unverified. For example: ```text Machine: your selected computer Task: the returned task ID Expected: the agreed test suite passes Observed: the actual exit status and test report Unverified: anything not checked ``` This is a reporting template, not the result of an actual test run. For a project-wide handoff, follow [Verify and deliver](https://docs.cmdop.ai/guides/workflow/testing-and-delivery). If a call is refused or the computer is offline, report that. Do not switch to another computer or widen permissions to make the report look complete. For an incomplete or refused call, follow [Diagnose an AI agent call that did not complete](https://cmdop.ai/academy/lessons/diagnose-agent-call-errors). ## Next in this path [ChatGPT says hi on your Mac](https://cmdop.ai/academy/lessons/chatgpt-on-your-mac-screen.md) [All materials in this path](https://cmdop.ai/academy/paths/work-on-a-machine.md)