Committed summaries
Project authorized host decisions and read minimal academic feedback during instruction.
Use a committed summary to give a tutor safe feedback from an academic decision already recorded by the host. The official decision remains in the host's system.
Project an event
Call projectCommittedSummary(authorization, previous, event, knownEvent) in an authenticated host ingestion path. Bind scope, decision, source, course, outcome, source policy and consent. Events have a schema version, committed marker, unique event ID, positive revision and disposition. Optional feedback is limited to 2,048 UTF-8 bytes.
This synthetic example projects an already-authorized decision. A real host loads its current projection and event receipt in the same transaction.
// preceptor-docs: runnable
import { projectCommittedSummary, SUMMARY_SCHEMA_VERSION } from "@0xbuff/preceptor";
// Synthetic, already-authorized host data. A real host loads its stored state and receipt.
const authorization = {
scopeRef: "example-scope",
decisionId: "example-decision",
sourceRef: "example-source",
courseRef: "example-course",
outcomeRef: "example-outcome",
sourcePolicyRevision: "1",
consent: true,
};
const result = projectCommittedSummary(authorization, undefined, {
scopeRef: authorization.scopeRef,
decisionId: authorization.decisionId,
sourceRef: authorization.sourceRef,
courseRef: authorization.courseRef,
outcomeRef: authorization.outcomeRef,
sourcePolicyRevision: authorization.sourcePolicyRevision,
schemaVersion: SUMMARY_SCHEMA_VERSION,
committed: true,
eventId: "example-event",
revision: 1,
disposition: "credited",
feedback: "Use the public feedback to plan your next practice.",
});
if (result.status !== "applied" || result.projection.status !== "active")
throw new Error("Expected an active committed summary");
console.log(result.status);Expected output: applied.
Apply revisions atomically
| Delivery | Behavior |
|---|---|
| Exact replay | Duplicate; no change |
| Lower revision | Stale; retain current projection |
| Same-revision conflict or reused event ID | Withhold conflicting decision |
| Authorized newer full snapshot | Apply correction or revocation |
Corrections and revocations carry an explicit earlier superseded revision. Revoked events contain no feedback. Persist the projection and new receipt atomically; never overwrite an existing receipt. Pass undefined only for a genuinely unused event ID. If the reducer returns conflictingDecisionId, withhold the other decision in the same transaction. Resolve conflicts with a newer independently authorized full snapshot referencing the withheld revision or later.
Receipt digests identify content and contain no historical feedback. They do not authenticate events or prove deletion.
Read during instruction
Pass options.summary with SummaryReadAuthorization (including expected revision) and a scoped read-only ports.summary adapter. Return a matching projection or an unavailable reason. Reauthorize scope and consent when reading. The library reads one bounded snapshot and excludes scope keys and receipts from model context.
Missing, denied, stale, conflicting, revoked or malformed summaries produce incomplete context. Planning and locked assessments never invoke the summary adapter. Ingestion and reads are not model-callable operations.
Session provenance reports summaryStatus and the exact decision, source, revision and policy reference when an active summary reaches the model. It excludes feedback and private receipt data. Cancel sessions and invalidate caches on authority changes. Keep raw assessment findings, hidden rubrics and official record writes out of this integration.
See contracts for envelope limits.