Files
Agent-Workbench/docs/reliability-1.25.2-evidence/source-bytes/tests/fixtures/working-memory-t.json
T

138 lines
8.7 KiB
JSON

{
"scope": "Frozen T goal, first three original assistant turns and original unchanged project inputs. Offline fixture only; no model implementation.",
"goal": "修复这个Node费用报表工程的amount、summary、report三个模块。金额用精确分单位处理,接受测试约定的十进制字符串/有限数字、退款、0及空白;拒绝格式错误、超精度和不安全金额。按独立币种规范化/排序汇总并保留原数组,计数准确、安全求和,报表两位小数含负分金额。以原九项测试为完整契约。先inspect_project,再plan_checks选择[\"test\",\"build\"]并run_checks保留真实基线失败,读取原测试和相关源码。只允许修改src/amount.mjs、src/summary.mjs、src/report.mjs;不改测试、配置、README、构建脚本、owner文件或原暂存,不使用run_command,不直接提交Git。propose_file/propose_patch准备完整三个模块后,用prepare_change_set一次封存全部三文件,等待审查应用。应用后继续同一个Task,重新plan_checks/run_checks,通过原9项测试和build后,用plan_delivery为三个文件准备本地Git预览并等待确认。模型必须自己实现,禁止用口头完成替代检查。预算最多8次模型请求、90000tokens,输出2048,上下文16K,请合并独立工具调用并避免重复观察。",
"replies": [
{
"role": "assistant",
"content": "我会先读取项目识别结果并按你指定的顺序封存 `test`、`build` 基线计划;随后读取九项测试及三个目标模块,依据实际契约准备完整改动提案。",
"tool_calls": [
{
"id": "call_5eb7405a2e6a4fb2bd2e2acf4d775dcb",
"type": "function",
"function": {
"name": "inspect_project",
"arguments": "{}"
}
}
]
},
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_56fb7fe30f7a48c0a466eedca7cb1c33",
"type": "function",
"function": {
"name": "plan_checks",
"arguments": "{\"names\":[\"test\",\"build\"]}"
}
}
]
},
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_12f66bde19464121a617329f20484c0d",
"type": "function",
"function": {
"name": "run_checks",
"arguments": "{\"plan_id\": \"1c46ffc1-3b24-4fb8-b207-3305ccd14fd1\"}"
}
},
{
"id": "call_40d0588adc6b4abb8352fcd04c9abfbb",
"type": "function",
"function": {
"name": "read_file",
"arguments": "{\"path\": \"test/expense.test.mjs\"}"
}
},
{
"id": "call_7ca0aaf713a34fb6b06af412a0806774",
"type": "function",
"function": {
"name": "read_file",
"arguments": "{\"path\": \"src/amount.mjs\"}"
}
},
{
"id": "call_bba7c0bbdc874767a61a735efda0f601",
"type": "function",
"function": {
"name": "read_file",
"arguments": "{\"path\": \"src/summary.mjs\"}"
}
},
{
"id": "call_dbec88442f9f43469ad0cef99c0534f6",
"type": "function",
"function": {
"name": "read_file",
"arguments": "{\"path\": \"src/report.mjs\"}"
}
}
]
}
],
"files": [
{
"path": ".gitignore",
"content": "dist/\n.awb-*\nnode_modules/\n",
"sha256": "cab0bc87cad1b1214d71b023eee742986044093ff4b4331cd6a51098af6bdce6"
},
{
"path": "owner-staged.txt",
"content": "Owner working copy differs from staging\n",
"sha256": "56b0dda452eaf9aead80f0e4ad971d7befa3cf152c3553923f8fde46e1fd336a"
},
{
"path": "owner-unstaged.txt",
"content": "Owner unstaged change\n",
"sha256": "468bfb2956a4ac040508fc5ffd915cf8057fb7420e22c41a3cc2d094785f0d3e"
},
{
"path": "owner-untracked.txt",
"content": "Owner untracked change\n",
"sha256": "e32ab29a12ed13d72c2ed603b2360e1b4e35afb0fe4280db2e523ad2c6c5bc8d"
},
{
"path": "package.json",
"content": "{\n \"name\": \"owned-live-expense-report\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"node --test test/expense.test.mjs\",\n \"build\": \"node scripts/build.mjs\"\n }\n}\n",
"sha256": "6ad63026b2fe9de7513a4f6704c372a86108ee3d018a1f04883dc0a409ea4c24"
},
{
"path": "README.md",
"content": "# Expense report acceptance\nRepair the three source modules using the immutable original nine tests; do not edit checks or owner files.\n",
"sha256": "5e35a4dace9537e7c4cc815ce7054f73c171f053f1cccb9ff141f49ecb3c013e"
},
{
"path": "scripts/build.mjs",
"content": "import { spawnSync } from 'node:child_process';\nimport { readFileSync } from 'node:fs';\nfor (const file of ['src/amount.mjs','src/summary.mjs','src/report.mjs']) {\n const result=spawnSync(process.execPath,['--check',file],{encoding:'utf8'});\n if(result.status!==0) { process.stderr.write(result.stderr);process.exit(result.status??1); }\n if(!readFileSync(file,'utf8').trim()) throw new Error('Empty business module');\n}\nconsole.log('All three business modules compile.');\n",
"sha256": "7279bc7c707c0f3ccbae63b14f0abed248ad3755be14f9e37128124ae9267526"
},
{
"path": "src/amount.mjs",
"content": "export function amountToCents(value) { return 0; }\n",
"sha256": "84cb647328ec52dad27d288f3a6127ff3e1ad87274ae2d227ad44daa49cbb2ed"
},
{
"path": "src/report.mjs",
"content": "export function formatReport(groups) { return ''; }\n",
"sha256": "ba0a014e6e9df710d66e255a3a6f970f4e1c8af48accc81f33627029dcded7c0"
},
{
"path": "src/summary.mjs",
"content": "import { amountToCents } from './amount.mjs';\nexport function summarize(rows) { return []; }\n",
"sha256": "48829850c11ca0cd0ab5e86bbac69a0c5f90297292168c1ba6dc338e2eae6ee7"
},
{
"path": "test/expense.test.mjs",
"content": "import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { amountToCents } from '../src/amount.mjs';\nimport { summarize } from '../src/summary.mjs';\nimport { formatReport } from '../src/report.mjs';\ntest('decimal strings become exact cents including zero and refunds',()=>{\n for(const [input,expected] of [['0',0],[' 12.34 ',1234],['+2.5',250],['-1.05',-105],['-0.00',0],['0009.10',910]]) assert.equal(amountToCents(input),expected);\n});\ntest('finite decimal numbers use the same cents contract',()=>{\n for(const [input,expected] of [[0,0],[1.01,101],[2.5,250],[-4.32,-432]]) assert.equal(amountToCents(input),expected);\n});\ntest('malformed overprecision nonfinite and unsafe amounts are rejected',()=>{\n for(const input of ['',null,undefined,true,{},'1e2','1,000','.50','1.234',1.234,NaN,Infinity,'900719925474099.99']) assert.throws(()=>amountToCents(input),TypeError,String(input));\n});\ntest('independent currencies are sorted and summed without floating point loss',()=>{\n assert.deepEqual(summarize([{currency:'usd',amount:'0.10'},{currency:' CNY ',amount:3},{currency:'USD',amount:'0.20'}]),[\n {currency:'CNY',cents:300,count:1},{currency:'USD',cents:30,count:2}]);\n});\ntest('refunds cancel totals while counting every original record',()=>{\n assert.deepEqual(summarize([{currency:'eur',amount:'1.20'},{currency:'EUR',amount:'-1.20'}]),[{currency:'EUR',cents:0,count:2}]);\n});\ntest('summarizing retains caller rows and handles an empty list',()=>{\n const rows=Object.freeze([Object.freeze({currency:'usd',amount:'2.00'})]);\n assert.deepEqual(summarize(rows),[{currency:'USD',cents:200,count:1}]);assert.deepEqual(summarize([]),[]);\n});\ntest('invalid rows currency and unsafe aggregate totals are rejected',()=>{\n for(const rows of [null,{},[null],[{currency:'US',amount:'1'}],[{currency:'U1D',amount:'1'}],[{currency:'USD',amount:'1.234'}],\n [{currency:'USD',amount:'90071992547409.91'},{currency:'USD',amount:'0.01'}]]) assert.throws(()=>summarize(rows),TypeError);\n});\ntest('reports use two decimals and render negative subunit amounts',()=>{\n assert.equal(formatReport([{currency:'CNY',cents:300,count:2},{currency:'USD',cents:-105,count:1}]),'CNY 3.00 (2)\\nUSD -1.05 (1)');\n assert.equal(formatReport([{currency:'EUR',cents:-5,count:1}]),'EUR -0.05 (1)');assert.equal(formatReport([]),'');\n});\ntest('complete expense flow preserves exact decimal sums',()=>{\n assert.equal(formatReport(summarize([{currency:'usd',amount:'0.29'},{currency:'USD',amount:'-0.30'},{currency:'CNY',amount:'10.50'}])),\n 'CNY 10.50 (1)\\nUSD -0.01 (2)');\n});\n",
"sha256": "0bcda551dbaeafad9a6e3df8024492ab67d7c09956f4676c393b78249ab44839"
}
]
}