Skip to content

telemetry: implement ADR 0154 trace continuity #9060

Open

Description

@ifireball

What happens

Fullsend traces individual runs, but independent launches for the same issue or PR do not share durable trace context. Behaviour-test (BT) traces also do not group scenario-owned work with the entities and Fullsend runs that scenario creates, making end-to-end failures harder to diagnose.

What should happen

Implement ADR 0154:

  • Independent launches on an issue or PR continue its authenticated trace context; Fullsend-created ordinary work is linked to its source as the ADR specifies.
  • A BT scenario and its Fullsend/BT-owned operations, created entities, and triggered runs share the scenario TraceID.
  • Stored context is accepted only when its signature and entity binding verify. Missing or invalid context falls back to the entity-derived context, and dispatch authorization remains independent.
  • The required metadata carriers and protected key configuration work across GitHub, GitLab, Forgejo, and Jira within the ADR’s scope.

Acceptance criteria

  • Tests cover repeated launches, created-entity links, context verification failures and fallback, and authorization independence.
  • BT tests show scenario-owned operations and created work items sharing the scenario TraceID, with spans collected through scenario teardown.
  • Carrier and key-provisioning behavior is covered for the forges and Jira in the ADR’s scope, and the relevant documentation is updated.

Related

Activity

  1. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 9:09 AM UTC · Completed 9:11 AM UTC

    Commit: c7652ad · View workflow run →

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

  2. added
    feature
    triaged
    on Nov 3, 2026
  3. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage

    ADR 0154 is merged and gives a detailed design, so this is ready for implementation. No open PR addresses it. The related PR #9011 (root-span forge/CI attributes for #6842) touches the same run-span area, so expect merge-conflict coordination in internal/cli/run.go.

    Scope notes for the implementer

    • This is a large, dependency-ordered change. Land it in staged PRs: signed envelope and verification, then key provisioning, then forge/Jira carriers, then run continuity and created-work links, then BT scenario correlation.
    • There is no Forgejo adapter in internal/forge (only GitHub, GitLab and Jira). The ADR applies Forgejo support when that adapter exists and its hidden-metadata behaviour is verified, so Forgejo should be deferred rather than blocking the rest.
    • Key provisioning may touch scaffold or workflow templates for repository secrets. If it does, that part needs manual maintainer action because the code agent cannot modify workflow files.
    • Per repo rules, any new CLI flags or config need matching updates under docs/cli/ and docs/guides/. Forge access must go through forge.Client.

    Proposed test cases

    - two independent launches on one entity share signed TraceID/parent
    - bad signature, wrong binding, unknown version, missing key -> entity-derived fallback
    - pending-creation marker grants no context/link; falls back after bounded wait
    - dispatch authorization result identical with valid/invalid/absent context
    - Fullsend-created issue/PR gets a span link (not a parent) to its source
    - install flags reject raw private-key bytes; secrets redacted from output
    - metadata-only writes preserve human body text and do not retrigger runs (GitHub, GitLab, Jira)
    - BT: scenario ops, created entity and triggered Fullsend run share the scenario TraceID through teardown
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  4. added 2 commits that reference this issue on Nov 12, 2026
  5. added 2 commits that reference this issue on Nov 12, 2026
  6. added 3 commits that reference this issue on Nov 13, 2026
  7. dhshah13 commented on Nov 13, 2026

    @dhshah13
    Contributor

    FULLSEND_TRACE_SIGNING_KEY_ID

    Under ADR 0154, a standard install keeps the private key in a repository secret, FULLSEND_TRACE_SIGNING_KEY in v1. GitHub's API never returns a secret's value, so install records which key the secret holds in a plain repository variable, FULLSEND_TRACE_SIGNING_KEY_ID.

    • Its value is the v1 key ID, the first 8 bytes of SHA-256 of the public key, as 16 lowercase hex characters (tracecontext.FormatKeyID). It is public: envelopes carry the same bytes. The seed stays standard base64 (SigningKey.EncodeSeed).
    • Install reads it in the preflight and again right before its writes. If that read fails, or the value appeared, disappeared or changed in between, install leaves the secret and the variable alone and fails that repository. Otherwise install deletes the variable, writes the seed and sets the variable again, each step only after the one before it succeeds. So when the variable exists, it names the last seed that install confirmed, and an interrupted write leaves it absent. The variable ships in the same PR as the first seed write.
    • For keys that install generates, the install is healthy when the secret exists and the variable names the entry's active key. If the variable is absent or names a retained key, the secret may not hold the active key. Install writes a new key and retains the old one, unless the variable names a retained key and the committed config does not list the active key, or neither the variable nor the secret exists and the committed config has no block of this installation: then the secret does not hold the old one, and install replaces it. From a read-only repos.yaml it fails that repository. Keys supplied through install flags come in a later PR, which defines how install records them.
    • A value on an entry without trace_context, or a key ID the entry does not list, usually means the last install wrote a different repos.yaml. Install writes nothing for that repository and fails it; the other repositories still converge. A value that is not 16 lowercase hex characters fails the repository with an error that says to delete the variable.
    • repos uninstall deletes it with the secret, and repos status counts it as managed. Nothing at run time uses it.
    • GitHub installs take no lease, so the re-read misses an install or uninstall that writes after it. Two overlapping installs can leave the secret holding a key the variable does not name, which install cannot see. Run one at a time.
    • GitLab support comes in a later PR, which settles how GitLab records the key ID. Until then, install writes no key and no variable on GitLab.

    Why not layered config

    Install writes the new public key to repos.yaml before the seed write. .fullsend/config.yaml changes only when the install commit lands, by default through a pull request. So config says which key should sign, not which key the secret holds. A field in repos.yaml would also live in one operator's copy, while the variable sits beside the secret, where every install reads it. Without the variable, a retry after an interrupted rotation would call the install healthy while the secret holds a retained key. Removing that key later would leave every envelope the secret signs unverifiable.

    Also not taken: per-key secret names, since fullsend run, fullsend lint and the GitLab jobs' unset line reserve one fixed name.

  8. added 5 commits that reference this issue on Nov 17, 2026
  9. dhshah13 commented on Nov 17, 2026

    @dhshah13
    Contributor

    Updated the FULLSEND_TRACE_SIGNING_KEY_ID note above after the #9477 review: recovery replaces a key the secret can't hold instead of retaining it, and a refusal fails only that repository. Open item for delivering the key to runs: on an existing install, repos install writes the new seed before the commit that adds its public key to .fullsend/config.yaml is on the default branch, by default until the install pull request merges, so verifying an envelope signed in that window against the default branch gives unknown-key. Install can't publish the key first and switch later: the seed exists only in the run that generates it, the secret can't be read back, and v1 has one secret name.

  10. added 3 commits that reference this issue on Nov 17, 2026
  11. dhshah13 commented on Nov 18, 2026

    @dhshah13
    Contributor

    GitLab key ID: the FULLSEND_TRACE_SIGNING_KEY description

    On GitLab the API returns a CI/CD variable's description even when it hides the value. So install records the key ID in the seed variable's description and writes no FULLSEND_TRACE_SIGNING_KEY_ID. It writes keys when it would on GitHub.

    • The description is the key ID (tracecontext.FormatKeyID), written with the seed in one request. Install creates the variable protected, masked and hidden.
    • Proposal: install scopes the variable to the environment fullsend-trace-signing, which every GitLab tier supports, instead of *, so only jobs that declare that environment receive it. No fullsend GitLab job in any release so far declares an environment, so no fullsend job receives the seed until delivery to runs declares this one; any other job would have to declare that environment and run on a protected branch or tag. At *, every job on a protected branch or tag would receive it, including fullsend's jobs from releases before v0.56.0, which do not unset it. It would be the one fullsend-managed GitLab variable outside *, an exception to the documented rule that fullsend reads, updates and deletes only *. The action: access and * copy points below depend on this proposal.
    • Delivery to runs would declare the environment only on the jobs that sign, with action: access, which GitLab documents as receiving environment-scoped variables without creating a deployment. GitLab creates the environment on the first such pipeline.
    • Install takes the FULLSEND_GITLAB_INSTALL_LEASE project lease and re-reads the variable. If the read fails, or the variable appeared, disappeared or changed its description since the preflight, the repository fails with no key written. Otherwise install writes the seed, checks the returned description and releases the lease. Any failure stops the repository before its commit.
    • Healthy means the description names the entry's active key and no FULLSEND_TRACE_SIGNING_KEY exists at scope *. For an entry with keys, when the variable is missing, its description is empty or names a retained key, or a * copy exists, the next plain run writes a new key as on GitHub. An existing install whose entry has no keys gets its first key only from --rotate-trace-signing-key, as on GitHub. Install has never keyed a GitLab repository, so that covers every existing GitLab install except one whose entry declares trace_context by hand, which gets a new key on its first plain run as a recovery. A description naming a key the entry does not list fails the repository as stale.
    • A description that is set but is not 16 lowercase hex characters fails the repository with no writes. The error says to clear the description or delete FULLSEND_TRACE_SIGNING_KEY itself; after either, the next plain run writes a new key.
    • A * copy can only come from a hand edit or an unreleased build. GitLab passes it to every job on a protected branch or tag, or to every job if it is not protected. A run that writes a key deletes the copy under the lease, names it in its output, and replaces the previous active key instead of retaining it, since the copy may hold its seed and no GitLab job signs yet.
    • A write changes the seed and its description together or not at all. GitLab's code does this, lets an update change a hidden value and keeps that value out of the API, but its docs promise none of it. If a write lands but its response is lost, the next run is healthy, and a retry from an older repos.yaml is refused as stale.
    • Every run that writes or deletes the seed holds the lease, so the re-read catches overlapping runs.
    • repos uninstall deletes the variable and any * copy; repos status counts the name as managed. GitLab uninstall also removes .fullsend/config.yaml, through a merge request unless --direct is set. Before that removal lands, the next install retains the old active key as on GitHub. Once it lands after --uninstall-only, nothing committed shows that the key's seed was written, so unlike GitHub the next install replaces it, and an older repos.yaml is no longer refused. No job signs with a GitLab key before delivery to runs, so no signed metadata depends on it yet; delivery to runs revisits this.
    • The description needs GitLab 16.2. In GitLab's code, older versions ignore it, so the first write stores the seed alone and fails, naming 16.2; later runs see no description field and skip keys with a notice. Hidden needs 17.4 and is set only on create, so a seed made without it stays readable by Maintainers through the API until deleted.

    Why not FULLSEND_TRACE_SIGNING_KEY_ID

    A second variable brings GitHub's gaps: install deletes it before the seed write, so after a failure it is absent, retries add retained keys, and an older repos.yaml can drop a key that landed.

  12. dhshah13 commented on Nov 18, 2026

    @dhshah13
    Contributor

    Correction to the GitLab note above: a run that finds a * copy keeps the previous active key as retained, as on GitHub, instead of replacing it. Replacing it would drop a key the committed .fullsend/config.yaml still lists. Every later run would then refuse the repository as stale until the install merge request merged, and a run that failed before its commit would stay refused. No job signs with a GitLab key yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretriaged

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions