Keep run logs opaque and streamline transfers

This commit is contained in:
npc0-hue
2026-09-03 16:40:05 +08:00
parent 48dd540253
commit 330b1c0130
27 changed files with 429 additions and 673 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ type ArtifactChunkUploadRequest struct {
Offset int64 `json:"offset"`
SizeBytes int `json:"sizeBytes"`
Checksum string `json:"checksum"`
Payload []byte `json:"payload"`
Payload []byte `json:"-"`
}
type ArtifactChunkUploadResponse struct {
+3 -3
View File
@@ -5,7 +5,7 @@ Artifacts move files and large payloads between platform and run without blockin
## Implemented Routes
- `POST /api/v1/run/artifacts/open`: opens a run-to-platform upload transfer and returns resume state.
- `POST /api/v1/run/artifacts/chunks`: uploads one bounded chunk with byte range and checksum metadata.
- `POST /api/v1/run/artifacts/chunks`: uploads one bounded octet-stream chunk with byte range and checksum metadata in headers.
- `POST /api/v1/run/artifacts/status`: queries received chunks and the next missing chunk index.
- `POST /api/v1/run/artifacts/complete`: verifies all chunks and final checksum before marking the artifact available.
@@ -18,7 +18,7 @@ Browser-facing artifact downloads are implemented through platform-owned routes
- `ArtifactTransferOpenRequest`: run ID, session token, artifact ID, upload direction, owner scope, size, chunk size, checksum, and idempotency key.
- `ArtifactTransferOpenResponse`: transfer ID, artifact metadata, total chunks, received chunk indexes, next missing chunk index, duplicate flag, and server time.
- `ArtifactChunkUploadRequest`: transfer ID, artifact ID, chunk index, byte offset, size, checksum, and JSON byte payload.
- `ArtifactChunkUploadRequest`: transfer ID, artifact ID, chunk index, byte offset, size, checksum, and an in-memory octet-stream payload buffer that is not JSON encoded.
- `ArtifactChunkUploadResponse`: accepted chunk index, received chunk indexes, next missing chunk index, duplicate flag, and server time.
- `ArtifactTransferStatusRequest`: run ID, session token, transfer ID, and artifact ID.
- `ArtifactTransferStatusResponse`: transfer direction, total chunks, received chunk indexes, next missing chunk index, completion flag, and server time.
@@ -27,7 +27,7 @@ Browser-facing artifact downloads are implemented through platform-owned routes
## Local Queue
Run stores unacknowledged `ArtifactChunkUploadRequest` payloads in the local artifact queue. A queued chunk may be removed only after the platform acknowledges the same transfer ID, artifact ID, and chunk index. The queue must not store or expose raw host paths.
Run stores unacknowledged artifact chunk metadata as JSON and raw chunk bytes as sidecar files in the local artifact queue. A queued chunk may be removed only after the platform acknowledges the same transfer ID, artifact ID, and chunk index. The queue must not store or expose raw host paths.
## Rules
+1 -1
View File
@@ -135,7 +135,7 @@ type SQLiteSchemaProbeSafeError struct {
Retryable bool `json:"retryable"`
}
// SQLiteSchemaProbeResult is a terminal, redacted envelope. Names and sample
// SQLiteSchemaProbeResult is a terminal, bounded envelope. Names and sample
// values are represented only by salted-looking SHA-256 fingerprints.
type SQLiteSchemaProbeResult struct {
RequestID string `json:"requestId"`
+1 -1
View File
@@ -93,4 +93,4 @@ remain separate channels and must not be multiplexed through job result
payloads. Artifact transfer carries chunk payloads only through
`/api/v1/run/artifacts/*` routes.
Production code signing/KMS, rollout rings/fleet orchestration, client-manager lifecycle, plugin lifecycle, production scaling/alerts, and real AI-provider integration are explicitly outside this contract.
Production code signing/KMS, rollout rings/fleet orchestration, plugin lifecycle, production scaling/alerts, and real AI-provider integration are explicitly outside this contract.