Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
- [ ] `python3 -m unittest discover -s tests -v`
- [ ] `python3 scripts/validate_skill.py .`
- [ ] `python3 scripts/verify_release.py .`
- [ ] `python3 scripts/build_integrations.py`
- [ ] `python3 scripts/validate_integrations.py`
- [ ] No raw prompts, credentials, private logs, or executable model files added

## Safety and compatibility impact

9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Compile
run: python -m compileall -q scripts tests
run: python -m compileall -q scripts tests integrations/local-audit-planner
- name: Unit and integration tests
run: python -m unittest discover -s tests -v
- name: Validate Skill
run: python scripts/validate_skill.py .
- name: Verify release gates
run: python scripts/verify_release.py .
- name: Build and validate host integrations
run: |
python scripts/build_integrations.py --output-dir dist/integrations
python scripts/validate_integrations.py --build-dir dist/integrations
python scripts/benchmark_integrations.py \
--build-dir dist/integrations \
--output "${RUNNER_TEMP}/integrations-v0.2.json"
- name: Build reproducible archive
run: python scripts/build_archive.py --output-dir dist
60 changes: 55 additions & 5 deletions .github/workflows/openclaw-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ on:
- "scripts/**"
- "assets/**"
- "references/**"
- "integrations/**"
- "scripts/build_integrations.py"
- "scripts/validate_integrations.py"
- ".github/workflows/openclaw-compat.yml"
pull_request:
paths:
- "SKILL.md"
- "scripts/**"
- "assets/**"
- "references/**"
- "integrations/**"
- "scripts/build_integrations.py"
- "scripts/validate_integrations.py"
- ".github/workflows/openclaw-compat.yml"
schedule:
- cron: "29 4 * * 1"
Expand All @@ -35,14 +41,20 @@ jobs:
with:
python-version: "3.11"
- name: Build portable archive
run: python scripts/build_archive.py --output-dir dist
- name: Prepare clean source and workspace
run: |
mkdir -p "${RUNNER_TEMP}/route-source" "${RUNNER_TEMP}/openclaw-home"
tar -xzf dist/route-openclaw-task-v0.1.0.tar.gz \
python scripts/build_archive.py --output-dir dist
python scripts/build_integrations.py --output-dir dist/integrations
- name: Prepare clean source and isolated homes
run: |
mkdir -p \
"${RUNNER_TEMP}/route-source" \
"${RUNNER_TEMP}/openclaw-home" \
"${RUNNER_TEMP}/openclaw-plugin-home"
tar -xzf dist/route-openclaw-task-v0.2.0.tar.gz \
--strip-components=1 -C "${RUNNER_TEMP}/route-source"
chmod -R a+rX "${RUNNER_TEMP}/route-source"
chmod 777 "${RUNNER_TEMP}/openclaw-home"
chmod a+r dist/integrations/route-openclaw-task-openclaw-native-v0.2.0.tar.gz
chmod 777 "${RUNNER_TEMP}/openclaw-home" "${RUNNER_TEMP}/openclaw-plugin-home"
- name: Install with the official OpenClaw CLI
run: |
docker run --rm --network none --read-only --cap-drop ALL \
Expand Down Expand Up @@ -72,3 +84,41 @@ jobs:
--goal "Read-only: inspect the repository planner architecture." \
> "${RUNNER_TEMP}/route.json"
python -c 'import json, os; p=json.load(open(os.environ["RUNNER_TEMP"]+"/route.json")); assert p["schema_version"]=="1.0" and p["planner_profile"]=="terminal_cli_workflow" and not p["execution_tools"]'
- name: Install the native plugin archive
run: |
docker run --rm --network none --read-only --cap-drop ALL \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,noexec,nosuid,size=128m \
-v "${RUNNER_TEMP}/openclaw-plugin-home:/home/node:rw" \
-v "${PWD}/dist/integrations/route-openclaw-task-openclaw-native-v0.2.0.tar.gz:/plugin.tar.gz:ro" \
"${OPENCLAW_IMAGE}" node /app/openclaw.mjs \
plugins install /plugin.tar.gz
- name: Load the native runtime and verify the hook
run: |
docker run --rm --network none --read-only --cap-drop ALL \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,noexec,nosuid,size=128m \
-v "${RUNNER_TEMP}/openclaw-plugin-home:/home/node:rw" \
"${OPENCLAW_IMAGE}" node /app/openclaw.mjs \
plugins inspect route-openclaw-task --runtime --json \
> "${RUNNER_TEMP}/plugin-info.json"
python -c 'import json, os; p=json.load(open(os.environ["RUNNER_TEMP"]+"/plugin-info.json")); q=p["plugin"]; assert q["status"]=="loaded" and q["version"]=="0.2.0" and p["typedHooks"]==[{"name":"before_prompt_build","priority":20}]'
- name: Verify the embedded Skill and installed bridge
run: |
docker run --rm --network none --read-only --cap-drop ALL \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,noexec,nosuid,size=128m \
-v "${RUNNER_TEMP}/openclaw-plugin-home:/home/node:rw" \
"${OPENCLAW_IMAGE}" node /app/openclaw.mjs \
skills info route-openclaw-task --json \
> "${RUNNER_TEMP}/plugin-skill-info.json"
python -c 'import json, os; p=json.load(open(os.environ["RUNNER_TEMP"]+"/plugin-skill-info.json")); assert p["eligible"] and p["modelVisible"] and not p["missing"]["bins"]'
docker run --rm --network none --read-only --cap-drop ALL \
--security-opt no-new-privileges \
--tmpfs /tmp:rw,noexec,nosuid,size=128m \
-v "${RUNNER_TEMP}/openclaw-plugin-home:/home/node:rw" \
"${OPENCLAW_IMAGE}" node --input-type=module -e \
'const m=await import("file:///home/node/.openclaw/extensions/route-openclaw-task/router-bridge.mjs"); const d=await m.routePrompt("Read-only: inspect the repository planner architecture."); console.log(m.buildRouteContext(d));' \
> "${RUNNER_TEMP}/bridge-context.txt"
grep -q '<route-openclaw-task advisory="true">' "${RUNNER_TEMP}/bridge-context.txt"
grep -q '"schema_version":"1.0"' "${RUNNER_TEMP}/bridge-context.txt"
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ jobs:
python scripts/validate_skill.py .
python scripts/verify_release.py .
- name: Build archive
run: python scripts/build_archive.py --output-dir dist --version "${GITHUB_REF_NAME#v}"
run: |
python scripts/build_archive.py --output-dir dist --version "${GITHUB_REF_NAME#v}"
python scripts/build_integrations.py \
--output-dir dist/integrations \
--version "${GITHUB_REF_NAME#v}"
- name: Publish GitHub release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
with:
generate_release_notes: true
files: |
dist/*.tar.gz
dist/SHA256SUMS
dist/integrations/*.tar.gz
dist/integrations/INTEGRATION_SHA256SUMS
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.

## [Unreleased]

## [0.2.0] - 2026-07-11

### Added

- Version-constrained OpenClaw native plugin with a fail-open `before_prompt_build` adapter.
- Standard Codex and Claude Code plugin bundles built from the same hash-locked core Skill.
- Version-locked `LocalAuditPlanner` research adapter, explicitly separated from upstream OpenClaw.
- Reproducible multi-host bundle builder, offline validators, and a 240-case integration-contract benchmark.
- Official OpenClaw container gate for native installation, runtime hook loading, Skill discovery, and bridge execution.

### Changed

- Updated and SHA-pinned the GitHub Actions toolchain to Checkout 7.0.0, Setup Python 6.3.0, CodeQL 4.37.0, and Action GH Release 3.0.1; future Action updates are grouped into one Dependabot PR.
- Bumped release metadata to 0.2.0 while preserving the v0.1.0 router, model tables, and routing contract byte-for-byte.

## [0.1.0] - 2026-07-11

Expand All @@ -20,5 +31,6 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Offline test suite, release verifier, CI matrix, CodeQL, and tagged archive workflow.
- ToolSandbox and 1,000-task aggregate benchmark evidence.

[Unreleased]: https://github.com/RTPI-ltc/route-openclaw-task/compare/v0.1.0...HEAD
[Unreleased]: https://github.com/RTPI-ltc/route-openclaw-task/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/RTPI-ltc/route-openclaw-task/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/RTPI-ltc/route-openclaw-task/releases/tag/v0.1.0
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0
message: "If you use OpenClaw Task Router in research, please cite this software."
title: "OpenClaw Task Router"
type: software
version: 0.1.0
version: 0.2.0
date-released: 2026-07-11
license: MIT
repository-code: "https://github.com/RTPI-ltc/route-openclaw-task"
Expand Down
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Deterministic, auditable planner routing for OpenClaw.
[![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](https://www.python.org/)
[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-compatible-111827.svg)](https://agentskills.io/)

[中文说明](README.zh-CN.md) | [Benchmarks](docs/BENCHMARKS.md) | [Security](SECURITY.md) | [Architecture](docs/ARCHITECTURE.md)
[中文说明](README.zh-CN.md) | [Integrations](docs/INTEGRATIONS.md) | [Benchmarks](docs/BENCHMARKS.md) | [Security](SECURITY.md) | [Architecture](docs/ARCHITECTURE.md)

`route-openclaw-task` turns a natural-language task into a bounded JSON routing decision before any tool runs. It selects a planner profile, executor family, context policy, permission behavior, and next action while preserving OpenClaw's runtime permission engine as the final authority.

Expand Down Expand Up @@ -50,7 +50,7 @@ The same model, image, planner policy, and security controls were used on both s
### From GitHub

```bash
openclaw skills install git:RTPI-ltc/route-openclaw-task@v0.1.0
openclaw skills install git:RTPI-ltc/route-openclaw-task@v0.2.0
```

OpenClaw installs Git skills into the active workspace's `skills/` directory. Pin a release tag in production instead of tracking `main`.
Expand All @@ -64,6 +64,22 @@ openclaw skills install ./route-openclaw-task

Requirements: OpenClaw, Python 3.10 or newer, and no third-party Python packages. The release is install-and-run tested against the official OpenClaw `2026.6.11` image in a network-disabled, read-only-root container.

### Native Runtime Integration

The v0.2 release also ships a version-constrained OpenClaw native plugin. It
routes every prompt through the unchanged core before planning and falls back
to the baseline planner on any adapter error:

```bash
openclaw plugins install ./route-openclaw-task-openclaw-native-v0.2.0.tar.gz
openclaw plugins inspect route-openclaw-task --runtime --json
```

Codex and Claude Code plugin bundles are published from the same core. Their
v0.2 evidence is offline contract E2E only: Codex was not modified or invoked,
and Claude Code was not installed or started. See the precise
[compatibility matrix and evidence levels](docs/INTEGRATIONS.md).

## 60-Second Demo

```bash
Expand Down Expand Up @@ -112,7 +128,7 @@ flowchart LR
H --> I[Verifier and audit log]
```

The skill returns advisory policy. OpenClaw still owns candidate generation, search, permission decisions, execution, and verification. An optional deep integration for `LocalAuditPlanner` is documented in [OpenClaw integration](docs/OPENCLAW_INTEGRATION.md).
The skill returns advisory policy. OpenClaw still owns candidate generation, search, permission decisions, execution, and verification. The portable native plugin and the separately version-locked `LocalAuditPlanner` research adapter are documented in [OpenClaw integration](docs/OPENCLAW_INTEGRATION.md).

## Security

Expand All @@ -130,6 +146,8 @@ Read [SECURITY.md](SECURITY.md) before connecting the skill to privileged tools.
python3 -m unittest discover -s tests -v
python3 scripts/validate_skill.py .
python3 scripts/verify_release.py .
python3 scripts/build_integrations.py
python3 scripts/validate_integrations.py
```

CI runs these checks on Python 3.10 through 3.13. Pull requests must include a routing test for behavior changes and must keep benchmark promotion gates green.
Expand All @@ -143,6 +161,7 @@ assets/ Auditable Naive Bayes model tables
references/ Routing contract and model card
tests/ Offline unit, CLI, invariant, and packaging tests
docs/ Architecture, integration, and benchmark details
integrations/ Host manifests and thin adapter templates
examples/ Safe synthetic input examples
```

Expand Down
21 changes: 19 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

面向 OpenClaw 的确定性、可审计 planner 路由 Skill。

[English](README.md) | [完整评测](docs/BENCHMARKS.md) | [安全策略](SECURITY.md) | [架构](docs/ARCHITECTURE.md)
[English](README.md) | [宿主集成](docs/INTEGRATIONS.md) | [完整评测](docs/BENCHMARKS.md) | [安全策略](SECURITY.md) | [架构](docs/ARCHITECTURE.md)

`route-openclaw-task` 在工具执行前,把自然语言任务转换成有界 JSON 决策:planner profile、执行器类型、上下文策略、权限行为和下一步动作。它不会生成命令,也不会替代 OpenClaw 的权限引擎。

Expand All @@ -23,7 +23,7 @@
## 安装

```bash
openclaw skills install git:RTPI-ltc/route-openclaw-task@v0.1.0
openclaw skills install git:RTPI-ltc/route-openclaw-task@v0.2.0
```

本地安装:
Expand All @@ -35,6 +35,21 @@ openclaw skills install ./route-openclaw-task

要求 Python 3.10+,不需要第三方 Python 包、网络或 API key。发布流程会在官方 OpenClaw `2026.6.11` 镜像中,以断网、只读根文件系统方式验证安装、识别和执行。

### v0.2 宿主集成

v0.2 额外发布 OpenClaw 原生插件,它会在 prompt 构建前调用同一套 router,
adapter 超时或失败时回退到原 planner:

```bash
openclaw plugins install ./route-openclaw-task-openclaw-native-v0.2.0.tar.gz
openclaw plugins inspect route-openclaw-task --runtime --json
```

同一核心还会构建 Codex 和 Claude Code 标准插件包。按照本次约束,Codex
没有被修改或调用,Claude Code 也没有安装或启动;这两项只声明离线 manifest、
目录发现、核心哈希和包内执行验证,不冒充原生 runtime E2E。详细版本范围与证据
等级见 [宿主集成说明](docs/INTEGRATIONS.md)。

## 快速使用

```bash
Expand Down Expand Up @@ -66,6 +81,8 @@ python3 scripts/validate_route.py routes.jsonl
python3 -m unittest discover -s tests -v
python3 scripts/validate_skill.py .
python3 scripts/verify_release.py .
python3 scripts/build_integrations.py
python3 scripts/validate_integrations.py
```

项目代码采用 [MIT License](LICENSE),第三方数据和 benchmark 保留原始许可,详见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
2 changes: 1 addition & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: route-openclaw-task
description: Classify task-oriented requests into an OpenClaw planner profile, execution tools, safety policy, model tier, context policy, and next action. Use when deciding how an agent task should be planned or delegated, selecting CLI, file, mobile GUI, mobile CLI, MCP, or deployment executors, determining whether to continue, replan, refuse, or await human approval, or evaluating routing behavior across benchmark tasks.
license: MIT
metadata: {"version":"0.1.0","compatibility":"OpenClaw with Python 3.10 or newer; no network access or API key required","openclaw":{"requires":{"bins":["python3"]}}}
metadata: {"version":"0.2.0","compatibility":"OpenClaw with Python 3.10 or newer; no network access or API key required","openclaw":{"requires":{"bins":["python3"]}}}
---

# Route OpenClaw Task
Expand Down
43 changes: 43 additions & 0 deletions benchmarks/integrations-v0.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"benchmark_version": "1.0",
"capability_metrics_source": [
"benchmarks/generalization-1k.json",
"benchmarks/toolsandbox-router.json",
"benchmarks/toolsandbox-integrated.json"
],
"case_generation": {
"base_goals": 12,
"case_set_sha256": "f8cf5347a8a3c8699e6ed0fd8371ea0441ff21e777629be91e4bdfc7452f7e34",
"cases": 240,
"modifiers": 20,
"raw_external_benchmark_rows_packaged": false
},
"hosts": {
"claude-code": {
"cases": 240,
"exact_core_parity": 1.0,
"mean_route_seconds": 0.0011545204557478427,
"p95_route_seconds": 0.0012631900608539581,
"safety_invariant_rate": 1.0,
"schema_valid_rate": 1.0
},
"codex": {
"cases": 240,
"exact_core_parity": 1.0,
"mean_route_seconds": 0.001154757182424267,
"p95_route_seconds": 0.0012666098773479462,
"safety_invariant_rate": 1.0,
"schema_valid_rate": 1.0
},
"openclaw-native": {
"cases": 240,
"exact_core_parity": 1.0,
"mean_route_seconds": 0.0011537160724401474,
"p95_route_seconds": 0.0012631416320800781,
"safety_invariant_rate": 1.0,
"schema_valid_rate": 1.0
}
},
"kind": "synthetic_integration_contract_e2e",
"release_version": "0.2.0"
}
3 changes: 2 additions & 1 deletion benchmarks/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"files": {
"generalization-1k.json": "819ec625a3c1053077a8b0f2a45ad893520a8ff03d92dfbb525c8aaa269fd0ea",
"toolsandbox-integrated.json": "80884e254260f4d8bf4f5196f8bdd49194ad0720d56ef65b58f09c8e5572e704",
"toolsandbox-router.json": "2eb7203f2f968b5b5f4b98ed2ddea537121ae8c611b8fbef75093bb8687ca35b"
"toolsandbox-router.json": "2eb7203f2f968b5b5f4b98ed2ddea537121ae8c611b8fbef75093bb8687ca35b",
"integrations-v0.2.json": "d33fc712162bdea34a0928eba4128d5ec9ee253a31a36fcd7c506e90a55f8db2"
}
}
7 changes: 6 additions & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ See [the model card](../references/model-card.md) for provenance and limitations

The router returns advisory JSON. In the standard skill flow, the agent reads the decision before constructing its plan. In the optional deep integration, the decision becomes a bounded desired-tool constraint for `LocalAuditPlanner` search.

The v0.2 native OpenClaw adapter is deliberately thinner: it registers
`before_prompt_build`, invokes the unchanged router out of process without a
shell, and appends a bounded advisory context. Codex and Claude Code bundles add
only host-standard discovery metadata around the same Skill. No adapter owns
permission checks or execution.

OpenClaw remains responsible for:

- candidate generation;
Expand All @@ -67,4 +73,3 @@ OpenClaw remains responsible for:
- Retrain the public profile prior only from license-reviewed dev data.
- Add executor families only after updating the routing contract, validators, tests, and promotion gates.
- Integrate a new planner by consuming the stable JSON contract instead of importing internal router functions.

Loading