v0.2.0: SQlite db, full FastAPI server, MCP exposure #10
Loading…
Reference in a new issue
No description provided.
Delete branch "v0.2.0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BLOCKING:
Dependency install test failed. jsonschema was introduced (into ngen-weave-core, as was ngen-weave-core as a dependency of ngen-weave-mcp (Likely the latter, investigate and fix)
MINOR:
Head of file docstrings still included. Replace them with 1-2 lines in head of file, write detailed docstrings only at class/function definition.
Observer predicate overengineering: overcomplicated observer predicates, helper funcs need to be full classes or removed and call ObserverPredicate constructor directly.
Floating config constants: Some constants are defined inline, constants that changes code behaviour should be centralised to 1. user facing config or 2. module specific central configs (.py files) from which they are imported by code that ingests them.
@ -5,6 +5,7 @@ description = "Core library for ngen-weave: durable human-in-the-loop AI workflorequires-python = ">=3.12"license = "Apache-2.0"dependencies = ["jsonschema>=4.21",Dependency test fails, check whether the issue is jsonschema.
@ -0,0 +1,46 @@"""Agent-specific error taxonomy.Shorten head of file docstrings
@ -0,0 +1,78 @@"""PermissionGate: wraps a ToolRegistry and enforces a PermissionSet per activation."""Add a research doc outlining the following task (desired research task described, do not execute it): Is containerisation as permissions gate a better solution than re-building and maintaining one ourselves?
@ -0,0 +13,4 @@MAX_TURNS = 3 # provider turns before exhaustion; one turn yields exactly one action_REPAIR_NUDGE = (Move to constants for this module
@ -0,0 +9,4 @@from ngen_weave.agent.errors import UnknownToolErrorfrom ngen_weave.errors import ConfigError, DataError_TOOL_NAME_RE = re.compile(r"^[a-z][a-z0-9_-]*$")Replace with explicit coding, add 'No RegExpressions' to design documents and PRD decisions - too hard to debug'.
@ -146,0 +176,4 @@raise ConfigError(f"{source}: unknown run.budget keys: {sorted(unknown)}")cost_usd = raw.get("cost_usd")steps = raw.get("steps")cost_ok = isinstance(cost_usd, (int, float)) and not isinstance(cost_usd, bool) and cost_usd > 0Allow -1 (exclusivel -1 no other negatives, check == -1) for 'no budget cap'. Apply same for steps but add a warning log.
@ -1,89 +1,340 @@"""Single-writer persistence for run files."""Single-writer persistence for run state in one SQLite database.Replace with 1-2 line docstring for head of files.
@ -113,0 +386,4 @@records=records,)def _import_legacy(self) -> None:Remove all legacy support crutches, we are not at v1.0 yet and don't require backwards compatibility.
@ -0,0 +1,321 @@"""Budget enforcement and cooperative cancellation.Remove head of file docsrings (replace with 1-2 lines).
@ -0,0 +10,4 @@from ngen_weave.errors import ConfigErrorfrom ngen_weave.workflow import WorkflowMANIFEST_NAME = "ngen-weave.json"Add to module's central config, create one if it doesn't exist.
@ -0,0 +62,4 @@return f"{self.field} {_OP_SYMBOLS[self.op]} {self.value}"def gt(field: str, value: float | int) -> ObserverPredicate:Simplify this. Either create dedicated classes for each op with a string value descriptor for serialised records, or commit to current methodology and call the ObserverPredicate constructor directly instead of these uneccessary builder funcs.
@ -0,0 +1,126 @@"""RunService protocol plus run-summary types.Again, move docstrings to definitions replace head of file with 1-2 lines max.
@ -0,0 +22,4 @@from ngen_weave.service import RunServicefrom ngen_weave.workflow import WorkflowNGEN_WEAVE_DIR = Path(".ngen-weave")Add to module central config, create if non existent.
@ -0,0 +1,23 @@[project]name = "ngen-weave-mcp"version = "0.1.3"This is MCP version 0.1, do not just copy main project version.
@ -0,0 +20,4 @@from ngen_weave_mcp.stdio import EPILOG, _package_versionfrom ngen_weave_mcp.tools import DEFAULT_TOOL_TIMEOUT_S, register_workflow_toolsMCP_HTTP_HOST = "127.0.0.1" # local-only by design; TLS/auth are out of scopeCentralise config variables per module
@ -0,0 +13,4 @@from ngen_weave.workflow import Workflowfrom pydantic import ValidationErrorPOLL_INTERVAL_S = 0.25 # engine-specified status poll cadence while blockingCentrlise in MCP module config.
@ -0,0 +16,4 @@POLL_INTERVAL_S = 0.25 # engine-specified status poll cadence while blockingDEFAULT_TOOL_TIMEOUT_S = 3600.0_TERMINAL_STATUSES = {"completed", "failed", "cancelled"}Note: STATUS sets are not config variables as they are structural elements of the logic.
@ -0,0 +1,19 @@[project]name = "ngen-weave-server"version = "0.1.3"Should be 0.1 (at least copy main project version accurately)
@ -0,0 +1,192 @@"""FastAPI HTTP translation layer: routes translate to LocalRunService calls.No business logic per the PRD.Don't cite design / plan docs in the code.