pluribus-context 0.3.22 → 0.3.27
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 +33 -3
- package/README.md +9 -2
- package/docs/community-review-packet.md +10 -2
- package/docs/context-budget-receipts.md +152 -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/agent-skills/context-receipts/README.md +22 -0
- package/examples/agent-skills/context-receipts/SKILL.md +89 -0
- 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,22 @@
|
|
|
1
|
+
# Context receipts Agent Skill recipe
|
|
2
|
+
|
|
3
|
+
This is a small, copyable Agent Skill recipe for context-engineering users who are adopting Tool Search, lazy MCP loading, skills, memory, compaction, or subagents and need to verify what actually crossed the context boundary.
|
|
4
|
+
|
|
5
|
+
It is intentionally markdown-only so it can be copied into a local skills directory such as:
|
|
6
|
+
|
|
7
|
+
- `.claude/skills/context-receipts/SKILL.md`
|
|
8
|
+
- `.opencode/skills/context-receipts/SKILL.md`
|
|
9
|
+
- `.agents/skills/context-receipts/SKILL.md`
|
|
10
|
+
|
|
11
|
+
## Quick smoke
|
|
12
|
+
|
|
13
|
+
Ask an agent or harness using the skill to emit a receipt for one workflow and verify these constraints:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
grep -E 'mcp\.tool_index\.loaded|context\.skill\.registry\.index\.loaded|subagent\.delegation\.requested' receipt.jsonl
|
|
17
|
+
grep -E 'raw_(schema|query|args|result|output)_copied":false|raw.*CopiedToReceipt":false' receipt.jsonl
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Then manually check that the receipt contains counts, hashes, ids, buckets, and `audit_gap`, but does **not** contain private prompts, raw schemas, tool args/results, skill bodies, memory bodies, customer names, secrets, or transcript text.
|
|
21
|
+
|
|
22
|
+
For executable fixture examples, see [`../../context-input-evidence/`](../../context-input-evidence/).
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Context Receipts
|
|
2
|
+
|
|
3
|
+
Use this skill when an agent workflow claims to save context by selecting, deferring, hydrating, summarizing, compacting, delegating, or isolating context.
|
|
4
|
+
|
|
5
|
+
The job is not to log the private content. The job is to emit a small receipt that lets a reviewer answer:
|
|
6
|
+
|
|
7
|
+
> what crossed the context boundary, what stayed out, and what audit gap remains?
|
|
8
|
+
|
|
9
|
+
## Privacy defaults
|
|
10
|
+
|
|
11
|
+
Never include raw prompts, raw tool schemas, raw tool arguments, raw tool results, raw skill bodies, memory bodies, secrets, customer names, or full transcripts in the receipt.
|
|
12
|
+
|
|
13
|
+
Prefer:
|
|
14
|
+
|
|
15
|
+
- stable ids or hashed ids;
|
|
16
|
+
- counts and token/line buckets;
|
|
17
|
+
- categorical reasons;
|
|
18
|
+
- explicit booleans for raw content copied/not copied;
|
|
19
|
+
- before/after context budget buckets;
|
|
20
|
+
- an `audit_gap` field when the receipt proves routing but not semantic correctness.
|
|
21
|
+
|
|
22
|
+
## 60-second Tool Search smoke
|
|
23
|
+
|
|
24
|
+
For MCP Tool Search, lazy tool loading, or progressive disclosure, emit enough evidence to answer these seven checks:
|
|
25
|
+
|
|
26
|
+
1. **Index-only startup:** did the session load a compact tool/server index instead of all full schemas?
|
|
27
|
+
2. **Search/routing:** what hashed query/category or routing reason selected candidate tools?
|
|
28
|
+
3. **Hydration:** which full tool definition was loaded, why, and how many definitions stayed suppressed?
|
|
29
|
+
4. **Call:** which server/tool id was invoked, with argument/result redaction status and success/error status?
|
|
30
|
+
5. **Boundary:** if a manager subagent or child agent was used, did raw child output return to the parent?
|
|
31
|
+
6. **Budget:** what were the startup and post-hydration context-token buckets?
|
|
32
|
+
7. **Audit gap:** what is not proven, such as whether the selected tool was semantically optimal?
|
|
33
|
+
|
|
34
|
+
Minimal JSONL event names:
|
|
35
|
+
|
|
36
|
+
```jsonl
|
|
37
|
+
{"event":"mcp.tool_index.loaded","loaded_server_count":12,"loaded_tool_index_count":84,"full_schema_count":0,"suppressed_tool_count":84,"raw_schema_copied":false,"startup_token_bucket":"lt_1k"}
|
|
38
|
+
{"event":"mcp.tool_search.performed","query_hash":"sha256:...","query_category":"repo_search","candidate_tool_count":5,"selected_tool_id":"github.search_code","raw_query_copied":false}
|
|
39
|
+
{"event":"mcp.tool_definition.loaded","tool_id":"github.search_code","hydrate_reason":"selected_after_tool_search","suppressed_tool_count":83,"definition_token_bucket":"1k_2k","raw_schema_copied":false}
|
|
40
|
+
{"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"}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Skill / prompt context smoke
|
|
44
|
+
|
|
45
|
+
For skills, rules, AGENTS.md overlays, or instruction files, answer:
|
|
46
|
+
|
|
47
|
+
- which index/listing entered the session;
|
|
48
|
+
- which full skill/rule/instruction body was selected;
|
|
49
|
+
- which candidates were suppressed and why;
|
|
50
|
+
- whether the body was loaded at session start, after a search, or after an explicit command;
|
|
51
|
+
- source hash, delivered hash, and canonical form when available;
|
|
52
|
+
- whether the skill/instruction text was copied into the receipt.
|
|
53
|
+
|
|
54
|
+
Minimal event names:
|
|
55
|
+
|
|
56
|
+
- `context.skill.registry.index.loaded`
|
|
57
|
+
- `context.skill.registry.skill.read`
|
|
58
|
+
- `context.skill.registry.skill.injected`
|
|
59
|
+
- `context.input.loaded`
|
|
60
|
+
- `context.input.candidate_suppressed`
|
|
61
|
+
|
|
62
|
+
## Subagent / manager boundary smoke
|
|
63
|
+
|
|
64
|
+
For subagents, manager agents, or child workers, answer:
|
|
65
|
+
|
|
66
|
+
- what task was delegated, by category and hashed objective;
|
|
67
|
+
- what large output was captured by the child, as line/token buckets;
|
|
68
|
+
- what bounded summary returned to the parent;
|
|
69
|
+
- whether raw child output, tool results, or MCP schemas entered the parent context;
|
|
70
|
+
- the remaining audit gap.
|
|
71
|
+
|
|
72
|
+
Minimal event names:
|
|
73
|
+
|
|
74
|
+
- `subagent.delegation.requested`
|
|
75
|
+
- `subagent.tool_output.captured`
|
|
76
|
+
- `subagent.summary.returned`
|
|
77
|
+
- `parent.context_budget.evaluated`
|
|
78
|
+
|
|
79
|
+
## Good receipt test
|
|
80
|
+
|
|
81
|
+
A receipt is useful if a maintainer can debug one of these failures without seeing private content:
|
|
82
|
+
|
|
83
|
+
- the agent never found the right tool/skill;
|
|
84
|
+
- the full definition loaded too early;
|
|
85
|
+
- too many definitions stayed in context;
|
|
86
|
+
- a child/subagent saved no budget because raw output returned to the parent;
|
|
87
|
+
- compaction happened but no one can prove what was preserved, summarized, or dropped.
|
|
88
|
+
|
|
89
|
+
A receipt is not enough if it only says “Tool Search enabled” or “used subagent”. It must prove the boundary behavior.
|
|
@@ -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":""}
|