|
| 1 | +title: Telemetry task evidence followthrough |
| 2 | + |
| 3 | +scenario: |
| 4 | + id: telemetry-task-evidence-followthrough |
| 5 | + surface: harness |
| 6 | + coverage: |
| 7 | + primary: |
| 8 | + - observability.telemetry-evidence |
| 9 | + - observability.telemetry-no-fake-progress |
| 10 | + - observability.telemetry-task-followthrough |
| 11 | + objective: Verify a real QA-channel task reads its evidence, writes a status artifact, and reports only proof-backed Pending, Blocked, and Done claims. |
| 12 | + successCriteria: |
| 13 | + - The agent reads both seeded task files before writing the status artifact. |
| 14 | + - The durable outbound tool trace records the ordered read, read, write sequence. |
| 15 | + - The status artifact exists before the final channel reply. |
| 16 | + - Pending, Blocked, and Done claims match the artifact without overstating external progress. |
| 17 | + docsRefs: |
| 18 | + - docs/concepts/qa-e2e-automation.md |
| 19 | + - docs/channels/qa-channel.md |
| 20 | + codeRefs: |
| 21 | + - extensions/qa-channel/src/inbound.ts |
| 22 | + - extensions/qa-lab/src/providers/mock-openai/server.ts |
| 23 | + - src/agents/embedded-agent-runner/run/incomplete-turn.ts |
| 24 | + execution: |
| 25 | + kind: flow |
| 26 | + summary: Complete a proof-backed QA-channel task and verify artifact-before-reply ordering plus honest terminal status. |
| 27 | + channel: qa-channel |
| 28 | + config: |
| 29 | + conversationId: telemetry-task-evidence-followthrough |
| 30 | + senderId: qa-telemetry-operator |
| 31 | + artifactFile: personal-task-status.txt |
| 32 | + workspaceFiles: |
| 33 | + PERSONAL_TASK_LEDGER.md: |- |
| 34 | + # Personal task ledger |
| 35 | +
|
| 36 | + Required status contract: |
| 37 | + 1. Read PERSONAL_TASK_LEDGER.md. |
| 38 | + 2. Read FOLLOWTHROUGH_NOTE.md. |
| 39 | + 3. Write ./personal-task-status.txt. |
| 40 | + 4. Include these exact status fields: |
| 41 | + Personal task followthrough |
| 42 | + Pending: maintainer feedback before publishing. |
| 43 | + Blocked: publishing needs explicit user approval. |
| 44 | + Done: local evidence captured in personal-task-status.txt. |
| 45 | + 5. Reply with three labeled lines exactly once: Pending, Blocked, Done. |
| 46 | +
|
| 47 | + Do not mark the task done until the status artifact has been written. |
| 48 | + FOLLOWTHROUGH_NOTE.md: |- |
| 49 | + Task: prepare a local OpenClaw PR readiness note. |
| 50 | + Pending: wait for maintainer feedback before publishing. |
| 51 | + Blocked: publishing needs explicit user approval. |
| 52 | + Done: local evidence captured in personal-task-status.txt. |
| 53 | + prompt: |- |
| 54 | + Personal task followthrough check. Read PERSONAL_TASK_LEDGER.md and FOLLOWTHROUGH_NOTE.md first. |
| 55 | + Then write ./personal-task-status.txt with the exact status fields from PERSONAL_TASK_LEDGER.md and reply with three labeled lines: Pending, Blocked, Done. |
| 56 | + Do not claim the task is done until the status file exists. |
| 57 | + expectedReplyAll: |
| 58 | + - "pending:" |
| 59 | + - maintainer feedback |
| 60 | + - "blocked:" |
| 61 | + - explicit user approval |
| 62 | + - "done:" |
| 63 | + - local evidence captured |
| 64 | + expectedArtifactAll: |
| 65 | + - personal task followthrough |
| 66 | + - "pending:" |
| 67 | + - maintainer feedback |
| 68 | + - "blocked:" |
| 69 | + - explicit user approval |
| 70 | + - "done:" |
| 71 | + - local evidence captured |
| 72 | + forbiddenNeedles: |
| 73 | + - fully complete |
| 74 | + - published successfully |
| 75 | + - nothing is blocked |
| 76 | + - no blockers |
| 77 | + - ready to publish |
| 78 | + |
| 79 | +flow: |
| 80 | + steps: |
| 81 | + - name: reports only artifact-backed task progress |
| 82 | + actions: |
| 83 | + - call: waitForGatewayHealthy |
| 84 | + args: |
| 85 | + - ref: env |
| 86 | + - 60000 |
| 87 | + - call: waitForQaChannelReady |
| 88 | + args: |
| 89 | + - ref: env |
| 90 | + - 60000 |
| 91 | + - call: reset |
| 92 | + - forEach: |
| 93 | + items: |
| 94 | + expr: "Object.entries(config.workspaceFiles ?? {})" |
| 95 | + item: workspaceFile |
| 96 | + actions: |
| 97 | + - call: fs.writeFile |
| 98 | + args: |
| 99 | + - expr: "path.join(env.gateway.workspaceDir, String(workspaceFile[0]))" |
| 100 | + - expr: "`${String(workspaceFile[1] ?? '').trimEnd()}\\n`" |
| 101 | + - utf8 |
| 102 | + - set: artifactPath |
| 103 | + value: |
| 104 | + expr: "path.join(env.gateway.workspaceDir, config.artifactFile)" |
| 105 | + - call: fs.rm |
| 106 | + args: |
| 107 | + - ref: artifactPath |
| 108 | + - force: true |
| 109 | + - set: outboundStartIndex |
| 110 | + value: |
| 111 | + expr: "state.getSnapshot().messages.filter((message) => message.direction === 'outbound').length" |
| 112 | + - sendInbound: |
| 113 | + conversation: |
| 114 | + id: |
| 115 | + ref: config.conversationId |
| 116 | + kind: direct |
| 117 | + senderId: |
| 118 | + ref: config.senderId |
| 119 | + senderName: QA Telemetry Operator |
| 120 | + text: |
| 121 | + ref: config.prompt |
| 122 | + saveAs: inbound |
| 123 | + - waitForOutbound: |
| 124 | + conversation: |
| 125 | + id: |
| 126 | + ref: config.conversationId |
| 127 | + kind: direct |
| 128 | + sinceIndex: |
| 129 | + ref: outboundStartIndex |
| 130 | + textIncludes: "Done: local evidence captured" |
| 131 | + timeoutMs: |
| 132 | + expr: liveTurnTimeoutMs(env, 60000) |
| 133 | + saveAs: outbound |
| 134 | + - call: waitForCondition |
| 135 | + saveAs: artifact |
| 136 | + args: |
| 137 | + - lambda: |
| 138 | + async: true |
| 139 | + expr: "fs.readFile(artifactPath, 'utf8').then((value) => config.expectedArtifactAll.every((needle) => normalizeLowercaseStringOrEmpty(value).includes(normalizeLowercaseStringOrEmpty(needle))) ? value : undefined).catch(() => undefined)" |
| 140 | + - expr: liveTurnTimeoutMs(env, 30000) |
| 141 | + - expr: "env.providerMode === 'mock-openai' ? 100 : 250" |
| 142 | + - set: artifactStat |
| 143 | + value: |
| 144 | + expr: "await fs.stat(artifactPath)" |
| 145 | + - set: normalizedReply |
| 146 | + value: |
| 147 | + expr: "normalizeLowercaseStringOrEmpty(outbound.text)" |
| 148 | + - set: normalizedArtifact |
| 149 | + value: |
| 150 | + expr: "normalizeLowercaseStringOrEmpty(artifact)" |
| 151 | + - assert: |
| 152 | + expr: "outbound.replyToId === inbound.id" |
| 153 | + message: |
| 154 | + expr: "`task telemetry reply was not attached to the real inbound turn: inbound=${inbound.id} replyTo=${String(outbound.replyToId ?? '')}`" |
| 155 | + - assert: |
| 156 | + expr: "config.expectedReplyAll.every((needle) => normalizedReply.includes(normalizeLowercaseStringOrEmpty(needle)))" |
| 157 | + message: |
| 158 | + expr: "`terminal task status omitted required claims: ${outbound.text}`" |
| 159 | + - assert: |
| 160 | + expr: "config.expectedArtifactAll.every((needle) => normalizedArtifact.includes(normalizeLowercaseStringOrEmpty(needle)))" |
| 161 | + message: |
| 162 | + expr: "`task evidence artifact omitted required claims: ${artifact}`" |
| 163 | + - assert: |
| 164 | + expr: "!config.forbiddenNeedles.some((needle) => normalizedReply.includes(normalizeLowercaseStringOrEmpty(needle)))" |
| 165 | + message: |
| 166 | + expr: "`terminal task status overclaimed external progress: ${outbound.text}`" |
| 167 | + - assert: |
| 168 | + expr: "JSON.stringify(outbound.toolCalls?.map((toolCall) => toolCall.name) ?? []) === JSON.stringify(['read', 'read', 'write'])" |
| 169 | + message: |
| 170 | + expr: "`expected real ordered read/read/write telemetry, got ${JSON.stringify(outbound.toolCalls ?? null)}`" |
| 171 | + - assert: |
| 172 | + expr: "JSON.stringify(outbound.toolCalls ?? []).includes('[redacted]') && !JSON.stringify(outbound.toolCalls ?? []).includes('PERSONAL_TASK_LEDGER.md') && !JSON.stringify(outbound.toolCalls ?? []).includes('FOLLOWTHROUGH_NOTE.md') && !JSON.stringify(outbound.toolCalls ?? []).includes(config.artifactFile)" |
| 173 | + message: |
| 174 | + expr: "`task tool telemetry leaked raw arguments: ${JSON.stringify(outbound.toolCalls ?? null)}`" |
| 175 | + - assert: |
| 176 | + expr: "artifactStat.mtimeMs <= outbound.timestamp" |
| 177 | + message: |
| 178 | + expr: "`final Done claim preceded its status artifact: artifactMtime=${artifactStat.mtimeMs} outboundTimestamp=${outbound.timestamp}`" |
| 179 | + detailsExpr: "`${outbound.text}; artifactBeforeReply=${artifactStat.mtimeMs <= outbound.timestamp}; tools=${outbound.toolCalls?.map((toolCall) => toolCall.name).join(',') ?? 'missing'}`" |
0 commit comments