fix: repair watchdog dispatch receipt writer output

This commit is contained in:
Eve
2026-04-24 10:50:13 +08:00
parent cf1fbcf93f
commit 8a9a48649a
4 changed files with 21 additions and 7 deletions

View File

@@ -48,9 +48,7 @@ function printHelp() {
'',
'Minimal CLI skeleton for the subagent delivery watchdog.',
];
process.stdout.write(`${lines.join('
')}
`);
process.stdout.write(`${lines.join('\n')}\n`);
}
function tryReadInput(inputPath) {
@@ -116,8 +114,7 @@ function writeDispatchReceiptState(payload) {
expectedBy,
};
fs.writeFileSync(statePath, `${JSON.stringify(dispatchRecord, null, 2)}
`, 'utf8');
fs.writeFileSync(statePath, `${JSON.stringify(dispatchRecord, null, 2)}\n`, 'utf8');
return {
statePath,
@@ -160,8 +157,7 @@ function main() {
};
const spacing = args.compact ? 0 : 2;
process.stdout.write(`${JSON.stringify(response, null, spacing)}
`);
process.stdout.write(`${JSON.stringify(response, null, spacing)}\n`);
}
main();

View File

@@ -0,0 +1,6 @@
{
"runId": "fixture-run-active-before-sla",
"childSessionKey": "session:active-before-sla",
"dispatchAt": "2026-04-24T10:00:00.000Z",
"expectedBy": "2026-04-24T10:10:00.000Z"
}

View File

@@ -0,0 +1,6 @@
{
"runId": "fixture-run-completed",
"childSessionKey": "session:completed",
"dispatchAt": "2026-04-24T10:00:00.000Z",
"expectedBy": "2026-04-24T10:10:00.000Z"
}

View File

@@ -0,0 +1,6 @@
{
"runId": "fixture-run-suspect-delivery-failure",
"childSessionKey": "session:suspect-delivery-failure",
"dispatchAt": "2026-04-24T10:00:00.000Z",
"expectedBy": "2026-04-24T10:10:00.000Z"
}