CSV Close Check — Billing Access starter kit

QUICK START

Requires Node.js 24 or later. No package installation, credentials or Stripe
account is needed for the example.

1. Extract ALL files from this ZIP into one empty folder. Do not run inside
   the ZIP viewer. Keep the files together; their imports use relative paths.
2. Open a terminal in that extracted folder.
3. Run:

   node billing-access-example.mjs

Expected output: broken fixture = fail (HTTP 403), corrected fixture = pass
(HTTP 200), local_requests = 2, external_requests = 0. The example process exits
successfully only when both results match those expectations. It opens a temporary
loopback-only HTTP server on an available port, makes two local GETs and closes it.
No real account, payment or access permission is changed.

CHECK A SUITE OF REQUIRED CASES

   node billing-suite-runner.mjs suite-synthetic.json --replay

Expected: 1 pass, 1 mismatch, 1 inconclusive; exit code 1. The input deliberately
contains a wrong plan and an old observation. Fixing only the plan leaves the
suite non-passing. The browser example demonstrates the two separate corrections.

The suite envelope is {suite_version:1, suite_id, expected_case_ids, cases}.
Use the included JSON as the complete template. Declare the required case IDs
before collecting results. Each case uses the existing version 1 evidence schema.
At most 20 required IDs and 256 KiB total; each case retains the 32 KiB limit.
Case IDs must be unique; extra cases/fields are rejected. Missing required cases
remain in the result. Changing expected_case_ids changes coverage; review that
list in source control. No automatic test discovery or lifecycle coverage inferred.

For your own evidence, omit --replay:

   node billing-suite-runner.mjs suite.json
   node billing-suite-runner.mjs suite.json --junit

Default current mode requires declared sandbox evidence and checks checkpoint,
subscription and access observation timestamps against this machine's clock.
Maximum age is 300 seconds; optionally use --max-age-seconds N (1 through 3600).
Future timestamps are rejected. Accurate local time is required. The runner does
not fetch, authenticate or update evidence. --replay explicitly permits old or
synthetic records; it cannot establish current release readiness.

Output is JSON unless --junit prints JUnit XML to standard output. To save a report,
use your shell/CI output capture, preserving UTF-8. Do not swallow the exit code:
0 means every required case passed; 1 means at least one mismatch; 2 means blocked,
invalid input or other non-passing evidence. Pending/inconclusive/not-applicable
cases are JUnit errors, never skipped passes. Reject any nonzero exit in CI.
JUnit includes pseudonymous case IDs, fixed reasons, counts, scope and input hash;
no raw customer observations. Protect suite inputs and reports as private files.
The JSON findings contain case IDs, checkpoints and hashes but not raw evidence.
A pass covers only supplied successful-payment provisioning cases, not complete
release safety, protected action execution, renewals, cancellation or money saved.

OFFLINE SINGLE-CASE REPLAY

   node billing-access-runner.mjs evidence-synthetic.json

The included input deliberately fails (exit 1): an invented payment succeeded
but recorded Pro access is absent. This is an expected demo finding, not a crash.
Output is JSON. Exit codes: 0=matching checkpoint, 1=mismatch,
2=inconclusive/invalid, 3=within provisioning window, 4=no successful payment.
Only exit 0 is a successful paid-access checkpoint check.

USE YOUR OWN STAGING OBSERVATIONS

The JSON example is the version 1 input schema. Use pseudonymous references only.
Replace every observation and timestamp with fresh sandbox evidence. Set mode to
"sandbox-evidence". Choose a relevant successful-payment provisioning case and
explicitly expect the active paid plan at that checkpoint. Historical payment
alone does not establish current paid coverage. This checker does not cover
refunds, disputes, expiry, trials or cancellation policies.

Inputs must be UTF-8 JSON, at most 32 KiB, with only documented fields. References
use letters, digits, hyphens and underscores. UTC timestamps use milliseconds,
for example 2026-09-25T12:00:00.000Z; generate current timestamps, not this example.
Keep input files and output reports private. Do not include credentials, raw
provider payloads or real customer data. A fingerprint identifies bytes; it does
not authenticate their source.

OPTIONAL LOCAL STAGING GET

Developer setup is required. Test only an app endpoint you own or are authorized
to check, whose GET is read-only. The endpoint must read the same actual identity
and authorization policy as your protected feature, not echo expected values.

Configure these environment variables in your shell or CI environment editor:

CSV_ACCESS_PROBE_SANDBOX: YES
CSV_ACCESS_PROBE_ORIGIN: the exact endpoint origin, such as https://staging.example.com
CSV_ACCESS_PROBE_TOKEN: optional app sandbox bearer token; store as a secret

Never use a Stripe key. Do not put a token in a command, URL, evidence file,
source control, report or chat. No token is needed for the included example.
Do not disable TLS validation. HTTPS is required except literal loopback fixtures.

Set access to null in your fresh evidence file, then run:

node billing-access-runner.mjs --probe evidence.json https://staging.example.com/access-check

One GET is sent directly from your machine to that exact confirmed origin, with
an optional Authorization bearer token and a random X-CSV-Probe-Nonce header.
No requests pass through the CSV Close Check website. The probe has a 10-second
deadline and 8 KiB response limit, rejects redirects, and never retries.

ENDPOINT CONTRACT

Return Content-Type application/json and exactly these fields:

{"schema_version":1,"environment":"sandbox","nonce":"received nonce",
 "customer_ref":"your_pseudonymous_reference","plan_ref":"pro",
 "allowed":true,"checked_at":"current UTC timestamp with milliseconds"}

Use actual app state. Echo only the random nonce, not the expected access result.
The customer reference must match the input. Use null for plan_ref when no plan
applies. HTTP 200 may carry an allowed or denied assertion; HTTP 403 must carry
allowed:false. A wrong plan is a mismatch, not a schema error. HTTP 401, generic
403/error pages, invalid JSON and unbound responses are inconclusive. The response
timestamp must be no older than five seconds before the request starts and no
later than the time the request finishes. Keep clocks synchronized.

The probe advances the checkpoint to its completion time, preserves the source
checkpoint/fingerprint, and rechecks billing evidence freshness. It cannot turn
old subscription evidence into a pass. Output labels this an endpoint assertion,
not independent verification of billing or execution of a protected action.
A pass now does not prove access was first granted within the provisioning time.

IN A RELEASE WORKFLOW

Use the runner process exit code. Treat every nonzero code as needing attention;
never convert inconclusive into pass. You configure and operate your own CI or
scheduler. This download installs no service and starts no background monitoring.
The website does not receive runs, results or download-use telemetry.

TROUBLESHOOTING

"node" not found: install/configure Node.js 24+ through your normal development
toolchain. This kit does not install software.
Module not found: extract all files together, then open a terminal in that folder.
Inconclusive: read the fixed probe_error or checks, refresh stale observations,
and verify the declared sandbox origin and endpoint contract. Do not bypass errors.

CONTENTS AND SUPPORT

KIT-MANIFEST.json lists the SHA-256 digests of the six other files. It detects
accidental changes when compared with the files; it is not a digital signature.
The code is provided for evaluating CSV Close Check in your own local or staging
workflow. This kit has no npm dependencies. Keep its notices and limitations.

Website: https://csvclosecheck.com/billing-access
Support: csvclosecheck@gmail.com
The proposed connected $99/month pilot is not included in this download and is
not available for purchase yet. Existing $9/month hosted CSV comparisons are a
separate product. Successful examples are not evidence of revenue or customer ROI.
