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
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,53 @@

### Changed

- The host bindings move from `inferrsi.infra` to the new `inferrsi.apps.host`
package (Refs #498, slice 3a). There is no forwarding module or alias, and the
import gate fails any import of an old path.
- `inferrsi.infra.commands`, `inspection`, `environment`, `platforms` and
`targets` are now `inferrsi.apps.host.commands`, `inspection`, `environment`,
`platforms` and `targets`. Only one import line changes, in `inspection.py`,
which reads the neutral data leaf one package level deeper.
- The permanent neutral-leaf importer rule now names
`inferrsi.apps.host.inspection`. It moved with its file in the same change,
and `inferrsi.infra.inspection` is retired, so no window admits two importers.
`technical_leaf.permanent_importers` in `docs/legacy-knowledge-manifest.json`
names the new module. The A1 state is kept unchanged in `revision_history`, and
every leaf lock is unchanged. The move needs the same formal architecture review
as the rule.
- The `apps/host/` package keeps Infra's limit: the gate fails any path from it to
a Knowledge, Harness or Benchmark module.
- `inferrsi.infra` now holds only `artifacts.py`.
- The `inferrsi.infra.campaign` import facade is removed (Refs #498, slice 3c). It
only re-exported Infra helpers, and its one caller is the example campaign.
There is no forwarding module or alias, and the import gate fails any import of
the old path.
- `examples/qwen21_turbo_b300.py` imports `inferrsi.infra.artifacts`,
`inferrsi.infra.environment` and `inferrsi.infra.targets` directly.
- `helper_hashes` moves into that example unchanged. It hashes every Python file
of the installed package, so a record made after this change no longer lists
`inferrsi/infra/campaign.py`. Every other path it binds is unchanged, and
existing records are not rewritten.
- The serving helpers move from `inferrsi.infra` and `inferrsi.model` to the new
`inferrsi.harness.serving` package (Refs #498, slice 2). There is no forwarding
module or alias, and the import gate fails any import of an old path.
- `inferrsi.infra.processes` is now `inferrsi.harness.serving.server`,
`inferrsi.infra.http` is now `inferrsi.harness.serving.http`, and
`inferrsi.model.protocols.image` is now `inferrsi.harness.serving.image`.
The emptied `inferrsi.model.protocols` package is removed. The server helpers
keep their Linux-only process-group contract.
- The package initializer imports nothing, so importing the HTTP or image client
does not load the server helpers.
- `inferrsi.infra.campaign` no longer re-exports `launch_server` and
`stop_server`. The example campaign imports them from
`inferrsi.harness.serving.server`.
- The optimization session's runtime identity now hashes
`harness/serving/server.py` in place of `infra/processes.py`. A session planned
before this change is refused before `status`, `recover` or any other operation
runs, and its plan is not changed. Resume such a session with the runtime that
planned it: install the wheel or source of the commit it was started from, and
run the same `inferrsi benchmarks session` command there.
- Pickled objects that name an old module path no longer load.
- `docs/contracts/schemas/contract-v1.schema.json` validates more strictly
(Refs #497). Eleven `pattern` values ended with `$`, which in Python `re`, and so in
`jsonschema`, also matches before one trailing LF: `"att-1\n"` passed `Id`. They now
Expand Down
46 changes: 23 additions & 23 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,20 @@ interfaces; existing CLI commands remain supported.
| --- | --- | --- |
| Entry and knowledge | CLI arguments, immutable RunSpec, cited knowledge/context export | Model execution or automatic source editing |
| Harness | AB/BA order, deadlines, source checks, scenario composition, evidence, performance adjudication and reporting | Device-specific conditions, request schemas or kernel dispatch |
| Model | Request payloads and output decoding | Scheduling, worker lifetime, hardware selection, metric contracts or quality checks |
| Infra | Repository identity, device discovery/qualification, process ownership, HTTP transport, storage and artifacts | Model constants, campaign gates or performance verdicts |
| Model | Anthropic provider adapters and their request authorization | Scheduling, worker lifetime, hardware selection, request payloads, metric contracts or quality checks |
| Infra | Repository identity, device discovery/qualification, storage and artifacts | Model constants, campaign gates or performance verdicts |

Dependencies flow from entrypoints to Harness, from scenarios to Model/Infra,
and from Model to Infra utilities. Infra does not import Model or Harness. None
Dependencies flow from entrypoints to Harness. Harness reaches no Infra or Model
module, and Infra does not import Model or Harness. None
of these shared packages imports a campaign from `examples/`.

Environment inspection follows that direction. `infra/inspection.py` is the
Environment inspection follows that direction. `apps/host/inspection.py` is the
facts API: it takes the command probe and the repository snapshot as ports.
`apps/inspection.py` binds those ports to this host with
`infra.commands.probe_command` and `infra.targets.repository_identity`, and the
CLI calls that composition. Infra reaches no Apps, Knowledge, Harness or
Benchmark module and is not a fourth core. `infra/inspection.py` reads a
`apps.host.commands.probe_command` and `apps.host.targets.repository_identity`,
and the CLI calls that composition. The `apps/host/` package moved from Infra in
#498 slice 3a and keeps its limit: it reaches no Knowledge, Harness or Benchmark
module. `apps/host/inspection.py` reads a
repository-pack description through the neutral `resources.repository_packs`
leaf, under the one permanent importer rule in
[module-layout.md](module-layout.md#permanent-neutral-leaf-importer-rule-proposed).
Expand Down Expand Up @@ -186,6 +187,12 @@ src/inferrsi/
skill_eval_engineering.py Composed artifact check: task rules around sandbox replay
improvement.py Composed assessment, selection, rerun and holdout acceptance
inspection.py Environment inspection bound to the host probe and Git identity
host/
inspection.py Environment inspection facts API; command and snapshot ports
commands.py Bounded read-only probes
environment.py Dependency versions and storage checks
platforms/ Backend discovery registry; CUDA qualification
targets/git.py Repository identity and source snapshots
legacy/
run.py Old run composed from Harness, Benchmark and the report
evaluation.py Old evaluate entry: RunSpec to the Benchmark gates
Expand Down Expand Up @@ -269,19 +276,12 @@ src/inferrsi/
runner.py One AB/BA loop; execute/snapshot/assess/report ports injected
scenarios/
external.py External command trials; metric validation injected
model/
protocols/
serving/
server.py Supervised Linux serving workers and their group cleanup
http.py Timed JSON POST transport
image.py OpenAI-style image payload and PNG response protocol
infra/
processes.py Supervised Linux serving workers and their group cleanup
targets/git.py Repository identity and source snapshots
platforms/ Backend discovery registry; CUDA qualification
inspection.py Environment inspection facts API; command and snapshot ports
commands.py Bounded read-only probes
environment.py Dependency versions and storage checks
http.py HTTP POST/download timing
artifacts.py Hashing and evidence writes
campaign.py Legacy runner utility facade; transitive helper hashes
data/
repo_packs/ Contribution descriptors and versioned tuning knowledge
knowledge_packs/ Dependency and peer knowledge, preserving existing tiers
Expand Down Expand Up @@ -311,9 +311,9 @@ path to its replacement and lists what still keeps the isolation gate false.

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

The acceptance rule is: **a new model or hardware adapter must reuse the common
AB/BA loop, process cleanup and performance adjudication.** The extension
Expand Down Expand Up @@ -390,7 +390,7 @@ the default control package continues to require only the standard library.

### Add a platform or repository

Register a device probe in `infra.platforms.PLATFORM_PROBES`; supply the selected
Register a device probe in `apps.host.platforms.PLATFORM_PROBES`; supply the selected
IDs, device model and bounded command runner. A new backend name additionally
needs an entry in `knowledge.catalog.BACKENDS`, which supplies the CLI `--backend` choices
and the accepted knowledge and skill backends; no package-data descriptor is
Expand All @@ -407,7 +407,7 @@ change the AB/BA algorithm, process cleanup or evaluator.

## Compatibility and historical evidence

The supervised server helpers (`infra.processes.launch_server` / `stop_server`)
The supervised server helpers (`harness.serving.server.launch_server` / `stop_server`)
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
Expand Down
9 changes: 5 additions & 4 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ policy does not renormalize existing blobs or authorize edits to frozen files.
Nightly checks cover Linux and Windows checkouts with `core.autocrlf` set to
`false`, `true` and `input`.

Use `harness/scenarios`, `model/protocols` and `benchmark/validators` for new models,
`infra/targets` with `data/repo_packs` for repositories, and `infra/platforms` for
hardware. A backend is registered in `infra/platforms/__init__.py`; its probe
command is defined in the implementing module under `infra/platforms/`. That
Use `harness/scenarios`, `harness/serving` and `benchmark/validators` for new models,
`apps/host/targets` with `data/repo_packs` for repositories, and
`apps/host/platforms` for hardware. A backend is registered in
`apps/host/platforms/__init__.py`; its probe command is defined in the
implementing module under `apps/host/platforms/`. That
module owns the command name and the discovery boundary. Reuse the common AB/BA loop,
cleanup and adjudication. See [extension contracts](architecture.md#where-to-extend).

Expand Down
45 changes: 38 additions & 7 deletions docs/legacy-knowledge-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "urn:inferrsi:docs:legacy-knowledge-manifest:v1",
"description": "First-wave Knowledge compatibility record and the neutral technical data leaf's locks. P0b froze the first revision at 0da7e2f960cd4ec994ae8eddea5b71023c5379ca, K01 re-recorded every leaf hash before the code move, K02 changed only the data leaf's locked file hash, and C2 (#451) moved that leaf byte for byte to inferrsi.resources.repository_packs. The R1 revision (#412) deleted the seven root Knowledge shells with their eight pairs, so compatibility_pairs is empty and the allowlist blocker is gone. The former ninth pair, infra.inspection -> the data leaf, is now the permanent exact rule in technical_leaf.permanent_importers, outside the allowlist. The nine retired pair records, with the old root leaf hashes and export lists, are kept unchanged under the C2 revision_history entry, the record that R1 appended; it is no longer the last entry. The leaf's bytes and locked file hash are unchanged. Nothing here is a wildcard approval, and it changes only through formal review. Line references are at the base_commit recorded by the revision that wrote them; no later revision re-records them. This A1 revision (#408) removes technical_leaf.temporary_importers with root arguments.py: the moved Apps parser reads the same REPO_TYPES object through inferrsi.knowledge.catalog, no Apps importer of the leaf is declared, and the removed entry is kept unchanged as retired_temporary_importers under the last revision_history entry, the R1 record.",
"base_commit": "aaa17a5dd333449d15fb052bb09b2012d55f2327",
"description": "First-wave Knowledge compatibility record and the neutral technical data leaf's locks. P0b froze the first revision at 0da7e2f960cd4ec994ae8eddea5b71023c5379ca, K01 re-recorded every leaf hash before the code move, K02 changed only the data leaf's locked file hash, and C2 (#451) moved that leaf byte for byte to inferrsi.resources.repository_packs. The R1 revision (#412) deleted the seven root Knowledge shells with their eight pairs, so compatibility_pairs is empty and the allowlist blocker is gone. The former ninth pair, infra.inspection -> the data leaf, is now the permanent exact rule (its importer moved to apps.host.inspection in #498 slice 3a) in technical_leaf.permanent_importers, outside the allowlist. The nine retired pair records, with the old root leaf hashes and export lists, are kept unchanged under the C2 revision_history entry, the record that R1 appended; it is no longer the last entry. The leaf's bytes and locked file hash are unchanged. Nothing here is a wildcard approval, and it changes only through formal review. Line references are at the base_commit recorded by the revision that wrote them; no later revision re-records them. This A1 revision (#408) removes technical_leaf.temporary_importers with root arguments.py: the moved Apps parser reads the same REPO_TYPES object through inferrsi.knowledge.catalog, no Apps importer of the leaf is declared, and the removed entry is kept unchanged as retired_temporary_importers under the last revision_history entry, the R1 record.",
"base_commit": "9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426",
"revision_history": [
{
"base_commit": "0da7e2f960cd4ec994ae8eddea5b71023c5379ca",
Expand Down Expand Up @@ -287,6 +287,31 @@
"gate": "tests/_gate_policy_support.py TEMPORARY_LEAF_IMPORTERS holds the same importer and name.",
"review": "This entry requires formal architecture review. The implementer does not self-approve it, and passing tests are not that review."
}
},
{
"base_commit": "aaa17a5dd333449d15fb052bb09b2012d55f2327",
"stage": "A1",
"superseded_by": "#498 slice 3a host-move revision at 9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426",
"reason": "#498 slice 3a moves src/inferrsi/infra/inspection.py to src/inferrsi/apps/host/inspection.py together with commands.py, environment.py, platforms/ and targets/, with no forwarding module or alias. The permanent leaf importer moves with its file in the same change: the gate admits exactly inferrsi.apps.host.inspection with the same one name, and inferrsi.infra.inspection is retired, so no window admits two importers. The import line gains one relative level for the deeper package. The host modules keep Infra's limit and reach no Knowledge, Harness or Benchmark module. Every leaf lock is unchanged.",
"retired_permanent_importers": {
"stage": "R1",
"issue": "#412",
"rule": "Outside inferrsi.knowledge, exactly the listed module may import the leaf. It binds only its listed name, with the plain module-level from-import recorded as import_line. Any other importer, any other name, an alias, the leaf imported as a module object, an import below module level, a sys.modules use or a dynamic import fails the gate. An inferrsi.resources prefix allows nothing, and the leaf's one parent initializer stays import-free.",
"importers": [
{
"importer": "inferrsi.infra.inspection",
"file": "src/inferrsi/infra/inspection.py",
"names": [
"repository_pack"
],
"import_line": "from ..resources.repository_packs import repository_pack",
"note": "D020. Infra reads one pack description directly, never through Knowledge or Harness. This is the edge that was the ninth compatibility pair."
}
],
"not_a_compatibility_pair": "The entry is not in compatibility_pairs and is never counted by the allowlist blocker. It does not retire with a shell, because the importer is not a shell.",
"gate": "tests/_gate_policy_support.py LEAF_IMPORTERS holds the same importer and name. tests/test_knowledge_compatibility_shells.py requires the two to match exactly.",
"review": "This rule requires formal architecture review. The implementer does not self-approve it, and passing tests are not that review."
}
}
],
"compatibility_pairs": [],
Expand Down Expand Up @@ -349,18 +374,24 @@
"rule": "Outside inferrsi.knowledge, exactly the listed module may import the leaf. It binds only its listed name, with the plain module-level from-import recorded as import_line. Any other importer, any other name, an alias, the leaf imported as a module object, an import below module level, a sys.modules use or a dynamic import fails the gate. An inferrsi.resources prefix allows nothing, and the leaf's one parent initializer stays import-free.",
"importers": [
{
"importer": "inferrsi.infra.inspection",
"file": "src/inferrsi/infra/inspection.py",
"importer": "inferrsi.apps.host.inspection",
"file": "src/inferrsi/apps/host/inspection.py",
"names": [
"repository_pack"
],
"import_line": "from ..resources.repository_packs import repository_pack",
"note": "D020. Infra reads one pack description directly, never through Knowledge or Harness. This is the edge that was the ninth compatibility pair."
"import_line": "from ...resources.repository_packs import repository_pack",
"note": "D020. The host inspection facts API reads one pack description directly, never through Knowledge or Harness. This is the edge that was the ninth compatibility pair. #498 slice 3a moved it from inferrsi.infra.inspection with its file."
}
],
"not_a_compatibility_pair": "The entry is not in compatibility_pairs and is never counted by the allowlist blocker. It does not retire with a shell, because the importer is not a shell.",
"gate": "tests/_gate_policy_support.py LEAF_IMPORTERS holds the same importer and name. tests/test_knowledge_compatibility_shells.py requires the two to match exactly.",
"review": "This rule requires formal architecture review. The implementer does not self-approve it, and passing tests are not that review."
"review": "This rule requires formal architecture review. The implementer does not self-approve it, and passing tests are not that review.",
"relocated": {
"stage": "#498 slice 3a",
"from": "inferrsi.infra.inspection",
"to": "inferrsi.apps.host.inspection",
"review": "The move changes which module the rule names, so it requires the same formal architecture review as the rule itself. Passing tests are not that review."
}
}
},
"infra_inspection_rewrite": {
Expand Down
Loading
Loading