Skip to content

test(registry): boundary fixture corpus for decimal exponents, scripts and slug limits - #22

Open
jdjioe5-cpu wants to merge 1 commit into
Kinlock-Org:mainfrom
jdjioe5-cpu:test/validator-boundary-fixtures
Open

jdjioe5-cpu wants to merge 1 commit into
Kinlock-Org:mainfrom
jdjioe5-cpu:test/validator-boundary-fixtures

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Summary

Closes #15. Fulfills Roadmap row M1-40 (Phase 1, M0 Validate, Priority P1).

This PR introduces a comprehensive boundary-fixture corpus for the registry validator in fixtures/boundary/:

  • Valid Boundary Fixtures (valid/):
    • 0-decimal-jpy.json: 0-decimal currency (JPY, Japan)
    • 3-decimal-bhd.json: 3-decimal currency (BHD, Bahrain)
    • non-latin-japanese.json: Non-Latin Unicode script in display_name (Japanese)
    • rtl-arabic.json: Right-to-Left script in display_name (Arabic)
    • diacritics-french.json: Multi-word French name with diacritics
    • slug-exact-80-chars.json: Slug at exactly the 80-character maximum limit
  • Rejection Boundary Fixtures (invalid/):
    • slug-81-chars.json: Rejection on exceeding 80 characters (81 chars)
    • payout-address-short-55.json: Rejection on wrong address length (55 chars)
    • payout-address-lowercase.json: Rejection on lowercase address character
    • payout-address-swapped-prefix.json: Rejection on invalid prefix (S instead of G/C)
    • directory-country-mismatch.json: Rejection on file placed in wrong country folder
    • attester-unauthorized-country.json: Rejection on attester not authorized for target country
    • duplicate-slug-cross-country.json: Rejection on duplicate slug across different countries
  • Test Suite: Added 13 dedicated unit test cases in scripts/boundary.test.ts asserting exact error message patterns and confirming canonical UTF-8 hashing stability. Total 29/29 tests green.
  • Corpus Documentation: Created fixtures/boundary/README.md.
  • Roadmap: Marked M1-40 as DONE in ROADMAP.md with Changelog entry.

Non-Personal Data & Multi-Country Guarantee

  • Zero real institutions, zero personal data, and zero live wallets.
  • Covers multiple countries (Japan, Bahrain, Egypt, France, Kenya, Philippines, Ghana) demonstrating the country-agnostic core (Hard Rule 11).
  • Live payees/, attesters/, and supported-countries.json remain completely untouched.

Real Command Outputs Executed

$ pnpm lint
> biome check .
Checked 13 files in 13ms. No fixes applied.

$ pnpm typecheck
> tsc -p tsconfig.json
(exit 0, 0 errors)

$ pnpm test
> vitest run
 Test Files  2 passed (2)
      Tests  29 passed (29)
   Duration  282ms

$ pnpm validate
> tsx scripts/validate.ts
3 payee file(s) checked, 0 problem(s)

$ pnpm hash fixtures/boundary/valid/slug-exact-80-chars.json
payee_id  411268ec536774628e9cfd10ba76e835ee5f52990abc7143e62b8c410c40d4ff
meta_hash b2245ab73fecf5d7ceb597338b6a0be869c81d805c75d39f5a8bc11bef8ae818

…s and slug limits

- Closes Kinlock-Org#15 (Roadmap row M1-40, Priority P1)
- Create comprehensive boundary fixture corpus in fixtures/boundary/ covering 0-decimal (JPY), 3-decimal (BHD), non-Latin Unicode (Japanese), RTL (Arabic), diacritics (French), and exactly 80-char slug
- Cover explicit rejection boundaries: 81-char slug, short payout address (55 chars), lowercase address character, swapped prefix (S), directory-country mismatch, unauthorized attester, and cross-country duplicate slug
- Add 13 dedicated test assertions in scripts/boundary.test.ts asserting exact rejection error messages and verifying canonical UTF-8 hashing integrity (29 tests total green)
- Author fixtures/boundary/README.md explaining the corpus
- Live payees/, attesters/, and schemas/ completely untouched
- Update ROADMAP.md marking M1-40 as DONE with Changelog entry
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.

Boundary fixtures for the validator: decimal exponents, non-Latin and RTL names, slug and address limits

2 participants