Skip to content

fix(daemon): emit post-reaper shutdown phase receipts - #1138

Merged
ScriptedAlchemy merged 2 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
grok/shutdown-phase-receipts
Sep 9, 2026
Merged

fix(daemon): emit post-reaper shutdown phase receipts#1138
ScriptedAlchemy merged 2 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
grok/shutdown-phase-receipts

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • emit daemon_shutdown start/complete receipts for project-server drain and terminal store close after retirement reapers join
  • include elapsed_ms and deadline_remaining_ms so a 5-second dogfood force-kill can name the stalled phase
  • no timeout, deadline, or harness --stop-timeout changes

Needed to diagnose PR checkout dogfood force-kills (e.g. #1131 job 102359845662), which previously went silent after retirement_reapers_joined.

Verification

  • post_reaper_phases_emit_start_and_complete_receipts plus 13 sibling orchestration tests
  • check/clippy --no-deps -D warnings, fmt, diff check, commitlint

Project-server drain and terminal store close waited serially after
reaper join with no operator start/complete events, so a 5s harness
kill could not name which phase stalled.
@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: daf285e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T08:25:14.388991Z 3556f89 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3556f89789

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +495 to +499
log_shutdown_phase(
"store_close",
"start",
store_close_started,
store_close_deadline,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark store close as skipped when servers time out

When project_servers.timed_out_count() > 0, these lines still emit store_close_start and later store_close_complete, even though the branch at lines 503–509 does not invoke the terminal owner and only constructs a timeout receipt. This makes the new operator telemetry claim that the durability close ran when it was actually skipped; emit a skipped/blocked outcome or place the boundaries around the branch that performs the close.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

Comment on lines +73 to +75
#[cfg(test)]
capture_daemon_event_line(&line);
eprintln!("{line}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify the actual host-visible log sink

The #[cfg(test)] branch adds a shadow observation path to the shared production logger, and the new test scans that private Vec<String> rather than observing what reaches stderr. A regression between formatting and the host-visible sink could therefore leave the shutdown receipts absent while this test remains green; exercise the real process output instead of adding a test-only production port and string-scan acceptance path.

AGENTS.md reference: AGENTS.md:L121-L129

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Performance Comparison codex/tracedecay-total-redesign-plan-reopenedgrok/shutdown-phase-receipts

Total Elapsed Time: 3.87s → 3.96s (+2.2%)
CPU Baseline: 81.88µs → 84.52µs (+3.2%)
Benchmark ID: index-bench-timing

timing - Execution duration of functions.

+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| Function                                 | Calls                      | Avg                             | P95                             | Total                            | % Total                      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| tracedecay-index-bench                   | 1 → 1 (+0.0%)              | 3.87s → 3.96s (+2.3%)           | 3.87s → 3.96s (+2.3%)           | 3.87s → 3.96s (+2.3%)            | 100.00% → 100.00% (+0.0%)    |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.append_pages              | 13 → 13 (+0.0%)            | 118.79ms → 121.94ms (+2.7%)     | 159.78ms → 161.09ms (+0.8%)     | 1.54s → 1.59s (+3.2%)            | 39.91% → 40.07% (+0.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.workers.install               | 83 → 83 (+0.0%)            | 13.41ms → 13.62ms (+1.6%)       | 46.76ms → 46.50ms (-0.6%)       | 1.11s → 1.13s (+1.8%)            | 28.77% → 28.57% (-0.7%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| domain.canonical.sha256                  | 110414 → 110414 (+0.0%)    | 8.51µs → 8.48µs (-0.4%)         | 11.01µs → 11.02µs (+0.1%)       | 939.79ms → 936.86ms (-0.3%)      | 24.29% → 23.68% (-2.5%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.sqlite              | 13 → 13 (+0.0%)            | 68.43ms → 69.74ms (+1.9%)       | 92.01ms → 92.21ms (+0.2%)       | 889.56ms → 906.60ms (+1.9%)      | 22.99% → 22.91% (-0.3%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.build.and_publish             | 2 → 2 (+0.0%)              | 437.04ms → 436.75ms (-0.1%)     | 508.56ms → 508.04ms (-0.1%)     | 874.08ms → 873.50ms (-0.1%)      | 22.59% → 22.08% (-2.3%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings            | 13 → 13 (+0.0%)            | 60.20ms → 60.66ms (+0.8%)       | 80.67ms → 80.81ms (+0.2%)       | 782.63ms → 788.57ms (+0.8%)      | 20.22% → 19.93% (-1.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.chunk.index_file              | 276 → 276 (+0.0%)          | 2.08ms → 2.75ms (+32.2%) ⚠️     | 3.13ms → 3.10ms (-1.0%)         | 573.92ms → 760.08ms (+32.4%) ⚠️  | 14.83% → 19.21% (+29.5%) ⚠️  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.finalization.advance_wake | 14 → 14 (+0.0%)            | 44.17ms → 47.61ms (+7.8%)       | 267.78ms → 285.74ms (+6.7%)     | 618.35ms → 666.56ms (+7.8%)      | 15.98% → 16.85% (+5.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.prepare_pages             | 13 → 13 (+0.0%)            | 42.52ms → 43.94ms (+3.3%)       | 60.19ms → 60.36ms (+0.3%)       | 552.81ms → 571.16ms (+3.3%)      | 14.29% → 14.44% (+1.0%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.extract.parser_artifact       | 276 → 276 (+0.0%)          | 2.07ms → 2.06ms (-0.5%)         | 3.11ms → 3.10ms (-0.3%)         | 571.81ms → 568.28ms (-0.6%)      | 14.78% → 14.36% (-2.8%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| 🆕 code_index.chunk.map_ordered          | 0 → 780 (+100.0%) ⚠️       | 0.00ns → 603.51µs (+100.0%) ⚠️  | 0.00ns → 507.39µs (+100.0%) ⚠️  | 0.00ns → 470.74ms (+100.0%) ⚠️   | 0.00% → 11.90% (+100.0%) ⚠️  |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.parallel_prepare    | 13 → 13 (+0.0%)            | 33.90ms → 35.19ms (+3.8%)       | 47.91ms → 47.87ms (-0.1%)       | 440.76ms → 457.52ms (+3.8%)      | 11.39% → 11.56% (+1.5%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| query.artifact.batch.postings.ngram_rows | 13 → 13 (+0.0%)            | 33.85ms → 33.80ms (-0.1%)       | 45.88ms → 45.58ms (-0.7%)       | 440.07ms → 439.36ms (-0.2%)      | 11.37% → 11.10% (-2.4%)      |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| code_index.build.assemble                | 2 → 2 (+0.0%)              | 196.52ms → 193.95ms (-1.3%)     | 206.96ms → 203.42ms (-1.7%)     | 393.03ms → 387.90ms (-1.3%)      | 10.16% → 9.80% (-3.5%)       |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+
| 🗑️ code_index.chunk.build                | 276 → 0 (-100.0%) 🚀       | 1.33ms → 0.00ns (-100.0%) 🚀    | 1.96ms → 0.00ns (-100.0%) 🚀    | 366.93ms → 0.00ns (-100.0%) 🚀   | 9.48% → 0.00% (-100.0%) 🚀   |
+------------------------------------------+----------------------------+---------------------------------+---------------------------------+----------------------------------+------------------------------+

Generated with hotpath-rs

@ScriptedAlchemy
ScriptedAlchemy merged commit d5b6ee1 into codex/tracedecay-total-redesign-plan-reopened Sep 9, 2026
7 of 9 checks passed
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