Add billing receipt privacy guard#424
Conversation
|
Hardening update pushed in 094ae6e: nested allowed provider metadata values now scan through structured objects, so private project context cannot hide inside an allowlisted metadata key. Validation refreshed locally: npm run check, npm test (6 tests), git diff --check, and sensitive-term scan returned no matches. |
|
Hardening update pushed in 25e1c08: customer-facing line-item identifiers and units are now scanned and redacted when they carry restricted dataset context, so private dataset labels cannot leak through receipt fields outside the description/projectRef path. Verification refreshed:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in 3408b06:
Validation:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in
Validation refreshed locally:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in
Validation refreshed locally:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in
Why this matters:
Validation refreshed locally:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in
Validation refreshed locally:
|
|
Follow-up competitive hardening pass for the billing receipt privacy guard. What changed in
Why this matters:
Validation refreshed locally:
|
|
Hardening update pushed in This tightens the customer-facing receipt gate: malformed or negative numeric fields now block delivery even when they do not contain private research text. The guard emits Fresh validation from
This keeps #424 distinct from #362: #424 protects customer-facing receipt/privacy delivery, while #362 focuses on analytics license seat roster renewal/true-up controls. |
|
Pushed a focused hardening commit for malformed sparse provider line items: Fresh verification from |
/claim #20
Summary
Adds a distinct
billing-receipt-privacy-guard/slice for Revenue Infrastructure issue #20.The guard validates customer-facing invoices, receipts, and payment-provider metadata before billing artifacts leave SCIBASE. It detects private research project context, restricted dataset references, collaborator identifiers, grant-sensitive phrases, unsafe receipt identifiers, unsafe customer-facing envelope fields, malformed monetary/quantity fields, unsafe line-item fields, unsafe provider metadata values, unsafe provider metadata key names, and sparse billing provider batches. Safe receipts remain deliverable, while unsafe receipts are held for finance review with redacted replacement identifiers, safe currency labels, replacement line items, redacted metadata-key handles, malformed-field repair actions, and deterministic audit evidence.
Hardening Updates
Holds malformed line-item entries as
malformed-line-itemfinance-repair evidence instead of crashing sparse billing provider payload review.Holds receipts with malformed or negative customer-facing totals, quantities, or line-item amounts even when those fields do not contain private research text.
Redacts malformed customer-facing numeric fields to
nulland emitsinvalid-billing-amount/invalid-billing-quantityfindings.Adds
repair-malformed-billing-fields-before-deliveryremediation for malformed billing field packets.Adds
reports/malformed-receipt-privacy-packet.jsonso reviewers can inspect the new blocked malformed-field path.Redacts unsafe provider metadata key names when the key itself carries restricted dataset or private research context, preserving reviewer-safe handles such as
metadata-key-redacted-1.Scans structured/nested allowed provider metadata values so private project context cannot hide behind safe metadata keys.
Redacts customer-facing line-item identifiers and units when they contain restricted dataset context.
Redacts receipt, invoice, and customer identifiers when they expose private project, dataset, or collaborator context while keeping distinct redacted handles for finance review correlation.
Treats missing provider metadata as an empty provider packet instead of crashing receipt review.
Treats omitted receipt and line-item collections as empty billing evidence instead of crashing receipt review.
Redacts unsafe customer-facing currency labels to
XXXwhen malformed receipt envelope data carries restricted dataset context.Redacts unsafe customer-facing totals, quantities, and line-item amounts to
nullwhen billing fields carry restricted dataset context.Non-overlap
This is scoped to privacy-safe billing artifacts before invoice, receipt, or payment-provider delivery. It does not duplicate subscription entitlement or renewal guards, usage metering, tax controls, dispute evidence, procurement controls, pricing experiments, payment rail failover, webhook entitlement, invoice acceptance, storage overage, analytics licensing, credit breakage, FX/reconciliation, or revenue-recognition slices.
Validation
Wrote failing tests first. Latest red regression failed before implementation with
deliver-receiptinstead ofhold-for-finance-reviewfor a receipt containing a string total, string quantity, and negative line-item amount.Added validation for malformed cents/quantity fields, redaction to
null, and a malformed-field repair remediation action.cd billing-receipt-privacy-guard && npm testpassed: 16 tests.cd billing-receipt-privacy-guard && npm run checkpassed test, demo, and video generation.cd billing-receipt-privacy-guard && npm run demoregenerated deterministic packet/report/SVG artifacts and addedreports/malformed-receipt-privacy-packet.json.cd billing-receipt-privacy-guard && npm run videoregeneratedreports/demo.mp4.ffprobeverifiedbilling-receipt-privacy-guard/reports/demo.mp4as H.264, 1280x720, 4s, 30fps, 48,322 bytes.Parsed all report JSON successfully: empty packet 0 receipts, malformed packet 1 held receipt, main packet 1 held and 1 deliverable receipt.
git diff --checkandgit diff --cached --checkpassed; only Windows line-ending normalization warnings appeared.Restricted-term scan of
billing-receipt-privacy-guardreturned no matches.Generated report/doc scan found no private fixture terms from the malformed or sparse-batch cases.
GitHub PR merge state after push:
CLEAN; no checks are reported for this branch.Added a red regression for
lineItems: [null]; before the fix receipt review crashed atlineItem.id.Added
reports/malformed-line-item-privacy-packet.jsonso reviewers can inspect the held malformed-line-item path.cd billing-receipt-privacy-guard && npm testpassed: 17 tests.cd billing-receipt-privacy-guard && npm run checkpassed test, demo, and video generation.Parsed all report JSON successfully: malformed line-item packet 1 held receipt, 1 remediation action, digest
sha256:5237f198878a.ffprobeverifiedbilling-receipt-privacy-guard/reports/demo.mp4as H.264, 1280x720, 4s, 30fps, 56,900 bytes.git diff --check,git diff --cached --check, billing-guard-only staging, restricted-string scan, and generated report private-fixture scan passed.Demo Artifacts
billing-receipt-privacy-guard/reports/receipt-privacy-packet.jsonbilling-receipt-privacy-guard/reports/empty-receipt-privacy-packet.jsonbilling-receipt-privacy-guard/reports/malformed-receipt-privacy-packet.jsonbilling-receipt-privacy-guard/reports/malformed-line-item-privacy-packet.jsonbilling-receipt-privacy-guard/reports/receipt-privacy-report.mdbilling-receipt-privacy-guard/reports/summary.svgbilling-receipt-privacy-guard/reports/demo.mp4Synthetic data only. No credentials, payment processors, customer systems, private workspaces, institutional finance tools, payout systems, or external APIs are used.
AI-assisted with OpenAI Codex; I reviewed and locally verified the diff before submitting.