Skip to content

Preserve campaign judges during drafting - #1746

Draft
keshav55 wants to merge 2 commits into
masterfrom
codex/campaign-draft-preservation-20261105
Draft

keshav55 wants to merge 2 commits into
masterfrom
codex/campaign-draft-preservation-20261105

Conversation

@keshav55

@keshav55 keshav55 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Drafting a campaign with an existing ID can overwrite its judge before duplicate detection, changing the behavior of the existing campaign. This change refuses recorded IDs and existing draft directories, reserves a new directory, and writes separate exclusive judge files for retries. It also validates the ID before constructing the shell command.

Failed attempts now retain their draft files for inspection rather than recursively deleting the directory. A generated ID collision is refused and must be retried.

This remains a draft: the store check and directory reservation are not atomic. Another process can register the same ID after the check or while the judge runs, including when only drafting. Concurrent path replacement and edits before execution are also not fenced. The engine-generated judge still runs as shell code; this change does not sandbox it. Real judges, live campaigns, and rollout have not been verified.

Validation: node --test test/campaign-new*.test.js test/campaign-store.test.js (35 passed), using temporary files and SQLite plus mocked engine responses. Independent review reproduced the missing-directory case against a temporary SQLite store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant