Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

chore(taxonomy): per-org taxonomy refresh + backup/delete ops tooling

merged#2505CedarCopilot

CedarCopilot wants to merge 0 commits into staging from chore/taxonomy-refresh-ops-tooling

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

    Live on prod, no production signal yet

    Aug 18, 2026, 8:16 PM

Behaviors Libra is checking

Operators can back up an organization’s taxonomy extraction rows and, only with explicit commit, delete just canonical or supplied legacy taxonomy field values while leaving CRM/scalar values untouched.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/backup-delete-extractions.ts --commit since deploy.

prod, checked Aug 18, 2026, 5:50 PM
By default, taxonomy extraction cleanup writes a backup but performs no deletion until an operator supplies `--commit`.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/backup-delete-extractions.ts since deploy.

prod, checked Aug 18, 2026, 5:51 PM
Operators can create a read-only, full restore-point backup of each target organization’s Deals field definitions before taxonomy changes, with taxonomy-versus-CRM inventory and customer-vocabulary reporting.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/backup-org-taxonomy.ts since deploy.

prod, checked Aug 18, 2026, 6:16 PM
Operators can preview a per-organization taxonomy refresh, including additions, removals, preserved vocabulary, and CRM safety validation, without writing to the database.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/refresh-org-taxonomy.ts --dry-run since deploy.

prod, checked Aug 18, 2026, 6:16 PM
Operators can refresh one organization’s Deals taxonomy to the current canonical field structure while preserving all CRM fields byte-for-byte and retaining customer-authored vocabulary unless explicitly reset.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/refresh-org-taxonomy.ts since deploy.

prod, checked Aug 18, 2026, 7:16 PM
A taxonomy refresh removes obsolete organization-specific background taxonomy fields while keeping canonical taxonomy fields and non-background CRM fields.Inconclusivelow confidence

OTEL fallback found no prod spans matching scripts/taxonomy-ops/refresh-org-taxonomy.ts since deploy.

prod, checked Aug 18, 2026, 7:17 PM

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

What

The reusable scripts used to bring Pirros / Aspire / Vooma onto the current DealsOrgFieldDefaults taxonomy (with their personalized vocab) ahead of re-extraction. Prod-connecting, guarded, dry-runnable.

Tools

  • refresh-org-taxonomy.ts , vocab-preserving taxonomy refresh. CRM (background:false) fields kept verbatim behind a byte-identical guard (refuses to write if they'd change); canonical fields set to the new structure with customer-authored options preserved (--seed to add, --reset to force a key to default); legacy background fields dropped by omission. --dry-run first.
  • backup-org-taxonomy.ts , read-only field-def + seeded-vocab snapshot (restore point).
  • backup-delete-extractions.ts , backs up (JSONL) then scoped-deletes old taxonomy extractions (field_id IN 29 canonical + org legacy); never touches CRM/scalar values; --commit-gated.
  • pirros-vocab-seed.json / vooma-vocab-seed.json , the vocab seeded per org (from their vocab docs). Aspire needed none , its DB vocab was preserved in place.
  • .gitignore , excludes the local backup artifacts (large JSONL row dumps stay local).

Applied result (already run + verified on prod)

  • All three orgs now on the 29-field taxonomy.
  • Aspire: 6 vocab sets preserved (persona 19, theme 12, angle 9, competitor 9, win_loss 7, use_case 6); value_driver reset to default.
  • Pirros: fresh vocab seeded (10 fields incl. 4 demo archetypes); 6 legacy fields dropped.
  • Vooma: greenfield , full canonical + fresh vocab (incl. roi_pricing call type).
  • CRM fields byte-identical on all three (50 / 46 / 7 preserved).
  • Old taxonomy extractions cleared after backup (Pirros 35,532 / Aspire 10,184; 0 remain); CRM/orphan values intact.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Tggg2sBmoV3cCZGMvpsdX

Greptile Summary

The PR adds production-oriented tooling to back up, refresh, and remove organization taxonomy data while preserving customer vocabulary and CRM definitions.

  • Adds a canonical taxonomy refresh command with optional vocabulary seeding and reset controls.
  • Adds taxonomy and extraction backup tooling plus a commit-gated extraction deletion command.
  • Adds Pirros and Vooma vocabulary seeds and ignores locally generated restore artifacts.

Confidence Score: 2/5

The PR should not merge until the destructive delete scope and backup race are fixed and reset reliably takes precedence over seeded vocabulary.

The delete command can include arbitrary non-taxonomy field IDs and can delete rows inserted after its backup snapshot, while the refresh command silently reapplies seed values to fields explicitly requested for reset.

Files Needing Attention: apps/server/scripts/backup-delete-extractions.ts, apps/server/scripts/refresh-org-taxonomy.ts

Important Files Changed

FilenameOverview
apps/server/scripts/backup-delete-extractions.tsAdds commit-gated backup and deletion, but does not validate operator-supplied legacy IDs and does not make backup and deletion atomic.
apps/server/scripts/refresh-org-taxonomy.tsRebuilds canonical definitions while preserving CRM fields and customer vocabulary, but seed application overrides reset semantics.
apps/server/scripts/backup-org-taxonomy.tsExpands the read-only organization backup report with canonical, legacy-background, CRM, and customer-vocabulary summaries.
apps/server/scripts/run-backup-delete-extractions.mjsBuilds and invokes the delete utility while forwarding arguments unchanged.
apps/server/scripts/run-refresh-org-taxonomy.mjsBuilds and invokes the refresh utility while forwarding seed and reset options unchanged.
apps/server/scripts/pirros-vocab-seed.jsonDefines organization-specific customer vocabulary for Pirros.
apps/server/scripts/vooma-vocab-seed.
Show production surfaces and changed-file mapping

Production surfaces

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

Changed files → surfaces

  • .gitignoreno production surface mapped
  • apps/server/scripts/backup-org-taxonomy.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/backup-delete-extractions.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/backup-org-taxonomy.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/refresh-org-taxonomy.tsno production surface mapped
  • apps/server/scripts/taxonomy-ops/run-backup-delete-extractions.mjsno production surface mapped
  • apps/server/scripts/taxonomy-ops/run-backup-org-taxonomy.mjsno production surface mapped
  • apps/server/scripts/taxonomy-ops/run-refresh-org-taxonomy.mjsno production surface mapped
  • docs/audits/pirros/pirros-vocab-seed.jsonno production surface mapped
  • docs/audits/vooma/vooma-vocab-seed.jsonno production surface mapped