CSV & JSON Key Guard
CSV & JSON Key Guard audits composite business keys and structural data errors without sending file contents to a server. The extension has no runtime npm dependencies and supports CSV, TSV, JSON arrays, NDJSON, and JSONL.
Free and Pro commands
Free commands work without a license key:
- Key Guard: Audit Active File checks the current supported file and publishes VS Code diagnostics.
- Key Guard: Open Sample Invoice CSV opens and audits a built-in example.
Pro commands require a live Gumroad or Polar license verification, with a seven-day cached grace window used only when a previously valid provider becomes temporarily unreachable:
- Key Guard: Audit Workspace Batch (Pro) audits supported files outside
node_modules and .git, including cross-file duplicate keys.
- Key Guard: Export Audit Report (Pro) writes the latest batch result as Markdown or formula-neutralized CSV.
- Key Guard: Activate Pro License stores the key in VS Code SecretStorage rather than workspace settings.
- Key Guard: Clear Pro License deletes the stored license session.
The default composite key is supplier_id + invoice_id. Configure keyGuard.compositeKeys per resource when a data set uses different field names.
Deterministic offline build and test
From this extension directory:
python -X utf8 scripts/pack_vsix.py
node --test tests/extension.test.js
The standard-library packer writes dist/csv-json-key-guard-0.1.0.vsix. It fixes ZIP timestamps and entry ordering, so unchanged inputs produce unchanged bytes. No npm install is required for this build or test path.
Install the local package with Extensions: Install from VSIX... or:
code --install-extension dist/csv-json-key-guard-0.1.0.vsix
Gumroad product binding
- Create the software product in Gumroad and enable its license-key block.
- Copy the product ID shown by Gumroad. Newer Gumroad products require
product_id, not the product permalink.
- For a distributable, owner-bound package, replace the empty
default for keyGuard.gumroadProductId in package.json, then rebuild the VSIX. For local validation only, set keyGuard.gumroadProductId in VS Code settings.
- Keep
keyGuard.licenseProvider set to gumroad, run Key Guard: Activate Pro License, and enter a buyer key.
The client posts product_id, license_key, and increment_uses_count=false to https://api.gumroad.com/v2/licenses/verify. Pro access is granted only when success is true and the purchase is not marked refunded, chargebacked, or disputed. License enforcement is client-side and should be treated as a purchase gate, not tamper-proof DRM.
Switch to Polar
The Polar adapter is isolated from the analyzer and command code. The project target is to make this switch when the owner chooses the stated US$10 payout-threshold route; that threshold is an operational assumption to reconfirm with Polar before migration. To migrate:
- Set
keyGuard.licenseProvider to polar.
- Set
keyGuard.polarOrganizationId to the issuing organization ID. To bind it into a distributable, set that configuration property's default in package.json before packaging.
- Run Key Guard: Clear Pro License, then Key Guard: Activate Pro License with a Polar-issued key.
- Run the local test suite and a controlled key validation before publishing the migrated build. Reconfirm Polar's current API contract and payout terms at migration time.
The configured adapter posts { "key", "organization_id" } to https://api.polar.sh/v1/customer-portal/license-keys/validate and accepts only status: "granted".
Marketplace publication with no project purchase
The repository needs no paid dependency or packaging service. Marketplace publication still requires the owner to create the publisher identity and authentication requested by the current VS Code Marketplace process.
Create or confirm the Marketplace publisher ID mmo-data-tools; it must match package.json.
Install Microsoft's publishing CLI when network access is available:
npm install --global @vscode/vsce
Validate the Marketplace package path:
vsce package
Authenticate the publisher using the current Microsoft-documented method, then publish:
vsce publish
Microsoft's publishing documentation currently notes a transition away from global Azure DevOps personal access tokens on December 1, 2026. Check the current official instructions immediately before publication rather than storing a long-lived token in this repository.
Official references checked for this build:
Scope and limitations
- UTF-8 byte validation is fatal for file reads; unsaved editor text is already decoded by VS Code and cannot be byte-validated again.
- Duplicate matching is type-aware. For example, CSV text
0012 is distinct from 12, and JSON string "12" is distinct from JSON number 12.
- Diagnostics use 1-based source coordinates internally and are converted to VS Code's 0-based ranges at the UI boundary.
- A JSON file must contain an array of objects. NDJSON/JSONL expects one object per non-blank physical line.
- License-provider calls transmit only the configured product/organization identifier and the entered license key; audited file content stays local.
License
MIT. See LICENSE.