From 98a3f6d47306eea24dfeddc95c3acf65b475c4b5 Mon Sep 17 00:00:00 2001 From: tzhouam Date: Wed, 30 Sep 2026 18:22:05 +0800 Subject: [PATCH] feat: enable vLLM-GR agent review with packaged owner routes --- .github/workflows/test.yml | 2 + adapters/vllm_gr/manifest.yaml | 118 ++++++++++++++++++ doc/knowledge/SCHEMA.md | 2 +- knowledge/repos/_index.md | 5 +- knowledge/repos/vllm-gr/_index.md | 33 +++++ knowledge/repos/vllm-gr/_routes.yaml | 75 +++++++++++ knowledge/repos/vllm-gr/components/_index.md | 30 +++++ .../vllm-gr/components/attention/_index.md | 32 +++++ .../components/attention/architecture.md | 39 ++++++ .../vllm-gr/components/beam-proc/_index.md | 33 +++++ .../components/beam-proc/architecture.md | 41 ++++++ .../vllm-gr/components/engine-core/_index.md | 33 +++++ .../components/engine-core/architecture.md | 41 ++++++ .../vllm-gr/components/packaging/_index.md | 35 ++++++ .../components/packaging/architecture.md | 45 +++++++ .../vllm-gr/components/serving/_index.md | 34 +++++ .../components/serving/architecture.md | 43 +++++++ test/test_vllm_gr_review_support.py | 91 ++++++++++++++ 18 files changed, 729 insertions(+), 3 deletions(-) create mode 100644 adapters/vllm_gr/manifest.yaml create mode 100644 knowledge/repos/vllm-gr/_index.md create mode 100644 knowledge/repos/vllm-gr/_routes.yaml create mode 100644 knowledge/repos/vllm-gr/components/_index.md create mode 100644 knowledge/repos/vllm-gr/components/attention/_index.md create mode 100644 knowledge/repos/vllm-gr/components/attention/architecture.md create mode 100644 knowledge/repos/vllm-gr/components/beam-proc/_index.md create mode 100644 knowledge/repos/vllm-gr/components/beam-proc/architecture.md create mode 100644 knowledge/repos/vllm-gr/components/engine-core/_index.md create mode 100644 knowledge/repos/vllm-gr/components/engine-core/architecture.md create mode 100644 knowledge/repos/vllm-gr/components/packaging/_index.md create mode 100644 knowledge/repos/vllm-gr/components/packaging/architecture.md create mode 100644 knowledge/repos/vllm-gr/components/serving/_index.md create mode 100644 knowledge/repos/vllm-gr/components/serving/architecture.md create mode 100644 test/test_vllm_gr_review_support.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66c382180..3ba9eb7e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,6 +91,8 @@ jobs: if loaded: sys.exit(f"public SDK import loaded private implementation: {loaded}") caps = get_capabilities() + if "vllm-gr" not in caps.supported_repositories: + sys.exit("installed SDK omits vLLM-GR review support") dist_version = importlib.metadata.version("infermatrix-copilot") if not (__version__ == dist_version == caps.distribution_version == "0.2.0"): sys.exit( diff --git a/adapters/vllm_gr/manifest.yaml b/adapters/vllm_gr/manifest.yaml new file mode 100644 index 000000000..1ceabc0a7 --- /dev/null +++ b/adapters/vllm_gr/manifest.yaml @@ -0,0 +1,118 @@ +# GR review support authorized by the repository maintainer. +name: vllm_gr +status: active +created_by: human +schema_version: 1 +capabilities: [] +repo: + path: ${VLLM_GR_REPO} + full_name: JiusiServe/vllm-gr + aliases: + - vllm-gr + - vllm_gr + - JiusiServe/vllm-gr + default_branch: main + language: python +knowledge: + source: JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee + repo_subdir: repos/vllm-gr + briefing_docs: + - repos/vllm-gr/_index.md +modules: + engine_core: + local_paths: + - vllm_gr/v1/engine/ + - vllm_gr/v1/core/ + wave: 1 + risk: high + beam_proc: + local_paths: + - rust/beam-proc/ + - rust/ce-transport/ + - rust/examples/ + wave: 1 + risk: high + serving: + local_paths: + - vllm_gr/entrypoints/ + wave: 1 + risk: high + attention: + local_paths: + - vllm_gr/v1/attention/ + wave: 1 + risk: high + packaging: + local_paths: + - setup.py + - pyproject.toml + - MANIFEST.in + - requirements/ + - rust/Cargo. + - .github/workflows/ + - .pre-commit-config.yaml + - tools/pre_commit/ + - tests/packaging/ + wave: 1 + risk: high +review_routes: +- prefix: vllm_gr/v1/engine/ + owner: engine-core + doc: repos/vllm-gr/components/engine-core/architecture.md +- prefix: vllm_gr/v1/core/ + owner: engine-core + doc: repos/vllm-gr/components/engine-core/architecture.md +- prefix: rust/beam-proc/ + owner: beam-proc + doc: repos/vllm-gr/components/beam-proc/architecture.md +- prefix: rust/ce-transport/ + owner: beam-proc + doc: repos/vllm-gr/components/beam-proc/architecture.md +- prefix: rust/examples/ + owner: beam-proc + doc: repos/vllm-gr/components/beam-proc/architecture.md +- prefix: vllm_gr/entrypoints/ + owner: serving + doc: repos/vllm-gr/components/serving/architecture.md +- prefix: vllm_gr/v1/attention/ + owner: attention + doc: repos/vllm-gr/components/attention/architecture.md +- prefix: setup.py + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: pyproject.toml + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: MANIFEST.in + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: requirements/ + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: rust/Cargo. + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: .github/workflows/ + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: .pre-commit-config.yaml + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: tools/pre_commit/ + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +- prefix: tests/packaging/ + owner: packaging + doc: repos/vllm-gr/components/packaging/architecture.md +validation: + test_manifest_sources: + - .github/workflows/ + precommit: true +ci: + provider: github_actions +push: + default_remote: origin + protected_branches: + - main + - master + allowed: false diff --git a/doc/knowledge/SCHEMA.md b/doc/knowledge/SCHEMA.md index 50758fa31..6de0c9d22 100644 --- a/doc/knowledge/SCHEMA.md +++ b/doc/knowledge/SCHEMA.md @@ -45,7 +45,7 @@ contradictions: [相对路径] # 可选:与本页冲突的页面 新标签必须先加入此表再使用(防止标签蔓延): -- 归属:`general`、`vllm-omni`、`afd-plugin` +- 归属:`general`、`vllm-omni`、`afd-plugin`、`vllm-gr` - 工作主题:`review`、`ci`、`docs`、`git`、`debug`、`bug`、`benchmark`、`environment`、 `remote`、`agents`、`planning`、`dev`、`rebase` - 代码/模型轴:`components`、`models`、`diffusion`、`model-executor`、`serving`、 diff --git a/knowledge/repos/_index.md b/knowledge/repos/_index.md index 1c5bbe14a..e99198ee6 100644 --- a/knowledge/repos/_index.md +++ b/knowledge/repos/_index.md @@ -1,9 +1,9 @@ --- title: "仓库经验入口" created: 2026-07-10 -updated: 2026-08-06 +updated: 2026-09-30 type: index -tags: [vllm-omni, afd-plugin] +tags: [vllm-omni, afd-plugin, vllm-gr] sources: [] --- @@ -26,3 +26,4 @@ sources: [] | vLLM-Omni | `vllm-project/vllm-omni` | [vllm-omni](vllm-omni/_index.md) | | afd-plugin | `vllm-project/afd-plugin` | [afd-plugin](afd-plugin/_index.md) | | Jianghan roleplay data pipeline | 私有项目 | [jianghan-roleplay-data-pipeline](jianghan-roleplay-data-pipeline/_index.md) | +| vLLM-GR | `JiusiServe/vllm-gr` | [vllm-gr](vllm-gr/_index.md) | diff --git a/knowledge/repos/vllm-gr/_index.md b/knowledge/repos/vllm-gr/_index.md new file mode 100644 index 000000000..66d1d0a4e --- /dev/null +++ b/knowledge/repos/vllm-gr/_index.md @@ -0,0 +1,33 @@ +--- +title: vLLM-GR repository entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:README.md +--- + +# vLLM-GR repository entry + +## When to use this entry + +Repository: `JiusiServe/vllm-gr`; aliases `vllm-gr` and `vllm_gr`. +Default branch: `main`. Source map baseline: `a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee`. +The baseline supports vLLM `0.22.1` and vLLM-Ascend `0.22.1rc1`; inspect the target revision's own constraints before validation. +This repository implements generative recommendation inference, including OneRec beam/catalog paths, Pangu passthrough and GPU/NPU execution. + +## Outside this entry + +Repository-independent review procedures belong to [general review](../../general/review/_index.md). +vLLM-Omni model and diffusion assumptions belong to that repository and do not apply here. +This map describes the pinned main branch; new transports and APIs must be verified from the reviewed head. + +## Contents + +| Task | Entry | Boundary | +|---|---|---| +| Select a source owner and focused tests | [Components](components/_index.md) | EngineCore, BeamProc, serving, attention and packaging | + +Direct owner signals and source scopes are declared in `_routes.yaml`; adapter aliases and briefing live in `adapters/vllm_gr/manifest.yaml`. diff --git a/knowledge/repos/vllm-gr/_routes.yaml b/knowledge/repos/vllm-gr/_routes.yaml new file mode 100644 index 000000000..7c915597d --- /dev/null +++ b/knowledge/repos/vllm-gr/_routes.yaml @@ -0,0 +1,75 @@ +schema_version: 1 +owners: +- owner: engine-core + path: repos/vllm-gr/components/engine-core/architecture.md + signals: + - enginecore + - engine core + - scheduler + - scheduling + - beam plan + - beam cache + - ce + scope_prefixes: + - vllm_gr/v1/engine/ + - vllm_gr/v1/core/ +- owner: beam-proc + path: repos/vllm-gr/components/beam-proc/architecture.md + signals: + - beamproc + - beam proc + - bp + - rust worker + - shared memory + - sharedmem + - iceoryx + - transport + scope_prefixes: + - rust/beam-proc/ + - rust/ce-transport/ + - rust/examples/ +- owner: serving + path: repos/vllm-gr/components/serving/architecture.md + signals: + - serving + - openai + - chat completion + - streaming + - sse + - beam stream + - beam metrics + - response + scope_prefixes: + - vllm_gr/entrypoints/ +- owner: attention + path: repos/vllm-gr/components/attention/architecture.md + signals: + - attention + - flash attention + - flashattn + - suffix lse + - cascade attention + - gqa + - kv cache + scope_prefixes: + - vllm_gr/v1/attention/ +- owner: packaging + path: repos/vllm-gr/components/packaging/architecture.md + signals: + - packaging + - wheel + - cargo + - native library + - build + - pre commit + - installation + scope_prefixes: + - setup.py + - pyproject.toml + - MANIFEST.in + - requirements/ + - rust/Cargo. + - .github/workflows/ + - .pre-commit-config.yaml + - tools/pre_commit/ + - tests/packaging/ diff --git a/knowledge/repos/vllm-gr/components/_index.md b/knowledge/repos/vllm-gr/components/_index.md new file mode 100644 index 000000000..da526aabc --- /dev/null +++ b/knowledge/repos/vllm-gr/components/_index.md @@ -0,0 +1,30 @@ +--- +title: vLLM-GR component map +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- components +sources: [] +--- + +# vLLM-GR components + +## When to use this entry + +Select the stable source owner for a GR runtime or packaging change. + +## Outside this map + +Repository identity and supported versions belong to the [repository entry](../_index.md); generic procedures belong to [general review](../../../general/review/_index.md). + +## Contents + +| Task | Entry | Source scope | +|---|---|---| +| EngineCore beam scheduling | [engine-core](engine-core/_index.md) | `vllm_gr/v1/engine/` | +| Rust BeamProc runtime | [beam-proc](beam-proc/_index.md) | `rust/beam-proc/` | +| OpenAI beam serving | [serving](serving/_index.md) | `vllm_gr/entrypoints/` | +| Beam attention runtime | [attention](attention/_index.md) | `vllm_gr/v1/attention/` | +| Native packaging and validation | [packaging](packaging/_index.md) | `setup.py` | diff --git a/knowledge/repos/vllm-gr/components/attention/_index.md b/knowledge/repos/vllm-gr/components/attention/_index.md new file mode 100644 index 000000000..64cc322b2 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/attention/_index.md @@ -0,0 +1,32 @@ +--- +title: Beam attention runtime entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- attention-runtime +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/attention/backends/beam_attn_gpu.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/attention/backends/beam_attn_metadata.py +--- + +# Beam attention runtime + +## When to use this entry + +GPU/NPU beam attention execution and the metadata that describes ordinary, prefix and suffix query/cache layouts. + +Source scopes: `vllm_gr/v1/attention/`. + +## Outside this owner + +Other source owners are listed in the [component map](../_index.md); repository identity and version constraints belong to the [repository entry](../../_index.md). + +## Contents + +| Task | Entry | Purpose | +|---|---|---| +| Trace source, data flow and validation | [Architecture](architecture.md) | Pinned source map and compact Direct review map | + +Focused tests: `tests/test_beam_attention_metadata.py`. diff --git a/knowledge/repos/vllm-gr/components/attention/architecture.md b/knowledge/repos/vllm-gr/components/attention/architecture.md new file mode 100644 index 000000000..79ff7df26 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/attention/architecture.md @@ -0,0 +1,39 @@ +--- +title: Beam attention runtime architecture +created: '2026-09-30' +updated: '2026-09-30' +type: architecture +tags: +- vllm-gr +- attention-runtime +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/attention/backends/beam_attn_gpu.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/attention/backends/beam_attn_metadata.py +--- + +# Beam attention runtime architecture + +## Responsibilities and boundary + +GPU/NPU beam attention execution and the metadata that describes ordinary, prefix and suffix query/cache layouts. + +## Source and entrypoints + +- `vllm_gr/v1/attention/backends/beam_attn_gpu.py` +- `vllm_gr/v1/attention/backends/beam_attn_metadata.py` + +## Data flow + +Metadata partitions standard and beam queries and supplies cache geometry. GPU attention evaluates standard queries and prefix/suffix beam attention, merges their states and writes into the caller-owned output. Platform and FlashAttention-version branches can have different shape and ownership contracts. + +## Direct review map + +Read `vllm_gr/v1/attention/backends/beam_attn_metadata.py` for query indices and cache geometry, then `beam_attn_gpu.py` for prefix/suffix kernels, LSE layouts and output writes. Check ordinary and grouped queries, supported FlashAttention versions, causal suffix lengths and caller output ownership. Inspect platform-specific peers before extending a GPU conclusion to NPU. + +Focused tests: `tests/test_beam_attention_metadata.py`. + +## Validation + +Use the target head's declared dependency versions and test selectors. Bind evidence to that head; a missing native build or incompatible environment is a validation gap. + +See the [owner entry](_index.md) and [component map](../_index.md) for neighboring boundaries. diff --git a/knowledge/repos/vllm-gr/components/beam-proc/_index.md b/knowledge/repos/vllm-gr/components/beam-proc/_index.md new file mode 100644 index 000000000..6efc0797b --- /dev/null +++ b/knowledge/repos/vllm-gr/components/beam-proc/_index.md @@ -0,0 +1,33 @@ +--- +title: Rust BeamProc runtime entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- distributed +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/worker/io_worker.rs +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/worker/beam_worker.rs +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/main.rs +--- + +# Rust BeamProc runtime + +## When to use this entry + +Rust BeamProc process, worker queues, beam decisions, and the BP side of CE and API-server communication. + +Source scopes: `rust/beam-proc/`, `rust/ce-transport/`, `rust/examples/`. + +## Outside this owner + +Other source owners are listed in the [component map](../_index.md); repository identity and version constraints belong to the [repository entry](../../_index.md). + +## Contents + +| Task | Entry | Purpose | +|---|---|---| +| Trace source, data flow and validation | [Architecture](architecture.md) | Pinned source map and compact Direct review map | + +Focused tests: `tests/test_beamproc_scheduler_unit.py`. diff --git a/knowledge/repos/vllm-gr/components/beam-proc/architecture.md b/knowledge/repos/vllm-gr/components/beam-proc/architecture.md new file mode 100644 index 000000000..906e9885b --- /dev/null +++ b/knowledge/repos/vllm-gr/components/beam-proc/architecture.md @@ -0,0 +1,41 @@ +--- +title: Rust BeamProc runtime architecture +created: '2026-09-30' +updated: '2026-09-30' +type: architecture +tags: +- vllm-gr +- distributed +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/worker/io_worker.rs +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/worker/beam_worker.rs +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/beam-proc/src/main.rs +--- + +# Rust BeamProc runtime architecture + +## Responsibilities and boundary + +Rust BeamProc process, worker queues, beam decisions, and the BP side of CE and API-server communication. + +## Source and entrypoints + +- `rust/beam-proc/src/worker/io_worker.rs` +- `rust/beam-proc/src/worker/beam_worker.rs` +- `rust/beam-proc/src/main.rs` + +## Data flow + +The process owns worker and I/O managers. I/O decodes CE messages, dispatches them to beam workers and publishes plans or final results. CE replies and API-server final-result delivery are distinct channels. Changes to native CE transport must also inspect the live Python caller and the CE wire contract. + +## Direct review map + +Read `rust/beam-proc/src/main.rs` for process startup and shutdown; `worker/io_worker.rs` for framing, worker routing and result delivery; `worker/beam_worker.rs` for beam state, selection and terminal output. Inspect the pinned `rust/Cargo.toml` and lockfile before using native dependency APIs. Review the enabled transport path and partial-startup cleanup separately from the default path. + +Focused tests: `tests/test_beamproc_scheduler_unit.py`. + +## Validation + +Use the target head's declared dependency versions and test selectors. Bind evidence to that head; a missing native build or incompatible environment is a validation gap. + +See the [owner entry](_index.md) and [component map](../_index.md) for neighboring boundaries. diff --git a/knowledge/repos/vllm-gr/components/engine-core/_index.md b/knowledge/repos/vllm-gr/components/engine-core/_index.md new file mode 100644 index 000000000..928ad3d4e --- /dev/null +++ b/knowledge/repos/vllm-gr/components/engine-core/_index.md @@ -0,0 +1,33 @@ +--- +title: EngineCore beam scheduling entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- scheduler +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/core.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/engine_core_patch.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/wire.py +--- + +# EngineCore beam scheduling + +## When to use this entry + +Python EngineCore admission, beam state and cache ownership, scheduler replies, and the CE side of the BeamProc wire boundary. + +Source scopes: `vllm_gr/v1/engine/`, `vllm_gr/v1/core/`. + +## Outside this owner + +Other source owners are listed in the [component map](../_index.md); repository identity and version constraints belong to the [repository entry](../../_index.md). + +## Contents + +| Task | Entry | Purpose | +|---|---|---| +| Trace source, data flow and validation | [Architecture](architecture.md) | Pinned source map and compact Direct review map | + +Focused tests: `tests/test_beam_request_unit.py`, `tests/test_beamproc_scheduler_unit.py`. diff --git a/knowledge/repos/vllm-gr/components/engine-core/architecture.md b/knowledge/repos/vllm-gr/components/engine-core/architecture.md new file mode 100644 index 000000000..dc3fc13e5 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/engine-core/architecture.md @@ -0,0 +1,41 @@ +--- +title: EngineCore beam scheduling architecture +created: '2026-09-30' +updated: '2026-09-30' +type: architecture +tags: +- vllm-gr +- scheduler +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/core.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/engine_core_patch.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/v1/engine/wire.py +--- + +# EngineCore beam scheduling architecture + +## Responsibilities and boundary + +Python EngineCore admission, beam state and cache ownership, scheduler replies, and the CE side of the BeamProc wire boundary. + +## Source and entrypoints + +- `vllm_gr/v1/engine/core.py` +- `vllm_gr/v1/engine/engine_core_patch.py` +- `vllm_gr/v1/engine/wire.py` + +## Data flow + +EngineCore patches register GR request types, initialize beam state before upstream startup, and start CE I/O at most once. Engine outputs go to BeamProc; returned beam plans enter the scheduler before newer API input. Child creation, aborts and terminal cleanup belong to the EngineCore scheduler. + +## Direct review map + +Read `vllm_gr/v1/engine/core.py` for plan application, child admission, wire encoding and terminal cleanup. Read `engine_core_patch.py` for initialization and shutdown ownership, and `wire.py`/`types.py` for the registered request contract. Follow the live CE-to-BP sender and BP-to-CE reply path together; transport changes also touch the BeamProc owner. + +Focused tests: `tests/test_beam_request_unit.py`, `tests/test_beamproc_scheduler_unit.py`. + +## Validation + +Use the target head's declared dependency versions and test selectors. Bind evidence to that head; a missing native build or incompatible environment is a validation gap. + +See the [owner entry](_index.md) and [component map](../_index.md) for neighboring boundaries. diff --git a/knowledge/repos/vllm-gr/components/packaging/_index.md b/knowledge/repos/vllm-gr/components/packaging/_index.md new file mode 100644 index 000000000..c11dcd3a2 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/packaging/_index.md @@ -0,0 +1,35 @@ +--- +title: Native packaging and validation entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- ci +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:setup.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:pyproject.toml +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/Cargo.toml +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:tests/packaging/test_install_metadata.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:.github/workflows/pre-commit.yml +--- + +# Native packaging and validation + +## When to use this entry + +Platform-dependent installation metadata, Rust builds, native artifact inclusion and the repository validation entrypoints. + +Source scopes: `setup.py`, `pyproject.toml`, `MANIFEST.in`, `requirements/`, `rust/Cargo.`, `.github/workflows/`, `.pre-commit-config.yaml`, `tools/pre_commit/`, `tests/packaging/`. + +## Outside this owner + +Other source owners are listed in the [component map](../_index.md); repository identity and version constraints belong to the [repository entry](../../_index.md). + +## Contents + +| Task | Entry | Purpose | +|---|---|---| +| Trace source, data flow and validation | [Architecture](architecture.md) | Pinned source map and compact Direct review map | + +Focused tests: `tests/packaging/test_install_metadata.py`. diff --git a/knowledge/repos/vllm-gr/components/packaging/architecture.md b/knowledge/repos/vllm-gr/components/packaging/architecture.md new file mode 100644 index 000000000..f1f2f9cc5 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/packaging/architecture.md @@ -0,0 +1,45 @@ +--- +title: Native packaging and validation architecture +created: '2026-09-30' +updated: '2026-09-30' +type: architecture +tags: +- vllm-gr +- ci +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:setup.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:pyproject.toml +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:rust/Cargo.toml +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:tests/packaging/test_install_metadata.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:.github/workflows/pre-commit.yml +--- + +# Native packaging and validation architecture + +## Responsibilities and boundary + +Platform-dependent installation metadata, Rust builds, native artifact inclusion and the repository validation entrypoints. + +## Source and entrypoints + +- `setup.py` +- `pyproject.toml` +- `rust/Cargo.toml` +- `tests/packaging/test_install_metadata.py` +- `.github/workflows/pre-commit.yml` + +## Data flow + +Setup selects platform requirements and builds the Rust executable for source/editable installation. Package metadata declares included native artifacts. CI workflows and pre-commit helpers define their own test selectors; verify the final wheel contents and imported runtime independently of source-tree fallbacks. + +## Direct review map + +Read `setup.py`, `pyproject.toml`, `MANIFEST.in`, platform `requirements/`, and `rust/Cargo.toml` together. Trace each native artifact from its build command to wheel inclusion and the runtime loader. Read `.github/workflows/pre-commit.yml` and `tools/pre_commit/` for actual selectors. Use an isolated installed-wheel smoke check when native loading or artifact layout changes. + +Focused tests: `tests/packaging/test_install_metadata.py`. + +## Validation + +Use the target head's declared dependency versions and test selectors. Bind evidence to that head; a missing native build or incompatible environment is a validation gap. + +See the [owner entry](_index.md) and [component map](../_index.md) for neighboring boundaries. diff --git a/knowledge/repos/vllm-gr/components/serving/_index.md b/knowledge/repos/vllm-gr/components/serving/_index.md new file mode 100644 index 000000000..678668638 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/serving/_index.md @@ -0,0 +1,34 @@ +--- +title: OpenAI beam serving entry +created: '2026-09-30' +updated: '2026-09-30' +type: index +tags: +- vllm-gr +- serving +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/serving_engine.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/serving_models.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/beam_search_patch.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/beam_proc_manager.py +--- + +# OpenAI beam serving + +## When to use this entry + +OpenAI-facing beam request and response handling, BeamProc startup, API-server final delivery, metrics and cancellation. + +Source scopes: `vllm_gr/entrypoints/`. + +## Outside this owner + +Other source owners are listed in the [component map](../_index.md); repository identity and version constraints belong to the [repository entry](../../_index.md). + +## Contents + +| Task | Entry | Purpose | +|---|---|---| +| Trace source, data flow and validation | [Architecture](architecture.md) | Pinned source map and compact Direct review map | + +Focused tests: `tests/test_serving_beam_lifecycle.py`, `tests/test_serving_models_beamproc_startup.py`, `tests/test_prometheus_beam_search_metrics.py`. diff --git a/knowledge/repos/vllm-gr/components/serving/architecture.md b/knowledge/repos/vllm-gr/components/serving/architecture.md new file mode 100644 index 000000000..b2ccba3e2 --- /dev/null +++ b/knowledge/repos/vllm-gr/components/serving/architecture.md @@ -0,0 +1,43 @@ +--- +title: OpenAI beam serving architecture +created: '2026-09-30' +updated: '2026-09-30' +type: architecture +tags: +- vllm-gr +- serving +sources: +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/serving_engine.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/serving_models.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/beam_search_patch.py +- JiusiServe/vllm-gr@a05103dc16c7b8dfd2213b73c5ee2d4f28cb6fee:vllm_gr/entrypoints/openai/beam_proc_manager.py +--- + +# OpenAI beam serving architecture + +## Responsibilities and boundary + +OpenAI-facing beam request and response handling, BeamProc startup, API-server final delivery, metrics and cancellation. + +## Source and entrypoints + +- `vllm_gr/entrypoints/openai/serving_engine.py` +- `vllm_gr/entrypoints/openai/serving_models.py` +- `vllm_gr/entrypoints/openai/beam_search_patch.py` +- `vllm_gr/entrypoints/openai/beam_proc_manager.py` + +## Data flow + +Serving creates beam requests and communicates with EngineCore. The BeamProc manager owns executable startup and readiness; serving consumes engine/BP results and turns them into API responses. Request cancellation, iterator failure and terminal result cleanup must retain their user-visible behavior. + +## Direct review map + +Read `serving_engine.py` for request ownership, beam result consumption, final cleanup and metrics; `beam_search_patch.py` for upstream API signatures and streaming delegation; `serving_models.py` and `beam_proc_manager.py` for native process startup. Check stream options, error and cancellation paths against the supported vLLM version rather than an unrelated installed release. + +Focused tests: `tests/test_serving_beam_lifecycle.py`, `tests/test_serving_models_beamproc_startup.py`, `tests/test_prometheus_beam_search_metrics.py`. + +## Validation + +Use the target head's declared dependency versions and test selectors. Bind evidence to that head; a missing native build or incompatible environment is a validation gap. + +See the [owner entry](_index.md) and [component map](../_index.md) for neighboring boundaries. diff --git a/test/test_vllm_gr_review_support.py b/test/test_vllm_gr_review_support.py new file mode 100644 index 000000000..050253673 --- /dev/null +++ b/test/test_vllm_gr_review_support.py @@ -0,0 +1,91 @@ +"""GR reviews use packaged owner routes and the existing SDK head gate.""" + +from dataclasses import replace + +import pytest + +from infermatrix_copilot.sdk.v1 import ( + ChangedPath, + DirectClient, + DirectCompletionRequest, + DirectReviewRequest, + RepositoryRef, +) + + +HEAD = "abe0335e4823fa5c2564471d761194b44c66abff" + + +def request(alias, paths, title="Update implementation", body=""): + return DirectReviewRequest( + review_id="gr-review-424", + repository=RepositoryRef(alias=alias, full_name="JiusiServe/vllm-gr"), + pr_number=424, + expected_head_sha=HEAD, + title=title, + body=body, + changed_paths=tuple(ChangedPath(path, "modified") for path in paths), + ) + + +@pytest.mark.parametrize("alias", ["vllm-gr", "vllm_gr"]) +@pytest.mark.parametrize("path,owner", [ + ("vllm_gr/v1/engine/core.py", "engine-core"), + ("rust/beam-proc/src/worker/io_worker.rs", "beam-proc"), + ("rust/ce-transport/src/lib.rs", "beam-proc"), + ("vllm_gr/entrypoints/openai/serving_engine.py", "serving"), + ("vllm_gr/v1/attention/backends/beam_attn_gpu.py", "attention"), + ("setup.py", "packaging"), +]) +def test_gr_sdk_accepts_repository_and_routes_the_changed_owner(alias, path, owner): + client = DirectClient() + assert "vllm-gr" in client.capabilities().supported_repositories + plan = client.plan(request(alias, [path])) + + assert plan.routing["status"] == "scope_fallback" + assert [route.owner for route in plan.knowledge_routes] == [owner] + route = plan.knowledge_routes[0] + assert route.document.document_id.startswith("repos/vllm-gr/") + assert route.quick_map_status == "ok" + assert route.quick_map + assert client.read_document( + route.document.document_id, + review_context_id=plan.review_context_id, + ).sha256 == route.document.sha256 + + +def test_gr_beamproc_review_keeps_exact_routes_and_head_validation(): + client = DirectClient() + plan = client.plan(request( + "vllm-gr", + ["vllm_gr/v1/engine/core.py", "rust/ce-transport/src/lib.rs", "setup.py"], + title="Optimize BeamProc scheduling and add Rust shared-memory transport", + body="Move EngineCore TX/RX workers into Rust. Build and package the native library.", + )) + + assert 1 <= len(plan.knowledge_routes) <= 3 + assert {route.owner for route in plan.knowledge_routes} == { + "engine-core", "beam-proc", "packaging", + } + assert all(route.quick_map_status == "ok" for route in plan.knowledge_routes) + completion = DirectCompletionRequest( + review_context_id=plan.review_context_id, + expected_head_sha=HEAD, + evidence_head_sha=HEAD, + subtraction_signal="none", + existing_feedback_status="checked", + ) + assert client.validate(completion).review_complete + assert not client.validate(replace(completion, evidence_head_sha="b" * 40)).review_complete + + +def test_gr_mcp_and_sdk_use_the_same_repository_routes(): + from infermatrix_copilot.direct_routing import direct_review_plan + + path = "vllm_gr/v1/engine/core.py" + sdk = DirectClient().plan(request("vllm-gr", [path])) + mcp = direct_review_plan("JiusiServe/vllm-gr", changed_files=[path]) + assert [route.owner for route in sdk.knowledge_routes] == [ + route["owner"] for route in mcp["knowledge_routes"] + ] +