Skip to content

feat(privacy): privacy-policy consistency checker#548

Open
suculent wants to merge 1 commit into
masterfrom
privacy-policy/consistency-checker
Open

feat(privacy): privacy-policy consistency checker#548
suculent wants to merge 1 commit into
masterfrom
privacy-policy/consistency-checker

Conversation

@suculent

@suculent suculent commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Privacy Policy Consistency Checker that mechanically verifies the concrete claims in THiNX's privacy policy (services/console/src/public/privacy.html, static/gdpr.html) against the code that implements them — GDPR purge/transfer/consent endpoints, the owner-purge orchestrator, OAuth providers, IP logging, and cookies.

Self-contained and dependency-free (only fs/path); needs no Redis, CouchDB, MQTT, or network.

What's included

  • scripts/privacy-policy-check.js — manifest-driven checker. Each claim is a data entry pairing a policy sentence with the implementation signal that must exist (file / Express route / keyword / verified-by-absence) plus a severity. Emits a per-claim PASS/WARN/FAIL report to stdout and exits non-zero on any FAIL, so it doubles as a CI gate. npm run privacy-check.
  • spec/jasmine/PrivacyPolicyConsistencySpec.js — enforces zero FAIL-severity discrepancies in the existing jasmine suite; documented WARNs are allowed. Runs without live services.
  • docs/PRIVACY_POLICY_CONSISTENCY.md — traceability matrix (claim → implementing file/endpoint → status), findings, and run instructions.

Findings surfaced today — 7 PASS, 3 WARN, 0 FAIL

  • OAuth provider mismatch (headline): the policy advertises Google, Twitter, but the code implements GitHub (lib/router.github.js, lib/thinx/oauth-github.js) and Google (lib/router.google.js, mounted in thinx-core.js). Twitter is advertised but not implemented. (The original "GitHub only" premise was inaccurate — Google OAuth is a real, mounted flow; the honest gap is Twitter.)
  • IP-logging of malicious requests is only partially backed by the shared Winston logger — no dedicated client-IP path.
  • Cross-document drift: static/gdpr.html (a 2018 stub) has diverged from privacy.html on contact email, the 24-hour retention window, and named providers.

The hard GDPR contracts (24h deletion sweep, API-key deletion with devices, retained-queue invalidation, JSON transfer, consent endpoint) all PASS and are now regression-guarded.

Test plan

  • node scripts/privacy-policy-check.js → 7 PASS / 3 WARN / 0 FAIL, exit 0
  • npx jasmine privacy spec → 4 specs, 0 failures
  • eslint clean on both new JS files

🤖 Generated with Claude Code

Nightshift-Task: privacy-policy
Nightshift-Ref: https://github.com/marcus/nightshift


Automated by nightshift

Mechanically verify the concrete claims in the THiNX privacy policy
(services/console/src/public/privacy.html, static/gdpr.html) against the
code that implements them (GDPR purge/transfer/consent endpoints, owner
purge orchestrator, OAuth providers, IP logging, cookies).

- scripts/privacy-policy-check.js: dependency-free, manifest-driven checker
  emitting a per-claim PASS/WARN/FAIL report and a non-zero exit on FAIL.
- spec/jasmine/PrivacyPolicyConsistencySpec.js: enforces zero FAILs in CI
  without live services (WARNs are documented and allowed).
- docs/PRIVACY_POLICY_CONSISTENCY.md: traceability matrix + findings.
- package.json: `npm run privacy-check`.

Surfaces real drift as WARN: policy advertises Twitter OAuth that is not
implemented (GitHub + Google are), IP-logging promise only partially
backed, and static/gdpr.html has diverged from privacy.html.

Nightshift-Task: privacy-policy
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant