docs: adopt Discipline charter + ADRs + ARCHITECTURE - #14
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adopt the Web3Settle
Discipline.mdengineering charter inmerchant-sdkand author repo-specific ADRs grounded insrc/. Additive docs only — no product code, tests, or CI touched.Added
Discipline.md— copied verbatim from the platform charter.docs/adr/README.md— ADR index mirroring the monorepo root's; continues the platform numbering (root owns 0001–0002; SDK starts at 0003) and points to the platform-wide ADRs without duplicating them.fetchPaymentConfig(src/core/api-client.ts) fails closed through a 4-step gate: Zod shape → Ed25519 signature vs baked-in pubkey oversigned_at + canonical_json(data)→ freshness → contract-address/ABI allow-lists. Trust anchor is the published artifact, not the wire; splits trust so a backend compromise alone can't redirect funds. (payment-config-verifier.ts,canonical-json.ts,config.ts)KNOWN_PERMIT_TOKENSpermit allow-list.signPermitrefuses EIP-2612 signing for tokens whose EIP-712 domain digest isn't allow-listed (typo-squat defence: a clone spoofingname()="USD Coin"has a differentverifyingContract→ different digest), before any wallet popup; unknown-but-real tokens fall back toapprove(). Documents the known test follow-up: the olderpermit.test.tshappy-path cases assert the pre-allow-list path (left for a separate code PR). (src/evm/permit.ts)redactErrorMessagestrips addresses/hashes/UUIDs/base58/paths/long-hex before emission. (src/core/telemetry.ts)ARCHITECTURE.md— subpath/entry map (.,./solana,./tron,./headless,./wc), the 4-step trust gate, multi-chainPaymentPipelineadapters, build/publish, and a customer-browser → SDK → gateway/chain ASCII diagram.Tooling note (charter adaptation)
The charter's §7 example mandates
pnpm+tsup. This repo's actual build is npm + Vite library mode +vite-plugin-dts, with Vitest (already charter-aligned). The docs reflect reality per charter R8/R11; no third-party tools were installed and the build was not retooled. Flagged explicitly inARCHITECTURE.md.Scope / safety
git diff mainshows no changes to tracked code/tests/CI.SECOPS-SCAN/was deliberately not staged.