Skip to content

scripts: detached start, restart, and problem cases as JSON - #338

Merged
Kyu-seok merged 1 commit into
masterfrom
dev-scripts-detach-migrate-json
Nov 14, 2026
Merged

Kyu-seok merged 1 commit into
masterfrom
dev-scripts-detach-migrate-json

Conversation

@Kyu-seok

Copy link
Copy Markdown
Owner

Summary

From the #302 retro: three script changes so an agent restating problems stops working around its tools.

 scripts/dev-branch-servers.sh
   [start]              foreground, Ctrl-C stops
+  start --detach       nohup's a start, returns once the summary prints (log: <state>/start.log)
+  restart              stop → wait for the old start to exit → start --detach
   stop | status | drop | name
 scripts/problem-text.sh <slug>
   [--all]
+  --json               every case as [{input, expected_output}], what judge-local.sh --cases reads

restart waits for the old start process (pid now in <state>/start.pid): otherwise it can see its apps gone before the stop flag and stop everything on its way out, the new servers included.

CLAUDE.md and the restate-problem skill point at all three, replacing the hand-written psql … json_agg export and the "restart the servers" workaround #334 documented.

Evidence

  • Before: in Restate the 4 statements that contradict their Test Cases #302 the agent piped a foreground start through head and waited ~10 min; after V313 moved a Slug, judge-local.sh failed by either Slug until a manual stop/start.
    After:
    • start --detach from a plain tool call returned in 26 s; /api/health answered UP after the call ended.
    • With a scratch V999__…sql added, restart returned in 23 s with the database at V999, one start process left.
    • problem-text.sh pick-charging-start --json > cases.json → judge-local.sh pick-charging-start --cases cases.json: 10 cases, ACCEPTED.
    • New tests: dev-branch-servers.test.sh (detached start up / died, restart and start --detach refused in the main checkout, unknown start option) and problem-text.test.sh (--json query and output, unknown slug, unknown option); script tests and shellcheck pass.

Merge Danger

Door: two-way

Blast Radius: dev scripts

Only local development tooling and agent docs; start with no option behaves as before.

🤖 Generated with Claude Code

From the #302 retro. dev-branch-servers.sh start --detach returns once
the servers are up and leaves them running, so an agent needn't poll a
foreground start; restart brings the branch database up to migrations
written since the start (it waits for the old start to exit, which
would otherwise stop the new servers on its way out). problem-text.sh
--json prints every case as judge-local.sh --cases reads them. CLAUDE.md
and the restate-problem skill point at all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kyu-seok
Kyu-seok merged commit 465968a into master Nov 14, 2026
4 checks passed
@Kyu-seok
Kyu-seok deleted the dev-scripts-detach-migrate-json branch November 14, 2026 21:58
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