@agenticprimitives/context
v0.0.0-alpha.28
Published
The two-tier context contract (spec 351 P0.11): public knowledge vs a subject's private records, entity resolution that refuses to guess, and the ContextProvider port.
Maintainers
Readme
@agenticprimitives/context
Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages
The two-tier context contract: public knowledge (reproducible from chain state — ADR-0040) and a subject's private records (their relationships and rosters — ADR-0025), with the tier carried on every fact so the two can never be quietly mixed.
import { resolveEntity, type EntityProvider } from '@agenticprimitives/context';
// "who did they mean by alice?" — asked only of the asker's own tier, because this answer
// will become the payee of a mandate.
const outcome = await resolveEntity(providers, { term: 'alice', tiers: ['private'], subject: askerSa });
switch (outcome.outcome) {
case 'certain': return outcome.candidate.agent;
case 'ambiguous': return ask(outcome.candidates); // the person chooses; nothing is ranked
case 'unknown': return refuse(outcome.looked); // and say where we looked
}There is no score, and there will not be one: a ranked list with a confident top entry is
indistinguishable from certainty, which is how a payment reaches the wrong person.
See CLAUDE.md for the boundary and spec.md for the invariants.
