pluribus-context 0.3.34 → 0.3.36

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.
Files changed (85) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +2 -1
  3. package/bin/pluribus.js +12 -0
  4. package/docs/agent-firewall-denial-audit.md +95 -0
  5. package/docs/ai-pr-review-receipts.md +173 -0
  6. package/docs/canonical-output-receipts.md +107 -0
  7. package/docs/compaction-resume-receipts.md +43 -0
  8. package/docs/controlled-learning-queue.md +48 -0
  9. package/docs/dynamic-workflow-run-receipts.md +158 -0
  10. package/docs/install-plan-receipts.md +79 -0
  11. package/docs/loaded-resource-boundary.md +97 -0
  12. package/docs/mcp-tool-visibility-receipts.md +67 -0
  13. package/docs/memory-write-policy-receipts.md +41 -0
  14. package/docs/parallel-session-review-ledger.md +103 -0
  15. package/docs/phase-boundary-contracts.md +87 -0
  16. package/docs/review-primitive-gate.md +109 -0
  17. package/docs/skill-install-receipts.md +102 -0
  18. package/docs/skill-policy-receipts.md +87 -0
  19. package/docs/skill-use-rate-receipts.md +104 -0
  20. package/docs/subagent-role-receipts.md +95 -0
  21. package/docs/temporal-context-receipts.md +123 -0
  22. package/examples/agent-firewall-denial-audit/README.md +14 -0
  23. package/examples/agent-firewall-denial-audit/check-denial-audit.mjs +116 -0
  24. package/examples/agent-firewall-denial-audit/denial-envelope.json +9 -0
  25. package/examples/agent-firewall-denial-audit/operator-audit-record.json +20 -0
  26. package/examples/agent-skills/skill-policy-receipts/README.md +22 -0
  27. package/examples/agent-skills/skill-policy-receipts/SKILL.md +77 -0
  28. package/examples/ai-pr-review-receipts/.github/pull_request_template.md +31 -0
  29. package/examples/ai-pr-review-receipts/.github/workflows/ai-pr-review-receipt.yml +25 -0
  30. package/examples/ai-pr-review-receipts/README.md +55 -0
  31. package/examples/ai-pr-review-receipts/incomplete-review-primitive-receipt.json +43 -0
  32. package/examples/ai-pr-review-receipts/review-primitive-receipt.json +60 -0
  33. package/examples/canonical-output-receipts/canonical-output-receipt.json +55 -0
  34. package/examples/claude-code-review-hook/README.md +74 -0
  35. package/examples/claude-code-review-hook/check-review-receipt-hook.mjs +80 -0
  36. package/examples/claude-code-review-hook/sample-task-completed-event.json +6 -0
  37. package/examples/compaction-resume-receipts/README.md +12 -0
  38. package/examples/compaction-resume-receipts/check-resume-receipt.mjs +116 -0
  39. package/examples/compaction-resume-receipts/safe-resume-receipt.json +52 -0
  40. package/examples/compaction-resume-receipts/unsafe-resume-receipt.json +41 -0
  41. package/examples/controlled-learning-queue/README.md +26 -0
  42. package/examples/controlled-learning-queue/check-learning-queue.mjs +44 -0
  43. package/examples/controlled-learning-queue/leads/acme-job-card.md +12 -0
  44. package/examples/controlled-learning-queue/learning_queue.md +27 -0
  45. package/examples/controlled-learning-queue/memory/durable.md +10 -0
  46. package/examples/controlled-learning-queue/memory/working-notes.md +5 -0
  47. package/examples/controlled-learning-queue/role/job-contract.md +18 -0
  48. package/examples/controlled-learning-queue/skills/qualify-lead.md +17 -0
  49. package/examples/dynamic-workflow-run-receipts/README.md +18 -0
  50. package/examples/dynamic-workflow-run-receipts/workflow-run-receipt.json +112 -0
  51. package/examples/install-plan-receipts/README.md +34 -0
  52. package/examples/install-plan-receipts/agent-install-plan-receipt.json +56 -0
  53. package/examples/loaded-resource-boundary/README.md +22 -0
  54. package/examples/loaded-resource-boundary/check-loaded-resource-boundary.mjs +65 -0
  55. package/examples/loaded-resource-boundary/loaded-resource-boundary.json +69 -0
  56. package/examples/memory-write-policy/README.md +28 -0
  57. package/examples/memory-write-policy/approved-memory-update.json +48 -0
  58. package/examples/memory-write-policy/check-memory-update.mjs +120 -0
  59. package/examples/memory-write-policy/quarantined-memory-update.json +43 -0
  60. package/examples/parallel-session-review-ledger/README.md +13 -0
  61. package/examples/parallel-session-review-ledger/check-parallel-session-review-ledger.mjs +69 -0
  62. package/examples/parallel-session-review-ledger/parallel-session-review-ledger.json +72 -0
  63. package/examples/phase-boundary-contract/README.md +23 -0
  64. package/examples/phase-boundary-contract/check-phase-boundary.mjs +73 -0
  65. package/examples/phase-boundary-contract/phase-boundary-contract.json +68 -0
  66. package/examples/review-primitive-gate/README.md +19 -0
  67. package/examples/review-primitive-gate/check-review-receipt.mjs +100 -0
  68. package/examples/review-primitive-gate/fail-review-receipt.json +42 -0
  69. package/examples/review-primitive-gate/pass-review-receipt.json +54 -0
  70. package/examples/skill-install-receipts/README.md +31 -0
  71. package/examples/skill-install-receipts/check-skill-install-receipt.mjs +75 -0
  72. package/examples/skill-install-receipts/skill-install-receipt.json +79 -0
  73. package/examples/skill-use-rate-receipts/README.md +16 -0
  74. package/examples/skill-use-rate-receipts/check-skill-use-rate.mjs +89 -0
  75. package/examples/skill-use-rate-receipts/skill-use-rate-receipt.json +79 -0
  76. package/examples/subagent-role-receipts/README.md +15 -0
  77. package/examples/subagent-role-receipts/agents.toml +36 -0
  78. package/examples/temporal-context-receipts/CURRENT_STATE.md +13 -0
  79. package/examples/temporal-context-receipts/specs/2025-checkout-rewrite.md +10 -0
  80. package/examples/temporal-context-receipts/specs/2026-checkout-risk-notes.md +10 -0
  81. package/examples/temporal-context-receipts/temporal-authority-receipt.json +27 -0
  82. package/package.json +1 -1
  83. package/src/commands/demo.js +155 -0
  84. package/src/index.js +1 -0
  85. package/src/utils/version.js +1 -1
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs'
3
+ import { spawnSync } from 'node:child_process'
4
+ import { dirname, resolve } from 'node:path'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const [receiptPathArg] = process.argv.slice(2)
8
+
9
+ if (!receiptPathArg) {
10
+ console.error(JSON.stringify({ ok: false, errors: ['usage: node check-review-receipt-hook.mjs <receipt.json>'] }, null, 2))
11
+ process.exit(2)
12
+ }
13
+
14
+ const stdin = readFileSync(0, 'utf8').trim()
15
+ let hookInput = {}
16
+ if (stdin) {
17
+ try {
18
+ hookInput = JSON.parse(stdin)
19
+ } catch (error) {
20
+ console.error(JSON.stringify({ ok: false, errors: [`invalid hook JSON on stdin: ${error.message}`] }, null, 2))
21
+ process.exit(2)
22
+ }
23
+ }
24
+
25
+ const here = dirname(fileURLToPath(import.meta.url))
26
+ const localGate = resolve(here, '../review-primitive-gate/check-review-receipt.mjs')
27
+ const copiedGate = resolve(here, 'check-review-receipt.mjs')
28
+ const gatePath = process.env.PLURIBUS_REVIEW_GATE || (exists(copiedGate) ? copiedGate : localGate)
29
+ const receiptPath = resolve(process.cwd(), receiptPathArg)
30
+
31
+ const result = spawnSync(process.execPath, [gatePath, receiptPath], {
32
+ encoding: 'utf8',
33
+ stdio: ['ignore', 'pipe', 'pipe']
34
+ })
35
+
36
+ let gateResult = null
37
+ try {
38
+ gateResult = JSON.parse(result.stdout || '{}')
39
+ } catch {
40
+ gateResult = { ok: false, errors: ['review gate did not return JSON'], raw_stdout: result.stdout.trim() }
41
+ }
42
+
43
+ const hookEventName = hookInput.hook_event_name || hookInput.hookEventName || hookInput.event || 'unknown'
44
+ const output = {
45
+ ok: result.status === 0 && gateResult.ok === true,
46
+ hook_event_name: hookEventName,
47
+ receipt_path: receiptPathArg,
48
+ resume_state: gateResult.resume_state,
49
+ assignment_id: gateResult.assignment_id,
50
+ run_id: gateResult.run_id,
51
+ next_safe_action: readNextSafeAction(receiptPath),
52
+ errors: gateResult.errors || [],
53
+ warnings: gateResult.warnings || []
54
+ }
55
+
56
+ if (output.ok) {
57
+ console.log(JSON.stringify(output, null, 2))
58
+ process.exit(0)
59
+ }
60
+
61
+ console.error(JSON.stringify(output, null, 2))
62
+ process.exit(result.status || 1)
63
+
64
+ function exists(path) {
65
+ try {
66
+ readFileSync(path)
67
+ return true
68
+ } catch {
69
+ return false
70
+ }
71
+ }
72
+
73
+ function readNextSafeAction(path) {
74
+ try {
75
+ const receipt = JSON.parse(readFileSync(path, 'utf8'))
76
+ return receipt?.handoff?.next_safe_action || null
77
+ } catch {
78
+ return null
79
+ }
80
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "hook_event_name": "TaskCompleted",
3
+ "session_id": "demo-session",
4
+ "transcript_path": "redacted/transcript.jsonl",
5
+ "cwd": "/repo/example"
6
+ }
@@ -0,0 +1,12 @@
1
+ # Compaction resume receipt gate
2
+
3
+ This example validates a privacy-safe receipt for `PostCompact`, `SessionStart(compact)`, or any workflow that resumes an AI coding session after summarization.
4
+
5
+ Run:
6
+
7
+ ```bash
8
+ node check-resume-receipt.mjs safe-resume-receipt.json
9
+ node check-resume-receipt.mjs unsafe-resume-receipt.json
10
+ ```
11
+
12
+ Use it as a tiny CI/hook check before an agent continues work after compaction. The receipt records hashes, refs, and verdicts — not raw transcripts or raw instruction bodies.
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from 'node:fs'
3
+
4
+ const [file] = process.argv.slice(2)
5
+
6
+ if (!file) {
7
+ console.error('Usage: node check-resume-receipt.mjs <compaction-resume-receipt.json>')
8
+ process.exit(2)
9
+ }
10
+
11
+ let receipt
12
+ try {
13
+ receipt = JSON.parse(readFileSync(file, 'utf8'))
14
+ } catch (error) {
15
+ console.error(JSON.stringify({ ok: false, file, errors: [`invalid JSON: ${error.message}`] }, null, 2))
16
+ process.exit(2)
17
+ }
18
+
19
+ const errors = []
20
+ const warnings = []
21
+
22
+ if (receipt.type !== 'agent.compaction_resume_receipt.v1') {
23
+ errors.push('type must be agent.compaction_resume_receipt.v1')
24
+ }
25
+
26
+ for (const key of ['compaction_event_id', 'session_id', 'trigger']) {
27
+ if (!receipt[key] || typeof receipt[key] !== 'string') {
28
+ errors.push(`${key} is required`)
29
+ }
30
+ }
31
+
32
+ const transcript = receipt.transcript || {}
33
+ if (!transcript.range || typeof transcript.range !== 'string') {
34
+ errors.push('transcript.range is required')
35
+ }
36
+ if (!transcript.content_hash || typeof transcript.content_hash !== 'string') {
37
+ errors.push('transcript.content_hash is required; do not log raw transcript text')
38
+ }
39
+ if (transcript.raw_text_logged !== false) {
40
+ errors.push('transcript.raw_text_logged must be false')
41
+ }
42
+
43
+ const summary = receipt.summary || {}
44
+ if (!summary.content_hash || typeof summary.content_hash !== 'string') {
45
+ errors.push('summary.content_hash is required')
46
+ }
47
+ if (!Number.isInteger(summary.token_count) || summary.token_count <= 0) {
48
+ errors.push('summary.token_count must be a positive integer')
49
+ }
50
+
51
+ const reloads = Array.isArray(receipt.instruction_sources_reloaded)
52
+ ? receipt.instruction_sources_reloaded
53
+ : []
54
+ if (reloads.length === 0) {
55
+ errors.push('instruction_sources_reloaded must include at least one source')
56
+ }
57
+ for (const [index, source] of reloads.entries()) {
58
+ if (!source.kind || typeof source.kind !== 'string') {
59
+ errors.push(`instruction_sources_reloaded[${index}].kind is required`)
60
+ }
61
+ if (!source.ref || typeof source.ref !== 'string') {
62
+ errors.push(`instruction_sources_reloaded[${index}].ref is required`)
63
+ }
64
+ if (!source.content_hash || typeof source.content_hash !== 'string') {
65
+ errors.push(`instruction_sources_reloaded[${index}].content_hash is required`)
66
+ }
67
+ if (source.raw_body_logged !== false) {
68
+ errors.push(`instruction_sources_reloaded[${index}].raw_body_logged must be false`)
69
+ }
70
+ }
71
+
72
+ const state = receipt.state || {}
73
+ const kept = Array.isArray(state.kept) ? state.kept : []
74
+ const lost = Array.isArray(state.lost) ? state.lost : []
75
+ if (kept.length === 0) {
76
+ warnings.push('state.kept is empty; reviewers may not know what survived compaction')
77
+ }
78
+ if (!Array.isArray(state.lost)) {
79
+ errors.push('state.lost must be an array, even when empty')
80
+ }
81
+
82
+ const verdict = receipt.resume_verdict || {}
83
+ if (!['true', 'false', 'unknown'].includes(String(verdict.safe_to_resume))) {
84
+ errors.push('resume_verdict.safe_to_resume must be true, false, or unknown')
85
+ }
86
+ if (!Array.isArray(verdict.reasons) || verdict.reasons.length === 0) {
87
+ errors.push('resume_verdict.reasons must explain the verdict')
88
+ }
89
+ if (String(verdict.safe_to_resume) !== 'true') {
90
+ errors.push(`safe_to_resume is ${verdict.safe_to_resume}; stop, reload, or ask before continuing`)
91
+ }
92
+ if (lost.some((item) => item && item.blocks_resume === true)) {
93
+ errors.push('state.lost contains at least one blocks_resume=true item')
94
+ }
95
+
96
+ const privacy = receipt.privacy || {}
97
+ for (const key of ['raw_prompts_logged', 'raw_tool_output_logged', 'secrets_logged', 'full_instruction_bodies_logged']) {
98
+ if (privacy[key] !== false) {
99
+ errors.push(`privacy.${key} must be false`)
100
+ }
101
+ }
102
+
103
+ const result = {
104
+ ok: errors.length === 0,
105
+ file,
106
+ compaction_event_id: receipt.compaction_event_id,
107
+ session_id: receipt.session_id,
108
+ safe_to_resume: verdict.safe_to_resume,
109
+ reloaded_sources: reloads.map((source) => `${source.kind}:${source.ref}`),
110
+ lost: lost.map((item) => item.ref || item.kind || 'unknown'),
111
+ errors,
112
+ warnings
113
+ }
114
+
115
+ console.log(JSON.stringify(result, null, 2))
116
+ process.exit(result.ok ? 0 : 1)
@@ -0,0 +1,52 @@
1
+ {
2
+ "type": "agent.compaction_resume_receipt.v1",
3
+ "compaction_event_id": "compact-2026-06-01T15-02-59Z",
4
+ "session_id": "codex-session-42",
5
+ "trigger": "PostCompact",
6
+ "transcript": {
7
+ "range": "messages:1-184",
8
+ "content_hash": "sha256-7f8f6fbf8a3e3fe0e9f6b59efac0e771d8f64a9ebff3e9b0f5162e43c2e3e89a",
9
+ "raw_text_logged": false
10
+ },
11
+ "summary": {
12
+ "content_hash": "sha256-8a4f6242e9800f1452bcfd5dbec7e9f1f0b543d72b0c96e57dece44f6c4b8de4",
13
+ "token_count": 1240
14
+ },
15
+ "instruction_sources_reloaded": [
16
+ {
17
+ "kind": "AGENTS.md",
18
+ "ref": "repo-root/AGENTS.md",
19
+ "content_hash": "sha256-06c39dfb1ba74f5ac6f0e1a6d6b4c65358c3f1a872e96f3fe8d61da947caa1d4",
20
+ "mtime": "2026-06-01T14:58:02Z",
21
+ "raw_body_logged": false
22
+ },
23
+ {
24
+ "kind": "plan",
25
+ "ref": "memory/current-plan.md#active",
26
+ "content_hash": "sha256-a9b30f8a50dd31ec3c818c9c0d05282bf97f54991a4032f2d547a30174de1c61",
27
+ "mtime": "2026-06-01T14:59:44Z",
28
+ "raw_body_logged": false
29
+ }
30
+ ],
31
+ "state": {
32
+ "kept": [
33
+ { "kind": "active_plan", "ref": "plan:fix-auth-smoke", "summary_hash": "sha256-4c0f7fd0a72b8cf7e45c0fb97b893590fa12e931f914a34b94756de0d876182c" },
34
+ { "kind": "open_diff", "ref": "git:working-tree", "summary_hash": "sha256-2e5a0da4b6b4e9d07f11c8f10f332fc74497ef6d052a46997c4f5d0bdb0e1b07" }
35
+ ],
36
+ "lost": []
37
+ },
38
+ "resume_verdict": {
39
+ "safe_to_resume": true,
40
+ "reasons": [
41
+ "instruction sources reloaded with hashes",
42
+ "active plan and open diff summarized",
43
+ "no blocking lost fields recorded"
44
+ ]
45
+ },
46
+ "privacy": {
47
+ "raw_prompts_logged": false,
48
+ "raw_tool_output_logged": false,
49
+ "secrets_logged": false,
50
+ "full_instruction_bodies_logged": false
51
+ }
52
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "type": "agent.compaction_resume_receipt.v1",
3
+ "compaction_event_id": "compact-2026-06-01T15-02-59Z",
4
+ "session_id": "codex-session-42",
5
+ "trigger": "PostCompact",
6
+ "transcript": {
7
+ "range": "messages:1-184",
8
+ "content_hash": "sha256-7f8f6fbf8a3e3fe0e9f6b59efac0e771d8f64a9ebff3e9b0f5162e43c2e3e89a",
9
+ "raw_text_logged": true
10
+ },
11
+ "summary": {
12
+ "content_hash": "sha256-8a4f6242e9800f1452bcfd5dbec7e9f1f0b543d72b0c96e57dece44f6c4b8de4",
13
+ "token_count": 880
14
+ },
15
+ "instruction_sources_reloaded": [
16
+ {
17
+ "kind": "AGENTS.md",
18
+ "ref": "repo-root/AGENTS.md",
19
+ "content_hash": "",
20
+ "mtime": "2026-06-01T14:58:02Z",
21
+ "raw_body_logged": true
22
+ }
23
+ ],
24
+ "state": {
25
+ "kept": [],
26
+ "lost": [
27
+ { "kind": "rejected_decisions", "ref": "decision-log:missing", "blocks_resume": true },
28
+ { "kind": "pending_tests", "ref": "test-plan:unknown", "blocks_resume": true }
29
+ ]
30
+ },
31
+ "resume_verdict": {
32
+ "safe_to_resume": "unknown",
33
+ "reasons": ["AGENTS.md hash missing and blocking state was lost"]
34
+ },
35
+ "privacy": {
36
+ "raw_prompts_logged": true,
37
+ "raw_tool_output_logged": false,
38
+ "secrets_logged": false,
39
+ "full_instruction_bodies_logged": true
40
+ }
41
+ }
@@ -0,0 +1,26 @@
1
+ # Controlled learning queue example
2
+
3
+ A copyable layout for Claude Code/OpenClaw/Cursor-style "AI employee" agents that use a role file, Skills, memory, and external tools.
4
+
5
+ The pattern is simple:
6
+
7
+ - `role/job-contract.md` defines what the agent is allowed to do.
8
+ - `skills/*.md` define procedures with inputs, outputs, and stop conditions.
9
+ - `memory/durable.md` contains approved facts only.
10
+ - `memory/working-notes.md` can hold temporary observations.
11
+ - `learning_queue.md` is where the agent proposes durable memory changes as reviewable diffs.
12
+ - `leads/*.md` are tiny active job cards.
13
+
14
+ Run the smoke check:
15
+
16
+ ```bash
17
+ node check-learning-queue.mjs learning_queue.md
18
+ ```
19
+
20
+ Expected output:
21
+
22
+ ```text
23
+ learning queue ok: 2 proposal(s), 1 pending review
24
+ ```
25
+
26
+ Why it exists: agents can learn from outcomes, but durable cross-run memory should not be rewritten by one edge case without source, scope, expiry, and a promote/reject decision.
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+
4
+ const file = process.argv[2] || new URL('./learning_queue.md', import.meta.url).pathname;
5
+ const text = fs.readFileSync(file, 'utf8');
6
+ const proposals = text.split(/^## Proposal /m).slice(1);
7
+ const required = ['Status', 'Source', 'Observed', 'Proposed durable change', 'Reason', 'Scope', 'Expiry', 'Reviewer', 'Decision'];
8
+ const rawRisk = /(api[_-]?key|secret|password|token\s*[:=]|-----BEGIN|raw transcript|verbatim customer|full email)/i;
9
+ const errors = [];
10
+ let pending = 0;
11
+
12
+ if (proposals.length === 0) errors.push('missing proposals');
13
+
14
+ for (const [index, block] of proposals.entries()) {
15
+ const id = block.split('\n', 1)[0].trim() || `#${index + 1}`;
16
+ for (const field of required) {
17
+ if (!new RegExp(`^${field}:\\s*\\S`, 'mi').test(block)) {
18
+ errors.push(`${id}: missing ${field}`);
19
+ }
20
+ }
21
+
22
+ const status = block.match(/^Status:\s*(.+)$/mi)?.[1]?.trim().toLowerCase();
23
+ const reviewer = block.match(/^Reviewer:\s*(.+)$/mi)?.[1]?.trim().toLowerCase();
24
+ const decision = block.match(/^Decision:\s*(.+)$/mi)?.[1]?.trim().toLowerCase();
25
+
26
+ if (status === 'proposed') pending += 1;
27
+ if (status === 'promoted' && (!reviewer || reviewer === 'pending' || !decision || decision === 'pending')) {
28
+ errors.push(`${id}: promoted proposal needs reviewer and decision`);
29
+ }
30
+ if (/(auto-promote|autopromote|self-approved|self approved)/i.test(block)) {
31
+ errors.push(`${id}: auto-promotion is not allowed`);
32
+ }
33
+ if (rawRisk.test(block)) {
34
+ errors.push(`${id}: possible raw secret/private payload in learning queue`);
35
+ }
36
+ }
37
+
38
+ if (errors.length) {
39
+ console.error(`learning queue failed (${errors.length}):`);
40
+ for (const error of errors) console.error(`- ${error}`);
41
+ process.exit(1);
42
+ }
43
+
44
+ console.log(`learning queue ok: ${proposals.length} proposal(s), ${pending} pending review`);
@@ -0,0 +1,12 @@
1
+ # Lead job card: acme
2
+
3
+ ## Goal
4
+ Prepare a qualification summary for a human owner.
5
+
6
+ ## Known facts
7
+ - Source: demo form `lead-acme-2026-06-02`.
8
+ - Interest: AI agent workflows for sales operations.
9
+ - Constraint: no pricing promises without human owner.
10
+
11
+ ## Next safe action
12
+ Draft questions about current workflow, systems of record, and approval boundaries.
@@ -0,0 +1,27 @@
1
+ # Learning queue
2
+
3
+ Agents may propose durable memory updates here. Humans or maintainers promote/reject them.
4
+
5
+ ## Proposal 2026-06-02-001
6
+
7
+ Status: proposed
8
+ Source: lead-acme-2026-06-02 job card, redacted summary only
9
+ Observed: Prospect asked how to prevent a role-based agent from changing ICP after one edge case.
10
+ Proposed durable change: Add "role-based agents may propose ICP changes, but ICP memory changes require human promote/reject review" to `memory/durable.md`.
11
+ Reason: This is a reusable safety boundary for future lead qualification runs.
12
+ Scope: sales-ops-agent / ICP memory
13
+ Expiry: 2026-07-02
14
+ Reviewer: pending
15
+ Decision: pending
16
+
17
+ ## Proposal 2026-06-02-002
18
+
19
+ Status: rejected
20
+ Source: lead-beta-2026-06-01 job card, redacted summary only
21
+ Observed: One prospect wanted a custom discount workflow.
22
+ Proposed durable change: Add "discount requests are common" to `memory/durable.md`.
23
+ Reason: Rejected because one request is not enough to change durable market assumptions.
24
+ Scope: sales-ops-agent / pricing assumptions
25
+ Expiry: 2026-06-15
26
+ Reviewer: owner@example.invalid
27
+ Decision: reject; keep as working note only
@@ -0,0 +1,10 @@
1
+ # Durable memory
2
+
3
+ Approved facts only.
4
+
5
+ ## ICP
6
+ - Early-stage teams adopting AI coding agents need lightweight reviewable context, not another opaque memory dump.
7
+
8
+ ## Boundaries
9
+ - Do not store raw customer messages, secrets, or private transcripts.
10
+ - Pricing, legal commitments, and delivery promises require human review.
@@ -0,0 +1,5 @@
1
+ # Working notes
2
+
3
+ Temporary notes may live here during an active job. Promote nothing from this file into durable memory without a `learning_queue.md` proposal.
4
+
5
+ - 2026-06-02 lead-acme: asked about using Skills for sales ops. Needs human review before any pricing language.
@@ -0,0 +1,18 @@
1
+ # Sales ops agent role
2
+
3
+ ## Mission
4
+ Help qualify inbound leads and prepare concise handoff notes for a human owner.
5
+
6
+ ## Allowed
7
+ - Read approved lead/job cards.
8
+ - Draft next-step suggestions.
9
+ - Propose changes to durable memory through `learning_queue.md`.
10
+
11
+ ## Not allowed
12
+ - Promise pricing, discounts, contracts, legal terms, or delivery dates.
13
+ - Rewrite `memory/durable.md` directly.
14
+ - Store raw private email/chat text in durable memory.
15
+
16
+ ## Escalate when
17
+ - A lead asks for legal/financial commitments.
18
+ - A proposed learning would change ICP, pricing assumptions, compliance boundaries, or data-retention rules.
@@ -0,0 +1,17 @@
1
+ # Skill: qualify lead
2
+
3
+ ## Inputs
4
+ - Lead job card path.
5
+ - Current durable memory.
6
+ - Any approved working notes for this lead.
7
+
8
+ ## Output
9
+ - Qualification summary.
10
+ - Open questions.
11
+ - Suggested next action.
12
+ - Optional `learning_queue.md` proposal if the case reveals a reusable durable fact.
13
+
14
+ ## Stop conditions
15
+ - Missing consent or unclear data source.
16
+ - Request requires a human commitment.
17
+ - Proposed durable learning lacks source, scope, or expiry.
@@ -0,0 +1,18 @@
1
+ # Dynamic workflow run receipt example
2
+
3
+ This example is a copyable privacy-safe receipt for Claude Code-style dynamic workflows, ultracode runs, local LLM gateway orchestration, or any script that spawns several subagents to audit, migrate, research, or verify a codebase.
4
+
5
+ Use it when the parent session only sees the final report, but reviewers still need to understand:
6
+
7
+ - which phases ran;
8
+ - how many agents were spawned;
9
+ - which role/model/provider each agent actually used;
10
+ - which context was loaded, skipped, or suppressed;
11
+ - which tools/capabilities were granted and used;
12
+ - how token spend was bucketed;
13
+ - where each agent stopped;
14
+ - which gaps remain before mutation or merge.
15
+
16
+ The example intentionally uses coarse labels, buckets, and hashes instead of raw prompts, source code, exact paths, transcripts, tool output, secrets, or customer data.
17
+
18
+ See [`docs/dynamic-workflow-run-receipts.md`](../../docs/dynamic-workflow-run-receipts.md) for the checklist and field rationale.
@@ -0,0 +1,112 @@
1
+ {
2
+ "type": "dynamic.workflow.run_receipt.v1",
3
+ "workflow": {
4
+ "workflow_id": "wf_checkout_auth_audit_2026_05_30",
5
+ "runner": "claude-code-dynamic-workflow",
6
+ "script_source": "generated-then-reviewed-command",
7
+ "script_hash": "sha256:example-only",
8
+ "task_kind": "codebase_auth_audit",
9
+ "plan_approved_before_run": true,
10
+ "resumable": true,
11
+ "max_wall_clock_bucket": "under_15m",
12
+ "kill_switch_available": true,
13
+ "started_at": "2026-05-30T15:20:00Z",
14
+ "completed_at": "2026-05-30T15:31:42Z"
15
+ },
16
+ "permissions": {
17
+ "tool_allowlist_inherited": true,
18
+ "writes_allowed": false,
19
+ "network_allowed": false,
20
+ "external_commands_allowed": ["grep", "test --dry-run"],
21
+ "permission_profile": "review-only"
22
+ },
23
+ "phases": [
24
+ {
25
+ "phase_id": "route-inventory",
26
+ "purpose": "find candidate auth-sensitive routes",
27
+ "agent_count": 3,
28
+ "token_spend_bucket": "under_50k",
29
+ "elapsed_ms_bucket": "under_2m",
30
+ "result": "completed"
31
+ },
32
+ {
33
+ "phase_id": "adversarial-review",
34
+ "purpose": "cross-check candidate misses",
35
+ "agent_count": 2,
36
+ "token_spend_bucket": "under_25k",
37
+ "elapsed_ms_bucket": "under_2m",
38
+ "result": "completed_with_gaps"
39
+ }
40
+ ],
41
+ "agents": [
42
+ {
43
+ "agent_id": "agent-route-auditor-1",
44
+ "phase_id": "route-inventory",
45
+ "role": "route-auth-auditor",
46
+ "model": "claude-sonnet",
47
+ "provider": "anthropic",
48
+ "context_loaded": ["repo-policy", "auth-boundary-rules", "route-index-summary"],
49
+ "context_skipped_or_suppressed": [
50
+ {
51
+ "source": "customer-fixture-dump",
52
+ "reason": "contains raw customer data; summary hash only"
53
+ }
54
+ ],
55
+ "tools_granted": ["read", "grep"],
56
+ "tools_used": ["grep"],
57
+ "feature_areas_checked": ["checkout routes", "admin routes"],
58
+ "token_budget_bucket": "under_25k",
59
+ "token_spend_bucket": "under_10k",
60
+ "max_iterations": 8,
61
+ "iterations_used": 3,
62
+ "heartbeat_seen_at": "2026-05-30T15:25:00Z",
63
+ "partial_progress_reported": true,
64
+ "fuse_triggered": false,
65
+ "stop_reason": "completed_assigned_partition",
66
+ "confidence": "medium",
67
+ "known_gaps": ["did not execute integration tests"],
68
+ "raw_prompt_logged": false,
69
+ "raw_tool_output_logged": false,
70
+ "raw_paths_logged": false
71
+ },
72
+ {
73
+ "agent_id": "agent-reviewer-1",
74
+ "phase_id": "adversarial-review",
75
+ "role": "adversarial-auth-reviewer",
76
+ "model": "local-codex-compatible",
77
+ "provider": "local-llm-gateway",
78
+ "context_loaded": ["candidate-findings-summary", "public-api-contract-summary"],
79
+ "context_skipped_or_suppressed": [],
80
+ "tools_granted": ["read"],
81
+ "tools_used": ["read"],
82
+ "feature_areas_checked": ["route findings cross-check"],
83
+ "token_budget_bucket": "under_10k",
84
+ "token_spend_bucket": "under_10k",
85
+ "max_iterations": 5,
86
+ "iterations_used": 5,
87
+ "heartbeat_seen_at": "2026-05-30T15:30:00Z",
88
+ "partial_progress_reported": true,
89
+ "fuse_triggered": true,
90
+ "stop_reason": "iteration_budget_reached_before_claim_verified",
91
+ "confidence": "low",
92
+ "known_gaps": ["one route requires owner confirmation before merge"],
93
+ "raw_prompt_logged": false,
94
+ "raw_tool_output_logged": false,
95
+ "raw_paths_logged": false
96
+ }
97
+ ],
98
+ "handoff": {
99
+ "final_result_kind": "workflow_review_receipt",
100
+ "claims_rejected_or_deferred": 1,
101
+ "next_safe_action": "ask route owner to confirm checkout callback auth before writing fix",
102
+ "where_it_stopped": "ambiguous auth boundary before mutation"
103
+ },
104
+ "privacy": {
105
+ "raw_prompts_logged": false,
106
+ "raw_source_logged": false,
107
+ "raw_tool_output_logged": false,
108
+ "transcripts_logged": false,
109
+ "secrets_logged": false,
110
+ "customer_data_logged": false
111
+ }
112
+ }
@@ -0,0 +1,34 @@
1
+ # Install-plan receipt example
2
+
3
+ This example is for one-command agent setup tools that configure MCP, Skills, instruction files, hooks, or plugins across multiple AI coding tools.
4
+
5
+ Use it when you want a setup script to prove what it will write before it writes anything.
6
+
7
+ ## Copyable preflight checklist
8
+
9
+ Before applying installer changes, ask the agent or setup script to emit an `agent.install.plan.v1` receipt with:
10
+
11
+ - `agents_detected`
12
+ - `agents_selected`
13
+ - `planned_writes[]` with `kind`, `target`, `operation`, and `backup_planned`
14
+ - `external_commands_planned[]`
15
+ - `network_after_install`
16
+ - `writes_started=false`
17
+ - `next_safe_command`
18
+
19
+ Review the receipt, then run the apply command only if the planned writes match your intent.
20
+
21
+ ## Smoke test
22
+
23
+ The sample receipt is intentionally static JSON so it can be inspected without running an installer:
24
+
25
+ ```bash
26
+ cat examples/install-plan-receipts/agent-install-plan-receipt.json
27
+ node -e "const r=require('./examples/install-plan-receipts/agent-install-plan-receipt.json'); if (r.writes_started !== false) process.exit(1); console.log(r.receipt_type, r.planned_writes.length)"
28
+ ```
29
+
30
+ Expected output:
31
+
32
+ ```text
33
+ agent.install.plan.v1 3
34
+ ```