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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@
`harness.execution_spec` and `harness.errors` paths have been removed. Existing
store roots retain their namespace, object references and exact record versions.

- Import `LocalCpuTarget` from `inferrsi.harness.executor`. Its former
`inferrsi.harness.api` entry was removed. Hosts continue to import `Harness`
from `inferrsi.harness.api`.
- Import `prepare_generation`, `read_prepared_binding`, `project_prepared_binding`
and `verify_prepared_binding` from `inferrsi.harness.executor`. These replace
`harness.generation.prepare_generation` and `harness.prepared_binding`'s
`read`, `project` and `verify`. They accept the same specs and artifact readers.
- Hosts execute a prepared spec through `Harness.execute` from `inferrsi.harness.api`.
The former `harness.execution_service`, `harness.entry_code`, `harness.input_binding`
and `harness.evidence_capture` implementations now live inside Executor.
The source modules `candidates`, `confinement`, `skill_evaluation` and `artifact_sandbox`
moved from `inferrsi.harness` to `inferrsi.harness.executor` with their in-tree callers.
- Service recovery uses `process_group_empty` from `inferrsi.harness.executor`.
Local process supervision, launch records and device leases live under
`harness.executor`; the three former root modules were removed.
- The external trial runner moved from `harness.trials.external` to
`harness.executor.trials.external` for apps that inject single-command trials.
- Import `Verdict` and `parse_verdict` from `inferrsi.contracts.claim`.
The former `inferrsi.harness` exports have been removed.

- `inferrsi benchmarks compare` keeps every attempt of an arm (Refs #509, P1.1). The new
`--action retry --trial <id>` opens a fresh attempt with its own job and workspace after a
collected, terminal attempt. The collected attempt stays as evidence, and no campaign is renamed.
Expand Down
2 changes: 1 addition & 1 deletion docs/apps-module-migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
"src/inferrsi/apps/delivery/snapshot.py",
"src/inferrsi/harness/records/artifact_primitives.py",
"src/inferrsi/harness/records/atomic_json.py",
"src/inferrsi/harness/input_binding.py",
"src/inferrsi/harness/executor/_input_binding.py",
"tests/apps/test_anthropic_agent.py",
"tests/apps/test_goal_checkpoint.py",
"tests/apps/test_inspection.py",
Expand Down
8 changes: 4 additions & 4 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tool and retain the native identity and returned artifacts. The child owns the
complete start/knowledge/round/final lifecycle; the parent observes and collects. This path records the handoff; it
does not implement a background Agent CLI driver or a native-host deadline.

The application injects `harness.trials.external.execute_trial` into the
The application injects `harness.executor.trials.external.execute_trial` into the
[two-rank MoE entry](benchmarks/moe-forward-benchmark.md). The standalone image benchmark
and [TTS service protocol](benchmarks/tts-benchmark.md) expose their documented execution
boundaries. Apps and Harness callers assemble these operations into optimization
Expand Down Expand Up @@ -284,7 +284,7 @@ the [import gate](guides/module-layout.md#import-gate) for migration and depende

| Add | Main extension locations | Required qualification |
| --- | --- | --- |
| Model or scenario | `harness/serving`, `benchmark/metrics.py`, `benchmark/validators`; trials run through the model-independent `harness/trials/external.py` | Frozen request and metric contract; model-specific quality coverage |
| Model or scenario | `harness/serving`, `benchmark/metrics.py`, `benchmark/validators`; trials run through the model-independent `harness/executor/trials/external.py` | Frozen request and metric contract; model-specific quality coverage |
| Repository | `apps/host/targets`, a composed scenario, `resources/repo_packs` | Stable source identity; command/result contract; environment isolation |
| Hardware | `apps/host/platforms` | Device selection, process exclusivity and independent backend/model evidence; a backend is registered in `apps/host/platforms/__init__.py` and its probe command is defined in the implementing module under `apps/host/platforms/`, not in package data |

Expand Down Expand Up @@ -332,7 +332,7 @@ float; `benchmark.legacy_run_v0.trial_metric` then applies the one finite, posit
metric contract (`benchmark.metrics.validate_metric`) to whatever the reader
returns, so a reader that yields `0.0`, a `bool` or a non-finite value records a
metric error rather than entering the evaluation. The Harness executor
`harness.trials.external.execute_trial` holds no metric rule: a caller that
`harness.executor.trials.external.execute_trial` holds no metric rule: a caller that
passes a metric key also passes `metric=`, its validation function.

Run state is written by the termination path, never assumed. `status.json`
Expand Down Expand Up @@ -385,7 +385,7 @@ require Linux with a readable `/proc` process table. They reject other platforms
before launch; missing or inaccessible process enumeration raises an error rather
than reporting successful cleanup. Workers must remain in their owned process
group. Windows Job Object support in the general command executor
(`harness.local_process`) does not extend to these server helpers. These constraints do not restrict read-only knowledge
(`harness.executor.local_process`) does not extend to these server helpers. These constraints do not restrict read-only knowledge
operations or the control CLI to Linux.

- Existing CLI flags, external JSON metrics, run artifacts, cancellation
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/modular-directory-map-en.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/benchmarks/moe-forward-benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ inferrsi benchmarks run moe-forward-npu \
`--timeout-seconds` 都必须显式指定;两组配对为每实现每性能 case 16 个计时样本,
四组为 32 个。超时包括入口准备和执行,之后最多有额外的有界进程清理等待。
入口先冻结题目、候选和 grader 的副本及 SHA256,再通过现有
由应用入口注入的 `harness.trials.external.execute_trial` 执行。
由应用入口注入的 `harness.executor.trials.external.execute_trial` 执行。
该执行器不含 metric 规则,入口在传 metric key 的同时传入自己的校验函数
(`metric=read_metric`)。
Python 调用 `evaluate` 时须显式传入 `execute_trial`。它额外清理本次唯一环境标记的
Expand Down
4 changes: 2 additions & 2 deletions docs/contracts/function-owners.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Status: **Proposed baseline**; individually **adopted** entries are identified b
| `harness/improvement` `usage_totals`/`assessment`/`holdout_accepts`/`rerun_assessment` | B experiment validity/comparison/acceptance rules; budget admission/reservation/charging reconciliation remains H | read normalized facts only; provider parsing does not move because of import convenience |
| same file `choose` | H search progression; `SelectionPolicy` split into B threshold rules and H progression/stop policy | no shared business `Policy` class; Apps does not create a retry loop |
| `harness/knowledge_capture` `assemble_context_text`/`_item` | K pure knowledge text projection | Apps connects K/H; Apps gives H the fixed expected text/hash; H stores the actually delivered text/hash; `verify_capture` byte integrity belongs to H and does not call K assembly in reverse; it is not a task-benefit verdict |
| `harness/trials/external` `execute_trial`/`collect_trial_checks` | H: run one command through `execute_command`, retain its record, and collect the trial checks; semantic metric validation (`read_metric`/`validate_metric`) is B and lives in `benchmark/metrics.py` | `execute_trial` applies only the metric callable the caller injects and holds no metric rule; offline assess executes nothing |
| `harness/executor/trials/external` `execute_trial`/`collect_trial_checks` | H: run one command through `execute_command`, retain its record, and collect the trial checks; semantic metric validation (`read_metric`/`validate_metric`) is B and lives in `benchmark/metrics.py` | `execute_trial` applies only the metric callable the caller injects and holds no metric rule; offline assess executes nothing |
| `campaign_records` `STAGES`/claim capture/reconciliation | H records; dashboard/report presentation → Apps | first remove the `campaign_records → dashboard_data` reverse dependency; #333 is Proposed and no claim is made that a unified event envelope is accepted |
| `catalog.repository_pack`/`REPO_TYPES` | D020 neutral raw-data technical leaf; target interpretation stays H | K does not expose the pack reader publicly; `apps/host/inspection` (the former `infra/inspection`, moved by #498) changes only its same-leaf import; seven K bodies/root entries/tests move together |
| `apps/views/dashboard_workflow` `command_state`/`run_workflow`/`validation_progress` (added with the OBS dissolve; **adopted owner: Apps views; RSI-master architecture decision 2026-11-14 Asia/Shanghai, recorded in the [D008 wave-2 ownership decision](d008-wave2-ownership-decision.md#dashboard-workflow); independent PR review remains separate**) | Apps views: read-only presentation projection of workflow and command state | The module imports only the standard library and reads records the caller already loaded; it has no H, K or Benchmark edge. A group `state` such as `completed` is a display state for the run workflow, not a verdict, and must not be read as the legacy `Verdict`. `validation_progress` only validates counters from a snapshot `dashboard_data` has already read; it opens no file. |
Expand All @@ -31,7 +31,7 @@ Any later split of a mixed function is accepted by real pytest/host/wheel/record

## Implemented rows

The skill-evaluation split (#410) implements the `skill_evaluation`, `skill_eval_diagnostic`, `skill_eval_engineering` and `improvement` rows. H keeps `harness/skill_evaluation.py`, `harness/artifact_sandbox.py` and `harness/manager/search/improvement.py`; B holds `benchmark/skill_evaluation.py`, `benchmark/skill_eval_diagnostic.py`, `benchmark/skill_eval_engineering.py` and `benchmark/improvement.py`; Apps composes them in `apps/workflows/skill_evaluation.py`, `apps/workflows/skill_eval_engineering.py` and `apps/workflows/improvement.py`. Two points follow the tree as it stands after #338, not the row text:
The skill-evaluation split (#410) implements the `skill_evaluation`, `skill_eval_diagnostic`, `skill_eval_engineering` and `improvement` rows. H keeps `harness/executor/skill_evaluation.py`, `harness/executor/artifact_sandbox.py` and `harness/manager/search/improvement.py`; B holds `benchmark/skill_evaluation.py`, `benchmark/skill_eval_diagnostic.py`, `benchmark/skill_eval_engineering.py` and `benchmark/improvement.py`; Apps composes them in `apps/workflows/skill_evaluation.py`, `apps/workflows/skill_eval_engineering.py` and `apps/workflows/improvement.py`. Two points follow the tree as it stands after #338, not the row text:

- `usage_totals` stays in `harness/records/usage.py`, because `harness/optimization.py` consumes it for budget accounting. B `assessment` receives the baseline and candidate totals from Apps and does not import H.
- `SelectionPolicy` holds only the two thresholds, so it lives whole in B. H `choose` receives the assessments, the validity block and the composition flag; it holds no threshold and no policy class.
2 changes: 1 addition & 1 deletion docs/contracts/gate-policy-runstore-and-first-prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The symbol inventory is AST-derived and does not claim to have found every third

1. The default cross-core prohibition stays. Only the seven leaf→exact-K-module edges above may serve as migration-compatibility exceptions; a module prefix does not authorize adjacent new modules.
2. Shape checks allow only a module docstring, a `future` import, the listed `ImportFrom` lines (alias only as `name as name`), and an `__all__` constant string list. No business definitions, other imports, assignment side effects, or dynamic module hooks.
3. The static graph resolves absolute/relative imports, `from package import name`, and known export edges, and builds the transitive closure. Any target K/B/H core API entry that reaches another core, Apps, or a legacy facade fails. The D020 neutral technical leaf is not a legacy facade and must be independently verified to contain only raw data reading/data constants and no core imports; "only indirectly, so it passes" is not allowed. Target H entry points are the new `harness.api`/`execution_service`/`run_store`; the current mixed `harness` does not automatically count as an isolated core.
3. The static graph resolves absolute/relative imports, `from package import name`, and known export edges, and builds the transitive closure. Any target K/B/H core API entry that reaches another core, Apps, or a legacy facade fails. The D020 neutral technical leaf is not a legacy facade and must be independently verified to contain only raw data reading/data constants and no core imports; "only indirectly, so it passes" is not allowed. Target H entry points are `harness.api`, `harness.executor` and `harness.records`; the current mixed `harness` does not automatically count as an isolated core.
4. The existing `harness/skill_evaluation.py → knowledge_operations → knowledge.*` edge is a registered **exact residual legacy dependency**: retained, and it keeps `overall isolation_complete=false`. It is not erased from the report and no new/expanded H bypass is permitted. It is not an exception available to a target H new entry. The skill-evaluation split (#410) later removed this edge and its exemption; [Module layout](../guides/module-layout.md#first-wave-compatibility-exceptions-proposed) records the current rule.
5. `test_clean_scan_is_not_isolation` becomes a staged-model test. It does not permanently assert that all three package directories are absent. It verifies that `overall` is still false when any target package, any compat exception, or an old H→model/infra transitive residual is missing. Green is not manufactured by deleting assertions.
6. A non-empty allowlist forces `overall isolation_complete=false`; "new core business closure isolated" is reported as a separate verifiable result and cannot impersonate isolation of the whole historical namespace.
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/generation-bounds.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Internal original generation bounds

`inferrsi.harness.generation.prepare_generation` seals an approved context and
`inferrsi.harness.executor.prepare_generation` seals an approved context and
generation plan before execution registration. Its caller supplies the original
attempt, context request, candidate context and provider ports. It writes the
authorized RunStore and returns the ordinary execution specification; it does
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/generation-feedback-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It is separate from a search/loop controller and does not grade evidence.

## Host entry

`inferrsi.harness.generation.prepare_generation` keeps its existing required
`inferrsi.harness.executor.prepare_generation` keeps its existing required
arguments and accepts three keyword-only options:

| Option | Value |
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/generation-feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This documents the first-phase boundary accepted in
[#371, decision 7084973960](https://github.com/InferMatrixLab/InferRSI/issues/371#issuecomment-7084973960).
V25 assigns frozen feedback policy to Harness. The current
`inferrsi.harness.generation.prepare_generation`, when called without an explicit
`inferrsi.harness.executor.prepare_generation`, when called without an explicit
`feedback_policy_ref`, does not enforce that policy:
it receives a host-built `candidate_context`, retains the delivered context and
seals the generation plan. There is no automatic next round on this path.
Expand Down
3 changes: 2 additions & 1 deletion docs/contracts/harness-entry-verification.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Harness source-entry verification

The local CPU target can opt into the first frozen evaluation task with
`LocalCpuTarget(..., module_root=<trusted absolute directory>)`. The host owns
`LocalCpuTarget(..., module_root=<trusted absolute directory>)` from
`inferrsi.harness.executor`. The host owns
this configuration. Requests cannot supply the root. Existing targets with no
module root retain their ordinary-command behavior and refuse evaluation mode
before registration.
Expand Down
2 changes: 1 addition & 1 deletion docs/contracts/harness-evaluation-replay.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ caller cancellation with a descendant, fixed cleanup facts, commit failure after
a real start, cross-process replay and registration races. Execution facts do
not provide a complete Benchmark F/C/M proof or a service-gain claim.

The [local process supervisor](../../src/inferrsi/harness/local_process.py)
The [local process supervisor](../../src/inferrsi/harness/executor/local_process.py)
rechecks cancellation and the attempt deadline or step timeout after opening
logs and before starting the worker. The
[launch-boundary test](../../tests/harness/test_harness_execute.py) covers this
Expand Down
6 changes: 3 additions & 3 deletions docs/contracts/harness-prepared-binding.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Harness preparation binding before registration

The Harness evaluation path checks declarations before registering an attempt.
`inferrsi.harness.prepared_binding.verify(spec, artifact_reader)` returns a
`inferrsi.harness.executor.verify_prepared_binding(spec, artifact_reader)` returns a
`FixedPreparation` projection or raises a Harness `PublicError`. The spec must
first pass `execution_service.validate`'s static shape checks; `Harness.execute`
performs both checks in that order. Ordinary command mode reads no preparation.

The projection's `read(ref, reader)` port obtains a binary stream through
The projection's `read_prepared_binding(ref, reader)` port obtains a binary stream through
`reader.open(ArtifactRef)`, closes it, bounds reads by the declared size plus one
byte, and independently checks size and SHA-256. Missing bytes or a missing
reader produce `ArtifactUnavailable`; changed bytes or noncanonical JSON
produce `ArtifactIntegrityError`. Unknown host programming errors propagate.
`project(bytes)` is pure: it parses the canonical v1 envelope and validates the
`project_prepared_binding(bytes)` is pure: it parses the canonical v1 envelope and validates the
fields used by Harness. It does not read a protocol, resolve an entry or start a
process. A schema version other than v1 is explicitly unsupported.

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Nightly checks cover Linux and Windows checkouts with `core.autocrlf` set to

Use `harness/serving` for a new model's server and request protocol and
`benchmark/metrics.py` with `benchmark/validators` for its metric and quality checks.
`harness/trials/external.py` runs any external command as one trial and is the
`harness/executor/trials/external.py` runs any external command as one trial and is the
same for every model. Use `apps/host/targets` with `resources/repo_packs` for
repositories, and
`apps/host/platforms` for hardware. A backend is registered in
Expand Down
Loading
Loading