nisse-core: group modules into packages by architecture section
A pure move; behaviour unchanged. - models (L9, L7): llm, catalog, probe, render, render_anthropic, context - log (L7, L6): canonical, views - state (L8): store (was state), reconcile, worker, cancel, dump - knowledge (L10, L6.4): vault, memory - conversation (L5): transport, matrix - execution (L13): ssh (was execution), testing - authority (P3, P4, L4): actions - gitea, oplog, envfile stay at the top until each gains a second module. Every import, monkeypatch target, script and doc reference rewritten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
This commit is contained in:
1 parent
06759d5d70
commit
e351d0a74e
117 files changed
+291
-265
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from nisse_core.actions import (
|
||||
from nisse_core.authority.actions import (
|
||||
CONTAINED,
|
||||
DANGEROUS,
|
||||
HARMLESS,
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
Compaction,
|
||||
DelegationCompleted,
|
||||
@@ -16,7 +16,7 @@ from nisse_core.canonical import (
|
||||
from_payload,
|
||||
mint_call_id,
|
||||
)
|
||||
from nisse_core.state import StateSchemaError, StateStore
|
||||
from nisse_core.state.store import StateSchemaError, StateStore
|
||||
|
||||
ALL_EVENTS = [
|
||||
UserMessage(text="use demo", source="matrix:$abc"),
|
||||
|
||||
@@ -8,7 +8,7 @@ route has to come from what LiteLLM says the model is.
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from nisse_core.catalog import (
|
||||
from nisse_core.models.catalog import (
|
||||
CatalogUnavailable,
|
||||
ModelCatalog,
|
||||
UnknownModel,
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
CanonicalEvent,
|
||||
StoredEvent,
|
||||
@@ -14,8 +14,8 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.catalog import ModelCatalog, UnknownLimits
|
||||
from nisse_core.context import (
|
||||
from nisse_core.models.catalog import ModelCatalog, UnknownLimits
|
||||
from nisse_core.models.context import (
|
||||
Budget,
|
||||
BudgetedClient,
|
||||
ContextOverflow,
|
||||
@@ -24,7 +24,7 @@ from nisse_core.context import (
|
||||
head_and_tail,
|
||||
)
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.state import StateStore
|
||||
from nisse_core.state.store import StateStore
|
||||
from nisse_dev.loop.driver import Driver
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import io
|
||||
from pathlib import Path
|
||||
|
||||
from nisse_core.canonical import Fact, PlanSubmitted, ToolCall, ToolResult, UserMessage
|
||||
from nisse_core.dump import main, render
|
||||
from nisse_core.log.canonical import (
|
||||
Fact,
|
||||
PlanSubmitted,
|
||||
ToolCall,
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.state import StateStore
|
||||
from nisse_core.state.dump import main, render
|
||||
from nisse_core.state.store import StateStore
|
||||
|
||||
|
||||
def store_with_a_run(path: Path) -> None:
|
||||
|
||||
@@ -5,7 +5,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.execution import REDACTED, HostUnavailable, SSHHost, redact
|
||||
from nisse_core.execution.ssh import REDACTED, HostUnavailable, SSHHost, redact
|
||||
|
||||
|
||||
def test_exit_codes_and_streams_come_back(ssh_host: SSHHost) -> None:
|
||||
@@ -82,7 +82,7 @@ def test_a_changed_host_key_is_its_own_failure_and_only_forgetting_clears_it(
|
||||
) -> None:
|
||||
import subprocess
|
||||
|
||||
from nisse_core.execution import HostKeyChanged
|
||||
from nisse_core.execution.ssh import HostKeyChanged
|
||||
|
||||
host = SSHHost(
|
||||
ssh_host.address,
|
||||
|
||||
@@ -10,7 +10,7 @@ from nisse_core.gitea import (
|
||||
GiteaError,
|
||||
pull_request_reconciler,
|
||||
)
|
||||
from nisse_core.state import Intent
|
||||
from nisse_core.state.store import Intent
|
||||
|
||||
INTENT = Intent(
|
||||
id=1,
|
||||
|
||||
@@ -5,14 +5,14 @@ from typing import Any
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.envfile import load_env_file
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
StoredEvent,
|
||||
ToolCall,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.envfile import load_env_file
|
||||
from nisse_core.llm import (
|
||||
from nisse_core.models.llm import (
|
||||
DEFAULT_MAX_OUTPUT_TOKENS,
|
||||
OUTAGE_BACKOFF_S,
|
||||
RATE_LIMIT_RETRY_S,
|
||||
|
||||
@@ -4,8 +4,8 @@ import threading
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from nisse_core.matrix import MatrixConfig, MatrixTransport, TransportError
|
||||
from nisse_core.transport import InboundMessage
|
||||
from nisse_core.conversation.matrix import MatrixConfig, MatrixTransport, TransportError
|
||||
from nisse_core.conversation.transport import InboundMessage
|
||||
|
||||
CONFIG = MatrixConfig(
|
||||
homeserver="https://matrix.test",
|
||||
@@ -349,7 +349,7 @@ def test_a_reply_to_the_operators_own_threaded_message_joins_the_thread() -> Non
|
||||
|
||||
|
||||
def test_in_memory_transport_plays_threads() -> None:
|
||||
from nisse_core.transport import InMemoryTransport
|
||||
from nisse_core.conversation.transport import InMemoryTransport
|
||||
|
||||
transport = InMemoryTransport()
|
||||
seen: list[InboundMessage] = []
|
||||
|
||||
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.memory import Memory
|
||||
from nisse_core.vault import Vault, VaultError, split_frontmatter
|
||||
from nisse_core.knowledge.memory import Memory
|
||||
from nisse_core.knowledge.vault import Vault, VaultError, split_frontmatter
|
||||
|
||||
FOLDER = "memory/nisse-dev"
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.reconcile import reconcile_on_boot
|
||||
from nisse_core.state import StateStore
|
||||
from nisse_core.state.reconcile import reconcile_on_boot
|
||||
from nisse_core.state.store import StateStore
|
||||
|
||||
ENVELOPE_FIELDS = {"ts", "agent", "event", "task_id", "cause"}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import json
|
||||
|
||||
import httpx
|
||||
|
||||
from nisse_core.probe import interpret, probe
|
||||
from nisse_core.models.probe import interpret, probe
|
||||
|
||||
|
||||
def test_a_cut_at_the_declared_window_matches() -> None:
|
||||
|
||||
@@ -2,8 +2,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.reconcile import reconcile_on_boot
|
||||
from nisse_core.state import Intent, StateStore
|
||||
from nisse_core.state.reconcile import reconcile_on_boot
|
||||
from nisse_core.state.store import Intent, StateStore
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
from itertools import pairwise
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
Compaction,
|
||||
GateOpened,
|
||||
@@ -10,7 +10,7 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.render import OpenAIChatRenderer, effective_events
|
||||
from nisse_core.models.render import OpenAIChatRenderer, effective_events
|
||||
|
||||
|
||||
def stored(events: list) -> list[StoredEvent]:
|
||||
|
||||
@@ -4,7 +4,7 @@ these tests pin the differences that a normalising middlebox would blur."""
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
Compaction,
|
||||
StoredEvent,
|
||||
@@ -12,8 +12,8 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.llm import AnthropicPassthroughClient, LLMError
|
||||
from nisse_core.render_anthropic import (
|
||||
from nisse_core.models.llm import AnthropicPassthroughClient, LLMError
|
||||
from nisse_core.models.render_anthropic import (
|
||||
AnthropicMessagesRenderer,
|
||||
to_anthropic_tools,
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nisse_core.state import StateSchemaError, StateStore
|
||||
from nisse_core.state.store import StateSchemaError, StateStore
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -9,8 +9,8 @@ from pathlib import Path
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
from nisse_core import vault as vault_module
|
||||
from nisse_core.vault import Vault, VaultError, split_frontmatter
|
||||
from nisse_core.knowledge import vault as vault_module
|
||||
from nisse_core.knowledge.vault import Vault, VaultError, split_frontmatter
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -4,7 +4,7 @@ import io
|
||||
from collections.abc import Mapping
|
||||
from pathlib import Path
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
DelegationCompleted,
|
||||
DelegationStarted,
|
||||
@@ -15,10 +15,10 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.models.render import OpenAIChatRenderer
|
||||
from nisse_core.models.render_anthropic import AnthropicMessagesRenderer
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.render import OpenAIChatRenderer
|
||||
from nisse_core.render_anthropic import AnthropicMessagesRenderer
|
||||
from nisse_core.state import StateStore
|
||||
from nisse_core.state.store import StateStore
|
||||
|
||||
|
||||
class Store(StateStore):
|
||||
|
||||
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.state import StateStore
|
||||
from nisse_core.worker import InlineWorker, SerialWorker
|
||||
from nisse_core.state.store import StateStore
|
||||
from nisse_core.state.worker import InlineWorker, SerialWorker
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in new issue
Block a user