Skip to content

refactor(#9311): add GitHub conversation kind to trace context v1 - #9312

Merged
ifireball merged 1 commit into
mainfrom
agent/9311-conversation-trace-identity
Nov 12, 2026
Merged

ifireball merged 1 commit into
mainfrom
agent/9311-conversation-trace-identity

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

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 byte 0x03) to internal/telemetry/tracecontext and updates the v1 normative spec and the reference doc. Identity derivation and wire bytes for the existing work_item and change_proposal kinds 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: add KindConversation EntityKind = 0x03 and accept it in EntityKind.Valid. Fallback derivation, Sign, Parse, and Admit already validate through Valid and bind the kind byte. A conversation therefore gets the existing binding, signature, fallback, and unresolved rules with no other code change.
  • docs/normative/trace-context/v1/README.md:
    • The identity table now covers conversation. Its container is the repository id and its entity is the Discussion database ID (webhook discussion.id, GraphQL databaseId), never the node ID or the shared display number.
    • Conversations stay unresolved until a trusted read supplies the database ID. GitLab and Jira never use this kind.
    • Converting an issue to a Discussion, or back, counts as a new binding.
    • The derivation and wire tables list 0x03.
    • Adds a conversation derivation vector and a Compatibility note recording the in-place addition.
  • docs/reference/trace-context.md: documents EntityKind, notes that no adapter reads Discussions yet (ADR 0086 ingress), and updates the conformance-evidence list.

Triage suggested GraphQL fullDatabaseId for Discussions. GitHub's Discussion type doesn't have that field (introspection shows only databaseId: Int), so the spec names databaseId and the webhook discussion.id instead.

Testing

  • make lint passes (stage changes first, then run). pre-commit couldn'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, plus gofmt, go vet ./..., lint-broken-symlinks, lint-docs-links, and lychee --offline all passed. semgrep was not run because its pinned ruleset couldn't be downloaded.
  • Tests added/updated for new or modified logic. go test -race ./internal/telemetry/tracecontext/ ./internal/forge/github/ passes, with 100% statement coverage in tracecontext.
    • I built a new fallback vector and a new signed bound-envelope vector for a conversation independently, using Python struct, hashlib, and cryptography Ed25519. The same script reproduces the existing goldenBoundNoneHex byte for byte when the kind is 0x01.
    • Repeated launches on one conversation derive and admit identical context.
    • Distinct Discussions, and the same Discussion ID under a different repository, produce different traces. A conversation and a work item or change proposal with the same numeric IDs also stay distinct, in both derivation and admission (binding-mismatch).
    • Missing or invalid stored context on a conversation falls back with the documented reason: absent, malformed, bad-signature, unknown-key, conflicting-carrier, or unresolved. A conversation-scoped pending marker returns only pending.
    • All existing work-item and change-proposal vectors pass without changes.

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes). It uses refactor because this is an internal package and contract change with no user-visible behavior yet. It isn't breaking: no carrier has been published.
  • Commits are signed off (DCO): N/A, autonomous agent commit
  • I wrote this contribution myself and can explain all changes in it: authored by the fullsend code agent

🤖 Generated with Claude Code


Closes #9311

Post-script verification

  • Branch is not main/master (agent/9311-conversation-trace-identity)
  • Secret scan passed (gitleaks — 47b1f72cd7a778d91bcb411935ea804b80d7f06a..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

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>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:14 AM UTC · Completed 9:23 AM UTC

Commit: 0d3e0df · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.96

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://a7535a81-site.fullsend-ai.workers.dev

Commit: 0d3e0dfcc2d114d4306d08e27ad9347941117d21

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 11, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Additive 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.

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: PR changes Go code and reference/normative docs for trace context

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge go Pull requests that update go code component/docs User-facing documentation labels Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ifireball

Copy link
Copy Markdown
Member

/fs-fix diagnose BT failue, is it related to PR changes?

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 9:53 AM UTC · Completed 9:56 AM UTC

Commit: 0d3e0df · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.29

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. Human request: diagnose the behaviour-test (BT) failure and say whether it is related to the PR changes: Diagnosis only, no code change. The E2E 'behaviour' job failed in a single scenario (registered coder bot submits a review comment on a pull request). The failure is in the after-scenario hook, which allocates a fresh slot repo: GitHub Actions never registered the fullsend.yaml workflow on the new repo within 30 polling attempts (404). It is a repo-provisioning/Actions-readiness problem, not an assertion about product behaviour. The sibling scenario for the registered review bot passed, and about 90 other scenarios passed. The PR only touches the trace-context package (internal/telemetry/tracecontext) and two docs pages. Its unit tests, the 'test' job, playback and codecov/patch all passed. The behaviour suite does not exercise the changed code on this path. Classified as not related to the PR.
  2. Merge-conflict inspection: Forge reports mergeable=MERGEABLE, so no conflict reconciliation was needed.

Tests: passed

CI inspections (12):

  1. E2E Tests / behaviour (transient-infra, failure): A single scenario failed in its after-scenario hook while provisioning a fresh slot repo: the Actions workflow file never became visible on the new repo within the polling budget. Unrelated to the trace-context changes; the other scenarios, including the review-bot sibling, passed. Re-run the failed behaviour job; no code change needed.
  2. E2E Tests / playback (passing, success)
  3. CI / test (passing, success)
  4. CI / semgrep (passing, success)
  5. CI / commit-lint (passing, success)
  6. CI / web (passing, success)
  7. CI / gateway-doc-configs (passing, success)
  8. CI / test-sandbox-darwin (passing, success)
  9. codecov/patch (passing, success)
  10. PR Title Lint / pr-title-lint (passing, success)
  11. Build Site / build (passing, success)
  12. DCO (passing, success)

Conflict update: skipped; strategy none; forge MERGEABLE; target main@47b1f72cd7a778d91bcb411935ea804b80d7f06a

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push

Updated by fullsend fix agent

@ifireball
ifireball enabled auto-merge November 11, 2026 12:24
@ifireball
ifireball added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 743dc65 Nov 12, 2026
100 of 105 checks passed
@ifireball
ifireball deleted the agent/9311-conversation-trace-identity branch November 12, 2026 10:23

This branch was successfully deployed

1 active and 1 inactive deployments
dev — 0d3e0dfc Deployed Nov 12, 2026 by fullsend-ai-coder[bot] via behaviour #19655
site-preview — 0d3e0dfc Deployed Nov 11, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation go Pull requests that update go code ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

telemetry: support GitHub conversation trace identity

1 participant