Repository navigation
refactor: every JSON encoding is its format's Effect Schema - #93
systemfsoftware-bot wants to merge 9 commits into
Conversation
3405b31 to
301e21c
Compare
…gh its own schema Every JSON text is Schema.fromJsonString over the format's schema. The shared wrapper, the key-sorting replacer, canonicalKey and the Json namespace are deleted. Structural keys for types, signatures and items encode through their own schemas. The verdict writer encodes from Schema.toEncoded(Verdict), because the cell hands it the encoded verdict. The scenario asserting the removed trailing newline is deleted.
…owed insertion order
Merge Protections🔴 3 of 5 protections blocking · waiting on 👀 reviews and 🙋 you
🔴 Merge authorityWaiting for any of
This rule is failing.A PR merges only after the review app approves it (phase 1) or the review bot's review-gate passes (phase 2). A Dependabot patch or minor bump skips the review gate; a major bump still needs it.
🔴 Repository owner approves shared config and toolingWaiting for
This rule is failing.A PR that touches CI or Mergify config, the Nix flake, an API report or a tool config (tsconfig, vitest, oxlint, biome, stryker) needs the repository owner's approval, whoever wrote it. The review app's approval alone does not cover these files.
🔴 🚦 Auto-queueWaiting for any of
This rule is failing.When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
Show 2 satisfied protections🟢 Conventional PR titleThe squash commit takes the PR title, so the title must be a conventional commit.
🟢 Hold labelThe hold label keeps a PR out of the default branch.
|
Deletes every hand-written JSON writer and reader. Each format's text is
Schema.fromJsonStringover its own schema. There is no shared canonical-JSON module, key sorter orJsonnamespace.ApiModelFromJsonText,RuleCorpusFromJsonText,VerdictFromJsonText,PackageManifestFromJsonTextandExportTargetFromPackageExportsare the readers and writers of their formats.ApiModel.decode/encodeandVerdict.decodeRuleCorpusare removed.typeExprKey,signatureKey,itemKey).Schema.toEncoded(Verdict), because the cell hands it the encoded verdict.formatDocModel,formatTsdocMetadataand the verdict writer return typed failures instead of throwing.inlineSchemaTests()from@systemfsoftware/effect-schema-vite.src/schema-laws.test.tsis the committed stub, and the plugin generates the round-trip and recursion laws for every exported schema.Output change: JSON keys follow schema declaration order and the text has no trailing newline. Decoding accepts any key order, and
API_MODEL_SCHEMA_VERSIONis unchanged. The scenario asserting the trailing newline is deleted (it covered removed behaviour).Follow-ups: the doc model and tsdoc metadata still build untyped JSON, and
sortModelruns before encode rather than inside it. Each moves to a declared schema in its own PR.Checks: install, typecheck, lint and build exit 0. Each test file in packages/api-extractor passes when run on its own, and so do the e2e app's two integration files.