Skip to content
Website ↗

Run a swarm hunt ​

The hunt CLI command gives an objective to the local swarm. It uses your configured model and leaves task and validation records in the local daemon. Finish model setup and open an interactive terminal in your project directory. Capabilities vary by build, so use codant --help to confirm the hunt options available in your installation. CLI entry point · Hunt arguments

To start from scratch, create the sample project and use one task ID to follow the candidate, validation, and delivery. Follow a hunt from request to delivery

Choose the deliverable ​

GoalEntry pointWhat you can inspect
Investigate code or explain behaviorcodant hunt --answer "your investigation goal"An answer. Before delivery, the daemon verifies that the run left the workspace unchanged.
Change and validate filescodant hunt --check CHECK_ID "your change goal"The task, candidate diff, selected checks, and publication record. The check ID comes from the current user configuration.

For example, start by investigating how a configuration value is read. Asking for particular files or behavior makes the findings easier to check.

sh
codant hunt --answer "Find where the project reads its default encoding. List the setting, relevant files, and tests that cover it."

Subtask dispatch depends on the work and scheduling conditions. An answer-only hunt without selected checks can finish on the read-only answer path. File delivery also goes through candidate review and checks. Answer and workspace delivery paths · Dispatch conditions

Configure a reproducible check ​

Suppose a test Git repository already has a settings.json file with "encoding": "latin1" at the top level. The task changes only that field. Open your user configuration file, which defaults to ~/.codant/config.toml. Append the block below and replace project_roots with the test project's actual absolute path. The TOML single quotes preserve the backslashes in the Windows example. Paths within the project use /. Configuration loader · Check configuration schema

toml
[[hunt_checks]]
id = "verify-encoding"
checker = "artifact"
project_roots = ['D:\work\codant-demo']
input_paths = ["settings.json"]

[[hunt_checks.conditions]]
kind = "json"
path = "settings.json"
pointer = "/encoding"
condition = { operator = "equals", value = "UTF-8" }

This artifact check reads the candidate JSON and compares the value at /encoding. It validates the one field named in the condition. The project can suggest checks. The selected ID must come from the user configuration, and the daemon verifies the project root and freezes the check plan before execution. JSON condition implementation · Check plan freeze

Submit the change and inspect the evidence ​

Run the following command from the project you configured. When an action requires approval, the interactive terminal shows the pending action and a preview. File changes form a candidate diff. The daemon records the soldier's review and selected checks against that same candidate before it can proceed to workspace publication. Hunt approval prompt · Execution, validation, and publication

sh
codant hunt --check verify-encoding "Change only the encoding field in settings.json to UTF-8. Preserve all other fields and files."

Replace TASK_ID below with the ID from this submission. Use show for task status, evidence for validation records, and changes --source delivered for files recorded as delivered. In the TUI, you can also enter /ants changes TASK_ID. Task commands · File result filters

sh
codant task show TASK_ID
codant task evidence TASK_ID
codant task changes TASK_ID --source delivered

Investigate a failure or a candidate-only result ​

  • The check ID is unknown. Check the user configuration that Codant actually reads and confirm that project_roots authorizes the project you ran the command in.
  • A check failed or publication is unconfirmed. Read the validation evidence, then use codant task changes TASK_ID --source candidate to inspect any retained candidate. Candidate and delivered changes record different stages.
  • You want to build on an existing result. From the same project, use codant task artifacts --task TASK_ID to list retained artifacts. Workspace hunts accept --from-task. If the earlier task has multiple retained results, use --from-artifact to identify the original artifact. The runtime checks its origin and workspace again.

See troubleshooting, retained artifact validation, and task history, evidence, and diffs.