@holonograph/client 0.5.0 → 0.7.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/dist/index.d.ts +677 -133
- package/dist/index.js +479 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4010,6 +4010,7 @@ var ALL_SUBSTRATE_COLUMN_SEMANTICS = ["deployment-state", "diagnostic"];
|
|
|
4010
4010
|
var SubstrateColumnSemanticSchema = external_exports.enum(ALL_SUBSTRATE_COLUMN_SEMANTICS);
|
|
4011
4011
|
var ALL_EMISSION_EXPECTATIONS = ["always", "conditional"];
|
|
4012
4012
|
var EmissionExpectationSchema = external_exports.enum(ALL_EMISSION_EXPECTATIONS);
|
|
4013
|
+
var SubstrateColumnStatusSchema = external_exports.enum(["active", "forward-declared", "deprecated"]);
|
|
4013
4014
|
var SubstrateColumnSchema = external_exports.object({
|
|
4014
4015
|
id: external_exports.string().min(1).max(128),
|
|
4015
4016
|
control: ControlAttributeSchema,
|
|
@@ -4020,7 +4021,9 @@ var SubstrateColumnSchema = external_exports.object({
|
|
|
4020
4021
|
|
|
4021
4022
|
values: external_exports.array(external_exports.string().min(1)).min(1).optional(),
|
|
4022
4023
|
|
|
4023
|
-
emissionExpectation: EmissionExpectationSchema.optional()
|
|
4024
|
+
emissionExpectation: EmissionExpectationSchema.optional(),
|
|
4025
|
+
|
|
4026
|
+
status: SubstrateColumnStatusSchema.optional()
|
|
4024
4027
|
});
|
|
4025
4028
|
var SubstrateSnapshotSchema = external_exports.object({
|
|
4026
4029
|
lensVersion: LensVersionIdSchema,
|
|
@@ -4094,6 +4097,42 @@ new Set(
|
|
|
4094
4097
|
PLATFORM_SYSTEM_ROLE_SURFACES.map((s) => s.surfaceId)
|
|
4095
4098
|
);
|
|
4096
4099
|
|
|
4100
|
+
var JUDGE_RUBRIC_HASH_COLUMN_ID = "judge.rubric_hash";
|
|
4101
|
+
var JUDGE_CONTEXT_SCOPE_COLUMN_ID = "judge.context_scope";
|
|
4102
|
+
var JUDGE_MODEL_COLUMN_ID = "judge.model";
|
|
4103
|
+
var JUDGE_RESERVED_COLUMN_NAMESPACE_PREFIX = "judge.";
|
|
4104
|
+
var JUDGE_CONTEXT_SCOPES = [
|
|
4105
|
+
"rubric_actual",
|
|
4106
|
+
"rubric_actual_expected",
|
|
4107
|
+
"rubric_actual_expected_toolaware",
|
|
4108
|
+
"full_generating_prompt"
|
|
4109
|
+
];
|
|
4110
|
+
var JudgeContextScopeSchema = external_exports.enum(JUDGE_CONTEXT_SCOPES);
|
|
4111
|
+
var JudgeIdentitySchema = external_exports.object({
|
|
4112
|
+
|
|
4113
|
+
rubricHash: external_exports.string().min(1).optional(),
|
|
4114
|
+
|
|
4115
|
+
contextScope: JudgeContextScopeSchema.optional(),
|
|
4116
|
+
|
|
4117
|
+
model: external_exports.string().min(1).optional()
|
|
4118
|
+
});
|
|
4119
|
+
function judgeIdentityColumns(identity) {
|
|
4120
|
+
const columns = {};
|
|
4121
|
+
if (identity.rubricHash !== void 0) columns[JUDGE_RUBRIC_HASH_COLUMN_ID] = identity.rubricHash;
|
|
4122
|
+
if (identity.contextScope !== void 0)
|
|
4123
|
+
columns[JUDGE_CONTEXT_SCOPE_COLUMN_ID] = identity.contextScope;
|
|
4124
|
+
if (identity.model !== void 0) columns[JUDGE_MODEL_COLUMN_ID] = identity.model;
|
|
4125
|
+
return columns;
|
|
4126
|
+
}
|
|
4127
|
+
var JudgeLensIdentityObservationSchema = external_exports.object({
|
|
4128
|
+
|
|
4129
|
+
rubricHash: external_exports.array(external_exports.string().min(1)).optional(),
|
|
4130
|
+
|
|
4131
|
+
contextScope: external_exports.array(external_exports.string().min(1)).optional(),
|
|
4132
|
+
|
|
4133
|
+
model: external_exports.array(external_exports.string().min(1)).optional()
|
|
4134
|
+
});
|
|
4135
|
+
|
|
4097
4136
|
var CannedMessageRefSchema = external_exports.string().min(1).max(256);
|
|
4098
4137
|
var ALL_GATE_FAILURE_ACTIONS = ["retry", "flag", "block"];
|
|
4099
4138
|
var GateFailureActionSchema = external_exports.enum(ALL_GATE_FAILURE_ACTIONS);
|
|
@@ -4213,6 +4252,8 @@ var SurfaceDeclarationSchema = external_exports.object({
|
|
|
4213
4252
|
|
|
4214
4253
|
status: SurfaceStatusSchema.default("active"),
|
|
4215
4254
|
|
|
4255
|
+
captureJudgedFailures: external_exports.boolean().optional(),
|
|
4256
|
+
|
|
4216
4257
|
removedDimensions: external_exports.array(RemovedDimensionSchema).default([]),
|
|
4217
4258
|
|
|
4218
4259
|
removedCohortTags: external_exports.array(RemovedCohortTagSchema).default([])
|
|
@@ -4249,7 +4290,7 @@ external_exports.object({
|
|
|
4249
4290
|
|
|
4250
4291
|
description: external_exports.string().optional(),
|
|
4251
4292
|
|
|
4252
|
-
surfaces: external_exports.array(SurfaceDeclarationSchema)
|
|
4293
|
+
surfaces: external_exports.array(SurfaceDeclarationSchema),
|
|
4253
4294
|
|
|
4254
4295
|
routings: external_exports.array(SurfaceRoutingSchema).optional(),
|
|
4255
4296
|
|
|
@@ -4257,6 +4298,42 @@ external_exports.object({
|
|
|
4257
4298
|
|
|
4258
4299
|
systemSurfaces: SystemSurfacesSchema.optional()
|
|
4259
4300
|
});
|
|
4301
|
+
var RESERVED_COLUMN_IDS = new Set([
|
|
4302
|
+
|
|
4303
|
+
"lens_version",
|
|
4304
|
+
"light_source_identifier",
|
|
4305
|
+
"run_mode",
|
|
4306
|
+
"correlation_id",
|
|
4307
|
+
"provenance",
|
|
4308
|
+
"timestamp",
|
|
4309
|
+
|
|
4310
|
+
"light_source_served_model"
|
|
4311
|
+
|
|
4312
|
+
]);
|
|
4313
|
+
var SERVED_MODEL_COLUMN_ID = "light_source_served_model";
|
|
4314
|
+
function normalizeColumnId(colId) {
|
|
4315
|
+
return colId.toLowerCase().replace(/[._-]/g, "");
|
|
4316
|
+
}
|
|
4317
|
+
var CANONICAL_APPARATUS_FACET_IDS = [
|
|
4318
|
+
...RESERVED_COLUMN_IDS,
|
|
4319
|
+
JUDGE_RUBRIC_HASH_COLUMN_ID,
|
|
4320
|
+
JUDGE_CONTEXT_SCOPE_COLUMN_ID,
|
|
4321
|
+
JUDGE_MODEL_COLUMN_ID
|
|
4322
|
+
];
|
|
4323
|
+
var NORMALIZED_APPARATUS_FACETS = new Map(
|
|
4324
|
+
CANONICAL_APPARATUS_FACET_IDS.map((id) => [normalizeColumnId(id), id])
|
|
4325
|
+
);
|
|
4326
|
+
new Set(
|
|
4327
|
+
[
|
|
4328
|
+
SERVED_MODEL_COLUMN_ID,
|
|
4329
|
+
JUDGE_RUBRIC_HASH_COLUMN_ID,
|
|
4330
|
+
JUDGE_CONTEXT_SCOPE_COLUMN_ID,
|
|
4331
|
+
JUDGE_MODEL_COLUMN_ID
|
|
4332
|
+
].map(normalizeColumnId)
|
|
4333
|
+
);
|
|
4334
|
+
function isApparatusFacetSpelling(colId) {
|
|
4335
|
+
return NORMALIZED_APPARATUS_FACETS.has(normalizeColumnId(colId));
|
|
4336
|
+
}
|
|
4260
4337
|
|
|
4261
4338
|
var LightSourceRoleSchema = external_exports.enum(["system", "user", "assistant", "tool"]);
|
|
4262
4339
|
var LightSourceContentBlockSchema = external_exports.discriminatedUnion("kind", [
|
|
@@ -4360,6 +4437,8 @@ external_exports.discriminatedUnion("ok", [
|
|
|
4360
4437
|
|
|
4361
4438
|
vendorMetadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
4362
4439
|
|
|
4440
|
+
servedModel: external_exports.string().optional(),
|
|
4441
|
+
|
|
4363
4442
|
stopReason: external_exports.enum(["end_turn", "max_tokens", "tool_use", "stop_sequence", "refusal", "other"]).optional()
|
|
4364
4443
|
}),
|
|
4365
4444
|
external_exports.object({
|
|
@@ -4698,6 +4777,8 @@ var LightSnapshotSchema = external_exports.object({
|
|
|
4698
4777
|
|
|
4699
4778
|
vendorMetadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
4700
4779
|
|
|
4780
|
+
servedModel: external_exports.string().optional(),
|
|
4781
|
+
|
|
4701
4782
|
rawRequestOmitted: external_exports.boolean().optional(),
|
|
4702
4783
|
|
|
4703
4784
|
rawResponsePresence: external_exports.enum(["present", "omitted-by-policy", "pending-attach", "failed-attach"]).optional()
|
|
@@ -4820,7 +4901,9 @@ var NoiseFloorCalibrationSchema = external_exports.object({
|
|
|
4820
4901
|
|
|
4821
4902
|
perFixtureDimension: external_exports.array(NoiseFloorPerFixtureDimensionSchema),
|
|
4822
4903
|
|
|
4823
|
-
perDimensionPooled: external_exports.array(NoiseFloorPerDimensionPooledSchema)
|
|
4904
|
+
perDimensionPooled: external_exports.array(NoiseFloorPerDimensionPooledSchema),
|
|
4905
|
+
|
|
4906
|
+
calibratedUnderJudgeIdentity: JudgeLensIdentityObservationSchema.optional()
|
|
4824
4907
|
});
|
|
4825
4908
|
var VarianceDecompositionConfidenceIntervalSchema = external_exports.object({
|
|
4826
4909
|
lower: external_exports.number().min(0),
|
|
@@ -4835,6 +4918,110 @@ var VarianceLensVersionEntrySchema = external_exports.object({
|
|
|
4835
4918
|
|
|
4836
4919
|
meanScore: external_exports.number()
|
|
4837
4920
|
});
|
|
4921
|
+
var FloorFreshnessSchema = external_exports.object({
|
|
4922
|
+
state: external_exports.enum(["fresh", "stale", "undeterminable"]),
|
|
4923
|
+
|
|
4924
|
+
comparedFacets: external_exports.array(external_exports.string()),
|
|
4925
|
+
|
|
4926
|
+
changedFacets: external_exports.array(external_exports.string()),
|
|
4927
|
+
|
|
4928
|
+
ambiguousFacets: external_exports.array(external_exports.string())
|
|
4929
|
+
});
|
|
4930
|
+
var PhrasingBandRegionSchema = external_exports.object({
|
|
4931
|
+
|
|
4932
|
+
bandMean: external_exports.number().min(0),
|
|
4933
|
+
|
|
4934
|
+
bandMax: external_exports.number().min(0)
|
|
4935
|
+
});
|
|
4936
|
+
external_exports.object({
|
|
4937
|
+
|
|
4938
|
+
version: external_exports.string().min(1),
|
|
4939
|
+
|
|
4940
|
+
frozenAt: external_exports.string().min(1),
|
|
4941
|
+
|
|
4942
|
+
measuredUnder: external_exports.object({
|
|
4943
|
+
judge: external_exports.string().min(1),
|
|
4944
|
+
rubricVersion: external_exports.string().min(1)
|
|
4945
|
+
}),
|
|
4946
|
+
|
|
4947
|
+
boundaries: external_exports.object({
|
|
4948
|
+
|
|
4949
|
+
ceilingLo: external_exports.number(),
|
|
4950
|
+
|
|
4951
|
+
floorHi: external_exports.number(),
|
|
4952
|
+
|
|
4953
|
+
midMeasuredRange: external_exports.object({ lo: external_exports.number(), hi: external_exports.number() })
|
|
4954
|
+
}),
|
|
4955
|
+
regions: external_exports.object({
|
|
4956
|
+
ceiling: PhrasingBandRegionSchema,
|
|
4957
|
+
mid: PhrasingBandRegionSchema,
|
|
4958
|
+
floor: PhrasingBandRegionSchema
|
|
4959
|
+
})
|
|
4960
|
+
});
|
|
4961
|
+
var FloorRegionSchema = external_exports.object({
|
|
4962
|
+
|
|
4963
|
+
region: external_exports.enum(["ceiling", "mid", "floor"]),
|
|
4964
|
+
|
|
4965
|
+
calibrationRegion: external_exports.enum(["ceiling", "mid", "floor"]).optional(),
|
|
4966
|
+
|
|
4967
|
+
calibrationScoreCount: external_exports.number().int().min(0).optional(),
|
|
4968
|
+
|
|
4969
|
+
bandMean: external_exports.number().min(0),
|
|
4970
|
+
|
|
4971
|
+
bandMax: external_exports.number().min(0),
|
|
4972
|
+
|
|
4973
|
+
bandExtrapolated: external_exports.boolean(),
|
|
4974
|
+
|
|
4975
|
+
calibrationBandExtrapolated: external_exports.boolean().optional(),
|
|
4976
|
+
|
|
4977
|
+
windowStraddlesBoundary: external_exports.boolean().optional(),
|
|
4978
|
+
|
|
4979
|
+
counterfactualSigmaAgentDelta: external_exports.number().nullable(),
|
|
4980
|
+
|
|
4981
|
+
counterfactualUnavailableReason: external_exports.enum(["no_calibration_scores", "calibration_region_degenerate"]).optional(),
|
|
4982
|
+
|
|
4983
|
+
curveProvenance: external_exports.object({
|
|
4984
|
+
version: external_exports.string(),
|
|
4985
|
+
judge: external_exports.string(),
|
|
4986
|
+
rubricVersion: external_exports.string()
|
|
4987
|
+
})
|
|
4988
|
+
});
|
|
4989
|
+
var LensCompositeCorrectionSchema = external_exports.object({
|
|
4990
|
+
|
|
4991
|
+
correctedVarianceLens: external_exports.number().min(0),
|
|
4992
|
+
|
|
4993
|
+
reattributedFromResidual: external_exports.number(),
|
|
4994
|
+
|
|
4995
|
+
compositeGroupCount: external_exports.number().int().min(1),
|
|
4996
|
+
|
|
4997
|
+
bracketedFacets: external_exports.array(external_exports.string()),
|
|
4998
|
+
|
|
4999
|
+
bracketedFacetLevels: external_exports.array(external_exports.object({ facet: external_exports.string(), distinctLevels: external_exports.number().int().min(1) })).optional(),
|
|
5000
|
+
|
|
5001
|
+
conservationHolds: external_exports.boolean(),
|
|
5002
|
+
|
|
5003
|
+
partitionRelationship: external_exports.enum([
|
|
5004
|
+
"degenerate",
|
|
5005
|
+
"identical",
|
|
5006
|
+
"judge-refines-version",
|
|
5007
|
+
"version-refines-judge",
|
|
5008
|
+
"cross-cutting"
|
|
5009
|
+
])
|
|
5010
|
+
});
|
|
5011
|
+
var ApparatusFacetDriftSchema = external_exports.object({
|
|
5012
|
+
facet: external_exports.string(),
|
|
5013
|
+
basis: external_exports.enum(["reserved-namespace", "declared-control"]),
|
|
5014
|
+
|
|
5015
|
+
control: ControlAttributeSchema.optional()
|
|
5016
|
+
});
|
|
5017
|
+
var ApparatusResidualContaminationSchema = external_exports.object({
|
|
5018
|
+
|
|
5019
|
+
contaminated: external_exports.boolean(),
|
|
5020
|
+
|
|
5021
|
+
driftedFacets: external_exports.array(ApparatusFacetDriftSchema),
|
|
5022
|
+
|
|
5023
|
+
scope: external_exports.enum(["reserved-only", "contract-resolved"]).optional()
|
|
5024
|
+
});
|
|
4838
5025
|
var VarianceDecompositionSchema = external_exports.object({
|
|
4839
5026
|
dimensionId: DimensionIdSchema,
|
|
4840
5027
|
|
|
@@ -4865,7 +5052,17 @@ var VarianceDecompositionSchema = external_exports.object({
|
|
|
4865
5052
|
|
|
4866
5053
|
sigmaAgentCI: VarianceDecompositionConfidenceIntervalSchema,
|
|
4867
5054
|
|
|
4868
|
-
caveats: external_exports.array(external_exports.string()).default([])
|
|
5055
|
+
caveats: external_exports.array(external_exports.string()).default([]),
|
|
5056
|
+
|
|
5057
|
+
floorFreshness: FloorFreshnessSchema.optional(),
|
|
5058
|
+
|
|
5059
|
+
floorRegion: FloorRegionSchema.optional(),
|
|
5060
|
+
|
|
5061
|
+
lensCompositeCorrection: LensCompositeCorrectionSchema.optional(),
|
|
5062
|
+
|
|
5063
|
+
apparatusResidualContamination: ApparatusResidualContaminationSchema.optional(),
|
|
5064
|
+
|
|
5065
|
+
decompositionMethodVersion: external_exports.string().optional()
|
|
4869
5066
|
});
|
|
4870
5067
|
var LifecycleTransitionStatusSchema = external_exports.enum([
|
|
4871
5068
|
"draft",
|
|
@@ -4914,7 +5111,8 @@ var EvalRecommendationVerdictSchema = external_exports.enum([
|
|
|
4914
5111
|
"contaminated",
|
|
4915
5112
|
"insufficient-n",
|
|
4916
5113
|
"degenerate",
|
|
4917
|
-
"instrument-limited"
|
|
5114
|
+
"instrument-limited",
|
|
5115
|
+
"stale-floor"
|
|
4918
5116
|
]);
|
|
4919
5117
|
var EvalRecommendationCheckSchema = external_exports.object({
|
|
4920
5118
|
name: external_exports.string().min(1).max(128),
|
|
@@ -5330,6 +5528,193 @@ external_exports.object({
|
|
|
5330
5528
|
external_exports.enum(["classificationMode"]);
|
|
5331
5529
|
external_exports.enum(["prefix-match", "absent-defaulted"]);
|
|
5332
5530
|
|
|
5531
|
+
var RELIABILITY_DISPOSITIONS = ["flagged", "assessed", "not-applicable"];
|
|
5532
|
+
var ReliabilityDispositionSchema = external_exports.enum(RELIABILITY_DISPOSITIONS);
|
|
5533
|
+
var RELIABILITY_FIRING_STAGES = ["config", "score", "window"];
|
|
5534
|
+
var ReliabilityFiringStageSchema = external_exports.enum(RELIABILITY_FIRING_STAGES);
|
|
5535
|
+
var ReliabilityCorpusFindingSchema = external_exports.object({
|
|
5536
|
+
|
|
5537
|
+
entryId: external_exports.string().min(1),
|
|
5538
|
+
|
|
5539
|
+
failureMode: external_exports.string().min(1),
|
|
5540
|
+
|
|
5541
|
+
disposition: ReliabilityDispositionSchema,
|
|
5542
|
+
|
|
5543
|
+
remediation: external_exports.string().min(1).nullable(),
|
|
5544
|
+
|
|
5545
|
+
firesAt: ReliabilityFiringStageSchema,
|
|
5546
|
+
|
|
5547
|
+
tier: external_exports.literal("deterministic"),
|
|
5548
|
+
|
|
5549
|
+
evidence: external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])).optional()
|
|
5550
|
+
});
|
|
5551
|
+
external_exports.object({
|
|
5552
|
+
|
|
5553
|
+
corpusVersion: external_exports.string().min(1),
|
|
5554
|
+
|
|
5555
|
+
corpusHash: external_exports.string().min(1),
|
|
5556
|
+
|
|
5557
|
+
findings: external_exports.array(ReliabilityCorpusFindingSchema)
|
|
5558
|
+
});
|
|
5559
|
+
var ReliabilityCorpusEntryRateSchema = external_exports.object({
|
|
5560
|
+
entryId: external_exports.string().min(1),
|
|
5561
|
+
|
|
5562
|
+
evaluated: external_exports.number().int().nonnegative(),
|
|
5563
|
+
|
|
5564
|
+
flagged: external_exports.number().int().nonnegative(),
|
|
5565
|
+
|
|
5566
|
+
assessed: external_exports.number().int().nonnegative(),
|
|
5567
|
+
|
|
5568
|
+
notApplicable: external_exports.number().int().nonnegative(),
|
|
5569
|
+
|
|
5570
|
+
firingRateAmongApplicable: external_exports.number().min(0).max(1).nullable()
|
|
5571
|
+
});
|
|
5572
|
+
var ReliabilityCorpusRatesSchema = external_exports.object({
|
|
5573
|
+
corpusVersion: external_exports.string().min(1),
|
|
5574
|
+
corpusHash: external_exports.string().min(1),
|
|
5575
|
+
|
|
5576
|
+
evaluationCount: external_exports.number().int().nonnegative(),
|
|
5577
|
+
perEntry: external_exports.array(ReliabilityCorpusEntryRateSchema)
|
|
5578
|
+
});
|
|
5579
|
+
var TraceClaimCheckSchema = external_exports.object({
|
|
5580
|
+
|
|
5581
|
+
tool: external_exports.string().min(1),
|
|
5582
|
+
|
|
5583
|
+
invoked: external_exports.boolean(),
|
|
5584
|
+
disposition: external_exports.enum(["corroborated", "contradicted"])
|
|
5585
|
+
});
|
|
5586
|
+
var TRACE_CORROBORATION_DISPOSITIONS = [
|
|
5587
|
+
"contradicted",
|
|
5588
|
+
"corroborated",
|
|
5589
|
+
"no-marker-to-check",
|
|
5590
|
+
"not-applicable"
|
|
5591
|
+
];
|
|
5592
|
+
var TraceCorroborationDispositionSchema = external_exports.enum(TRACE_CORROBORATION_DISPOSITIONS);
|
|
5593
|
+
var TraceCorroborationSchema = external_exports.object({
|
|
5594
|
+
|
|
5595
|
+
disposition: TraceCorroborationDispositionSchema,
|
|
5596
|
+
|
|
5597
|
+
tier: external_exports.literal("deterministic"),
|
|
5598
|
+
|
|
5599
|
+
claims: external_exports.array(TraceClaimCheckSchema)
|
|
5600
|
+
});
|
|
5601
|
+
var MatchTierSchema = external_exports.discriminatedUnion("kind", [
|
|
5602
|
+
|
|
5603
|
+
external_exports.object({ kind: external_exports.literal("exact") }),
|
|
5604
|
+
|
|
5605
|
+
external_exports.object({ kind: external_exports.literal("normalized") }),
|
|
5606
|
+
|
|
5607
|
+
external_exports.object({ kind: external_exports.literal("fuzzy"), threshold: external_exports.number().min(0).max(1) })
|
|
5608
|
+
]);
|
|
5609
|
+
var GROUNDING_CLAIM_DISPOSITIONS = [
|
|
5610
|
+
"present-in-scope",
|
|
5611
|
+
"truncated-out",
|
|
5612
|
+
"not-found"
|
|
5613
|
+
];
|
|
5614
|
+
var GroundingClaimDispositionSchema = external_exports.enum(GROUNDING_CLAIM_DISPOSITIONS);
|
|
5615
|
+
var GroundingClaimCheckSchema = external_exports.object({
|
|
5616
|
+
|
|
5617
|
+
datum: external_exports.string().min(1),
|
|
5618
|
+
disposition: GroundingClaimDispositionSchema,
|
|
5619
|
+
|
|
5620
|
+
matchTier: MatchTierSchema.optional(),
|
|
5621
|
+
|
|
5622
|
+
charOffset: external_exports.number().int().nonnegative().optional()
|
|
5623
|
+
});
|
|
5624
|
+
var GROUNDING_COVERAGE_DISPOSITIONS = [
|
|
5625
|
+
"present-in-scope",
|
|
5626
|
+
"truncated-out",
|
|
5627
|
+
"not-found",
|
|
5628
|
+
"no-marker-to-check",
|
|
5629
|
+
"not-applicable"
|
|
5630
|
+
];
|
|
5631
|
+
var GroundingCoverageDispositionSchema = external_exports.enum(GROUNDING_COVERAGE_DISPOSITIONS);
|
|
5632
|
+
var GroundingCoverageSchema = external_exports.object({
|
|
5633
|
+
disposition: GroundingCoverageDispositionSchema,
|
|
5634
|
+
|
|
5635
|
+
tier: external_exports.literal("deterministic"),
|
|
5636
|
+
|
|
5637
|
+
claims: external_exports.array(GroundingClaimCheckSchema)
|
|
5638
|
+
});
|
|
5639
|
+
var VERDICT_RELIABILITY_TIERS = ["question", "trust", "review"];
|
|
5640
|
+
var VerdictReliabilityTierSchema = external_exports.enum(VERDICT_RELIABILITY_TIERS);
|
|
5641
|
+
external_exports.object({
|
|
5642
|
+
|
|
5643
|
+
tier: VerdictReliabilityTierSchema,
|
|
5644
|
+
|
|
5645
|
+
drivers: external_exports.array(external_exports.string()),
|
|
5646
|
+
|
|
5647
|
+
trace: TraceCorroborationSchema,
|
|
5648
|
+
|
|
5649
|
+
grounding: GroundingCoverageSchema
|
|
5650
|
+
});
|
|
5651
|
+
var VerdictReliabilityTierTallySchema = external_exports.object({
|
|
5652
|
+
question: external_exports.number().int().nonnegative(),
|
|
5653
|
+
trust: external_exports.number().int().nonnegative(),
|
|
5654
|
+
review: external_exports.number().int().nonnegative(),
|
|
5655
|
+
total: external_exports.number().int().nonnegative()
|
|
5656
|
+
});
|
|
5657
|
+
var FlaggedVerdictSchema = external_exports.object({
|
|
5658
|
+
|
|
5659
|
+
eventId: external_exports.string().min(1),
|
|
5660
|
+
|
|
5661
|
+
correlationId: external_exports.string().min(1).optional(),
|
|
5662
|
+
|
|
5663
|
+
occurredAt: external_exports.string().min(1),
|
|
5664
|
+
surfaceId: external_exports.string().min(1),
|
|
5665
|
+
dimensionId: external_exports.string().min(1),
|
|
5666
|
+
|
|
5667
|
+
drivers: external_exports.array(external_exports.string())
|
|
5668
|
+
});
|
|
5669
|
+
external_exports.object({
|
|
5670
|
+
|
|
5671
|
+
eventCount: external_exports.number().int().nonnegative(),
|
|
5672
|
+
|
|
5673
|
+
tierTally: VerdictReliabilityTierTallySchema,
|
|
5674
|
+
|
|
5675
|
+
flagged: external_exports.array(FlaggedVerdictSchema),
|
|
5676
|
+
|
|
5677
|
+
corpusRates: ReliabilityCorpusRatesSchema
|
|
5678
|
+
});
|
|
5679
|
+
var ESCALATION_REASONS = ["both-checks-not-applicable"];
|
|
5680
|
+
var EscalationReasonSchema = external_exports.enum(ESCALATION_REASONS);
|
|
5681
|
+
external_exports.object({
|
|
5682
|
+
|
|
5683
|
+
targetEventId: external_exports.string().min(1),
|
|
5684
|
+
surfaceId: external_exports.string().min(1),
|
|
5685
|
+
dimensionId: external_exports.string().min(1),
|
|
5686
|
+
|
|
5687
|
+
reason: EscalationReasonSchema
|
|
5688
|
+
});
|
|
5689
|
+
var JudgeVerdictSchema = external_exports.object({
|
|
5690
|
+
|
|
5691
|
+
score: external_exports.number().optional(),
|
|
5692
|
+
|
|
5693
|
+
passed: external_exports.boolean()
|
|
5694
|
+
});
|
|
5695
|
+
external_exports.object({
|
|
5696
|
+
|
|
5697
|
+
targetEventId: external_exports.string().min(1),
|
|
5698
|
+
surfaceId: external_exports.string().min(1),
|
|
5699
|
+
dimensionId: external_exports.string().min(1),
|
|
5700
|
+
|
|
5701
|
+
blind: external_exports.literal(true),
|
|
5702
|
+
|
|
5703
|
+
firstVerdict: JudgeVerdictSchema,
|
|
5704
|
+
|
|
5705
|
+
secondVerdict: JudgeVerdictSchema,
|
|
5706
|
+
|
|
5707
|
+
secondJudge: JudgeIdentitySchema,
|
|
5708
|
+
|
|
5709
|
+
secondJudgeInstrumentVersion: external_exports.string().min(1)
|
|
5710
|
+
});
|
|
5711
|
+
external_exports.object({
|
|
5712
|
+
escalatedCount: external_exports.number().int().nonnegative(),
|
|
5713
|
+
agreeCount: external_exports.number().int().nonnegative(),
|
|
5714
|
+
disagreeCount: external_exports.number().int().nonnegative(),
|
|
5715
|
+
agreementRate: external_exports.number().min(0).max(1).nullable()
|
|
5716
|
+
});
|
|
5717
|
+
|
|
5333
5718
|
var HolonographGradeAfterReportError = class extends Error {
|
|
5334
5719
|
constructor() {
|
|
5335
5720
|
super(
|
|
@@ -6252,12 +6637,22 @@ var HolonographClient = class {
|
|
|
6252
6637
|
|
|
6253
6638
|
onUnknownColumn;
|
|
6254
6639
|
|
|
6640
|
+
onUnknownColumnExplicit;
|
|
6641
|
+
|
|
6642
|
+
unknownColumnDeprecationWarned = false;
|
|
6643
|
+
|
|
6255
6644
|
declaredColumns;
|
|
6256
6645
|
|
|
6257
6646
|
warnedColumns = new Set();
|
|
6258
6647
|
|
|
6259
6648
|
refreshedColumnsOnce = false;
|
|
6260
6649
|
|
|
6650
|
+
onCoverageDivergence;
|
|
6651
|
+
|
|
6652
|
+
coverageDivergenceChecked = false;
|
|
6653
|
+
|
|
6654
|
+
emitNonBlocking;
|
|
6655
|
+
|
|
6261
6656
|
messages;
|
|
6262
6657
|
|
|
6263
6658
|
contract;
|
|
@@ -6292,6 +6687,9 @@ var HolonographClient = class {
|
|
|
6292
6687
|
this.lensVersion = options.lensVersion;
|
|
6293
6688
|
this.substrate = options.substrate;
|
|
6294
6689
|
this.onUnknownColumn = isHttpOptions(options) ? options.onUnknownColumn ?? "warn" : "ignore";
|
|
6690
|
+
this.onUnknownColumnExplicit = isHttpOptions(options) && options.onUnknownColumn !== void 0;
|
|
6691
|
+
this.onCoverageDivergence = isHttpOptions(options) ? options.onCoverageDivergence ?? "warn" : "ignore";
|
|
6692
|
+
this.emitNonBlocking = isHttpOptions(options) && options.emit?.mode !== void 0 && options.emit.mode !== "sync";
|
|
6295
6693
|
this.messages = { create: (req) => this.messagesCreate(req) };
|
|
6296
6694
|
this.contract = { register: (c) => this.registerContract(c) };
|
|
6297
6695
|
this.availability = { mark: (req, opts) => this.markAvailability(req, opts) };
|
|
@@ -6373,20 +6771,46 @@ var HolonographClient = class {
|
|
|
6373
6771
|
return this.declaredColumns;
|
|
6374
6772
|
}
|
|
6375
6773
|
|
|
6774
|
+
apparatusStampedColumns(light, judgeIdentity) {
|
|
6775
|
+
const columns = { ...this.substrate.columns };
|
|
6776
|
+
if (light.servedModel !== void 0) columns[SERVED_MODEL_COLUMN_ID] = light.servedModel;
|
|
6777
|
+
if (judgeIdentity !== void 0) Object.assign(columns, judgeIdentityColumns(judgeIdentity));
|
|
6778
|
+
return columns;
|
|
6779
|
+
}
|
|
6780
|
+
|
|
6376
6781
|
async validateSubstrateColumns(columns) {
|
|
6377
6782
|
if (columns === void 0 || this.onUnknownColumn === "ignore" || this.transport.getContract === void 0) {
|
|
6378
6783
|
return;
|
|
6379
6784
|
}
|
|
6380
|
-
const keys = Object.keys(columns)
|
|
6785
|
+
const keys = Object.keys(columns).filter(
|
|
6786
|
+
(k) => k !== SERVED_MODEL_COLUMN_ID && !k.startsWith(JUDGE_RESERVED_COLUMN_NAMESPACE_PREFIX)
|
|
6787
|
+
);
|
|
6381
6788
|
if (keys.length === 0) return;
|
|
6789
|
+
const apparatusSpellArounds = keys.filter((k) => isApparatusFacetSpelling(k));
|
|
6790
|
+
const substrateKeys = keys.filter((k) => !isApparatusFacetSpelling(k));
|
|
6791
|
+
if (apparatusSpellArounds.length > 0) {
|
|
6792
|
+
if (this.onUnknownColumn === "throw") {
|
|
6793
|
+
throw new Error(
|
|
6794
|
+
`Holonograph: substrate column(s) collide with apparatus-owned lens identity: ${apparatusSpellArounds.join(", ")}. These normalize to columns the apparatus stamps itself (read the 'judge.*' / 'light_source_served_model' columns) \u2014 remove them from your substrate. (onUnknownColumn: 'throw')`
|
|
6795
|
+
);
|
|
6796
|
+
}
|
|
6797
|
+
const toWarn2 = apparatusSpellArounds.filter((k) => !this.warnedColumns.has(k));
|
|
6798
|
+
if (toWarn2.length > 0) {
|
|
6799
|
+
for (const k of toWarn2) this.warnedColumns.add(k);
|
|
6800
|
+
console.warn(
|
|
6801
|
+
`Holonograph: substrate column(s) collide with apparatus-owned lens identity: ${toWarn2.join(", ")}. The apparatus stamps its own identity ('judge.*', 'light_source_served_model'); a substrate look-alike is not read as an axis \u2014 read the apparatus-stamped columns instead. (onUnknownColumn: 'throw' to block, 'ignore' to silence.)`
|
|
6802
|
+
);
|
|
6803
|
+
}
|
|
6804
|
+
}
|
|
6805
|
+
if (substrateKeys.length === 0) return;
|
|
6382
6806
|
const declared = await this.fetchDeclaredColumns();
|
|
6383
6807
|
if (declared === null || declared.size === 0) return;
|
|
6384
|
-
let unknown =
|
|
6808
|
+
let unknown = substrateKeys.filter((k) => !declared.has(k));
|
|
6385
6809
|
if (unknown.length > 0 && !this.refreshedColumnsOnce) {
|
|
6386
6810
|
this.refreshedColumnsOnce = true;
|
|
6387
6811
|
const refreshed = await this.fetchDeclaredColumns(true);
|
|
6388
6812
|
if (refreshed === null || refreshed.size === 0) return;
|
|
6389
|
-
unknown =
|
|
6813
|
+
unknown = substrateKeys.filter((k) => !refreshed.has(k));
|
|
6390
6814
|
}
|
|
6391
6815
|
if (unknown.length === 0) return;
|
|
6392
6816
|
if (this.onUnknownColumn === "throw") {
|
|
@@ -6400,6 +6824,42 @@ var HolonographClient = class {
|
|
|
6400
6824
|
console.warn(
|
|
6401
6825
|
`Holonograph: substrate column(s) declared in no surface contract: ${toWarn.join(", ")}. They are still emitted, but the lens won't recognize them \u2014 declare them on the contract or fix the typo. (onUnknownColumn: 'throw' to block, 'ignore' to silence.)`
|
|
6402
6826
|
);
|
|
6827
|
+
if (!this.onUnknownColumnExplicit && !this.unknownColumnDeprecationWarned) {
|
|
6828
|
+
this.unknownColumnDeprecationWarned = true;
|
|
6829
|
+
console.warn(
|
|
6830
|
+
`Holonograph: DEPRECATION \u2014 the default onUnknownColumn will change from 'warn' to 'throw' in the next @holonograph/client major, so an undeclared substrate column will be REJECTED rather than logged. Declare your columns on the surface contract, or set onUnknownColumn: 'warn' explicitly to keep warn-and-continue. (This notice fires once.)`
|
|
6831
|
+
);
|
|
6832
|
+
}
|
|
6833
|
+
}
|
|
6834
|
+
|
|
6835
|
+
async maybeSurfaceCoverageDivergence() {
|
|
6836
|
+
const getEmission = this.transport.getEmission?.bind(this.transport);
|
|
6837
|
+
if (this.onCoverageDivergence === "ignore" || this.emitNonBlocking || // never block the fast-resolve emit modes
|
|
6838
|
+
this.coverageDivergenceChecked || getEmission === void 0) {
|
|
6839
|
+
return;
|
|
6840
|
+
}
|
|
6841
|
+
this.coverageDivergenceChecked = true;
|
|
6842
|
+
const audit = await getEmission().catch(() => void 0);
|
|
6843
|
+
if (audit === void 0) return;
|
|
6844
|
+
const undeclared = [];
|
|
6845
|
+
const missing = [];
|
|
6846
|
+
const apparatus = [];
|
|
6847
|
+
for (const surface of audit.surfaces) {
|
|
6848
|
+
for (const col of surface.undeclaredObserved) undeclared.push(`${surface.surfaceId}.${col}`);
|
|
6849
|
+
for (const row of surface.columns) {
|
|
6850
|
+
if (row.verdict === "missing") missing.push(`${surface.surfaceId}.${row.columnId}`);
|
|
6851
|
+
}
|
|
6852
|
+
for (const col of surface.apparatusObserved) apparatus.push(`${surface.surfaceId}.${col}`);
|
|
6853
|
+
}
|
|
6854
|
+
if (undeclared.length === 0 && missing.length === 0) return;
|
|
6855
|
+
const parts = [];
|
|
6856
|
+
if (undeclared.length > 0) parts.push(`emitted-but-undeclared: ${undeclared.join(", ")}`);
|
|
6857
|
+
if (missing.length > 0) {
|
|
6858
|
+
parts.push(`declared-but-never-emitted (missing): ${missing.join(", ")}`);
|
|
6859
|
+
}
|
|
6860
|
+
console.warn(
|
|
6861
|
+
`Holonograph: declared-vs-emitted coverage divergence \u2014 ${parts.join("; ")}. See GET /holonograph/emission for the full audit` + (apparatus.length > 0 ? ` (apparatus columns observed: ${apparatus.join(", ")})` : "") + `. (onCoverageDivergence: 'ignore' to silence.)`
|
|
6862
|
+
);
|
|
6403
6863
|
}
|
|
6404
6864
|
async registerContract(contract) {
|
|
6405
6865
|
if (typeof this.transport.postContract !== "function") {
|
|
@@ -6494,11 +6954,16 @@ var HolonographClient = class {
|
|
|
6494
6954
|
lensVersion: this.lensVersion,
|
|
6495
6955
|
light: callResult.record.light,
|
|
6496
6956
|
|
|
6497
|
-
substrate: {
|
|
6957
|
+
substrate: {
|
|
6958
|
+
...this.substrate,
|
|
6959
|
+
lightSourceIdentifier: callResult.record.lightSourceId,
|
|
6960
|
+
columns: this.apparatusStampedColumns(callResult.record.light, outcome.judgeIdentity)
|
|
6961
|
+
},
|
|
6498
6962
|
surface
|
|
6499
6963
|
});
|
|
6500
6964
|
await this.validateSubstrateColumns(event.substrate?.columns);
|
|
6501
6965
|
await this.transport.appendEvent(event);
|
|
6966
|
+
await this.maybeSurfaceCoverageDivergence();
|
|
6502
6967
|
if (callResult.observerRecords && callResult.observerRecords.length > 0) {
|
|
6503
6968
|
const siblingCohortTags = baseCohortTags;
|
|
6504
6969
|
for (const observerRecord of callResult.observerRecords) {
|
|
@@ -6576,7 +7041,11 @@ var HolonographClient = class {
|
|
|
6576
7041
|
lensVersion: this.lensVersion,
|
|
6577
7042
|
light: record.light,
|
|
6578
7043
|
|
|
6579
|
-
substrate: {
|
|
7044
|
+
substrate: {
|
|
7045
|
+
...this.substrate,
|
|
7046
|
+
lightSourceIdentifier: record.lightSourceId,
|
|
7047
|
+
columns: this.apparatusStampedColumns(record.light)
|
|
7048
|
+
},
|
|
6580
7049
|
surface: observerSurface
|
|
6581
7050
|
});
|
|
6582
7051
|
await this.transport.appendEvent(event);
|
package/package.json
CHANGED