Skip to content

Persist span-level G1 labels on the native snapshot (queryable localization) #469

Description

@caohy1988

Parent: #435 (AgentForensics RFC — automated failure taxonomy and span-level trace auditing). This is the next engineering slice after span-level G1 localization #466 (PR #467 library + PR #468 presenter e2e), and the native-writer analog of #463: publish already-landed localization as pinned snapshot rows.

Sequencing

The gap

Phase 2 localization currently exists as a library, not as snapshot data. #467 already emits the RFC shape (trace_id, span_id, failure_category, evidence, confidence) for the widget-stock silence session — inspectable in Python tests and a --fixture presenter, but not part of the BQAA-owned snapshot contract. Session-level G1 is queryable via failed_sessions; span labels are not.

Do not reimplement span_taxonomy or invent a new taxonomy or a second localizer. The missing piece is publication: NativeAgentEventsRun.materialize (or a thin sibling that inherits it) should write a BQAA-owned span-labels table keyed by the frozen pin (job_id, import_version), joinable to failed_sessions via the frozen eval_id rule.

Session-level failed_sessions + G1 remains the denominator. Span rows localize; they never classify or replace it.

Goal

On a native snapshot of the widget-stock session 7e352c34 (full id 7e352c34-4c1c-4395-acd5-fb3c8f215346), the published span-labels rows make the AGENT_STARTING silence inspectable as data:

  • real span_id b7ad6b7169203331, target_kind="gap_after_span";
  • the frozen categories task/planning, finalization, tool blockers;
  • evidence that no subsequent TOOL_STARTING / check_inventory / AGENT_COMPLETED occurred.

Source of truth is production ADK agent_events (native path). The EvalBench adapter (#97, evalbench-import) stays optional; this slice must not require EvalBench source configs / results / scores.

Reuse label_native_run with the frozen EvalScorePolicy({"goal_completion": 1.0}) — per the #468 P1 finding, the default empty policy drops task/planning.

Acceptance (widget-stock, fixture-testable, no live BigQuery)

  • Session-level G1 for 7e352c34 still yields task/planning, finalization, tool blockers — unchanged.
  • Published span-label rows for that session are exactly the three library rows (same span/trace ids, categories, gap_after_span, evidence strings) and carry (job_id, import_version) with job_id=mvp-e2e-real-traces.
  • Identity: eval_id = session_id[:8] when unique in the snapshot / join set; full session_id on first-8 collision. Span rows must stay joinable to the same eval_id that failed_sessions / G1 already uses.
  • No synthetic span identifiers. Rows without a real span_id fail closed.
  • Frozen G1 names only (v0.1.0). No SANA fork, no new category strings. If a test proves a span cannot be labeled with the frozen three, preserve the failing case and defer the taxonomy change to a separate issue.
  • Offline unit tests only: no live BigQuery, no --synth, no live/LLM judge, no production agent_events writes.
  • Prefer inheriting EvalBenchRun.materialize / NativeAgentEventsRun rather than a parallel publisher. A thin CLI extension of evalbench-native-import is allowed; do not invent a new command family.

Guardrails

Out of scope

Related

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions