Skip to content

Outcome capture: emit accept/reject/edit-after-accept signals with gateway correlation id #431

Done

Description

@dahai80

Context

fusion#17 flywheel: the moat data is outcome labels, and they are only observable at the editor surface. This issue adds the outcome layer; fusion-gateway carries the correlation layer.

Scope

  1. On each applied AI edit (diff accepted / rejected / reverted / edited-after-accept within session), emit a structured outcome event: task/session id, edit id, outcome class, latency-from-proposal, gateway correlation id header passed through to :11432 calls.
  2. Local-first storage (same store conventions as existing session logs); redaction applies as with all written output.
  3. Consent gate: outcome capture inherits the tenant opt-in flag from fusion-gateway issue (single switch, default OFF). No capture without explicit opt-in.
  4. Export hook: weekly local job hand outcome rows + correlation ids to the fusion-bench mining consumer (same read contract as gateway metadata).

Acceptance

  • Simulated session produces correct event classes for accept / reject / revert / edit-after-accept.
  • With opt-in off: zero events written.
  • Correlation id round-trip verified end-to-end with gateway metadata row (integration test).
  • No prompt/completion content in outcome events.

Refs fusion#17 (flywheel outcome layer, 2026-12-01).

Activity

  1. dahai80 commented on Dec 1, 2026

    @dahai80
    OwnerAuthor

    Triage: roadmap item, not a quick patch. The fusion-code side (outcome event emission on applied-edit accept/reject/revert/edit-after-accept, local-first storage, consent gate, weekly export hook) is implementable here, but acceptance requires the gateway correlation id round-trip (fusion-gateway side, refs fusion#17) — cross-repo dependency per repo rules. Sequencing after the gateway correlation id issue lands. Leaving open as roadmap.

  2. dahai80 commented on Dec 1, 2026

    @dahai80
    OwnerAuthor

    Acceptance PASS (independently verified: PR #434 merged, 4 outcome classes present, strict default-off env gate, correlation id capture via x-fusion-correlation-id, schema-fixed events with no prompt/completion content, tsc clean, outcome tests 9/9).

    Follow-up note (P3, not blocking): issue text specified consent inheriting the gateway tenant-level opt-in switch (gw#755); implementation ships a machine-level env gate (FUSION_CODE_OUTCOME_CAPTURE). Acceptable for local-first v1; ai-* multi-tenant deployments need the tenant-level switch unified with gateway config once tenant config lands.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions