Repository navigation
Description
Goal
Relocate the MindIE-specific adapter already in this repository entirely into src/inferrsi/apps/mindie/ (project.py, context.py, mcp.py, read_worker.py). This bounded migration does not take over the broader MindIE Agent integration and real-task qualification tracked by #374, and does not include an internal refactor of existing subpackages. Related: #371, #408 and #412.
PR checklist
- M1 — Consolidate the existing MindIE adapter in Apps and retire the four root paths. Candidate internal files are
project.py,context.py,mcp.pyandread_worker.py. Addworker_process.pyonly if the subprocess launch/limit handling is shared by more than one module insideapps/mindie; do not introduce a one-user abstraction. Keep provider-specific pure projection inside the adapter as pure functions. Keepread_worker.pya standalone file whose top-level imports are stdlib-only: it still runs under the approved MindIE interpreter and importsmindie_knowledgeinsideread(), so do not describe the worker as stdlib-only overall. It must not gain relative or package imports, andapps/mindie/__init__.pymust stay import-free. Repointmindie_mcp.py:7'sfrom . import __version__tofrom ... import __version__(or an absolute import) when the module moves; do not re-export__version__fromapps/mindie/__init__.py. - In that same PR update the canonical CLI, worker/package lookup, active consumers, docs and tests; delete root
mindie_project.py,mindie_context.py,mindie_mcp.pyand_mindie_read_worker.py, and shrink the C1 exact-root inventory guard by these four files in the same PR.
Dependencies and boundaries
Integrate after the canonical CLI migration A1 in #408. All MindIE-specific code, including the worker, stays in apps/mindie/: do not add MindIE-specific Harness, Knowledge or infra modules, and do not create an extensions/ package or scatter MindIE-specific files into the core modules. Apps calls its worker and records original bytes, digests and receipts through applicable existing generic factual-storage interfaces. Verify interface suitability during implementation; do not invent a MindIE-specific core service. Harness must not depend on MindIE or infra.
Acceptance
- Preserve grant storage and explicit opt-in; no implicit activation, counter changes or new MindIE capability.
- Preserve the external-worker
-I -Bboundary, private working directory, 20-second/2-MiB limits and read-only SQLite behavior, including negative tests; add a negative test proving the worker still runs from an installed wheel with-I -Band no package-relative imports. - Preserve source bytes, digests, attribution and receipts. Pure projection has no I/O; do not silently substitute canonical JSON rules for the existing strict parser, and keep the existing strict-parser negative tests byte-for-byte.
- Verify installed-wheel worker lookup outside the checkout, stdio behavior and worker import/isolation side effects, including an installed-wheel import of
apps.mindie.mcp; do not introduce eager core imports through package initializers. Keep the accepted OBS layout decision: the historical six-key/no-retrieval path for readers providing neither observation nor provenance, and the existing extended path otherwise. - No new MindIE-specific code outside
apps/mindie, no four-layer migration, no permanent old-root aliases, and no claims of broader task: 支持 MindIE Agent 对接(知识、执行与评测交接) #374 real-task qualification.
Delivery discipline
- One implementation Claude session handles only the current PR in an isolated worktree. A second Claude session may only plan the next PR in a separate planning worktree; it must not edit source.
- Move implementation, update all active consumers/docs/tests, and delete the corresponding old root modules in the same PR. Do not introduce permanent compatibility shells or module-registry aliases.
- Preserve CLI command behavior, original evidence bytes, record/format contracts and isolation/security checks. Announce retired Python import/serialization module paths; historical frozen evidence remains pinned to its original commit or wheel, not rewritten.
- Before each implementation or review handoff, refresh main and confirmed dependencies. A completed plan is not implementation or approval. No automatic merge.
Activity
amy-why-3459 commentedon Nov 15, 2026
Thanks, the boundary against #374 is clear. I checked current main (
1373ef8e) and have a few notes for M1:mindie_project.py:17resolves the worker asPath(__file__).with_name("_mindie_read_worker.py")and launches it with[grant["python"], "-I", "-B", str(_WORKER), ...](line 104). Because the worker runs by file path under-I,apps/mindie/read_worker.pymust stay a standalone stdlib-only script. That holds today: it imports onlyjson,sqlite3,sys,contextlib,importlib.metadata, etc. It must not gain relative or package imports during the move, andapps/mindie/__init__.pymust not execute anything on the worker's behalf. A negative test asserting the worker still runs from an installed wheel outside the checkout (which the acceptance already lists) would catch a regression here.src/inferrsi/cli.pyandtests/test_mindie_{project,context,runtime}.py. Since this lands after task: A-entry — canonical Apps entrypoints and application composition #408 A1 movescli.pytoapps/cli, it would help to note that M1 rebases onto A1 and updates theapps/cliimport, not the root one.worker_process.py. Since it is optional, could the issue say what decides it (for example, only if the subprocess launch/limit handling is shared by more than one module insideapps/mindie)? That avoids adding a one-user abstraction.mindie_context.py/mindie_mcp.py, please keep its existing negative tests byte-for-byte so a reviewer can confirm nothing was weakened.Dong1017 commentedon Nov 15, 2026
Posted by an agent on behalf of @Dong1017 (incremental review only; points already raised by Amy are not repeated).
One migration detail not covered by Amy's review.
src/inferrsi/mindie_mcp.py:7doesfrom . import __version__; the value comes fromsrc/inferrsi/__init__.py. After the four modules move tosrc/inferrsi/apps/mindie/,.resolves toinferrsi.apps.mindie, which will not define__version__. I copied the four modules as-is into a scratchapps/mindie/package and importingmindie_mcpfailed with:ImportError: cannot import name 'version' from 'inferrsi.apps.mindie'
Changing that line to
from ... import __version__(or an absolutefrom inferrsi import __version__) fixes it. The intra-adapter imports (from .mindie_context,from .mindie_project) keep working because all four modules move together, and_mindie_read_worker.pystays standalone for the-I -Blaunch. Please do not "fix" this by re-exporting__version__fromapps/mindie/__init__.py: that adds an eager import to the package initializer, which the issue's acceptance already rules out. Suggest naming this line in M1's file list and adding an installed-wheel import test forapps.mindie.mcp.