Decision Engines Reference¶
AutoDecisionEngine¶
Default client for provisioning a decision engine backend (the refactor of the original JevClient).
Decision Engine adapter delegating to the best available backend.
Prefers :class:LayaDecisionEngine on Apple Silicon when laya_mlx is
installed; otherwise falls back to :class:TransformersDecisionEngine.
Parameters¶
checkpoint : str, default "aac6fef/laya-mlx" Model checkpoint identifier (MLX format or Hugging Face repository ID). model_name : str or None, optional Alternative checkpoint identifier for Transformers. provider : str or None, optional Explicit backend selector ('laya', 'mlx', 'transformers', or 'auto'). default_confidence_threshold : float, default 0.85 Empirical accuracy threshold for fast-exit routing. conformal_alpha : float, default 0.05 Significance level for conformal prediction sets. batch_size : int, default 16 Maximum batch size for evaluation. timeout_seconds : float, default 2.0 Per-decision call timeout in seconds. args : Any Additional positional arguments passed to backend. *kwargs : Any Additional keyword arguments forwarded to backend engines.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 | |
evaluate(state, question)
async
¶
Evaluate a single typed question.
Parameters¶
state : str or dict or list State payload. question : DecisionQuestion or dict Proposition or question specification.
Returns¶
DecisionScore or DecisionNoulResult Evaluation outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 | |
evaluate_batch(state, questions)
async
¶
Evaluate multiple questions in batch.
Parameters¶
state : str or dict or list State payload. questions : dict of str to (DecisionQuestion or dict) Question specifications.
Returns¶
dict of str to (DecisionScore or DecisionNoulResult) Batch evaluation results.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 | |
evaluate_choice(state, question, options, alpha=None)
async
¶
Evaluate a categorical choice question.
Parameters¶
state : str or dict or list State payload. question : str Categorical decision question. options : list of str or dict of str to str Candidate choices. alpha : float or None, default None Miscoverage significance level.
Returns¶
DecisionScore Scored categorical decision.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 | |
evaluate_noul(state, question)
async
¶
Evaluate a binary yes/no statement.
Parameters¶
state : str or dict or list State payload. question : str Proposition or question.
Returns¶
DecisionNoulResult Evaluation outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 | |
evaluate_score(state, question, levels)
async
¶
Evaluate an ordered scale or rubric score.
Parameters¶
state : str or dict or list State payload. question : str Rubric or scoring question. levels : list of int or list of str Ordered score levels.
Returns¶
DecisionScore Score outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 | |
fingerprint()
¶
Return a deterministic representation of engine configuration.
Returns¶
dict of str to Any Deterministic dictionary delegating to the underlying engine backend.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | |
LayaDecisionEngine¶
Apple Silicon (MLX) decision engine backend.
High-performance Apple Silicon MLX decision engine client.
Runs local bidirectional Transformer inference using laya_mlx
(ModernBERT / mmBERT backbone) to evaluate typed questions against state
blocks with dual confidence metrics and zero output token generation.
Parameters¶
checkpoint : str, default "aac6fef/laya-mlx"
Hugging Face repository ID or local path to pre-converted MLX checkpoint.
dtype : str, default "float16"
Computation precision ("float16" or "float32").
batch_size : int, default 16
Maximum questions processed per MLX forward pass.
timeout_seconds : float, default 2.0
Per-request inference timeout in seconds.
default_confidence_threshold : float, default 0.85
Empirical accuracy threshold for fast-exit routing.
conformal_alpha : float, default 0.05
Default significance level for conformal prediction sets (guaranteeing
1 - alpha coverage).
agent : Any or None, default None
Optional pre-loaded laya.Agent instance. If None, loaded lazily.
embed_fn : Any or None, default None
Optional bi-encoder embedding function for large choice set shortlisting.
shortlist_threshold : int, default 5
Option count threshold above which candidate shortlisting is applied.
compile : bool, default False
Whether to enable MLX graph compilation.
cache_prompts : bool, default False
Whether to cache prefix tokenizations across repetitive calls.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | |
name
property
¶
Return the engine name.
evaluate(state, question)
async
¶
Evaluate a single typed question against a state payload.
Parameters¶
state : str or dict or list Structured state payload. question : DecisionQuestion or dict Typed decision question specification or dictionary.
Returns¶
DecisionScore or DecisionNoulResult Evaluation outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | |
evaluate_batch(state, questions)
async
¶
Evaluate multiple typed questions in a single forward pass.
Parameters¶
state : str or dict or list State payload. questions : dict of str to (DecisionQuestion or dict) Dictionary mapping question identifiers to specifications.
Returns¶
dict of str to (DecisionScore or DecisionNoulResult) Mapped results for all evaluated questions.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | |
evaluate_choice(state, question, options, alpha=None)
async
¶
Evaluate a categorical choice via Laya Choice head.
Parameters¶
state : str or dict or list Structured state payload. question : str Categorical decision question. options : list of str or dict of str to str Candidate labels or rubric mapping label to description. alpha : float or None, default None Significance level for conformal prediction set (1 - alpha coverage).
Returns¶
DecisionScore Score containing selected option, class probability, empirical accuracy, and conformal prediction set.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
evaluate_noul(state, question)
async
¶
Evaluate a binary yes/no statement via Laya Noul head.
Parameters¶
state : str or dict or list Structured state payload. question : str Binary proposition or verification question.
Returns¶
DecisionNoulResult Evaluation outcome containing calibrated probability and empirical accuracy.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
evaluate_score(state, question, levels)
async
¶
Evaluate an ordered scale or score via Laya Score head.
Parameters¶
state : str or dict or list Structured state payload. question : str Rubric or scoring question. levels : list of int or list of str Ordered score levels.
Returns¶
DecisionScore Result indicating expected level and distribution.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
fingerprint()
¶
Return a deterministic representation of engine configuration.
Returns¶
dict of str to Any Deterministic dictionary containing model checkpoint, precision, batch size, inference timeout, calibration thresholds, and flags.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/jev_client.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
MockJevDecisionEngine¶
In-memory deterministic decision engine used for testing.
In-memory deterministic mock decision engine.
Enables testing pipeline phases and gating logic by matching state/question patterns against pre-registered fixtures, or returning configurable defaults.
Parameters¶
default_confidence_threshold : float, default 0.85 Default threshold for binary noul decisions. conformal_alpha : float, default 0.05 Default significance error level for conformal prediction sets. simulated_latency : float, default 0.0 Simulated latency in seconds to replicate System 1 inference time.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
name
property
¶
Return the mock engine name.
evaluate(state, question)
async
¶
Evaluate a single typed question against state.
Parameters¶
state : str or dict or list Structured state payload. question : DecisionQuestion or dict Typed decision question specification or dictionary.
Returns¶
DecisionScore or DecisionNoulResult Evaluation outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
evaluate_batch(state, questions)
async
¶
Evaluate a batch of questions against a single state block in parallel.
Parameters¶
state : str or dict or list Structured state block. questions : dict of str to (DecisionQuestion or dict) Mapping from key to question definition specification or dictionary.
Returns¶
dict of str to (DecisionScore or DecisionNoulResult) Mapping from question key to corresponding result.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
evaluate_choice(state, question, options, alpha=None)
async
¶
Evaluate a categorical choice over options.
Parameters¶
state : str or dict or list Input state block. question : str Categorical decision question. options : list of str or dict of str to str Available options. alpha : float or None, default None Significance level for conformal prediction set.
Returns¶
DecisionScore Categorical evaluation score.
Raises¶
Exception
If should_raise is configured.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |
evaluate_noul(state, question)
async
¶
Evaluate a binary yes/no statement.
Parameters¶
state : str or dict or list Input state block. question : str Binary proposition or question.
Returns¶
DecisionNoulResult Evaluation result.
Raises¶
Exception
If should_raise is configured.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
evaluate_score(state, question, levels)
async
¶
Evaluate an ordered scale or score against levels.
Parameters¶
state : str or dict or list Input state block. question : str Scoring rubric question. levels : list of int or list of str Ordered levels.
Returns¶
DecisionScore Evaluation score indicating expected level and probabilities.
Raises¶
Exception
If should_raise is configured.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | |
fingerprint()
¶
Return a deterministic representation of mock engine configuration.
Returns¶
dict of str to Any Deterministic dictionary containing thresholds, rule counts, and simulated latency.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
register_choice_response(question_pattern, state_pattern=None, selected_option=None, probabilities=None, class_probability=None, empirical_accuracy=0.9, prediction_set=None, tokens_saved_estimate=120)
¶
Register a fixture response for categorical choice questions.
Parameters¶
question_pattern : str Substring pattern to match against question text (case-insensitive). state_pattern : str or None, default None Optional substring pattern to match against input state. selected_option : str, int, or None, default None The winning option to return. probabilities : dict of str to float or None, default None Categorical probability distribution. class_probability : float or None, default None Peak softmax probability. If omitted, derived from max(probabilities). empirical_accuracy : float, default 0.90 Calibrated empirical frequency of being correct. prediction_set : list of str or None, default None Conformal prediction set. tokens_saved_estimate : int, default 120 Estimated LLM tokens saved.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
register_noul_response(question_pattern, state_pattern=None, probability=0.95, empirical_accuracy=0.92, passed=None)
¶
Register a fixture response for binary noul questions.
Parameters¶
question_pattern : str Substring pattern to match against question text (case-insensitive). state_pattern : str or None, default None Optional substring pattern to match against input state. probability : float, default 0.95 Calibrated proposition probability P(true). empirical_accuracy : float, default 0.92 Calibrated empirical accuracy frequency. passed : bool or None, default None Explicit boolean flag. If None, derived from probability >= threshold.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
register_score_response(question_pattern, state_pattern=None, selected_option=1, probabilities=None, class_probability=0.85, empirical_accuracy=0.88, prediction_set=None, tokens_saved_estimate=80)
¶
Register a fixture response for ordered score questions.
Parameters¶
question_pattern : str Substring pattern to match against question text. state_pattern : str or None, default None Optional substring pattern to match against input state. selected_option : str or int, default 1 Expected or selected score level. probabilities : dict of str to float or None, default None Distribution over levels. class_probability : float, default 0.85 Confidence in the selected level. empirical_accuracy : float, default 0.88 Empirical accuracy estimate. prediction_set : list of str or None, default None Conformal prediction set over levels. tokens_saved_estimate : int, default 80 Estimated LLM tokens saved.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
reset()
¶
Clear all registered fixture rules and call history.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
257 258 259 260 261 262 263 | |
set_simulated_latency(latency)
¶
Set simulated execution latency in seconds.
Parameters¶
latency : float Latency duration in seconds.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/mock.py
247 248 249 250 251 252 253 254 255 | |
ObservableDecisionEngine¶
Decorator adding decision audit/observability on top of an underlying decision engine.
Decorates a :class:~episteme_pipeline.protocols.decision.DecisionEngine to emit domain events.
Parameters¶
inner : DecisionEngine Underlying decision engine instance to decorate. engine_name : str or None, default None Human-readable name of the decision engine. If omitted, derived from the inner engine's attributes or class name. prompt_bundle : StructuredPromptBundle or None, default None Optional prompt bundle carrying prompt_name, prompt_version, and prompt_label for telemetry prompt binding. stochastic_audit_rate : float, default 0.0 Probability in [0, 1] of randomly marking a fast-exit evaluation for stochastic auditing (System 2 validation).
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
name
property
¶
Return the engine name.
__getattr__(name)
¶
Delegate unhandled attribute and method lookups to the inner engine.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
386 387 388 | |
evaluate(state, question)
async
¶
Evaluate a single typed question with telemetry instrumentation.
Parameters¶
state : str or dict or list Structured state payload. question : DecisionQuestion or dict Typed decision question specification or dictionary.
Returns¶
DecisionScore or DecisionNoulResult Evaluation outcome.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | |
evaluate_batch(state, questions)
async
¶
Evaluate multiple questions in batch via the inner decision engine.
Parameters¶
state : str or dict or list Structured state payload. questions : dict of str to (DecisionQuestion or dict) Question specifications.
Returns¶
dict of str to (DecisionScore or DecisionNoulResult) Batch evaluation results.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
evaluate_choice(state, question, options, alpha=None)
async
¶
Evaluate a categorical choice with latency and event tracking.
Parameters¶
state : str or dict or list Structured state payload. question : str Categorical decision question. options : list of str or dict of str to str Allowed options or dictionary mapping option labels to rubric definitions. alpha : float or None, default None Optional significance level for conformal prediction set (1 - alpha coverage).
Returns¶
DecisionScore Categorical evaluation score containing selected option, class probability, full probability distribution, and conformal prediction set.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
evaluate_noul(state, question)
async
¶
Evaluate a binary yes/no statement with latency and event tracking.
Parameters¶
state : str or dict or list Structured state payload. question : str Binary proposition or decision question to evaluate.
Returns¶
DecisionNoulResult Evaluation outcome containing calibrated probability and empirical accuracy.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
evaluate_score(state, question, levels)
async
¶
Evaluate an ordered scale or score with latency and event tracking.
Parameters¶
state : str or dict or list Structured state payload. question : str Scoring question or grading rubric. levels : list of int or list of str Ordered scale levels.
Returns¶
DecisionScore Evaluation score indicating expected level and level probabilities.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
fingerprint()
¶
Return a deterministic representation of the observable wrapper and wrapped engine.
Returns¶
dict of str to Any Deterministic dictionary containing wrapper metadata, audit rate, and inner engine fingerprint.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/observable.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
Modal Resolvers¶
Modal resolvers fuse modality evidence, capturing fusion mode, fusion \(\alpha\), epistemic status priors, and underlying decision engine instances.
StructuralistModalResolver¶
Symbolic modal strength resolver grounded in Schurz's structuralist philosophy.
Evaluates the authorial propositional modality M(phi) deterministically from structuralist syntax attributes (ScopeType, EpistemicStatus, ComponentType).
Parameters¶
default_base_score : float, default 0.60 Fallback modal certainty when no structuralist dimensions match.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
evaluate_syntax_profile(atom)
¶
Derive deterministic modal score and guardrail interval from atom syntax.
Parameters¶
atom : TheoryAtom Target theoretical atom.
Returns¶
ModalSyntaxProfile Evaluated score and guardrail interval bounds.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
fingerprint()
¶
Return deterministic structuralist modal resolver configuration.
Returns¶
dict of str to Any Dictionary containing class identifier and default base score.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
60 61 62 63 64 65 66 67 68 69 70 71 | |
get_syntax_bounds(atom)
¶
Compute admissible modal certainty interval [M_min, M_max] for guardrail clipping.
Parameters¶
atom : TheoryAtom Target theoretical atom.
Returns¶
tuple of (float, float) Lower and upper bounds for authorial propositional certainty in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
resolve_modality(atom, context=None)
async
¶
Asynchronously derive deterministic modal certainty (delegates to sync).
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Ignored for symbolic evaluation.
Returns¶
float Propositional modal strength M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |
resolve_modality_sync(atom, context=None)
¶
Synchronously derive deterministic modal certainty from structuralist syntax.
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Ignored for purely symbolic syntactic evaluation.
Returns¶
float Propositional modal strength M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
DecisionEngineModalResolver¶
Empirical modal strength resolver backed by a System 1 DecisionEngine.
Evaluates linguistic hedging, modal auxiliaries, and assertiveness directly on the claim and surrounding sentence context.
Parameters¶
decision_engine : DecisionEngine System 1 calibrated decision engine. question_template : str, default "Assess the author's propositional certainty / modal qualification for this claim." Evaluative prompt question for the decision engine. levels : list of float, optional Ordinal certainty levels in [0.0, 1.0]. Defaults to [0.2, 0.4, 0.6, 0.8, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
fingerprint()
¶
Return deterministic decision engine modal resolver configuration.
Returns¶
dict of str to Any Dictionary containing class identifier, question template, levels, and underlying decision engine fingerprint.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
resolve_modality(atom, context=None)
async
¶
Evaluate linguistic hedging via System 1 DecisionEngine.
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Surrounding context text.
Returns¶
float Calibrated expected propositional modal strength M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | |
resolve_modality_sync(atom, context=None)
¶
Synchronous fallback delegating to structuralist syntax.
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Textual context.
Returns¶
float Fallback modal strength M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
HybridModalResolver¶
Neuro-symbolic hybrid modal strength resolver.
Harmonizes symbolic structuralist properties (ScopeType, EpistemicStatus) with calibrated linguistic assertiveness scoring from the System 1 DecisionEngine.
Parameters¶
structural_resolver : StructuralistModalResolver or None, optional Symbolic resolver instance. If None, initialized with default settings. decision_resolver : DecisionEngineModalResolver or None, optional Empirical decision engine resolver. If None, runs in pure structuralist mode. mode : Literal["guardrail", "convex", "structural_only", "engine_only"], default "guardrail" Integration mode: - "guardrail": Clips decision engine score into structuralist syntax bounds. - "convex": Computes weighted average between structural prior and engine score. - "structural_only": Strictly evaluates structuralist syntax. - "engine_only": Strictly evaluates decision engine score. fusion_alpha : float, default 0.50 Relative weight of structuralist syntax in convex fusion mode (in [0.0, 1.0]).
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |
create(config=None, decision_engine=None, structural_resolver=None, decision_resolver=None)
classmethod
¶
Construct a fully configured HybridModalResolver from config and dependencies.
Parameters¶
config : ModalResolverConfig or dict or None, optional Modal resolver configuration. If None or empty, default settings are used. decision_engine : DecisionEngine or None, optional Calibrated System 1 decision engine. If provided and decision_resolver is None, constructs DecisionEngineModalResolver automatically. structural_resolver : StructuralistModalResolver or None, optional Custom structuralist resolver. If None, initialized using config.default_base_score. decision_resolver : DecisionEngineModalResolver or None, optional Custom decision resolver. If None and decision_engine is provided, constructed automatically.
Returns¶
HybridModalResolver Configured neuro-symbolic hybrid modal strength resolver.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
fingerprint()
¶
Return deterministic hybrid modal resolver configuration.
Returns¶
dict of str to Any Dictionary containing mode, fusion alpha, and component resolver fingerprints.
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
resolve_modality(atom, context=None)
async
¶
Resolve propositional modal strength with event emission and observability.
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Surrounding context text.
Returns¶
float Resolved modal certainty M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
resolve_modality_sync(atom, context=None)
¶
Synchronously resolve propositional modal strength via structuralist fallback.
Parameters¶
atom : TheoryAtom Target theoretical atom. context : str or None, optional Surrounding context text.
Returns¶
float Resolved modal certainty M(phi) in [0.0, 1.0].
Source code in packages/episteme-pipeline/episteme_pipeline/decision/modal_resolver.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |