A caller invokes search_receipts with a
query, an optional claim_type
(unknown / external_action /
internal_method), and an optional current session ID.
The single real route is POST /api/receipts/search.
The layer fans out across every registered trace surface, term-matching the searchable
text columns of each — read-only, mutating nothing.
Product 16 · SDK / MCP / Local API · Wave 2
Receipt Discovery Layer
Proof-of-action gets created everywhere — tool calls, model usage, file reads, memory writes, change logs — across many subsystems and sessions. Receipt Discovery is the one read-only place to ask “did this actually happen?” and get back the matching receipts with a trust classification, not a guess.
Receipts pile up in silos. The question gets answered from narration.
Proof-of-action lands wherever it is made. A model call lands in
model_usage_log, a tool result in
tool_audit, a file read in
shared_files, a memory write in a memory
table, a state change in change_log — each
subsystem keeps its own proof, in its own shape, scoped to its own session. When someone
later asks “did the agent actually do X?”, the proof exists, but it is scattered
across a dozen surfaces with no shared query.
So the question gets answered from narration instead of receipts. The agent reasons about whether something happened, and confident language fills the gap the missing query left open. Worse, two true things get conflated: a real internal method — a repeatable protocol with traces across memory, execution, and change surfaces — gets described as an external worker or agent run, even though no worker or model receipt exists. The “drone” lesson in the originating agent was exactly this: the method was real and receipt-backed, but it was not an autonomous agent.
Receipt Discovery makes the whole proof-trail queryable. One read-only search fans out across every receipt surface, correlates the hits, and returns them with an explicit trust classification and language guidance — so claims can be bound to receipts instead of to confidence.
Search → Classify → Correlate
Hits are grouped by surface and group, then classified: a direct external receipt →
CONFIRMED; a strong cross-surface
internal pattern → CONFIRMED
as an internal method (explicitly not an external worker); multi-surface but
weaker → PARTIAL_EVIDENCE; a single
surface → a weak trace; nothing → ABSENT.
Results carry counts by surface, by group, and by session
scope (same_session /
cross_session / unknown_session /
no_session), plus
language_guidance and
recognition_guidance telling the caller
exactly what the receipts do and do not support.
Surfaces, trust taxonomy & query dimensions
The model below is derived directly from the originating agent's receipt-discovery service and its trace registry. Field and surface names reflect the originating implementation (see the lineage note).
TRACE_SURFACES)| Group | Example surfaces | Counts as |
|---|---|---|
| external_execution | execution_log |
External receipt |
| external_tool | tool_audit |
External receipt |
| external_model | model_usage_log |
External receipt |
| external_worker | worker_log |
External receipt |
| file | shared_files |
External receipt |
| snapshot | snapshots |
External receipt |
| memory | memory_semantic, memory_episodic, memory_procedural, … memory_releases |
Internal-method trace |
| change | change_log |
Internal-method trace |
| witness | witness_log |
Internal-method trace |
| stream_capture | stream_captures |
Internal-method trace |
| retraction | retraction_log |
Internal-method trace |
| conversation | conversation |
Internal-method trace |
| heat | cognitive_heat_events |
Internal-method trace |
| proposal / heartbeat / goal / thread | spawn_proposals, heartbeat_notes, goals, threads |
Context trace |
External-receipt groups vs. internal-method groups are tracked separately
(EXTERNAL_RECEIPT_GROUPS,
INTERNAL_METHOD_GROUPS) —
this is what keeps a real internal method from being reported as an external worker.
| Status | evidence_kind | When |
|---|---|---|
| CONFIRMED | external_receipt |
claim_type=external_action and a direct external-group receipt exists. |
| CONFIRMED | internal_method |
≥4 surfaces incl. memory and an execution/change/witness/stream/retraction trace — confirmed as a method, explicitly not an external worker. |
| PARTIAL_EVIDENCE | cross_surface_trace |
Traces on ≥2 surfaces but not enough for the stronger claim. |
| PARTIAL_EVIDENCE | single_surface_trace |
A related trace on only one surface — a weak trace, not confirmation. |
| ABSENT | absent |
No matching traces; treat as absent or hypothesis only. |
The full status vocabulary is CONFIRMED /
PARTIAL_EVIDENCE /
INFERRED /
ABSENT. The decisive line is
external receipt vs. internal-method trace — a real method is never reported as an external
worker run.
| Dimension | Field(s) | Use |
|---|---|---|
| Query terms | query (≤8 terms) |
Free-text match across the searchable columns of each surface. |
| Claim type | claim_type |
Steers external-action vs. internal-method classification. |
| Surface / group | counts_by_surface, counts_by_group |
See where the proof lives and how it is distributed. |
| Session scope | counts_by_scope, per-hit session_scope |
Separate current-session facts (same_session) from cross_session / unknown_session / no_session evidence. |
| Coverage | searched_surfaces, omitted_surfaces |
Know exactly what was searched and what errored or was skipped. |
recognition_guidance turns the
session-scope counts into explicit language rules — e.g. cross-session-only evidence may be
cited but must not be claimed as current-session direct recognition.
POST /api/receipts/search),
the full surface registry, the trust taxonomy, and the external-vs-internal-method
distinction are all implemented and verifier-passed in the originating agent
— RECEIPT_DISCOVERY_LAYER_VERIFIER_OK.
The companion tools below (classify_claim,
list_receipt_surfaces) are
proposed convenience surfaces over fields the service already returns.
MCP tools
The MCP tools below ship in the published package (v0.1.1). They were extracted from what the originating agent's receipt-discovery route and service expose today.
CONFIRMED / PARTIAL_EVIDENCE / INFERRED / ABSENT), counts by surface/group/scope, and language + recognition guidance. Wraps POST /api/receipts/search.language_guidance for a query/claim, without the full evidence payload. The discovery service already computes these fields.Install
Receipt Discovery Layer is a CertaWorks Wave 2 product — built, tested, and published on npm. The commands below install the package — an SDK, an MCP server, and a local HTTP API, consistent with the rest of the suite — so you can see exactly what it exposes.
Running it, or want to help shape what comes next? Use the feedback form below.
The package @certaworks/receipt-discovery-layer
is live on npm. Install it globally, or point your MCP client at it with the config below
(its MCP server command is receipt-discovery-mcp).
npm install -g @certaworks/receipt-discovery-layer
{
"mcpServers": {
"receipt-discovery": {
"command": "npx",
"args": ["-y", "-p", "@certaworks/receipt-discovery-layer", "receipt-discovery-mcp"]
}
}
}
What Receipt Discovery does and does not do
- Search every local receipt surface from one read-only query
- Classify results into a confirmed / partial / inferred / absent taxonomy
- Distinguish a real internal method from an external worker/agent run
- Correlate hits by surface, group, and session scope
- Emit explicit language + recognition guidance per result
- Run fully local as an MCP server, SDK, and local HTTP API
- Create, write, or modify any receipt (read-only)
- Decide whether a claim is “true enough” to act on
- Assert an external action without a direct external receipt
- Reach across machines or non-local stores — it searches local surfaces only
- Guarantee completeness — it reports searched and omitted surfaces honestly
- Provide hosted storage, team accounts, or replace human/audit review
Related Products
Using Receipt Discovery Layer? Tell us how it goes
Receipt Discovery Layer is part of CertaWorks Wave 2 — a second set of built tools productized from a working cognitive agent. It's on npm now. Tell us what you're running it against, what broke, or what you'd want next — we read every note.