Persist IO FAT progress and export portable handover packages - #114
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a272f02870
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| project.InitializeRuntimeNotifications(); | ||
| var evidenceDirectory = Path.Combine(evidenceRoot, SanitizePathPart(project.ProjectId)); |
There was a problem hiding this comment.
Scope exported evidence to the workbook hash
When two workbook revisions reuse the same ProjectId but have different SHA-256 hashes, their snapshots are separated into hash-qualified directories while both sessions write evidence under the same project-ID-only directory. Exporting either revision therefore enumerates and packages journals belonging to the other workbook, producing a handover with unrelated FAT evidence. Include the workbook hash in the evidence directory or filter each journal by its recorded workbook hash before export.
Useful? React with 👍 / 👎.
| throw new InvalidDataException($"Imported evidence failed hash-chain verification: {verification.Error}"); | ||
| } | ||
|
|
||
| await WriteFileAtomicAsync(Path.Combine(localDirectory, "project.snapshot.json"), snapshotBytes, cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
Preserve newer local progress when importing a package
When a handover package targets a project and workbook hash that already exist locally, this unconditionally replaces project.snapshot.json without comparing SavedAtUtc, prompting, or retaining a backup. Opening an older package for the same project can therefore silently discard newer autosaved results, and subsequent workbook opens restore the stale imported state. Detect the collision and merge, prompt, or preserve the existing snapshot before replacement.
Useful? React with 👍 / 👎.
| foreach (var evidence in manifest.EvidenceFiles) | ||
| { | ||
| cancellationToken.ThrowIfCancellationRequested(); | ||
| var entry = RequiredEntry(archive, evidence.Entry); | ||
| var bytes = await ReadEntryAsync(entry, 100 * 1024 * 1024, cancellationToken).ConfigureAwait(false); |
There was a problem hiding this comment.
Cap the package's total uncompressed evidence size
For a highly compressed or malicious package, the 500 MB archive-size limit and 100 MB per-entry limit still permit thousands of evidence entries to expand onto disk; the existing 10,000-entry cap allows an aggregate approaching 1 TB. Since every entry is read and written without a cumulative uncompressed-size budget, opening such a package can exhaust disk space. Track and reject an aggregate uncompressed size before importing entries.
Useful? React with 👍 / 👎.
| if (!manifest.PackageVersion.Equals(PackageVersion, StringComparison.Ordinal)) | ||
| throw new InvalidDataException($"Unsupported IO FAT package version '{manifest.PackageVersion}'."); |
There was a problem hiding this comment.
Reject manifests with missing required strings
When manifest.json is syntactically valid but omits packageVersion or sets it to null, deserialization succeeds and this instance call throws NullReferenceException. The launcher only catches the documented import exceptions, so selecting such a malformed or partially written package can escape the async click handler instead of showing the normal import-failed dialog. Validate required manifest members and throw InvalidDataException before dereferencing them.
Useful? React with 👍 / 👎.
Purpose
Make IO List FAT work durable on one laptop and portable across laptops without weakening the existing OFF → ON → OFF evidence rules.
Local persistence
ProjectIdand source-workbook SHA-256project.snapshot.jsonplus a local copy of the approved XLSXSafe continuation
Portable handover
Adds
.arsas-iofatpackages containing:manifest.jsonproject.snapshot.jsonreport/IO-FAT-Report.htmlA package can be opened from Open FAT Handover Package on another ARSAS laptop to continue the remaining scope. Its A4-landscape HTML report can be opened in a browser and printed to PDF without the original testing laptop.
Integrity and safety
UI
Regression coverage
Automated validation at head
a272f028701f55e016c307abdbb04bc87e0a2d26Direct result writing back into XLSX and formal signed PDF generation remain follow-up phases.