blake-trail

Decision → outcome.

Part of blake-guard: append-only trail of gate decisions and post-action facts. Closes the prompt-vs-fact gap.

blake-guard · blake-trail · Apache-2.0 · Node ≥ 20

why

Trail closes the gap.

  • Decision first

    Append the gate decision — allow, deny, or require_approval — with fingerprint and policyHash.

  • Outcome after

    Record whether the side-effect actually happened. Prompt is not fact.

  • Violation when drift

    If deny / require_approval but the action still ran, the trail marks a violation you can verify later.

install

Get the package.

npm install blake-trail

# or from GitHub
npm install github:ndblk3/blake-trail

record

Append decision, then outcome.

import {
  createFsComplianceLog,
  recordDecision,
  recordOutcome,
  verifyTrail,
} from "blake-trail";

const trail = createFsComplianceLog("/var/spaces/andy");

await recordDecision(trail, {
  ownerId: "own_1",
  agentId: "agt_1",
  environment: "personal_private",
  intentType: "git.merge",
  fingerprint: "ifp_…",
  policyHash: "pol_…",
  effect: "deny",
});

await recordOutcome(trail, {
  ownerId: "own_1",
  agentId: "agt_1",
  environment: "personal_private",
  intentType: "git.merge",
  fingerprint: "ifp_…",
  policyHash: "pol_…",
  expectedEffect: "deny",
  occurred: true, // → violation
});

console.log(await verifyTrail(trail));

cli

Inspect without a UI.

npx blake-trail recent --dir ./data/agents/andy --limit 20
npx blake-trail verify --dir ./data/agents/andy

Log path: {root}/.blake-compliance/trail.jsonl.

on blake

Already wired into the gate.

Every decideAgentIntent appends a decision row under data/agents/{nickname}/.blake-compliance/trail.jsonl. Post-run merge compliance appends the outcome. Open Account → Profile to read the trail.

Part of blake-guard — gate · witness · trail. See also blake-gate.