Skip to content
Open
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
10 changes: 9 additions & 1 deletion docs/apps-module-migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@
"src/inferrsi/apps/cli/__init__.py",
"src/inferrsi/apps/views/capture_delivery.py",
"src/inferrsi/apps/views/optimization_story.py",
"src/inferrsi/apps/workflows/session_knowledge.py",
"tests/apps/test_codex_knowledge_search.py",
"tests/apps/test_codex_search_delivery.py",
"tests/benchmark/test_benchmark_compare.py",
"tests/knowledge/test_knowledge_cli.py",
"tests/repository/check_installed.py",
"tests/fixtures/dashboard_profile_review.py",
"tests/fixtures/knowledge_retrieval.py",
Expand Down Expand Up @@ -472,6 +477,7 @@
"src/inferrsi/apps/integrations/mindie/mcp.py",
"src/inferrsi/apps/integrations/mindie/navigation.py",
"src/inferrsi/apps/integrations/mindie/project.py",
"src/inferrsi/apps/views/codex_knowledge.py",
"tests/repository/check_installed.py",
"tests/apps/test_apps_module_migrations.py",
"tests/apps/test_mindie_context.py",
Expand Down Expand Up @@ -546,9 +552,11 @@
"consumers": [
"docs/guides/operations.md",
"src/inferrsi/apps/cli/__init__.py",
"src/inferrsi/apps/workflows/session_knowledge.py",
"tests/apps/test_apps_context_provider.py",
"tests/apps/test_apps_knowledge.py",
"tests/harness/test_harness_generation_seal.py"
"tests/harness/test_harness_generation_seal.py",
"tools/evaluate_indexer.py"
],
"status": "retired",
"first_removal_version": "0.3.4"
Expand Down
19 changes: 12 additions & 7 deletions docs/benchmarks/benchmark-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,18 @@ Report generation verifies the campaign again to detect changes after collection

Tasks can require delivery of a package knowledge card in the on arm. The
task manifest's `knowledge_delivery` declares a `query`, `scenario`, and
package `ref`. Preparing the comparison freezes those fields along with the
card revision, body hash, and context byte budget. The on dispatch prompt
provides the corresponding `session knowledge` command. Collection checks for
the actual assembled text and card body at that budget in the verified inputs
to the first search round. Collection retains the evidence for a missing body,
late capture, or budget mismatch and excludes the affected pair. The delivery
requirement applies to plans that declare it.
package `ref`. Its optional `context_bytes` sets the experiment allowance
(default 65,536 bytes). Preparation freezes those fields, the card revision,
and its body hash. The on dispatch prompt supplies the query and scenario to
`find` in the trial session. Follow the required
card's returned `read` command before submitting the first candidate. The report
verifies the revision and body against that round's retained inputs. It sums the
UTF-8 resource bytes delivered through each matching search, including repeated
reads and attachments. An over-budget read stays visible as delivered. The pair
is excluded if the card was missing, arrived late, or the actual delivery
exceeded the plan’s allowance. A later retry cannot qualify it. Historical
plans and receipts retain their original requested-budget checks.
Plans without a required card keep their original comparison rules.

Each round can supply `--strategy <description>` and repeated
`--knowledge-ref <delivered-context-path>` in addition to `--hypothesis`.
Expand Down
3 changes: 1 addition & 2 deletions docs/benchmarks/moe-forward-benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ inferrsi benchmarks session round --session ./outputs/moe-session \
inferrsi benchmarks session final --session ./outputs/moe-session
```

知识库开启时使用 `benchmarks session knowledge` 检索并留存实际交付内容;关闭时拒绝
受管检索。外部来源和直接文件读取的隔离由对照实验的执行环境与 Agent 访问约定负责。
知识库开启时,用 `find "<问题>" --session <目录>` 留存命中,执行选中命中返回的 `read` 后留存正文。关闭知识时,受管检索和读取均受冻结条件约束。外部来源和直接文件读取的隔离由对照实验的执行环境与 Agent 访问约定负责。
Profiling 由 Agent 按瓶颈选择,不是每轮必经步骤。

Harness 留存每轮源码、假设、实际评测、历史最佳选择和独立 final。迭代 assessor 核对
Expand Down
22 changes: 11 additions & 11 deletions docs/benchmarks/optimization-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ default; `--final-reserve-seconds` changes that explicit reservation. Use
Use profile data or existing measurements for the same workload and environment.
Record the bottleneck and a UTF-8 summary of its measured evidence before
the first candidate round. When the condition allows knowledge retrieval, use
it after diagnosis for a specific implementation question. The session retains
the exact delivered context with its hash.
search after diagnosis for a specific implementation question. Run a selected
hit's scoped read command to receive the body and its delivery reference.

```bash
inferrsi benchmarks session diagnose --session ./outputs/qwen-rsi \
--bottleneck '<measured-bottleneck>' --evidence ./measurement-summary.txt
inferrsi benchmarks session knowledge --session ./outputs/qwen-rsi \
--query 'Ascend denoising conditioning reuse normalization fusion' \
--context-bytes 16384
inferrsi find 'Ascend denoising conditioning reuse normalization fusion' --session ./outputs/qwen-rsi
# Execute the returned read command for the chosen hit.
```

Read the returned content. Make one justified candidate change. Knowledge
selection method and the external Agent configuration are caller-controlled
variables. A retained delivery establishes what was supplied. Model consumption
and access to material outside this session require their own observation.
The search records the hits. Each scoped read records the body it returns.
Use the read receipt when material informs a candidate change. A benchmark
comparison can require a named card in round one. Follow its supplied Find
request and read that hit before submitting the first candidate. The plan
sets the experiment allowance. The report checks the bytes the round received.

### Include CANNBot in the round

Expand All @@ -99,8 +99,8 @@ CANNBot and still delivers local knowledge. Start a new benchmark session from
the approved Git project if your session has no binding. Use the original
frozen InferRSI release to resume sessions created with an earlier runtime.

`knowledge` queries both sources for the next round. It returns the local
context and a separate `external` result, with its own ranking, channel state
`find QUERY --session DIR` queries both sources for the next round. It returns
local hits and a separate `external` result, with its own ranking, channel state
and `reference.path`. A CANNBot timeout still returns the local result. The
external request and worker cleanup use the remaining search budget before the
final reserve. Use task keywords and keep private details out.
Expand Down
79 changes: 48 additions & 31 deletions docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,28 +230,34 @@ inferrsi campaign import-search --directory "$campaign" --round 1 \

For round 2 take a new first/last pair, even in the same session. Windows are
one-based and inclusive. If the host buffers events, import after they have
flushed. After an interruption the host can do the same handoff. Use
`--context-id <id>` once per `campaign capture-context` performed in this round.
These inputs can be combined with the rollout or used alone for an Indexer-only
round. Each capture is verified and its returned refs, revisions, request and
resource paths are recorded. Opening a resource and receiving a prepared context
are distinct observations. For a new Collect retrieval that must be retained, use
`campaign capture-context` with the same query or exact IDs.
flushed. After an interruption the host can do the same handoff. For scoped
Find and read receipts with a `sha256`, add
`--context-id <find-id> --context-id <read-id>` to the import.
Take each ID from the respective `reference.path` (`knowledge/<id>.json`).
A manual campaign creates each search receipt with `find QUERY --session DIR`. Follow the hit's scoped
`read` to retain the selected body. For an inventory or assembly of already
known IDs, use `campaign capture-context`. Captures can be imported with a
rollout or on their own. Each verified capture supplies the recorded request,
returned refs, revisions and resource paths. A tool return with the body
establishes visibility. A later decision citation identifies declared use.

The importer reads Desktop `CommandExecution` events. Run `find` and `read` in
separate simple tool calls and retain both call/return pairs in the selected
separate simple tool calls, apart from line counting, pipes and redirections.
Retain both call/return pairs in the selected
window. It accepts Find's default text and `--json` output. Find records result
references in returned order, including separately qualified external hits.
When an installed Skill links to its package projection, `read_ref` gives the
identity in the open command. Read records the resolved reference and
returned revision. Only `read --material` or `read --resource` can verify a
returned body. A metadata-only read records a visible reference.
returned revision. For a standalone read, `--material` or `--resource`
returns a body. In a session, the emitted `read_args` include `--search-ref`
and bind the read to the hit in the saved search. A metadata-only read records
a visible reference.

The importer verifies direct CLI delivery against the agent-facing tool
response. Missing, clipped or uncorrelated outputs leave coverage partial
even with `--complete`. Compatibility queries through `collect`, `knowledge
search`, `knowledge research` and `context` require separate capture evidence
for their results. The importer marks these standalone calls unresolved.
even with `--complete`. Historical traces may contain `collect`, `knowledge search`, `knowledge research`
or `context` text queries. Their results require the original capture evidence.
A standalone legacy call without that evidence remains unresolved.
Remote tools and external card reads also require their own evidence.

For file searches the importer supports text and filename matches with `rg`
Expand Down Expand Up @@ -375,9 +381,12 @@ retrievals require separate evidence. Review query text and paths before sharing

If a delivered passage changes a candidate or validation choice, explain that
choice in the round's existing reason and append `[use REF | EXACT SOURCE EXCERPT]`.
Use the qualified reference from `read` or the reference in the delivered
context. Pick a short verbatim excerpt on one source line that identifies the
passage. A round whose choice did not depend on a passage needs no citation.
Use the material `ref` from `read` or the reference in the delivered context.
The read's `reference.path` is the receipt for `round --knowledge-ref`.
Pick a short verbatim excerpt on one source line that identifies the
passage. If a compact record includes a URL or private path on that same line,
the archive can retain just the cited excerpt when it survives redaction.
A round whose choice did not depend on a passage needs no citation.

For managed project and benchmark rounds, use the existing `--hypothesis`.
A local mask-memory experiment submitted this hypothesis.
Expand All @@ -388,11 +397,23 @@ At round close, after the completed round response is in the rollout, run
the existing `campaign import-search` over that round. Use the start boundary
captured before retrieval and the end of the flushed rollout. A review file
with `task`, `corpus` and `"decisions": []` is enough for automatic alignment.
Include `--context-id` for AB/BA or benchmark captures used in the round.
Include a `--context-id` for each standard Find and read capture returned in the round.
The importer locates matching managed JSON returns within the window for those
captures. It locates the submitted hypothesis from the round call and verifies
the round receipt. The return containing the source passage must precede the
round call. Service-reuse sessions retain knowledge in their own records.
round call. If the round ran asynchronously and its final output was clipped,
read its short receipt after completion and include that call and its return
in the same window:

```sh
inferrsi campaign status --session "$campaign" --round-receipt 1
```

For a benchmark use `benchmarks session status` with the same options. The
receipt identifies the original submitted observation by its path and digest.
The original round call still determines when the decision was made. A receipt read
after a historical window supplies no evidence inside that window.
Service-reuse sessions retain knowledge in their own records.
See [service reuse](guides/service-reuse-campaigns.md#records-compatibility-and-validation).

For a manual campaign, put the citation in the existing log's round
Expand Down Expand Up @@ -672,23 +693,19 @@ to understand the whole optimization: what knowledge was retrieved and why, the
declared search space and how it was narrowed, each round's hypothesis and
reason, the decision, and the success and failure summaries. It has two parts.

**1. Capture the knowledge context while working.** Run the same retrieval the
agent uses through `campaign capture-context`. It calls `collect` to rank the
question with Find and assemble resources within a context budget. The capture
keeps the request, the selected items,
everything left out and why, and every resource body with its SHA-256. The
dashboard re-derives the assembled text from those resources and withholds a
capture whose bytes or hashes no longer match.
**1. Capture the knowledge context while working.** Run Find in the manual
campaign. Give the search a fresh ID, then run the scoped read returned for
the hit whose body you need.

```sh
inferrsi campaign capture-context --directory <CAMPAIGN_DIRECTORY> --id r1-diagnosis \
--relevance '<WHAT_THE_PROFILE_SHOWED>' --backend <BACKEND> --context-bytes 65536
inferrsi find '<WHAT_THE_PROFILE_SHOWED>' --session <CAMPAIGN_DIRECTORY>
```

Each call writes a new `knowledge/<id>.json` and prints its SHA-256; an
existing id is never overwritten. The capture records what InferRSI prepared,
not what a model read. Hash checks detect changes relative to the cited bytes
and internal inconsistencies; they do not authenticate who produced a capture.
The search record identifies the hits. The read records which revision and
resource were returned. Use `--knowledge-ref` when a managed round actually
uses a delivery. In a manual campaign, enter the read and its use in the
optimization log below. The dashboard verifies retained resources and assembled
text against their recorded hashes. A hash establishes byte consistency.
The campaign root and its `knowledge` directory must remain trusted and stable
while reading or writing. Captured text comes from the selected knowledge
sources; review it before sharing if a store or checkout source was added.
Expand Down
8 changes: 7 additions & 1 deletion docs/examples/dashboard-profile-review.html
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,13 @@ <h2 class="panel-heading" aria-labelledby="chart-title"></h2>
for(const entry of record.items){
const card=item(local,entry.title||entry.ref);
field(card,tr('Reference','引用'),entry.ref);
field(card,tr('Delivery','交付'),entry.delivered?tr('Context prepared','已装配上下文'):tr('Context omitted','未装配上下文'));
if(Array.isArray(entry.reads)){
if(!entry.reads.length)field(card,tr('Read receipts','读取凭据'),tr('No read recorded','暂无读取记录'));
for(const read of entry.reads){
field(card,read.omission?tr('Read omitted','读取未交付'):tr('Read resource','已读资源'),[read.resource,read.omission].filter(Boolean).join(' · '));
p(card,read.path,'rd-note');
}
}else field(card,tr('Delivery','交付'),entry.delivered?tr('Context prepared','已装配上下文'):tr('Context omitted','未装配上下文'));
}
const result=record.external;
if(!result)return;
Expand Down
26 changes: 14 additions & 12 deletions docs/guides/knowledge/external-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ This is the **default and intended state**, not a missing installation step.

```bash
$ inferrsi find "CeilDivision 向上取整"
no_match 135 entries searched; rephrase, or search the corpus directly with rg
local_no_match 135 entries searched; try another query or scope

external (not locally verified; scores are not comparable across channels)
cannbot-knowledge [not_enabled] cannbot knowledge is not enabled for this project
fix: inferrsi cannbot enable --checkout <path> --python <interpreter>
```

`no_match` there is honest: the packaged corpus really holds nothing for that
query. The `not_enabled` line says an external source exists, was not approved
for this checkout, and how to approve it. Without that line a caller would
conclude the knowledge does not exist anywhere, which would be wrong.
`local_no_match` describes the packaged corpus. Each external source reports
its own status. In JSON, an external hit makes `no_match` false even when
`items` is empty. If an attempted source did not answer and no other source
found a hit, `no_match` is null. `matched` counts local matches.

On `main` `6c7e2379`, the packaged corpus holds **6 Ascend content cards and 0
per-API cards**. The external cannbot-knowledge corpus holds **10,550 cards,
Expand All @@ -36,8 +36,9 @@ terms for your intended use before enabling it. Keeping the content outside the
package does not establish permission to use, transmit or redistribute it;
that organisational decision remains open in #476 Q1.

Nothing from an external checkout is ever copied into `src/inferrsi/knowledge/data/`,
a wheel, or `evidence/`.
An external lookup does not add upstream content to the packaged corpus.
Managed CANNBot receipts retain metadata. For MindIE, a caller can explicitly
archive native query and explain returns with `campaign import-mindie`.

## Setting one up

Expand Down Expand Up @@ -115,7 +116,7 @@ Or declare it per call:

```bash
inferrsi find "AscendC tiling 参数怎么算" --backend ascend --platform a2
inferrsi cannbot search "CeilDivision 向上取整" --platform a2 --limit 100
inferrsi find "CeilDivision 向上取整" --backend ascend --platform a2 --external-limit 100
inferrsi cannbot read ops/ascendc/apis/utils_api/cpp_stdlib/math_functions/ceil_division
```

Expand Down Expand Up @@ -231,10 +232,11 @@ conclusion.

| Capability | State |
| --- | --- |
| `cannbot enable / disable / describe / search / read` | implemented |
| `find` integration with gating, budgets, per-channel states | implemented |
| Managed CANNBot benchmark and AB/BA round query, read and Dashboard attribution | implemented |
| MindIE native navigation | Project default or per-call selection in [standalone Find](../plugins/codex-plugin.md#find-navigation) under an approved Ascend project. Returns versioned references and condition exclusion counts. |
| CANNBot project grant | `cannbot enable`, `cannbot describe`, `cannbot disable` |
| CANNBot navigation and pinned card reads | `find QUERY --backend ascend` queries the approved source. Use the hit's `cannbot read` command for a pinned page. |
| Managed CANNBot benchmark and AB/BA retrieval | `find QUERY --session DIR` follows the frozen source rule. The external hit's `knowledge-read` command returns the page and a receipt for round attribution. |
| MindIE project grant and navigation | `mindie enable`, `mindie describe`, `mindie disable`. Standalone `find` uses an opted-in project default or `--backend ascend --external-source mindie-agent`. It returns versioned refs and condition exclusion counts. Use `find --input FILE` for native requests. [Find navigation](../plugins/codex-plugin.md#find-navigation) |
| MindIE card reads and evidence | `mindie explain` reads selected units. `campaign import-mindie` retains the supplied query and explain returns. [MindIE workflow](../plugins/codex-plugin.md#mindie-knowledge) |
| `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
Loading
Loading