# AI calculator verification article package Prepared: 2026-10-10. Status: private editorial draft. This directory contains independent Japanese and English articles, a local calculation demonstration, and its executed tests. It does not contain a published app. ## Files - article_ja.md: Japanese article, yen-denominated teaching example - article_en.md: independent English article, neutral integer minor units - editorial_brief.md: audience, useful result, scope, and visual direction - source_metadata.json: primary-source claim mapping and recheck triggers - rights.md: source and asset rights notes - demo/discount.mjs: corrected and intentionally faulty calculation functions - demo/test-discount.mjs: identical fixed test cases for either implementation - demo/test-log.txt: actual execution output, date, runtime, and exit codes - demo/sha256.txt: checksums of the demonstration source, tests, and log - assets/diagram_ja.svg and assets/diagram_en.svg: original explanatory diagrams - build/diagrams.py: diagram generator - preview.html and preview_en.html: final HTML previews - qa/visual.json: recorded diagram visual QA and browser QA status ## Reproduce the calculation checks Use an existing Node.js installation with BigInt and ES module support. The recorded run used v24.19.0. No packages were installed. Only that runtime version was tested; this is not a promise of support across Node versions. From this article directory, run: node demo/test-discount.mjs faulty Expected: 32 passed, 3 failed, exit code 1. Failure is intentional. Then run: node demo/test-discount.mjs correct Expected: 35 passed, 0 failed, exit code 0. The commands only execute local arithmetic and write their output to the terminal. The source makes no network calls, reads no user files, and uses no credentials or personal data. Do not substitute this demo for a payment or accounting implementation. ## Exact contract Both inputs must be JavaScript numeric values that satisfy Number.isSafeInteger. The amount is in [0, 1,000,000,000] integer minor units, inclusive; the discount percentage is in [0, 100], inclusive. Text such as "101" is rejected, as are a blank string, missing values, fractions and out-of-range values. This function is not an HTML-form parser. The result is the final payable amount rounded half-up to a minor unit. The choice to round the final amount, rather than the discount, is part of this example's specification. It is not a merchant policy, legal rule, or advice on tax. After validation, the function converts the inputs to BigInt. For a nonnegative integer numerator n, write n = 100q + r, where 0 <= r < 100. Dividing n + 50 by 100 with integer truncation yields q when r < 50, and q + 1 when r >= 50. This is the chosen half-up rule. The result is at most 1,000,000,000, so its conversion back to Number remains within the safe-integer range. ## What was actually run The same 35 named test cases ran against each implementation. There are 12 fixed-output cases, 21 invalid-argument cases, one repeated A-B-A sequence, and one valid-after-invalid sequence. Some named cases contain more than one assertion or function call; "35" means named cases, not individual assertions, user sessions, or coverage percentage. Expected values were specified separately from the functions and are literal values in the test file, with arithmetic comments. The test harness does not calculate its expected outputs by copying the implementation formula. Both implementations share input validation so that this demonstration isolates the rounding-order defect. The faulty implementation fails two half-unit cases and the repeated sequence containing one of those cases. This represents one intentionally introduced defect observed in three cases. Actual execution: 2026-10-10T05:03:10Z on Node.js v24.19.0, as preserved in demo/test-log.txt. ## Limits - Function-level tests only, using a local command-line runtime - No browser, form parser, UI, mobile, accessibility, or end-to-end QA - The repeated function-call sequence does not test button clicks or stale screen output - No exhaustive enumeration of the accepted input domain, property-based fuzzing, independent security audit, or performance benchmark - No claims about any particular AI tool's code-generation reliability or provenance - No live customer data, accounts, API calls, transactions, or application deployment - Passing this test set does not establish that an app is safe to publish Original diagrams are at assets/diagram_ja.svg and assets/diagram_en.svg, generated by build/diagrams.py. Their visual QA is recorded in qa/visual.json. Final HTML previews are preview.html and preview_en.html. Browser QA status: NOT_RUN. Diagram inspection does not establish full-page layout or interaction quality.