Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pm-stack/aggregator/scripts/sync-decision-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,16 @@ function parseArgs(): { files: string[]; outboxDir?: string; target?: string; st
}

async function main(): Promise<number> {
// Parse first, kill switch second (#9794): the operator-script
// contract (root AGENTS.md) requires every unaccounted-for
// argument to produce a non-zero usage error, and a disabled
// invocation is not exempt — a typo'd flag must exit 2, not
// silently succeed because the sync is switched off.
const opts = parseArgs();
if (process.env.DECISION_EVENTS_SYNC === "0") {
console.log("sync-decision-events: disabled by DECISION_EVENTS_SYNC=0");
return 0;
}
const opts = parseArgs();
const files = opts.files.length > 0 ? [...opts.files] : [defaultDecisionEventsOutboxFile()];
if (opts.outboxDir) {
const entries = await readdir(opts.outboxDir).catch(() => [] as string[]);
Expand Down