Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@

### Changed

- The local MindIE adapter moves into the Apps package and its four root files
are removed (Refs #452, M1), with no forwarding shell, `sys.modules` alias or
import fallback:
- `inferrsi.mindie_project` → `inferrsi.apps.mindie.project`
- `inferrsi.mindie_context` → `inferrsi.apps.mindie.context`
- `inferrsi.mindie_mcp` → `inferrsi.apps.mindie.mcp`
- `src/inferrsi/_mindie_read_worker.py` →
`src/inferrsi/apps/mindie/read_worker.py`, a standalone file that is run by
path and never imported
- The four files move with their code unchanged apart from the imports that
name their neighbours (`.context`, `.project`, `.mcp`) and the package
version, which `mcp.py` now reads with `from ... import __version__`.
`apps/mindie/__init__.py` imports nothing and does not re-export the
version. The `inferrsi mindie` and `inferrsi campaign import-mindie`
commands, the Codex configuration and the MCP server name are unchanged.
- The worker keeps its boundary: it starts with `-I -B` in a private working
directory, with a 20 second limit and a 2 MiB cap, opens SQLite read-only,
imports only the standard library at the top level and imports
`mindie_knowledge` inside `read()`. It is not standard-library-only overall.
The grant file, its explicit opt-in and the recorded read receipts are
unchanged, as is the OBS layout.
- Importing `inferrsi.mindie_project`, `inferrsi.mindie_context` or
`inferrsi.mindie_mcp` now raises `ModuleNotFoundError`, in external Python
code as well as in this repository, and a pickle that names an object by
one of these paths no longer loads. Callers import from
`inferrsi.apps.mindie`. Frozen evidence is not rewritten.
- The tracked package root shrinks from six files to the final two,
`__init__.py` and `__main__.py`. The four paths join `RETIRED_ROOT_MODULES`
in the gate, so a root file that returns under any of them fails, and the
installed-wheel checker verifies that the adapter and worker ship under
`apps/mindie/` and that the installed adapter starts the installed worker by
file path and gets its structured rejection for an unavailable catalog.
- Isolation is still incomplete: the 12 Harness hits into Infra (R2, #412)
and the five runtime resource loaders (R3, #412) remain.

- The campaign chart renderer and the single-task launcher move into the Apps
package and the two root modules are removed (Refs #408, A2), with no
forwarding shell, `sys.modules` alias or import fallback. Both files move
Expand Down
22 changes: 14 additions & 8 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ src/inferrsi/
apps/
evidence_layout.py Create the plan/results/patch/validator evidence directories
campaign.py Knowledge values connected to Harness campaign records
mindie/
project.py Opt-in per-checkout grant, the worker launch and the recorded read
context.py Export supplied MindIE reads into a caller-reviewed campaign trace
mcp.py Stdio MCP for the two approved local MindIE reads
read_worker.py Standalone worker run by the approved MindIE interpreter
views/
summary_chart.py Stdlib SVG gain chart (chain/branch) and report figure spec
optimization_chart.py Managed optimization objective/token curves and final result
Expand Down Expand Up @@ -271,19 +276,20 @@ examples/ Current Qwen runner, image validator and v4 adapter
tests/fixtures/legacy/ Frozen historical validation dependencies for regressions
```

The package root holds exactly six tracked files at this stage: `__init__.py`,
`__main__.py`, `mindie_context.py`, `mindie_mcp.py`, `mindie_project.py` and
`_mindie_read_worker.py`. #408 A2 moved the chart renderer to
The package root holds exactly two tracked files: `__init__.py` and `__main__.py`.
#452 M1 moved the MindIE adapter to `apps/mindie/` (`project.py`, `context.py`,
`mcp.py` and the standalone `read_worker.py`) and deleted root `mindie_project.py`,
`mindie_context.py`, `mindie_mcp.py` and `_mindie_read_worker.py` with no forwarding
shell or alias. #408 A2 moved the chart renderer to
`apps/views/summary_chart.py` and the task launcher to `apps/benchmark_operations.py`
and deleted root `summary_chart.py` and `benchmark_operations.py` with no forwarding
shell or alias. #408 A1 moved the CLI and its parser to `apps/cli/`
and deleted root `cli.py` and `arguments.py` the same way;
and deleted root `summary_chart.py` and `benchmark_operations.py` the same way. #408 A1 moved the CLI and its parser to `apps/cli/`
and deleted root `cli.py` and `arguments.py`;
`__main__.py` and the console script call `inferrsi.apps.cli:main`. #412 R1 deleted eleven root modules with no
forwarding shell or alias: the seven Knowledge shells, whose code is in
`knowledge/`; the three old-run forwarders `evaluation.py`, `execution.py` and
`reporting.py`, whose code is in `apps/legacy/`; and `inspection.py`, whose
host binding is `apps/inspection.py`. The final two-file root (`__init__.py`
and `__main__.py`) waits for the M1 (#452) move.
host binding is `apps/inspection.py`. The build-generated `_version.py` is ignored
wheel metadata, not a tracked root file.
[module-layout.md](module-layout.md#retired-root-modules) maps each retired
path to its replacement and lists what still keeps the isolation gate false.

Expand Down
57 changes: 39 additions & 18 deletions docs/module-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ nothing. Neither package is a fourth core. C2 (#451) moved these out of root
`_repo_pack_data.py` and `evidence_paths.py` and deleted both root files, with
no forwarding shell or alias.

The flat package root is retired in stages.
`tests/test_package_root_inventory.py` pins the root to an exact file set: 23
tracked files after C1, 21 after C2, 10 after R1 (#412), 8 after A1 (#408) and 6
after A2 (#408). The six are `__init__.py`, `__main__.py`,
`_mindie_read_worker.py`, `mindie_context.py`, `mindie_mcp.py` and
`mindie_project.py`. A2 moved root `summary_chart.py` to
The flat package root is retired. `tests/test_package_root_inventory.py` pins the
root to an exact file set: 23 tracked files after C1, 21 after C2, 10 after R1
(#412), 8 after A1 (#408), 6 after A2 (#408) and the final two after M1 (#452).
The two are `__init__.py` and `__main__.py`. M1 moved root `mindie_project.py`,
`mindie_context.py`, `mindie_mcp.py` and `_mindie_read_worker.py` to
`apps/mindie/project.py`, `context.py`, `mcp.py` and `read_worker.py` and deleted
the four root files with no forwarding shell or alias. A2 moved root
`summary_chart.py` to
`apps/views/summary_chart.py` and root `benchmark_operations.py` to
`apps/benchmark_operations.py` and deleted both root files with no forwarding
shell or alias. A1 moved root `cli.py` and
`apps/benchmark_operations.py` and deleted both root files the same way. A1 moved root `cli.py` and
`arguments.py` to `apps/cli/__init__.py` and `apps/cli/arguments.py` and
deleted both root files the same way. The last removal PR shrinks the set in
the same change: M1 (#452) moves the four MindIE files. The guard does
not assert the final two-file root (`__init__.py` and `__main__.py`) early,
and the build-generated `_version.py` is ignored wheel metadata, not a tracked
root file. [Retired root modules](#retired-root-modules) lists the eleven
paths that R1 removed, the two that A1 removed and the two that A2 removed.
deleted both root files. A new root file now fails the guard, so a later module
belongs in a subpackage. The build-generated `_version.py` is ignored wheel
metadata, not a tracked root file. [Retired root modules](#retired-root-modules)
lists the eleven paths that R1 removed, the two that A1 removed, the two that A2
removed and the four that M1 removed.

The current `src/inferrsi/harness/` tree is a mixed implementation. Its
presence is not the target Harness boundary and is not evidence that the four
Expand Down Expand Up @@ -120,6 +120,7 @@ Several flat modules remain shared seams until their slice starts.
| `knowledge/knowledge_operations.py`, `knowledge/knowledge_store.py`, `knowledge/catalog.py`, `knowledge/research.py`, `knowledge/skill_catalog.py`, `knowledge/_skill_selection.py`, `knowledge/_source_snapshot.py` | The seven Knowledge implementations, moved by K01 | Interfaces unchanged; the same-named root shells were deleted by R1 |
| `harness/records/` | Campaign manifests, traces, logs, profile captures and delivered-context captures | Imports no Knowledge or Apps module; `apps/campaign.py` supplies the backend names, the selection default and the context projection |
| `apps/views/`, `apps/campaign.py` | Dashboard views, templates and the Knowledge-to-records connection | Apps path still follows the #371 proposal |
| `apps/mindie/` (`project.py`, `context.py`, `mcp.py`, `read_worker.py`) | The local MindIE adapter: project grant, stdio MCP, context export and the read worker | M1 (#452) moved the four root MindIE files here; no Harness, Knowledge or Infra module names MindIE, and the initializer imports nothing |
| `harness/` | Mixed legacy tree, not target isolation | Not redefined |
| `harness/runner.py`, `harness/scenarios/external.py`, `harness/atomic_json.py` | Old run execution facts and Harness-owned JSON writes | Ports injected; no Model edge, and no Infra edge except the local process executor |
| `benchmark/legacy_run_v0.py`, `benchmark/sampling.py` | Old run gates and metric validation; image/video sample collection | Imports only `model/protocols/metrics`; owns its rule inputs and verdict labels |
Expand Down Expand Up @@ -492,10 +493,6 @@ The `inferrsi` console script and `python -m inferrsi` call
unchanged. A test replaces a CLI name such as `_knowledge_reader` or `files` on
`inferrsi.apps.cli`.

The root now holds the six files listed under
[Target modules](#target-modules). The final two-file root waits for the
M1 (#452) move.

A2 (#408) deleted two more root modules the same way:

| Retired root module | Canonical module |
Expand All @@ -508,6 +505,30 @@ A2 (#408) deleted two more root modules the same way:
the SVG and Markdown bytes it writes are unchanged. The dashboard, the HTML report
and the CLI `benchmarks run` command import the canonical modules.

M1 (#452) deleted the four root MindIE files the same way:

| Retired root module | Canonical module or file |
| --- | --- |
| `inferrsi.mindie_project` | `inferrsi.apps.mindie.project` |
| `inferrsi.mindie_context` | `inferrsi.apps.mindie.context` |
| `inferrsi.mindie_mcp` | `inferrsi.apps.mindie.mcp` |
| `inferrsi._mindie_read_worker` | `src/inferrsi/apps/mindie/read_worker.py`, a file run by path and not imported |

The four files moved with their code unchanged except the imports that name
their neighbours and the package version. `apps/mindie/__init__.py` imports
nothing and does not re-export `__version__`; `mcp.py` reads it with
`from ... import __version__`. The worker is still started as
`python -I -B read_worker.py` with a private working directory, a 20 second limit
and a 2 MiB cap, opens SQLite read-only, imports only the standard library at
the top level and takes `mindie_knowledge` inside `read()`. It is not described
as standard-library-only overall. The grant file, its explicit opt-in, the
recorded read receipts and the OBS layout are unchanged. The `inferrsi mindie`
and `inferrsi campaign import-mindie` commands, the Codex configuration in
[codex-plugin.md](codex-plugin.md) and the MCP server name are unchanged.

The root now holds exactly the two files `__init__.py` and `__main__.py`. The
build-generated `_version.py` is separate wheel metadata.

## Old `run` exit codes

Frozen from
Expand Down
4 changes: 2 additions & 2 deletions src/inferrsi/apps/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def main(argv: list[str] | None = None) -> int:
args = argument_parser.parse_args(argv)
try:
if args.command == "mindie":
from ...mindie_project import dispatch
from ..mindie.project import dispatch

result = dispatch(args)
if result is not None:
Expand Down Expand Up @@ -408,7 +408,7 @@ def main(argv: list[str] | None = None) -> int:

if args.command == "campaign":
if args.campaign_action == "import-mindie":
from ...mindie_context import export_context
from ..mindie.context import export_context

path = export_context(
args.directory, context_id=args.id, query_input=args.query_input,
Expand Down
5 changes: 5 additions & 0 deletions src/inferrsi/apps/mindie/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The local MindIE adapter: project grant, stdio MCP, context export and the read worker.

This initializer imports nothing. The worker file runs under the approved MindIE
interpreter and must stay loadable without this package.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This CLI host adapter never activates MindIE, reads a session or calls a model.
Retained responses establish supplied bytes, not their authenticity or consumption.
It stays with the current flat CLI; it does not instantiate the proposed Apps package.
It lives in the Apps package with the rest of the MindIE adapter.
"""

from __future__ import annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import re
import sys

from . import __version__
from .mindie_context import MAX_BYTES, _invalid_constant, _object
from .mindie_project import call, describe
from ... import __version__
from .context import MAX_BYTES, _invalid_constant, _object
from .project import call, describe

_PROTOCOL = "2025-11-25"
_SUPPORTED = {"2024-11-05", "2025-03-26", "2025-06-18", _PROTOCOL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import tempfile
from pathlib import Path

from .mindie_context import MAX_BYTES, _parse
from .context import MAX_BYTES, _parse

_SCHEMA = "inferrsi-mindie-project/1"
_DOMAIN = re.compile(r"[a-z][a-z0-9-]{0,63}")
_WORKER = Path(__file__).with_name("_mindie_read_worker.py")
_WORKER = Path(__file__).with_name("read_worker.py")
_REF_ID = r"[A-Za-z0-9_.-]+@[1-9][0-9]*"
_SEARCH_FIELDS = {"query", "conditions", "limit", "token_budget", "include_unknown"}
_EXPLAIN_FIELDS = {"refs", "conditions", "known_refs", "token_budget"}
Expand Down Expand Up @@ -241,7 +241,7 @@ def dispatch(args) -> dict | None:
if args.mindie_action == "describe":
return describe()
if args.mindie_action == "serve":
from .mindie_mcp import serve
from .mcp import serve

serve()
return None
Expand Down
12 changes: 11 additions & 1 deletion tests/_gate_policy_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,17 @@
# implementations are ``inferrsi.apps.views.summary_chart`` and
# ``inferrsi.apps.benchmark_operations``.
RETIRED_BY_A2 = frozenset({"inferrsi.summary_chart", "inferrsi.benchmark_operations"})
RETIRED_ROOT_MODULES = RETIRED_BY_R1 | RETIRED_BY_A1 | RETIRED_BY_A2
# #452 M1 deleted the four root MindIE files the same way. The adapter is the
# ``inferrsi.apps.mindie`` package: ``project``, ``context``, ``mcp`` and ``read_worker``.
RETIRED_BY_M1 = frozenset(
{
"inferrsi.mindie_project",
"inferrsi.mindie_context",
"inferrsi.mindie_mcp",
"inferrsi._mindie_read_worker",
}
)
RETIRED_ROOT_MODULES = RETIRED_BY_R1 | RETIRED_BY_A1 | RETIRED_BY_A2 | RETIRED_BY_M1
# #412 R1, permanent: the one importer of the neutral data leaf outside
# ``inferrsi.knowledge``, with the only name it may bind (D020: Infra reads one pack
# description and reaches no Knowledge or Harness). This is not a manifest
Expand Down
Loading
Loading