Shared parts, not a shared scheduler (agreed): nisse-review will have its own small scheduler; a common one waits until two exist to compare. - nisse_core.loop.driver: the driver run, moved; the agent names its waiting tools per run (nisse-dev's are WAITING_TOOLS), and execution goes to any Executor (ToolOutcome moves with it). - nisse_core.loop.tools: the tool helper and the tools any agent offers (notes, memory, memory_done, ask_expert); nisse_core.loop.expert. - nisse_core.knowledge.handlers: Knowledge, the vault and memory as control tools, the index and prompt text, out of LoopAgent. - nisse_core.config: file reading, references, people, tuning sections of the agent's own, LLM numbers, the vault. - New core tests: a driver run with a non-workspace executor and the agent's own waiting set; Knowledge alone; the shared config pieces. Docs: the Development Plan marks M7.2 done; Architecture Part L and the nisse-core README name the new parts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
"""Entry point for the dev agent.
|
|
|
|
Loads configuration, builds the agent, and stays up until told to stop.
|
|
Shutdown is deliberate rather than abrupt: L8's durability guarantees assume
|
|
the process may die at any moment, but a clean stop still beats relying on
|
|
them.
|
|
"""
|
|
|
|
import os
|
|
import signal
|
|
import sys
|
|
from pathlib import Path
|
|
from types import FrameType
|
|
|
|
from nisse_core.config import ConfigError
|
|
from nisse_core.envfile import load_env_file
|
|
from nisse_dev.config import AgentConfig
|
|
from nisse_dev.loop.build import build_loop_agent
|
|
|
|
|
|
def main() -> int:
|
|
load_env_file(Path(os.environ.get("NISSE_ENV", ".env")).expanduser())
|
|
try:
|
|
config = AgentConfig.load()
|
|
except ConfigError as exc:
|
|
# Fail here rather than twenty minutes into a milestone on the one
|
|
# call that needed the missing value.
|
|
print(f"nisse-dev: {exc}", file=sys.stderr)
|
|
return 2
|
|
|
|
agent = build_loop_agent(config)
|
|
|
|
def shutdown(_signum: int, _frame: FrameType | None) -> None:
|
|
print("nisse-dev: stopping", file=sys.stderr)
|
|
agent.stop()
|
|
|
|
signal.signal(signal.SIGINT, shutdown)
|
|
signal.signal(signal.SIGTERM, shutdown)
|
|
|
|
agent.start()
|
|
names = ", ".join(p.name for p in config.projects)
|
|
print(f"nisse-dev: ready as {agent.account} on {names}", file=sys.stderr)
|
|
agent.wait()
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|