@takk/bayesoutputgate 1.0.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/LICENSE +190 -0
  3. package/NOTICE +45 -0
  4. package/README.md +403 -0
  5. package/SECURITY.md +98 -0
  6. package/SPEC.md +467 -0
  7. package/dist/adapter/index.cjs +411 -0
  8. package/dist/adapter/index.d.cts +29 -0
  9. package/dist/adapter/index.d.ts +29 -0
  10. package/dist/adapter/index.js +404 -0
  11. package/dist/audit/index.cjs +82 -0
  12. package/dist/audit/index.d.cts +40 -0
  13. package/dist/audit/index.d.ts +40 -0
  14. package/dist/audit/index.js +77 -0
  15. package/dist/bayesfactor/index.cjs +152 -0
  16. package/dist/bayesfactor/index.d.cts +15 -0
  17. package/dist/bayesfactor/index.d.ts +15 -0
  18. package/dist/bayesfactor/index.js +149 -0
  19. package/dist/beta/index.cjs +180 -0
  20. package/dist/beta/index.d.cts +45 -0
  21. package/dist/beta/index.d.ts +45 -0
  22. package/dist/beta/index.js +178 -0
  23. package/dist/calibration/index.cjs +339 -0
  24. package/dist/calibration/index.d.cts +53 -0
  25. package/dist/calibration/index.d.ts +53 -0
  26. package/dist/calibration/index.js +333 -0
  27. package/dist/cli/index.cjs +968 -0
  28. package/dist/cli/index.d.cts +1 -0
  29. package/dist/cli/index.d.ts +1 -0
  30. package/dist/cli/index.js +966 -0
  31. package/dist/dimensions/index.cjs +106 -0
  32. package/dist/dimensions/index.d.cts +33 -0
  33. package/dist/dimensions/index.d.ts +33 -0
  34. package/dist/dimensions/index.js +104 -0
  35. package/dist/edge/index.cjs +1141 -0
  36. package/dist/edge/index.d.cts +12 -0
  37. package/dist/edge/index.d.ts +12 -0
  38. package/dist/edge/index.js +1109 -0
  39. package/dist/gate/index.cjs +803 -0
  40. package/dist/gate/index.d.cts +77 -0
  41. package/dist/gate/index.d.ts +77 -0
  42. package/dist/gate/index.js +799 -0
  43. package/dist/hypothesis/index.cjs +268 -0
  44. package/dist/hypothesis/index.d.cts +38 -0
  45. package/dist/hypothesis/index.d.ts +38 -0
  46. package/dist/hypothesis/index.js +266 -0
  47. package/dist/index.cjs +1141 -0
  48. package/dist/index.d.cts +29 -0
  49. package/dist/index.d.ts +29 -0
  50. package/dist/index.js +1109 -0
  51. package/dist/likelihood/index.cjs +137 -0
  52. package/dist/likelihood/index.d.cts +23 -0
  53. package/dist/likelihood/index.d.ts +23 -0
  54. package/dist/likelihood/index.js +132 -0
  55. package/dist/node/index.cjs +1282 -0
  56. package/dist/node/index.d.cts +24 -0
  57. package/dist/node/index.d.ts +24 -0
  58. package/dist/node/index.js +1246 -0
  59. package/dist/policy/index.cjs +88 -0
  60. package/dist/policy/index.d.cts +11 -0
  61. package/dist/policy/index.d.ts +11 -0
  62. package/dist/policy/index.js +85 -0
  63. package/dist/types-bMjn1j4e.d.cts +159 -0
  64. package/dist/types-bMjn1j4e.d.ts +159 -0
  65. package/package.json +142 -0
@@ -0,0 +1,29 @@
1
+ export { TOOL_NAME, bayesOutputGateTool, describeTool, parseGateInput, runTool, toJsonSafe } from './adapter/index.cjs';
2
+ export { AuditChain, AuditEntry, AuditMeta, ChainVerification, GENESIS_HASH, sha256Hex, verifyChain } from './audit/index.cjs';
3
+ export { bayesFactor, jeffreysStrength } from './bayesfactor/index.cjs';
4
+ export { BetaModel, BetaModelOptions, BetaModelSnapshot } from './beta/index.cjs';
5
+ export { AssessOptions, GoodnessOfFit, Prediction, ReliabilityBin, assessAssumptions, brierScore, expectedCalibrationError, goodnessOfFit, reliability } from './calibration/index.cjs';
6
+ export { DependenceDiagnostic, DependenceOptions, DimensionCorrelation, dependenceDiagnostic } from './dimensions/index.cjs';
7
+ export { MonitorGuards, OutputGate, OutputGateMonitor, OutputGateMonitorOptions, OutputGateOptions, evaluate } from './gate/index.cjs';
8
+ export { DimensionConfig, HypothesisManager, HypothesisManagerOptions } from './hypothesis/index.cjs';
9
+ export { logBinaryMarginalLikelihood, logScoreLikelihood, logVectorLikelihood, toScoreMap } from './likelihood/index.cjs';
10
+ export { decide, posteriorHighQuality } from './policy/index.cjs';
11
+ export { A as AssumptionReport, B as BayesFactorPolicy, a as BayesFactorResult, b as BetaParams, D as DecisionPolicy, c as DecisionTheoreticPolicy, d as DimensionContribution, e as DimensionModel, E as EvidenceStrength, f as ExpectedLoss, G as GateAction, g as GateDecision, h as GateGuards, H as HypothesisKind, L as LabeledObservation, P as PolicyConfig, i as PolicyDecision, Q as QualityScore, S as ScoreVector } from './types-bMjn1j4e.cjs';
12
+
13
+ /**
14
+ * Stable, machine-readable codes for every failure mode the gate can raise. Callers switch on
15
+ * `error.code` rather than parsing messages.
16
+ */
17
+ type BayesOutputGateErrorCode = "INVALID_CONFIG" | "INVALID_SCORE" | "INVALID_DIMENSION" | "INVALID_HYPOTHESIS" | "INVALID_OBSERVATION" | "INVALID_STATE" | "INVALID_SNAPSHOT" | "NUMERIC";
18
+ /** The only error type the package throws. */
19
+ declare class BayesOutputGateError extends Error {
20
+ readonly code: BayesOutputGateErrorCode;
21
+ constructor(code: BayesOutputGateErrorCode, message: string);
22
+ }
23
+ /**
24
+ * Throw a {@link BayesOutputGateError} with the given code when `condition` is falsy. Narrows the
25
+ * type for the caller on the happy path.
26
+ */
27
+ declare function invariant(condition: unknown, code: BayesOutputGateErrorCode, message: string): asserts condition;
28
+
29
+ export { BayesOutputGateError, type BayesOutputGateErrorCode, invariant };
@@ -0,0 +1,29 @@
1
+ export { TOOL_NAME, bayesOutputGateTool, describeTool, parseGateInput, runTool, toJsonSafe } from './adapter/index.js';
2
+ export { AuditChain, AuditEntry, AuditMeta, ChainVerification, GENESIS_HASH, sha256Hex, verifyChain } from './audit/index.js';
3
+ export { bayesFactor, jeffreysStrength } from './bayesfactor/index.js';
4
+ export { BetaModel, BetaModelOptions, BetaModelSnapshot } from './beta/index.js';
5
+ export { AssessOptions, GoodnessOfFit, Prediction, ReliabilityBin, assessAssumptions, brierScore, expectedCalibrationError, goodnessOfFit, reliability } from './calibration/index.js';
6
+ export { DependenceDiagnostic, DependenceOptions, DimensionCorrelation, dependenceDiagnostic } from './dimensions/index.js';
7
+ export { MonitorGuards, OutputGate, OutputGateMonitor, OutputGateMonitorOptions, OutputGateOptions, evaluate } from './gate/index.js';
8
+ export { DimensionConfig, HypothesisManager, HypothesisManagerOptions } from './hypothesis/index.js';
9
+ export { logBinaryMarginalLikelihood, logScoreLikelihood, logVectorLikelihood, toScoreMap } from './likelihood/index.js';
10
+ export { decide, posteriorHighQuality } from './policy/index.js';
11
+ export { A as AssumptionReport, B as BayesFactorPolicy, a as BayesFactorResult, b as BetaParams, D as DecisionPolicy, c as DecisionTheoreticPolicy, d as DimensionContribution, e as DimensionModel, E as EvidenceStrength, f as ExpectedLoss, G as GateAction, g as GateDecision, h as GateGuards, H as HypothesisKind, L as LabeledObservation, P as PolicyConfig, i as PolicyDecision, Q as QualityScore, S as ScoreVector } from './types-bMjn1j4e.js';
12
+
13
+ /**
14
+ * Stable, machine-readable codes for every failure mode the gate can raise. Callers switch on
15
+ * `error.code` rather than parsing messages.
16
+ */
17
+ type BayesOutputGateErrorCode = "INVALID_CONFIG" | "INVALID_SCORE" | "INVALID_DIMENSION" | "INVALID_HYPOTHESIS" | "INVALID_OBSERVATION" | "INVALID_STATE" | "INVALID_SNAPSHOT" | "NUMERIC";
18
+ /** The only error type the package throws. */
19
+ declare class BayesOutputGateError extends Error {
20
+ readonly code: BayesOutputGateErrorCode;
21
+ constructor(code: BayesOutputGateErrorCode, message: string);
22
+ }
23
+ /**
24
+ * Throw a {@link BayesOutputGateError} with the given code when `condition` is falsy. Narrows the
25
+ * type for the caller on the happy path.
26
+ */
27
+ declare function invariant(condition: unknown, code: BayesOutputGateErrorCode, message: string): asserts condition;
28
+
29
+ export { BayesOutputGateError, type BayesOutputGateErrorCode, invariant };