Skip to content

Agent Feedback Delivery

Assura has one check pipeline and several output shapes. Agent integrations use the same CLI options as humans and hooks; there is no separate agent mode.

NeedOptionWho uses it
Raw facts--format json or --format yamlCI, wrappers, reports
Repair guidance--format adviceHumans and agents fixing drift
Compact status--format statusGit hooks, tool results, final status lines
Structured agent feedback--format agentAgents and wrappers that want stable JSON
Codex prompt hook JSON--format agent --agent codexOptional Codex UserPromptSubmit hooks
Event-aware nudge JSONassura agent nudgeCodex, OpenCode, Claude, and Pi wrappers around relevant events
Display limits--min-severity and --max-issuesAny noisy workflow
Advisory exit--warnWorkflows that should report without blocking
SurfaceWho invokes itWhat it runsHow feedback appearsBlocking owner
Manual CLI proofDeveloper or agent commandassura check --format advice or --format statusGuided advice or one-line statusThe caller
Git hooksGitInstalled hook scriptsGit hook stdout/stderrThe hook script
Agent feedback packageWrapper code that cannot call the Rust CLI directlyReport parsing and feedback renderingLibrary return value or JSONThe wrapper
Codex prompt hookOptional Codex UserPromptSubmit commandassura check --format agent --agent codexCodex hookSpecificOutput.additionalContextHook configuration
Event-aware nudgeLocal agent hook or wrapperassura agent nudge --event ... --agent <agent>Bounded assura.agent-nudge.v1 JSONThe wrapper
Agent integration lifecycleMaintainer or setup scriptassura agent integration ...Reviewable .assura/integrations/<agent>/ bundleThe maintainer
Project-intelligence agent CLILocal coding agent with shell accessassura agent ...JSON diagnostics, context packs, graph/search, relation checks, and safe-fix previewsThe caller
Project-intelligence editor sessionLocal editor wrapperassura editor sessionLSP-shaped JSON-line diagnostics, context, and code-action previewsThe wrapper
Future tool/editor hookFuture agent integrationScoped check plus feedback renderingTool result, next agent message, or status lineHook configuration
Project-intelligence sessionLocal agent/editor wrapperassura content sessionJSON-line context/query responsesThe wrapper
Warm checker sessionFuture structure-check integrationPrepared structure checker or hot daemonLow-latency check result for changed pathsIntegration policy

The primary DX is assura check. The package is a lower-level bridge for wrappers that already have an Assura JSON report or cannot shell out to the Rust CLI directly.

Use guided output when a human or agent should fix the result:

Terminal window
assura check --format advice .

Use status output when a hook or tool result needs one concise line:

Terminal window
assura check --format status .

Display controls limit what gets shown without changing what gets checked:

Terminal window
assura check --format advice . --min-severity medium --max-issues 3

Use structured agent output when a wrapper wants stable JSON:

Terminal window
assura check --format agent . --warn --min-severity medium --max-issues 5

Use the Codex delivery adapter only when a Codex UserPromptSubmit hook should inject bounded Assura context:

Terminal window
assura check --format agent --agent codex . --warn --min-severity medium --max-issues 5
OptionEffect
--format adviceEmits human-readable guidance for fixing violations.
--format statusEmits one concise line suitable for hooks and tool output.
--format agentEmits stable assura.agent-feedback.v1 JSON.
--agent codexWraps --format agent output for Codex UserPromptSubmit delivery.
--format jsonEmits the raw structure report.
--format yamlEmits the raw structure report as YAML.
--min-severityHides lower-severity feedback items from display.
--max-issuesCaps displayed feedback items.
--warnReports failures but exits successfully.

Structure feedback uses one shared severity contract across text, JSON, YAML, advice, status, agent, and Codex output. low findings are advisory and emit "blocking": false; medium, high, and critical findings emit "blocking": true and make assura check exit 1 unless --warn is present. Agent messages include path, rule, severity, severity_label, blocking, problem, and corrective_context so integrations do not need to parse human prose.

Use assura agent nudge when a wrapper can observe session or tool events and needs a concise decision about whether Assura context should be injected. Identical messages are suppressed during the default 300-second cooldown; wrappers can set --cooldown-seconds 0 for measurement or deliberate replay:

Terminal window
assura agent nudge --event session-start --agent codex .
assura agent nudge --event before-tool --agent opencode --changed docs/guide.md .
assura agent nudge --event after-tool --agent claude --changed docs/guide.md .
assura agent nudge --event file-read --agent codex --changed docs/guide.md .
assura agent nudge --event recovery --agent opencode .
assura agent nudge --event after-tool --agent pi --changed src/cli/check/rules.rs .

The command emits assura.agent-nudge.v1 JSON by default. Its target_agent field labels the host wrapper; it does not select a private validation engine. codex may use the supported Codex delivery wrapper for deeper check output, while opencode, claude, and pi should fetch generic assura check --format agent --warn output when detail is needed.

EventExpected useCache and context policy
session-startCompact daemon health and project readiness.Inject only when summary.should_inject is true.
before-toolPath-aware edit, move, delete, or targeted read operations likely to influence edits.Pass only paths relevant to the pending tool call.
after-toolChanged files produced new findings or affected references.Keep --max-issues small and defer full reports to explicit commands.
file-readHigh-value reads that should account for affected docs, headings, references, or content records.Pass the read path through --changed; inject only when Assura finds actionable context.
recoveryResume, stale daemon state, failed tool call, or context-repair moments.Prefer compact daemon and fallback commands over broad reports.

Daemon-aware nudges include exact follow-up commands such as assura daemon status --format json ., assura daemon doctor --format json ., and the appropriate assura check --format agent fallback. Wrappers should use those commands for detail instead of injecting daemon state into every event.

Agent-ready onboarding writes .assura/onboarding/lifecycle.md with the same three lifecycle modes used by the JSON onboarding report:

  • nudge: path-aware working-loop feedback from assura agent nudge.
  • warn: advisory checks with assura check --format agent --warn.
  • gate: pre-push or CI checks without --warn, preserving blocking exit behavior for configured medium, high, or critical findings.
MomentRecommended checkWhy
Before a commitGit pre-commit hookCatch drift before local history changes.
Before a pushGit pre-push hookCatch drift before PR/CI feedback.
Before Codex processes a user promptOptional Codex UserPromptSubmit hookInject bounded Assura context into Codex when the user has opted in.
Before or after path-aware agent tool calls`assura agent nudge —event before-toolafter-tool —changed `
Before high-value file readsassura agent nudge --event file-read --changed <path>Surface affected-reference or content context before the agent trusts a file in isolation.
During recovery or resumeassura agent nudge --event recoveryRe-anchor the agent on daemon health and fallback commands without flooding context.
Before a user-facing agent responseReuse the latest report or run a final scoped checkAvoid telling the user work is done while structure drift remains.
After config or checkout changesFull project checkRebuild assumptions after policy or tree shape changes.

The current public assura check and Git hook paths do not keep a daemon. They run when a caller invokes Assura or Git fires an installed hook.

For repeated project-intelligence queries, use a local JSON-line session:

Terminal window
assura content session .

For one-shot project-intelligence handoffs, use the local agent command group:

Terminal window
assura agent context .
assura agent diagnostics .
assura agent context-pack . --collection assura_goals --id goal-assura-project-intelligence-usability-program --text "Project Intelligence Usability" --limit 5
assura agent safe-fixes .

These commands default to JSON and reuse the same content-query and safe-fix preview contracts as assura content ....

For editor wrappers, use the local editor session:

Terminal window
assura editor session .

It accepts LSP-shaped JSON-line methods:

{"request_id":"diag-1","method":"textDocument/diagnostics","params":{"textDocument":{"uri":"docs/goals/goal_portable_structure.md"}}}
{"request_id":"ctx-1","method":"textDocument/context","params":{"uri":"docs/goals/goal_portable_structure.md","text":"portable","limit":5}}
{"request_id":"fix-1","method":"textDocument/codeAction","params":{"uri":"docs/goals/goal_portable_structure.md"}}

Editor responses use assura.project-intelligence.editor.response.v1 and include the same conservative reload states as assura content session. textDocument/codeAction returns preview actions only; wrappers must require an explicit assura fix markdown --apply --format json step before writing.

Send one request per line:

{"request_id":"ctx-1","type":"context-pack","collection":"assura_goals","id":"goal-assura-project-intelligence-usability-program","text":"Project Intelligence Usability","limit":5}

Each response uses assura.project-intelligence.session.response.v1 and reports whether the loaded context was initial_load, reused, or reloaded. The session checks a conservative project fingerprint before every request, so it does not rely on watcher delivery for correctness. It is still local and disposable: stop the process to discard state.

Supported request type values are agent-context, collections, context-pack, diagnostics, expand, missing-relations, safe-fixes, and search. Failed requests return the same response envelope with ok: false, response: null, and an error.code such as invalid_request, request_failed, or reload_failed.

Safe-fix preview responses include both the project-intelligence fact id and the CLI audit audit_id. Wrappers should match audit_id to assura fix markdown --dry-run --format json fixes[].id, then require an explicit assura fix markdown --apply --format json step before writing.

Assura does have lower-level support intended for future editor and agent integrations:

  • PreparedStructureCheck keeps parsed and compiled policy state for repeated checks while configuration bytes stay unchanged.
  • Changed-path checks can validate a file or directory and its direct aggregate scopes without proving whole-project success.
  • Performance evidence includes hot daemon and warm editor-session rows to measure repeated checks without paying full process startup every time.

A future editor or post-tool agent integration should use that shape:

startup or config change -> load policy and build prepared checker
agent edits files -> check changed paths and update latest report
before user response -> show unresolved configured-severity feedback
checkout or policy edit -> refresh with a full project check

That avoids repeating policy parsing and broad validation work on every agent step, while still giving the agent fresh feedback after edits.

IntegrationSupported nowExpected delivery
assura agent integration install <agent>ExperimentalGenerates a reviewable .assura/integrations/<agent>/ manifest, wrapper, and README for Codex, OpenCode, Claude, or Pi.
assura agent integration update <agent>ExperimentalRegenerates the same managed files when Assura changes the shared wrapper contract.
assura agent integration remove <agent>ExperimentalRemoves only Assura-managed bundle files; host-agent config remains a manual opt-in step.
assura agent integration status <agent>ExperimentalReports expected files, managed status, and host wiring guidance.
assura agent integration doctor <agent>ExperimentalChecks project config, managed bundle state, and delegation to nudge/check/daemon commands.
Codex package libraryLower-level onlyWrapper code can use library helpers when it already has JSON.
Codex UserPromptSubmit hookYesA hook runs assura check --format agent --agent codex before Codex processes a prompt.
Codex event nudgesExperimentalA hook or wrapper calls assura agent nudge --agent codex around relevant session and tool events.
OpenCode event nudgesExperimentalA thin plugin or hook calls assura agent nudge --agent opencode and generic assura check --format agent --warn for detail.
Claude event nudgesExperimentalA local command hook or wrapper calls assura agent nudge --agent claude around path-aware tool events.
Pi event nudgesExperimentalA local extension or hook wrapper calls assura agent nudge --agent pi, including performance-gate nudges for structure hot paths.
Other agents with shell accessYesThey can call assura agent ... for project-intelligence context and assura check --format agent for structure feedback.
Project-intelligence sessionYesLocal wrappers can keep assura content session open for repeated context/query requests.
Project-intelligence editor sessionYesLocal editor wrappers can keep assura editor session open for LSP-shaped diagnostics, context, and code-action previews.
Full LSP/editor marketplace packageNot yetA future package should wrap the local editor session or shared content-query contracts.
Editor/daemon structure-check integrationNot yet as public UXShould reuse prepared checks or hot daemon state for repeated changed-path feedback.