Enums never take a String raw value; CredentialRejectedError redesign; one typed error envelope; FOSTesting depth; review project-scope clauses - #144
Merged
Conversation
…partitions Step 5 names the partition rule for large areas (by module, about 100 files per dispatch) and the project-scope dispatch; checks whose clauses answer a question about the whole project carry a Scope: project mark (behavioral-suite-standing clause 1, versioned-baseline-committed, server-installs-the-error-middleware) and run in exactly one partition; Step 6 collapses duplicates across partitions. Plugin 2.65.0.
…rentType:); no-string-backed-enums check The truth statement lands in FOSMVVMArchitecture.md and its Simple Errors section teaches the plain-enum form. LocalizableString gains localized(case:parentType:), which derives the YAML key from the case. fosmvvm-review gains no-string-backed-enums (cross-cutting, blocker); the serverrequest, fields, and viewmodel generators, the serverrequest check's example, and both DocC articles teach the plain form. The framework's five String-backed FOSMVVM enums drop their raw values; FormInputType and FormInputOption.Autocomplete keep their HTML tokens as htmlAttributeValue, derived on the owner. Plugin 2.66.0.
… a framework YAML bundle
…enge; one typed error envelope on the wire CredentialRejectedError carries reason (Reason.missing/.invalid) and a typed CredentialChallenge (.bearer, .bearerRealm, .basicRealm) with synthesized Codable; the hand-rolled discriminator envelope is gone. Every ServerRequest error body now crosses the wire inside the WireError envelope, encoded by FOSMVVMVapor.ErrorMiddleware and decoded by the client and the FOSTestingVapor harness, so the client never trial-decodes a body. The rejection no longer conforms to AbortError: ErrorMiddleware assigns its 401 and WWW-Authenticate (the error token follows the reason per RFC 6750). The stale DocC that taught hand-rolled retry is rewritten around the refresh seam.
…ons walks child ViewModels; strict test encoder; loud empty UI-test harness expectFullViewModelTests forwards a version: to the version-stability check. expectTranslations descends into stored child ViewModels, optionals, and collections and names the failing path. LocalizableTestCase's encoder is strict: a key the store cannot resolve fails the encode with LocalizerError.missingTranslation (JSONEncoder.localizingEncoder gains the strictLocalization switch; production encoding is unchanged). ViewModelViewTestCase.setUp(bundles:) throws RunError.noLocalizationYAML when the given bundles yield no YAML; bundles: [] opts into key-echo explicitly.
…and raw-bytes transfer
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.
Summary
Seven commits, one arc: the first full customer review run and the review of one of our own types.
fosmvvm-reviewevaluates project-scope clauses once. A large area is partitioned by module explicitly, and the clauses that answer a question about the whole project ("no behavioral suite exists", "no committed.VersionedTestJSON", "the boot path never installs the error middleware") carry**Scope:** projectand run in exactly one partition; the aggregator collapses any duplicate. Plugin 2.65.0.Enums never take a
Stringraw value. Truth statement in the architecture doc;no-string-backed-enums(cross-cutting, blocker; tools, not libraries, are exempt);LocalizableString.localized(case:parentType:)derives the YAML key from the case; the serverrequest, fields, and viewmodel generators and both DocC articles teach the plain-enum form. The framework's five FOSMVVM enums drop their raw values;FormInputTypeandFormInputOption.Autocompletekeep their HTML tokens ashtmlAttributeValue. Plugin 2.66.0.CredentialRejectedErroris plain data.reason(Reason.missing/.invalid) and a typedCredentialChallenge(.bearer,.bearerRealm(_:),.basicRealm(_:)) with synthesizedCodable; the hand-rolled discriminator envelope is gone. EveryServerRequesterror body now crosses the wire inside one typed envelope encoded byFOSMVVMVapor.ErrorMiddlewareand decoded by the client and theFOSTestingVaporharness — no trial decode. The rejection no longer conforms toAbortError: the middleware assigns its 401 andWWW-Authenticate(the error token follows the reason, RFC 6750 §3.1). The stale DocC that taught hand-rolled retry is rewritten around the refresh seam. Wire contract: a client and server on either side of this release see each other's error bodies as undecodable and fall to the status path; upgrade both together.FOSTesting depth.
expectFullViewModelTests(_:locales:version:);expectTranslationswalks child ViewModels, optionals, and collections and names the failing path; the test encoder is strict (LocalizerError.missingTranslation), production encoding unchanged;setUp(bundles:)fails loudly when the bundles yield no YAML (bundles: []opts into key-echo).Ledger. Three framework gaps recorded in
docs/deferrals.md(non-Fluent write door, socket-channel door, raw-bytes transfer) and one deferral (the rejection's localized message waits on a framework YAML bundle).Verification
Ships as 0.16.0 (public API added; wire contract changed).