diff --git a/.gitattributes b/.gitattributes index e7fb3e682..cf5457620 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,9 @@ /evidence/** -text /tests/fixtures/legacy/** -text /tests/fixtures/atomic-reader/** -text whitespace=-blank-at-eof +# Migrated task paragraphs and YAML headers retain their original LF separators. +/src/inferrsi/knowledge/atoms/task-*.md text eol=lf whitespace=-blank-at-eof +/src/inferrsi/knowledge/compositions/*-header.yaml text eol=lf whitespace=-blank-at-eof # A session started by an older runtime keeps its exact bytes; its plan pins file hashes. /tests/fixtures/optimization-session/pre-infra-removal-session/** -text /tests/fixtures/optimization-session/pre-trials-rename-session/** -text diff --git a/docs/guides/knowledge/knowledge-layout.md b/docs/guides/knowledge/knowledge-layout.md index 43053339d..af8548f2b 100644 --- a/docs/guides/knowledge/knowledge-layout.md +++ b/docs/guides/knowledge/knowledge-layout.md @@ -46,8 +46,19 @@ by its JSON pointer at the requested revision. builder appends their original bytes, including whitespace, to the L0 body. A Reader request for L0 still returns the composition's L0 route. Each of the seven public task names has one owner. + To preserve native host fields during migration, `skill.frontmatter` can + name a content resource in the pinned composition. The builder verifies its + name and description, requires exactly one header with no procedure text, + and emits its original bytes, including invocation settings and attribution. The [executable authoring example](../../../tests/knowledge/test_atomic_generation.py) builds all seven entries and a supporting skill. +- For the task-domain migration, read the [v0.3.4 owner and byte + map](../../../tests/fixtures/atomic-reader/task-domain-v0.3.4.json). Run + `inferrsi skills --root /skills enter task-debug` against a + built candidate to open the complete primary procedure. Use the same root + with `resource inference-task-router references/routes/debug.json` for its + original routing card. The card's candidate skill IDs identify owners to + consult in the other domains. - The installer writes `knowledge/{atoms,compositions}/`, the generated catalog and file digests in `knowledge/generation.json`, and `skills//SKILL.md` with the declared references, assets and scripts. Two builds of the same diff --git a/src/inferrsi/knowledge/atomic_build.py b/src/inferrsi/knowledge/atomic_build.py index 1de399a1d..2fbbd2cc8 100644 --- a/src/inferrsi/knowledge/atomic_build.py +++ b/src/inferrsi/knowledge/atomic_build.py @@ -5,6 +5,7 @@ import json import re from collections.abc import Callable, Mapping +from io import BytesIO from pathlib import Path, PurePosixPath from tempfile import TemporaryDirectory @@ -13,6 +14,7 @@ from .atomic_reader import atom_material, permits_operations from .decision_cards import DecisionSource from .knowledge_operations import IDENTITY, Bundle, _json, safe_path +from .skill_catalog import _frontmatter_parts _PUBLISH = {"read", "retain", "redistribute"} @@ -42,7 +44,8 @@ def _authored(directory: Path, path: Path, field: str) -> tuple[AtomPin, Bundle] return AtomPin(ref, bundle.revision), bundle -def _host_skill(declaration: dict, nodes: dict, material: dict) -> tuple[str, dict[str, bytes]]: +def _host_skill(bundle: Bundle, nodes: dict, material: dict) -> tuple[str, dict[str, bytes]]: + declaration = bundle.metadata["composition"]["skill"] name, description = declaration["name"], declaration["description"] if (not isinstance(name, str) or len(name) > 64 or not re.fullmatch(r"[a-z0-9]+(?:-[a-z0-9]+)*", name)): @@ -62,8 +65,19 @@ def _host_skill(declaration: dict, nodes: dict, material: dict) -> tuple[str, di raise ValueError(f"Repeated host skill section in {name}") body = b"".join(material[pin][0] for pin in pins) markdown = body.decode("utf-8") - quoted = json.dumps(description, ensure_ascii=False) - header = f"---\nname: {json.dumps(name)}\ndescription: {quoted}\n---\n\n".encode() + if "frontmatter" in declaration: + path = safe_path(declaration["frontmatter"]) + if path not in bundle.content: + raise ValueError(f"Missing pinned host frontmatter for {name}") + header = bundle.content[path] + stream = BytesIO(header) + host, _ = _frontmatter_parts(stream) + if (host.get("name") != name or host.get("description") != description + or stream.read().strip() or not header.endswith(b"\n")): + raise ValueError(f"Invalid host frontmatter for {name}") + else: + quoted = json.dumps(description, ensure_ascii=False) + header = f"---\nname: {json.dumps(name)}\ndescription: {quoted}\n---\n\n".encode() output = {f"skills/{name}/SKILL.md": header + body} resources = declaration.get("resources", {}) for relative, node in resources.items(): @@ -150,7 +164,7 @@ def _prepare(source: Path, permits: Callable[[AtomPin, str], bool], roots: Mappi if route["layer"] not in layers: raise ValueError(f"No required root supplies {route['layer']} for {pin.ref}") if "skill" in declaration: - name, output = _host_skill(declaration["skill"], nodes, material) + name, output = _host_skill(bundle, nodes, material) if name in skills: raise ValueError(f"Multiple compositions export host skill {name}") skills[name] = pin.ref diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.json b/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.json new file mode 100644 index 000000000..181417a30 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-accuracy-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-accuracy" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "byte_range": [ + 4261, + 4767 + ], + "sha256": "142403a4ec7eb056ee229f3cd153e64a37cc8f44a97eec4aedab53d81bbf1837" + } + } + }, + "content": { + "body.md": { + "path": "task-accuracy-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.md b/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.md new file mode 100644 index 000000000..f4301735b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when the first divergence is explained, the original and held-out end-to-end outputs meet the user's tolerance on the actual target, and trade-offs are reported. If only an analogue exists (for example Ascend evidence for Windows TTS), identify the missing target sample and the smallest stage replay that tests transfer. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-condition.json b/src/inferrsi/knowledge/atoms/task-accuracy-condition.json new file mode 100644 index 000000000..1fd6586f3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-accuracy-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Inference completes but output violates a reference, quality metric or tolerance.", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/accuracy.json", + "sha256": "5a672842ec26262d8827f7ce8d92de9bd956859ff5244189c0519b8f0dd188e3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-accuracy" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/accuracy.json", + "byte_range": [ + 92, + 173 + ], + "sha256": "d9bad2e989c2bfa1463001c8a0eac3a6ea9bb88f1d88df1b5d20669d26f16753" + } + } + }, + "content": { + "body.md": { + "path": "task-accuracy-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-condition.md b/src/inferrsi/knowledge/atoms/task-accuracy-condition.md new file mode 100644 index 000000000..a676ac3ea --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-condition.md @@ -0,0 +1 @@ +Inference completes but output violates a reference, quality metric or tolerance. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-navigation.json b/src/inferrsi/knowledge/atoms/task-accuracy-navigation.json new file mode 100644 index 000000000..d94b0728a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-accuracy-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Repair a numerical or output-quality regression", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "byte_range": [ + 1346, + 1397 + ], + "sha256": "10477fc3d5e6501291a3cd48b91857681a5c15a829743b4617335baf97939cf6" + } + } + }, + "content": { + "body.md": { + "path": "task-accuracy-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-navigation.md b/src/inferrsi/knowledge/atoms/task-accuracy-navigation.md new file mode 100644 index 000000000..ad16aa592 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-navigation.md @@ -0,0 +1,2 @@ +# Repair a numerical or output-quality regression + diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-procedure.json b/src/inferrsi/knowledge/atoms/task-accuracy-procedure.json new file mode 100644 index 000000000..c29f3a124 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-accuracy-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-accuracy" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "byte_range": [ + 1899, + 2905 + ], + "sha256": "222d4b2c6c9ac9d09aad49980e2ffd163645514e6e8ac20fef4e28de52734322" + } + } + }, + "content": { + "body.md": { + "path": "task-accuracy-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-procedure.md b/src/inferrsi/knowledge/atoms/task-accuracy-procedure.md new file mode 100644 index 000000000..64c0efaa3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Freeze the model revision, reference outputs, inputs, seeds, preprocessing, dtype and sampling flags. Define the user's end-to-end tolerance and how the oracle handles ordinary variation. Replay both the reference and failing target with the supplied script. +2. Compare aligned stage outputs, then the first divergent token, frame or tensor. For TTS, distinguish text normalization, codec tokens and decoded audio. Feed a saved reference intermediate to the target stage to distinguish an upstream handoff error from a local math error. +3. If quality changed after an upgrade, replay the last-good and current combinations on identical inputs. Add version alignment as a secondary task if only the target combination fails. If both fail, continue tracing the divergence against the reference. +4. Change one in-scope implementation or configuration. Re-run the original and held-out inputs, including the complete postprocessing path, and report any latency or resource trade-off. + diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-route-card.json b/src/inferrsi/knowledge/atoms/task-accuracy-route-card.json new file mode 100644 index 000000000..b990521d5 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-accuracy-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Restore numerical or output quality", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/accuracy.json", + "sha256": "5a672842ec26262d8827f7ce8d92de9bd956859ff5244189c0519b8f0dd188e3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-accuracy" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/accuracy.json", + "byte_range": [ + 0, + 1411 + ], + "sha256": "5a672842ec26262d8827f7ce8d92de9bd956859ff5244189c0519b8f0dd188e3" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"accuracy\",\n \"title\": \"Restore numerical or output quality\",\n \"choose_when\": \"Inference completes but output violates a reference, quality metric or tolerance.\",\n \"required_inputs\": [\n \"fixed inputs, weights and reference implementation\",\n \"quality metric and tolerance\",\n \"seed, dtype and preprocessing\",\n \"modality-specific outputs\"\n ],\n \"steps\": [\n \"Confirm preprocessing, sampling and evaluation parity.\",\n \"For a post-upgrade regression, compare the last-good and current revisions on identical inputs. If only the upgraded combination fails, add version-align and bisect the changed boundary. If both fail against the reference, keep tracing the quality divergence.\",\n \"Find the first diverging stage, tensor, frame or token.\",\n \"For TTS, collect reference audio or codec tokens at the target revision. Report target-matched evidence separately from observations on other devices. When target evidence is missing, record where you searched, the missing owner and the smallest target parity check.\",\n \"Verify the correction on the reproducer and held-out inputs before rechecking speed.\"\n ],\n \"acceptance_evidence\": \"A localized divergence, reproducible quality recovery and held-out results; include any latency cost.\",\n \"candidate_skill_ids\": [\n \"audit-fixed-workload-claim\",\n \"diffusers-invocation-state\",\n \"torch-npu\",\n \"claim-contract\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-support.json b/src/inferrsi/knowledge/atoms/task-accuracy-support.json new file mode 100644 index 000000000..74441d87a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-accuracy-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-accuracy" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "byte_range": [ + 2905, + 4261 + ], + "sha256": "479cfe5a22d0cc5d26ca279a659d05a864ddc1d34b1b647e186ddd3a552088b6" + } + } + }, + "content": { + "body.md": { + "path": "task-accuracy-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-accuracy-support.md b/src/inferrsi/knowledge/atoms/task-accuracy-support.md new file mode 100644 index 000000000..8ab353162 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-accuracy-support.md @@ -0,0 +1,13 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| A fixed-workload report aggregates the quality or completion results differently between runs. | `audit-fixed-workload-claim` | Audit retained observations, declared quality evidence and comparability. Align the reports before attributing a regression to model math. | +| A Flux pipeline or FlowMatch scheduler differs only on repeated calls. | `diffusers-invocation-state` | Get the call-state and schedule trace. Compare fresh versus reused wrappers at the first differing timestep. | +| The first differing tensor is on an Ascend TorchNPU dispatch or dtype boundary. | `torch-npu` | Identify the actual dispatch path and precision behavior. Replay that operator with fixed inputs and verify on the installed device. | +| The reported tolerance passes for only a subset of requested outputs or targets. | `claim-contract` | Get the supported verdict and evidence gaps. State the covered scope and obtain the missing target result before declaring recovery. | + diff --git a/src/inferrsi/knowledge/atoms/task-capture-run.json b/src/inferrsi/knowledge/atoms/task-capture-run.json new file mode 100644 index 000000000..b57927533 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-capture-run.json @@ -0,0 +1,134 @@ +{ + "metadata": { + "id": "task-capture-run", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Capture the actual run", + "state": "candidate", + "applicability": { + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + }, + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "byte_range": [ + 1397, + 1899 + ], + "sha256": "41efed7aa96e9a9c72a53a5164501dc8b8e9d688780e6f6084c32acc9d13266a" + }, + "other_occurrences": [ + { + "source_index": 1, + "byte_range": [ + 1385, + 1887 + ] + }, + { + "source_index": 2, + "byte_range": [ + 1393, + 1895 + ] + }, + { + "source_index": 3, + "byte_range": [ + 1424, + 1926 + ] + }, + { + "source_index": 4, + "byte_range": [ + 1438, + 1940 + ] + }, + { + "source_index": 5, + "byte_range": [ + 1405, + 1907 + ] + }, + { + "source_index": 6, + "byte_range": [ + 1424, + 1926 + ] + } + ] + } + }, + "content": { + "body.md": { + "path": "task-capture-run.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-capture-run.md b/src/inferrsi/knowledge/atoms/task-capture-run.md new file mode 100644 index 000000000..872abb8aa --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-capture-run.md @@ -0,0 +1,9 @@ +## Capture the actual run + +Record the hardware vendor, device SKU, backend and driver, OS, model family and +checkpoint revision, engine and plugin versions, and the exact run script and +flags. Attach the benchmark inputs, workload shape, dtype, reference or quality +oracle, and the user's acceptance criteria. Write down the current diagnosis +and its supporting observation, allowed search space, and remaining budget. +Mark missing fields as unknown and request the first one that affects a decision. + diff --git a/src/inferrsi/knowledge/atoms/task-day-0-acceptance.json b/src/inferrsi/knowledge/atoms/task-day-0-acceptance.json new file mode 100644 index 000000000..082d76b16 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-day-0-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-day-0" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "byte_range": [ + 4009, + 4496 + ], + "sha256": "2c8620c1d6ace8743a53ce5ee8356b70bd2c7fca1ac50048058661f69747fa28" + } + } + }, + "content": { + "body.md": { + "path": "task-day-0-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-acceptance.md b/src/inferrsi/knowledge/atoms/task-day-0-acceptance.md new file mode 100644 index 000000000..72191166e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when each requested stage meets its reference check, the full model returns the accepted result on the specified target, and the saved fixture reproduces it. If a stage still fails, name its first mismatching input/output pair and the single replay that separates a loader error from an operator error. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-day-0-condition.json b/src/inferrsi/knowledge/atoms/task-day-0-condition.json new file mode 100644 index 000000000..80591d818 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-day-0-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "First usable support for a new checkpoint or model architecture in an existing engine.", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/day0-model.json", + "sha256": "77b26d1300e5535d8b595cef95c6c803ea1322e92f38b68ae2905f69355a814f" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-day-0" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/day0-model.json", + "byte_range": [ + 91, + 177 + ], + "sha256": "254ed9783464222ada47f205281c63014c7bd7740a9cf5908cc91855dafedc79" + } + } + }, + "content": { + "body.md": { + "path": "task-day-0-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-condition.md b/src/inferrsi/knowledge/atoms/task-day-0-condition.md new file mode 100644 index 000000000..882b7867b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-condition.md @@ -0,0 +1 @@ +First usable support for a new checkpoint or model architecture in an existing engine. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-day-0-navigation.json b/src/inferrsi/knowledge/atoms/task-day-0-navigation.json new file mode 100644 index 000000000..3e27d7939 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-day-0-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Bring up a new model in an existing engine", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "byte_range": [ + 1339, + 1385 + ], + "sha256": "94321a7eef751bf1fbaf721fc98aaf7916e178d8cda0cd4fb3f8f567c0e1a5ea" + } + } + }, + "content": { + "body.md": { + "path": "task-day-0-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-navigation.md b/src/inferrsi/knowledge/atoms/task-day-0-navigation.md new file mode 100644 index 000000000..46699a527 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-navigation.md @@ -0,0 +1,2 @@ +# Bring up a new model in an existing engine + diff --git a/src/inferrsi/knowledge/atoms/task-day-0-procedure.json b/src/inferrsi/knowledge/atoms/task-day-0-procedure.json new file mode 100644 index 000000000..9aa2e35b5 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-day-0-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-day-0" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "byte_range": [ + 1887, + 2911 + ], + "sha256": "643ed05ac29007e34dd92e1a977fa1aa661df37d37442c027d6a1816a4c237a9" + } + } + }, + "content": { + "body.md": { + "path": "task-day-0-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-procedure.md b/src/inferrsi/knowledge/atoms/task-day-0-procedure.md new file mode 100644 index 000000000..7c146a5b9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Pin the upstream reference implementation, model revision, weights, tokenizer/processor, input and decoding settings. Save the exact reference command and expected output for each requested modality. Record any stochastic comparison rule before changing the adapter. +2. Map the checkpoint and I/O contract onto the engine's loader, preprocessing, stage boundaries, operators and postprocessing. On the target device, start with the smallest real-weight input. Compare each stage against the pinned reference in execution order. +3. At the first failing stage, replay its saved reference inputs through the target stage alone. If those pass, inspect the previous stage's handoff. Otherwise inspect the implementation or weights at that stage. Change one allowed adaptation at a time. +4. Run the complete user script with the agreed features and flags. Save inputs, revisions, stage checks, output and tolerance as a replayable regression fixture. State which features and devices the fixture covers. + diff --git a/src/inferrsi/knowledge/atoms/task-day-0-route-card.json b/src/inferrsi/knowledge/atoms/task-day-0-route-card.json new file mode 100644 index 000000000..e92360507 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-day-0-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Integrate a newly released model", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/day0-model.json", + "sha256": "77b26d1300e5535d8b595cef95c6c803ea1322e92f38b68ae2905f69355a814f" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-day-0" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/day0-model.json", + "byte_range": [ + 0, + 871 + ], + "sha256": "77b26d1300e5535d8b595cef95c6c803ea1322e92f38b68ae2905f69355a814f" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"day0-model\",\n \"title\": \"Integrate a newly released model\",\n \"choose_when\": \"First usable support for a new checkpoint or model architecture in an existing engine.\",\n \"required_inputs\": [\n \"checkpoint revision and tokenizer or processor\",\n \"model family and supported modalities\",\n \"upstream reference outputs\",\n \"device, backend and engine revisions\"\n ],\n \"steps\": [\n \"Map the model config and I/O contract to the host engine.\",\n \"Run the smallest reference-parity test for each requested modality.\",\n \"List missing operators or unsupported features before benchmarking.\"\n ],\n \"acceptance_evidence\": \"A reproducible load and generation smoke, parity checks and a supported-feature matrix on the named target.\",\n \"candidate_skill_ids\": [\n \"ascend-model-adaptation\",\n \"diffusers-invocation-state\",\n \"claim-contract\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-support.json b/src/inferrsi/knowledge/atoms/task-day-0-support.json new file mode 100644 index 000000000..2e87c10b7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-day-0-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-day-0" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "byte_range": [ + 2911, + 4009 + ], + "sha256": "51b8018e5c27cec47b81a85935569d9f62242995679441f7acfa80b4f97c8230" + } + } + }, + "content": { + "body.md": { + "path": "task-day-0-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-day-0-support.md b/src/inferrsi/knowledge/atoms/task-day-0-support.md new file mode 100644 index 000000000..4f4cb1cb9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-day-0-support.md @@ -0,0 +1,12 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| The target is Ascend and weight scales, KV replication or a multimodal adapter prevent a real-weight run. | `ascend-model-adaptation` | Get the checkpoint and feature report. Replay the first unsupported load or stage with real weights before progressing. | +| A Flux diffusion stage agrees on the first call but diverges on reuse. | `diffusers-invocation-state` | Get the wrapper/scheduler state trace. Replay with a fresh pipeline and compare the first differing timestep. | +| The request includes a support claim and some features have only source or smoke evidence. | `claim-contract` | Map observations to the declared gates. Publish the supported subset and leave the uncovered features open. | + diff --git a/src/inferrsi/knowledge/atoms/task-debug-acceptance.json b/src/inferrsi/knowledge/atoms/task-debug-acceptance.json new file mode 100644 index 000000000..cc8ad8dfd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-debug-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-debug" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "byte_range": [ + 4165, + 4686 + ], + "sha256": "65d1fc97fb0a8c0eafd9f7f3902b2300389a5316ecb61ac06f639a18969cd1d3" + } + } + }, + "content": { + "body.md": { + "path": "task-debug-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-acceptance.md b/src/inferrsi/knowledge/atoms/task-debug-acceptance.md new file mode 100644 index 000000000..8b14e39f2 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when the original failure is reproducible before the fix, its earliest implicated boundary is supported by evidence, and both the original script and the unaffected control pass after the fix. For an intermittent failure, record the attempted repeats and propose the narrowest additional trace that can distinguish the remaining causes. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-debug-condition.json b/src/inferrsi/knowledge/atoms/task-debug-condition.json new file mode 100644 index 000000000..d566e7a07 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-debug-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "A hang, crash, OOM or execution-path failure needs a reproducible cause.", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/debug.json", + "sha256": "75241e43d12fb961d3f48d1b683e4df321c0f18e683959aedca9722e78a8b78f" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-debug" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/debug.json", + "byte_range": [ + 81, + 153 + ], + "sha256": "7bccb87127ab06a0c0963e48c4919df0ab1985e9da6236e85d811bedddf0fac9" + } + } + }, + "content": { + "body.md": { + "path": "task-debug-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-condition.md b/src/inferrsi/knowledge/atoms/task-debug-condition.md new file mode 100644 index 000000000..6c81123f2 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-condition.md @@ -0,0 +1 @@ +A hang, crash, OOM or execution-path failure needs a reproducible cause. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-debug-navigation.json b/src/inferrsi/knowledge/atoms/task-debug-navigation.json new file mode 100644 index 000000000..423767a9d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-debug-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Isolate and repair an execution failure", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "byte_range": [ + 1350, + 1393 + ], + "sha256": "1c33f39d398a29d15a74b4430c532e2e0c18a43c9236a83015e254fe04d5efde" + } + } + }, + "content": { + "body.md": { + "path": "task-debug-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-navigation.md b/src/inferrsi/knowledge/atoms/task-debug-navigation.md new file mode 100644 index 000000000..7cb3b28b6 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-navigation.md @@ -0,0 +1,2 @@ +# Isolate and repair an execution failure + diff --git a/src/inferrsi/knowledge/atoms/task-debug-procedure.json b/src/inferrsi/knowledge/atoms/task-debug-procedure.json new file mode 100644 index 000000000..67ef21d05 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-debug-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-debug" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "byte_range": [ + 1895, + 2839 + ], + "sha256": "18b0a3c5c4d0df01977c44aeeeaac5261f94f4e42af64b1d59b76f9a005e39e4" + } + } + }, + "content": { + "body.md": { + "path": "task-debug-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-procedure.md b/src/inferrsi/knowledge/atoms/task-debug-procedure.md new file mode 100644 index 000000000..3eaee20b9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Replay the supplied script with its original flags and capture the first observable error, stage, device, rank and timestamps. Keep a last-working revision or configuration as a control. For a hang, capture progress at each boundary before attributing a cause. +2. Minimize the input or configuration one variable at a time. Preserve the original signature and a closely matched passing control. Follow ownership across stages to locate the earliest difference. +3. State two explanations that predict different observations. Probe the smallest boundary that distinguishes them, such as a recorded handoff with a known-good producer or consumer. Apply one in-scope fix only when the observation implicates that boundary. +4. Repeat the minimal reproducer, then the original unmodified script and an unaffected control. Retain logs tying the original failure and recovery to the same boundary and save a regression check. + diff --git a/src/inferrsi/knowledge/atoms/task-debug-route-card.json b/src/inferrsi/knowledge/atoms/task-debug-route-card.json new file mode 100644 index 000000000..c8d9bafdd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-debug-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Diagnose execution failures", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/debug.json", + "sha256": "75241e43d12fb961d3f48d1b683e4df321c0f18e683959aedca9722e78a8b78f" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-debug" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/debug.json", + "byte_range": [ + 0, + 782 + ], + "sha256": "75241e43d12fb961d3f48d1b683e4df321c0f18e683959aedca9722e78a8b78f" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"debug\",\n \"title\": \"Diagnose execution failures\",\n \"choose_when\": \"A hang, crash, OOM or execution-path failure needs a reproducible cause.\",\n \"required_inputs\": [\n \"symptom, phase and logs\",\n \"minimal reproducer\",\n \"last working version or configuration\",\n \"hardware and system context\"\n ],\n \"steps\": [\n \"Reduce to a failing and a working control.\",\n \"Localize the first failing boundary and test competing causes.\",\n \"Verify the fix against the reproducer and an unaffected control.\"\n ],\n \"acceptance_evidence\": \"A minimal reproducer, cause with evidence and regression check.\",\n \"candidate_skill_ids\": [\n \"inference-optimization-casebook\",\n \"ascend-device-health\",\n \"audit-vllm-kv-lifetimes\",\n \"audit-afd-p2p-exchanges\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-support.json b/src/inferrsi/knowledge/atoms/task-debug-support.json new file mode 100644 index 000000000..12aaa1d92 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-debug-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-debug" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "byte_range": [ + 2839, + 4165 + ], + "sha256": "c2bdb7f270de0f3dce9c57506687d6aec559f8eb13b227d744631b403c35910f" + } + } + }, + "content": { + "body.md": { + "path": "task-debug-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-debug-support.md b/src/inferrsi/knowledge/atoms/task-debug-support.md new file mode 100644 index 000000000..315a18c0d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-debug-support.md @@ -0,0 +1,13 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| The failure resembles a prior trial or appears only with a particular optimization. | `inference-optimization-casebook` | Get the prior failure conditions and retry rule. Test whether the same switch reproduces the signature on this target. | +| Ascend timing or device behavior changed after a killed job or card-group change. | `ascend-device-health` | Collect device health, occupancy and timing checks. Establish a clean matched control before blaming the engine. | +| A vLLM V1 request stalls during asynchronous KV transfer, preemption or block reuse. | `audit-vllm-kv-lifetimes` | Build the scheduler/connector ownership trace. Probe the earliest missing completion or block-release edge. | +| A CUDA AFD dense FFN P2P exchange hangs or returns the wrong slice. | `audit-afd-p2p-exchanges` | Build the rank and per-peer payload ledger. Check the first mismatched assignment against caller traces before testing transport. | + diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.json b/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.json new file mode 100644 index 000000000..522a1ed57 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-derived-engine-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-derived-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "byte_range": [ + 4145, + 4606 + ], + "sha256": "7f38bd547e9f51601c7f064ff11eb3637e9cbc1096a3d6f9343555ee038efb4d" + } + } + }, + "content": { + "body.md": { + "path": "task-derived-engine-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.md b/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.md new file mode 100644 index 000000000..2073d07eb --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when the inherited-path checks pass, the intended delta is demonstrated by a distinct test, and both are reproducible on the named target under the user's gates. If both paths regress, isolate the first common initialization or dispatch boundary before changing the extension. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-condition.json b/src/inferrsi/knowledge/atoms/task-derived-engine-condition.json new file mode 100644 index 000000000..896b0caa8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-derived-engine-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "The deliverable reuses the execution core of vLLM, vLLM-Omni or another pinned parent, as in a DeepInfer-like extension.", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/derived-engine.json", + "sha256": "3ab030bcd04db76781d20dccb27b62963b4fd996e05edfb0c38e2680018d8222" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-derived-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/derived-engine.json", + "byte_range": [ + 111, + 231 + ], + "sha256": "ae59e0929772223f890c1b43a0558646fb5df14a5e8b5dc5b52814bdb7d9cfc6" + } + } + }, + "content": { + "body.md": { + "path": "task-derived-engine-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-condition.md b/src/inferrsi/knowledge/atoms/task-derived-engine-condition.md new file mode 100644 index 000000000..1a4a26120 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-condition.md @@ -0,0 +1 @@ +The deliverable reuses the execution core of vLLM, vLLM-Omni or another pinned parent, as in a DeepInfer-like extension. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.json b/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.json new file mode 100644 index 000000000..7a4e73164 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-derived-engine-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Deliver an engine derived from a pinned parent", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "byte_range": [ + 1374, + 1424 + ], + "sha256": "e4a4488b15b00f3ba3f8510f240b5eca8117ee76fb9233ff40495eb37284ab7a" + } + } + }, + "content": { + "body.md": { + "path": "task-derived-engine-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.md b/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.md new file mode 100644 index 000000000..9445e8bbf --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-navigation.md @@ -0,0 +1,2 @@ +# Deliver an engine derived from a pinned parent + diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.json b/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.json new file mode 100644 index 000000000..9ed56c379 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-derived-engine-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-derived-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "byte_range": [ + 1926, + 2784 + ], + "sha256": "8bd14385d000cf2e03e9220bf833b44a5ab30bf87522e4407c7df0033696da75" + } + } + }, + "content": { + "body.md": { + "path": "task-derived-engine-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.md b/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.md new file mode 100644 index 000000000..e53c66ab7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Pin the parent repository, revision, build and known-good run. Identify inherited modules and the fork-owned seam. State what API, model behavior and state ownership must be preserved and what observable behavior should change. +2. Run the actual model, script and flags on the parent. Capture outputs, state transitions and benchmark results. Build the smallest fork slice at the chosen seam on the same target. +3. Run a matched inherited-path check with the extension disabled or bypassed where supported. Run a separate case that exercises the intended delta. At the first mismatch, replay the same input at the parent/fork boundary before extending the change. +4. Repeat end to end with the user's flags and acceptance workload. Report inherited-path regressions, delta behavior, and performance or memory trade-offs separately. + diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-route-card.json b/src/inferrsi/knowledge/atoms/task-derived-engine-route-card.json new file mode 100644 index 000000000..58f9500e4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-derived-engine-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Build an engine derived from an existing runtime", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/derived-engine.json", + "sha256": "3ab030bcd04db76781d20dccb27b62963b4fd996e05edfb0c38e2680018d8222" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-derived-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/derived-engine.json", + "byte_range": [ + 0, + 983 + ], + "sha256": "3ab030bcd04db76781d20dccb27b62963b4fd996e05edfb0c38e2680018d8222" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"derived-engine\",\n \"title\": \"Build an engine derived from an existing runtime\",\n \"choose_when\": \"The deliverable reuses the execution core of vLLM, vLLM-Omni or another pinned parent, as in a DeepInfer-like extension.\",\n \"required_inputs\": [\n \"parent repository, revision and retained modules\",\n \"delta in model or scheduling contract\",\n \"target hardware and workload\",\n \"reference parent behavior\"\n ],\n \"steps\": [\n \"Identify inherited execution paths and replacement seams.\",\n \"Define compatibility for configuration, responses and state ownership.\",\n \"Compare outputs and performance to the pinned parent on the same inputs.\"\n ],\n \"acceptance_evidence\": \"A runnable derived-engine slice, a parent-versus-fork delta and reproducible parity/benchmark results.\",\n \"candidate_skill_ids\": [\n \"repository-evolution-analysis\",\n \"bound-windowed-attention-replay\",\n \"budget-speculative-verification\",\n \"inference-benchmark-design\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-support.json b/src/inferrsi/knowledge/atoms/task-derived-engine-support.json new file mode 100644 index 000000000..efea34987 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-derived-engine-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-derived-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "byte_range": [ + 2784, + 4145 + ], + "sha256": "5d2c5ff5e42aac53675b389441ea52e330e9983327710f3baaa0cb9b917efc31" + } + } + }, + "content": { + "body.md": { + "path": "task-derived-engine-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-derived-engine-support.md b/src/inferrsi/knowledge/atoms/task-derived-engine-support.md new file mode 100644 index 000000000..ef1c01666 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-derived-engine-support.md @@ -0,0 +1,13 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| The parent and fork changed the same subsystem at different revisions. | `repository-evolution-analysis` | Locate the inherited contract and divergence point in history. Test the last shared behavior and then the fork-owned change. | +| The fork compacts replay or prefill rows across a windowed-attention state boundary. | `bound-windowed-attention-replay` | Derive the retain/dependency rule. Test at the rollback and window boundaries before accepting the reduced state. | +| The fork changes speculative verification and draft acceptance varies by position. | `budget-speculative-verification` | Obtain a per-position acceptance and cost model. Test the proposed row budget against the parent at matched quality. | +| The new path changes scheduling or outputs and current benchmarks exercise only parent behavior. | `inference-benchmark-design` | Define matched controls and a delta-exercising workload. Run both on the same device before accepting the fork. | + diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.json b/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.json new file mode 100644 index 000000000..37726fdb1 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-independent-engine-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-independent-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "byte_range": [ + 4562, + 5045 + ], + "sha256": "56242f0b13a89c715d167aa0d949973daa3e171488f32215a77e18c2878b4ad9" + } + } + }, + "content": { + "body.md": { + "path": "task-independent-engine-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.md b/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.md new file mode 100644 index 000000000..4849c6b1d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when a target-native end-to-end run meets the agreed correctness and resource gates, with native dispatch or permitted fallback accounted for. If a backend or device is unavailable, record the missing access and propose the first on-target operator or allocation check that can resolve the blocker. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-condition.json b/src/inferrsi/knowledge/atoms/task-independent-engine-condition.json new file mode 100644 index 000000000..53f9e0e13 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-independent-engine-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "A new runtime must own execution, memory and device integration on a distinct OS, model or hardware stack.", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/independent-engine.json", + "sha256": "f2208c40871306fe4be21f84a099c551013eda26e55bff02d95ba60739b8fade" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-independent-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/independent-engine.json", + "byte_range": [ + 104, + 210 + ], + "sha256": "daf5fcb41433a998b84025c14d4f508f8ab1d4c3081d58d6da89e3df4216f3e0" + } + } + }, + "content": { + "body.md": { + "path": "task-independent-engine-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-condition.md b/src/inferrsi/knowledge/atoms/task-independent-engine-condition.md new file mode 100644 index 000000000..28f11113b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-condition.md @@ -0,0 +1 @@ +A new runtime must own execution, memory and device integration on a distinct OS, model or hardware stack. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.json b/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.json new file mode 100644 index 000000000..c23286632 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-independent-engine-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Bring up an independent inference engine", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "byte_range": [ + 1394, + 1438 + ], + "sha256": "30a63c2292a8b5bc46f4f94bdbcfcd7b745f87e083ad5cb2d04c2f6679ec4bbb" + } + } + }, + "content": { + "body.md": { + "path": "task-independent-engine-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.md b/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.md new file mode 100644 index 000000000..cad12cdca --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-navigation.md @@ -0,0 +1,2 @@ +# Bring up an independent inference engine + diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.json b/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.json new file mode 100644 index 000000000..19e5bdb56 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-independent-engine-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-independent-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "byte_range": [ + 1940, + 2926 + ], + "sha256": "0cc92998bb971b6efadb26abb5ad8e0fc8bb509faffe8e3ccf6ccbf126a03f59" + } + } + }, + "content": { + "body.md": { + "path": "task-independent-engine-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.md b/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.md new file mode 100644 index 000000000..61fe7cfa9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Pin model format, reference inputs and outputs, target OS/ABI, device/driver, available runtime APIs and resource limits. Map required operators, dtypes, layouts and memory lifetimes to target capabilities. Mark fallback, missing implementations and unverified capabilities. +2. On the actual target, load the model and run one reference-checked operator with a dispatch trace. Extend to the shortest connected path that produces an output. Test the first missing operator or allocation boundary before expanding coverage. +3. Run the complete input through preprocessing, execution and postprocessing. Verify device placement or any explicitly permitted fallback. Exercise repeated requests and teardown to expose ownership or retained-memory errors. +4. Replay the user's script on the target OS/device. Check end-to-end output, resident or peak memory, cold/warm behavior and the user-specified resource gates. Record unsupported operators and model features. + diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-route-card.json b/src/inferrsi/knowledge/atoms/task-independent-engine-route-card.json new file mode 100644 index 000000000..daeccaea3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-independent-engine-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Build an independent inference engine", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/independent-engine.json", + "sha256": "f2208c40871306fe4be21f84a099c551013eda26e55bff02d95ba60739b8fade" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-independent-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/independent-engine.json", + "byte_range": [ + 0, + 960 + ], + "sha256": "f2208c40871306fe4be21f84a099c551013eda26e55bff02d95ba60739b8fade" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"independent-engine\",\n \"title\": \"Build an independent inference engine\",\n \"choose_when\": \"A new runtime must own execution, memory and device integration on a distinct OS, model or hardware stack.\",\n \"required_inputs\": [\n \"target OS and device\",\n \"runtime API and driver/toolchain availability\",\n \"model format and memory budget\",\n \"reference inputs and expected outputs\"\n ],\n \"steps\": [\n \"Prove model loading and one operation on the target device.\",\n \"Complete one end-to-end output, including fallback and lifecycle checks.\",\n \"Measure resident memory, correctness and cold/warm behavior on the actual OS and hardware.\"\n ],\n \"acceptance_evidence\": \"An independently runnable target-native engine, adapter boundaries and target-device validation results.\",\n \"candidate_skill_ids\": [\n \"mlc-llm\",\n \"local-dream\",\n \"audit-llama-runtime-state\",\n \"os-process-placement\",\n \"inference-benchmark-design\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-support.json b/src/inferrsi/knowledge/atoms/task-independent-engine-support.json new file mode 100644 index 000000000..9c0947d34 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-independent-engine-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-independent-engine" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "byte_range": [ + 2926, + 4562 + ], + "sha256": "f7f9b7e1ffd58a91749581415f9f2be874d90498d14f6afbc2ab72b9dddbd389" + } + } + }, + "content": { + "body.md": { + "path": "task-independent-engine-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-independent-engine-support.md b/src/inferrsi/knowledge/atoms/task-independent-engine-support.md new file mode 100644 index 000000000..918b67a79 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-independent-engine-support.md @@ -0,0 +1,14 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| An MLC-derived artifact, Metal dispatch or KV-capacity estimate is relevant to the proposed target. | `mlc-llm` | Obtain the pinned artifact/runtime contract and native discriminator. Verify the operator or allocation locally before using it as target evidence. | +| An Android diffusion path exhibits a process, DiT packaging, ABI or backend mismatch. | `local-dream` | Get the declared-versus-serving state trace. Run the minimal packaged path on the named Android device and verify dispatch. | +| A repeated request retains state and the design uses a llama.cpp-compatible context. | `audit-llama-runtime-state` | Obtain a state ownership ledger. Probe the earliest unmatched allocation, progress or release event on the target runtime. | +| Timings vary on a shared host and CPU affinity or accelerator contention is observable. | `os-process-placement` | Record supported placement, occupancy and thread controls. Repeat the workload under matched conditions using target-native tooling. | +| The engine runs end to end but quality, cold/warm timings or the resource envelope are undefined. | `inference-benchmark-design` | Define reference checks and a target workload. Collect quality and resource measurements on the actual device. | + diff --git a/src/inferrsi/knowledge/atoms/task-performance-acceptance.json b/src/inferrsi/knowledge/atoms/task-performance-acceptance.json new file mode 100644 index 000000000..3c95be80c --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-performance-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-performance" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "byte_range": [ + 4334, + 4809 + ], + "sha256": "f7133ee21b9f8ede1fb9b51171c031d8670108f72eb4756416548a296b1fde09" + } + } + }, + "content": { + "body.md": { + "path": "task-performance-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-acceptance.md b/src/inferrsi/knowledge/atoms/task-performance-acceptance.md new file mode 100644 index 000000000..e05f60ff4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when the selected candidate meets the user's metric and quality criteria on an independent end-to-end replay. If trials disagree, identify a targeted control such as an unchanged repeat to separate run variance from the candidate effect. Retain the best verified baseline if budget expires. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-performance-condition.json b/src/inferrsi/knowledge/atoms/task-performance-condition.json new file mode 100644 index 000000000..4ef0f637f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-performance-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "A correct baseline misses a specified latency, throughput, memory or cost objective.", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/performance.json", + "sha256": "4904e6b403f8390ddc6d11c962491ec42683ec7e29eb4a2be4075bb052bd31fa" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-performance" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/performance.json", + "byte_range": [ + 90, + 174 + ], + "sha256": "7953e915d72f06abc87154db5555b435b7ff0db94d12087321276aaf7379e1ec" + } + } + }, + "content": { + "body.md": { + "path": "task-performance-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-condition.md b/src/inferrsi/knowledge/atoms/task-performance-condition.md new file mode 100644 index 000000000..4ffa184b4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-condition.md @@ -0,0 +1 @@ +A correct baseline misses a specified latency, throughput, memory or cost objective. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-performance-navigation.json b/src/inferrsi/knowledge/atoms/task-performance-navigation.json new file mode 100644 index 000000000..b8f9d56ed --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-performance-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Optimize a measured inference bottleneck", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "byte_range": [ + 1361, + 1405 + ], + "sha256": "f87804ff7d31dc1ec3d1e4761f88e24a956b684e4c6aa0c653dad0f5336d52b7" + } + } + }, + "content": { + "body.md": { + "path": "task-performance-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-navigation.md b/src/inferrsi/knowledge/atoms/task-performance-navigation.md new file mode 100644 index 000000000..0f3da3c5e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-navigation.md @@ -0,0 +1,2 @@ +# Optimize a measured inference bottleneck + diff --git a/src/inferrsi/knowledge/atoms/task-performance-procedure.json b/src/inferrsi/knowledge/atoms/task-performance-procedure.json new file mode 100644 index 000000000..1ac64bba5 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-performance-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-performance" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "byte_range": [ + 1907, + 2941 + ], + "sha256": "8b18e4f7ac481d8fd70c7d27416cf73a74a8151fb137eda22a6a28927772260b" + } + } + }, + "content": { + "body.md": { + "path": "task-performance-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-procedure.md b/src/inferrsi/knowledge/atoms/task-performance-procedure.md new file mode 100644 index 000000000..ad19a4dbc --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Replay the supplied benchmark unchanged. Pin requests, shape/batch mix, concurrency, warmup, timing boundary, repetitions, aggregation rule and quality oracle. Capture the baseline distribution and end-to-end output on the actual engine and device. +2. Profile the stage dominating the target metric. Separate queueing, prefill, decode, transfer or modality generation where observable. Estimate how much changing that stage can move the end-to-end metric. +3. Choose one change inside the allowed search space whose mechanism matches the measured bottleneck and the installed hardware/engine. Record the predicted profile signature. Alternate unchanged baseline and candidate trials with the same workload, quality evaluation and resource conditions. +4. After each change, compare the target metric, uncertainty and quality gate. Restore the incumbent if quality fails or the benefit is indistinguishable. Re-profile when the bottleneck moves. Recheck the selected change end to end with the original script. + diff --git a/src/inferrsi/knowledge/atoms/task-performance-route-card.json b/src/inferrsi/knowledge/atoms/task-performance-route-card.json new file mode 100644 index 000000000..98e0e67fe --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-performance-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Optimize inference performance", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/performance.json", + "sha256": "4904e6b403f8390ddc6d11c962491ec42683ec7e29eb4a2be4075bb052bd31fa" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-performance" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/performance.json", + "byte_range": [ + 0, + 843 + ], + "sha256": "4904e6b403f8390ddc6d11c962491ec42683ec7e29eb4a2be4075bb052bd31fa" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"performance\",\n \"title\": \"Optimize inference performance\",\n \"choose_when\": \"A correct baseline misses a specified latency, throughput, memory or cost objective.\",\n \"required_inputs\": [\n \"fixed workload, quality oracle and baseline\",\n \"target metric and budget\",\n \"device and concurrency\",\n \"phase timings or profile\"\n ],\n \"steps\": [\n \"Pin the workload and verify baseline quality.\",\n \"Locate the limiting stage and estimate headroom.\",\n \"Measure candidates against the same control and report end-to-end trade-offs.\"\n ],\n \"acceptance_evidence\": \"Paired measurements with the quality gate, uncertainty and workload conditions.\",\n \"candidate_skill_ids\": [\n \"inference-benchmark-design\",\n \"performance-ceiling-analysis\",\n \"optimization-search-policy\",\n \"inference-optimization-casebook\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-support.json b/src/inferrsi/knowledge/atoms/task-performance-support.json new file mode 100644 index 000000000..379ea6983 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-performance-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-performance" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "byte_range": [ + 2941, + 4334 + ], + "sha256": "6c3cdd804106a70c67ad2c33f54624231f4d03428ff43892064c99e29b6c98b6" + } + } + }, + "content": { + "body.md": { + "path": "task-performance-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-performance-support.md b/src/inferrsi/knowledge/atoms/task-performance-support.md new file mode 100644 index 000000000..d21753a5e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-performance-support.md @@ -0,0 +1,13 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| The supplied benchmark lacks an agreed workload boundary or modality quality oracle. | `inference-benchmark-design` | Obtain a workload and parity protocol. Resolve the missing gate and measure the baseline before comparing candidates. | +| A slow stage is visible but its contribution to the requested metric is unclear. | `performance-ceiling-analysis` | Estimate stage share and achievable headroom. Profile the next limiting stage if even eliminating this one cannot meet the target. | +| Several legal changes could address the profiled limit. | `optimization-search-policy` | Obtain a ranked shortlist with mechanisms, expected signals and cost. Test one bounded candidate, then retain or revert it using the paired evidence. | +| A prior trial appears to match the bottleneck or an earlier candidate failed. | `inference-optimization-casebook` | Retrieve the prior workload, decision and retry condition. Reuse its hypothesis only after comparing target conditions and retest on this run. | + diff --git a/src/inferrsi/knowledge/atoms/task-router-conditions.json b/src/inferrsi/knowledge/atoms/task-router-conditions.json new file mode 100644 index 000000000..775e4898e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-conditions.json @@ -0,0 +1,53 @@ +{ + "metadata": { + "id": "task-router-conditions", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Target conditions", + "state": "candidate", + "applicability": { + "scope": "Classifying an inference engineering request and identifying reusable procedures.", + "input_contract": "Goal, deliverable, known model, backend, OS, engine and workload constraints.", + "produced_artifact": "Selected task cards, scoped references, unknowns and acceptance evidence.", + "refusal_point": "If the execution owner, reference behavior or target compatibility is unknown, record the gap before making a target-specific recommendation." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "sha256": "3dae791f61b26810332e05fbabe6fd7113abf9ed8609aef663535a267525849c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "byte_range": [ + 3169, + 4746 + ], + "sha256": "ba86dd5d3143dd483a217e4a27d2d0acf78d047cfa12cb9a77fa39ebf8234e79" + } + } + }, + "content": { + "body.md": { + "path": "task-router-conditions.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-router-conditions.md b/src/inferrsi/knowledge/atoms/task-router-conditions.md new file mode 100644 index 000000000..c1b7f37d7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-conditions.md @@ -0,0 +1,26 @@ +## Target conditions + +Record model family as a list (LLM, Omni, TTS, Diffusion, RLT or another +specified family), model/checkpoint revision, hardware backend (CUDA, ROCm, +Ascend NPU, XPU or another specified target), device SKU, OS (Linux, Windows, +Android, iOS or another specified target), engine and revision, dtype, shape, +concurrency and constraints. An Omni pipeline may additionally include its TTS +or diffusion stages. Keep deployment form such as mobile/edge separate from OS. +An absent field is unknown. A routing label or a common-backend registration +does not establish device support. Check the selected owner's source and scope. + +Failures that interrupt execution begin in debug. Correct execution with +unacceptable output begins in accuracy. A regression first observed after an +upgrade may use version-align as the primary route and either as a secondary +route. For engine work, decide who owns the execution core: an upstream fork +uses derived-engine; a new runtime owning its own execution and memory model +uses independent-engine, including on Windows or mobile. OS alone cannot +decide between them. + +For a Windows vLLM fork with a TTS quality regression after an upgrade, +choose accuracy if the requested delivery is restored speech quality, or +version-align if the requested delivery is a validated upgrade matrix. Link +the other route and pin both revisions, the same audio input, and reference +output. Record fork lineage as context unless creating the fork is a deliverable. +If the delivery is unclear, state both routes and ask what must be accepted. + diff --git a/src/inferrsi/knowledge/atoms/task-router-handoff.json b/src/inferrsi/knowledge/atoms/task-router-handoff.json new file mode 100644 index 000000000..6a0756068 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-handoff.json @@ -0,0 +1,53 @@ +{ + "metadata": { + "id": "task-router-handoff", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Use and handoff", + "state": "candidate", + "applicability": { + "scope": "Classifying an inference engineering request and identifying reusable procedures.", + "input_contract": "Goal, deliverable, known model, backend, OS, engine and workload constraints.", + "produced_artifact": "Selected task cards, scoped references, unknowns and acceptance evidence.", + "refusal_point": "If the execution owner, reference behavior or target compatibility is unknown, record the gap before making a target-specific recommendation." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "sha256": "3dae791f61b26810332e05fbabe6fd7113abf9ed8609aef663535a267525849c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "byte_range": [ + 4746, + 6199 + ], + "sha256": "de6b8cfd4e7f628c5b53eee85150f9f4e0cb896db7650ef24bab3d0a70ee8215" + } + } + }, + "content": { + "body.md": { + "path": "task-router-handoff.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-router-handoff.md b/src/inferrsi/knowledge/atoms/task-router-handoff.md new file mode 100644 index 000000000..dd97bc8fe --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-handoff.md @@ -0,0 +1,22 @@ +## Use and handoff + +1. Load the selected primary procedure, for example + `inferrsi skills enter task-version-alignment`. The compatibility card for + machine readers is available through + `inferrsi skills resource inference-task-router references/routes/version-align.json`. +2. Capture the actual run as the primary skill directs. Use observed triggers + to choose supporting skills. Search for the named component or symptom with + `inferrsi find`. Resolve candidate skill IDs via `skills show`, read their + applicability, and retain only the source-backed matches. An exact owner + or resource can also be opened directly. If only cross-platform methodology + matches, return it as such, and list the missing target-specific evidence. +3. Record primary and secondary tasks, target conditions, fixed source references, + gaps and acceptance evidence. A candidate skill is a starting point for + inspection. Execution and promotion require the normal workbench contracts. + +The cards contain seed IDs. For each affected stage and component, search the +full catalog as well. Report a target-validated owner, a methodological analogue +with its limits, or a missing owner. For a missing Windows/TTS or XPU match, +state the missing evidence and the smallest target check that would establish +it. Keep a general benchmarking procedure available as methodology. A project +policy or an unreviewed learning does not establish runtime compatibility. diff --git a/src/inferrsi/knowledge/atoms/task-router-navigation.json b/src/inferrsi/knowledge/atoms/task-router-navigation.json new file mode 100644 index 000000000..e7dd6d505 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-navigation.json @@ -0,0 +1,53 @@ +{ + "metadata": { + "id": "task-router-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Choose an inference task", + "state": "candidate", + "applicability": { + "scope": "Classifying an inference engineering request and identifying reusable procedures.", + "input_contract": "Goal, deliverable, known model, backend, OS, engine and workload constraints.", + "produced_artifact": "Selected task cards, scoped references, unknowns and acceptance evidence.", + "refusal_point": "If the execution owner, reference behavior or target compatibility is unknown, record the gap before making a target-specific recommendation." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "sha256": "3dae791f61b26810332e05fbabe6fd7113abf9ed8609aef663535a267525849c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "byte_range": [ + 1633, + 3169 + ], + "sha256": "669654ec66111fcc6b1faa20f62d051dce73fc4c925d7aa8ce5999c7c161732a" + } + } + }, + "content": { + "body.md": { + "path": "task-router-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-router-navigation.md b/src/inferrsi/knowledge/atoms/task-router-navigation.md new file mode 100644 index 000000000..352e5ff76 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-router-navigation.md @@ -0,0 +1,16 @@ +# Choose an inference task + +Choose one primary skill by the requested deliverable. Load its full procedure +before the first supporting evidence search. Record secondary tasks for follow-up. +The route cards remain available to callers that consume the JSON summaries. + +| Primary skill | Choose it when | Route card | +| --- | --- | --- | +| `task-day-0` | First usable support for a new checkpoint or model architecture in an existing engine. | [day0-model](references/routes/day0-model.json) | +| `task-performance` | A correct baseline misses a specified latency, throughput, memory or cost objective. | [performance](references/routes/performance.json) | +| `task-debug` | A hang, crash, OOM or execution-path failure needs a reproducible cause. | [debug](references/routes/debug.json) | +| `task-accuracy` | Inference completes but output violates a reference, quality metric or tolerance. | [accuracy](references/routes/accuracy.json) | +| `task-version-alignment` | A dependency or engine upgrade must preserve API, ABI, operator or runtime behavior across a stack. | [version-align](references/routes/version-align.json) | +| `task-derived-engine` | The deliverable reuses the execution core of vLLM, vLLM-Omni or another pinned parent, as in a DeepInfer-like extension. | [derived-engine](references/routes/derived-engine.json) | +| `task-independent-engine` | A new runtime must own execution, memory and device integration on a distinct OS, model or hardware stack. | [independent-engine](references/routes/independent-engine.json) | + diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.json b/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.json new file mode 100644 index 000000000..3d8d4aa38 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-version-alignment-acceptance", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Acceptance and handoff", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-version-alignment" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "byte_range": [ + 4122, + 4568 + ], + "sha256": "a3fce65c489abb8e198f996aa291e9b26c5457cf916e785cdb8ff354b1236ed1" + } + } + }, + "content": { + "body.md": { + "path": "task-version-alignment-acceptance.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.md b/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.md new file mode 100644 index 000000000..26b56141f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-acceptance.md @@ -0,0 +1,5 @@ +## Acceptance and handoff + +Finish when the requested target combination passes the user's original workload and gates, the changed boundary is documented, and the rollback point is verified. If only a coupled upgrade fails, state the next API or dispatch check that separates the two components. +If the allowed search space or budget is exhausted, record the blocker, the +evidence already obtained and the smallest remaining discriminating test. diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-condition.json b/src/inferrsi/knowledge/atoms/task-version-alignment-condition.json new file mode 100644 index 000000000..bbe399ba2 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-condition.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-version-alignment-condition", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "A dependency or engine upgrade must preserve API, ABI, operator or runtime behavior across a stack.", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/version-align.json", + "sha256": "4243e305578e50ddc88bf4465447e716bbe9d22e4a0122189ad58a50e2267bf1" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-version-alignment" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/version-align.json", + "byte_range": [ + 95, + 194 + ], + "sha256": "091d18f3b17c56be2f97f5a025641366891f341253febe9f3d602dd5d68237b8" + } + } + }, + "content": { + "body.md": { + "path": "task-version-alignment-condition.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-condition.md b/src/inferrsi/knowledge/atoms/task-version-alignment-condition.md new file mode 100644 index 000000000..1b8738959 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-condition.md @@ -0,0 +1 @@ +A dependency or engine upgrade must preserve API, ABI, operator or runtime behavior across a stack. \ No newline at end of file diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.json b/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.json new file mode 100644 index 000000000..555fa2adf --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.json @@ -0,0 +1,51 @@ +{ + "metadata": { + "id": "task-version-alignment-navigation", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Validate an engine or plugin stack upgrade", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L0", + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "byte_range": [ + 1378, + 1424 + ], + "sha256": "4c15a2b480fe5f480177f8b5fb8e2255cf0f106ca50844c154aa9ba264003be5" + } + } + }, + "content": { + "body.md": { + "path": "task-version-alignment-navigation.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.md b/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.md new file mode 100644 index 000000000..1b5d39b7f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-navigation.md @@ -0,0 +1,2 @@ +# Validate an engine or plugin stack upgrade + diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.json b/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.json new file mode 100644 index 000000000..cda7e91fd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-version-alignment-procedure", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Run the procedure", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L2", + "when": { + "task": [ + "task-version-alignment" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "byte_range": [ + 1926, + 2805 + ], + "sha256": "accfd8bc951d16a6cccbe80b511e7bb6b2f774ee2a3e2bba9b4d3e87e308c5d6" + } + } + }, + "content": { + "body.md": { + "path": "task-version-alignment-procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.md b/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.md new file mode 100644 index 000000000..944532c23 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-procedure.md @@ -0,0 +1,7 @@ +## Run the procedure + +1. Inventory the known-good and requested versions of the engine, plugin, operator library, backend and driver. Include vLLM, vLLM-Omni, vLLM-Ascend and AFD Plugin where used. Keep build options, model, device and run script constant. +2. Replay the known-good and complete target stacks on the same workload. Record import/build, operator dispatch, integration and output/parity results for each supported combination. +3. Change one compatible dependency boundary at a time, or bisect a coupled pair when the components must travel together. Record unbuildable combinations explicitly. Compare effective APIs, ABI, flags and dispatch at the earliest failing step. +4. Apply the smallest in-scope pin or adapter, replay the complete target stack, and verify the rollback combination with the same script and quality/performance checks requested by the user. + diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-route-card.json b/src/inferrsi/knowledge/atoms/task-version-alignment-route-card.json new file mode 100644 index 000000000..f09817af8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-route-card.json @@ -0,0 +1,57 @@ +{ + "metadata": { + "id": "task-version-alignment-route-card", + "kind": "knowledge", + "entrypoint": "body.json", + "title": "Align engine and plugin revisions", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/version-align.json", + "sha256": "4243e305578e50ddc88bf4465447e716bbe9d22e4a0122189ad58a50e2267bf1" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L3", + "when": { + "task": [ + "task-version-alignment" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/references/routes/version-align.json", + "byte_range": [ + 0, + 919 + ], + "sha256": "4243e305578e50ddc88bf4465447e716bbe9d22e4a0122189ad58a50e2267bf1" + } + } + }, + "content": { + "body.json": { + "text": "{\n \"task\": \"version-align\",\n \"title\": \"Align engine and plugin revisions\",\n \"choose_when\": \"A dependency or engine upgrade must preserve API, ABI, operator or runtime behavior across a stack.\",\n \"required_inputs\": [\n \"current and target revisions for each component\",\n \"compatibility or ABI contracts\",\n \"known-good configuration\",\n \"affected integration tests\"\n ],\n \"steps\": [\n \"Build a before/after matrix for vLLM, vLLM-Omni, vLLM-Ascend and AFD Plugin as applicable.\",\n \"Change one boundary at a time; record required pins or adaptations.\",\n \"Run import, operator, integration and parity checks for the requested combination.\"\n ],\n \"acceptance_evidence\": \"A pinned compatibility matrix, failing and passing combinations, and a rollback point.\",\n \"candidate_skill_ids\": [\n \"repository-evolution-analysis\",\n \"vllm-ascend\",\n \"audit-afd-p2p-exchanges\",\n \"claim-contract\"\n ]\n}\n" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-support.json b/src/inferrsi/knowledge/atoms/task-version-alignment-support.json new file mode 100644 index 000000000..392e97af0 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-support.json @@ -0,0 +1,55 @@ +{ + "metadata": { + "id": "task-version-alignment-support", + "kind": "knowledge", + "entrypoint": "body.md", + "title": "Select supporting skills from observed evidence", + "state": "candidate", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "atom": { + "layer": "L1", + "when": { + "task": [ + "task-version-alignment" + ] + }, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "byte_range": [ + 2805, + 4122 + ], + "sha256": "cdd7c6f9caecd1e6b5f8d1ae12457f012ac526ed828a83b8982181a9bff222b8" + } + } + }, + "content": { + "body.md": { + "path": "task-version-alignment-support.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/task-version-alignment-support.md b/src/inferrsi/knowledge/atoms/task-version-alignment-support.md new file mode 100644 index 000000000..235aaa987 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/task-version-alignment-support.md @@ -0,0 +1,13 @@ +## Select supporting skills from observed evidence + +Load the skill whose trigger is observed. Check its revision, prerequisites and +scope before using its output. If none fits, search the observed component and +symptom, then verify any result against the actual model, engine, OS and device. + +| Observation in this run | Load skill ID | Returned evidence and next decision | +| --- | --- | --- | +| Several upstream revisions changed a boundary and the first incompatible change is unknown. | `repository-evolution-analysis` | Trace the history to a candidate transition. Run the same contract test immediately before and after it. | +| The changed component is vLLM-Ascend and its release, role or effective dispatch differs. | `vllm-ascend` | Get the version-specific dispatch and first failing boundary. Verify applicability against the installed stack before choosing a pin or adapter. | +| An AFD Plugin upgrade changes a CUDA P2P rank map or per-peer split. | `audit-afd-p2p-exchanges` | Compare the old and new payload ledgers. Test the first changed rank or slice with the same worker configuration. | +| A release claim spans combinations with missing hardware or parity evidence. | `claim-contract` | Map each tested combination to its gates. Publish the observed matrix and retain untested cells as unknown. | + diff --git a/src/inferrsi/knowledge/compositions/inference-task-router-header.yaml b/src/inferrsi/knowledge/compositions/inference-task-router-header.yaml new file mode 100644 index 000000000..53d4d07e0 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/inference-task-router-header.yaml @@ -0,0 +1,41 @@ +--- +name: inference-task-router +description: Select the starting route for day-0 model support, inference performance optimization, debugging, accuracy repair, version alignment, derived-engine development or independent runtime bring-up. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "task-routing", + "model-onboarding", + "performance", + "debugging", + "accuracy", + "version-alignment", + "inference-engine", + "day-0", + "cross-platform" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "This entry selects a task and its evidence requirements before resource-layer analysis.", + "applicability": { + "scope": "Classifying an inference engineering request and identifying reusable procedures.", + "input_contract": "Goal, deliverable, known model, backend, OS, engine and workload constraints.", + "produced_artifact": "Selected task cards, scoped references, unknowns and acceptance evidence.", + "refusal_point": "If the execution owner, reference behavior or target compatibility is unknown, record the gap before making a target-specific recommendation." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/inference-task-router.json b/src/inferrsi/knowledge/compositions/inference-task-router.json new file mode 100644 index 000000000..ef8b75861 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/inference-task-router.json @@ -0,0 +1,309 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.inference_task_router", + "kind": "skill", + "title": "inference-task-router", + "summary": "Select the starting route for day-0 model support, inference performance optimization, debugging, accuracy repair, version alignment, derived-engine development or independent runtime bring-up.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/inference-task-router/SKILL.md", + "sha256": "3dae791f61b26810332e05fbabe6fd7113abf9ed8609aef663535a267525849c" + } + ], + "applicability": { + "scope": "Classifying an inference engineering request and identifying reusable procedures.", + "input_contract": "Goal, deliverable, known model, backend, OS, engine and workload constraints.", + "produced_artifact": "Selected task cards, scoped references, unknowns and acceptance evidence.", + "refusal_point": "If the execution owner, reference behavior or target compatibility is unknown, record the gap before making a target-specific recommendation." + }, + "limitations": [ + "The cards describe routes and acceptance evidence; hardware support and task success require separate validation." + ], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-router-navigation", + "revision": "sha256:746b1f751d06ad9dff1d5ccb555f9d107afad35063f8d3898733cd98dddf0e35" + }, + "conditions": { + "ref": "package:task-router-conditions", + "revision": "sha256:878149de5dfd147b1e3cbcdf1eefd384af195da2d19d929f22176428ea2a230a" + }, + "handoff": { + "ref": "package:task-router-handoff", + "revision": "sha256:d7682430d2a5ac15bde08d753a4b5138cb888b5aac28f236c78b9bb7b3028a24", + "requires": [ + "conditions" + ] + }, + "task-accuracy-condition": { + "ref": "package:task-accuracy-condition", + "revision": "sha256:f3379e53e78e4f00e0706f3eac90dd94ebe618ab28cca6fdf55f7fceb14b0b51" + }, + "task-accuracy-route-card": { + "ref": "package:task-accuracy-route-card", + "revision": "sha256:473013fb5d39462fe6ba92cb820c9a32a9de3c9d69e761a3a940f13e8af68d97" + }, + "task-day-0-condition": { + "ref": "package:task-day-0-condition", + "revision": "sha256:ce562871c48dcc73b7ea944be3386a5dc2423ecd06f4a8e3d1e22f2a6e00b1ef" + }, + "task-day-0-route-card": { + "ref": "package:task-day-0-route-card", + "revision": "sha256:7dc5d7e17c95c37ab987161f5b735d2569c38b913f64d78644bb90280268d6c2" + }, + "task-debug-condition": { + "ref": "package:task-debug-condition", + "revision": "sha256:4d3371dedc197b02ad6e75cd1272934b7a49d9bb7dd7fac56a267dc17fa02382" + }, + "task-debug-route-card": { + "ref": "package:task-debug-route-card", + "revision": "sha256:b652dd060d2d299cdddea9da46279ff768c8bd729daf56cdce4b712a5c1e2928" + }, + "task-derived-engine-condition": { + "ref": "package:task-derived-engine-condition", + "revision": "sha256:a6fe8ec011c12d15027c46c02b440166faf4045624a6e36ddf5728caea0e7d3b" + }, + "task-derived-engine-route-card": { + "ref": "package:task-derived-engine-route-card", + "revision": "sha256:4b1b39c1c83cccbc43b1dc8b7cb8fed5907ee3c55db13560928a61317e6c8441" + }, + "task-independent-engine-condition": { + "ref": "package:task-independent-engine-condition", + "revision": "sha256:8edb2bb5e3d2ddb933da296654dd3af59be165b61f3095aaeec94b77a2fd3075" + }, + "task-independent-engine-route-card": { + "ref": "package:task-independent-engine-route-card", + "revision": "sha256:21c6a577e796942cb7364015feb56f1d577fd8589c189dab22112d91b4aff396" + }, + "task-performance-condition": { + "ref": "package:task-performance-condition", + "revision": "sha256:de1ad1bfae3b28693dd2662ca096a3568036f440f85ed227b38c8ee82c132ba5" + }, + "task-performance-route-card": { + "ref": "package:task-performance-route-card", + "revision": "sha256:52cd3166acddb7536dd74461fbf3157541ac8ccbfd61e2ce3cb8b2a2e8748674" + }, + "task-version-alignment-condition": { + "ref": "package:task-version-alignment-condition", + "revision": "sha256:ab0001edd9e56701f050f7f9761c683918b1319849ea6acacfac4ad1c263ea67" + }, + "task-version-alignment-route-card": { + "ref": "package:task-version-alignment-route-card", + "revision": "sha256:53f87fd923168f6ad65a49da91af8eed6788c8f1fae2605d2f2254999b53e331" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "conditions": { + "layer": "L1", + "required": [ + "conditions" + ] + }, + "handoff": { + "layer": "L2", + "required": [ + "handoff" + ] + }, + "task-accuracy-condition": { + "layer": "L1", + "required": [ + "task-accuracy-condition" + ], + "when": { + "task": [ + "task-accuracy" + ] + } + }, + "task-accuracy-route-card": { + "layer": "L3", + "required": [ + "task-accuracy-route-card" + ], + "when": { + "task": [ + "task-accuracy" + ] + } + }, + "task-day-0-condition": { + "layer": "L1", + "required": [ + "task-day-0-condition" + ], + "when": { + "task": [ + "task-day-0" + ] + } + }, + "task-day-0-route-card": { + "layer": "L3", + "required": [ + "task-day-0-route-card" + ], + "when": { + "task": [ + "task-day-0" + ] + } + }, + "task-debug-condition": { + "layer": "L1", + "required": [ + "task-debug-condition" + ], + "when": { + "task": [ + "task-debug" + ] + } + }, + "task-debug-route-card": { + "layer": "L3", + "required": [ + "task-debug-route-card" + ], + "when": { + "task": [ + "task-debug" + ] + } + }, + "task-derived-engine-condition": { + "layer": "L1", + "required": [ + "task-derived-engine-condition" + ], + "when": { + "task": [ + "task-derived-engine" + ] + } + }, + "task-derived-engine-route-card": { + "layer": "L3", + "required": [ + "task-derived-engine-route-card" + ], + "when": { + "task": [ + "task-derived-engine" + ] + } + }, + "task-independent-engine-condition": { + "layer": "L1", + "required": [ + "task-independent-engine-condition" + ], + "when": { + "task": [ + "task-independent-engine" + ] + } + }, + "task-independent-engine-route-card": { + "layer": "L3", + "required": [ + "task-independent-engine-route-card" + ], + "when": { + "task": [ + "task-independent-engine" + ] + } + }, + "task-performance-condition": { + "layer": "L1", + "required": [ + "task-performance-condition" + ], + "when": { + "task": [ + "task-performance" + ] + } + }, + "task-performance-route-card": { + "layer": "L3", + "required": [ + "task-performance-route-card" + ], + "when": { + "task": [ + "task-performance" + ] + } + }, + "task-version-alignment-condition": { + "layer": "L1", + "required": [ + "task-version-alignment-condition" + ], + "when": { + "task": [ + "task-version-alignment" + ] + } + }, + "task-version-alignment-route-card": { + "layer": "L3", + "required": [ + "task-version-alignment-route-card" + ], + "when": { + "task": [ + "task-version-alignment" + ] + } + } + }, + "skill": { + "name": "inference-task-router", + "description": "Select the starting route for day-0 model support, inference performance optimization, debugging, accuracy repair, version alignment, derived-engine development or independent runtime bring-up.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "conditions", + "handoff" + ], + "resources": { + "references/routes/accuracy.json": "task-accuracy-route-card", + "references/routes/day0-model.json": "task-day-0-route-card", + "references/routes/debug.json": "task-debug-route-card", + "references/routes/derived-engine.json": "task-derived-engine-route-card", + "references/routes/independent-engine.json": "task-independent-engine-route-card", + "references/routes/performance.json": "task-performance-route-card", + "references/routes/version-align.json": "task-version-alignment-route-card" + } + } + } + }, + "content": { + "host-header.yaml": { + "path": "inference-task-router-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-accuracy-header.yaml b/src/inferrsi/knowledge/compositions/task-accuracy-header.yaml new file mode 100644 index 000000000..f4ee0fb10 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-accuracy-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-accuracy +description: Use when inference completes but tokens, audio, frames, tensors or a quality metric diverge from a reference. Trace the first divergence and verify end-to-end tolerance. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "accuracy" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-accuracy.json b/src/inferrsi/knowledge/compositions/task-accuracy.json new file mode 100644 index 000000000..d6a39e056 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-accuracy.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_accuracy", + "kind": "skill", + "title": "task-accuracy", + "summary": "Use when inference completes but tokens, audio, frames, tensors or a quality metric diverge from a reference. Trace the first divergence and verify end-to-end tolerance.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-accuracy/SKILL.md", + "sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3" + } + ], + "applicability": { + "scope": "Modality-specific reference parity and accuracy regression repair.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "First-divergence trace, before/after oracle results and held-out end-to-end quality checks.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-accuracy-navigation", + "revision": "sha256:957e4dbd31fc469dd133de54273bee6222958d36904c13994e8804353074939e" + }, + "condition": { + "ref": "package:task-accuracy-condition", + "revision": "sha256:f3379e53e78e4f00e0706f3eac90dd94ebe618ab28cca6fdf55f7fceb14b0b51" + }, + "procedure": { + "ref": "package:task-accuracy-procedure", + "revision": "sha256:996a2d7ff3508718b0d43778b77a8d5c87a7b9c0eb7e9f6c9fdb064b4078212b", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-accuracy-support", + "revision": "sha256:ee260b93bf898e478effc67ae1eb2e9b4c777949db5bdf3e9d7d1346a84db6d9" + }, + "acceptance": { + "ref": "package:task-accuracy-acceptance", + "revision": "sha256:3febd8ca99c151f3e13d329411b52d8fd017cc7875c749dac1e6d29f90e64d0f" + }, + "route-card": { + "ref": "package:task-accuracy-route-card", + "revision": "sha256:473013fb5d39462fe6ba92cb820c9a32a9de3c9d69e761a3a940f13e8af68d97" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-accuracy" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-accuracy" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-accuracy" + ] + } + } + }, + "skill": { + "name": "task-accuracy", + "description": "Use when inference completes but tokens, audio, frames, tensors or a quality metric diverge from a reference. Trace the first divergence and verify end-to-end tolerance.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-accuracy-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-day-0-header.yaml b/src/inferrsi/knowledge/compositions/task-day-0-header.yaml new file mode 100644 index 000000000..3c0422c37 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-day-0-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-day-0 +description: Use for Day-0 onboarding of a new checkpoint or architecture to a named inference engine. Produce a reproducible target run, stage parity evidence and a regression fixture. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "day-0" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-day-0.json b/src/inferrsi/knowledge/compositions/task-day-0.json new file mode 100644 index 000000000..aa5b8535a --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-day-0.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_day_0", + "kind": "skill", + "title": "task-day-0", + "summary": "Use for Day-0 onboarding of a new checkpoint or architecture to a named inference engine. Produce a reproducible target run, stage parity evidence and a regression fixture.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-day-0/SKILL.md", + "sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3" + } + ], + "applicability": { + "scope": "New model support in an existing inference engine.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Per-stage parity report, supported-feature matrix, end-to-end output and replayable regression fixture.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-day-0-navigation", + "revision": "sha256:90a46e63daf878e5c9d86afd3626276ef425efa0ecdb00dfcd5e0f257ddc285b" + }, + "condition": { + "ref": "package:task-day-0-condition", + "revision": "sha256:ce562871c48dcc73b7ea944be3386a5dc2423ecd06f4a8e3d1e22f2a6e00b1ef" + }, + "procedure": { + "ref": "package:task-day-0-procedure", + "revision": "sha256:19d25196b9a8ada22a8d4eee4e62f2cc2e155574b3f74e7da32ad9af98ff1c06", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-day-0-support", + "revision": "sha256:1a2072dbb25d0603f19d5be4a1955d890e7c55b3711f7d6a867242fe8f336e89" + }, + "acceptance": { + "ref": "package:task-day-0-acceptance", + "revision": "sha256:46751e02cef6af11bb9c0d2525a442a69dd9dd35df9fba3693d680e7e7bf4393" + }, + "route-card": { + "ref": "package:task-day-0-route-card", + "revision": "sha256:7dc5d7e17c95c37ab987161f5b735d2569c38b913f64d78644bb90280268d6c2" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-day-0" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-day-0" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-day-0" + ] + } + } + }, + "skill": { + "name": "task-day-0", + "description": "Use for Day-0 onboarding of a new checkpoint or architecture to a named inference engine. Produce a reproducible target run, stage parity evidence and a regression fixture.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-day-0-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-debug-header.yaml b/src/inferrsi/knowledge/compositions/task-debug-header.yaml new file mode 100644 index 000000000..3ba965852 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-debug-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-debug +description: Use for inference crashes, hangs, out-of-memory failures or execution-path errors. Localize the first failing boundary and verify recovery with the original reproducer. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "debug" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-debug.json b/src/inferrsi/knowledge/compositions/task-debug.json new file mode 100644 index 000000000..7e114421f --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-debug.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_debug", + "kind": "skill", + "title": "task-debug", + "summary": "Use for inference crashes, hangs, out-of-memory failures or execution-path errors. Localize the first failing boundary and verify recovery with the original reproducer.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-debug/SKILL.md", + "sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0" + } + ], + "applicability": { + "scope": "Run-specific failure reproduction, fault isolation and regression verification.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Minimal reproducer, passing control, localized cause and verified original-script replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-debug-navigation", + "revision": "sha256:16c9c8fc1632a4afdcbe3c516601160a2e796c49f35a34d3d320ed0a1e279593" + }, + "condition": { + "ref": "package:task-debug-condition", + "revision": "sha256:4d3371dedc197b02ad6e75cd1272934b7a49d9bb7dd7fac56a267dc17fa02382" + }, + "procedure": { + "ref": "package:task-debug-procedure", + "revision": "sha256:9fd1abb1babd13effbbcb8072046dab5ef8638e437d2bf61967ecb5beba1c003", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-debug-support", + "revision": "sha256:9cac09949a3390c458e4d4aecaefdf7d87ce1a93f1f0bcdc7a95536bc56c67bc" + }, + "acceptance": { + "ref": "package:task-debug-acceptance", + "revision": "sha256:6b9d5839c61be95237c0e7fa5ad588b6313b5d201d55a8b18e5ba089a96b2b9d" + }, + "route-card": { + "ref": "package:task-debug-route-card", + "revision": "sha256:b652dd060d2d299cdddea9da46279ff768c8bd729daf56cdce4b712a5c1e2928" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-debug" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-debug" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-debug" + ] + } + } + }, + "skill": { + "name": "task-debug", + "description": "Use for inference crashes, hangs, out-of-memory failures or execution-path errors. Localize the first failing boundary and verify recovery with the original reproducer.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-debug-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-derived-engine-header.yaml b/src/inferrsi/knowledge/compositions/task-derived-engine-header.yaml new file mode 100644 index 000000000..7ee732a53 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-derived-engine-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-derived-engine +description: Use for a fork or extension that retains an upstream inference execution core, including a vLLM or vLLM-Omni derivative. Verify inherited behavior and the intended delta separately. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "derived-engine" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-derived-engine.json b/src/inferrsi/knowledge/compositions/task-derived-engine.json new file mode 100644 index 000000000..3b0d330bc --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-derived-engine.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_derived_engine", + "kind": "skill", + "title": "task-derived-engine", + "summary": "Use for a fork or extension that retains an upstream inference execution core, including a vLLM or vLLM-Omni derivative. Verify inherited behavior and the intended delta separately.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-derived-engine/SKILL.md", + "sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942" + } + ], + "applicability": { + "scope": "Development and qualification of an engine that retains an upstream execution core.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Parent/fork behavior matrix, bounded extension and matched end-to-end results.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-derived-engine-navigation", + "revision": "sha256:d58c43da61a0a5384e5cc520dfcbeed2f68349b654d1b6f250ff0dbb8c53df9c" + }, + "condition": { + "ref": "package:task-derived-engine-condition", + "revision": "sha256:a6fe8ec011c12d15027c46c02b440166faf4045624a6e36ddf5728caea0e7d3b" + }, + "procedure": { + "ref": "package:task-derived-engine-procedure", + "revision": "sha256:3409ccf0b3c572e4a8217800299bad2bbdd03ec69c6255fa8b09f58780cbf6c7", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-derived-engine-support", + "revision": "sha256:72b9ff81e8e92ad3d34f0b71743cd212c51c6baa3c61620aa5be6d037a0ce9a3" + }, + "acceptance": { + "ref": "package:task-derived-engine-acceptance", + "revision": "sha256:fab1a8e59147b399fb0106fc92487325fd0fa1b46b7b7f0593c3dac1b310ec65" + }, + "route-card": { + "ref": "package:task-derived-engine-route-card", + "revision": "sha256:4b1b39c1c83cccbc43b1dc8b7cb8fed5907ee3c55db13560928a61317e6c8441" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-derived-engine" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-derived-engine" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-derived-engine" + ] + } + } + }, + "skill": { + "name": "task-derived-engine", + "description": "Use for a fork or extension that retains an upstream inference execution core, including a vLLM or vLLM-Omni derivative. Verify inherited behavior and the intended delta separately.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-derived-engine-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-independent-engine-header.yaml b/src/inferrsi/knowledge/compositions/task-independent-engine-header.yaml new file mode 100644 index 000000000..7b5fc0a04 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-independent-engine-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-independent-engine +description: Use when the deliverable owns its execution, memory and device integration on a target OS and hardware stack. Prove a native end-to-end path and measure its resource use. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "independent-engine" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-independent-engine.json b/src/inferrsi/knowledge/compositions/task-independent-engine.json new file mode 100644 index 000000000..da6b69966 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-independent-engine.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_independent_engine", + "kind": "skill", + "title": "task-independent-engine", + "summary": "Use when the deliverable owns its execution, memory and device integration on a target OS and hardware stack. Prove a native end-to-end path and measure its resource use.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-independent-engine/SKILL.md", + "sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e" + } + ], + "applicability": { + "scope": "Independent runtime bring-up across OS, model format, device and backend boundaries.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Operator/capability map, minimal native execution path, end-to-end parity and resource measurements.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-independent-engine-navigation", + "revision": "sha256:b42f92e770d83e1bc2391ca348a582ba9edb8d4ad186192c0d9e09b6fdcbe84e" + }, + "condition": { + "ref": "package:task-independent-engine-condition", + "revision": "sha256:8edb2bb5e3d2ddb933da296654dd3af59be165b61f3095aaeec94b77a2fd3075" + }, + "procedure": { + "ref": "package:task-independent-engine-procedure", + "revision": "sha256:93ed0d9ba49a3e7d7162cb2ca6f145928876070f5d4805a6de55e8a1641b2bb4", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-independent-engine-support", + "revision": "sha256:b72982d55a25b5bf279e2611a6d15c0a4e8a6513d8aac0f90dcb428982054294" + }, + "acceptance": { + "ref": "package:task-independent-engine-acceptance", + "revision": "sha256:738e35a44a2df1dff02e0abf4a1460863f943860329800cdfb865e53340260c1" + }, + "route-card": { + "ref": "package:task-independent-engine-route-card", + "revision": "sha256:21c6a577e796942cb7364015feb56f1d577fd8589c189dab22112d91b4aff396" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-independent-engine" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-independent-engine" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-independent-engine" + ] + } + } + }, + "skill": { + "name": "task-independent-engine", + "description": "Use when the deliverable owns its execution, memory and device integration on a target OS and hardware stack. Prove a native end-to-end path and measure its resource use.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-independent-engine-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-performance-header.yaml b/src/inferrsi/knowledge/compositions/task-performance-header.yaml new file mode 100644 index 000000000..c9f0c0904 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-performance-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-performance +description: Use when a correct inference baseline misses a latency, throughput, memory or cost target. Compare compatible changes under the user's workload and quality gate. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "performance" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-performance.json b/src/inferrsi/knowledge/compositions/task-performance.json new file mode 100644 index 000000000..4f09ea6cb --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-performance.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_performance", + "kind": "skill", + "title": "task-performance", + "summary": "Use when a correct inference baseline misses a latency, throughput, memory or cost target. Compare compatible changes under the user's workload and quality gate.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-performance/SKILL.md", + "sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b" + } + ], + "applicability": { + "scope": "Optimization of a specified metric under fixed workload, quality and resource constraints.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Paired baseline/candidate measurements, quality checks, trade-offs and final replay.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-performance-navigation", + "revision": "sha256:fcead58f85b5a7f3b93ecf1600144c8cc4611d2d3d60f3c12588b6e52fcfdbf3" + }, + "condition": { + "ref": "package:task-performance-condition", + "revision": "sha256:de1ad1bfae3b28693dd2662ca096a3568036f440f85ed227b38c8ee82c132ba5" + }, + "procedure": { + "ref": "package:task-performance-procedure", + "revision": "sha256:7b9c4ba29df1feb9d4579b334414ba5e4c07b01ec4506e347e9404c9e6b41bd7", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-performance-support", + "revision": "sha256:7b4953fb421fc66dd3f6e6a151ce10b37e61d3949497903845b866d482891e06" + }, + "acceptance": { + "ref": "package:task-performance-acceptance", + "revision": "sha256:4d5c0df36abb1c3d73e70848587fdeaf6ff9f4a502a9167f17a68a9fbec1a273" + }, + "route-card": { + "ref": "package:task-performance-route-card", + "revision": "sha256:52cd3166acddb7536dd74461fbf3157541ac8ccbfd61e2ce3cb8b2a2e8748674" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-performance" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-performance" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-performance" + ] + } + } + }, + "skill": { + "name": "task-performance", + "description": "Use when a correct inference baseline misses a latency, throughput, memory or cost target. Compare compatible changes under the user's workload and quality gate.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-performance-header.yaml" + } + } +} diff --git a/src/inferrsi/knowledge/compositions/task-version-alignment-header.yaml b/src/inferrsi/knowledge/compositions/task-version-alignment-header.yaml new file mode 100644 index 000000000..651eef994 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-version-alignment-header.yaml @@ -0,0 +1,32 @@ +--- +name: task-version-alignment +description: Use for upgrades spanning inference engines, plugins, drivers or operator libraries. Isolate the incompatible boundary and qualify the requested version combination on the same workload. +metadata: + inferrsi: | + { + "schema_version": 1, + "profile": "local-skill-v1", + "kind": "skill", + "discovery_role": "task-entry", + "status": "candidate", + "origin": [ + "first-party" + ], + "consumption_mode": "packaged", + "tags": [ + "inference-task", + "primary-task", + "version-alignment" + ], + "empirical_validation": "not_run", + "searchspace_not_applicable": "The procedure selects supporting evidence and tests within the caller's declared search space.", + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "provenance_readsets": [] + } +--- + diff --git a/src/inferrsi/knowledge/compositions/task-version-alignment.json b/src/inferrsi/knowledge/compositions/task-version-alignment.json new file mode 100644 index 000000000..a48cbfb19 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/task-version-alignment.json @@ -0,0 +1,133 @@ +{ + "metadata": { + "id": "inferrsi.common.skills.task_version_alignment", + "kind": "skill", + "title": "task-version-alignment", + "summary": "Use for upgrades spanning inference engines, plugins, drivers or operator libraries. Isolate the incompatible boundary and qualify the requested version combination on the same workload.", + "state": "candidate", + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/tasks/task-version-alignment/SKILL.md", + "sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c" + } + ], + "applicability": { + "scope": "Compatibility of explicit working and target version combinations.", + "input_contract": "Actual hardware, model, engine, script and flags, benchmark, acceptance criteria, current diagnosis, permitted changes and budget.", + "produced_artifact": "Version matrix, first incompatible boundary, matched workload checks and rollback point.", + "refusal_point": "Record missing evidence or an exhausted search budget and identify the smallest discriminating test before declaring success." + }, + "limitations": [], + "attribution": "InferRSI contributors", + "empirical_validation": "not_run", + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "package:task-version-alignment-navigation", + "revision": "sha256:aeef4ae92da6cec0d7b09265bf0017c7722dabde239fc7c30db128a052b1ae58" + }, + "condition": { + "ref": "package:task-version-alignment-condition", + "revision": "sha256:ab0001edd9e56701f050f7f9761c683918b1319849ea6acacfac4ad1c263ea67" + }, + "procedure": { + "ref": "package:task-version-alignment-procedure", + "revision": "sha256:4f874d2b33ead344cd135532920f36a787668bd4e6be9ae7419185975219e94e", + "requires": [ + "condition", + "capture" + ] + }, + "support": { + "ref": "package:task-version-alignment-support", + "revision": "sha256:4fdfaf2e503104c418d5db4c75d3a5ed19bb7eb868f8bf9c7cbac6ce0ff2051d" + }, + "acceptance": { + "ref": "package:task-version-alignment-acceptance", + "revision": "sha256:54a2a7a80833f04affc1c7347a2145dd956826cb9bd809ba1c47e5c4e1dda67d" + }, + "route-card": { + "ref": "package:task-version-alignment-route-card", + "revision": "sha256:53f87fd923168f6ad65a49da91af8eed6788c8f1fae2605d2f2254999b53e331" + }, + "capture": { + "ref": "package:task-capture-run", + "revision": "sha256:4568b234dd60323423d75a563cf98236dfabfd8e34da0f04aa11dd552a6d741b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "condition", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-version-alignment" + ] + } + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure", + "support", + "acceptance" + ], + "when": { + "task": [ + "task-version-alignment" + ] + } + }, + "route-card": { + "layer": "L3", + "required": [ + "route-card" + ], + "when": { + "task": [ + "task-version-alignment" + ] + } + } + }, + "skill": { + "name": "task-version-alignment", + "description": "Use for upgrades spanning inference engines, plugins, drivers or operator libraries. Isolate the incompatible boundary and qualify the requested version combination on the same workload.", + "frontmatter": "host-header.yaml", + "body": "navigation", + "sections": [ + "capture", + "procedure", + "support", + "acceptance" + ], + "resources": {} + } + } + }, + "content": { + "host-header.yaml": { + "path": "task-version-alignment-header.yaml" + } + } +} diff --git a/tests/fixtures/atomic-reader/task-domain-v0.3.4.json b/tests/fixtures/atomic-reader/task-domain-v0.3.4.json new file mode 100644 index 000000000..acb3c6371 --- /dev/null +++ b/tests/fixtures/atomic-reader/task-domain-v0.3.4.json @@ -0,0 +1,208 @@ +{ + "release": "v0.3.4", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "wheel_sha256": "9a1015f2c1e1347f46d1ca899d2cb8e32c8279a75e88669b9de1a8c8bda5b6c9", + "entries": { + "task-accuracy": { + "source": "tasks/task-accuracy/SKILL.md", + "original_sha256": "a441eb5565cd39674307f2cc870cb0d8d4c90314bb7df80245162df1dc3d1ae3", + "original_bytes": 4767, + "header_sha256": "0a02fb52d03847f788db18ef7f321b9314626603661855548962c5483bbeb5c1", + "body_sha256": "d69abc5b0decfa559adbb926a48d1e5ef8da587372bba3aa2a784a6f65d6ccbc", + "target": "package:inferrsi.common.skills.task_accuracy", + "original_refs": { + "checkout:task-accuracy": "sha256:5267d2773666629bdc6c49d5b79de77da70297722bd53f99ec1268c57a5848bb", + "package:inferrsi.common.skills.task_accuracy": "sha256:9bf40fbe608fc676778186a1c455bf594d34d1e4c9a20fedfe0a595b68a47866" + }, + "enter_instruction_bytes": 3633, + "enter_instruction_sha256": "684f9f5d106a8d5fc7b2c61e9409e9ade7b7490d435efb7c4844c005e096da00", + "route_card": { + "bytes": 1411, + "choose_when": "Inference completes but output violates a reference, quality metric or tolerance.", + "public_relative_path": "references/routes/accuracy.json", + "seed_owners": { + "audit-fixed-workload-claim": "playbooks/measurement/audit-fixed-workload-claim", + "claim-contract": "workflows/governance/claim-contract", + "diffusers-invocation-state": "systems/frameworks/diffusers/diffusers-invocation-state", + "torch-npu": "systems/frameworks/torch-npu/torch-npu" + }, + "sha256": "5a672842ec26262d8827f7ce8d92de9bd956859ff5244189c0519b8f0dd188e3", + "source": "tasks/inference-task-router/references/routes/accuracy.json" + } + }, + "task-day-0": { + "source": "tasks/task-day-0/SKILL.md", + "original_sha256": "ca187de2205b3aa86b4ca5123fb0107a8235aa84f9d942d3771a8a665df1a0a3", + "original_bytes": 4496, + "header_sha256": "6084ce34325c8275508a6190e81a9a278af20b5212aee173b7c526bea49d883c", + "body_sha256": "dec6cec5b9ec2aca541ed4264520e92347890af24abdd0b7590f766b7115549f", + "target": "package:inferrsi.common.skills.task_day_0", + "original_refs": { + "checkout:task-day-0": "sha256:50c42cedf843870e6a8fa17219e7e3ce5049dd2b7cefa8305f8c3683b8833e95", + "package:inferrsi.common.skills.task_day_0": "sha256:48c3747738f0a84ac45fe2a1c1fac1395e59b841d639f9940e3ab9f316d4d236" + }, + "enter_instruction_bytes": 3369, + "enter_instruction_sha256": "ed376f482eab265de2b3883a97c6cc095f5376c457adb85446410805ae8c56b4", + "route_card": { + "bytes": 871, + "choose_when": "First usable support for a new checkpoint or model architecture in an existing engine.", + "public_relative_path": "references/routes/day0-model.json", + "seed_owners": { + "ascend-model-adaptation": "systems/platforms/ascend/ascend-model-adaptation", + "claim-contract": "workflows/governance/claim-contract", + "diffusers-invocation-state": "systems/frameworks/diffusers/diffusers-invocation-state" + }, + "sha256": "77b26d1300e5535d8b595cef95c6c803ea1322e92f38b68ae2905f69355a814f", + "source": "tasks/inference-task-router/references/routes/day0-model.json" + } + }, + "task-debug": { + "source": "tasks/task-debug/SKILL.md", + "original_sha256": "2e1e91cf429384c7cb3de68cb9a896a645853f819b23bbe2c10792b2813ae5f0", + "original_bytes": 4686, + "header_sha256": "ed65c6d5570ee324fafbe959575b45bbc175007ed92af57fc19e25b7309aeb35", + "body_sha256": "21b16e409d7d0e2cdd326ef08429fe5fa6c751cabd4354de813570b56d3c084f", + "target": "package:inferrsi.common.skills.task_debug", + "original_refs": { + "checkout:task-debug": "sha256:9345d416516f3325ffe415b05d0e9e2e5a7c9144aa10a81ba6407b3ef8213879", + "package:inferrsi.common.skills.task_debug": "sha256:44157caad01d02b45cf7f2e6675db64e1411a0e9a41bc1891b148806af1c12d6" + }, + "enter_instruction_bytes": 3544, + "enter_instruction_sha256": "01707debe5adc0e5ffe8ad4f79acef5848544043f2aeede57f5b200a433326ba", + "route_card": { + "bytes": 782, + "choose_when": "A hang, crash, OOM or execution-path failure needs a reproducible cause.", + "public_relative_path": "references/routes/debug.json", + "seed_owners": { + "ascend-device-health": "systems/platforms/ascend/ascend-device-health", + "audit-afd-p2p-exchanges": "systems/engines/afd-plugin/audit-afd-p2p-exchanges", + "audit-vllm-kv-lifetimes": "systems/engines/vllm/audit-vllm-kv-lifetimes", + "inference-optimization-casebook": "casebooks/inference/inference-optimization-casebook" + }, + "sha256": "75241e43d12fb961d3f48d1b683e4df321c0f18e683959aedca9722e78a8b78f", + "source": "tasks/inference-task-router/references/routes/debug.json" + } + }, + "task-derived-engine": { + "source": "tasks/task-derived-engine/SKILL.md", + "original_sha256": "976a01cf23e626fb2112fa637bb76da3f59532d27ee93f22365ea2c752dd0942", + "original_bytes": 4606, + "header_sha256": "de59a1744dbde57f6a01b439099aa008f3c59f55555c858e02f1ffa760f91632", + "body_sha256": "2289d24186c69a26917b89f860db541998fb694494ec91ef7c031fcada1429ec", + "target": "package:inferrsi.common.skills.task_derived_engine", + "original_refs": { + "checkout:task-derived-engine": "sha256:ea82623db3db137d9e195f4e5c8cf3be42f0bc6199444f8a9a5530f65bbd0f75", + "package:inferrsi.common.skills.task_derived_engine": "sha256:032ffbbdb0deded77a9ddd08caccc3f83ca5508b2bbe7c37b37bba9721869f45" + }, + "enter_instruction_bytes": 3462, + "enter_instruction_sha256": "757fb5644051e8aba790fcdb1265244fbd29f3007ba5970adc88b60e8567c09a", + "route_card": { + "bytes": 983, + "choose_when": "The deliverable reuses the execution core of vLLM, vLLM-Omni or another pinned parent, as in a DeepInfer-like extension.", + "public_relative_path": "references/routes/derived-engine.json", + "seed_owners": { + "bound-windowed-attention-replay": "systems/engines/deepinfer/bound-windowed-attention-replay", + "budget-speculative-verification": "systems/engines/deepinfer/budget-speculative-verification", + "inference-benchmark-design": "playbooks/measurement/inference-benchmark-design", + "repository-evolution-analysis": "workflows/research/repository-evolution-analysis" + }, + "sha256": "3ab030bcd04db76781d20dccb27b62963b4fd996e05edfb0c38e2680018d8222", + "source": "tasks/inference-task-router/references/routes/derived-engine.json" + } + }, + "task-independent-engine": { + "source": "tasks/task-independent-engine/SKILL.md", + "original_sha256": "37e122098f2df35edc466d5b70598039ae640c8f4bb683b694d9195b0a83089e", + "original_bytes": 5045, + "header_sha256": "22a9a34eebbccf5a6a7e7a174750e88a01d37a2a249f9382a7c401da38edd121", + "body_sha256": "413df7de2562e0eb343bfa3d1ad6f84e17c28bbafecee1b5c6789d5d005eb339", + "target": "package:inferrsi.common.skills.task_independent_engine", + "original_refs": { + "checkout:task-independent-engine": "sha256:f3e551786fe01450fdc827e1cd4ca22441a7231ea84421c0997dcd5733793800", + "package:inferrsi.common.skills.task_independent_engine": "sha256:6e6858d74a33e8e6e088ff94dc7e23cd95ad47c01d2c3b8bfad4d183e65bbdb2" + }, + "enter_instruction_bytes": 3874, + "enter_instruction_sha256": "6e698e4512a7934c7555d6e03c17035f808e892889f55320c5ba5be307d9a2f0", + "route_card": { + "bytes": 960, + "choose_when": "A new runtime must own execution, memory and device integration on a distinct OS, model or hardware stack.", + "public_relative_path": "references/routes/independent-engine.json", + "seed_owners": { + "audit-llama-runtime-state": "systems/engines/llama-cpp/audit-llama-runtime-state", + "inference-benchmark-design": "playbooks/measurement/inference-benchmark-design", + "local-dream": "systems/engines/local-dream", + "mlc-llm": "systems/engines/mlc-llm", + "os-process-placement": "systems/platforms/host/os-process-placement" + }, + "sha256": "f2208c40871306fe4be21f84a099c551013eda26e55bff02d95ba60739b8fade", + "source": "tasks/inference-task-router/references/routes/independent-engine.json" + } + }, + "task-performance": { + "source": "tasks/task-performance/SKILL.md", + "original_sha256": "bf5a137504566b6ee4eeaee18400d52aae99a1db3c8247dea7247d653103df0b", + "original_bytes": 4809, + "header_sha256": "3fc97a98c2feed125812c904f90c1fb75184be162014205bc116222a0463d925", + "body_sha256": "a1b150bee5d83822c4221f0883e3b862972c0006297ee0797297df78a774cf51", + "target": "package:inferrsi.common.skills.task_performance", + "original_refs": { + "checkout:task-performance": "sha256:38f6e79eb4c8cc728ed6a0cd71923c22f81e112b82ce23ddd6f773cb2e799f74", + "package:inferrsi.common.skills.task_performance": "sha256:325c70d067f2b7580094222d13217f0517d4fdea34019bcb574184c67f2536f9" + }, + "enter_instruction_bytes": 3655, + "enter_instruction_sha256": "f13b0a77f1263c372d007de8cdcb3ac28199eb23eed2bcc2200544f56d94fcc2", + "route_card": { + "bytes": 843, + "choose_when": "A correct baseline misses a specified latency, throughput, memory or cost objective.", + "public_relative_path": "references/routes/performance.json", + "seed_owners": { + "inference-benchmark-design": "playbooks/measurement/inference-benchmark-design", + "inference-optimization-casebook": "casebooks/inference/inference-optimization-casebook", + "optimization-search-policy": "playbooks/planning/optimization-search-policy", + "performance-ceiling-analysis": "playbooks/measurement/performance-ceiling-analysis" + }, + "sha256": "4904e6b403f8390ddc6d11c962491ec42683ec7e29eb4a2be4075bb052bd31fa", + "source": "tasks/inference-task-router/references/routes/performance.json" + } + }, + "task-version-alignment": { + "source": "tasks/task-version-alignment/SKILL.md", + "original_sha256": "114a2f41ce5b45f61b7cbb55d1cf9fa99a7c9aaff5e5597e563d9a00a7727c8c", + "original_bytes": 4568, + "header_sha256": "179323d23c0875b602b2d086ec29716ab9adea9800fae70140b75e66f6162536", + "body_sha256": "79c789b6097b61f3815e742e2887f348d36608b8f940b3d303a62a67f804b167", + "target": "package:inferrsi.common.skills.task_version_alignment", + "original_refs": { + "checkout:task-version-alignment": "sha256:fe85ab688e4ff47dcf5b39304d04a20c5a71891e0e86452edd6132f368324553", + "package:inferrsi.common.skills.task_version_alignment": "sha256:7bd59f139173c66e1b0aecfdfe927b0357bb70e4a74cc9d1a8de61f84d0ef02a" + }, + "enter_instruction_bytes": 3428, + "enter_instruction_sha256": "d0685657b7a7ce02130276284a0e68b6998cf3aab55ee96a40d979975a8e7924", + "route_card": { + "bytes": 919, + "choose_when": "A dependency or engine upgrade must preserve API, ABI, operator or runtime behavior across a stack.", + "public_relative_path": "references/routes/version-align.json", + "seed_owners": { + "audit-afd-p2p-exchanges": "systems/engines/afd-plugin/audit-afd-p2p-exchanges", + "claim-contract": "workflows/governance/claim-contract", + "repository-evolution-analysis": "workflows/research/repository-evolution-analysis", + "vllm-ascend": "systems/engines/vllm-ascend" + }, + "sha256": "4243e305578e50ddc88bf4465447e716bbe9d22e4a0122189ad58a50e2267bf1", + "source": "tasks/inference-task-router/references/routes/version-align.json" + } + }, + "inference-task-router": { + "source": "tasks/inference-task-router/SKILL.md", + "original_sha256": "3dae791f61b26810332e05fbabe6fd7113abf9ed8609aef663535a267525849c", + "original_bytes": 6199, + "header_sha256": "9eebc1eb5ad5ad6829dc4a0d855cd9fd21093ad77216fe3022e7b3da40cb5e4f", + "body_sha256": "9c772738cb587b8b45250b36eb1ff42db11277cfc6c28f7120a422667aaf00e7", + "target": "package:inferrsi.common.skills.inference_task_router", + "original_refs": { + "checkout:inference-task-router": "sha256:e1803be3152e6f90320357364f305deeb8cd4ef52f3a6a5b5db9167226d3f7a1", + "package:inferrsi.common.skills.inference_task_router": "sha256:4d9216ccdf398375295e52ea01dcc2e7a6f9343a6107d04c6507d95d0b8773d3" + } + } + } +} diff --git a/tests/fixtures/atomic-reader/task-sources-v0.3.4.zip b/tests/fixtures/atomic-reader/task-sources-v0.3.4.zip new file mode 100644 index 000000000..3ef578b85 Binary files /dev/null and b/tests/fixtures/atomic-reader/task-sources-v0.3.4.zip differ diff --git a/tests/knowledge/test_atomic_generation.py b/tests/knowledge/test_atomic_generation.py index 96945c166..92bbaba9c 100644 --- a/tests/knowledge/test_atomic_generation.py +++ b/tests/knowledge/test_atomic_generation.py @@ -183,6 +183,25 @@ def test_host_procedure_assembles_pinned_sections_without_changing_l0(author_roo ) +@pytest.mark.parametrize("header", [ + None, + "---\nname: task-performance\ndescription: Inspect the fixture.\n---\n", + "---\nname: task-debug\ndescription: Inspect the fixture.\n---\nextra instructions\n", + "---\nname: task-debug\ndescription: Inspect the fixture.\n", +]) +def test_invalid_host_header_rejects_generation(author_root, tmp_path, header): + descriptor = author_root / "compositions/task-debug.json" + spec = json.loads(descriptor.read_bytes()) + spec["metadata"]["composition"]["skill"]["frontmatter"] = "host.yaml" + if header is not None: + spec.setdefault("content", {})["host.yaml"] = {"text": header} + write_json(descriptor, spec) + target = tmp_path / "install" + with pytest.raises(ValueError, match="frontmatter"): + build_release(author_root, target, permits=allow) + assert not target.exists() + + @pytest.mark.parametrize("change", [ "missing task", "missing revision", "retain", "license", "policy", "outside", "alias", "wrong layer", "incomplete skill", "missing relative link", diff --git a/tests/knowledge/test_atomic_task_routes.py b/tests/knowledge/test_atomic_task_routes.py new file mode 100644 index 000000000..848ff60a1 --- /dev/null +++ b/tests/knowledge/test_atomic_task_routes.py @@ -0,0 +1,165 @@ +import hashlib +import json +import shutil +from pathlib import Path +from zipfile import ZipFile + +import pytest + +from inferrsi.knowledge.atomic_build import build_generation +from inferrsi.knowledge.atomic_generation import PUBLIC_TASKS, InstalledGeneration +from inferrsi.knowledge.atomic_reader import AtomicReader +from inferrsi.knowledge.knowledge_operations import UnavailableRevision +from inferrsi.knowledge.skill_catalog import primary_task_instructions, skill_resource + +ROOT = Path(__file__).resolve().parents[2] +FIXTURES = ROOT / "tests/fixtures/atomic-reader" +OLD = json.loads((FIXTURES / "task-domain-v0.3.4.json").read_bytes()) +ROUTER = "inference-task-router" + + +@pytest.fixture(scope="module") +def generation(tmp_path_factory): + stage = tmp_path_factory.mktemp("task-domain").resolve() + root, original, source = stage / "installed", stage / "release", stage / "authored" + published = {} + for item in OLD["entries"].values(): + published[item["source"]] = item["original_sha256"] + if card := item.get("route_card"): + published[card["source"]] = card["sha256"] + with ZipFile(FIXTURES / "task-sources-v0.3.4.zip") as archive: + assert set(archive.namelist()) == published.keys() + for path, expected in published.items(): + data = archive.read(path) + assert hashlib.sha256(data).hexdigest() == expected + target = original / "src/inferrsi/knowledge/data/skill_library" / path + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(data) + + library = ROOT / "src/inferrsi/knowledge" + def copy_descriptor(family, name): + directory = library / family + dest = source / family + dest.mkdir(exist_ok=True, parents=True) + descriptor = directory / f"{name}.json" + shutil.copyfile(descriptor, dest / descriptor.name) + spec = json.loads(descriptor.read_bytes()) + for item in spec.get("content", {}).values(): + if path := item.get("path"): + shutil.copyfile(directory / path, dest / path) + return spec["metadata"] + + atoms = set() + for task in OLD["entries"]: + spec = copy_descriptor("compositions", task) + atoms.update(node["ref"].split(":", 1)[1] for node in spec["composition"]["nodes"].values()) + for atom in sorted(atoms): + copy_descriptor("atoms", atom) + generation_id = build_generation(source, root, permits=lambda pin, op: True, + source_roots={OLD["commit"]: original}) + return root / "skills", InstalledGeneration(root, expected=generation_id) + + +@pytest.mark.parametrize("name", sorted(OLD["entries"])) +def test_all_published_task_owners_and_host_instructions(generation, name): + skills, installed = generation + before = OLD["entries"][name] + ref = installed.skills[name] + assert ref == before["target"] + revision = installed.catalog[ref]["revision"] + _, bundle = installed.read_resolved(ref, revision=revision) + assert bundle.metadata["state"] == "candidate" + assert bundle.metadata["empirical_validation"] == "not_run" + source = bundle.metadata["sources"][0] + assert source["commit"] == OLD["commit"] and source["sha256"] == before["original_sha256"] + original = (skills / name / "SKILL.md").read_bytes() + assert len(original) == before["original_bytes"] + assert hashlib.sha256(original).hexdigest() == before["original_sha256"] + header = bundle.content[bundle.metadata["composition"]["skill"]["frontmatter"]] + assert hashlib.sha256(header).hexdigest() == before["header_sha256"] + assert original.startswith(header) + assert hashlib.sha256(original[len(header):]).hexdigest() == before["body_sha256"] + for old_ref, old_revision in before["original_refs"].items(): + with pytest.raises(UnavailableRevision): + installed.read_resolved(old_ref, revision=old_revision) + assert set(installed.tasks) == PUBLIC_TASKS == OLD["entries"].keys() - {ROUTER} + if name == ROUTER: + with pytest.raises(ValueError, match="Not a primary inference task skill"): + primary_task_instructions(skills, name) + return + instructions = primary_task_instructions(skills, name).encode() + assert len(instructions) == before["enter_instruction_bytes"] + assert hashlib.sha256(instructions).hexdigest() == before["enter_instruction_sha256"] + card = before["route_card"] + data = skill_resource(skills, ROUTER, card["public_relative_path"]).read_bytes() + assert len(data) == card["bytes"] and hashlib.sha256(data).hexdigest() == card["sha256"] + assert set(json.loads(data)["candidate_skill_ids"]) == card["seed_owners"].keys() + + +@pytest.mark.parametrize("name", sorted(PUBLIC_TASKS)) +def test_task_layers_preserve_source_ranges_and_refuse_partial_or_foreign_routes(generation, name): + skills, installed = generation + reader = AtomicReader(installed, permits=lambda pin, op: True) + + def read(owner, layer, task, budget): + ref = installed.skills[owner] + return reader.read_selection(ref, revision=installed.catalog[ref]["revision"], + layer=layer, context={"task": task}, max_bytes=budget) + + before = OLD["entries"][name] + card = before["route_card"] + other = next(task for task in sorted(PUBLIC_TASKS) if task != name) + for layer in ("L0", "L1", "L2", "L3"): + full = read(name, layer, name, 100_000) + assert full.receipt["status"] == "delivered" + size = sum(map(len, full.bodies)) + assert full.receipt["body_bytes"] == size + assert read(name, layer, name, size).bodies == full.bodies + short = read(name, layer, name, size - 1) + assert not short.bodies and short.receipt["status"] == "over_budget" + assert short.receipt["body_bytes"] == 0 and short.receipt["required_bytes"] == size + for data, record in zip(full.bodies, full.receipt["delivered"], strict=True): + path = record["source_path"].split("/data/skill_library/", 1)[1] + if path.endswith("/SKILL.md"): + raw = (skills / Path(path).parent.name / "SKILL.md").read_bytes() + else: + assert path == card["source"] + raw = skill_resource(skills, ROUTER, card["public_relative_path"]).read_bytes() + assert record["source"]["commit"] == OLD["commit"] + assert record["source_range_verification"] == "verified_at_build" + assert hashlib.sha256(raw).hexdigest() == record["source"]["sha256"] + start, end = record["source_byte_range"] + assert raw[start:end] == data + if layer == "L0": + assert read(name, layer, "", size).bodies == full.bodies + assert len(full.bodies) == 1 + continue + wrong = read(name, layer, other, size) + assert not wrong.bodies and wrong.receipt["status"] == "not_applicable" + if layer == "L1": + assert card["choose_when"].encode() in full.bodies + if layer == "L2": + roles = ("procedure", "condition", "support", "acceptance") + expected = {f"package:{name}-{role}" for role in roles} | {"package:task-capture-run"} + assert {r["ref"] for r in full.receipt["delivered"]} == expected + if layer == "L3": + via_router = read(ROUTER, layer, name, size) + assert via_router.bodies == full.bodies + assert len(full.bodies) == 1 + assert hashlib.sha256(full.bodies[0]).hexdigest() == card["sha256"] + direct, shared = (reply.receipt["delivered"][0] for reply in (full, via_router)) + assert (direct["ref"], direct["revision"]) == (shared["ref"], shared["revision"]) + + +def test_router_keeps_general_decision_guidance_and_requires_a_target_for_card(generation): + _, installed = generation + router = installed.skills[ROUTER] + reader = AtomicReader(installed, permits=lambda pin, op: True) + read_args = {"revision": installed.catalog[router]["revision"], + "context": {}, "max_bytes": 20_000} + for layer, expected in (("L0", b"# Choose an inference task"), ("L1", b"## Target conditions"), + ("L2", b"## Use and handoff")): + result = reader.read_selection(router, layer=layer, **read_args) + assert any(body.startswith(expected) for body in result.bodies) + result = reader.read_selection(router, layer="L3", **read_args) + assert result.receipt["status"] == "not_applicable" and not result.bodies