Skip to content

Add opt-in diagnostic artifact transport - #542

Open
JusterZhu wants to merge 1 commit into
masterfrom
justerzhu-diagnostic-outbox-upload
Open

JusterZhu wants to merge 1 commit into
masterfrom
justerzhu-diagnostic-outbox-upload

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

  • Add an explicit HTTPS multipart transport for a caller-provided schema 2 crash ZIP, bounded request/response sizes, configured tenant/app identity, and application-level response validation.
  • Verify a returned content SHA-256 when provided; expose missing hash and duplicate/unparsed results without authorizing evidence deletion.
  • Document host security responsibilities and the Bowl/GeneralSpace coordination required before implementing an outbox consumer.

Scope and dependencies

This is a transport-only first step. It does not scan or delete the Bowl outbox, create durable snapshots, schedule retries, or integrate with the bootstrap lifecycle. Safe consumption depends on Bowl's outboxProtocol: 1 writer/GC/consumer lock protocol and a GeneralSpace release that verifies and returns stored ZIP hashes. The current anonymous endpoint does not authenticate AppKey; a deployment must supply authenticated access.

Verification

  • dotnet test tests\CoreTest\CoreTest.csproj --no-restore --filter FullyQualifiedName~ArtifactUploadClientTests (15 passed)
  • dotnet build src\GeneralUpdate.Core\GeneralUpdate.Core.csproj --no-restore (all target frameworks passed)
  • net10.0 rebuild with AOT analyzer: no diagnostics in the new transport. Native AOT publish not run: Visual C++ build tools unavailable.

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:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The upload client can hang indefinitely after receiving response headers despite a configured HTTP timeout, and its GUID validation accepts whitespace-padded values that can cause acknowledgment mismatches.

2 open issues
What changed in this PR

Adds an opt-in transport for sending prepared Bowl schema 2 crash ZIPs to GeneralSpace, without integrating outbox consumption or evidence deletion.

Changes:

  • Adds HTTPS multipart uploads with configured tenant/app identity, size limits, response validation, and optional SHA-256 verification.
  • Adds tests for upload formatting, validation, retries, snapshot isolation, and cancellation.
  • Documents host security responsibilities and prerequisites for safe outbox integration.
File Description
tests/​CoreTest/​Diagnostics/​ArtifactUploadClientTests.cs Tests upload behavior and failure handling.
src/​GeneralUpdate.Core/​Diagnostics/​ArtifactUploadClient.cs Implements the transport, metadata, and acknowledgment types.
docs/​diagnostic-artifact-transport.md Documents usage, security requirements, and lifecycle boundaries.

Review effort: Balanced

var guid = artifact.Guid;
var kind = artifact.Kind;
var schema = artifact.Schema;
if (!Guid.TryParseExact(guid, "D", out _) ||
if (!requestLength.HasValue || requestLength.Value > RequestLimit)
throw new InvalidOperationException("The multipart request exceeds the GeneralSpace transport limit.");

using var response = await _client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken)
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