Skip to main content
A decision governs your agent once its rule file sits under .actual/rules/. The Actual CLI gives you two ways to get it there. actual adr new writes the decision and its rule file into your repository with no sign-in. Signed in, actual adr create saves the decision to Actual AI, where you can keep it as a draft, publish it, and let Actual AI’s sync pull request write the same files. The actual adr commands need Actual CLI 0.14.0 or later.

Write a decision into the repository

Run actual adr new from the repository root with a title and one --policy per rule:
It writes two files, laid out the way Actual AI’s repository sync writes them: Commit both. Decisions and rule files covers what each file holds and how the header scopes a decision. Before it writes anything, adr new runs the same check Actual AI runs before it saves a decision. When the decision would be refused, it writes nothing and lists each reason. A --policy with no level is refused before that check runs. The new decision gets a random local id until you push it with actual adr create --file, and an existing file is never replaced.

Accepted or draft

An accepted decision governs at once: plan-check and impl-check read its rules. A draft is read by no check. adr new writes an accepted decision when you run it at a terminal, and a draft when standard input isn’t a terminal, as in a coding agent’s shell, a script or CI. An agent that writes a decision therefore leaves a draft for a person to accept. --status accepted or --status draft sets either one yourself. To accept a draft that adr new wrote, change status: draft to status: accepted in the header of both files, and the decision file’s Status: proposed line to Status: accepted.

Policies that check well

Each --policy becomes one rule, and the checks judge a plan or a diff against each rule on its own. A rule checks well when it states one thing a plan or a change can show:
  • Write one statement per policy. “Services store relational data in Postgres” checks cleanly; a policy that bundles a database choice, a naming rule and a review process doesn’t.
  • Choose the level the rule means: MUST and MUST NOT for what every change has to do or avoid, SHOULD and SHOULD NOT for a default with room for exceptions, MAY for what’s allowed. Each rule is judged together with its level.
  • Give a --scope when the decision covers part of the repository. The checks select rules by the paths they govern, so a narrow glob such as services/** keeps the decision out of unrelated changes, and !services/legacy/** carves out an exception.
  • Put the reasoning in --context. The context explains the decision to people; the policies are what the checks enforce.

Check decision files

actual adr check runs Actual AI’s save check on decision files and lists likely duplicates. It needs no sign-in.
Signed in, it also compares the files with your decisions in Actual AI: the connected repository’s decisions, or the whole organization’s when your checkout names no connected repository. It exits 1 when a file fails the check. A likely duplicate is reported without failing the run. Two decisions look the same when their titles share at least half their content words, or when a policy of one does with a policy of the other.

Save a decision to Actual AI

Sign in with actual login (see Sign in), then save a decision from a file that adr new wrote, or from flags:
create works on the connected repository your checkout’s origin remote names; --repo picks another by its name, owner/name or id. It runs these steps in order and stops at the first that fails:
1

Read the decision

It reads the decision from the file or the flags. A file that doesn’t parse, flags with no --policy, or a --policy with no level is refused before anything is sent.
2

Look for duplicates

It reads the repository’s decisions in Actual AI and refuses when the decision is already one of them or looks the same as one. --allow-duplicate sends it anyway.
3

Send it once

It sends the decision once and never retries. When the request was sent but no answer came back, the decision may have been saved: the command exits 3 and asks you to look with actual adr list before you run create again.
4

Finish a file's save

With --file, a scope in the file’s header is set on the new decision, and an accepted save then publishes it. Both files are renamed to the names Actual AI’s sync uses for the new decision, and their headers take its id and the status it was saved with.
--status works as it does for adr new: accepted at a terminal, draft with no person at one. A file saved as a draft stops governing locally until you publish it and Actual AI’s sync pull request rewrites its files. --deciders belongs to adr new; a decision saved from flags has no Deciders line, and a file keeps its own.

Publish, change and archive

These commands act on your organization’s decisions in Actual AI and take a decision’s id as actual adr list prints it. Each one checks the decision’s state by the web app’s rules first and sends nothing when the state doesn’t allow the change. A change to the repository’s rule files arrives through Actual AI’s sync pull request. To change a decision’s policies, read their ids with show, then give update the whole list you want:
With --policy, prefix a policy’s id and = to keep it, write a new policy with no id, and leave a policy out to remove it. --level changes one policy’s level and can’t be combined with --policy. --context replaces the whole context, and --clear-scope applies the decision to its whole repository again. Editing the policy list can give the policies new ids, so take the ids for your next edit from the output update prints or from actual adr show.

Exit codes

Every actual adr command takes --json, which prints its result as JSON on standard output. Errors go to standard error. actual adr lists every subcommand with its flags.