Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(taxonomy-eval): cut extraction volume/tokens + fix CRM-leak and linking

merged#2508CedarCopilot

CedarCopilot wants to merge 0 commits into staging from fix/taxonomy-extraction-perf-linking

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 16, 2026, 4:40 AM
  2. Merged
    Aug 16, 2026, 3:51 PM
  3. Live on prod
    Aug 16, 2026, 3:51 PM
  4. Observed 2 days
    Aug 16, 2026, 3:51 PM
  5. Pipelines steady after this deploy
    Aug 16, 2026, 3:51 PM
  6. Unobserved

    Live on prod, no production signal yet

    Aug 18, 2026, 11:16 PM

Behaviors Libra is checking

Taxonomy evaluation no longer leaks CRM-oriented fields or values into unrelated extracted taxonomy records.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy extraction workflow since deploy.

prod, checked Aug 18, 2026, 8:17 PM
Extracted callbacks, pain bridges, recap coverage, and objection responses resolve local and prior-call references to the correct field-value records.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy extraction link resolver since deploy.

prod, checked Aug 18, 2026, 9:15 PM
Customer-specific topics, objection themes, competitor categories, pitch angles, and proposed vocabulary are kept distinct from universal vocabularies and can be reconciled into canonical options.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy vocabulary canonicalization since deploy.

prod, checked Aug 18, 2026, 9:15 PM
Taxonomy evaluation extraction processes a smaller, higher-signal set of conversation moments to reduce model-token consumption and extraction volume.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy extraction workflow since deploy.

prod, checked Aug 18, 2026, 10:15 PM
The evaluator captures rep urgency creation, rapport building, pain mirroring/recaps, and value-add offers as distinct coaching behaviors.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy extraction workflow since deploy.

prod, checked Aug 18, 2026, 10:15 PM
The evaluator captures and classifies rep questions, prospect questions, live demo features, objections, next steps, competitors, pricing, and product pitches with structured metadata.Inconclusivelow confidence

OTEL fallback found no prod spans matching taxonomy extraction workflow since deploy.

prod, checked Aug 18, 2026, 11:16 PM

Libra has verdicts on 0 of 6 tracked behaviors on prod; 6 are still being checked. Libra checks hourly for 3 days after each deploy.

Bundles the extraction perf work + the linking-audit fixes into one PR.

Volume / cost

  • prospect.question signal-gated , capture only when it reveals a need, carries an objection/hesitation, probes the buying process, or triggers a demo. It was 25% of all rows and the driver of the group-demo output-cap blowout.
  • Slim vs full envelope , count-and-classify fields (prospect.question, next_step.set, stakeholder.engaged, tactic.*, prospect.call_ran_over) emit only content+payload+persona+ids (null summary/responseSpan/strength/completeness). Measured: prospect.question −43%/moment. Enforced defensively in assemble_sonnet.py.
  • Per-plane defs , gen-field-defs emits <stem>.instance.ts (instance + call-level) and <stem>.judgment.ts (versioned); each agent reads only its plane. Judgment 115KB→27KB (−77%), instance →90KB (−22%). Net def-read load per 3-meeting deal ~196k→~72k tokens.
  • Classify merged into instance , the call is classified (call_type/demo_story_type) first in the same transcript read; the separate classify fan-out is gone (one fewer agent + one fewer transcript read per meeting).
  • Output-cap retry , a failed instance agent retries once with a stricter signal budget (Sonnet's 64k output is a hard model ceiling, not a raisable env), so a dense call isn't silently lost.

CRM-leak fix (was missing on this branch , overlaps open #2506)

gen-field-defs now filters background:true first, so an org's live CRM list/text fields (50 for Pirros) no longer leak into the extraction planes , Pirros went from a wrong 29 instance + 16 versioned back to the canonical 18 + 8. Without this we'd extract transcript values into live CRM fields. Vocab guardrail + multi-select sidecar scoped to the taxonomy plane too. Note: this duplicates #2506's fix , recommend closing #2506 or merging this and rebasing.

Linking correctness (from the linking audit)

  • SEV-1a , pointer refs are the target atom's local_id / prior base#local id, not a "verbatim span" (the resolver drops span refs as danglers). Fixed in the extract prompt and the 5 shipped field defs (responds_to, callback_to, tie_back×2, pains_covered).
  • SEV-1b , links are driven by the relationship, with the companion label (flow=callback / narrative_type⊇pain_bridge / mode=recap) set to agree , no longer "set ONLY when <label>", which suppressed recall (0 of 52 links in the dry run). Added a dedicated linking pass.
  • SEV-2a , write-agentic builds cross-call priorCandidates from the DB (the deal's prior meetings' pain/use_case/rep.question atoms) and event-scopes the delete, so cross-call refs resolve on partial/incremental runs instead of dangling. Full-run behavior is byte-identical.

Safety / tests

  • Field-def changes are description-only (field set/order unchanged). Equivalence content hash re-pinned; defaults-equivalence + link-resolver tests green (12/12). eval-new-fields.ts regenerated.
  • Typecheck clean on all touched files (pre-existing errors elsewhere untouched).
  • All DB writes remain behind write-agentic's DRY_RUN gate , recommend a --dry-run pass before the next real write to confirm cross-call priorCandidates resolution.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Tggg2sBmoV3cCZGMvpsdX

Greptile Summary

The PR reduces taxonomy-evaluation token volume, splits generated definitions by extraction plane, merges call classification into instance extraction, and improves cross-call pointer resolution. It also changes incremental write replacement and retry behavior, where two correctness issues remain.

  • Signal-gates and slims high-volume instance fields.
  • Generates dedicated instance and judgment definition modules.
  • Retries failed instance extraction once under a stricter output budget.
  • Filt
Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/server/scripts/eval-new-fields.instance.tsno production surface mapped
  • apps/server/scripts/eval-new-fields.judgment.tsno production surface mapped
  • apps/server/scripts/eval-new-fields.tsno production surface mapped
  • apps/server/scripts/taxonomy-eval/README.mdno production surface mapped
  • apps/server/scripts/taxonomy-eval/agent_extract_prompt.mdno production surface mapped
  • apps/server/scripts/taxonomy-eval/assemble_sonnet.pyno production surface mapped
  • apps/server/scripts/taxonomy-eval/canonicalize-proposals.mjsno production surface mapped
  • apps/server/scripts/taxonomy-eval/chunk-manifest.mjsno production surface mapped
  • apps/server/scripts/taxonomy-eval/display_buckets.pyno production surface mapped
  • apps/server/scripts/taxonomy-eval/extract-workflow.jsno production surface mapped
  • apps/server/scripts/taxonomy-eval/field-defs-meta.jsonno production surface mapped
  • apps/server/scripts/taxonomy-eval/filter-first-n.mjsno production surface mapped
  • apps/server/scripts/taxonomy-eval/gen-field-defs.tsno production surface mapped
  • apps/server/scripts/taxonomy-eval/write-remap.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/apply-org-vocab-glosses.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/run-apply-org-vocab-glosses.mjsno production surface mapped
  • apps/server/scripts/write-agentic.tsno production surface mapped
  • apps/server/src/services/field-values/__tests__/defaults-equivalence.test.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/call-level.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/discovery.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/product.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/qualification.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/tactics.tsno production surface mapped
  • apps/server/src/services/field-values/defaults/voice.tsno production surface mapped
  • docs/audits/aspire/RETRIEVAL.mdno production surface mapped
  • docs/audits/aspire/aspire-customer-vocab.mdno production surface mapped
  • docs/audits/aspire/aspire-questions-for-anand.htmlno production surface mapped
  • docs/audits/pirros/RETRIEVAL.mdno production surface mapped
  • docs/audits/pirros/pirros-customer-vocab.mdno production surface mapped
  • docs/audits/pirros/pirros-questions-for-peter.htmlno production surface mapped
  • docs/audits/taxonomy-extraction-run-plan-2026-08-16.mdno production surface mapped
  • docs/audits/vooma/RETRIEVAL.mdno production surface mapped
  • docs/audits/vooma/vooma-2026-08-14-requirements.mdno production surface mapped
  • docs/audits/vooma/vooma-crm-compatibility-preflight.mdno production surface mapped
  • docs/audits/vooma/vooma-customer-vocab.mdno production surface mapped
  • docs/audits/vooma/vooma-dropped-meeting-recovery.mdno production surface mapped
  • docs/audits/vooma/vooma-questions-for-tenzin.htmlno production surface mapped
  • docs/audits/vooma/vooma-stage-criteria-for-approval.mdno production surface mapped