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
3 changes: 3 additions & 0 deletions docs/apps-module-migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@
"tests/check_installed.py",
"tests/test_apps_module_migrations.py",
"tests/test_cannbot_boundaries.py",
"tests/test_mindie_runtime.py",
"tests/test_optimization_session.py",
"tests/test_project_optimization.py"
]
Expand Down Expand Up @@ -438,6 +439,7 @@
"docs/module-layout.md",
"src/inferrsi/apps/cli/__init__.py",
"src/inferrsi/apps/integrations/mindie/mcp.py",
"src/inferrsi/apps/integrations/mindie/navigation.py",
"src/inferrsi/apps/integrations/mindie/project.py",
"tests/check_installed.py",
"tests/test_apps_module_migrations.py",
Expand All @@ -461,6 +463,7 @@
"docs/module-layout.md",
"src/inferrsi/apps/cli/__init__.py",
"src/inferrsi/apps/integrations/mindie/mcp.py",
"src/inferrsi/apps/integrations/mindie/navigation.py",
"tests/check_installed.py",
"tests/test_apps_module_migrations.py",
"tests/test_mindie_project.py",
Expand Down
16 changes: 16 additions & 0 deletions docs/codex-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@ New sessions in that checkout reuse the grant. Use `--adapter-config <path>`
when the MindIE adapter is installed outside its default location. Run
`inferrsi mindie disable` from the same checkout to revoke the grant.

### Find navigation

Select MindIE for one Find from the approved checkout.

```sh
inferrsi find "Ascend operator tiling" --backend ascend --external-source mindie-agent
```

Find keeps the local results and shows the approved domain's versioned MindIE
references in native order. It includes a reference only when the native card
reports `match_status="matched"`. It uses up to 8,000 native tokens and returns up
to five references by default. `--external-limit` can raise the cap to 20, and
`--external-timeout` covers both the availability check and the query.
The MindIE section contains navigation metadata only. The plain Find command
selects CANNBot when eligible. Use `--no-external` for local results alone.

### MCP configuration and queries

Add the following entry to the trusted checkout's `.codex/config.toml`.
Expand Down
18 changes: 10 additions & 8 deletions docs/external-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ it (1–200). These are returned hits, not the total number of upstream matches.
`--external-timeout` covers discovery and search together. Channels run
concurrently under that deadline. On timeout the caller cancels owned worker
processes and discards late results; subprocess teardown adds a short cleanup
interval. The cannbot adapter terminates its process group on POSIX; Windows
uses `taskkill /T /F` while the worker is alive. The new process-tree regression
runs on POSIX; Windows cleanup has not been qualified by that test. Generic
Python channel adapters must cooperate with the request deadline and register
owned resources; Python cannot forcibly stop arbitrary in-process threads.
interval. The CANNBot adapter terminates its process group on POSIX and uses
`taskkill /T /F` while the Windows worker is alive. Its process-tree regression
runs on POSIX. MindIE Find starts its Windows worker inside a Job Object, so
cleanup covers descendants after the launcher exits. Find reports `rejected` if
cleanup cannot confirm that the job is empty.
Generic Python channel adapters must cooperate with the request deadline and
register owned resources. Python cannot forcibly stop arbitrary in-process threads.

### The backend gate

Expand Down Expand Up @@ -223,14 +225,14 @@ Whether CANN OSL v2.0 permits even a local read-only copy is an open question fo
the organisation; see #476 Q1. This page documents the mechanism, not a legal
conclusion.

## What is not implemented
## Capability status

| Capability | State |
| --- | --- |
| `cannbot enable / disable / describe / search / read` | implemented |
| `find` integration with gating, budgets, per-channel states | implemented |
| Managed benchmark and AB/BA round query, read and Dashboard attribution | implemented |
| MindIE as a second channel | not yet; `apps/integrations/mindie/` has the reader, not the adapter |
| Managed CANNBot benchmark and AB/BA round query, read and Dashboard attribution | implemented |
| MindIE native navigation | Explicit opt-in for [standalone Find](codex-plugin.md#find-navigation) under an approved Ascend project. Returns navigation references. |
| `cannbot serve` (stdio MCP proxying `discover` / `search` / `read_card`) | not yet |
| `campaign import-cannbot` (receipts into evidence) | not yet |
| Automatic clone, index build or deployment | deliberately absent |
Expand Down
29 changes: 20 additions & 9 deletions src/inferrsi/apps/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ def _clip(value: str, limit: int = 160) -> str:
return text if len(text) <= limit else text[: limit - 1].rstrip() + "…"


def _channels():
def _channels(*, source: str | None = None):
from ..integrations.external_channels import external_channels

return external_channels()
return external_channels(source=source)


def _print_external(result: dict) -> None:
Expand All @@ -186,13 +186,17 @@ def _print_external(result: dict) -> None:
if entry.get("fix"):
print(f" fix: {_clip(entry['fix'], 120)}")
continue
revision = (entry.get("revision") or "")[:12] or "unpinned"
print(f" {entry['channel']} @ {revision}\t[{entry['score_scale']}]"
f"\t{entry.get('count', 0)} hit(s)\t{entry.get('elapsed_ms', 0)} ms")
heading = entry["channel"]
if entry.get("score_scale"):
revision = (entry.get("revision") or "")[:12] or "unpinned"
heading += f" @ {revision}\t[{entry['score_scale']}]"
print(f" {heading}\t{entry.get('count', 0)} hit(s)\t{entry.get('elapsed_ms', 0)} ms")
for item in entry.get("items", []):
print(f" {item['score']}\t{_clip(item['title'], 60)}\t{item['locator']}")
if entry.get("items"):
print(f" open: {entry['items'][0].get('open', '')}")
score = f"{item['score']}\t" if "score" in item else ""
print(f" {score}{_clip(item['title'], 60)}\t{item['locator']}")
first = next(iter(entry.get("items", [])), {})
if first.get("open"):
print(f" open: {first['open']}")
for note in result.get("external_notes", []):
print(f" note: {_clip(note, 140)}")

Expand Down Expand Up @@ -589,6 +593,13 @@ def main(argv: list[str] | None = None) -> int:
unknown = [k for k in kinds if k not in ("case", "skill", "record")]
if unknown or not kinds:
raise ValueError("--kinds takes a subset of case,skill,record")
if args.external_source and not args.no_external:
if args.backend != "ascend":
raise ValueError("--external-source mindie-agent requires --backend ascend")
if args.platform:
raise ValueError(
"--platform applies to CANNBot. MindIE uses the approved domain."
)
coordinate = None
if args.searchspace_coordinate is not None:
from ...knowledge.searchspace_index import load_searchspace_coordinate
Expand All @@ -602,7 +613,7 @@ def main(argv: list[str] | None = None) -> int:
searchspace_index=coordinate.index if coordinate is not None else None,
),
limit=args.limit, explain=args.explain,
registry=None if args.no_external else _channels(),
registry=None if args.no_external else _channels(source=args.external_source),
backend=args.backend, platform=args.platform,
external_limit=args.external_limit,
external_timeout=args.external_timeout,
Expand Down
4 changes: 4 additions & 0 deletions src/inferrsi/apps/cli/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ def parser(*, parser_class=argparse.ArgumentParser) -> argparse.ArgumentParser:
"for a declared backend and are never inferred from the query",
)
find.add_argument("--platform", help="Override the grant’s upstream platform, e.g. a2")
find.add_argument(
"--external-source", choices=("mindie-agent",),
help="Explicitly select MindIE navigation for this Find; requires --backend ascend",
)
find.add_argument(
"--no-external", action="store_true",
help="Skip every external channel; use in CI and offline runs",
Expand Down
17 changes: 13 additions & 4 deletions src/inferrsi/apps/integrations/external_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@


def external_channels(
*, root: Path | None = None, expected_checkout: dict | None = None,
*, root: Path | None = None, expected_checkout: dict | None = None, source: str | None = None,
) -> ChannelRegistry:
if source is not None:
from .mindie.navigation import MindieNavigationChannel

if source != MindieNavigationChannel.name:
raise ValueError("Unknown explicit external knowledge source")
return ChannelRegistry([
MindieNavigationChannel(root=root, expected_checkout=expected_checkout),
])

channels = [
source(root=root, expected_checkout=expected_checkout) if expected_checkout is not None
else source(root=root)
for source in _SOURCES
channel_type(root=root, expected_checkout=expected_checkout)
if expected_checkout is not None else channel_type(root=root)
for channel_type in _SOURCES
]
# A project grant can declare the task backend when Find has no explicit
# --backend. Conflicting grant defaults leave it undeclared.
Expand Down
Loading
Loading