Skip to content

#877 phase 2b: org-kind gold set, definitions carry the class rulings, eval-set/score - #904

Merged
gregoryfoster merged 6 commits into
mainfrom
feat/877-gold-set
Nov 27, 2026
Merged

gregoryfoster merged 6 commits into
mainfrom
feat/877-gold-set

Conversation

@gregoryfoster

@gregoryfoster gregoryfoster commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

#877 phase 2b: the org-kind gold set and its score. Jev stays off.

What lands

  • docs/research/org-kind/gold.csv: 293 org_id,kind labels (no names), plus a README on the method. The labels were drafted before any Jev call and reviewed by the operator (35 flagged + 30 random).

  • org_kinds definitions (seed, reconciled in place by the existing upsert) now carry the operator's class rulings:

    • association includes members that are governments or their officials;

    • a legislative task force or work group is a legislature;

    • a federation of unions is a labor_union;

    • city and county councils stay government.

    • an org that exists for another purpose and also registers as a political committee takes that purpose's kind (campaign_committee).

    Jev reads these definitions, so the gold set scores the question production asks. The flag must not turn on before this deploys.

  • scripts/org_kind_gold.py subcommands:

    • finalize: worksheet + review → gold.csv;
    • eval-set: builds the typesafe-eval.py JSONL through production's question builder. It writes outside every work tree only, and --kinds-dsn-env reads the definitions from another DB;
    • score: per-kind precision at 0.7, the rules' agreement, the confusion matrix and the trust set. Aggregates only.
  • Rules: rules-2. org_wa_pdc_committee → campaign_committee is retired: a committee filer ID doesn't prove a campaign committee (the gold set holds a trade association that registered as one). The rule list moves to a temp table that both sets and clears, so the change reconciles on an existing DB. After deploy, the drain supersedes the stale answers (3 orgs in production, none decided) with none.

  • Plan revisions, the design D1/D4 text and docs/SCHEMA.md, updated to match.

Score (jev-1.14.0, valid harness run on the final definitions, 260k input tokens): the top choice matched the gold label on 275/293; at ≥ 0.7, 251/254 answers were right, with 87% coverage. Proposed trust set: association, business, government, legislature. Rules under rules-2: 46/46. The full aggregates are on #877.

Tests: tests/scripts/test_org_kind_gold.py, 24 unit tests (the committed set is ids and kinds only; the report names no org; the definitions carry the rulings) and 5 integration tests (eval_cases asks exactly what jev_client.build_request sends). Also tests/core/test_classification.py: a retired rule supersedes its answer under rules-2. Targeted integration run (classification, schema, drain, gold): 92 passed, with apply-schema --test.

TDD: each feature commit holds its tests; the red runs came before the implementation in this session (missing attributes; the old definition text).

Refs #877

🤖 Generated with Claude Code

gregoryfoster and others added 5 commits November 27, 2026 05:46
…private worksheets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The private-path guard accepts a path git ignores; .gitignore ignores
data/gold-877/ so the worksheets (org names) can never be committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling 1: an association's members may be governments. Ruling 2: a
legislative task force is a legislature. Ruling 3: a federation of unions
is a labor_union. City and county councils stay government.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… against it

docs/research/org-kind/gold.csv: 293 org_id,kind labels, drafted before any
Jev call, reviewed by the operator (35 flagged + 30 random), class rulings
written into the definitions. finalize writes it; eval-set builds the
typesafe-eval.py set through production's question builder, outside every
work tree; score prints per-kind precision at the threshold, the rules'
agreement, the confusion and the proposed trust set: aggregates only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ulings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e says other-purpose orgs keep their kind

A PDC campaign-finance committee filer ID doesn't prove a campaign committee:
the gold set holds a trade association that registered as one. The rule list
moves to a temp table that both sets and clears, so the retirement reconciles
on an existing DB, and the drain supersedes each stale answer with none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregoryfoster
gregoryfoster merged commit db752f9 into main Nov 27, 2026
1 check passed
@gregoryfoster
gregoryfoster deleted the feat/877-gold-set branch November 27, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant