Skip to main content
pb.dq answers a different question than search. Search asks “what is there?” Decision quality asks “is what’s there good enough to act on, for this purpose?” A verdict is a disposition plus an enumerated list of findings. There are no confidence scores: a finding names a specific, structural deficiency, so you can act on it.

check

Return a verdict for a subject and a purpose.
const verdict = await pb.dq.check({
  subject: { type: "Account", id: "acme" },
  purpose: "send a renewal proposal",
});

if (verdict.safeToAct) {
  // proceed
} else {
  console.log(verdict.explain());
}
subject
{ type, id }
required
The entity to evaluate.
purpose
string
What you intend to do. The verdict is relative to this. Defaults to a general fitness assessment.
required
string[]
Slots that must be present for this purpose.
optional
string[]
Slots that strengthen the verdict but are not load-bearing.
A Verdict exposes disposition, findings, purpose, safeToAct, findingsOfKind(kind), and explain().

Dispositions

DispositionMeaning
SafeToActFit to act on for this purpose.
NeedsHydrationMissing or stale slots that can be filled.
BlockedA dependency prevents acting.
UnsafeActing would be a mistake.
SafeToRejectEnough to confidently decline.
NotEvaluatedNo verdict was produced.

Finding kinds

missing-required, needs-hydration, schema-violation, unprovenanced, stale, weak-edge, contradiction.

gaps

The findings that block acting, as a list: the gaps you need to fill.
const gaps = await pb.dq.gaps({
  subject: { type: "Account", id: "acme" },
  purpose: "send a renewal proposal",
});

repair

Turn a verdict’s findings into suggested remediation steps. repair names what is needed; it never generates content or writes. You run the steps through pb.* yourself.
const verdict = await pb.dq.check({ subject, purpose });
const plan = pb.dq.repair(verdict);
// plan.actions: [{ action: "hydrate" | "capture" | "extract" | ..., target, reason }]

audit

Check whether applying a staged delta would degrade the graph. A read-grade dry run; it never writes.
const audit = await pb.dq.audit(deltaId);
if (audit.degrades) {
  console.log(audit.explain());
}

trace

Check evidence coverage for a set of claims or entities. Pass a MemoryBriefing directly, or an explicit set. Each item is marked supported (backed by a stored source), inferred (semantically related but not directly sourced), or unsupported.
const briefing = await pb.memory.synthesize({ query: "deal status" });
const trace = await pb.dq.trace(briefing);

console.log(trace.grounded);     // true only if every claim is supported
console.log(trace.unsupported);  // claims with no backing
pb.dq is read-grade: evaluating quality never writes to the graph.