Skip to content

feat: HV-2 scheduling driver + native admission telemetry endpoint - #88

Merged
hardcoreerik merged 4 commits into
masterfrom
feat/hv2-scheduling-runner
Jul 22, 2026
Merged

feat: HV-2 scheduling driver + native admission telemetry endpoint#88
hardcoreerik merged 4 commits into
masterfrom
feat/hv2-scheduling-runner

Conversation

@hardcoreerik

@hardcoreerik hardcoreerik commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • New Tools/Hv2SchedulingRunner for HV-2 (docs/NATIVE_RUNTIME_HIVE_VALIDATION_PLAN.md): proves capability/resource-aware scheduling across the fleet — a large-context job denied on the low-VRAM box with a real fail-closed exception, admitted on higher-VRAM boxes, plus the inverse (small-context job admitted everywhere) proving denial is footprint-driven, not box-driven.
  • NativeContextSize is a per-worker-process startup config, not a per-job HIVE parameter — so the two checks run as two fleet configurations of the same three machines (--phase large|small) rather than two job shapes against one running config.
  • New GET /hive/native-telemetry endpoint on HiveNodeServer, wired from HiveService.cs, exposing RuntimeReservationSnapshot (RejectedAdmissionCount, LastRejectionReason, VRAM totals) — this existed in-process but had no remote observability surface on a headless worker before this. Unauthenticated read-only, same posture as the existing /hive/info.

Test plan

  • dotnet build on the new tool, main Avalonia project, and Daemon — all green.
  • dotnet test --filter FullyQualifiedName~Hive — 112/112 passing, no regressions.
  • Real HV-2 run against the fleet (both phases) — evidence to follow in a comment once run.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a native execution telemetry endpoint for viewing admission, reservation, lease, and rejection diagnostics.
    • Native worker runtimes now provide live reservation snapshots through the node server.
    • Added an HV-2 scheduling verification tool that runs worker admission scenarios and generates JSON evidence reports.
  • Bug Fixes

    • Improved visibility into native execution admission outcomes, including rejected requests and resource availability.

Adds Tools/Hv2SchedulingRunner for HV-2 (docs/
NATIVE_RUNTIME_HIVE_VALIDATION_PLAN.md): proves capability/resource-
aware scheduling across the fleet. Since NativeContextSize is a
per-worker-process startup config rather than a per-job HIVE
parameter, the two HV-2 checks (large-context denial on the low-VRAM
box, small-context admission everywhere) run as two separate fleet
configurations of the same three machines against the same driver,
using --phase large|small.

Also exposes RuntimeReservationSnapshot (RejectedAdmissionCount,
LastRejectionReason, Total/Reserved/AvailableBytes) over a new
GET /hive/native-telemetry endpoint on HiveNodeServer, wired from
HiveService.cs after building the native runtime. This telemetry
existed in-process but had no remote observability surface on a
headless worker -- only the Avalonia GUI's diagnostics panel could
see it. Unauthenticated read-only, same posture as the existing
/hive/info endpoint.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hardcoreerik

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hardcoreerik, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 917d564c-d872-40a2-8e4e-5df48bb6d7ee

📥 Commits

Reviewing files that changed from the base of the PR and between 84eff6d and a99fbd1.

📒 Files selected for processing (5)
  • OrchestratorIDE.Daemon/HiveService.cs
  • OrchestratorIDE/Services/Hive/HiveNodeServer.cs
  • Tools/Hv2SchedulingRunner/Hv2SchedulingRunner.csproj
  • Tools/Hv2SchedulingRunner/Program.cs
  • docs/NATIVE_RUNTIME_HIVE_VALIDATION_PLAN.md
📝 Walkthrough

Walkthrough

Adds native admission telemetry exposure to Hive nodes and introduces an HV-2 scheduling runner that dispatches native work, polls outcomes, verifies denial telemetry, and writes JSON evidence reports.

Changes

Native telemetry verification

Layer / File(s) Summary
Telemetry endpoint and runtime wiring
OrchestratorIDE.Daemon/HiveService.cs, OrchestratorIDE/Services/Hive/HiveNodeServer.cs
Native runtime reservation snapshots are connected to GET /hive/native-telemetry, which returns camelCase JSON or {} when unavailable.
HV-2 runner setup and dispatch
Tools/Hv2SchedulingRunner/Hv2SchedulingRunner.csproj, Tools/Hv2SchedulingRunner/Program.cs
Adds a net10.0 executable that parses worker settings, creates native campaign work units, dispatches them, and polls task status.
Admission evidence and verdicts
Tools/Hv2SchedulingRunner/Program.cs
Collects pre/post telemetry, derives admission results, records per-job evidence, computes pass/fail status, and writes JSON reports.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runner
  participant Warchief
  participant WorkerNode
  participant EvidenceFile
  Runner->>WorkerNode: Fetch baseline NativeTelemetry
  Runner->>Warchief: Submit native Hive campaign
  Warchief->>WorkerNode: Dispatch native work unit
  WorkerNode-->>Warchief: Return task status
  Runner->>Warchief: Poll task status
  Runner->>WorkerNode: Fetch post-dispatch NativeTelemetry
  Runner->>EvidenceFile: Write Hv2Report JSON
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main additions: the HV-2 scheduling driver and the native admission telemetry endpoint.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hv2-scheduling-runner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Tools/Hv2SchedulingRunner/Program.cs`:
- Around line 46-58: Validate the --phase large configuration in the worker
setup around GetArg and the workers list: require --low-vram-worker to be
provided and match one of the configured worker IDs, otherwise throw an
InvalidOperationException before running jobs. Preserve the existing
ExpectDenied assignment for the matched worker and normal behavior for other
phases.
- Around line 98-101: Replace the suffix-based worker lookup in the foreach over
workUnits with positional pairing to the workers collection, preserving the
one-to-one order established when workUnits was built. Use the paired worker’s
Id and related metadata for task attribution, and remove the ambiguous
workers.First EndsWith lookup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b3d83de-b6eb-44de-ad76-d8cf267fa326

📥 Commits

Reviewing files that changed from the base of the PR and between 84eff6d and c54ea52.

📒 Files selected for processing (4)
  • OrchestratorIDE.Daemon/HiveService.cs
  • OrchestratorIDE/Services/Hive/HiveNodeServer.cs
  • Tools/Hv2SchedulingRunner/Hv2SchedulingRunner.csproj
  • Tools/Hv2SchedulingRunner/Program.cs

Comment thread Tools/Hv2SchedulingRunner/Program.cs
Comment thread Tools/Hv2SchedulingRunner/Program.cs
hardcoreerik and others added 2 commits July 21, 2026 07:20
…wrapper

Confirmed empirically during real-fleet calibration: a genuine admission
denial with correct numbers ("Requires ~6.8 GB, only 5.6 GB available")
still surfaces as HiveWorkerAgent's generic "native role runtime failed.
Phase 3B does not fall back." wrapper text at the task level -- the
detailed RuntimeAdmissionDeniedException message never reaches
HiveTaskResult.ErrorMsg, only the worker's own local log. Classify
denial by task status alone (this execution kind can structurally never
fall back instead) and let the separate /hive/native-telemetry check
be the authority on whether it was specifically an admission denial
with correct numbers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
HardcorePC (6GB) denied at ctx=40000 with a real
RuntimeAdmissionDeniedException and correct telemetry
(RejectedAdmissionCount 3->6, "Requires ~6.8 GB, only 5.6 GB
available"), then admitted cleanly at ctx=8192 -- same box, same
model, proving denial is footprint-driven not box-driven.
HardcoreLaptopMSI (8GB) admitted at both. The 16GB leg (NewcorePC) is
blocked on a separate, genuine finding: running the Daemon locally on
NewcorePC to add it as a worker regenerated its own HIVE identity
(same DPAPI/AES-GCM collision as HV-1, now on the warchief side), and
unlike HV-1's workers this can't be re-paired -- the Daemon can never
approve incoming pairing by its own design. Filed as an open
follow-up rather than worked around. Also documents a driver
classification bug found and fixed mid-campaign, and a real inbound-
firewall gap worked around via SSH rather than asking to change
system settings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hardcoreerik

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

…worker

Prevents a silent vacuous PASS: without this guard, an omitted or
mistyped --low-vram-worker left ExpectDenied false for every worker,
so a misconfigured large-context run could report success without
ever exercising the admission-denial path it exists to prove.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@hardcoreerik

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 55 minutes.

@hardcoreerik
hardcoreerik merged commit 792a717 into master Jul 22, 2026
2 checks passed
@hardcoreerik
hardcoreerik deleted the feat/hv2-scheduling-runner branch July 22, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant