pluribus-context 0.3.39 โ 0.3.41
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 +9 -0
- package/README.md +1 -1
- package/bin/pluribus.js +2 -0
- package/docs/.nojekyll +0 -0
- package/docs/.well-known/agent-skills/context-receipts/SKILL.md +206 -0
- package/docs/.well-known/agent-skills/index.json +19 -0
- package/docs/.well-known/agent-skills/skill-policy-receipts/SKILL.md +77 -0
- package/docs/context-budget-receipts.md +43 -0
- package/docs/index.html +38 -0
- package/docs/receipt-playground.html +250 -0
- package/examples/context-attention-receipts/README.md +41 -0
- package/examples/context-attention-receipts/attention-receipt-fail.json +49 -0
- package/examples/context-attention-receipts/attention-receipt-pass.json +53 -0
- package/examples/context-attention-receipts/check-attention-receipt.mjs +97 -0
- package/examples/tool-surface-diff-receipts/tool-surface-diff-receipt.json +61 -0
- package/package.json +10 -2
- package/skills/context-receipts/README.md +13 -2
- package/skills/context-receipts/SKILL.md +65 -0
- package/src/commands/demo.js +120 -1
- package/src/utils/version.js +1 -1
|
@@ -45,6 +45,71 @@ Minimal JSONL event names:
|
|
|
45
45
|
{"event":"mcp.tool_call.completed","tool_id":"github.search_code","args_hash":"sha256:...","result_token_bucket":"2k_4k","raw_args_copied":false,"raw_result_copied":false,"status":"ok"}
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
## Runtime tool-surface diff smoke
|
|
49
|
+
|
|
50
|
+
For MCP dynamic discovery, gateways, admin/Purview-style audit trails, or runtime tool catalogs, separate discovery from activation:
|
|
51
|
+
|
|
52
|
+
- which platform/gateway/audit sink observed the runtime catalog change;
|
|
53
|
+
- which catalog/version/hash was active before and after discovery;
|
|
54
|
+
- which tools were discovered, activated, withheld, or blocked;
|
|
55
|
+
- which validation outcome applied, such as `accepted`, `blocked_by_rai`, `blocked_by_xpia`, `schema_invalid`, or `entitlement_filtered`;
|
|
56
|
+
- whether only low-cardinality ids, hashes, counts, and outcome codes entered the receipt;
|
|
57
|
+
- the audit gap, such as not proving the tool was semantically right for the user task.
|
|
58
|
+
|
|
59
|
+
Minimal JSON shape:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"receipt_type": "pluribus.mcp_tool_surface_diff_receipt.v1",
|
|
64
|
+
"runtime_discovery": {
|
|
65
|
+
"trigger": "turn_start|admin_refresh|tool_search|manual_refresh",
|
|
66
|
+
"before_catalog_hash": "sha256:...",
|
|
67
|
+
"after_catalog_hash": "sha256:..."
|
|
68
|
+
},
|
|
69
|
+
"summary": {
|
|
70
|
+
"discovered_count": 3,
|
|
71
|
+
"activated_count": 1,
|
|
72
|
+
"withheld_count": 1,
|
|
73
|
+
"blocked_count": 1
|
|
74
|
+
},
|
|
75
|
+
"privacy": {
|
|
76
|
+
"raw_schemas_copied": false,
|
|
77
|
+
"raw_prompts_copied": false,
|
|
78
|
+
"raw_results_copied": false
|
|
79
|
+
},
|
|
80
|
+
"audit_gap": "proves tool-surface boundary, not semantic usefulness"
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Context attention smoke
|
|
85
|
+
|
|
86
|
+
For GraphRAG, memory, code search, transcript review, or baseline-first workflows, separate retrieval from attention:
|
|
87
|
+
|
|
88
|
+
- which required context ids were selected or retrieved;
|
|
89
|
+
- where they were delivered, such as prompt, tool result, memory result, subagent packet, or file read;
|
|
90
|
+
- which ids were acknowledged before planning;
|
|
91
|
+
- which ids were cited before edits/tool calls;
|
|
92
|
+
- what the agent must stop on if a required id is missing;
|
|
93
|
+
- whether raw docs, prompts, results, paths, customer text, and full transcript snippets stayed out of the receipt.
|
|
94
|
+
|
|
95
|
+
Minimal JSON shape:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"receipt_type": "pluribus.context_attention_receipt.v1",
|
|
100
|
+
"required_context_ids": ["ctx:auth-boundary", "ctx:migration-plan"],
|
|
101
|
+
"delivered_context_ids": ["ctx:auth-boundary", "ctx:migration-plan"],
|
|
102
|
+
"acknowledged_before_plan_ids": ["ctx:auth-boundary", "ctx:migration-plan"],
|
|
103
|
+
"cited_before_edit_ids": ["ctx:auth-boundary"],
|
|
104
|
+
"missing_context_stop": "stop_before_edit",
|
|
105
|
+
"privacy": {
|
|
106
|
+
"raw_context_copied": false,
|
|
107
|
+
"raw_transcript_copied": false
|
|
108
|
+
},
|
|
109
|
+
"audit_gap": "proves required context was acknowledged/cited, not that the edit is correct"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
48
113
|
## Skill / prompt context smoke
|
|
49
114
|
|
|
50
115
|
For skills, rules, AGENTS.md overlays, or instruction files, answer:
|
package/src/commands/demo.js
CHANGED
|
@@ -11,9 +11,11 @@ const DEFAULT_DEMO = 'skill-use-rate'
|
|
|
11
11
|
const SKILL_USE_RATE_DEMO = 'skill-use-rate'
|
|
12
12
|
const MCP_AUDIT_RECEIPT_DEMO = 'mcp-audit-receipt'
|
|
13
13
|
const MCP_TELEMETRY_IMPORT_DEMO = 'mcp-telemetry-import'
|
|
14
|
-
const
|
|
14
|
+
const TOOL_SURFACE_DIFF_DEMO = 'tool-surface-diff'
|
|
15
|
+
const AVAILABLE_DEMOS = [SKILL_USE_RATE_DEMO, MCP_AUDIT_RECEIPT_DEMO, MCP_TELEMETRY_IMPORT_DEMO, TOOL_SURFACE_DIFF_DEMO]
|
|
15
16
|
const SKILL_USE_RATE_SCHEMA = 'pluribus.skill_use_rate_receipt.v1'
|
|
16
17
|
const MCP_AUDIT_RECEIPT_SCHEMA = 'pluribus.mcp_tool_call_audit_receipt.v1'
|
|
18
|
+
const TOOL_SURFACE_DIFF_SCHEMA = 'pluribus.mcp_tool_surface_diff_receipt.v1'
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* @param {Record<string, string | boolean>} args
|
|
@@ -29,6 +31,8 @@ export async function runDemo(args, positional = []) {
|
|
|
29
31
|
return runMcpAuditReceiptDemo(args)
|
|
30
32
|
case MCP_TELEMETRY_IMPORT_DEMO:
|
|
31
33
|
return runMcpTelemetryImportDemo(args)
|
|
34
|
+
case TOOL_SURFACE_DIFF_DEMO:
|
|
35
|
+
return runToolSurfaceDiffDemo(args)
|
|
32
36
|
default:
|
|
33
37
|
console.error(`โ Unknown demo: ${demoName}`)
|
|
34
38
|
console.error(` Available demos: ${AVAILABLE_DEMOS.join(', ')}`)
|
|
@@ -188,6 +192,44 @@ function bundledMcpTelemetryJsonlPath() {
|
|
|
188
192
|
return fileURLToPath(new URL('../../examples/mcp-telemetry-import/sample-rpc-messages.jsonl', import.meta.url))
|
|
189
193
|
}
|
|
190
194
|
|
|
195
|
+
function bundledToolSurfaceDiffReceiptPath() {
|
|
196
|
+
return fileURLToPath(new URL('../../examples/tool-surface-diff-receipts/tool-surface-diff-receipt.json', import.meta.url))
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function runToolSurfaceDiffDemo(args) {
|
|
200
|
+
const receiptPath = selectedReceiptPath(args, bundledToolSurfaceDiffReceiptPath())
|
|
201
|
+
const receipt = readReceipt(receiptPath, 'tool-surface diff')
|
|
202
|
+
const result = validateToolSurfaceDiffReceipt(receipt)
|
|
203
|
+
|
|
204
|
+
if (Boolean(args.json)) {
|
|
205
|
+
console.log(JSON.stringify({
|
|
206
|
+
ok: result.errors.length === 0,
|
|
207
|
+
demo: TOOL_SURFACE_DIFF_DEMO,
|
|
208
|
+
receipt: path.relative(process.cwd(), receiptPath) || receiptPath,
|
|
209
|
+
summary: result.summary,
|
|
210
|
+
warnings: result.warnings,
|
|
211
|
+
errors: result.errors,
|
|
212
|
+
}, null, 2))
|
|
213
|
+
} else {
|
|
214
|
+
console.log('๐งช Pluribus demo: MCP tool-surface diff receipt')
|
|
215
|
+
console.log(` Receipt: ${path.relative(process.cwd(), receiptPath) || receiptPath}`)
|
|
216
|
+
console.log('')
|
|
217
|
+
|
|
218
|
+
if (result.errors.length === 0) {
|
|
219
|
+
console.log(`โ
tool-surface diff receipt ok: ${result.summary.discoveredCount} discovered, ${result.summary.activatedCount} activated, ${result.summary.withheldCount} withheld/blocked`)
|
|
220
|
+
for (const warning of result.warnings) console.log(` โข ${warning}`)
|
|
221
|
+
console.log('')
|
|
222
|
+
console.log('Why this matters: runtime MCP discovery changes the active tool surface. Persist a low-cardinality receipt of discovered โ activated โ withheld/blocked tools without logging raw schemas, prompts, or results.')
|
|
223
|
+
console.log('Try your own receipt: pluribus demo tool-surface-diff --receipt path/to/tool-surface-diff-receipt.json --json')
|
|
224
|
+
} else {
|
|
225
|
+
console.error('โ tool-surface diff receipt invalid:')
|
|
226
|
+
for (const error of result.errors) console.error(` โข ${error}`)
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (result.errors.length > 0) process.exit(1)
|
|
231
|
+
}
|
|
232
|
+
|
|
191
233
|
export function validateSkillUseRateReceipt(receipt) {
|
|
192
234
|
const errors = []
|
|
193
235
|
const warnings = []
|
|
@@ -537,3 +579,80 @@ export function validateMcpAuditReceipt(receipt) {
|
|
|
537
579
|
},
|
|
538
580
|
}
|
|
539
581
|
}
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
export function validateToolSurfaceDiffReceipt(receipt) {
|
|
585
|
+
const errors = []
|
|
586
|
+
const warnings = []
|
|
587
|
+
|
|
588
|
+
function requireString(value, field) {
|
|
589
|
+
if (typeof value !== 'string' || value.trim() === '') errors.push(`${field} must be a non-empty string`)
|
|
590
|
+
}
|
|
591
|
+
function requireBoolean(value, field) {
|
|
592
|
+
if (typeof value !== 'boolean') errors.push(`${field} must be boolean`)
|
|
593
|
+
}
|
|
594
|
+
function requireNonNegativeInteger(value, field) {
|
|
595
|
+
if (!Number.isInteger(value) || value < 0) errors.push(`${field} must be a non-negative integer`)
|
|
596
|
+
}
|
|
597
|
+
function requireArray(value, field) {
|
|
598
|
+
if (!Array.isArray(value) || value.length === 0) errors.push(`${field} must be a non-empty array`)
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if (receipt.schema !== TOOL_SURFACE_DIFF_SCHEMA) errors.push(`schema must be ${TOOL_SURFACE_DIFF_SCHEMA}`)
|
|
602
|
+
requireString(receipt.run_id, 'run_id')
|
|
603
|
+
requireString(receipt.generated_at, 'generated_at')
|
|
604
|
+
requireString(receipt.platform?.name, 'platform.name')
|
|
605
|
+
requireString(receipt.platform?.audit_sink, 'platform.audit_sink')
|
|
606
|
+
requireString(receipt.catalog?.server_id, 'catalog.server_id')
|
|
607
|
+
requireString(receipt.catalog?.previous_hash, 'catalog.previous_hash')
|
|
608
|
+
requireString(receipt.catalog?.current_hash, 'catalog.current_hash')
|
|
609
|
+
requireBoolean(receipt.runtime_discovery?.enabled, 'runtime_discovery.enabled')
|
|
610
|
+
requireString(receipt.runtime_discovery?.trigger, 'runtime_discovery.trigger')
|
|
611
|
+
requireArray(receipt.tools, 'tools')
|
|
612
|
+
requireString(receipt.privacy_boundary?.raw_schemas, 'privacy_boundary.raw_schemas')
|
|
613
|
+
requireString(receipt.privacy_boundary?.raw_prompts, 'privacy_boundary.raw_prompts')
|
|
614
|
+
requireString(receipt.privacy_boundary?.raw_results, 'privacy_boundary.raw_results')
|
|
615
|
+
|
|
616
|
+
if (receipt.privacy_boundary?.raw_schemas !== 'omitted_hash_only') errors.push('privacy_boundary.raw_schemas must be omitted_hash_only')
|
|
617
|
+
if (receipt.privacy_boundary?.raw_prompts !== 'omitted') errors.push('privacy_boundary.raw_prompts must be omitted')
|
|
618
|
+
if (receipt.privacy_boundary?.raw_results !== 'omitted') errors.push('privacy_boundary.raw_results must be omitted')
|
|
619
|
+
|
|
620
|
+
const statuses = new Set(['discovered', 'activated', 'withheld', 'blocked', 'removed'])
|
|
621
|
+
const outcomes = new Set(['accepted', 'blocked_by_rai', 'blocked_by_xpia', 'schema_invalid', 'entitlement_filtered', 'not_selected', 'removed'])
|
|
622
|
+
let discoveredCount = 0
|
|
623
|
+
let activatedCount = 0
|
|
624
|
+
let withheldCount = 0
|
|
625
|
+
let rawLeakCount = 0
|
|
626
|
+
|
|
627
|
+
for (const [index, tool] of (receipt.tools || []).entries()) {
|
|
628
|
+
const prefix = `tools[${index}]`
|
|
629
|
+
requireString(tool.tool_id, `${prefix}.tool_id`)
|
|
630
|
+
requireString(tool.name_hash, `${prefix}.name_hash`)
|
|
631
|
+
requireString(tool.schema_hash, `${prefix}.schema_hash`)
|
|
632
|
+
requireString(tool.status, `${prefix}.status`)
|
|
633
|
+
requireString(tool.validation_outcome, `${prefix}.validation_outcome`)
|
|
634
|
+
requireNonNegativeInteger(tool.diff_summary?.added_fields, `${prefix}.diff_summary.added_fields`)
|
|
635
|
+
requireNonNegativeInteger(tool.diff_summary?.removed_fields, `${prefix}.diff_summary.removed_fields`)
|
|
636
|
+
requireNonNegativeInteger(tool.diff_summary?.changed_fields, `${prefix}.diff_summary.changed_fields`)
|
|
637
|
+
|
|
638
|
+
if (!statuses.has(tool.status)) errors.push(`${prefix}.status must be one of ${[...statuses].join('|')}`)
|
|
639
|
+
if (!outcomes.has(tool.validation_outcome)) errors.push(`${prefix}.validation_outcome must be one of ${[...outcomes].join('|')}`)
|
|
640
|
+
if (!String(tool.name_hash || '').startsWith('sha256:')) errors.push(`${prefix}.name_hash must be a sha256: hash, not a raw tool name`)
|
|
641
|
+
if (!String(tool.schema_hash || '').startsWith('sha256:')) errors.push(`${prefix}.schema_hash must be a sha256: hash, not a raw schema`)
|
|
642
|
+
if (typeof tool.raw_schema === 'string' || typeof tool.description === 'string') rawLeakCount++
|
|
643
|
+
|
|
644
|
+
if (['discovered', 'activated', 'withheld', 'blocked'].includes(tool.status)) discoveredCount++
|
|
645
|
+
if (tool.status === 'activated') activatedCount++
|
|
646
|
+
if (['withheld', 'blocked'].includes(tool.status)) withheldCount++
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
if (rawLeakCount > 0) errors.push(`tools must not include raw_schema or description (${rawLeakCount} raw fields found)`)
|
|
650
|
+
if (activatedCount === 0) warnings.push('no activated tools recorded; receipt may only prove discovery/withholding')
|
|
651
|
+
if (withheldCount === 0) warnings.push('no withheld/blocked tools recorded; receipt does not prove negative space')
|
|
652
|
+
|
|
653
|
+
return {
|
|
654
|
+
errors,
|
|
655
|
+
warnings,
|
|
656
|
+
summary: { discoveredCount, activatedCount, withheldCount },
|
|
657
|
+
}
|
|
658
|
+
}
|
package/src/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.3.
|
|
1
|
+
export const VERSION = '0.3.41'
|