Skip to content

refactor(apps): move the MindIE adapter into Apps and retire four root files (M1) - #477

Merged
Dong1017 merged 2 commits into
mainfrom
impl/m1-mindie
Nov 17, 2026
Merged

Dong1017 merged 2 commits into
mainfrom
impl/m1-mindie

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Refs #452

M1 only, following merged C1/C2/R1/A1/A2. This is one slice of the open Apps/architecture issues; R2 and R3 are not implemented.

  • Move root mindie_project.py, mindie_context.py and mindie_mcp.py to apps/mindie/project.py, context.py and mcp.py, and root _mindie_read_worker.py to apps/mindie/read_worker.py. The worker's bytes are unchanged. The other three change only the imports that name their neighbours, the package version import in mcp.py (from ... import __version__), the worker file name in project.py (_WORKER) and one docstring line in context.py that said it stayed outside Apps.
  • Update the CLI (apps/cli), the tests, the installed-wheel checker tests/check_installed.py, the gate and the docs. Delete all four root files with no forwarding shell, sys.modules alias or import fallback. apps/mindie/__init__.py has a docstring and no imports; a test checks that by AST.
  • RETIRED_BY_M1 adds the four names, bringing the retired root modules to nineteen. The root-inventory test now asserts the exact final root: the tracked package root holds exactly __init__.py and __main__.py. No scan, assertion or allowlist was widened.
  • The installed checker now also runs two isolated (-I -B) subprocess probes against the installed wheel: the MindIE entry point and the read worker, and checks that the four old names no longer resolve.
  • No evaluator, factual-record or OBS change. This PR does not claim isolation: the 12 Harness hits into Infra (R2) and the five runtime resource loaders (R3) remain, so first_wave_report() still has blockers.

Provenance

Based on main bebd4914d15e272b0c09a5b784a82f955f51a5e0 (A2, #474). Two commits (the second answers review), no merge, no rebase, no amend, no force push, no skipped hooks.

The code, tests and docs were written in a Claude Code session reported as claude-opus-5-5, effort xhigh, confirmed by the owner. This is client/session attribution, not a backend attestation. The changed paths are outside the knowledge-model-policy protected scope, so the declaration below is disclosure only. Manifest and precision-guard changes still need formal architecture review; passing tests is not that approval.

Evidence

Heavy runs were on the owned CPU-only H200 (Linux, single process, no GPU); the local laptop ran only the small groups below. Candidate and baseline trees were extracted from tarballs and every file was verified by SHA256 against a manifest before the run.

  • Real MCP behaviour, before and after the move. serve, describe and the disable path were run against both trees: exit codes, stdout and stderr bytes are identical.
  • Ruff 0.17.5 on the changed Python files passes.
  • Seven directly affected test files, 151 passed and 305 subtests (local): test_package_root_inventory, test_target_module_import_gate, test_first_wave_isolation_policy, test_campaign_record_injection, test_mindie_runtime, test_mindie_project and test_mindie_context.
  • Installed-wheel probes were self-checked against the source tree with -I -B; the real wheel build and install run in this PR's installed-package job. Since 5d2e950, a third probe calls the installed adapter's _worker() from a temporary cwd with a synthetic grant whose engine file is missing. It goes through the real _WORKER lookup and the python -I -B <worker> entry and asserts the worker's fixed structured rejection. Pointing _WORKER at a missing file makes the probe fail.
  • Full suite on H200, candidate vs unchanged main bebd491, same environment and flags (-o addopts= -q -rfEs, CUDA_VISIBLE_DEVICES= empty):
Candidate (M1) Baseline (main bebd491)
Result 404 failed, 4,317 passed, 168 skipped, 636 subtests 404 failed, 4,313 passed, 168 skipped, 616 subtests
Failed test ids 397 397

The two lists of 397 failed ids are identical: zero ids fail only on the candidate and zero only on the baseline. The junit case lists differ only in test_package_root_inventory: the candidate adds four test_an_added_root_file_is_rejected cases, one per retired MindIE name, and renames the inventory test to test_inventory_is_the_exact_final_two_file_root. main has since moved to 1acfacf (#323), which changes only infra/platforms/mlx.py and tests/test_mlx_discovery.py and touches no M1 file. The H200 failures overall (git 2.34.1, no bwrap, other users' processes) are why this run is not full-suite proof. The authoritative Linux full-suite result is this PR's full-check 3.10 and 3.11 jobs, and the host-compatibility job covers hosted Windows and macOS.

Not claimed

  • The real mindie-knowledge package is not installed on any test host. The worker read path is covered only by the offline stub in tests/test_mindie_runtime.py, so a live MindIE knowledge read was not exercised before or after the move.
  • No local full-suite pass, no Windows or macOS run before CI, and no architecture approval.
{"schema_version":1,"head_sha":"5d2e9508ab1a7823f9c236e257bd897596f3f8cf","human_only":false,"material_ai_authors":[{"tool":"Claude Code","model_id":"claude-opus-5-5","effort":"xhigh","role":"author"}]}

…t files (M1)

Move root mindie_project.py, mindie_context.py and mindie_mcp.py to
apps/mindie/{project,context,mcp}.py and _mindie_read_worker.py to
apps/mindie/read_worker.py. Apart from the imports that name their
neighbours and the package version in mcp.py, the code is unchanged.

Update the CLI, tests, the installed-wheel checker, the gate and the docs, and
delete all four root files with no forwarding shell, sys.modules alias or
import fallback. apps/mindie/__init__.py imports nothing.

The tracked package root now holds exactly __init__.py and __main__.py.

Refs #452

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
@Dong1017 Dong1017 added the kind:task Bounded delivery task with a delegated slice label Nov 17, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — DO NOT PASS (verification still pending; no demonstrated code defect)

Independent first review under the owner's standing InferRSI review delegation, acting as zengchuang-hw. Reviewed head fe34b75; current target main is 1acfacf. Change range is bebd491 → fe34b75 (18 changed files). No prior review by this account.

Checked the accepted M1 requirements in #452 through scope-only triage, repository AGENTS/contribution/review guidance, and actual source/tests independently, without reading other reviewers' findings. The four moved implementation files match the prior versions after only the declared import/path/docstring substitutions; read_worker.py is byte-identical. CLI consumers use the Apps paths; the package initializer stays import-free; MCP resolves the root version; the standalone worker retains -I -B, its private cwd, timeout/response-size handling and read-only SQLite path. Root-retirement guards, documentation and installed-wheel probes cover the renamed paths. No new behavior defect found within this relocation scope.

Actually executed in an isolated checkout:

  • Seven focused test files: 151 passed, 305 subtests passed (MindIE context/project/runtime, root inventory, target-module/import gate, first-wave isolation, campaign injection).
  • Ruff across src/tests/tools: passed.
  • git diff --check for the change range: passed.
  • Compared all four moved modules against prior source and checked active source/plugin/tool consumers for retired imports.

Current-head remote evidence: installed-package on Python 3.10/3.11, Windows/macOS host compatibility, dashboard browser, lint/smoke, declarations and PR references have succeeded. The two full-check jobs (3.10/3.11) are still in progress as last checked.

Before approval: confirm both full-check jobs complete successfully for this exact head and reassess any failures. My independent local wheel build was not completed: the available test environment lacked the build backend; an isolated build-environment dependency fetch encountered proxy timeouts. Remote installed-wheel success is explicitly remote CI evidence, not a locally rerun claim. No real MindIE service/catalog or GPU campaign was exercised; the runtime tests use fixtures, and broader #374 qualification is outside this relocation.

Resolved prior findings: not applicable (first review).
Non-blocking suggestions: none.
This COMMENT records the required review while evidence remains pending; it does not request speculative code changes, approve integration, merge, or close #452.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One gap in the installed-wheel verification.

Comment thread tests/check_installed.py
"assert all(not (isinstance(node, ast.ImportFrom) and node.level) for node in top)\n"
"assert all((node.module if isinstance(node, ast.ImportFrom) else node.names[0].name)\n"
" .split('.')[0] in sys.stdlib_module_names for node in top)\n"
"namespace = runpy.run_path(path, run_name='not_main')\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probes the wheel resource via runpy(..., run_name='not_main'), so it does not exercise the installed adapter’s _WORKER lookup or the real python -I -B <worker> entry point. Could we also run the installed launch path from a temporary cwd with deliberately unavailable synthetic input and assert the structured rejection? That would cover #452’s installed-worker negative case without requiring a live MindIE dependency.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added in 5d2e95083e (current head). tests/check_installed.py now runs a third isolated probe against the installed wheel: from a temporary cwd it calls the installed adapter's project._worker() with a synthetic grant (current interpreter, a missing engine file, domain probe). That goes through the real _WORKER lookup (asserted to be apps/mindie/read_worker.py inside the installed package) and the real python -I -B <worker> launch. It asserts ReadFailure with the worker's fixed message The local MindIE catalog is unavailable, exit code 1 and the exact JSON response {"isError": true, "error": ...}. No live MindIE dependency is needed.

Self-check on the source tree: the probe passes, and pointing _WORKER at a missing file makes it fail. The installed-wheel result is this head's installed-package jobs, still running. This push voids the existing approval at fe34b75.

zengchuang-hw
zengchuang-hw previously approved these changes Nov 17, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS

Independent review by the delegated assistant acting as zengchuang-hw, under the owner's direct authorization to review and approve this PR if its requirements are met; no merge authorization is exercised. Reviewed target main/base 1acfacf and head fe34b75. Scope: #452 M1 only. I did not consult other reviewers' findings.

I independently inspected the actual 18-file change, governing M1 requirements, affected callers, repository review guidance and test implementation. The four relocated implementation files are exact matches to bebd491 after only the import/path/docstring substitutions; read_worker.py is byte-identical. The CLI targets the Apps adapter, MCP reads the package version correctly, and the initializer remains import-free. No compatibility alias or MindIE-specific core module was added. Grant opt-in, raw-byte/receipt handling, strict-parser behavior, OBS format, isolated worker/private cwd, timeout/size handling and read-only SQLite implementation remain unchanged. Retirement guards now enforce the final two-file tracked root and nineteen retired module names without widening scan exceptions.

Verification in this review:

  • Reran the seven directly affected test files: 151 passed, 305 subtests passed.
  • Ruff across src/tests/tools and change-range git diff --check: passed.
  • Reran tests/check_installed.py with -I -B from outside the checkout against the separately installed wheel: passed, including MCP/version and standalone-worker isolation probes. Inspected the successful local wheel build/install records; those steps were reused rather than rerun in this pass.
  • Independently confirmed current-head ready CI success: full-check and installed-package on Python 3.10/3.11, Windows/macOS host compatibility, dashboard-browser and PR references. Current-head knowledge-model-policy status is also successful.
  • The current main delta from the PR parent only changes MLX discovery and its tests, not this migration or its checking definitions.

This supersedes this account's earlier interim COMMENT: the pending full-check jobs have now succeeded, and installed-wheel validation is complete. No blocking finding remains for this bounded relocation.

Limits: no live mindie-knowledge service/catalog or GPU campaign was exercised. Runtime behavior checks use the offline library fixture; installed probes establish package/worker loading, not live knowledge-read qualification. R2/R3 isolation work and broader #374 qualification remain outside this approval. This does not merge the PR or close its governing issue.

…er (M1)

The installed-wheel checker now also calls the installed adapter's _worker()
from a temporary cwd with a synthetic grant whose engine file does not exist.
That uses the real _WORKER lookup and the python -I -B <worker> entry point,
and asserts the worker's fixed structured rejection, without a live MindIE
dependency.

Refs #452

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — DO NOT PASS yet (current-head CI still pending; no demonstrated code defect)

Independent incremental review under the owner's standing review delegation, acting as zengchuang-hw, without consulting other reviewers' findings. Previous review: #477 (review) (APPROVE on fe34b75, now dismissed after the push). Reviewed delta: fe34b75 → 5d2e950; current main/base remains 1acfacf.

The actual delta changes only tests/check_installed.py and CHANGELOG.md. The additional probe imports the installed adapter in an isolated subprocess, verifies its actual _WORKER path, invokes _worker with a synthetic missing-engine grant, and asserts the structured worker rejection and exit code. This exercises the real file-path entry point rather than only runpy loading. Production source, package/build definitions, existing tests and CI definitions are unchanged; no new blocking defect found.

Actually executed in this pass: the exact new-head installed checker under -I -B outside the checkout against the previously installed fe34b75 wheel passed, including the new launch probe. This reuse is justified by the unchanged production/package contents; it is not a claim that I rebuilt the new-head wheel locally. Ruff on the exact changed checker using repository configuration also passed. Prior focused tests (151 passed, 305 subtests) and source review remain applicable to unchanged implementation; I did not rerun that selection or the full suite in this pass.

Current-head remote evidence: installed-package (3.10/3.11), PR references and knowledge-model-policy have succeeded. Full-check (3.10/3.11), Windows/macOS host compatibility and dashboard-browser are not all complete as last checked. Before renewed approval, confirm those current-head checks finish successfully and assess any failures. This is interim non-voting feedback, not a request for speculative source changes.

No live MindIE service/catalog or GPU campaign was exercised. The new negative probe is not successful real-catalog-read qualification. No merge or issue closure performed.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS

Independent re-review by the delegated assistant acting as zengchuang-hw under the owner's standing authorization to review and approve when requirements are met. Reviewed current main/base 1acfacf and head 5d2e950. No other reviewers' findings were consulted, and no merge is performed.

This completes my incremental review recorded at #477 (review) and supersedes its pending-CI conclusion. The earlier source review/approval at #477 (review) covered fe34b75. The reviewed delta fe34b75 → 5d2e950 changes only tests/check_installed.py and CHANGELOG.md: it adds an isolated installed-adapter call through the real _WORKER lookup/file entry point and verifies the worker's structured rejection for an unavailable catalog. Production code, packaging and workflow definitions are unchanged. No blocking defect found in this delta or the bounded #452 M1 relocation.

Evidence:

  • In the preceding incremental pass, the exact new-head checker passed under -I -B outside the checkout against the previously installed fe34b75 wheel, including the added negative launch probe. Reuse is applicable because the implementation and packaging contents are unchanged; this is not a new-head local rebuild claim. Repository-configured Ruff on the changed checker passed.
  • The earlier seven focused test files passed: 151 tests and 305 subtests. The mechanical relocation/source checks, read-worker byte equality and root-retirement/isolation assessment remain applicable to the unchanged implementation.
  • I have now independently verified that current-head ready workflow 44021953523 completed successfully, including full-check and installed-package on Python 3.10/3.11, Windows and macOS host compatibility, dashboard-browser and PR references. The current-head knowledge-model-policy status is also successful. These results close the remaining CI gap in my interim review.
  • Immediately before submission, confirmed that this PR remains open on the reviewed head/base and this account has no existing approval for the new head.

No additional local test or wheel build was rerun during this CI-completion check. No live MindIE service/catalog or GPU campaign was exercised. Runtime fixtures and the installed negative probe do not establish successful live catalog reads or broader #374 qualification. R2/R3 isolation work remains outside this M1 approval. No issue closure or merge is implied.

@Dong1017
Dong1017 enabled auto-merge (squash) November 17, 2026 06:21

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS
Reviewed base 1acfacf8d49a13edf8d1fbdfde224c11ddbee8bf and head 5d2e9508ab1a7823f9c236e257bd897596f3f8cf.

Independent steward review (cursor[bot]) of #452 M1 while hosted Dong-bot is on usage_limit. Verified four MindIE roots relocated to apps/mindie/* with no forwarding aliases; RETIRED_BY_M1 / exact two-file root inventory; CLI/gate/docs updates; david's installed _WORKER negative launch probe on head 5d2e950; Ready full-check/installed-package/host-compat green. Local focused suite 151 passed / 305 subtests; installed-wheel check exit 0. No R2/R3 isolation claim. Optional: stale "exact ten files" comment in tests/check_installed.py (~L623).

@Dong1017
Dong1017 merged commit 1bbc3b0 into main Nov 17, 2026
12 checks passed
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by an authorized steward agent on behalf of @Dong1017 (hosted Dong-bot on usage_limit).

Steward review + merge: independent cursor[bot] Approve on 5d2e9508ab1a with @zengchuang-hw LGTM → dual Approve, mergeable_state=clean. Squash-merged to main as 1bbc3b0c8de14d6194d7ee7987607365b665fbfe. Refs #452 M1 only; R2/R3 remain open.

@Dong1017
Dong1017 deleted the impl/m1-mindie branch November 17, 2026 06:33
Dong1017 added a commit that referenced this pull request Nov 17, 2026
Resolve the CHANGELOG conflict by keeping both the M1 and the R2 entries.
No other conflict; the four root MindIE modules stay retired.

Refs #412

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — DO NOT PASS (incomplete full acceptance evidence; scoped independent review, no newly demonstrated migration defect).

This explicitly answers historical human request #477 (comment) (created/updated 2026-11-17T06:31:36Z). Current reviewed head: 5d2e950; current base: 1acfacf. The actual PR branch diff uses merge-base bebd491 (18 changed files). A direct base/head comparison includes unrelated MLX changes on the base side; those are not attributed to this PR. The PR remains closed.

My earlier reviews 5932411803, 5932460625 (dismissed), 5933250759 and 5933542717 do not explicitly associate themselves with this later request. Neither the existing approval nor same-head publication is used as proof that the request was answered.

Independent checks of the M1-only migration:

  • Compared executable ASTs of the four old modules against their new owners. Context and read_worker are executable-AST identical. Project changes only its relative owner imports and worker sibling filename; MCP changes owner imports and obtains the version from the package root. CLI dispatch/import-context now bind these canonical owners.
  • The exact Git tree has only init.py and main.py as root Python files. All four old MindIE modules are absent. Static absolute and resolved relative imports in src contain no references to the retired root modules.
  • Inspected the new installed-checker assertions for narrow adapter imports, MCP version, packaged worker presence and failure-path launch. An isolated source-file read_worker load using Python -I -B from outside the export succeeded without importing inferrsi or mindie_knowledge. That is a source-worker check, not an installed-wheel result.

Actually executed against an isolated exact-head export:

  • Seven focused modules: mindie_context, mindie_project, mindie_runtime, package_root_inventory, target_module_import_gate, first_wave_isolation_policy, campaign_record_injection: 150 passed, 1 skipped, 305 subtests passed. The skipped tracked-root inventory test requires Git metadata; actual tracked inventory was separately checked.
  • Ruff on apps/mindie, apps/cli and check_installed.py passed; merge-base-to-head git diff --check passed.
  • Attempted a no-isolation wheel build with the existing local build environment and synthetic version override. It failed during get_requires_for_build_wheel/egg_info: "Can't parse version from tag '0.0'". No wheel was produced or installed. This archive/build-environment limitation is not presented as a proven PR regression.
  • Exact-head check-run metadata has 12 successful entries. I did not read third-party review narratives or CI logs, or verify required-check configuration.

The complete original Issue452 acceptance contract was not recovered in the isolated requirement handoff. Full-suite, installed-outside-checkout MindIE entry/worker verification, and full documentation/provenance review remain uncompleted here. Therefore this does not certify original-AC completion or full architectural isolation. No MindIE model/service/device experiment, policy/security relaxation, code change, reopening or merge was performed. The existing review states are left untouched; this is a new head-bound COMMENT with the actual verification boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants