v0.2.0: SQlite db, full FastAPI server, MCP exposure #10

Merged
fnoble merged 38 commits from v0.2.0 into main 2026-08-27 18:42:58 +00:00
Owner
No description provided.
chore(release): increment version
Some checks failed
CI / check (push) Failing after 21s
d675f910fd
style: ruff format
Some checks failed
CI / check (push) Failing after 21s
9ea341a503
fnoble left a comment

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.

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 workflo
requires-python = ">=3.12"
license = "Apache-2.0"
dependencies = [
"jsonschema>=4.21",
Author
Owner

Dependency test fails, check whether the issue is jsonschema.

Dependency test fails, check whether the issue is jsonschema.
@ -0,0 +1,46 @@
"""Agent-specific error taxonomy.
Author
Owner

Shorten head of file docstrings

Shorten head of file docstrings
@ -0,0 +1,78 @@
"""PermissionGate: wraps a ToolRegistry and enforces a PermissionSet per activation."""
Author
Owner

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?

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 = (
Author
Owner

Move to constants for this module

Move to constants for this module
@ -0,0 +9,4 @@
from ngen_weave.agent.errors import UnknownToolError
from ngen_weave.errors import ConfigError, DataError
_TOOL_NAME_RE = re.compile(r"^[a-z][a-z0-9_-]*$")
Author
Owner

Replace with explicit coding, add 'No RegExpressions' to design documents and PRD decisions - too hard to debug'.

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 > 0
Author
Owner

Allow -1 (exclusivel -1 no other negatives, check == -1) for 'no budget cap'. Apply same for steps but add a warning log.

Allow -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.
Author
Owner

Replace with 1-2 line docstring for head of files.

Replace with 1-2 line docstring for head of files.
@ -113,0 +386,4 @@
records=records,
)
def _import_legacy(self) -> None:
Author
Owner

Remove all legacy support crutches, we are not at v1.0 yet and don't require backwards compatibility.

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.
Author
Owner

Remove head of file docsrings (replace with 1-2 lines).

Remove head of file docsrings (replace with 1-2 lines).
@ -0,0 +10,4 @@
from ngen_weave.errors import ConfigError
from ngen_weave.workflow import Workflow
MANIFEST_NAME = "ngen-weave.json"
Author
Owner

Add to module's central config, create one if it doesn't exist.

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:
Author
Owner

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.

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.
Author
Owner

Again, move docstrings to definitions replace head of file with 1-2 lines max.

Again, move docstrings to definitions replace head of file with 1-2 lines max.
@ -0,0 +22,4 @@
from ngen_weave.service import RunService
from ngen_weave.workflow import Workflow
NGEN_WEAVE_DIR = Path(".ngen-weave")
Author
Owner

Add to module central config, create if non existent.

Add to module central config, create if non existent.
@ -0,0 +1,23 @@
[project]
name = "ngen-weave-mcp"
version = "0.1.3"
Author
Owner

This is MCP version 0.1, do not just copy main project version.

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_version
from ngen_weave_mcp.tools import DEFAULT_TOOL_TIMEOUT_S, register_workflow_tools
MCP_HTTP_HOST = "127.0.0.1" # local-only by design; TLS/auth are out of scope
Author
Owner

Centralise config variables per module

Centralise config variables per module
@ -0,0 +13,4 @@
from ngen_weave.workflow import Workflow
from pydantic import ValidationError
POLL_INTERVAL_S = 0.25 # engine-specified status poll cadence while blocking
Author
Owner

Centrlise in MCP module config.

Centrlise in MCP module config.
@ -0,0 +16,4 @@
POLL_INTERVAL_S = 0.25 # engine-specified status poll cadence while blocking
DEFAULT_TOOL_TIMEOUT_S = 3600.0
_TERMINAL_STATUSES = {"completed", "failed", "cancelled"}
Author
Owner

Note: STATUS sets are not config variables as they are structural elements of the logic.

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"
Author
Owner

Should be 0.1 (at least copy main project version accurately)

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.
Author
Owner

Don't cite design / plan docs in the code.

Don't cite design / plan docs in the code.
deps.sh ran bare 'uv sync --locked', which only installs the root
dependency graph (root -> cli -> core) and orphans the ngen-weave-mcp
and ngen-weave-server workspace members, so fastapi/uvicorn/mcp never
installed and the CI pytest step failed at collection.

- deps.sh: sync --all-packages --locked so every member installs
- build.sh: build all four package wheels instead of core+cli only
- mcp/server package versions: 0.1 (they were copying the monorepo
  version 0.1.3); uv.lock updated accordingly (version pins only)
Review findings: head-of-file docstrings, observer predicate
overengineering, legacy support crutches.

- docstrings: every module header cut to <=2 lines, detail moved to
  class/function definitions (PRD rule: headers are not content indexes)
- observers: gt/lt/ge/le/eq builder functions removed; call sites
  construct ObserverPredicate(field, op, value) directly; describe()
  output byte-identical; PRD decision record updated
- store: _import_legacy and all pre-1.0 import/migration compatibility
  removed (fallbacks in service.py started_at, state.py, export.py
  tolerant loading, legacy tests/fixtures); PRD and implementation-plan
  statements about readable legacy JSON revised to match the deliberate
  no-back-compat decision; canonical load_run_json() export parser kept
Review findings: floating config constants, regex-based tool name
validation (no-regex decision: too hard to debug).

- constants: behaviour-affecting constants centralised into
  ngen_weave.constants and new ngen_weave_mcp.constants
  (NGEN_WEAVE_DIR, MANIFEST_NAME, MAX_TURNS, REPAIR_NUDGE,
  POLL_INTERVAL_S, DEFAULT_TOOL_TIMEOUT_S, MCP_HTTP_HOST/PORT);
  CLI duplicate NGEN_WEAVE_DIR definition deduplicated; STATUS sets
  intentionally stay local (structural logic, not config)
- validation: _TOOL_NAME_RE and _CLASS_NAME_RE replaced with explicit
  character checks preserving the accepted language exactly;
  differential edge-case tests added (test_tool_name.py, test_workflow.py)
- docs: no-regex decision recorded in PRD and design README; container-
  isation-as-permission-gate research brief added under docs/ (unanswered
  question, no conclusions drawn)
Review finding: budget caps should allow -1 == -1 only as 'no cap'.

- config: cost_usd == -1 and steps == -1 parse as uncapped (BUDGET_UNLIMITED);
  other negatives, zero, and booleans still rejected; steps == -1 emits one
  warning at parse time, not per engine turn
- runner: enforcement treats None and -1 as unlimited before comparing
  usage against the limit, so an uncapped budget never triggers
  budget_exhausted; capped dimensions still enforce normally
- tests: parse + enforcement matrix (mixed capped/uncapped dimensions,
  booleans, -2, nested workflows, no budget records for uncapped runs,
  warning emitted exactly once)
chore(ignore): add plans/tmp
All checks were successful
CI / check (push) Successful in 36s
7b396ecaa0
docs(plans): remove ignored file
All checks were successful
CI / check (push) Successful in 40s
a930c11ac5
fnoble merged commit c477c9d7f3 into main 2026-08-27 18:42:58 +00:00
fnoble deleted branch v0.2.0 2026-08-27 18:42:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
neurogenesis/ngen-weave!10
No description provided.