docs: fix the README "Result Object Shape" example to match real engine output#27
Open
dmchaledev wants to merge 1 commit into
Open
docs: fix the README "Result Object Shape" example to match real engine output#27dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
… output The documented sample result was fabricated and internally inconsistent (e.g. parallel_hosts: 800 implies 8 CPU cores, yet optimized_scan_time: 19 != ceil(1500/8), and none of the cost/ROI figures matched the engine). It also omitted real fields: scaling_info, self_managed_annual, managed_annual and setup_cost. Replace it with the verified output for the input the example already implied (1000 hosts / medium / weekly / hailbytes_asm, 8h window) and state that input explicitly. Add a regression test that asserts the documented numbers stay in sync with calculate(), so the example can't drift again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GszLaxg5to1DvSn8cvFiBD
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.
Problem
The "Result Object Shape" example in
README.md(the npm landing page for this package) is fabricated, internally inconsistent, and missing real fields. For a calculator whose entire value proposition is the numbers it produces, a self-contradictory sample output on the front page is a credibility problem.The example is implicitly the canonical default input —
storage_gb: 70only occurs for 1000 hosts / medium / weekly /hailbytes_asm/ 8h window — yet almost none of the documented numbers match whatcalculate()actually returns for that input:cpu_coresram_gbram_recommendednetwork_bandwidth_mbpsoptimized_scan_time_minutesparallel_hostsscan_window_utilizationinfrastructure_monthly_awsinfrastructure_monthly_azuretotal_monthly_awstotal_monthly_azureroi.self_managed_monthlyroi.monthly_savingsroi.annual_savingsroi.roi_percentageThe old numbers don't even agree with each other:
parallel_hosts: 800impliescpu_cores: 8(consistent), but thenoptimized_scan_time_minutesshould beceil(1500 / (800/100)) = 188, not the documented19. Andscan_window_utilization: 3.9%is impossible alongside those values for any 1–24h window.The example also omitted real fields that the engine and
index.d.tsdefine:vm_resources.scaling_info,roi_analysis.self_managed_annual,roi_analysis.managed_annual, androi_analysis.setup_cost.Fix
calculate()for the input it already implied, and state that input explicitly above the block.index.d.tsshape.test/calculate.test.mjs→describe('Documentation')) that asserts the documented numbers stay in sync withcalculate(), so the example can't silently drift again.Verification
All numbers were produced by running
calculate()against the documented input.npm testpasses (66 tests, +1 new).This is independent of the other open PRs/issues, which focus on
calculate()input handling, thetime_pressuretype, DOM-free import, the test glob, CDN pinning, a11y, and traditional storage sizing — none touch the README result example.🤖 Generated with Claude Code
https://claude.ai/code/session_01GszLaxg5to1DvSn8cvFiBD
Generated by Claude Code