Skip to content

Add one-call diagnostics (P4) - #15

Merged
MPCoreDeveloper merged 1 commit into
mainfrom
feat/11-one-call-diagnostics
Nov 14, 2026
Merged

MPCoreDeveloper merged 1 commit into
mainfrom
feat/11-one-call-diagnostics

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

Summary

IPdfDiagnoser.DiagnoseAsync returns a PdfDiagnosticsReport — the document, its fonts, its signatures, an optional PDF/A pre-flight and the merged, de-duplicated warnings — assembled from the use cases the library already exposes, so it cannot disagree with them.

  • IPdfDiagnoser (Domain port) + PdfDiagnoserService (Application), depending on IPdfInspector, IPdfFontInspector, IPdfSignatureValidator and IPdfAWriter. IPdfInspector gains nothing.
  • The report is read-only and redaction-explicit: it names sources and describes structure, never stream contents.
  • A document that stays closed is reported with IsReadable/RequiresPassword and read once; the other use cases are skipped.
  • Archival is null unless a profile is named; when it is, the writer's own pre-flight fills it, with Stream.Null as the destination.
  • tools/SharpCorePDF.Diagnostics prints the report as text or JSON (--profile, --json).
  • DI registration, README/manual/changelog, and the rebuilt 1.7.0 manual (125 pages).

Tests

  • 9 PdfDiagnoserTests: clean document, rebuilt cross-reference finding, encrypted without throwing, archival pre-flight, undefined profile, font-warning merge, one open for a closed document, null source, container resolution.
  • Full suite: 1195 passed / 0 failed / 0 skipped on net10.0 and net11.0.
  • Scoped Stryker over PdfDiagnoserService.cs: 42.86% after the first run's survivors were read and the two real gaps closed; the remaining survivors are the ConfigureAwait arguments, a message string, the redundant null guard and two merge statements whose fixtures cannot tell them apart — all recorded in docs/mutation-testing.md.
  • Manual: 125 pages, check: ok, qpdf check: no problems.

Closes #11.

IPdfDiagnoser.DiagnoseAsync returns a PdfDiagnosticsReport — the document, its fonts, its signatures, an optional PDF/A pre-flight and the merged, de-duplicated warnings — assembled from the use cases the library already exposes. A document that stays closed is reported with IsReadable/RequiresPassword and read once, not thrown; the report never returns stream contents. The tools/SharpCorePDF.Diagnostics console prints it as text or JSON.

Twenty-two domain and three application snapshot entries; nine tests; the manual's chapter 8 gains the section and the 1.7.0 edition is rebuilt at 125 pages. The scoped Stryker run is 42.86% over the service, with each survivor explained in docs/mutation-testing.md.

Closes #11.
@MPCoreDeveloper
MPCoreDeveloper merged commit 462e342 into main Nov 14, 2026
5 checks passed
@MPCoreDeveloper
MPCoreDeveloper deleted the feat/11-one-call-diagnostics branch November 14, 2026 14:48
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.

[Feature] One-call diagnostics report (P4, 1.7.0)

1 participant