Skip to content

ADR-0006: verifier in TypeScript workspace, not Rust separate repo#38

Merged
pulkitpareek18 merged 1 commit into
mainfrom
dev
May 15, 2026
Merged

ADR-0006: verifier in TypeScript workspace, not Rust separate repo#38
pulkitpareek18 merged 1 commit into
mainfrom
dev

Conversation

@pulkitpareek18
Copy link
Copy Markdown
Collaborator

Task 4 of today. Formally records the Plan B (TS workspace) decision from yesterday's plan-mode session — what we picked, what we gave up vs the brainstorm's Rust spec, what we kept (Rust-compatible HTTP shape for future swap), and the inline-fallback retirement plan (2026-06-08 PR removes the inline path after 3 weeks of prod soak).

Pure docs change — no code, no tests, no Dockerfile. Safe to fast-merge.

🤖 Generated with Claude Code

Task 4 of today. Formally records the decision Pulkit made yesterday
when he picked Plan B over Plan A. Captures the three reasons
single-engineer velocity beat the brainstorm's Rust spec, what we
gave up (reproducible-build provenance, smaller transitive surface,
unsafe-discipline) and what we kept (cross-repo HTTP shape stays
Rust-compatible if we ever swap).

Also pins the inline-fallback retirement plan:
- 2026-05-15: verifier shipped, inline path unused but compiled-in
- 2026-05-16 → 2026-06-06: 3-week soak in prod
- 2026-06-08: PR to delete verifyInline + snarkjs from root deps +
  refuse-to-start when VERIFIER_URL is unset
- 2026-06-09: prod runs verifier-only

References the three shipping PRs (#35 cutover, #36 healthcheck hotfix,
#37 SQLite audit log) + the plan-mode design doc + the B02 build
prompt that we rejected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 08:05
@pulkitpareek18 pulkitpareek18 merged commit 113361d into main May 15, 2026
1 of 2 checks passed
@pulkitpareek18 pulkitpareek18 deleted the dev branch May 15, 2026 08:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an Architecture Decision Record (ADR) documenting the decision to implement the Groth16 verifier as a TypeScript npm workspace/service (snarkjs) within the existing repo instead of a separate Rust repository, including rationale, consequences, and a deprecation timeline for the inline fallback.

Changes:

  • Introduces ADR-0006 capturing Plan B decision (TypeScript workspace verifier service) vs Plan A (Rust repo).
  • Documents operational/deployment details (Docker/container, audit log/hash chain) and links to related PRs.
  • Defines an inline-fallback retirement plan with dates and steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Decision

The Groth16 verifier ships as **`@zeroauth/verifier`, an npm workspace inside `pulkitpareek18/ZeroAuth`**, written in TypeScript on top of `snarkjs`. It runs as a separate Docker container (`zeroauth-verifier`) bound to `127.0.0.1:3001` on the Docker network. The API container reaches it via HTTP — never inline anymore.
- [PR #36](https://github.com/pulkitpareek18/ZeroAuth/pull/36) — Healthcheck hotfix (`localhost` → `127.0.0.1` because alpine busybox `wget` hits IPv6 first).
- [PR #37](https://github.com/pulkitpareek18/ZeroAuth/pull/37) — SQLite append-only audit log + hash chain (the design doc §4.3 component).

The inline-`snarkjs` fallback in `src/services/zkp.ts` **stays in the codebase for two more weeks** as a safety net while the verifier service soaks in production. It activates only when `VERIFIER_URL` is unset (which never happens in prod — the value is hard-set in `docker-compose.yml`'s `environment:` block). Retirement is scheduled for end of Week 4 of the build cycle (~2026-06-08), as a separate PR.

- 2026-05-15 (today) — Verifier in prod, `VERIFIER_URL` hard-set in compose, inline path unused but compiled-in.
- 2026-05-16 → 2026-06-06 (3 weeks of prod traffic) — Watch for any "ZKP: verifier service unreachable" or non-2xx log lines. If zero failures, proceed.
- 2026-06-08 (start of Week 5) — Single PR removes the inline path entirely:
pulkitpareek18 added a commit that referenced this pull request May 15, 2026
Task 4 of today. Formally records the decision Pulkit made yesterday
when he picked Plan B over Plan A. Captures the three reasons
single-engineer velocity beat the brainstorm's Rust spec, what we
gave up (reproducible-build provenance, smaller transitive surface,
unsafe-discipline) and what we kept (cross-repo HTTP shape stays
Rust-compatible if we ever swap).

Also pins the inline-fallback retirement plan:
- 2026-05-15: verifier shipped, inline path unused but compiled-in
- 2026-05-16 → 2026-06-06: 3-week soak in prod
- 2026-06-08: PR to delete verifyInline + snarkjs from root deps +
  refuse-to-start when VERIFIER_URL is unset
- 2026-06-09: prod runs verifier-only

References the three shipping PRs (#35 cutover, #36 healthcheck hotfix,
#37 SQLite audit log) + the plan-mode design doc + the B02 build
prompt that we rejected.
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.

2 participants