Skip to content

test: read the unread documents for claims - #140

Merged
CaffeinatedCoder merged 2 commits into
release/2.3.0from
test/unread-document-claims
Oct 29, 2026
Merged

CaffeinatedCoder merged 2 commits into
release/2.3.0from
test/unread-document-claims

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #98

Problem

The first oracle catalogue (#97) waived nine public surfaces as unread:: their documents had never been read for promises. Option, Result and Patch<T> with their extensions, Choose, OrNull, GuidValueExtensions.New, WithTypeKit(), ToHttpResult() over a closed set and [RequireCustomInitialization] had no claim naming the tests that hold them, so a promise in docs/option.md, docs/result.md, docs/merge-patches.md or the Serilog, AspNetCore, Generators and Analyzers READMEs could lose its test without the catalogue noticing.

Change

  • 157 claims in test/oracles/claims.json, one per promise, each quoted verbatim and naming the test classes that hold it: 46 for docs/option.md, 65 for docs/result.md, 33 for docs/merge-patches.md, 8 for the Serilog README, 1 for the AspNetCore README's closed set as a fault type, 1 for OrderId.New() in the Generators README and 3 for [RequireCustomInitialization] in the Analyzers README. The four C06 claims on the closed-set fault section that held nothing now name their tests.
  • The nine unread: waivers are gone. oracles status lists no unread waiver, and every public member is claimed or waived.
  • PromiseDocuments gains docs/option.md, docs/result.md and the Serilog README.
  • New tests where no test held a promise:
    • UnassignedNoDefaultMemberAnalyzerTests: CMTK0006 reports a struct marked [RequireCustomInitialization] and leaves an unmarked struct of value objects alone.
    • ResultWithValueTests: query syntax over a result has no where (CS1936), and a bare error doesn't convert to a valued result (CS0029).
    • ResultCatchTests: Catch over a Task, an async lambda included, fails to compile naming CatchAsync.
    • ResultContinuationTests: a callback returning a ValueTask binds TapAsync and TapErrorAsync to the overload that doesn't wait, and MapAsync keeps the ValueTask as the value; .AsTask() and an async lambda bind to the waiting overload.
    • FaultResponsePartsTests: no ToHttpResult overload accepts a Result<T, Exception>.
    • FaultSetDefaultTests: a closed set that is no fault set, mapped on its own, is answered through ToHttpResult().
    • HostConfigurationTests: a value object a patch carries refuses a body with the same bare 400.
    • PatchSchemaTests: = default on a patch parameter breaks the document (the schema exporter throws), pinned so the page is corrected when it stops doing so.
    • SourceGeneratedJsonTests: a value object inside a patch is read with its own converter under a source-generated context that lists neither it nor its wrapped type, and keeps its rule, path and silence about the input.

No promise turned out false, so candidates.json stays empty and no bug was filed. Two sentences have no claim, because no test can hold them: the Serilog README's "needs Serilog 4.0.0 or later" (a dependency floor), and the merge-patches page's sentence that a static constructor registers each closed Patch<T>'s converter under Native AOT (the consumer smoke test's aot consumer measures it, and that's no test class). There is no changelog line, because consumers see no change.

Tests

  • CodoMetis.TypeKit.Oracles.Tests: 27 passed, catalogue, surface coverage and promise documents included.

  • Each new test was seeded and caught: a defect planted in src/, the test run red for the planted reason, the file restored.

    Seed Test that went red
    CMTK0006 ignores [RequireCustomInitialization] A_struct_marked_RequireCustomInitialization_reports_and_an_unmarked_one_does_not
    a Where on a result Query_syntax_has_no_where
    a conversion from TError (explicit, so the test project still builds) A_bare_error_does_not_convert
    Catch(Func<Task>) without its [Obsolete(error: true)] Catch_over_a_task_is_a_compile_error_naming_CatchAsync
    a TapAsync(Func<T, ValueTask>) overload A_callback_that_returns_a_ValueTask_binds_to_the_overload_that_does_not_wait
    a ToHttpResult(this Result<Exception>) overload ToHttpResult_accepts_no_result_whose_error_is_an_exception
    a closed set's command answers every fault with 204 A_closed_set_that_is_no_fault_set_is_answered_with_a_mapping_of_its_own
    a patch swallows its value's refusal as a clear A_minimal_API_answers_a_refused_body_with_a_bare_400 (the patch rows)
    a patch asks the options for its value's contract A_value_object_inside_a_patch_is_read_with_its_own_converter
    the record without = default (the control) A_patch_parameter_defaulted_with_default_breaks_the_document
  • The full suite through build-verdict test: 18498 passed, 471 skipped.

🤖 Generated with Claude Code

docs/option.md, docs/result.md, docs/merge-patches.md, the Serilog README's
WithTypeKit(), the AspNetCore README's closed set as a fault type, OrderId.New()
in the Generators README and [RequireCustomInitialization] in the Analyzers
README become 157 claims, each quoted verbatim and naming the tests that hold
it; the four unheld C06 claims on the closed-set fault section name theirs.
The nine unread: waivers are gone, and option.md, result.md and the Serilog
README join PromiseDocuments.

Where no test held a promise, one does now: CMTK0006 over a marked struct, no
`where` on a result, no bare error conversion, Catch over a Task, a ValueTask
callback's binding, no ToHttpResult over Result<T, Exception>, a plain closed
set mapped on its own, a patch's 400, `= default` on a patch parameter, and a
value object inside a patch under a source-generated context. Each was seeded
in src/ and caught. No promise turned out false.

Closes #98

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 2.3.0 milestone Oct 29, 2026
@CaffeinatedCoder CaffeinatedCoder added tests Adds or changes tests only (tests, probes, harnesses); no library code area/tooling The repository's tools: prober, verdict, guard, docs-query, smoke test labels Oct 29, 2026
…document-claims

# Conflicts:
#	test/oracles/claims.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tooling The repository's tools: prober, verdict, guard, docs-query, smoke test tests Adds or changes tests only (tests, probes, harnesses); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant