Files
sam 0dbf241106 feat(judgement): the weakest-link decision, and executing only what was judged (#1986, #1989, #1990, #1988)
A new judgement module assesses one concrete action: hard rules refuse before
any guard runs; every guard sets a ceiling and the action runs at the lowest;
a guard that fails, panics or gives no ceiling holds it at propose and wait;
an advisory verdict is recorded and sets no ceiling. Reversibility and
Precedent (the fresh-install class default) are the first guards. Every
decision is recorded with its verdicts and class, and the run's trail lists
them. Agent tools now offer connector actions too: each call is assessed and
executed only as decided and only with the judged input, and a held action
comes back to the agent as a failed call naming its level and findings.
Tools gain Resolve, so an MCP server's declared effect reaches judgement.
2026-11-16 01:05:29 +11:00

28 lines
1.0 KiB
SQL

-- +goose Up
CREATE SCHEMA judgement;
-- A decision is the judgement of one concrete action, with every verdict in
-- its body. key identifies the attempt to run it, so a replayed step finds the
-- decision already made. The class columns are what earned autonomy is
-- counted against.
CREATE TABLE judgement.decisions (
id uuid PRIMARY KEY,
org_id text NOT NULL,
run_id uuid NOT NULL,
key text NOT NULL,
connector text NOT NULL,
action text NOT NULL,
target_kind text NOT NULL,
environment text NOT NULL,
level text NOT NULL CHECK (level IN ('act_quietly', 'act_and_tell', 'propose_and_wait', 'escalate', 'never')),
body json NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (org_id, key)
);
CREATE INDEX decisions_by_run ON judgement.decisions (org_id, run_id, created_at);
CREATE INDEX decisions_by_class ON judgement.decisions (org_id, connector, action, target_kind, environment, created_at);
-- +goose Down
DROP SCHEMA judgement CASCADE;