A short run

An agent adds to a web page and commits it. complier only lets the commit through if the page's check passed after the agent's last edit.

You need complier installed, with complier doctor saying ready. See Install.

  1. Get a page to work on

    A small page with a check script (it fails if a link is broken or the title is missing). Its complier workflows come with it, in .complier/:

    Terminal
    git clone https://github.com/kavishsathia/complier-loop-test ~/loop-test
    cd ~/loop-test
  2. Read the contract

    It's in .complier/short/workflow.csp. Running the check is a call like any other, and its result, done if it passed or failed if not, decides what comes next:

    workflow.csp
    Unchecked = Permit(edit, \ _ @ Unchecked)
             [] Permit(check, \ v @ (if v == done then Checked else Unchecked))
             [] Deny(commit, Unchecked)
    Checked   = Permit(edit, \ _ @ Unchecked)
             [] Permit(check, \ v @ (if v == done then Checked else Unchecked))
             [] Permit(commit, \ _ @ SKIP)
    
    Agent  = ControllableCHAOS
    System = prioritise(Agent [| {|attempt, allow, deny, result, refuse|} |] ComplierGuard(Policy),
                        <{|attempt|}, {refuse}>)

    Next to it, claude-code.yaml says which of Claude Code's tool calls count as edit, check and commit.

  3. Start the machine

    FDR proves the contract and the CEL verifier proves the unit before anything runs:

    Terminal
    complier machine up short .complier/short

    Then watch it in a second terminal. Every call shows up as allowed, denied or refused, and every result as it comes back:

    Terminal
    complier machine log short --follow
  4. Start Claude Code on it

    Back in the first terminal:

    Terminal
    COMPLIER_MACHINE=short COMPLIER_ROLE=dev claude --plugin-dir ~/.complier/plugin

    Then give it the task, which is also in .complier/short/prompt.md:

    prompt
    Add two more birds to index.html, each with a short note, then commit with `git commit -am "..."`.
    Before committing, run the page's check with `python3 check.py`: the commit is only allowed if that
    check passed after your last edit.
  5. What to look for

    • A commit before the check, or after an edit since the last check, is denied, with the reason.
    • Try breaking the page (ask the agent to link to a file that doesn't exist): the check fails, the result is failed, and the commit stays denied until a later check passes.
    • Once the commit is through, the log ends with finished. Stop the machine with complier machine down short.