@marinoscar/kvox-eval 0.0.0-bootstrap → 0.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/ask/index.d.ts +6 -0
- package/dist/ask/index.js +28 -0
- package/dist/ask/question-schema.d.ts +121 -0
- package/dist/ask/question-schema.js +167 -0
- package/dist/ask/report.d.ts +88 -0
- package/dist/ask/report.js +170 -0
- package/dist/ask/scorer.d.ts +104 -0
- package/dist/ask/scorer.js +164 -0
- package/dist/ask-run/ask-command.d.ts +62 -0
- package/dist/ask-run/ask-command.js +254 -0
- package/dist/ask-run/host/app.d.ts +65 -0
- package/dist/ask-run/host/app.js +146 -0
- package/dist/ask-run/host/db.d.ts +38 -0
- package/dist/ask-run/host/db.js +126 -0
- package/dist/ask-run/host/ports.d.ts +35 -0
- package/dist/ask-run/host/ports.js +113 -0
- package/dist/ask-run/index.d.ts +13 -0
- package/dist/ask-run/index.js +35 -0
- package/dist/ask-run/replay.d.ts +128 -0
- package/dist/ask-run/replay.js +212 -0
- package/dist/ask-run/run-ask-eval.d.ts +125 -0
- package/dist/ask-run/run-ask-eval.js +193 -0
- package/dist/ask-run/seed-golden-graph.d.ts +64 -0
- package/dist/ask-run/seed-golden-graph.js +495 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/kg-command.d.ts +66 -0
- package/dist/cli/kg-command.js +238 -0
- package/dist/cli/main.d.ts +18 -0
- package/dist/cli/main.js +69 -0
- package/dist/fixtures/domains.d.ts +16 -0
- package/dist/fixtures/domains.js +33 -0
- package/dist/fixtures/fixture-schema.d.ts +323 -0
- package/dist/fixtures/fixture-schema.js +199 -0
- package/dist/fixtures/index.d.ts +16 -0
- package/dist/fixtures/index.js +40 -0
- package/dist/fixtures/load.d.ts +73 -0
- package/dist/fixtures/load.js +137 -0
- package/dist/fixtures/questions.d.ts +15 -0
- package/dist/fixtures/questions.js +26 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +36 -0
- package/dist/kg/gold-runner.d.ts +13 -0
- package/dist/kg/gold-runner.js +57 -0
- package/dist/kg/index.d.ts +17 -0
- package/dist/kg/index.js +65 -0
- package/dist/kg/internals.d.ts +7 -0
- package/dist/kg/internals.js +17 -0
- package/dist/kg/prediction-schema.d.ts +245 -0
- package/dist/kg/prediction-schema.js +102 -0
- package/dist/kg/predictions.d.ts +11 -0
- package/dist/kg/predictions.js +49 -0
- package/dist/kg/report.d.ts +84 -0
- package/dist/kg/report.js +125 -0
- package/dist/kg/run-kg-eval.d.ts +77 -0
- package/dist/kg/run-kg-eval.js +137 -0
- package/dist/kg/runner.d.ts +72 -0
- package/dist/kg/runner.js +51 -0
- package/dist/kg/runners/extract-resolve-runner.d.ts +40 -0
- package/dist/kg/runners/extract-resolve-runner.js +199 -0
- package/dist/kg/runners/extract-runner.d.ts +65 -0
- package/dist/kg/runners/extract-runner.js +243 -0
- package/dist/kg/scorer.d.ts +226 -0
- package/dist/kg/scorer.js +463 -0
- package/dist/kg/targets.d.ts +17 -0
- package/dist/kg/targets.js +16 -0
- package/dist/kg/text.d.ts +45 -0
- package/dist/kg/text.js +100 -0
- package/dist/live/adapters.d.ts +16 -0
- package/dist/live/adapters.js +58 -0
- package/dist/live/env.d.ts +39 -0
- package/dist/live/env.js +56 -0
- package/dist/live/index.d.ts +6 -0
- package/dist/live/index.js +16 -0
- package/dist/live/live-ai.d.ts +104 -0
- package/dist/live/live-ai.js +157 -0
- package/dist/parity/constants.d.ts +79 -0
- package/dist/parity/constants.js +104 -0
- package/dist/parity/index.d.ts +20 -0
- package/dist/parity/index.js +38 -0
- package/dist/parity/internals.d.ts +8 -0
- package/dist/parity/internals.js +16 -0
- package/dist/parity/scenario.d.ts +45 -0
- package/dist/parity/scenario.js +245 -0
- package/dist/parity/script.d.ts +44 -0
- package/dist/parity/script.js +136 -0
- package/dist/parity/snapshot.d.ts +43 -0
- package/dist/parity/snapshot.js +71 -0
- package/dist/real-data/index.d.ts +2 -0
- package/dist/real-data/index.js +12 -0
- package/dist/real-data/real-data.d.ts +76 -0
- package/dist/real-data/real-data.js +156 -0
- package/fixtures/kg-golden/README.md +136 -0
- package/fixtures/kg-golden/ask-questions.json +458 -0
- package/fixtures/kg-golden/meetings/m01-northwind-pilot-kickoff.json +792 -0
- package/fixtures/kg-golden/meetings/m02-halden-migration-planning.json +814 -0
- package/fixtures/kg-golden/meetings/m03-larkspur-weekly-sync.json +601 -0
- package/fixtures/kg-golden/meetings/m04-corvid-intake-discovery.json +690 -0
- package/fixtures/kg-golden/meetings/m05-hosting-vendor-selection.json +631 -0
- package/fixtures/kg-golden/meetings/m06-northwind-floor-data-review.json +649 -0
- package/fixtures/kg-golden/meetings/m07-gullwing-intro-notes.json +428 -0
- package/fixtures/kg-golden/meetings/m08-halden-migration-checkpoint.json +672 -0
- package/fixtures/kg-golden/meetings/m09-northwind-platform-org-update.json +711 -0
- package/fixtures/kg-golden/meetings/m10-corvid-prototype-review.json +623 -0
- package/fixtures/kg-golden/meetings/m11-solvane-grid-dashboard-scoping.json +689 -0
- package/fixtures/kg-golden/meetings/m12-northwind-pilot-replan.json +681 -0
- package/fixtures/kg-golden/meetings/m13-halden-cutover-go-no-go.json +721 -0
- package/fixtures/kg-golden/meetings/m14-gullwing-discovery-readout.json +719 -0
- package/fixtures/kg-golden/meetings/m15-halden-handover-ravi-leaving.json +716 -0
- package/fixtures/kg-golden/meetings/m16-varden-claims-portal-intro.json +704 -0
- package/fixtures/kg-golden/meetings/m17-corvid-usability-debrief.json +572 -0
- package/fixtures/kg-golden/meetings/m18-hosting-decision-revisited.json +655 -0
- package/fixtures/kg-golden/meetings/m19-solvane-integration-kickoff.json +726 -0
- package/fixtures/kg-golden/meetings/m20-northwind-go-live-retro.json +673 -0
- package/fixtures/kg-golden/meetings/m21-quarterly-account-review.json +449 -0
- package/fixtures/kg-golden/meetings/m22-halden-intro-call-2020.json +558 -0
- package/fixtures/kg-golden/meetings/m23-gullwing-model-review.json +702 -0
- package/fixtures/kg-golden/meetings/m24-varden-discovery-midpoint.json +643 -0
- package/fixtures/kg-golden/meetings/m25-corvid-rollout-planning.json +642 -0
- package/fixtures/kg-golden/meetings/m26-larkspur-engineering-prep.json +695 -0
- package/fixtures/kg-golden/meetings/m27-solvane-phase-one-demo.json +649 -0
- package/fixtures/kg-golden/meetings/m28-northwind-building-5-scoping.json +715 -0
- package/fixtures/kg-golden/meetings/m29-halden-southern-cutover-review.json +752 -0
- package/fixtures/kg-golden/meetings/m30-varden-portal-build-kickoff.json +697 -0
- package/fixtures/kg-golden/meetings/m31-gullwing-rollout-renewal.json +681 -0
- package/fixtures/kg-golden/meetings/m32-brambleway-weekly-sync.json +472 -0
- package/fixtures/kg-golden/meetings/m33-nina-oliver-one-on-one.json +342 -0
- package/fixtures/kg-golden/meetings/m34-coffee-with-dana.json +249 -0
- package/fixtures/kg-golden/meetings/m35-brambleway-june-sync.json +553 -0
- package/fixtures/kg-golden/meetings/m36-copenhagen-conference-planning.json +296 -0
- package/host/generated/client.d.ts +1 -0
- package/host/generated/client.js +5 -0
- package/host/generated/default.d.ts +1 -0
- package/host/generated/default.js +5 -0
- package/host/generated/edge.d.ts +1 -0
- package/host/generated/edge.js +1658 -0
- package/host/generated/index-browser.js +1684 -0
- package/host/generated/index.d.ts +192335 -0
- package/host/generated/index.js +1658 -0
- package/host/generated/package.json +139 -0
- package/host/generated/query_compiler_fast_bg.js +2 -0
- package/host/generated/query_compiler_fast_bg.wasm +0 -0
- package/host/generated/query_compiler_fast_bg.wasm-base64.js +2 -0
- package/host/generated/runtime/client.d.ts +3433 -0
- package/host/generated/runtime/client.js +110 -0
- package/host/generated/runtime/index-browser.d.ts +90 -0
- package/host/generated/runtime/index-browser.js +6 -0
- package/host/generated/runtime/wasm-compiler-edge.js +100 -0
- package/host/generated/schema.prisma +6312 -0
- package/host/generated/wasm-edge-light-loader.mjs +5 -0
- package/host/generated/wasm-worker-loader.mjs +5 -0
- package/host/prisma/fragments/kvox.ask.prisma +126 -0
- package/host/prisma/fragments/kvox.graph.prisma +1073 -0
- package/host/prisma/fragments/kvox.notes.prisma +787 -0
- package/host/prisma/fragments/kvox.search.prisma +211 -0
- package/host/prisma/fragments/kvox.transcripts.prisma +790 -0
- package/host/prisma/kvox.lock +101 -0
- package/host/prisma/migrations/20240101000000_initial/migration.sql +297 -0
- package/host/prisma/migrations/20240101000001_add_personal_access_tokens/migration.sql +31 -0
- package/host/prisma/migrations/20240101000002_add_credentials/migration.sql +20 -0
- package/host/prisma/migrations/20240101000003_add_notification_deliveries/migration.sql +27 -0
- package/host/prisma/migrations/20240101000004_drop_stale_uuid_defaults/migration.sql +35 -0
- package/host/prisma/migrations/20240101000005_add_notifications/migration.sql +22 -0
- package/host/prisma/migrations/20240101000006_add_push_subscriptions/migration.sql +25 -0
- package/host/prisma/migrations/20240101000007_add_jobs/migration.sql +110 -0
- package/host/prisma/migrations/20240101000008_add_worker_nodes/migration.sql +90 -0
- package/host/prisma/migrations/20240101000009_add_database_backup_runs/migration.sql +104 -0
- package/host/prisma/migrations/20240101000010_add_notification_broadcasts/migration.sql +57 -0
- package/host/prisma/migrations/20240101000011_add_backup_run_job_link/migration.sql +87 -0
- package/host/prisma/migrations/20240101000012_add_job_node_secrets/migration.sql +61 -0
- package/host/prisma/migrations/20240101000013_add_backup_run_pg_dump_version/migration.sql +26 -0
- package/host/prisma/migrations/20240101000014_add_job_claim_token/migration.sql +92 -0
- package/host/prisma/migrations/20240101000015_add_ai_platform/migration.sql +108 -0
- package/host/prisma/migrations/20240101000016_revoke_viewer_ai_use/migration.sql +32 -0
- package/host/prisma/migrations/20240101000017_add_user_credentials/migration.sql +29 -0
- package/host/prisma/migrations/20240101000018_add_device_session_credential_link/migration.sql +52 -0
- package/host/prisma/migrations/20240101000019_add_worker_node_vitals/migration.sql +3 -0
- package/host/prisma/migrations/20240101000020_add_job_trace_context/migration.sql +6 -0
- package/host/prisma/migrations/20240101000021_add_retention_created_at_indexes/migration.sql +13 -0
- package/host/prisma/migrations/20240101000022_add_organizations/migration.sql +142 -0
- package/host/prisma/migrations/20240101000023_split_system_org_roles/migration.sql +131 -0
- package/host/prisma/migrations/20240101000024_org_scoped_rls/migration.sql +215 -0
- package/host/prisma/migrations/20240101000025_add_groups/migration.sql +165 -0
- package/host/prisma/migrations/20240101000026_add_grants/migration.sql +117 -0
- package/host/prisma/migrations/20240101000027_add_org_settings/migration.sql +49 -0
- package/host/prisma/migrations/20240101000028_add_org_credentials/migration.sql +54 -0
- package/host/prisma/migrations/20240101000029_add_jobs_org_id/migration.sql +18 -0
- package/host/prisma/migrations/20240101000030_add_jobs_org_id_status_index/migration.sql +6 -0
- package/host/prisma/migrations/20240101000031_add_broadcast_target_org/migration.sql +21 -0
- package/host/prisma/migrations/20240101000032_add_android_app/migration.sql +60 -0
- package/host/prisma/migrations/20240101000033_open_job_reason/migration.sql +16 -0
- package/host/prisma/migrations/20240101000034_ai_usage_feature/migration.sql +37 -0
- package/host/prisma/migrations/20240101000035_add_app_metadata/migration.sql +49 -0
- package/host/prisma/migrations/20240101000036_open_sharing_vocabularies/migration.sql +97 -0
- package/host/prisma/migrations/20260914130000_kvox_add_transcripts/migration.sql +322 -0
- package/host/prisma/migrations/20260914140000_kvox_add_notes/migration.sql +311 -0
- package/host/prisma/migrations/20260915120000_kvox_add_search_vectors/migration.sql +150 -0
- package/host/prisma/migrations/20260915130000_kvox_add_search_embeddings/migration.sql +362 -0
- package/host/prisma/migrations/20260915210000_kvox_add_note_title_source/migration.sql +30 -0
- package/host/prisma/migrations/20260923120000_kvox_add_note_generation_context_snapshot/migration.sql +24 -0
- package/host/prisma/migrations/20260923130000_kvox_add_user_hidden_note_templates/migration.sql +35 -0
- package/host/prisma/migrations/20260923140000_kvox_add_transcript_speaker_identities/migration.sql +6 -0
- package/host/prisma/migrations/20260923150000_kvox_transcript_name_checks/migration.sql +95 -0
- package/host/prisma/migrations/20260923160000_kvox_add_note_body_format/migration.sql +27 -0
- package/host/prisma/migrations/20260923170000_kvox_add_note_version_body_format/migration.sql +23 -0
- package/host/prisma/migrations/20260926012548_kvox_add_knowledge_graph/migration.sql +680 -0
- package/host/prisma/migrations/20260926030000_kvox_fix_kg_relations_valid_precision_chk/migration.sql +29 -0
- package/host/prisma/migrations/20260926030100_kvox_add_transcript_recorded_at/migration.sql +9 -0
- package/host/prisma/migrations/20260926030200_kvox_kg_evidence_invariant/migration.sql +60 -0
- package/host/prisma/migrations/20260926040000_kvox_add_kg_graph_layouts/migration.sql +30 -0
- package/host/prisma/migrations/20260926050000_kvox_add_ask_conversations/migration.sql +99 -0
- package/host/prisma/migrations/20260926231512_kvox_add_kg_exports/migration.sql +52 -0
- package/host/prisma/migrations/20261016120000_kvox_transcripts_org_id/migration.sql +49 -0
- package/host/prisma/platform.lock +319 -0
- package/host/prisma/schema/app.kvox.ask.prisma +110 -0
- package/host/prisma/schema/app.kvox.graph.prisma +1030 -0
- package/host/prisma/schema/app.kvox.notes.prisma +746 -0
- package/host/prisma/schema/app.kvox.search.prisma +208 -0
- package/host/prisma/schema/app.kvox.transcripts.prisma +726 -0
- package/host/prisma/schema/platform.ai.prisma +419 -0
- package/host/prisma/schema/platform.android-app.prisma +46 -0
- package/host/prisma/schema/platform.base.prisma +15 -0
- package/host/prisma/schema/platform.credentials.prisma +156 -0
- package/host/prisma/schema/platform.db-backup.prisma +359 -0
- package/host/prisma/schema/platform.identity.prisma +638 -0
- package/host/prisma/schema/platform.jobs.prisma +824 -0
- package/host/prisma/schema/platform.notifications.prisma +641 -0
- package/host/prisma/schema/platform.settings.prisma +53 -0
- package/host/prisma/schema/platform.sharing.prisma +208 -0
- package/host/prisma/schema/platform.storage.prisma +118 -0
- package/package.json +112 -1
- package/parity/requests.ask.json +2681 -0
- package/parity/requests.m01.json +1554 -0
- package/parity/requests.m02.json +1554 -0
- package/parity/requests.m03.json +1554 -0
- package/parity/requests.m04.json +1554 -0
- package/parity/requests.m05.json +1554 -0
- package/parity/requests.m06.json +1554 -0
- package/parity/requests.m07.json +1554 -0
- package/parity/requests.m08.json +1554 -0
- package/parity/requests.m09.json +1554 -0
- package/parity/requests.m10.json +1554 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One citation of a gold label: a transcript segment and a verbatim quote from it,
|
|
4
|
+
* or a verbatim quote from the note body.
|
|
5
|
+
*
|
|
6
|
+
* @stability experimental
|
|
7
|
+
*/
|
|
8
|
+
export declare const evidenceLabelSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
source: z.ZodLiteral<"segment">;
|
|
10
|
+
segmentId: z.ZodString;
|
|
11
|
+
quote: z.ZodString;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
source: z.ZodLiteral<"note">;
|
|
14
|
+
quote: z.ZodString;
|
|
15
|
+
}, z.core.$strip>], "source">;
|
|
16
|
+
/**
|
|
17
|
+
* A parsed {@link evidenceLabelSchema}.
|
|
18
|
+
*
|
|
19
|
+
* @stability experimental
|
|
20
|
+
*/
|
|
21
|
+
export type EvidenceLabel = z.infer<typeof evidenceLabelSchema>;
|
|
22
|
+
/**
|
|
23
|
+
* The precision of a temporal label (docs/specs/ontology.md §5.4): `unknown` means both bounds are `null`.
|
|
24
|
+
*
|
|
25
|
+
* @stability experimental
|
|
26
|
+
*/
|
|
27
|
+
export declare const validPrecisionSchema: z.ZodEnum<{
|
|
28
|
+
unknown: "unknown";
|
|
29
|
+
day: "day";
|
|
30
|
+
month: "month";
|
|
31
|
+
year: "year";
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* A parsed {@link validPrecisionSchema}.
|
|
35
|
+
*
|
|
36
|
+
* @stability experimental
|
|
37
|
+
*/
|
|
38
|
+
export type ValidPrecisionLabel = z.infer<typeof validPrecisionSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* A calendar date, `YYYY-MM-DD`.
|
|
41
|
+
*
|
|
42
|
+
* @stability experimental
|
|
43
|
+
*/
|
|
44
|
+
export declare const isoDateSchema: z.ZodString;
|
|
45
|
+
/**
|
|
46
|
+
* The item kinds a fixture labels.
|
|
47
|
+
*
|
|
48
|
+
* @stability experimental
|
|
49
|
+
*/
|
|
50
|
+
export declare const ITEM_LABEL_KINDS: readonly ["commitment", "decision", "claim", "person_fact"];
|
|
51
|
+
/**
|
|
52
|
+
* One of {@link ITEM_LABEL_KINDS}.
|
|
53
|
+
*
|
|
54
|
+
* @stability experimental
|
|
55
|
+
*/
|
|
56
|
+
export type ItemLabelKind = (typeof ITEM_LABEL_KINDS)[number];
|
|
57
|
+
/**
|
|
58
|
+
* A gold entity row: `key` is local to its fixture, `existingId` names the known entity a resolver must link it to.
|
|
59
|
+
*
|
|
60
|
+
* @stability experimental
|
|
61
|
+
*/
|
|
62
|
+
export declare const goldenEntityLabelSchema: z.ZodObject<{
|
|
63
|
+
key: z.ZodString;
|
|
64
|
+
type: z.ZodString;
|
|
65
|
+
label: z.ZodString;
|
|
66
|
+
aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
67
|
+
existingId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
69
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
70
|
+
source: z.ZodLiteral<"segment">;
|
|
71
|
+
segmentId: z.ZodString;
|
|
72
|
+
quote: z.ZodString;
|
|
73
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
74
|
+
source: z.ZodLiteral<"note">;
|
|
75
|
+
quote: z.ZodString;
|
|
76
|
+
}, z.core.$strip>], "source">>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* A parsed {@link goldenEntityLabelSchema}.
|
|
80
|
+
*
|
|
81
|
+
* @stability experimental
|
|
82
|
+
*/
|
|
83
|
+
export type GoldenEntityLabel = z.infer<typeof goldenEntityLabelSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* A gold edge: `from`/`to` name a label key or a known entity id; temporal bounds per §5.4.
|
|
86
|
+
*
|
|
87
|
+
* @stability experimental
|
|
88
|
+
*/
|
|
89
|
+
export declare const goldenRelationLabelSchema: z.ZodObject<{
|
|
90
|
+
type: z.ZodString;
|
|
91
|
+
from: z.ZodString;
|
|
92
|
+
to: z.ZodString;
|
|
93
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
94
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
95
|
+
precision: z.ZodEnum<{
|
|
96
|
+
unknown: "unknown";
|
|
97
|
+
day: "day";
|
|
98
|
+
month: "month";
|
|
99
|
+
year: "year";
|
|
100
|
+
}>;
|
|
101
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
|
+
source: z.ZodLiteral<"segment">;
|
|
104
|
+
segmentId: z.ZodString;
|
|
105
|
+
quote: z.ZodString;
|
|
106
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
107
|
+
source: z.ZodLiteral<"note">;
|
|
108
|
+
quote: z.ZodString;
|
|
109
|
+
}, z.core.$strip>], "source">>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
/**
|
|
112
|
+
* A parsed {@link goldenRelationLabelSchema}.
|
|
113
|
+
*
|
|
114
|
+
* @stability experimental
|
|
115
|
+
*/
|
|
116
|
+
export type GoldenRelationLabel = z.infer<typeof goldenRelationLabelSchema>;
|
|
117
|
+
/**
|
|
118
|
+
* A gold commitment, decision, claim or person fact, with its owner and counterparty columns.
|
|
119
|
+
*
|
|
120
|
+
* @stability experimental
|
|
121
|
+
*/
|
|
122
|
+
export declare const goldenItemLabelSchema: z.ZodObject<{
|
|
123
|
+
kind: z.ZodEnum<{
|
|
124
|
+
commitment: "commitment";
|
|
125
|
+
decision: "decision";
|
|
126
|
+
claim: "claim";
|
|
127
|
+
person_fact: "person_fact";
|
|
128
|
+
}>;
|
|
129
|
+
subject: z.ZodString;
|
|
130
|
+
owner: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
counterparty: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
title: z.ZodString;
|
|
133
|
+
statement: z.ZodString;
|
|
134
|
+
status: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
135
|
+
open: "open";
|
|
136
|
+
done: "done";
|
|
137
|
+
dropped: "dropped";
|
|
138
|
+
}>>>;
|
|
139
|
+
occurredAt: z.ZodNullable<z.ZodString>;
|
|
140
|
+
dueAt: z.ZodNullable<z.ZodString>;
|
|
141
|
+
sensitivity: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
142
|
+
business: "business";
|
|
143
|
+
personal: "personal";
|
|
144
|
+
sensitive: "sensitive";
|
|
145
|
+
}>>>;
|
|
146
|
+
supersedesLabel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
148
|
+
source: z.ZodLiteral<"segment">;
|
|
149
|
+
segmentId: z.ZodString;
|
|
150
|
+
quote: z.ZodString;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
source: z.ZodLiteral<"note">;
|
|
153
|
+
quote: z.ZodString;
|
|
154
|
+
}, z.core.$strip>], "source">>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
/**
|
|
157
|
+
* A parsed {@link goldenItemLabelSchema}.
|
|
158
|
+
*
|
|
159
|
+
* @stability experimental
|
|
160
|
+
*/
|
|
161
|
+
export type GoldenItemLabel = z.infer<typeof goldenItemLabelSchema>;
|
|
162
|
+
/**
|
|
163
|
+
* One synthetic meeting of the golden set: the raw material an extraction run reads
|
|
164
|
+
* (segments, note, Context, the prior graph) and the hand labels it is scored against.
|
|
165
|
+
*
|
|
166
|
+
* @stability experimental
|
|
167
|
+
*/
|
|
168
|
+
export declare const goldenFixtureSchema: z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
title: z.ZodString;
|
|
171
|
+
tags: z.ZodArray<z.ZodString>;
|
|
172
|
+
recordedAt: z.ZodString;
|
|
173
|
+
contextText: z.ZodNullable<z.ZodString>;
|
|
174
|
+
hasTranscript: z.ZodBoolean;
|
|
175
|
+
speakers: z.ZodArray<z.ZodObject<{
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
label: z.ZodString;
|
|
178
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
speakerId: z.ZodString;
|
|
183
|
+
startMs: z.ZodNumber;
|
|
184
|
+
endMs: z.ZodNumber;
|
|
185
|
+
rev: z.ZodDefault<z.ZodNumber>;
|
|
186
|
+
text: z.ZodString;
|
|
187
|
+
}, z.core.$strip>>;
|
|
188
|
+
note: z.ZodObject<{
|
|
189
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
190
|
+
body: z.ZodString;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
knownEntities: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
type: z.ZodString;
|
|
195
|
+
label: z.ZodString;
|
|
196
|
+
aliases: z.ZodArray<z.ZodString>;
|
|
197
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
198
|
+
attendedFixtureIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
199
|
+
}, z.core.$strip>>>;
|
|
200
|
+
knownRelations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
type: z.ZodString;
|
|
203
|
+
from: z.ZodString;
|
|
204
|
+
to: z.ZodString;
|
|
205
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
206
|
+
validFrom: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
validTo: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
precision: z.ZodDefault<z.ZodEnum<{
|
|
209
|
+
unknown: "unknown";
|
|
210
|
+
day: "day";
|
|
211
|
+
month: "month";
|
|
212
|
+
year: "year";
|
|
213
|
+
}>>;
|
|
214
|
+
}, z.core.$strip>>>;
|
|
215
|
+
labels: z.ZodObject<{
|
|
216
|
+
entities: z.ZodArray<z.ZodObject<{
|
|
217
|
+
key: z.ZodString;
|
|
218
|
+
type: z.ZodString;
|
|
219
|
+
label: z.ZodString;
|
|
220
|
+
aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
221
|
+
existingId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
223
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
+
source: z.ZodLiteral<"segment">;
|
|
225
|
+
segmentId: z.ZodString;
|
|
226
|
+
quote: z.ZodString;
|
|
227
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
228
|
+
source: z.ZodLiteral<"note">;
|
|
229
|
+
quote: z.ZodString;
|
|
230
|
+
}, z.core.$strip>], "source">>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
233
|
+
type: z.ZodString;
|
|
234
|
+
from: z.ZodString;
|
|
235
|
+
to: z.ZodString;
|
|
236
|
+
validFrom: z.ZodNullable<z.ZodString>;
|
|
237
|
+
validTo: z.ZodNullable<z.ZodString>;
|
|
238
|
+
precision: z.ZodEnum<{
|
|
239
|
+
unknown: "unknown";
|
|
240
|
+
day: "day";
|
|
241
|
+
month: "month";
|
|
242
|
+
year: "year";
|
|
243
|
+
}>;
|
|
244
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
245
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
246
|
+
source: z.ZodLiteral<"segment">;
|
|
247
|
+
segmentId: z.ZodString;
|
|
248
|
+
quote: z.ZodString;
|
|
249
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
+
source: z.ZodLiteral<"note">;
|
|
251
|
+
quote: z.ZodString;
|
|
252
|
+
}, z.core.$strip>], "source">>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
items: z.ZodArray<z.ZodObject<{
|
|
255
|
+
kind: z.ZodEnum<{
|
|
256
|
+
commitment: "commitment";
|
|
257
|
+
decision: "decision";
|
|
258
|
+
claim: "claim";
|
|
259
|
+
person_fact: "person_fact";
|
|
260
|
+
}>;
|
|
261
|
+
subject: z.ZodString;
|
|
262
|
+
owner: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
263
|
+
counterparty: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
264
|
+
title: z.ZodString;
|
|
265
|
+
statement: z.ZodString;
|
|
266
|
+
status: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
267
|
+
open: "open";
|
|
268
|
+
done: "done";
|
|
269
|
+
dropped: "dropped";
|
|
270
|
+
}>>>;
|
|
271
|
+
occurredAt: z.ZodNullable<z.ZodString>;
|
|
272
|
+
dueAt: z.ZodNullable<z.ZodString>;
|
|
273
|
+
sensitivity: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
274
|
+
business: "business";
|
|
275
|
+
personal: "personal";
|
|
276
|
+
sensitive: "sensitive";
|
|
277
|
+
}>>>;
|
|
278
|
+
supersedesLabel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
evidence: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
280
|
+
source: z.ZodLiteral<"segment">;
|
|
281
|
+
segmentId: z.ZodString;
|
|
282
|
+
quote: z.ZodString;
|
|
283
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
284
|
+
source: z.ZodLiteral<"note">;
|
|
285
|
+
quote: z.ZodString;
|
|
286
|
+
}, z.core.$strip>], "source">>;
|
|
287
|
+
}, z.core.$strip>>;
|
|
288
|
+
negatives: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
289
|
+
quote: z.ZodString;
|
|
290
|
+
why: z.ZodString;
|
|
291
|
+
}, z.core.$strip>>>;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
/**
|
|
295
|
+
* A parsed golden fixture (defaults applied).
|
|
296
|
+
*
|
|
297
|
+
* @stability experimental
|
|
298
|
+
*/
|
|
299
|
+
export type GoldenFixture = z.infer<typeof goldenFixtureSchema>;
|
|
300
|
+
/**
|
|
301
|
+
* A golden fixture as written on disk (before defaults), the shape an exported skeleton takes.
|
|
302
|
+
*
|
|
303
|
+
* @stability experimental
|
|
304
|
+
*/
|
|
305
|
+
export type GoldenFixtureInput = z.input<typeof goldenFixtureSchema>;
|
|
306
|
+
/**
|
|
307
|
+
* `m03#claim-1`: the address an item is known by across the set.
|
|
308
|
+
*
|
|
309
|
+
* @param fixtureId - the fixture the item is labelled in.
|
|
310
|
+
* @param kind - the item's kind.
|
|
311
|
+
* @param indexWithinKind - its 0-based position among that fixture's items of that kind.
|
|
312
|
+
* @returns the address.
|
|
313
|
+
* @stability experimental
|
|
314
|
+
*/
|
|
315
|
+
export declare function itemAddress(fixtureId: string, kind: ItemLabelKind, indexWithinKind: number): string;
|
|
316
|
+
/**
|
|
317
|
+
* Every item in a fixture keyed by its cross-fixture address.
|
|
318
|
+
*
|
|
319
|
+
* @param fixture - the fixture.
|
|
320
|
+
* @returns the items by {@link itemAddress}.
|
|
321
|
+
* @stability experimental
|
|
322
|
+
*/
|
|
323
|
+
export declare function itemsByAddress(fixture: GoldenFixture): Map<string, GoldenItemLabel>;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// The knowledge-graph golden set: fixture schema (issue #362, epic #346)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
//
|
|
6
|
+
// One JSON file per synthetic meeting under
|
|
7
|
+
// `packages/kvox-eval/fixtures/kg-golden/meetings/mNN-<slug>.json`. The file carries
|
|
8
|
+
// the raw material an extraction run reads (segments, the note body, Context,
|
|
9
|
+
// the prior graph state as `knownEntities`) AND the hand labels a run is
|
|
10
|
+
// scored against (`labels`). See the README beside the fixtures for the
|
|
11
|
+
// authoring rules; `docs/specs/ontology.md` §6 for why the set exists.
|
|
12
|
+
//
|
|
13
|
+
// This file lives in `@marinoscar/kvox-eval` (issue #580), never in an app's
|
|
14
|
+
// `src/`: no production build of the API or the web app compiles it. The app
|
|
15
|
+
// reaches it only from its `scripts/` and its specs.
|
|
16
|
+
//
|
|
17
|
+
// Reference conventions used by the labels:
|
|
18
|
+
// - an entity label's `key` is local to its fixture ("sarah", "meeting");
|
|
19
|
+
// - a relation's `from`/`to` and an item's `subject`/`owner`/`counterparty`
|
|
20
|
+
// name either such a key or a `knownEntities` id ("g-person-sarah-chen");
|
|
21
|
+
// - an item is addressed from another fixture as `<fixtureId>#<kind>-<n>`,
|
|
22
|
+
// `n` being its 1-based position among that fixture's items of that kind
|
|
23
|
+
// ("m03#claim-1") — that is what `supersedesLabel` holds.
|
|
24
|
+
// =============================================================================
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.goldenFixtureSchema = exports.goldenItemLabelSchema = exports.goldenRelationLabelSchema = exports.goldenEntityLabelSchema = exports.ITEM_LABEL_KINDS = exports.isoDateSchema = exports.validPrecisionSchema = exports.evidenceLabelSchema = void 0;
|
|
27
|
+
exports.itemAddress = itemAddress;
|
|
28
|
+
exports.itemsByAddress = itemsByAddress;
|
|
29
|
+
const zod_1 = require("zod");
|
|
30
|
+
/**
|
|
31
|
+
* One citation of a gold label: a transcript segment and a verbatim quote from it,
|
|
32
|
+
* or a verbatim quote from the note body.
|
|
33
|
+
*
|
|
34
|
+
* @stability experimental
|
|
35
|
+
*/
|
|
36
|
+
exports.evidenceLabelSchema = zod_1.z.discriminatedUnion('source', [
|
|
37
|
+
zod_1.z.object({ source: zod_1.z.literal('segment'), segmentId: zod_1.z.string(), quote: zod_1.z.string().min(1).max(400) }),
|
|
38
|
+
zod_1.z.object({ source: zod_1.z.literal('note'), quote: zod_1.z.string().min(1).max(400) }),
|
|
39
|
+
]);
|
|
40
|
+
/**
|
|
41
|
+
* The precision of a temporal label (docs/specs/ontology.md §5.4): `unknown` means both bounds are `null`.
|
|
42
|
+
*
|
|
43
|
+
* @stability experimental
|
|
44
|
+
*/
|
|
45
|
+
exports.validPrecisionSchema = zod_1.z.enum(['day', 'month', 'year', 'unknown']);
|
|
46
|
+
/**
|
|
47
|
+
* A calendar date, `YYYY-MM-DD`.
|
|
48
|
+
*
|
|
49
|
+
* @stability experimental
|
|
50
|
+
*/
|
|
51
|
+
exports.isoDateSchema = zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
52
|
+
/**
|
|
53
|
+
* The item kinds a fixture labels.
|
|
54
|
+
*
|
|
55
|
+
* @stability experimental
|
|
56
|
+
*/
|
|
57
|
+
exports.ITEM_LABEL_KINDS = ['commitment', 'decision', 'claim', 'person_fact'];
|
|
58
|
+
const propsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).default({});
|
|
59
|
+
/**
|
|
60
|
+
* A gold entity row: `key` is local to its fixture, `existingId` names the known entity a resolver must link it to.
|
|
61
|
+
*
|
|
62
|
+
* @stability experimental
|
|
63
|
+
*/
|
|
64
|
+
exports.goldenEntityLabelSchema = zod_1.z.object({
|
|
65
|
+
key: zod_1.z.string().min(1),
|
|
66
|
+
type: zod_1.z.string(),
|
|
67
|
+
label: zod_1.z.string().min(1),
|
|
68
|
+
aliases: zod_1.z.array(zod_1.z.string()).default([]),
|
|
69
|
+
/** When set, a resolver must link this mention to that `knownEntities` id. */
|
|
70
|
+
existingId: zod_1.z.string().nullable().default(null),
|
|
71
|
+
props: propsSchema,
|
|
72
|
+
evidence: zod_1.z.array(exports.evidenceLabelSchema).min(1),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* A gold edge: `from`/`to` name a label key or a known entity id; temporal bounds per §5.4.
|
|
76
|
+
*
|
|
77
|
+
* @stability experimental
|
|
78
|
+
*/
|
|
79
|
+
exports.goldenRelationLabelSchema = zod_1.z.object({
|
|
80
|
+
type: zod_1.z.string(),
|
|
81
|
+
from: zod_1.z.string(),
|
|
82
|
+
to: zod_1.z.string(),
|
|
83
|
+
validFrom: exports.isoDateSchema.nullable(),
|
|
84
|
+
validTo: exports.isoDateSchema.nullable(),
|
|
85
|
+
precision: exports.validPrecisionSchema,
|
|
86
|
+
props: propsSchema,
|
|
87
|
+
evidence: zod_1.z.array(exports.evidenceLabelSchema).min(1),
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* A gold commitment, decision, claim or person fact, with its owner and counterparty columns.
|
|
91
|
+
*
|
|
92
|
+
* @stability experimental
|
|
93
|
+
*/
|
|
94
|
+
exports.goldenItemLabelSchema = zod_1.z.object({
|
|
95
|
+
kind: zod_1.z.enum(exports.ITEM_LABEL_KINDS),
|
|
96
|
+
subject: zod_1.z.string(),
|
|
97
|
+
owner: zod_1.z.string().nullable().default(null),
|
|
98
|
+
counterparty: zod_1.z.string().nullable().default(null),
|
|
99
|
+
title: zod_1.z.string().min(1),
|
|
100
|
+
statement: zod_1.z.string().min(1),
|
|
101
|
+
status: zod_1.z.enum(['open', 'done', 'dropped']).nullable().default(null),
|
|
102
|
+
occurredAt: exports.isoDateSchema.nullable(),
|
|
103
|
+
dueAt: exports.isoDateSchema.nullable(),
|
|
104
|
+
sensitivity: zod_1.z.enum(['business', 'personal', 'sensitive']).nullable().default(null),
|
|
105
|
+
/** `<fixtureId>#<kind>-<n>`: the earlier item this one replaces. */
|
|
106
|
+
supersedesLabel: zod_1.z.string().nullable().default(null),
|
|
107
|
+
evidence: zod_1.z.array(exports.evidenceLabelSchema).min(1),
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* One synthetic meeting of the golden set: the raw material an extraction run reads
|
|
111
|
+
* (segments, note, Context, the prior graph) and the hand labels it is scored against.
|
|
112
|
+
*
|
|
113
|
+
* @stability experimental
|
|
114
|
+
*/
|
|
115
|
+
exports.goldenFixtureSchema = zod_1.z.object({
|
|
116
|
+
id: zod_1.z.string().regex(/^m\d{2,3}$/),
|
|
117
|
+
title: zod_1.z.string().min(1),
|
|
118
|
+
tags: zod_1.z.array(zod_1.z.string()),
|
|
119
|
+
/** The meeting date — the anchor every relative date resolves against (§5.4). */
|
|
120
|
+
recordedAt: zod_1.z.string().datetime(),
|
|
121
|
+
/** The note's Context field, as the user typed it. */
|
|
122
|
+
contextText: zod_1.z.string().nullable(),
|
|
123
|
+
/** false = a note-only meeting: no speakers, no segments, note evidence only. */
|
|
124
|
+
hasTranscript: zod_1.z.boolean(),
|
|
125
|
+
speakers: zod_1.z.array(zod_1.z.object({ id: zod_1.z.string(), label: zod_1.z.string(), displayName: zod_1.z.string().nullable() })),
|
|
126
|
+
segments: zod_1.z.array(zod_1.z.object({
|
|
127
|
+
id: zod_1.z.string(),
|
|
128
|
+
speakerId: zod_1.z.string(),
|
|
129
|
+
startMs: zod_1.z.number().int(),
|
|
130
|
+
endMs: zod_1.z.number().int(),
|
|
131
|
+
rev: zod_1.z.number().int().default(1),
|
|
132
|
+
text: zod_1.z.string().min(1),
|
|
133
|
+
})),
|
|
134
|
+
note: zod_1.z.object({ version: zod_1.z.number().int().default(1), body: zod_1.z.string().min(1) }),
|
|
135
|
+
/** The graph as it stood before this meeting: what resolution may link to. */
|
|
136
|
+
knownEntities: zod_1.z
|
|
137
|
+
.array(zod_1.z.object({
|
|
138
|
+
id: zod_1.z.string(),
|
|
139
|
+
type: zod_1.z.string(),
|
|
140
|
+
label: zod_1.z.string(),
|
|
141
|
+
aliases: zod_1.z.array(zod_1.z.string()),
|
|
142
|
+
props: propsSchema,
|
|
143
|
+
attendedFixtureIds: zod_1.z.array(zod_1.z.string()).default([]),
|
|
144
|
+
}))
|
|
145
|
+
.default([]),
|
|
146
|
+
/**
|
|
147
|
+
* #365: the prior graph's accepted temporal/other edges between known
|
|
148
|
+
* entities, so the in-memory `work-item-dedup`/`temporal-closing` pass has
|
|
149
|
+
* something to find `known` and to close. Optional; absent = none.
|
|
150
|
+
*/
|
|
151
|
+
knownRelations: zod_1.z
|
|
152
|
+
.array(zod_1.z.object({
|
|
153
|
+
id: zod_1.z.string(),
|
|
154
|
+
type: zod_1.z.string(),
|
|
155
|
+
from: zod_1.z.string(),
|
|
156
|
+
to: zod_1.z.string(),
|
|
157
|
+
props: propsSchema,
|
|
158
|
+
validFrom: exports.isoDateSchema.nullable().default(null),
|
|
159
|
+
validTo: exports.isoDateSchema.nullable().default(null),
|
|
160
|
+
precision: exports.validPrecisionSchema.default('unknown'),
|
|
161
|
+
}))
|
|
162
|
+
.default([]),
|
|
163
|
+
labels: zod_1.z.object({
|
|
164
|
+
entities: zod_1.z.array(exports.goldenEntityLabelSchema),
|
|
165
|
+
relations: zod_1.z.array(exports.goldenRelationLabelSchema),
|
|
166
|
+
items: zod_1.z.array(exports.goldenItemLabelSchema),
|
|
167
|
+
/** §5.1 negative examples: text a correct extractor must NOT turn into a row. */
|
|
168
|
+
negatives: zod_1.z.array(zod_1.z.object({ quote: zod_1.z.string(), why: zod_1.z.string() })).default([]),
|
|
169
|
+
}),
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* `m03#claim-1`: the address an item is known by across the set.
|
|
173
|
+
*
|
|
174
|
+
* @param fixtureId - the fixture the item is labelled in.
|
|
175
|
+
* @param kind - the item's kind.
|
|
176
|
+
* @param indexWithinKind - its 0-based position among that fixture's items of that kind.
|
|
177
|
+
* @returns the address.
|
|
178
|
+
* @stability experimental
|
|
179
|
+
*/
|
|
180
|
+
function itemAddress(fixtureId, kind, indexWithinKind) {
|
|
181
|
+
return `${fixtureId}#${kind}-${indexWithinKind + 1}`;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Every item in a fixture keyed by its cross-fixture address.
|
|
185
|
+
*
|
|
186
|
+
* @param fixture - the fixture.
|
|
187
|
+
* @returns the items by {@link itemAddress}.
|
|
188
|
+
* @stability experimental
|
|
189
|
+
*/
|
|
190
|
+
function itemsByAddress(fixture) {
|
|
191
|
+
const counters = new Map();
|
|
192
|
+
const out = new Map();
|
|
193
|
+
for (const item of fixture.labels.items) {
|
|
194
|
+
const n = counters.get(item.kind) ?? 0;
|
|
195
|
+
counters.set(item.kind, n + 1);
|
|
196
|
+
out.set(itemAddress(fixture.id, item.kind, n), item);
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@marinoscar/kvox-eval/fixtures`: the synthetic golden set and its contract.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* The committed meetings (`fixtures/kg-golden/meetings/`) and the Ask question
|
|
6
|
+
* file beside them, the schema every fixture is validated with, and the loaders.
|
|
7
|
+
* Every meeting is invented: no real recording, transcript, note, name, company,
|
|
8
|
+
* email address or phone number belongs in the set (`fixtures/kg-golden/README.md`).
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { evidenceLabelSchema, goldenEntityLabelSchema, goldenFixtureSchema, goldenItemLabelSchema, goldenRelationLabelSchema, isoDateSchema, ITEM_LABEL_KINDS, itemAddress, itemsByAddress, validPrecisionSchema, } from './fixture-schema.js';
|
|
13
|
+
export type { EvidenceLabel, GoldenEntityLabel, GoldenFixture, GoldenFixtureInput, GoldenItemLabel, GoldenRelationLabel, ItemLabelKind, ValidPrecisionLabel, } from './fixture-schema.js';
|
|
14
|
+
export { fixtureDomains, PERSONAL_FIXTURE_TAG } from './domains.js';
|
|
15
|
+
export { GOLDEN_MEETINGS_DIR, GOLDEN_SET_DIR, KgEvalLoadError, listFixtureFiles, loadFixtureFile, loadGoldenMeetings, loadGoldenSet, selectFixtures, } from './load.js';
|
|
16
|
+
export { ASK_QUESTIONS_PATH, loadGoldenAskQuestions } from './questions.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadGoldenAskQuestions = exports.ASK_QUESTIONS_PATH = exports.selectFixtures = exports.loadGoldenSet = exports.loadGoldenMeetings = exports.loadFixtureFile = exports.listFixtureFiles = exports.KgEvalLoadError = exports.GOLDEN_SET_DIR = exports.GOLDEN_MEETINGS_DIR = exports.PERSONAL_FIXTURE_TAG = exports.fixtureDomains = exports.validPrecisionSchema = exports.itemsByAddress = exports.itemAddress = exports.ITEM_LABEL_KINDS = exports.isoDateSchema = exports.goldenRelationLabelSchema = exports.goldenItemLabelSchema = exports.goldenFixtureSchema = exports.goldenEntityLabelSchema = exports.evidenceLabelSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `@marinoscar/kvox-eval/fixtures`: the synthetic golden set and its contract.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The committed meetings (`fixtures/kg-golden/meetings/`) and the Ask question
|
|
9
|
+
* file beside them, the schema every fixture is validated with, and the loaders.
|
|
10
|
+
* Every meeting is invented: no real recording, transcript, note, name, company,
|
|
11
|
+
* email address or phone number belongs in the set (`fixtures/kg-golden/README.md`).
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
var fixture_schema_js_1 = require("./fixture-schema.js");
|
|
16
|
+
Object.defineProperty(exports, "evidenceLabelSchema", { enumerable: true, get: function () { return fixture_schema_js_1.evidenceLabelSchema; } });
|
|
17
|
+
Object.defineProperty(exports, "goldenEntityLabelSchema", { enumerable: true, get: function () { return fixture_schema_js_1.goldenEntityLabelSchema; } });
|
|
18
|
+
Object.defineProperty(exports, "goldenFixtureSchema", { enumerable: true, get: function () { return fixture_schema_js_1.goldenFixtureSchema; } });
|
|
19
|
+
Object.defineProperty(exports, "goldenItemLabelSchema", { enumerable: true, get: function () { return fixture_schema_js_1.goldenItemLabelSchema; } });
|
|
20
|
+
Object.defineProperty(exports, "goldenRelationLabelSchema", { enumerable: true, get: function () { return fixture_schema_js_1.goldenRelationLabelSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "isoDateSchema", { enumerable: true, get: function () { return fixture_schema_js_1.isoDateSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "ITEM_LABEL_KINDS", { enumerable: true, get: function () { return fixture_schema_js_1.ITEM_LABEL_KINDS; } });
|
|
23
|
+
Object.defineProperty(exports, "itemAddress", { enumerable: true, get: function () { return fixture_schema_js_1.itemAddress; } });
|
|
24
|
+
Object.defineProperty(exports, "itemsByAddress", { enumerable: true, get: function () { return fixture_schema_js_1.itemsByAddress; } });
|
|
25
|
+
Object.defineProperty(exports, "validPrecisionSchema", { enumerable: true, get: function () { return fixture_schema_js_1.validPrecisionSchema; } });
|
|
26
|
+
var domains_js_1 = require("./domains.js");
|
|
27
|
+
Object.defineProperty(exports, "fixtureDomains", { enumerable: true, get: function () { return domains_js_1.fixtureDomains; } });
|
|
28
|
+
Object.defineProperty(exports, "PERSONAL_FIXTURE_TAG", { enumerable: true, get: function () { return domains_js_1.PERSONAL_FIXTURE_TAG; } });
|
|
29
|
+
var load_js_1 = require("./load.js");
|
|
30
|
+
Object.defineProperty(exports, "GOLDEN_MEETINGS_DIR", { enumerable: true, get: function () { return load_js_1.GOLDEN_MEETINGS_DIR; } });
|
|
31
|
+
Object.defineProperty(exports, "GOLDEN_SET_DIR", { enumerable: true, get: function () { return load_js_1.GOLDEN_SET_DIR; } });
|
|
32
|
+
Object.defineProperty(exports, "KgEvalLoadError", { enumerable: true, get: function () { return load_js_1.KgEvalLoadError; } });
|
|
33
|
+
Object.defineProperty(exports, "listFixtureFiles", { enumerable: true, get: function () { return load_js_1.listFixtureFiles; } });
|
|
34
|
+
Object.defineProperty(exports, "loadFixtureFile", { enumerable: true, get: function () { return load_js_1.loadFixtureFile; } });
|
|
35
|
+
Object.defineProperty(exports, "loadGoldenMeetings", { enumerable: true, get: function () { return load_js_1.loadGoldenMeetings; } });
|
|
36
|
+
Object.defineProperty(exports, "loadGoldenSet", { enumerable: true, get: function () { return load_js_1.loadGoldenSet; } });
|
|
37
|
+
Object.defineProperty(exports, "selectFixtures", { enumerable: true, get: function () { return load_js_1.selectFixtures; } });
|
|
38
|
+
var questions_js_1 = require("./questions.js");
|
|
39
|
+
Object.defineProperty(exports, "ASK_QUESTIONS_PATH", { enumerable: true, get: function () { return questions_js_1.ASK_QUESTIONS_PATH; } });
|
|
40
|
+
Object.defineProperty(exports, "loadGoldenAskQuestions", { enumerable: true, get: function () { return questions_js_1.loadGoldenAskQuestions; } });
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type GoldenFixture } from './fixture-schema.js';
|
|
2
|
+
/**
|
|
3
|
+
* The committed, synthetic golden set's directory (`fixtures/kg-golden/` of the package).
|
|
4
|
+
*
|
|
5
|
+
* @stability experimental
|
|
6
|
+
*/
|
|
7
|
+
export declare const GOLDEN_SET_DIR: string;
|
|
8
|
+
/**
|
|
9
|
+
* The committed, synthetic meetings (`fixtures/kg-golden/meetings/`).
|
|
10
|
+
*
|
|
11
|
+
* @stability experimental
|
|
12
|
+
*/
|
|
13
|
+
export declare const GOLDEN_MEETINGS_DIR: string;
|
|
14
|
+
/**
|
|
15
|
+
* A golden set (or a selection of it) that cannot be loaded: a file that is not
|
|
16
|
+
* JSON or does not match its schema, a duplicate id, an unknown id. The CLIs map
|
|
17
|
+
* it to exit code 2.
|
|
18
|
+
*
|
|
19
|
+
* @stability experimental
|
|
20
|
+
*/
|
|
21
|
+
export declare class KgEvalLoadError extends Error {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Every `*.json` file of a directory, sorted by name.
|
|
25
|
+
*
|
|
26
|
+
* @param dir - the directory.
|
|
27
|
+
* @returns absolute paths.
|
|
28
|
+
* @stability experimental
|
|
29
|
+
*/
|
|
30
|
+
export declare function listFixtureFiles(dir: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* One fixture file, parsed and validated.
|
|
33
|
+
*
|
|
34
|
+
* @param file - the file.
|
|
35
|
+
* @returns the fixture.
|
|
36
|
+
* @throws {@link KgEvalLoadError} when it is not JSON or does not match `goldenFixtureSchema`.
|
|
37
|
+
* @stability experimental
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadFixtureFile(file: string): GoldenFixture;
|
|
40
|
+
/**
|
|
41
|
+
* Every fixture of a directory, sorted by id (numerically: m2 before m10).
|
|
42
|
+
*
|
|
43
|
+
* @param dir - the directory; default the committed {@link GOLDEN_MEETINGS_DIR}.
|
|
44
|
+
* @returns the fixtures.
|
|
45
|
+
* @throws {@link KgEvalLoadError} on a malformed file or a duplicate id.
|
|
46
|
+
* @stability experimental
|
|
47
|
+
*/
|
|
48
|
+
export declare function loadGoldenSet(dir?: string): GoldenFixture[];
|
|
49
|
+
/**
|
|
50
|
+
* `--only m01,m07` / `--tag promotion`: both narrow; neither given keeps all.
|
|
51
|
+
*
|
|
52
|
+
* @param fixtures - the loaded set.
|
|
53
|
+
* @param only - fixture ids to keep, or `null`.
|
|
54
|
+
* @param tag - a tag every kept fixture carries, or `null`.
|
|
55
|
+
* @returns the selection, in set order.
|
|
56
|
+
* @throws {@link KgEvalLoadError} when `only` names an id the set does not have.
|
|
57
|
+
* @stability experimental
|
|
58
|
+
*/
|
|
59
|
+
export declare function selectFixtures(fixtures: GoldenFixture[], only: string[] | null, tag: string | null): GoldenFixture[];
|
|
60
|
+
/**
|
|
61
|
+
* The committed golden meetings, optionally narrowed to some ids.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const [m01, m07] = loadGoldenMeetings(['m01', 'm07']);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @param ids - fixture ids to keep (in set order); omitted or empty keeps all.
|
|
69
|
+
* @returns the fixtures.
|
|
70
|
+
* @throws {@link KgEvalLoadError} on a malformed file or an unknown id.
|
|
71
|
+
* @stability experimental
|
|
72
|
+
*/
|
|
73
|
+
export declare function loadGoldenMeetings(ids?: readonly string[]): GoldenFixture[];
|