Repository navigation
DR-SEC-01g-G4a: release ownership on signal stop - #872
Merged
Merged
Conversation
… errors The CLI entry now handles SIGINT/SIGTERM by closing the server once and waiting for the store release before exit; a second signal exits at once. The close hook no longer emits 'error' from the rejection handler: the failure goes to the callback or one stderr line, and a native close error is kept as cause. Ownership release errors no longer overwrite an existing cause. Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: SIGTERM stop releases ownership and the next process can write Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: SIGINT stop releases ownership and the next process can write Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: a failing release on signal stop exits non-zero with a short stderr line Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: close without callback and failing release logs once and does not crash Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: dual close failure keeps the native error as cause of the release failure Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: a release failure does not overwrite the cause of the mutation error Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Paket-PR bringt seinen Bericht mitPackage branches (w<N>-, df<N>, ki-<N>, hq2-, dr-, z<N>-) must carry their report in the PR body, in a section that starts with "## Report".
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
A closed terminal or ssh session sends SIGHUP, which killed the entry without releasing the ledger owner record. SIGHUP now takes the same stop path as SIGINT/SIGTERM (POSIX only; Windows cannot deliver it). Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: SIGHUP stop releases ownership and the next process can write Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e line synchronously A stop signal that arrives after a failed listen exited 0 because the native ERR_SERVER_NOT_RUNNING was treated as success; the clean exit is now gated on the listening flag. The failure line goes through fs.writeSync(2) so an immediate exit cannot drop it on a pipe (the existing stderr assertion stays). Test-First: tools/denkraum/server-stop.test.mjs::DRSEC-G4a: a stop after a failed listen exits non-zero Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…was taken freePort() releases the port before the child binds it; under parallel load another process can take it (EADDRINUSE seen in the prepush lane). startEntry now retries that start up to five times on a fresh port. No-Test: Test-helper only; the retry changes no assertion and the tests it serves stay as they were. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cuarroc
marked this pull request as ready for review
October 9, 2026 17:57
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 9, 2026
Closed
Contributor
Merge Queue Status
This pull request spent 19 minutes 52 seconds in the queue, including 13 minutes 9 seconds running CI. Required conditions to merge
|
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Der Entscheidungsserver gibt beim Beenden per Strg+C (SIGINT) oder SIGTERM jetzt die Besitzmarke des Ledgers frei und beendet sich erst danach mit Code 0. Schlägt die Freigabe fehl, endet er mit Code 1 und einer kurzen Fehlerzeile; ein zweites Signal beendet sofort. Fehler beim Schließen stürzen den Server nicht mehr ab, sondern gehen an den Callback oder in eine Stderr-Zeile, und beide Fehlerursachen bleiben erhalten.
Gestapelter PR: Basis ist
cursor/dr-sec-01g-g2-core(35fe38e, PR #866); Root setzt die Basis nach dem Merge von #866 aufmain.Report
Was geändert wurde (Tier A)
tools/denkraum/server.mjs(CLI-Einstieg): SIGINT/SIGTERM rufen einmalserver.close(), warten auf die Store-Freigabe, dann Exit 0. Fehlschlag: Exit 1 plus eine ZeileBeenden fehlgeschlagen: <Code>. Zweites Signal während des Schließens: sofort Exit 1.tools/denkraum/server.mjs(Close-Hook): keinemit('error')mehr aus dem Rejection-Handler. Der Fehler geht an den Callback, sonst genau eine Stderr-Zeile (nur der Fehlercode, kein Pfad). Scheitern natives Schließen undstore.close(), bleibt der native Fehler alsfailure.cause ??= errorerhalten.tools/denkraum/store/core.mjs(#owned):error.cause ??= causestatt Überschreiben.tools/denkraum/server-stop.test.mjs(neu, 6 Tests).Evidence, Runde 0 (Arbeitsbaum, Head 88ac685)
node --test tools/denkraum/server-stop.test.mjs: pass 0, fail 6), am Kopf grün (pass 6, fail 0).node --test tools/denkraum/server-stop.test.mjs tools/denkraum/store/*.test.mjs→ Exit 0 (pass 85, fail 0)npm run test:denkraum→ Exit 0 (Playwright 9 passed, Hygiene 0 Funde)bash scripts/ci/red-first.sh→ Exit 0bash scripts/ci/gates.sh lane prepush→ Exit 0 (214 s)Test-First: tools/denkraum/server-stop.test.mjs::<Testname>, je ein neuer Test.Architecture drift: keine neuen Treffer, keine Allowlist-Änderung.
NICHT ABGEDECKT
process.platform !== 'win32'übersprungen. Die Windows-Bahn läuft in der Merge-Queue; die#[cfg(windows)]-Tests sind auf Linux nicht übersetzt.kill -9(verwaiste Besitzmarke) → G6.Review: Runde 1: GLM 5.2 approve (keine Findings), Kimi K3 approve mit Auflagen (unten). Runde 2 (Delta) wartet auf Root-Dispatch.
Report NACHBESSERN (Runde 1, Head 55bbb2c)
server.mjs:163: SIGHUP (Terminal/ssh schließt) beendet den Prozess ohne Freigabe der Besitzmarkestop, nur wennprocess.platform !== 'win32'; TestSIGHUP stop releases ownership…an 88ac685 rot (code: null, signal: 'SIGHUP'), am Kopf grünserver.mjs:159:console.error+ sofortigesprocess.exit(1)kann die Zeile auf einer Pipe verlierenfs.writeSync(2, …)in try/catch vor dem Exit; bestehende Stderr-Assertion bleibt, Test deterministisch grün; kein neuer Test (auf Linux nicht reproduzierbar)server.mjs:158-160: Stop nach fehlgeschlagenem Listen meldet Exit 0listening-Flag (imlistening-Handler gesetzt), sonst Exit 1 mit „nicht gestartet“; Testa stop after a failed listen exits non-zeroan 88ac685 rot (code: 0), am Kopf grün (Preload hält die Event-Loop am Leben, damit das Signal sicher nach dem Listen-Fehler eintrifft)freePort()gab den Port vor dem Kind-Bind frei; ein paralleler Prozess nahm ihn (EADDRINUSE)startEntrywiederholt den Start bis 5-mal mit neuem Port; reiner Test-Helfer,No-Test:Hinweis zum Ablauf: Der Pre-commit-Hook führt
npm run test:denkraumaus; ein rein roter Test-Commit ist ohne--no-verifynicht möglich. Test und Fix stehen daher je Befund im selben Commit; die Rotprüfung gegen 88ac685 wurde lokal ausgeführt (Tests allein, Quelle unverändert).Evidence, Runde 1 (Head 55bbb2c)
node --test tools/denkraum/server-stop.test.mjs tools/denkraum/store/*.test.mjs→ Exit 0 (pass 87, fail 0);server-stop.test.mjs3-mal hintereinander Exit 0npm run test:denkraum→ Exit 0bash scripts/ci/red-first.sh→ Exit 0bash scripts/ci/gates.sh lane prepush→ Exit 0 (319 s; ein früherer Lauf war wegen des oben genannten Port-Flakes rot und wurde nach dem Fix vollständig wiederholt)Review (Delta): Runde 2 wartet auf Root-Dispatch (Stufe A; die Autor-Familie Claude zählt nicht als Prüfer).
🤖 Generated with Claude Code
Root-Abnahme (09.10.2026 18:05Z, head 55bbb2c)
Tier A, author Claude (Sonnet 5.5). Reviewers outside the family: Kimi K3 (Moonshot) + GLM 5.2 (Zhipu), local Ollama. R1 on 88ac685: GLM approve (no findings), Kimi approve w/ conditions → fix1 (K1/K3/K4). R2 delta 88ac685..55bbb2c: both approve with conditions, no high.
store/core.mjs:20-24,#owned), the notifier drain starts only onlistening; a process that never listens never acquires. Restart-after-failed-listen test → follow-up G4b (admission before listen)exit, notclose(stdio may be incomplete)console.errorTwo review rounds done (AGENTS.md rule 5); no open high; remaining items are low or verified-rejected and bound to G4b/G6. Ready +
review-okbound to 55bbb2c.