Add np settings effective-sizing, and pin the heatmap axis order - #176
Merged
Conversation
… order The effective-sizing endpoint shipped with a frontend client only. CLAUDE.md requires every API endpoint to have both clients, and this one is worth more from the CLI than most read-only endpoints: with Performance:ManualTuning false (the default), `np settings get Engine` reports the inert preset from configuration rather than the numbers the process is running on, so there was no way to answer "what is this host actually sized to" without a browser. MCP stays out deliberately - it has no admin-settings tools at all, and the endpoint is already recorded in that known-gaps list. The table renders the resolved value next to the constraint that produced it, and surfaces the pending mode only when the saved switch differs from the booted one, which is the only case where two numbers are in play. Undetected memory prints as CPU-only sizing rather than 0 GB - a degraded plan that ignored RAM reads nothing like a host with no memory. Also add the regression test the heatmap sort fix shipped without: the axis was ordered with a bare .sort(), so [1, 2, 10] came out as [1, 10, 2] and every heatmap crossing a digit boundary drew its cells under the wrong time. The existing heatmap fixture uses a single timestamp and passes against the buggy code; this one fails against it. Closes #89 Closes #77
| .RespondWith(Response.Create().WithStatusCode(200).WithBodyAsJson(new | ||
| { | ||
| manualTuning = false, desiredManualTuning = false, | ||
| processorCount = 2, usableMemoryBytes = (long?)null, isDesktop = true, |
| .RespondWith(Response.Create().WithStatusCode(200).WithBodyAsJson(new | ||
| { | ||
| manualTuning = false, desiredManualTuning = true, | ||
| processorCount = 4, usableMemoryBytes = (long?)null, isDesktop = true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
np settings effective-sizing(#89)The effective-sizing endpoint shipped with a frontend client only. CLAUDE.md requires both clients, and this endpoint earns it more than most read-only routes: with
Performance:ManualTuningfalse (the default),np settings get Enginereports the inert preset from configuration rather than the numbers the process is running on. There was no way to answer "what is this host actually sized to" without a browser.MCP stays out deliberately — it has no admin-settings tools at all, and the endpoint is already recorded in that known-gaps list.
The table renders each resolved value next to the constraint that produced it (
Cpu/Ram/Floor/Ceiling/Manual), surfaces the pending mode only when the saved switch differs from the booted one, and prints undetected memory as CPU-only sizing rather than0 GB— a degraded plan that ignored RAM reads nothing like a host with no memory.Heatmap regression test (#77)
The numeric-sort fix shipped without one. The axis was ordered with a bare
.sort(), so[1, 2, 10]came out as[1, 10, 2]and every heatmap crossing a digit boundary drew its cells under the wrong time. The existing heatmap fixture uses a single timestamp and passes against the buggy code; the new test fails against it (verified by reverting the fix).Note for triage — a guard that should have caught #89
EndpointClientCoverageTestsexists precisely to enforce "every endpoint needs both clients", and it passed.IsCoveredlets a client-side wildcard satisfy an endpoint's literal segment, so the CLI's parameterizedapi/admin/settings/{section}call silently "covered" every literal sub-route beneath it.I measured a strict fix (client
*only matches endpoint*): it surfaces ~7 more routes, but a mix of real gaps and false positives needing per-route investigation. That is its own change, not part of this one, so it is not included here — worth a separate issue.Verification
dotnet test tests/NodePilot.Cli.Tests— 484 passed.npx vitest run src/__tests__/pages/MetricsPage.test.tsx— 8 passed; the new case fails against the pre-fix sort.Closes #89
Closes #77