Repository navigation
refactor(#9311): add GitHub conversation kind to trace context v1 - #9312
Conversation
Trace Context v1 defined only work-item and change-proposal identities, so runs started from a GitHub Discussion had no entity identity to derive or verify a shared trace against. Add KindConversation (kind byte 0x03) to internal/telemetry/tracecontext and accept it in EntityKind.Valid. Fallback derivation, signing, parsing, and admission already key off Valid and the kind byte, so a conversation gets the existing binding, signature, and fallback guarantees with no other code change. The derivation input and wire bytes of existing kinds are unchanged, and all existing vectors still pass. The v1 Compatibility section allows in-place changes until the first carrier-publishing PR merges; none has (only the foundation in #9084), so this extends v1 rather than defining a new version byte. The spec now maps a Discussion to its repository id and Discussion database id (webhook discussion.id, GraphQL databaseId; GitHub exposes no fullDatabaseId for Discussion), never the node ID or number, and treats issue/Discussion conversion as a new binding. Tests add an independent Python-built fallback vector and signed wire vector for a conversation, plus repeated-launch convergence, distinct conversations and repositories, kind separation, and absent, malformed, bad-signature, unknown-key, conflicting, unresolved, and pending cases. Note: pre-commit could not fetch remote hook repos (TLS failure in the sandbox). Hooks were run directly instead: whitespace/EOF/merge/key checks, gofmt, go vet, lint-broken-symlinks, lint-docs-links, and lychee passed. semgrep was skipped because its pinned ruleset could not be downloaded. Closes #9311 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 9:14 AM UTC · Completed 9:23 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.96 |
Site previewPreview: https://a7535a81-site.fullsend-ai.workers.dev Commit: |
|
Risk Assessment: moderate (2/5) DetailsAdditive telemetry contract change with full issue alignment and high test coverage, elevated to moderate risk by recent commit churn and regression history in the modified tracecontext files. |
|
Looks good to me Labels: PR changes Go code and reference/normative docs for trace context |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/fs-fix diagnose BT failue, is it related to PR changes? |
|
🤖 Finished Fix · ✅ Success · Started 9:53 AM UTC · Completed 9:56 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.29 |
🔧 Fix agent — iteration 1 (human-triggered)The behaviour (BT) failure is not related to this PR. One scenario failed because the fresh test repo did not get its fullsend.yaml workflow registered by GitHub Actions in time (404 after 30 attempts). That is transient infrastructure flakiness. The PR only adds a conversation kind to the trace-context package and docs, and all other checks passed. No code changes were made. Recommend re-running the failed E2E 'behaviour' job. Fixed (2):
Tests: passed CI inspections (12):
Conflict update: skipped; strategy
|
Summary
Adds a GitHub conversation (Discussion) entity kind to Trace Context so runs tied to the same Discussion can share a verified, stable trace identity. The change adds
KindConversation(kind byte0x03) tointernal/telemetry/tracecontextand updates the v1 normative spec and the reference doc. Identity derivation and wire bytes for the existingwork_itemandchange_proposalkinds don't change.Maintainer decision to confirm: extended v1 in place, no successor version byte. The issue asks for a "successor contract". However, the v1 Compatibility section says v1 can change without a new version byte until the first carrier-publishing PR merges. No such PR exists yet: only the foundation (#9084) and doc follow-ups have merged, and the only code outside the package that imports it is a test. A new version byte would add a second parse and derivation path for no compatibility benefit. If you'd rather have a v2 contract anyway, say so and the kind can move behind a new version byte.
Related Issue
Extends ADR 0154. Related: #9060 (trace-continuity runtime work; this PR touches no envelope or admission logic) and #6402 (Discussion conversation surface).
Changes
identity.go: addKindConversation EntityKind = 0x03and accept it inEntityKind.Valid. Fallback derivation,Sign,Parse, andAdmitalready validate throughValidand bind the kind byte. A conversation therefore gets the existing binding, signature, fallback, andunresolvedrules with no other code change.docs/normative/trace-context/v1/README.md:conversation. Its container is the repositoryidand its entity is the Discussion database ID (webhookdiscussion.id, GraphQLdatabaseId), never the node ID or the shared display number.0x03.docs/reference/trace-context.md: documentsEntityKind, notes that no adapter reads Discussions yet (ADR 0086 ingress), and updates the conformance-evidence list.Triage suggested GraphQL
fullDatabaseIdfor Discussions. GitHub'sDiscussiontype doesn't have that field (introspection shows onlydatabaseId: Int), so the spec namesdatabaseIdand the webhookdiscussion.idinstead.Testing
make lintpasses (stage changes first, then run).pre-commitcouldn't fetch its remote hook repos in the sandbox (TLS failure), so I ran the relevant hooks directly. Whitespace, EOF, merge-conflict, and private-key checks, plusgofmt,go vet ./...,lint-broken-symlinks,lint-docs-links, andlychee --offlineall passed. semgrep was not run because its pinned ruleset couldn't be downloaded.go test -race ./internal/telemetry/tracecontext/ ./internal/forge/github/passes, with 100% statement coverage intracecontext.struct,hashlib, andcryptographyEd25519. The same script reproduces the existinggoldenBoundNoneHexbyte for byte when the kind is0x01.binding-mismatch).absent,malformed,bad-signature,unknown-key,conflicting-carrier, orunresolved. A conversation-scoped pending marker returns onlypending.Checklist
!for breaking changes). It usesrefactorbecause this is an internal package and contract change with no user-visible behavior yet. It isn't breaking: no carrier has been published.🤖 Generated with Claude Code
Closes #9311
Post-script verification
agent/9311-conversation-trace-identity)47b1f72cd7a778d91bcb411935ea804b80d7f06a..HEAD)