Skip to content

Add --strict option and exit code 6 for partial reads - #194

Merged
mahach666 merged 1 commit into
IOExtend:mainfrom
AndreyStartsev:feat/strict-partial-read
Nov 12, 2026
Merged

mahach666 merged 1 commit into
IOExtend:mainfrom
AndreyStartsev:feat/strict-partial-read

Conversation

@AndreyStartsev

Copy link
Copy Markdown
Contributor

Problem

ExportReport marks a read as "status": "partial" when stream gzip members fail to decode, are rebuilt by structural recovery, or decode without a matching checksum, or when Global/ElemTable decodes no row — yet the CLI process still exits with code 0 unless a reader limit cut a stream (3). Scripts that require hard failures on partial reads had to parse the JSON report themselves.

Closes #54

Changes

  • Add RvtExitCodes.PartialRead = 6 (codes 0..4 and downgrade --check's 5 were already assigned) and strict overloads on RvtExitCodes.ForRead, ExportReport.ForRead, and ExportReport.Failed while preserving existing method signatures.
  • Add --strict to rvtio (Program.cs, ExportCommand.cs):
    • Exits with code 6 without writing an incomplete export when status == "partial" without an unaccepted limit hit (LimitExceeded 3 still takes precedence on unaccepted limits; --allow-partial and --strict exclude each other with usage exit code 1).
    • Records limits.strict in ExportReport and populates issues[] with stream-level findings (failed-members, recovered-members, unverified-members) alongside no-rows and streams[].
  • Document --strict, exit code 6, limits.strict, issues[] codes, and the case $? scripting example in docs/export-report.md, README.md, docs/public-api.md, and CHANGELOG.md.
  • Add unit tests in ExportReportTests and end-to-end process tests in CliExitCodeTests on synthetic .rvt files with intact and damaged partition members.

Export comparison

  • Exports without --strict and complete exports with --strict produce identical IFC and JSON outputs.

Verification

  • dotnet build RvtIO.slnx -c Release — 0 errors, 0 warnings in src/.
  • dotnet test tests/RvtIO.Tests/RvtIO.Tests.csproj -c Release --no-build --filter "FullyQualifiedName~ExportReportTests|FullyQualifiedName~ChunkDecompressorTests|FullyQualifiedName~Cli" — all non-fixture tests passed on net8.0 and net10.0 (private-fixture [SkippableFact] tests skipped when RVTIO_TEST_FILES is unset).
  • dotnet docfx docfx.json --warningsAsErrors — 0 warnings, 0 errors.

@mahach666
mahach666 merged commit fdb75ca into IOExtend:main Nov 12, 2026
4 checks passed
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.

Add an opt-in strict mode that exits non-zero when a read lost data without hitting a limit

2 participants