- harness/es.py: append-only event store + проекции (образец — кооп-портал) - harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу - harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы - harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе (глобальный asyncio-рантайм Strands не переживает 2+ create_harness) - cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом) - 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
34 lines
934 B
Python
34 lines
934 B
Python
import itertools
|
|
|
|
import pytest
|
|
|
|
from referencing import Resource, exceptions
|
|
|
|
|
|
def pairs(choices):
|
|
return itertools.combinations(choices, 2)
|
|
|
|
|
|
TRUE = Resource.opaque(True)
|
|
|
|
|
|
thunks = (
|
|
lambda: exceptions.CannotDetermineSpecification(TRUE),
|
|
lambda: exceptions.NoSuchResource("urn:example:foo"),
|
|
lambda: exceptions.NoInternalID(TRUE),
|
|
lambda: exceptions.InvalidAnchor(resource=TRUE, anchor="foo", ref="a#b"),
|
|
lambda: exceptions.NoSuchAnchor(resource=TRUE, anchor="foo", ref="a#b"),
|
|
lambda: exceptions.PointerToNowhere(resource=TRUE, ref="urn:example:foo"),
|
|
lambda: exceptions.Unresolvable("urn:example:foo"),
|
|
lambda: exceptions.Unretrievable("urn:example:foo"),
|
|
)
|
|
|
|
|
|
@pytest.mark.parametrize("one, two", pairs(each() for each in thunks))
|
|
def test_eq_incompatible_types(one, two):
|
|
assert one != two
|
|
|
|
|
|
@pytest.mark.parametrize("thunk", thunks)
|
|
def test_hash(thunk):
|
|
assert thunk() in {thunk()}
|