nisse-core: group modules into packages by architecture section
CI / checks (push) Skipped
CI / checks (pull_request) Successful in 1m37s
CI / e2e (pull_request) Successful in 4m5s

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:
dongarandClaude Opus 5.5 committed 2026-10-13 21:16:09 +00:00
1 parent 06759d5d70
commit e351d0a74e
117 files changed
+291 -265

No files matched your search

@@ -0,0 +1 @@
"""Actions by their effects (architecture P3, P4, L3, L4)."""
@@ -0,0 +1 @@
"""Conversation with the operator (architecture L5)."""
@@ -27,7 +27,7 @@ from urllib.parse import unquote
import httpx
from nisse_core.transport import InboundMessage
from nisse_core.conversation.transport import InboundMessage
# A mention pill at the start of an HTML body: the link holds the user ID,
# the link text is what the plain body starts with.
@@ -0,0 +1 @@
"""Running commands on tool VMs over SSH (architecture L13)."""
@@ -14,7 +14,7 @@ from collections.abc import Iterator
from contextlib import contextmanager
from pathlib import Path
from nisse_core.execution import SSHHost
from nisse_core.execution.ssh import SSHHost
SSHD = "/usr/sbin/sshd"
+2 -2
View File
@@ -16,8 +16,8 @@ from typing import Any
import httpx
from nisse_core.reconcile import Reconciler
from nisse_core.state import Intent
from nisse_core.state.reconcile import Reconciler
from nisse_core.state.store import Intent
PR_PAGE_SIZE = 50
MAX_PR_PAGES = 40 # 2000 PRs; beyond that, say so rather than guess
@@ -0,0 +1 @@
"""The knowledge vault (architecture L10) and agent memory (L6.4)."""
@@ -14,7 +14,7 @@ from dataclasses import dataclass
import yaml
from nisse_core.vault import Vault, VaultError, split_frontmatter
from nisse_core.knowledge.vault import Vault, VaultError, split_frontmatter
INDEX = "index" # the note the harness keeps; never the model's
_NAME = re.compile(r"[a-z0-9][a-z0-9-]{0,63}")
@@ -0,0 +1,2 @@
"""The canonical log (architecture L7) and what each role is shown of it
(L6)."""
@@ -20,7 +20,7 @@ ranges still line up with the log. Everything not the viewer's own becomes a
from collections.abc import Mapping
from dataclasses import replace
from nisse_core.canonical import (
from nisse_core.log.canonical import (
ActionVerdict,
AssistantText,
DelegationCompleted,
@@ -0,0 +1,2 @@
"""Talking to models (architecture L9): the client, what the models are, and
the request bodies built from the log (L7)."""
@@ -19,7 +19,7 @@ from typing import Any
import httpx
from nisse_core.llm import LLMClient, LLMError
from nisse_core.models.llm import LLMClient, LLMError
# LiteLLM's provider name for models we have a vendor-native adapter for.
ANTHROPIC_PROVIDER = "anthropic"
@@ -28,7 +28,7 @@ from collections.abc import Callable, Sequence
from dataclasses import dataclass, replace
from typing import Any
from nisse_core.canonical import (
from nisse_core.log.canonical import (
AssistantText,
CanonicalEvent,
DelegationStarted,
@@ -38,7 +38,7 @@ from nisse_core.canonical import (
ToolResult,
UserMessage,
)
from nisse_core.llm import DEFAULT_MAX_OUTPUT_TOKENS, LLMError
from nisse_core.models.llm import DEFAULT_MAX_OUTPUT_TOKENS, LLMError
# English and code run at about four characters a token. Three is deliberately
# pessimistic, before any correction from what the server reports.
@@ -17,15 +17,15 @@ from typing import Any, ClassVar, Protocol
import httpx
from nisse_core.canonical import (
from nisse_core.log.canonical import (
AssistantText,
CanonicalEvent,
StoredEvent,
ToolCall,
mint_call_id,
)
from nisse_core.render import OpenAIChatRenderer
from nisse_core.render_anthropic import AnthropicMessagesRenderer
from nisse_core.models.render import OpenAIChatRenderer
from nisse_core.models.render_anthropic import AnthropicMessagesRenderer
class LLMError(RuntimeError):
@@ -24,7 +24,7 @@ from dataclasses import dataclass
import httpx
from nisse_core.catalog import ModelFacts
from nisse_core.models.catalog import ModelFacts
# Of a probe's size, how much must come back for it to count as uncut. A
# chat template adds a little, and a tokenizer counts a little differently.
@@ -11,7 +11,7 @@ this skeleton.
import json
from typing import Any
from nisse_core.canonical import (
from nisse_core.log.canonical import (
AssistantText,
Compaction,
DelegationCompleted,
@@ -18,7 +18,7 @@ route and this renderer builds the vendor-native body.
from typing import Any
from nisse_core.canonical import (
from nisse_core.log.canonical import (
AssistantText,
Compaction,
DelegationCompleted,
@@ -31,7 +31,7 @@ from nisse_core.canonical import (
ToolResult,
UserMessage,
)
from nisse_core.render import effective_events
from nisse_core.models.render import effective_events
DEFAULT_MAX_TOKENS = 4096
NO_RESULT_PLACEHOLDER = "[no result recorded]"
@@ -0,0 +1,2 @@
"""Durability (architecture L8): the state store, reconciliation, the worker
thread and the kill switch."""
@@ -8,8 +8,8 @@ record of a stop is written by the worker when the stopped work returns.
import threading
from nisse_core.canonical import ToolCall, ToolResult
from nisse_core.state import Transcript
from nisse_core.log.canonical import ToolCall, ToolResult
from nisse_core.state.store import Transcript
STOPPED_RESULT = "not run: the operator stopped the agent"
@@ -1,6 +1,6 @@
"""A readable dump of a state store, for bring-up runs and debugging.
python -m nisse_core.dump STATE_DB [--full]
python -m nisse_core.state.dump STATE_DB [--full]
Opens the store read-only (SQLite `mode=ro`), so it is safe to run against a
live agent's database: it never migrates, writes or locks it. Prints the work
@@ -11,7 +11,7 @@ from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Literal
from nisse_core.state import Intent, StateStore
from nisse_core.state.store import Intent, StateStore
# Returns True if the intent's external effect verifiably happened (do not
# repeat it), False if it verifiably never started (safe to discard), or
@@ -6,7 +6,7 @@ intent-log write is a single immediately-committed statement — in-memory state
that hasn't hit disk is assumed lost.
The intent log records a unit of work *before* it starts, so a restart knows
what was in flight (see ``nisse_core.reconcile`` for how pending intents are
what was in flight (see ``nisse_core.state.reconcile`` for how pending intents are
resolved against external truth on boot).
"""
@@ -18,7 +18,7 @@ from datetime import UTC, datetime
from pathlib import Path
from typing import Any, Self
from nisse_core.canonical import (
from nisse_core.log.canonical import (
CanonicalEvent,
StoredEvent,
UserMessage,
@@ -26,8 +26,8 @@ from nisse_core.canonical import (
from_payload,
to_payload,
)
from nisse_core.log.views import project
from nisse_core.oplog import OpLog
from nisse_core.views import project
# The tables every agent has. An agent's own tables come on top: a subclass
# names them, the version they bring, and the migrations to it.