Repository navigation
feat(hardware-runner): add benchmark-gate.v1 and outbound hardware runner - #40
Conversation
…wiring - Add private @loopwright/hardware-runner package depending only on core and taskpack - Wire 11-package build, test, lint, and npm tarball bundling scripts - Register hardware-runner in self-upgrade unmanaged workspaces and digest lockfile - Verify scaffold exports, incremental build, and global tarball resolution Task 1 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
…, and verifier CAS budget - Add optional hardware specs, targetCellId, and metricThresholds while preserving legacy hashes - Enforce unmixed hardware_execution checks and Evidence hardwareProvenance with CAS URI binding - Evaluate hardware provenance and bounds/comparative thresholds independently in evaluateAcceptance - Budget .loopwright-verifier/<slotId>/* CAS descriptors separately and block candidate smuggling Task 2 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
… server - Load bounded YAML and JSON configs via taskpack helpers with symlink guards. - Enforce pull-lease fencing, monotonic drift checks, expiry sweeps, and single-owner preemption. - Serve authenticated controller benchmark jobs, worker leases, SSE cancel, and 1 MiB CAS. - Persist exclusive SQLite CAS ownership, durable recovery fences, and signed receipts. Task 5 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
…ecovery - Enforce bidirectional hardware_execution and benchmark-gate.v1 compile, registry, and lease bounds. - Add streaming CAS staging, LWTREE01 base-tree bundling, and binary SecretScrubber verifier ingestion. - Settle preemption exhaustion as blocked BENCHMARK_PREEMPTED with zero repair or rework retries. - Wire offline reconcile, crash recovery, async acceptance verification, and mode parity checks. - Allow untouched classic baseline executables in the pre-Pi native executable guard. Task 3 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
- Compile hardware target.matrix cells, thresholds, and host-owned benchmark-gate.v1 bindings. - Enforce cross-consumer credential isolation across preflight, MCP, publishers, decisions, and GitHub auth. - Project hardware target cells to id, platform, and variant in turnkey memory finalizers. Task 4 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
…nd evaluator - Add trusted CUDA, ROCm, and Ascend hardware provenance probes and workload snapshots. - Implement two-stage native_os and Docker blind sandbox evaluation with kernel containment. - Add zero-inbound-port pull-lease worker, NAT loopback E2E, and optional live SSH smoke suites. Task 6 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
…dger - Add loopwright runner relay and worker CLI commands with signal and exit mapping. - Register hardware-runner package and evidence paths in the 23-row closure ledger. - Preserve 18 closedLocal and 5 unprovisionedExternal counts and packed binary help parity. Task 7 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
… workspace - Update module map, configuration, CLI, internals, and closure docs for hardware-runner. - Sync AGENTS.md, README.md, and loopwright skills to the 11-package workspace layout. - Mark Phase 3.2 specification as Shipped with all eight tasks completed. Task 8 of hardware-execution-benchmark-gate-and-remote-runner. Signed-off-by: thxCode <thxcode0824@gmail.com>
…ire bounds - Bound Stage A diagnostic truncation to 2048 chars without splitting UTF-16 surrogates. - Cap Stage B threshold-denial findings at 64 entries while preserving the threshold finding. - Allow finite negative comparative ratio thresholds and enforce baseTreeBundle invariants in relay. Signed-off-by: thxCode <thxcode0824@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). Reviewed |
| : input.source?.version === 1 | ||
| ? rawCandidateArtifacts.map(item => ({ ...item, mode: '100644' as const })) | ||
| : rawCandidateArtifacts; |
There was a problem hiding this comment.
Exec-bit policy is inconsistent between source versions. For v2 sources, a candidate file whose effective mode differs from what Pi can materialize is refused fail-closed in controller.ts (piMaterializedMode check), but here for v1 sources every candidate file's mode is unconditionally overwritten with 100644 — including files that decodeDelegatedWorkspace now captures with an explicit 100755 (see artifacts.push({ name, bytes, mode }) above). A v1 agent that legitimately chmod'd a file +x will have its exec bit silently stripped, and the run proceeds with a non-executable file, which the hardware runner then stages with mode 100644 in buildCandidateArtifactsDescriptor — a build/exec mismatch instead of a refusal. Either preserve an explicitly captured mode and let the controller's fail-closed check reject it (v2 behavior), or document why silent degradation is acceptable for v1.
There was a problem hiding this comment.
Not changed (false positive). decodeDelegatedWorkspace returns early at packages/controller/src/capture.ts:384-389, preserving every delegated overlay mode. Lines 411-425 execute only for native Pi decodePiCapture, where classic v1 workspaces are always materialized read-only (0o444 / 100644).
| if ( | ||
| existing.endpointId !== spec.endpointId | ||
| || existing.purpose !== spec.purpose | ||
| || existing.destinationRef !== spec.destinationRef | ||
| || existing.envName !== spec.envName | ||
| ) { | ||
| if (isBenchmark) { |
There was a problem hiding this comment.
Behavior regression: two ordinary gate.v1 external gates that share the same signingCredentialRef (or the same authCredentialRef) identifier but bind to different endpoints previously compiled fine — gateCredentialSpecs.set silently deduplicated the credential entry. With recordGateCredentialSpec, existing.endpointId !== spec.endpointId now triggers manifestInvalid('external gate credential ... conflicts with an existing endpoint binding'). A host reusing one gate signing credential across multiple endpoints is a legitimate topology (e.g. one shared relay signing key); it is only rejected here, not for a documented isolation reason. Consider permitting the reuse when envName matches and only the derived destinationRef differs, mirroring what the old code effectively allowed.
There was a problem hiding this comment.
Not changed (intentional security invariant). In TrustedRegistry, each CredentialBinding maps one credential id to a single endpoint-scoped destinationRef (gate-sign-<endpointId> / gate-auth-<endpointId>). Silently deduplicating a shared id across distinct endpoints would clobber the first endpoint's destination binding and allow cross-endpoint credential aliasing; this invariant is explicitly tested in packages/taskpack/test/benchmark-gate-compile.test.ts (lines 1510-1599).
- Support linux-landlock fallback with blockAllSockets seccomp when bwrap is unavailable on Linux. - Lower MAX_STAGE_B_RESULT_BYTES to 48 KiB and use OVERLAY_LIMITS.maxMaxBytes for grant bounds. - Preserve parseStrictJsonBytes error codes, parse SSE cancel frames strictly, and drop dead code. Signed-off-by: thxCode <thxcode0824@gmail.com>
- Fail closed when derived credential stream overlap exceeds 256 KiB and rethrow lstat errors. - Reject empty saved verifierArtifacts on passing replay and seed rate-limited progress at -Infinity. - Propagate non-syntax workspace read errors and deduplicate settlement and verdict-detail helpers. Signed-off-by: thxCode <thxcode0824@gmail.com>
…nostics - Reject GITHUB_TOKEN and GH_TOKEN on ordinary gate.v1 credential bindings and quote metric keys. - Exclude models.json apiKeyEnv variables from command.v1 checks and deduplicate scrubber helpers. - Document provider credential precedence and replace nested ternary check capability mapping. Signed-off-by: thxCode <thxcode0824@gmail.com>
- Track sticky unknown and fenced worker settlements across runs and prioritize fenced over SIGINT. - Source runner secret env fields from @loopwright/hardware-runner and remove nested diagnostic ternary. Signed-off-by: thxCode <thxcode0824@gmail.com>
|
Addressed the Ubuntu CI failure and all 31 OpenCodeReview Round 1 findings ( CI Failure Fix (Ubuntu 24.04 x64 & arm64)
Inline Review Threads (14 total: 10 fixed & resolved, 4 not changed / left open)
Summary-Routed Items (17 total: 15 fixed, 2 not changed)
Verification
|
…sandboxes - Allow read-only /etc/ssl/openssl.cnf, certs, ca-certificates, and pki in Linux Landlock and bwrap. - Keep /etc/ssl/private denied so Node 26 initializes cleanly on Ubuntu 24.04 without exposing keys. Signed-off-by: thxCode <thxcode0824@gmail.com>
…escape CLI regexes - Catch ARTIFACT_INVALID alongside CONFIG_SYNTAX when falling back from JSON workspace parsing in step and reconcile. - Keep artifacts.read outside JSON fallback catch so missing or oversized workspaces still propagate. - Restore createRateLimitedProgress initial timestamp anti-flood invariant and escape CLI secret field regexes. Signed-off-by: thxCode <thxcode0824@gmail.com>
|
Addressed the Round 2 Ubuntu CI failures and all 3 Round 2 OpenCodeReview findings ( CI Failure Fixes (Ubuntu 24.04 x64 & arm64)
Round 2 OpenCodeReview Findings (3 total: 3 fixed)
Verification
|
…cket probe path - Narrow /etc/pki in Linux bwrap and Landlock read roots to public trust-store subpaths only. - Use a short relative ./p.sock probe path in evaluator.test.ts to stay under Linux UNIX_PATH_MAX. Signed-off-by: thxCode <thxcode0824@gmail.com>
|
Addressed the single Round 3 OpenCodeReview finding and the last remaining Ubuntu 24.04 shard
Verification
|
What type of PR is this?
/kind feature
/area core
/area controller
/area github-app
/area cli
/area docs
Summary
Implements Phase 3.2 (
hardware_execution,benchmark-gate.v1, and outbound remote hardware runner) across the Loopwright workspace perspecs/2026-11-21-hardware-execution-benchmark-gate-and-remote-runner.md:@loopwright/hardware-runner(11th workspace package): Adds an outbound-only pull-lease HTTP/TLS relay server, SQLite/in-memory lease queue with monotonicleaseEpochfencing and preemption requeue (leased/running -> preempted -> queued), hardware probe collectors (CUDA, ROCm, Ascend, CPU/synthetic), and a two-stage blind evaluator:held_out_workloads, verifiesLWTREE01base trees andSecretScrubberbinary safety, and uploads SHA-256-verified CAS build artifacts (.cubin,.o,.sass, etc.).held_out_workloadsread-only under OS confinement (macOS Seatbelt with(deny process-fork), Linuxbwrap+ socket-denying BPF, or Docker with--init,--user, exact GPU device pinning, and socket-denying seccomp), enforcesnetworkMode: 'none', exports zero Stage B files, and returns HMAC-signed verdicts with physicalhardwareProvenanceand numericmetrics.@loopwright/core: Extendstarget.matrixcells with acceleratorhardwaremetadata,hardwareProvenance,metricThresholds(boundsandcomparativeincluding finite negative ratios), andverifierArtifactBudget(MAX_LIMITSup to16 GiB/16,384files); enforces provenance and metric thresholds insideevaluateAcceptance.@loopwright/controller: Unlockshardware_executionchecks strictly when bound to a host-ownedbenchmark-gate.v1handler and hardware matrix cell; adds1 MiBstreaming CAS staging/ingestion,LWTREE01bundling, preemption exhaustion settlement asblocked(BENCHMARK_PREEMPTED, zero LLM repair retries), and offline recovery/reconciliation parity without relaxingexternal_writereconcile_requiredfences.@loopwright/taskpack&@loopwright/github-app: Compiles hardware matrix cells and host-ownedbenchmark-gate.v1gates while forbidding manifest-levelurl,signingCredentialRef, orauthCredentialRefoverrides; enforces strict cross-consumer credential isolation across benchmark endpoints, local command gates,GITHUB_TOKEN/GH_TOKEN, decisions, MCP, and publication; projects hardware target cells in memory finalization.@loopwright/cli& closure ledger: Addsloopwright runner relay --config FILE [--json]andloopwright runner worker --config FILE [--once] [--json](bundled into@gpustack/loopwright) and registers@loopwright/hardware-runnerevidence paths while preserving the honest 23-row closure split (18closedLocal,5unprovisionedExternal).README.md,AGENTS.md,docs/, skills, andspecs/2026-11-21-hardware-execution-benchmark-gate-and-remote-runner.md(Status: Shipped).Contract & upgrade impact: Purely additive. Existing
Taskpack,TaskContract,TrustedRegistry,gate.v1, andcommand.v1(parameters.mounts/allow-host-mounts) workflows continue unchanged;hardware_executionremains fail-closed unless explicitly bound to a hardware cell and host-ownedbenchmark-gate.v1endpoint.Verification boundaries: Verified locally on macOS across all 11 workspace packages (unit, integration, loopback relay/worker, Seatbelt isolation, packed CLI tarball, and closure failure matrix). Hugo HTML/
llms.txtgeneration (npm run site), Linuxbwrap, Docker GPU passthrough, and live SSH physical GPU hosts (LOOPWRIGHT_CUDA_SSH_HOST/LOOPWRIGHT_ROCM_SSH_HOST) remain external CI/host boundaries not executed on this local macOS machine.Related Issues
NONE
Verification
npm run buildpassed cleanlynpm run typecheckpassed cleanlynpm run lintpassed cleanlynpm run lint:docspassed cleanly (27docs pages,37linked sources,0errors)npm run sitebuilt and verified with zero broken links (hugois not installed on this local macOS host;check-docs.mjspassed locally and full Hugo site generation runs in CI)npm test:1,643tests,1,638passed,0failed,5skipped — 3 Linux-only sandbox tests and 2 opt-in live SSH smokes;loopwright closure --verify-failures --json:18closedLocal,5unprovisionedExternal,14/14failure matrix,56checked files)(deny process-fork)and write/network containment); Linuxbwrap, Docker GPU, and live SSH CUDA/ROCm execution remain unexecuted external boundaries.github/workflows/maintains least-privilegepermissionsand remains protected against untrusted taskpack/sandbox writes (zero workflow files modified)Signed-off-by: thxCode <thxcode0824@gmail.com>Developer Certificate of Origin (DCO) included on all commitsDoes this PR introduce a user-facing change?