pluribus-context 0.3.22 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -3
- package/README.md +2 -2
- package/docs/community-review-packet.md +2 -1
- package/docs/context-budget-receipts.md +150 -0
- package/docs/context-input-evidence.md +397 -0
- package/docs/context-receipts-for-agent-observability.md +177 -0
- package/docs/orchestration-search-receipts.md +102 -0
- package/docs/portability-fidelity-report.md +4 -2
- package/examples/context-input-evidence/AGENTS.md +12 -0
- package/examples/context-input-evidence/agent-overlay-log.jsonl +4 -0
- package/examples/context-input-evidence/agent-overlay-otel-trace.json +548 -0
- package/examples/context-input-evidence/agent-overlay-receipt.ndjson +3 -0
- package/examples/context-input-evidence/agentgateway-progressive-disclosure-otel-trace.json +393 -0
- package/examples/context-input-evidence/agentgateway-progressive-disclosure-receipt.ndjson +4 -0
- package/examples/context-input-evidence/brain-remediation-otel-trace.json +645 -0
- package/examples/context-input-evidence/brain-remediation-receipt.ndjson +7 -0
- package/examples/context-input-evidence/claudekit-mcp-manager-otel-trace.json +417 -0
- package/examples/context-input-evidence/claudekit-mcp-manager-receipt.ndjson +5 -0
- package/examples/context-input-evidence/cli-progressive-disclosure-otel-trace.json +399 -0
- package/examples/context-input-evidence/cli-progressive-disclosure-receipt.ndjson +4 -0
- package/examples/context-input-evidence/compaction-otel-trace.json +711 -0
- package/examples/context-input-evidence/compaction-receipt.ndjson +6 -0
- package/examples/context-input-evidence/context-selection-otel-trace.json +627 -0
- package/examples/context-input-evidence/context-selection-receipt.ndjson +7 -0
- package/examples/context-input-evidence/convert-agent-overlay-log.mjs +156 -0
- package/examples/context-input-evidence/convert-agentgateway-progressive-disclosure-log.mjs +251 -0
- package/examples/context-input-evidence/convert-brain-remediation-log.mjs +241 -0
- package/examples/context-input-evidence/convert-claudekit-mcp-manager-log.mjs +253 -0
- package/examples/context-input-evidence/convert-cli-progressive-disclosure-log.mjs +251 -0
- package/examples/context-input-evidence/convert-compaction-log.mjs +224 -0
- package/examples/context-input-evidence/convert-context-selection-log.mjs +247 -0
- package/examples/context-input-evidence/convert-mcp-tool-search-log.mjs +242 -0
- package/examples/context-input-evidence/convert-memory-consolidation-log.mjs +240 -0
- package/examples/context-input-evidence/convert-memory-governance-delete-log.mjs +223 -0
- package/examples/context-input-evidence/convert-memory-log.mjs +226 -0
- package/examples/context-input-evidence/convert-memory-provenance-log.mjs +263 -0
- package/examples/context-input-evidence/convert-secret-scanning-log.mjs +233 -0
- package/examples/context-input-evidence/convert-session-log.mjs +186 -0
- package/examples/context-input-evidence/convert-skill-log.mjs +161 -0
- package/examples/context-input-evidence/convert-skill-registry-log.mjs +246 -0
- package/examples/context-input-evidence/convert-skill-routing-log.mjs +253 -0
- package/examples/context-input-evidence/convert-subagent-context-budget-log.mjs +267 -0
- package/examples/context-input-evidence/convert-subagent-delegation-log.mjs +264 -0
- package/examples/context-input-evidence/export-otel-trace.mjs +128 -0
- package/examples/context-input-evidence/generate-receipt.mjs +188 -0
- package/examples/context-input-evidence/mcp-tool-search-otel-trace.json +477 -0
- package/examples/context-input-evidence/mcp-tool-search-receipt.ndjson +5 -0
- package/examples/context-input-evidence/memory-consolidation-otel-trace.json +492 -0
- package/examples/context-input-evidence/memory-consolidation-receipt.ndjson +4 -0
- package/examples/context-input-evidence/memory-governance-delete-otel-trace.json +614 -0
- package/examples/context-input-evidence/memory-governance-delete-receipt.ndjson +5 -0
- package/examples/context-input-evidence/memory-otel-trace.json +645 -0
- package/examples/context-input-evidence/memory-provenance-otel-trace.json +711 -0
- package/examples/context-input-evidence/memory-provenance-receipt.ndjson +5 -0
- package/examples/context-input-evidence/memory-receipt.ndjson +4 -0
- package/examples/context-input-evidence/otel-trace.json +1119 -0
- package/examples/context-input-evidence/receipt.ndjson +6 -0
- package/examples/context-input-evidence/sample-agentgateway-progressive-disclosure-log.jsonl +5 -0
- package/examples/context-input-evidence/sample-brain-remediation-log.jsonl +9 -0
- package/examples/context-input-evidence/sample-claudekit-mcp-manager-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-cli-progressive-disclosure-log.jsonl +5 -0
- package/examples/context-input-evidence/sample-compaction-log.jsonl +7 -0
- package/examples/context-input-evidence/sample-context-selection-log.jsonl +7 -0
- package/examples/context-input-evidence/sample-mcp-tool-search-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-memory-consolidation-log.jsonl +5 -0
- package/examples/context-input-evidence/sample-memory-governance-delete-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-memory-provenance-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-memory-retrieval-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-secret-scanning-log.jsonl +7 -0
- package/examples/context-input-evidence/sample-session-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-skill-registry-log.jsonl +5 -0
- package/examples/context-input-evidence/sample-skill-routing-log.jsonl +7 -0
- package/examples/context-input-evidence/sample-subagent-context-budget-log.jsonl +6 -0
- package/examples/context-input-evidence/sample-subagent-delegation-log.jsonl +5 -0
- package/examples/context-input-evidence/secret-scanning-otel-trace.json +794 -0
- package/examples/context-input-evidence/secret-scanning-receipt.ndjson +6 -0
- package/examples/context-input-evidence/session-otel-trace.json +411 -0
- package/examples/context-input-evidence/session-receipt.ndjson +2 -0
- package/examples/context-input-evidence/skill-invocation-log.jsonl +4 -0
- package/examples/context-input-evidence/skill-otel-trace.json +548 -0
- package/examples/context-input-evidence/skill-receipt.ndjson +3 -0
- package/examples/context-input-evidence/skill-registry-otel-trace.json +471 -0
- package/examples/context-input-evidence/skill-registry-receipt.ndjson +5 -0
- package/examples/context-input-evidence/skill-routing-otel-trace.json +567 -0
- package/examples/context-input-evidence/skill-routing-receipt.ndjson +6 -0
- package/examples/context-input-evidence/subagent-context-budget-otel-trace.json +507 -0
- package/examples/context-input-evidence/subagent-context-budget-receipt.ndjson +5 -0
- package/examples/context-input-evidence/subagent-delegation-otel-trace.json +388 -0
- package/examples/context-input-evidence/subagent-delegation-receipt.ndjson +4 -0
- package/package.json +6 -2
- package/schemas/audit-result.schema.json +409 -71
- package/src/commands/audit.js +64 -3
- package/src/utils/version.js +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Orchestration-layer search receipts
|
|
2
|
+
|
|
3
|
+
Search tools can report strong local savings while the whole agent task still gets more expensive: extra turns, repeated queries, insufficient snippets, or fallback full-file reads can erase the gain.
|
|
4
|
+
|
|
5
|
+
The receipt should live at the **orchestration / harness layer**, not inside a retrieval tool. The harness can see the task boundary, tool calls, follow-up reads, and whether the agent looped. A retrieval tool should not need to inspect the user's full task transcript or other tool traffic just to prove its value.
|
|
6
|
+
|
|
7
|
+
## Audience
|
|
8
|
+
|
|
9
|
+
Use this when evaluating code-search, MCP retrieval, RAG-over-notes, or agent memory tools inside Claude Code, Cursor, Codex, Copilot, Windsurf, OpenClaw, Continue, or custom harnesses.
|
|
10
|
+
|
|
11
|
+
## What to prove
|
|
12
|
+
|
|
13
|
+
A useful search receipt should answer:
|
|
14
|
+
|
|
15
|
+
- which task or session this evidence belongs to;
|
|
16
|
+
- which search/retrieval calls happened;
|
|
17
|
+
- how much context was returned to the agent;
|
|
18
|
+
- which files or notes were pointed to;
|
|
19
|
+
- whether the agent needed follow-up full reads;
|
|
20
|
+
- whether insufficient snippets caused repeated queries or extra loops;
|
|
21
|
+
- what data was intentionally omitted for privacy.
|
|
22
|
+
|
|
23
|
+
## Minimal JSON shape
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"schema": "pluribus.orchestrationSearchReceipt.v0",
|
|
28
|
+
"taskId": "optional-local-task-id",
|
|
29
|
+
"createdAt": "2026-05-20T15:00:00Z",
|
|
30
|
+
"orchestrator": {
|
|
31
|
+
"name": "local-harness",
|
|
32
|
+
"version": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"privacy": {
|
|
35
|
+
"storesPrompts": false,
|
|
36
|
+
"storesResultText": false,
|
|
37
|
+
"redaction": "paths-and-counts-only by default"
|
|
38
|
+
},
|
|
39
|
+
"retrievalTool": {
|
|
40
|
+
"name": "example-search-tool",
|
|
41
|
+
"mode": "mcp-or-cli"
|
|
42
|
+
},
|
|
43
|
+
"queries": [
|
|
44
|
+
{
|
|
45
|
+
"queryId": "q1",
|
|
46
|
+
"queryHash": "sha256:...",
|
|
47
|
+
"mode": "hybrid",
|
|
48
|
+
"topK": 5,
|
|
49
|
+
"returnedChunks": 5,
|
|
50
|
+
"returnedChars": 4479,
|
|
51
|
+
"estimatedTokensReturned": 1120,
|
|
52
|
+
"resultFiles": ["src/auth.ts", "src/session.ts"],
|
|
53
|
+
"candidateFileChars": 85000,
|
|
54
|
+
"followUpFullReads": ["src/auth.ts"],
|
|
55
|
+
"fallbackRecommended": false,
|
|
56
|
+
"resultSufficiency": "partial"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"totals": {
|
|
60
|
+
"searchCalls": 3,
|
|
61
|
+
"returnedChars": 12000,
|
|
62
|
+
"estimatedTokensReturned": 3000,
|
|
63
|
+
"estimatedTokensAvoidedVsFullFiles": 42000,
|
|
64
|
+
"followUpFullReadCount": 1,
|
|
65
|
+
"repeatedQueryCount": 1
|
|
66
|
+
},
|
|
67
|
+
"limits": [
|
|
68
|
+
"Does not prove end-to-end task success by itself.",
|
|
69
|
+
"Pair with a transcript or eval harness when comparing agent-level quality/cost."
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Privacy defaults
|
|
75
|
+
|
|
76
|
+
Default to counts, hashes, paths, and tool-call metadata. Do **not** store prompts, raw result text, repository secrets, memory contents, or full transcripts unless the user explicitly opts in.
|
|
77
|
+
|
|
78
|
+
Good defaults:
|
|
79
|
+
|
|
80
|
+
- hash query text instead of storing it when the query may contain private details;
|
|
81
|
+
- keep paths relative and redact ignored/private directories;
|
|
82
|
+
- store byte/token counts instead of snippet bodies;
|
|
83
|
+
- store fallback/full-read counts, not file contents;
|
|
84
|
+
- make receipt output a local artifact unless the user chooses to publish it.
|
|
85
|
+
|
|
86
|
+
## Why this belongs above the search tool
|
|
87
|
+
|
|
88
|
+
A search tool can usually know `returnedChars`, `topK`, and result paths. It usually cannot know whether the agent then:
|
|
89
|
+
|
|
90
|
+
- asked the same question again;
|
|
91
|
+
- read entire files anyway;
|
|
92
|
+
- solved the task;
|
|
93
|
+
- paid more in turns than it saved in retrieval tokens;
|
|
94
|
+
- mixed results with other memory/context sources.
|
|
95
|
+
|
|
96
|
+
That evidence is visible to the orchestrator, agent harness, CLI wrapper, CI eval, or transcript analyzer. Keeping the receipt there avoids asking retrieval tools to become invasive observers of the whole workflow.
|
|
97
|
+
|
|
98
|
+
## How this relates to Pluribus
|
|
99
|
+
|
|
100
|
+
Pluribus already emits context-file fidelity/load evidence for upfront context files. This document extends the same principle to **retrieved context**: the useful claim is not "search returned fewer tokens" in isolation, but "this task received enough context with fewer full reads / fewer loops / acceptable privacy boundaries."
|
|
101
|
+
|
|
102
|
+
This is a sketch, not a stable schema. If an agent harness or search tool has a better receipt shape, open an issue or discussion with a concrete example.
|
|
@@ -77,7 +77,7 @@ Pluribus is intentionally narrower than a skill registry or memory layer:
|
|
|
77
77
|
- `pluribus.md` keeps the claim in one reviewed source of truth.
|
|
78
78
|
- `sync --dry-run` previews target-specific outputs before writing files.
|
|
79
79
|
- generated files carry a warning header so manual edits are visible.
|
|
80
|
-
- `audit --json --fidelity-report` gives CI/reviewers a machine-readable check for missing/drifted outputs plus target-by-target section loss, activation shape, native discovery surface, resolution anchor, generic fallback status, load evidence, effective context scope, and portability warnings.
|
|
80
|
+
- `audit --json --fidelity-report` gives CI/reviewers a machine-readable check for missing/drifted outputs plus target-by-target section loss, activation shape, native discovery surface, resolution anchor, generic fallback status, load evidence, duplicate-load selection evidence, effective context scope, and portability warnings.
|
|
81
81
|
- remote imports are opt-in, locked, cached, and digest-checked before becoming shared context.
|
|
82
82
|
|
|
83
83
|
That does **not** prove runtime behavior. You still need tool-specific smoke tests for load order, path/glob activation, available tools, MCP servers, and permission semantics.
|
|
@@ -91,6 +91,7 @@ For each selected target, the JSON report includes:
|
|
|
91
91
|
- `genericFallback` — whether the output is a broad agent fallback surface rather than a target-specific native surface.
|
|
92
92
|
- `manualActivationRequired` — whether Pluribus knows the output requires manual activation after generation. Built-in project-wide targets are currently `false`; future scoped/skill targets may differ.
|
|
93
93
|
- `loadEvidence` — how the generated context is expected to enter the agent session. Built-in targets currently report `loadedBy` (`native-file-discovery` or `generic-agent-file`), `effectiveSource`, `deliveryMechanism`, `hookInstalled: false`, `injectedOnSessionStart: false`, `resumeBehavior: not-proven`, and `dedupeRisk: unknown`; this makes native-vs-hook-vs-manual duplication an explicit evidence question instead of an assumption.
|
|
94
|
+
- `duplicateLoadEvidence` — which generated candidate Pluribus can identify for duplicate-load review. Built-in targets currently report a `contentIdentity` hash, one `candidateLoads[]` item, a matching `selectedLoad`, empty `suppressedLoads`, `crossRootScanMode: not-inspected`, and `duplicateRisk: unknown`; this is a receipt shape for Cursor/Claude-style duplicate skill or duplicate `CLAUDE.md` loads, not proof of runtime suppression.
|
|
94
95
|
- `effectiveContext` — what Pluribus can prove about the context a target receives. Built-in targets currently report `scope: repo-root`, `pathScoped: false`, `inheritance: none-modeled`, `overrideBehavior: none-modeled`, plus the inferred `loadedBy` and `effectiveSource`; this is explicit evidence that monorepo path inheritance/isolation still needs a separate smoke.
|
|
95
96
|
- `semanticDifference` — a compact list such as `section-loss`, `project-wide-only`, `no-path-scope-evidence`, `generic-agent-file`, or `runtime-load-dedupe-not-proven` so reviewers can distinguish “file exists” from “same behavior is preserved.”
|
|
96
97
|
|
|
@@ -103,7 +104,8 @@ These fields are intentionally boring. They help reviewers catch cases like “i
|
|
|
103
104
|
3. Keep target-native instructions when a semantic cannot be represented everywhere.
|
|
104
105
|
4. Commit a small audit artifact (`pluribus audit --json --fidelity-report --output reports/pluribus-audit.json`) when you want CI/review evidence.
|
|
105
106
|
5. For hook/native/manual mixes, treat `loadEvidence.dedupeRisk: unknown` as a warning, not proof. Add a target-specific receipt for `loadedBy`, `hookInstalled`, `injectedOnSessionStart`, and resume behavior before claiming deduplication.
|
|
106
|
-
6. For
|
|
107
|
+
6. For multi-root skill/rule scans, treat `duplicateLoadEvidence.duplicateRisk: unknown` as a warning, not proof. Add a target-specific receipt for `candidateLoads`, `selectedLoad`, `suppressedLoads`, discovery roots, and content hashes before claiming duplicate suppression.
|
|
108
|
+
7. For monorepos, treat `effectiveContext.scope: repo-root` as a warning, not proof. Add a target-specific smoke for the path you care about, for example `apps/client/` should load root + client context but not `apps/auth/` rules.
|
|
107
109
|
7. Update the claim whenever a new target is added, a tool changes capability names, a subdirectory context is introduced, a hook/manual injection path changes, or a permission/security default changes.
|
|
108
110
|
|
|
109
111
|
## Feedback wanted
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: repo
|
|
3
|
+
applies_to: [claude-code, codex, cursor]
|
|
4
|
+
why_loaded: shared invariant guidance
|
|
5
|
+
expected_benefit: align agent behavior with repository conventions
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Agent instructions
|
|
9
|
+
|
|
10
|
+
Work from {{repo_root}}.
|
|
11
|
+
|
|
12
|
+
Prefer small patches, run the narrowest meaningful check, and explain any context file changes in review.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{"type":"session.start","time":"2026-05-21T19:00:00.000Z","session_id":"demo-session-agent-overlays","conversation_id":"demo-conversation-agent-overlays","agent":"cursor","workspace":"example/portable-agent-context"}
|
|
2
|
+
{"type":"agent_context.loaded","time":"2026-05-21T19:00:01.000Z","source_path":"AGENTS.md","source_role":"base","target_agent":"all","load_order":1,"composition_policy":"base_then_agent_overlay","fallback_policy":"base_only_when_overlay_missing","activation":"native-file-discovery","why_loaded":"shared repository invariants","expected_benefit":"keep cross-agent behavior aligned while avoiding duplicated per-agent rules","source_text":"# Project rules\n- Prefer small reviewable changes.\n- Run tests before claiming success.\n- Never commit secrets.","delivered_text":"# Project rules\n- Prefer small reviewable changes.\n- Run tests before claiming success.\n- Never commit secrets."}
|
|
3
|
+
{"type":"agent_context.loaded","time":"2026-05-21T19:00:02.000Z","source_path":"AGENTS.cursor.md","source_role":"agent_overlay","target_agent":"cursor","load_order":2,"composition_policy":"base_then_agent_overlay","fallback_policy":"base_only_when_overlay_missing","activation":"native-file-discovery","why_loaded":"Cursor-specific rule semantics and workspace hints","expected_benefit":"preserve agent-specific activation semantics without forking the shared repository guidance","source_text":"# Cursor overlay\n- Put Cursor-specific workspace rule hints here.\n- Do not duplicate base safety rules.","delivered_text":"# Cursor overlay\n- Put Cursor-specific workspace rule hints here.\n- Do not duplicate base safety rules."}
|
|
4
|
+
{"type":"agent_context.loaded","time":"2026-05-21T19:00:03.000Z","source_path":"AGENTS.codex.md","source_role":"agent_overlay_candidate","target_agent":"codex","load_order":0,"composition_policy":"base_then_agent_overlay","fallback_policy":"base_only_when_overlay_missing","activation":"not_loaded_wrong_agent","why_loaded":"candidate discovered but not applicable to Cursor session","expected_benefit":"avoid mixing Codex-only instructions into Cursor context","source_text":"# Codex overlay\n- Codex-specific sandbox notes live here, not in the Cursor session.","delivered_text":""}
|