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: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
go-version: "1.26.5"
cache: false
- run: npm ci
- run: npm run release:check
- name: Build pinned HF Broker
run: |
brokerkit_version="$(node -p 'require("./package.json").config.brokerkitVersion')"
Expand All @@ -30,8 +31,6 @@ jobs:
test "$(git -C "$RUNNER_TEMP/brokerkit" rev-parse "refs/tags/$brokerkit_version^{commit}")" = \
"$(git -C "$RUNNER_TEMP/brokerkit" rev-parse HEAD)"
go build -C "$RUNNER_TEMP/brokerkit" -o "$RUNNER_TEMP/hf-broker" ./brokers/huggingface/cmd/hf-broker
"$RUNNER_TEMP/hf-broker" credential requirements > "$RUNNER_TEMP/hf-broker-credential-requirements.json"
cmp src/mlclaw/hf-broker-credential-requirements.json "$RUNNER_TEMP/hf-broker-credential-requirements.json"
- name: Test pinned BrokerKit agent tools
env:
MLCLAW_HF_BROKER_BINARY: ${{ runner.temp }}/hf-broker
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
echo "runtime_image=${runtime_image}" >> "$GITHUB_OUTPUT"
echo "runtime_tag=${version}-openclaw-${openclaw_version}" >> "$GITHUB_OUTPUT"
- run: npm ci
- run: npm run release:check
- name: Build pinned HF Broker
run: |
git init "$RUNNER_TEMP/brokerkit"
Expand All @@ -80,8 +81,6 @@ jobs:
"refs/tags/${{ steps.runtime-config.outputs.brokerkit_version }}^{commit}")" = \
"$(git -C "$RUNNER_TEMP/brokerkit" rev-parse HEAD)"
go build -C "$RUNNER_TEMP/brokerkit" -o "$RUNNER_TEMP/hf-broker" ./brokers/huggingface/cmd/hf-broker
"$RUNNER_TEMP/hf-broker" credential requirements > "$RUNNER_TEMP/hf-broker-credential-requirements.json"
cmp src/mlclaw/hf-broker-credential-requirements.json "$RUNNER_TEMP/hf-broker-credential-requirements.json"
- name: Test pinned BrokerKit agent tools
env:
MLCLAW_HF_BROKER_BINARY: ${{ runner.temp }}/hf-broker
Expand Down
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ Do not run mutation testing during ordinary implementation work. Keep its
configuration and CI declaration current so a dedicated mutation run can be
performed separately.

Do not report work as complete until the original user-visible workflow has
been reproduced and verified end to end in its real target environment. Tests,
mocks, CI, health checks, successful builds, and deployments are supporting
evidence, not substitutes. If full verification is impossible, state that
clearly and report the work as unverified.

## Release Versions

- Treat `package.json` as the only hand-edited source for the MLClaw package,
OpenClaw, BrokerKit package, BrokerKit binary, and runtime image versions.
- Keep the `openclaw-brokerkit` dependency exactly equal to
`config.brokerkitPluginVersion`.
- Do not hand-edit Dockerfile release defaults or
`src/mlclaw/release-config.generated.ts`. After editing release metadata, run
`npm install --package-lock-only` if dependency metadata changed, then run
`npm run release:sync`.
- Run `npm run release:check` before committing. CI rejects version drift.

## Runtime Boundary

- Treat the OpenClaw process and agent account as untrusted.
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG OPENCLAW_VERSION=2026.7.1
ARG OPENCLAW_BASE_IMAGE=ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION}
ARG BROKERKIT_PLUGIN_VERSION=0.3.3
ARG BROKERKIT_VERSION=hf-broker/v0.4.0
ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/huggingface/mlclaw:0.4.7-openclaw-2026.7.1
ARG BROKERKIT_PLUGIN_VERSION=0.3.4
ARG BROKERKIT_VERSION=hf-broker/v0.4.2
ARG MLCLAW_RUNTIME_IMAGE=ghcr.io/huggingface/mlclaw:0.4.8-openclaw-2026.7.1

FROM golang:1.26.5-bookworm AS hf-broker-build
ARG BROKERKIT_VERSION
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,24 @@ app; the bootstrapper runs locally.

The `hf` CLI login is a provisioning credential: ML Claw uses it to create and
configure resources owned by your account. HF Broker uses a separate, durable
fine-grained credential whose required permissions are versioned by BrokerKit.
Interactive bootstrap opens Hugging Face's token form with those fields
preselected, then accepts the new token through a hidden local prompt. Creating
or replacing this credential never changes the active `hf` CLI login. For
automation, pass a `0600` file through `--broker-hf-token-file`; ML Claw does
not accept the token as a command-line value.
fine-grained credential whose selected permissions form BrokerKit's hard
upstream authority ceiling. Interactive bootstrap opens an empty Hugging Face
token form so you can choose those permissions and resources, then accepts the
new token through a hidden local prompt. Creating or replacing this credential
never changes the active `hf` CLI login. For automation, pass a `0600` file
through `--broker-hf-token-file`; ML Claw does not accept the token as a
command-line value.

The broker owns the selected credential; OpenClaw receives only a separate
agent credential that can call the broker's typed, policy-checked routes. It
cannot read the token or use the admin-only operator API. Rerunning bootstrap
reuses a healthy saved broker credential without reopening the form. A missing,
invalid, wrong-account, or under-scoped credential must be repaired before ML
Claw continues; it never silently substitutes the active CLI login. Existing
dedicated inference tokens remain supported through `MLCLAW_ROUTER_TOKEN`,
`HF_ROUTER_TOKEN`, or `--router-token-file` during migration.
invalid, or wrong-account credential must be repaired before ML Claw continues;
it never silently substitutes the active CLI login. When a selected permission
does not cover an operation, HF Broker denies that operation without weakening
the rest of the deployment. Existing dedicated inference tokens remain
supported through `MLCLAW_ROUTER_TOKEN`, `HF_ROUTER_TOKEN`, or
`--router-token-file`.

## Default Flow

Expand Down
Loading
Loading