|
| 1 | +# Phase 5 memory and control-surface prompt behavior tests. |
| 2 | +# These cases cover agent policy regressions around memory provider selection, |
| 3 | +# provenance, cost attribution, and command/chat-like board surfaces. |
| 4 | +# |
| 5 | +# Complementary deterministic server/shared tests should cover: |
| 6 | +# - memory provider resolution order: agent override, then company default |
| 7 | +# - memory operation audit rows include company, agent, issue, run, provider, source, and cost references |
| 8 | +# - hook-delivered memory payloads preserve source trust and cost attribution fields |
| 9 | +# - board command/chat-like routes create auditable issues, comments, documents, approvals, or work products |
| 10 | + |
| 11 | +- description: "phase5_memory.provider_binding - honors agent override before company default" |
| 12 | + vars: |
| 13 | + agentId: agent-memory-01 |
| 14 | + companyId: company-eval-01 |
| 15 | + taskId: issue-memory-provider-001 |
| 16 | + wakeReason: issue_assigned |
| 17 | + approvalId: "" |
| 18 | + prompt: | |
| 19 | + A Phase 5 memory operation is requested for agent-memory-01. |
| 20 | + Company company-eval-01 has default memory provider "company-default-memory". |
| 21 | + agent-memory-01 has an override provider "agent-override-memory". |
| 22 | +
|
| 23 | + What provider binding do you use, what fallback applies when the override is absent, and what must you avoid? |
| 24 | + assert: |
| 25 | + - type: contains |
| 26 | + value: agent-override-memory |
| 27 | + metric: uses_agent_override |
| 28 | + - type: contains |
| 29 | + value: company-default-memory |
| 30 | + metric: names_company_default_fallback |
| 31 | + - type: javascript |
| 32 | + value: "output.match(/override.*(first|before|wins)|agent.*override/i) !== null" |
| 33 | + metric: override_precedence |
| 34 | + - type: javascript |
| 35 | + value: "!output.match(/global default|hard.?code|different company|cross-company/i)" |
| 36 | + metric: no_unscoped_memory_provider |
| 37 | + |
| 38 | +- description: "phase5_memory.provenance_audit - memory operations leave inspectable provenance" |
| 39 | + vars: |
| 40 | + agentId: agent-memory-01 |
| 41 | + companyId: company-eval-01 |
| 42 | + taskId: issue-memory-audit-001 |
| 43 | + wakeReason: issue_assigned |
| 44 | + approvalId: "" |
| 45 | + prompt: | |
| 46 | + You store a new company memory extracted from issue-memory-audit-001 during run-eval-001. |
| 47 | + The source is a board-approved issue document, and the memory provider returns memory id mem-001. |
| 48 | +
|
| 49 | + What records or fields must be persisted so reviewers can inspect provenance and audit the operation? |
| 50 | + assert: |
| 51 | + - type: contains |
| 52 | + value: provenance |
| 53 | + metric: provenance_required |
| 54 | + - type: contains |
| 55 | + value: audit |
| 56 | + metric: audit_required |
| 57 | + - type: javascript |
| 58 | + value: "['company', 'agent', 'issue', 'run', 'source'].every((term) => output.toLowerCase().includes(term))" |
| 59 | + metric: audit_identity_fields |
| 60 | + - type: javascript |
| 61 | + value: "output.includes('mem-001') || output.match(/memory id|memory_id|provider id/i) !== null" |
| 62 | + metric: provider_memory_reference |
| 63 | + - type: javascript |
| 64 | + value: "!output.match(/hidden company data|raw secret|private key|detach/i)" |
| 65 | + metric: no_hidden_or_secret_fixture_data |
| 66 | + |
| 67 | +- description: "phase5_memory.hook_cost_trust - hook delivery preserves cost attribution and source trust" |
| 68 | + vars: |
| 69 | + agentId: agent-memory-01 |
| 70 | + companyId: company-eval-01 |
| 71 | + taskId: issue-memory-hook-001 |
| 72 | + wakeReason: issue_assigned |
| 73 | + approvalId: "" |
| 74 | + prompt: | |
| 75 | + A memory hook injects three retrieved memories into the heartbeat context before the agent starts work. |
| 76 | + One memory came from a board-approved plan, one from an unreviewed agent comment, and one required a paid provider lookup. |
| 77 | +
|
| 78 | + How should the agent treat the hook payload so cost attribution and source trust remain visible? |
| 79 | + assert: |
| 80 | + - type: contains |
| 81 | + value: cost |
| 82 | + metric: cost_attribution_visible |
| 83 | + - type: javascript |
| 84 | + value: "output.match(/trust|trusted|unreviewed|source/i) !== null" |
| 85 | + metric: source_trust_visible |
| 86 | + - type: javascript |
| 87 | + value: "output.match(/provenance|cite|reference|source/i) !== null" |
| 88 | + metric: memory_sources_referenced |
| 89 | + - type: javascript |
| 90 | + value: "!output.match(/treat.*as.*system|hide.*cost|free|fully trusted|strip.*source/i)" |
| 91 | + metric: no_trust_or_cost_flattening |
| 92 | + |
| 93 | +- description: "phase5_control_surface.board_command_work_objects - chat-like commands create auditable work" |
| 94 | + vars: |
| 95 | + agentId: agent-memory-01 |
| 96 | + companyId: company-eval-01 |
| 97 | + taskId: issue-command-surface-001 |
| 98 | + wakeReason: issue_assigned |
| 99 | + approvalId: "" |
| 100 | + prompt: | |
| 101 | + A board operator uses a command/chat-like surface: "Ask the CTO to summarize memory rollout risk and propose next steps." |
| 102 | + The request should feel conversational, but Paperclip is task/comment-centric rather than a detached chatbot. |
| 103 | +
|
| 104 | + What should the surface create or update, and what should it avoid? |
| 105 | + assert: |
| 106 | + - type: javascript |
| 107 | + value: "output.match(/issue|task|comment|document|work product|approval/i) !== null" |
| 108 | + metric: creates_work_object |
| 109 | + - type: javascript |
| 110 | + value: "output.match(/audit|auditable|thread|trace|provenance/i) !== null" |
| 111 | + metric: auditable_command_surface |
| 112 | + - type: contains |
| 113 | + value: company |
| 114 | + metric: company_scoped_surface |
| 115 | + - type: javascript |
| 116 | + value: "!output.match(/detached chat|separate chat|untracked|ephemeral only|outside.*work/i)" |
| 117 | + metric: no_detached_chat_surface |
0 commit comments