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
@@ -11,7 +11,8 @@ from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.execution.ssh import SSHHost
|
||||
from nisse_core.log.canonical import (
|
||||
CanonicalEvent,
|
||||
Fact,
|
||||
StoredEvent,
|
||||
@@ -19,8 +20,7 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.catalog import ModelFacts
|
||||
from nisse_core.execution import SSHHost
|
||||
from nisse_core.models.catalog import ModelFacts
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_dev.bench.tasks import Task
|
||||
from nisse_dev.config import Tuning
|
||||
|
||||
@@ -23,9 +23,13 @@ from typing import Any
|
||||
|
||||
import yaml
|
||||
|
||||
from nisse_core.llm import DEFAULT_MAX_OUTPUT_TOKENS, DEFAULT_REQUEST_TIMEOUT_S, RoleMap
|
||||
from nisse_core.matrix import MatrixConfig
|
||||
from nisse_core.vault import ACCESS, DEFAULT_IGNORE
|
||||
from nisse_core.conversation.matrix import MatrixConfig
|
||||
from nisse_core.knowledge.vault import ACCESS, DEFAULT_IGNORE
|
||||
from nisse_core.models.llm import (
|
||||
DEFAULT_MAX_OUTPUT_TOKENS,
|
||||
DEFAULT_REQUEST_TIMEOUT_S,
|
||||
RoleMap,
|
||||
)
|
||||
|
||||
DEFAULT_CONFIG_FILE = "nisse-dev.yaml"
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ from collections.abc import Callable
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Literal
|
||||
|
||||
from nisse_core.cancel import Cancel, skip_calls
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
AssistantText,
|
||||
DelegationCompleted,
|
||||
DelegationStarted,
|
||||
@@ -39,9 +38,10 @@ from nisse_core.canonical import (
|
||||
ToolCall,
|
||||
ToolResult,
|
||||
)
|
||||
from nisse_core.llm import LLMClient, LLMError, UpstreamUnavailable
|
||||
from nisse_core.reconcile import Reconciler
|
||||
from nisse_core.state import Intent, Transcript
|
||||
from nisse_core.models.llm import LLMClient, LLMError, UpstreamUnavailable
|
||||
from nisse_core.state.cancel import Cancel, skip_calls
|
||||
from nisse_core.state.reconcile import Reconciler
|
||||
from nisse_core.state.store import Intent, Transcript
|
||||
from nisse_dev.git import GitError, GitRepo
|
||||
from nisse_dev.state import StateStore
|
||||
from nisse_dev.tools import EXECUTION_TOOLS, MUTATING_TOOLS, Workspace
|
||||
|
||||
@@ -15,7 +15,7 @@ from collections.abc import Iterable
|
||||
from dataclasses import asdict, dataclass
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
ActionVerdict,
|
||||
DelegationCompleted,
|
||||
DelegationStarted,
|
||||
|
||||
@@ -26,14 +26,14 @@ import json
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.log.canonical import (
|
||||
DelegationCompleted,
|
||||
DelegationStarted,
|
||||
StoredEvent,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.llm import LLMClient, LLMError, RoleMap
|
||||
from nisse_core.state import Transcript
|
||||
from nisse_core.models.llm import LLMClient, LLMError, RoleMap
|
||||
from nisse_core.state.store import Transcript
|
||||
|
||||
EXPERT_ROLE = "expert"
|
||||
DEFAULT_BUDGET = 3
|
||||
|
||||
@@ -21,7 +21,7 @@ import shlex
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
|
||||
from nisse_core.execution import HostUnavailable, SSHHost
|
||||
from nisse_core.execution.ssh import HostUnavailable, SSHHost
|
||||
|
||||
TIMEOUT_S = 120
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ do, judged by code before anything runs.
|
||||
and is logged.
|
||||
|
||||
A rule never makes a command less severe than its worst part; what can't be
|
||||
read statically is unknown (nisse_core.actions).
|
||||
read statically is unknown (nisse_core.authority.actions).
|
||||
"""
|
||||
|
||||
import posixpath
|
||||
from collections.abc import Callable
|
||||
|
||||
from nisse_core.actions import (
|
||||
from nisse_core.authority.actions import (
|
||||
CONTAINED,
|
||||
DANGEROUS,
|
||||
HARMLESS,
|
||||
|
||||
@@ -26,7 +26,7 @@ from dataclasses import dataclass, replace
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.actions import (
|
||||
from nisse_core.authority.actions import (
|
||||
CONTAINED,
|
||||
DANGEROUS,
|
||||
REFUSED,
|
||||
@@ -34,8 +34,12 @@ from nisse_core.actions import (
|
||||
Action,
|
||||
Verdict,
|
||||
)
|
||||
from nisse_core.cancel import Cancel
|
||||
from nisse_core.canonical import (
|
||||
from nisse_core.conversation.transport import InboundMessage, Transport
|
||||
from nisse_core.execution.ssh import HostKeyChanged, HostUnavailable
|
||||
from nisse_core.gitea import GiteaClient, GiteaError, Issue, PullRequest
|
||||
from nisse_core.knowledge.memory import Memory
|
||||
from nisse_core.knowledge.vault import Vault, VaultError
|
||||
from nisse_core.log.canonical import (
|
||||
ActionVerdict,
|
||||
DelegationCompleted,
|
||||
DelegationStarted,
|
||||
@@ -46,15 +50,11 @@ from nisse_core.canonical import (
|
||||
ToolResult,
|
||||
UserMessage,
|
||||
)
|
||||
from nisse_core.execution import HostKeyChanged, HostUnavailable
|
||||
from nisse_core.gitea import GiteaClient, GiteaError, Issue, PullRequest
|
||||
from nisse_core.llm import LLMError, RoleMap
|
||||
from nisse_core.memory import Memory
|
||||
from nisse_core.models.llm import LLMError, RoleMap
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.state import WorkItem
|
||||
from nisse_core.transport import InboundMessage, Transport
|
||||
from nisse_core.vault import Vault, VaultError
|
||||
from nisse_core.worker import Worker
|
||||
from nisse_core.state.cancel import Cancel
|
||||
from nisse_core.state.store import WorkItem
|
||||
from nisse_core.state.worker import Worker
|
||||
from nisse_dev.config import GENERAL
|
||||
from nisse_dev.delegation import DELEGATION_INTENT, Delegation
|
||||
from nisse_dev.expert import BudgetExhausted, ExpertDesk
|
||||
|
||||
@@ -7,17 +7,17 @@ import threading
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
|
||||
from nisse_core.cancel import Cancel
|
||||
from nisse_core.catalog import ModelCatalog, select_client
|
||||
from nisse_core.context import BudgetedClient
|
||||
from nisse_core.execution import SSHHost
|
||||
from nisse_core.conversation.matrix import MatrixTransport
|
||||
from nisse_core.execution.ssh import SSHHost
|
||||
from nisse_core.gitea import GiteaClient
|
||||
from nisse_core.llm import AnthropicPassthroughClient, LiteLLMClient
|
||||
from nisse_core.matrix import MatrixTransport
|
||||
from nisse_core.memory import Memory
|
||||
from nisse_core.knowledge.memory import Memory
|
||||
from nisse_core.knowledge.vault import Vault
|
||||
from nisse_core.models.catalog import ModelCatalog, select_client
|
||||
from nisse_core.models.context import BudgetedClient
|
||||
from nisse_core.models.llm import AnthropicPassthroughClient, LiteLLMClient
|
||||
from nisse_core.oplog import OpLog
|
||||
from nisse_core.vault import Vault
|
||||
from nisse_core.worker import SerialWorker
|
||||
from nisse_core.state.cancel import Cancel
|
||||
from nisse_core.state.worker import SerialWorker
|
||||
from nisse_dev.config import AgentConfig, ConfigError
|
||||
from nisse_dev.config import Project as ProjectEntry
|
||||
from nisse_dev.delegation import Caps
|
||||
|
||||
@@ -16,9 +16,9 @@ from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.actions import CONTAINED, DANGEROUS, Action, Verdict
|
||||
from nisse_core.canonical import StoredEvent, ToolCall, UserMessage
|
||||
from nisse_core.llm import LLMClient, LLMError
|
||||
from nisse_core.authority.actions import CONTAINED, DANGEROUS, Action, Verdict
|
||||
from nisse_core.log.canonical import StoredEvent, ToolCall, UserMessage
|
||||
from nisse_core.models.llm import LLMClient, LLMError
|
||||
|
||||
SAFE = "safe"
|
||||
IN_SCOPE = "in_scope"
|
||||
|
||||
@@ -11,10 +11,10 @@ from collections.abc import Callable, Mapping
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Literal
|
||||
|
||||
from nisse_core.cancel import Cancel, skip_calls
|
||||
from nisse_core.canonical import AssistantText, Fact, ToolCall, ToolResult
|
||||
from nisse_core.llm import LLMClient, LLMError
|
||||
from nisse_core.state import Transcript
|
||||
from nisse_core.log.canonical import AssistantText, Fact, ToolCall, ToolResult
|
||||
from nisse_core.models.llm import LLMClient, LLMError
|
||||
from nisse_core.state.cancel import Cancel, skip_calls
|
||||
from nisse_core.state.store import Transcript
|
||||
from nisse_dev.loop.tools import WAITING, names
|
||||
from nisse_dev.tools import Workspace
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ half-edited tree).
|
||||
from collections.abc import Callable, Mapping
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from nisse_core.llm import LLMClient, RoleMap
|
||||
from nisse_core.models.llm import LLMClient, RoleMap
|
||||
from nisse_dev.config import Profile
|
||||
from nisse_dev.delegation import Caps
|
||||
from nisse_dev.expert import DEFAULT_BUDGET
|
||||
|
||||
@@ -8,7 +8,7 @@ agreement, what it is waiting for) is in ``data["loop"]``.
|
||||
from dataclasses import asdict, dataclass
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.state import WorkItem
|
||||
from nisse_core.state.store import WorkItem
|
||||
from nisse_dev.state import StateStore
|
||||
|
||||
READY = "ready"
|
||||
|
||||
@@ -20,8 +20,8 @@ import shlex
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.actions import split_shell, unwrap
|
||||
from nisse_core.execution import SSHHost
|
||||
from nisse_core.authority.actions import split_shell, unwrap
|
||||
from nisse_core.execution.ssh import SSHHost
|
||||
|
||||
# What the harness itself runs on a build VM (L13, D4): part of the
|
||||
# template, never of a project's toolchain.
|
||||
|
||||
@@ -10,8 +10,8 @@ The driver's model reads for now; the classifier role takes over in M2.6.
|
||||
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.canonical import StoredEvent, ToolCall, UserMessage
|
||||
from nisse_core.llm import LLMClient, LLMError
|
||||
from nisse_core.log.canonical import StoredEvent, ToolCall, UserMessage
|
||||
from nisse_core.models.llm import LLMClient, LLMError
|
||||
|
||||
|
||||
def command_form(text: str) -> str:
|
||||
|
||||
@@ -5,8 +5,8 @@ import sqlite3
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
|
||||
from nisse_core import state
|
||||
from nisse_core.state import Migration, utc_now
|
||||
from nisse_core.state import store as state
|
||||
from nisse_core.state.store import Migration, utc_now
|
||||
|
||||
_VM_BLOCKS = """
|
||||
CREATE TABLE vm_blocks (
|
||||
@@ -48,7 +48,7 @@ class StateStore(state.StateStore):
|
||||
"toolchain", # the toolchain step (D3): the driver's model, apart
|
||||
"memory", # the memory pass at an item's close (L6.4), apart too
|
||||
}
|
||||
# What each role is shown of the others' work (``nisse_core.views``).
|
||||
# What each role is shown of the others' work (``nisse_core.log.views``).
|
||||
SHOWN: Mapping[str, Mapping[str, str]] = {
|
||||
"driver": {"helper": "report"},
|
||||
"helper": {"driver": "narrate"},
|
||||
|
||||
@@ -20,8 +20,8 @@ from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from nisse_core.context import head_and_tail
|
||||
from nisse_core.execution import HostUnavailable, Result, SSHHost
|
||||
from nisse_core.execution.ssh import HostUnavailable, Result, SSHHost
|
||||
from nisse_core.models.context import head_and_tail
|
||||
|
||||
# Tools that change or verify something. Reading a file or listing a
|
||||
# directory is a model looking around, not doing the work, so neither counts
|
||||
|
||||
Reference in new issue
Block a user