Skip to content

Protect diagnostic outbox lifecycle - #5

Open
JusterZhu wants to merge 2 commits into
justerzhu-bowl-windows-hooksfrom
justerzhu-bowl-outbox-lifecycle
Open

JusterZhu wants to merge 2 commits into
justerzhu-bowl-windows-hooksfrom
justerzhu-bowl-outbox-lifecycle

Conversation

@JusterZhu

Copy link
Copy Markdown
Contributor

Summary

  • Coordinate writers and consumers with permanent striped cross-process locks; publish schema-2 protocol-1 manifests only after the crash hook completes.
  • Preserve unacknowledged and incomplete evidence; serialize bounded admission and fall back to exit-code monitoring when capture cannot be admitted.
  • Document migration, consumer locking and recovery; add real-process lock, publication and capacity tests.

Validation

  • dotnet test tests\Bowl.Console.Tests\Bowl.Console.Tests.csproj -c Release --no-restore (Windows)
  • Linux cross-process verification is exercised by the existing Ubuntu CI job; deployment requires a local filesystem and all old watchdogs/uploaders stopped.

Stacked on #4.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 15:50

Copilot AI 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.

🟡 Changes recommended

The hook’s nonzero-exit check is unreachable, causing failed hooks to return success and publish potentially incomplete evidence instead of retaining an unpublished case.

1 open issue
What changed in this PR

This PR protects the diagnostic watchdog’s crash-evidence outbox, building on #4’s hook and process-output fixes. It introduces coordinated access and bounded admission while preserving evidence for upload or operator recovery.

Changes:

  • Add permanent cross-process locks and defer manifest publication until after the crash hook.
  • Replace automatic eviction with capacity limits and exit-code-only monitoring when capture cannot be admitted.
  • Document the consumer protocol and migration requirements, and add lifecycle and concurrency tests.
File Description
tests/​Bowl.TestPeer/​Program.cs Add a real-process lock mode for concurrency tests.
tests/​Bowl.Console.Tests/​OutboxManagerTests.cs Update tests for session leases, protocol metadata, retention, and admission.
tests/​Bowl.Console.Tests/​OutboxConcurrencyTests.cs Cover locking, publication ordering, capacity, and failure recovery.
tests/​Bowl.Console.Tests/​CliOptionsTests.cs Test rejection of invalid version directory names.
tests/​Bowl.Console.Tests/​Bowl.Console.Tests.csproj Add the test-peer build dependency.
src/​GeneralUpdate.Bowl.Console/​SupervisorLoop.cs Hold session leases through capture and publication; support degraded monitoring.
src/​GeneralUpdate.Bowl.Console/​OutboxManager.cs Introduce locking and capacity limits; preserve existing evidence.
src/​GeneralUpdate.Bowl.Console/​CliOptions.cs Validate version directory names.
README.md Link the diagnostic outbox guide.
docs/​diagnostic-outbox.md Define locking, publication, consumer, migration, and recovery requirements.

Review effort: Balanced

GeneralTracer.Warn("SupervisorLoop: on-crash hook timed out after 60s and was killed.");
return false;
}
else if (process.ExitCode == 0)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

2 participants