Skip to content

SCE trace sync - #200

Open
davidabram wants to merge 9 commits into
agent-trace-exportfrom
sce-trace-sync
Open

SCE trace sync#200
davidabram wants to merge 9 commits into
agent-trace-exportfrom
sce-trace-sync

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

The Agent Trace control-plane endpoint lacked a configurable runtime setting, preventing the upcoming sync command from using the repository’s established configuration precedence. Add the shared auth-adjacent resolver entry with environment, config-file, and baked-default sources, expose provenance in config output, and enforce the non-empty schema contract. Record the resolved contract and T01 implementation evidence for downstream sync work.\n\nPlan: agent-trace-sync T01

Co-authored-by: SCE <sce@crocoder.dev>
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sce-config-json Ready Ready Preview Aug 11, 2026 10:16am

Request Review

davidabram and others added 2 commits August 11, 2026 00:55
Define typed serde contracts for ingestion state and batch endpoints, including exact stream wire values and generic batch payloads for all four export row types. Add shape tests to protect the camelCase request/response fields and stream identifiers used by the control plane.\n\nPlan: agent-trace-sync.md, T02

Co-authored-by: SCE <sce@crocoder.dev>
Add credential-backed ingestion HTTP operations with token reuse, refresh-on-expiry, bounded 401 retry, typed response classification, and state retry handling. Cover behavior with an in-repo HTTP test server and focused tests, while keeping batch retries under sync engine scope.\n\nPlan: agent-trace-sync (T03)

Co-authored-by: SCE <sce@crocoder.dev>
davidabram and others added 3 commits August 11, 2026 01:21
Add a generic per-stream batching engine that validates accepted counts and server cursors before advancing, including support for all four export row types. Reconcile conflicts and ambiguous outcomes from a refreshed authoritative cursor with a bounded retry counter, preserving gapped source IDs and avoiding unnecessary resends.\n\nPlan: agent-trace-sync (T04)

Co-authored-by: SCE <sce@crocoder.dev>
Expose \ through clap/runtime dispatch and synchronize the four Agent Trace capture streams from authoritative control-plane cursors. Reuse repository-scoped storage and WorkOS credentials, distinguish terminal failures from retryable reconciliation, and cover full, incremental, and forbidden-response behavior with end-to-end tests.\n\nPlan: agent-trace-sync, T05

Co-authored-by: SCE <sce@crocoder.dev>
Replace the provisional debug dump from "sce trace sync" with concise text output and the documented camelCase JSON report, including per-stream upload and cursor details. Add focused renderer coverage and document the completed command architecture and recovery behavior across the CLI context.

Plan: agent-trace-sync.md (T06, T07)

Co-authored-by: SCE <sce@crocoder.dev>
Reject out-of-range state cursors and persist refreshed credentials from a single expiry decision. Sanitize control-plane error messages and classify unsupported client statuses as terminal, while preserving reconciliation for ambiguous batch failures. Add regression coverage and document recovery behavior.

Plan: agent-trace-sync-hardening
Tasks: T01, T02, T03, T04

Co-authored-by: SCE <sce@crocoder.dev>
Synchronous Turso database calls previously invoked Runtime::block_on directly, which panics when an async caller already drives a Tokio runtime on the current thread. Detect that context and run the blocking future on a scoped dedicated thread, preserving direct execution for non-runtime callers across migration, connection, and query paths.

Co-authored-by: SCE <sce@crocoder.dev>
CredentialStore operations can initialize the encrypted auth database and Linux Secret Service through blocking APIs that create a Tokio runtime. Calling them directly from control-plane requests caused sce trace sync to panic with a nested-runtime error.\n\nRun credential persistence through spawn_blocking while leaving HTTP and token refresh asynchronous, and add regression coverage for the runtime boundary.

Co-authored-by: SCE <sce@crocoder.dev>
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