| _canonical_docs |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("4f5d9f01796f9baf") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned set. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
def _doc_of(ev: str) -> str:
return ev.split('#')[0]
def _canonical_docs(gp: dict) -> set:
out = set()
for evs in gp.get('evidence_policy', {}).get('canonical', {}).values():
for ev in evs:
out.add(_doc_of(ev))
return out
ARGS = {
'gp': {
'evidence_policy': {
'canonical': {
'key1': ['doc1#fragment1', 'doc2#fragment2'],
'key2': ['doc3#fragment3', 'doc1#fragment4']
}
}
}
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _doc_of |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("a1046c422555a285") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
def _doc_of(ev: str) -> str:
return ev.split('#')[0]
ARGS = {
'ev': 'example_document#anchor_text'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _facts_deterministic |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("dde7cf71dcfa1498") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
_ATOM_STOP = {'owner', 'OKR', 'KR', 'W1', 'W2', 'W3', 'W4'}
def _claim_atoms(claim: str) -> list:
"""claim -> list of atom groups; each group is a set of interchangeable spellings (any-of); a fact hits if at least one spelling per group appears."""
atoms = []
for q in re.findall('"([^"]+)"', claim):
atoms.append([q])
for nm in re.findall('[A-Za-z][A-Za-z0-9_\\-]+', claim):
if nm not in _ATOM_STOP:
atoms.append([nm])
d = re.search('\\d{4}-\\d{2}-\\d{2}', claim)
w = re.search('\\b[Ww]eek\\s*(\\d+)\\b', claim)
if d or w:
alt = ([d.group(0)] if d else []) + ([f'week {w.group(1)}', f'W{w.group(1)}'] if w else [])
atoms.append(alt)
return atoms
def _facts_deterministic(gp: dict, answer: str):
"""Deterministic fact coverage for extractive questions. Returns (fact_meta, facts, fact_claim) or None (no facts)."""
fl = gp.get('required_facts', [])
if not fl:
return None
ans = re.sub('\\s+', '', answer or '')
fmeta, facts, fclaim = ({}, {}, {})
for i, f in enumerate(fl):
claim = f.get('claim') or f.get('fact_preview') or ''
groups = _claim_atoms(claim)
if groups:
frac = sum((1 for g in groups if any((re.sub('\\s+', '', a) in ans for a in g)))) / len(groups)
else:
frac = 0.0
fmeta[i] = f.get('points', 1)
facts[i] = round(frac, 3)
fclaim[i] = claim
return (fmeta, facts, fclaim)
ARGS = {
'gp': {
'required_facts': [
{
'claim': 'The project "delivery" was completed in week 2',
'points': 10
},
{
'claim': 'The deadline is 2024-01-15 for milestone',
'points': 5
},
{
'claim': 'Status update "approved" by owner',
'points': 1
}
]
},
'answer': 'The delivery was completed in week 2 and the deadline 2024-01-15 was met'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _finalize |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("93400f880ff1eea7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Construct gp (ground truth/problem dict)
gp = {
'id': 'test_001',
'operator': 'generate',
'intent': 'summarization',
'expected_answer_type': 'text'
}
# Construct track (string identifier)
track = 'main'
# Construct scores (dict with optional keys)
scores = {
'fact_coverage': 0.85,
'faithfulness': 0.92,
'answer_correctness': 0.88
}
# Construct viol (violations list)
viol = ['violation_1', 'violation_2']
# Construct hard_fail (boolean)
hard_fail = False
# Construct diag (diagnostics dict)
diag = {
'model_confidence': 0.95,
'processing_time': 1.23,
'num_tokens': 50
}
# Construct safety (optional retrieval safety dict)
safety = {
'safety_score': 0.98,
'flagged_content': False
}
# Construct headline_override (optional override for headline score)
headline_override = None
ARGS = {
'gp': gp,
'track': track,
'scores': scores,
'viol': viol,
'hard_fail': hard_fail,
'diag': diag,
'safety': safety,
'headline_override': headline_override
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _forbidden_values |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("faf127929bf9a0a9") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
def _forbidden_values(gp: dict) -> tuple[list, list]:
"""Extract forbidden values from forbidden_claims: (stale/low-authority values, draft values).
forbidden_claims entries are ``{"value": <str>, "kind": "stale"|"draft", ...}`` when present.
(The released question bank does not populate forbidden_claims / versioned_policy_qa, so this
path is inert here; kept for datasets that do use versioned-policy questions.)
"""
fbc = gp.get('forbidden_claims', [])
newv = re.sub('\\D', '', str(gp.get('_provenance', {}).get('answer_value', '')))
stale, draft = ([], [])
for c in fbc:
kind = (c.get('kind') or '').lower() if isinstance(c, dict) else ''
raw = c.get('value') if isinstance(c, dict) else c
for v in re.findall('\\d+', str(raw or '')):
if v == newv:
continue
(draft if kind == 'draft' else stale).append(v)
return (stale, draft)
ARGS = {
'gp': {
'forbidden_claims': [
{'value': '123', 'kind': 'stale'},
{'value': '456', 'kind': 'draft'},
{'value': '789', 'kind': 'STALE'},
{'value': '999', 'kind': 'DRAFT'},
'111',
{'value': '222'},
],
'_provenance': {
'answer_value': '123'
}
}
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _judge_answer |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("56d55cc6a51fdc6a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from unittest.mock import Mock, patch
torch.manual_seed(0)
# Mock the llm module since it's used in the function
class MockLLM:
def judge_json(self, system_prompt, user_prompt, temperature=0.0, max_tokens=800):
# Return a valid JSON response that the function expects
return {
"covered": [0, 1],
"faithful": True,
"contradiction": "",
"correct": True
}
# Patch the llm module before defining ARGS
mock_llm = MockLLM()
# Create test data for the function
gp = {
"question_text": "What is the capital of France?",
"gold_answer": "Paris",
"required_facts": [
{
"claim": "Paris is the capital of France",
"points": 5
},
{
"claim": "Paris is located in northern France",
"points": 3,
"fact_preview": "Paris location"
}
]
}
answer = "Paris is the capital of France and is located in northern France, in the region of Île-de-France."
# Patch llm.judge_json in the module scope
import sys
llm_module = Mock()
llm_module.judge_json = mock_llm.judge_json
sys.modules['llm'] = llm_module
# Make llm available globally for the function
import builtins
builtins.llm = llm_module
ARGS = {
"gp": gp,
"answer": answer
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _okf_map |
Ran ran on a synthesized input |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("1496908687301d2b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import tempfile
import json
from pathlib import Path
# Create a temporary directory structure to simulate the OKF bundle environment
temp_dir = tempfile.mkdtemp()
dataset_dir = Path(temp_dir) / 'dataset'
dataset_dir.mkdir(exist_ok=True)
bundle_dir = dataset_dir / 'okf_bundle'
bundle_dir.mkdir(exist_ok=True)
# Create a sample markdown file in the bundle
sample_md = bundle_dir / 'sample_doc.md'
sample_md.write_text(
'resource: corpus://original/path/to/sample_doc.md\n\nContent here',
encoding='utf-8'
)
# Create an okf_manifest.json with source to document id mapping
manifest_data = {
'src_to_cid': {
'original/path/to/sample_doc.md': 'doc_id_1',
'original/path/to/other_doc.md': 'doc_id_2'
}
}
manifest_file = dataset_dir / 'okf_manifest.json'
manifest_file.write_text(json.dumps(manifest_data), encoding='utf-8')
# Set environment variable for the bundle location
os.environ['EKWB_DATASET'] = str(dataset_dir)
# Since _okf_map takes no parameters, the ARGS dict is empty
ARGS = {}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _retrieved_docs |
Ran ran; our contract draft was wrong, not the code |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("b24d9b18e5f0ac47") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
from pathlib import Path
from unittest.mock import patch, MagicMock
# Create a minimal mock environment
os.environ['EKWB_DATASET'] = '/tmp/mock_dataset'
# Create the argument for _retrieved_docs
mo = {
'retrieved_contexts': [
{
'doc_id': 'policy/Cephos-approval-matrix.md'
},
{
'doc_id': 'some_document'
},
{
'doc_id': None
},
{
'doc_id': 'another/path/to/document.md'
}
]
}
ARGS = {
'mo': mo
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| is_agent_giveup |
Ran ran, violated the contract we drafted |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("ebd973fd7cc9a2fd") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
_AGENT_GIVEUP = re.compile('Agent loop ended without producing an answer|Agent loop stopped: .*budget', re.I)
def is_agent_giveup(answer: str) -> bool:
"""Agent loop exhausted/gave up (the system failed to answer a feasible task) -- this is a **real task failure**, scored 0;
different in nature from an API failure (infra, not scored) and must not be silently excluded."""
return bool(_AGENT_GIVEUP.search((answer or '').strip()))
ARGS = {
"answer": "Agent loop ended without producing an answer"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| is_infra_error |
Ran ran, violated the contract we drafted |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("9de4707b028f2e9c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
_AGENT_GIVEUP = re.compile('Agent loop ended without producing an answer|Agent loop stopped: .*budget', re.I)
_INFRA_ERR = re.compile('\\[ERROR\\]|APITimeout|RateLimit|ServiceUnavailable|502 Bad Gateway', re.I)
_INFRA_LEAD = re.compile('^\\W{0,4}(API call failed|Request timed out|timed out|Connection error|read timeout)', re.I)
def is_agent_giveup(answer: str) -> bool:
"""Agent loop exhausted/gave up (the system failed to answer a feasible task) -- this is a **real task failure**, scored 0;
different in nature from an API failure (infra, not scored) and must not be silently excluded."""
return bool(_AGENT_GIVEUP.search((answer or '').strip()))
def is_infra_error(answer: str) -> bool:
"""Short text containing API-error signatures -> judged an infrastructure error (distinct from an actual (wrong) answer the model gave).
Note: agent give-up (is_agent_giveup) is not infra -- that is a task failure, scored 0 by evaluate."""
a = (answer or '').strip()
if not a or len(a) >= 500 or is_agent_giveup(a):
return False
return bool(_INFRA_ERR.search(a)) or bool(_INFRA_LEAD.match(a))
# Test cases for is_infra_error
test_cases = [
"This is a normal answer",
"[ERROR] Something went wrong",
"APITimeout occurred",
"Request timed out",
"Agent loop ended without producing an answer",
"",
None,
"x" * 600,
"Connection error: failed to connect",
"RateLimit exceeded",
]
ARGS = {
"answer": "APITimeout: The service is temporarily unavailable"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _claim_atoms |
Not yet run unverified (harvested, no recorded run) |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("5729872501858759") How it ran |
| evaluate |
Not yet run unverified (harvested, no recorded run) |
scitix/entlore/src/evaluator.py code served (permissive licence) · get_code("a3550da09101fb66") How it ran |