Skip to content

Commit e0b25cd

Browse files
committed
Add commercial evidence filesystem integrity seal execution
1 parent b7c087e commit e0b25cd

7 files changed

Lines changed: 113 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The first production milestone is M3UA over a transport abstraction. SCCP, TCAP,
7575
| Commercial evidence execution orchestration | Phase 37 foundation-complete: evidence execution run identity, stage catalog, operator command plan, execution environment contract, artifact collection manifest, digest/redaction verification, blocker classification, retry/resume policy, status reporting, and final validation are available; real retained execution artifacts are still required before commercial publication |
7676
| Commercial evidence artifact intake | Phase 38 foundation-complete: artifact intake target identity, artifact source registration, SHA-256 digest coverage, redaction review, completeness evaluation, dossier reporting, promotion handoff, execution-to-dossier bridge, status reporting, and final validation are available, binding a stable intake id, reviewer identity, UTC receipt time, run-scoped dossier root, concrete source paths, unique retained dossier paths, retained digests, trace-bearing artifact approvals, explicit intake blockers, retained Markdown summary, digest-covered handoff, end-to-end intake assembly, and intake readiness status to a governed execution run; real artifact files are still required before commercial publication |
7777
| Commercial evidence file verification | Phase 39 foundation-complete: retained file evidence item verification, retained file manifest coverage, file verification blocker reporting, retention ledger modeling, integrity sealing, publication attachment planning, verified promotion gating, command planning, status reporting, final validation, and documentation alignment are available, checking file existence, non-empty size, SHA-256 validity, digest match, UTC observation time, unique retained paths, promotion-required handoff coverage, explicit verification blockers, reviewer identity, immutable retention, UTC retention windows, minimum duration, deterministic aggregate ledger digests, sealed ledger attachment coverage, trace-bearing redaction approval, commercial readiness report presence, explicit promotion approval, workflow-ready verification command order, and readiness status separation; real retained file evidence remains required before commercial publication |
78-
| Commercial evidence filesystem execution | Phase 40 in progress: filesystem observation, manifest execution, verification report execution, artifact writing, and ledger execution are available, reading retained files from disk, computing real SHA-256 digests, reporting file existence and size, supporting retained-path-to-local-path overrides, building retained file manifests from real observations, exposing blocker-aware retained file reports from filesystem evidence, writing retained Markdown/TSV verification artifacts, and creating retention ledgers from filesystem-backed reports; seal execution, attachment execution, promotion execution, command materialization, status reporting, and final validation remain |
78+
| Commercial evidence filesystem execution | Phase 40 in progress: filesystem observation, manifest execution, verification report execution, artifact writing, ledger execution, and seal execution are available, reading retained files from disk, computing real SHA-256 digests, reporting file existence and size, supporting retained-path-to-local-path overrides, building retained file manifests from real observations, exposing blocker-aware retained file reports from filesystem evidence, writing retained Markdown/TSV verification artifacts, creating retention ledgers from filesystem-backed reports, and sealing those ledgers with deterministic aggregate SHA-256 digests; attachment execution, promotion execution, command materialization, status reporting, and final validation remain |
7979

8080
## Requirements
8181

docs/PHASE40_COMMERCIAL_EVIDENCE_FILESYSTEM_EXECUTION.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ This unit gives release operators retained files they can attach to the commerci
6262

6363
This unit connects real file verification output to the commercial evidence retention ledger.
6464

65+
## Unit 6 - Integrity Seal Execution
66+
67+
`SigtranCommercialEvidenceFileSystemIntegritySeals` creates an integrity seal from the filesystem-backed retention ledger:
68+
69+
- Requires ready retention ledger execution.
70+
- Computes the deterministic aggregate SHA-256 ledger digest.
71+
- Verifies that the retained seal matches the current ledger.
72+
- Carries the seal id forward for attachment and promotion execution.
73+
74+
This unit gives filesystem-backed evidence the same integrity seal contract used by the retained commercial evidence dossier.
75+
6576
## Validation
6677

6778
Each unit in this phase is validated with:

docs/PHASE40_SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Phase 40 prepares the SDK to run commercial evidence file verification against r
99
- Filesystem verification report execution that evaluates real observations and exposes retained file blockers such as missing files.
1010
- Verification artifact writer that retains a Markdown verification report and tab-separated observation manifest on disk.
1111
- Retention ledger execution that creates ledger entries from filesystem-backed verification reports and written artifacts.
12+
- Integrity seal execution that signs the filesystem-backed ledger with a deterministic aggregate SHA-256 seal.
1213

1314
## Readiness Position
1415

15-
The phase is in progress. Filesystem observation, manifest execution, report execution, artifact writing, and ledger execution are available. Seal execution, attachment execution, promotion execution, command materialization, status reporting, and final validation remain.
16+
The phase is in progress. Filesystem observation, manifest execution, report execution, artifact writing, ledger execution, and seal execution are available. Attachment execution, promotion execution, command materialization, status reporting, and final validation remain.

docs/PHASE_INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This index is the complete phase map for Sigtran.NET. It links each phase to the
4444
| 37 | Commercial evidence execution orchestration | [Phase 37 Commercial Evidence Execution Orchestration](PHASE37_COMMERCIAL_EVIDENCE_EXECUTION_ORCHESTRATION.md), [Phase 37 Summary](PHASE37_SUMMARY.md) | Foundation complete; real execution artifacts still required |
4545
| 38 | Commercial evidence artifact intake | [Phase 38 Commercial Evidence Artifact Intake](PHASE38_COMMERCIAL_EVIDENCE_ARTIFACT_INTAKE.md), [Phase 38 Summary](PHASE38_SUMMARY.md) | Foundation complete; real artifact files still required |
4646
| 39 | Commercial evidence file verification | [Phase 39 Commercial Evidence File Verification](PHASE39_COMMERCIAL_EVIDENCE_FILE_VERIFICATION.md), [Phase 39 Summary](PHASE39_SUMMARY.md) | Foundation complete; real retained file evidence required |
47-
| 40 | Commercial evidence filesystem execution | [Phase 40 Commercial Evidence Filesystem Execution](PHASE40_COMMERCIAL_EVIDENCE_FILESYSTEM_EXECUTION.md), [Phase 40 Summary](PHASE40_SUMMARY.md) | In progress; filesystem ledger execution complete |
47+
| 40 | Commercial evidence filesystem execution | [Phase 40 Commercial Evidence Filesystem Execution](PHASE40_COMMERCIAL_EVIDENCE_FILESYSTEM_EXECUTION.md), [Phase 40 Summary](PHASE40_SUMMARY.md) | In progress; filesystem seal execution complete |
4848

4949
## Current Commercial Gate
5050

docs/SDK_ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Status: Phase 39 is foundation-complete. Retained file evidence item verificatio
355355
- Build verification manifests, reports, retained artifacts, ledger, seal, attachments, promotion gate, and command materialization from observed files.
356356
- Keep filesystem execution separate from commercial publication: helpers can verify real files, but publication remains blocked until retained evidence comes from an approved commercial run.
357357

358-
Status: Phase 40 is in progress. Filesystem observation now reads retained files from disk, computes real SHA-256 digests, records file existence and size, and maps observations into the retained file verification model. Filesystem manifest execution now observes every promotion handoff item, supports retained-path-to-local-path overrides, and builds retained file manifests from real observations. Filesystem verification report execution now evaluates those manifests and exposes retained file blockers from real files. Verification artifact writing now retains a Markdown report and tab-separated observation manifest on disk. Retention ledger execution now creates ledger entries from filesystem-backed verification reports and written artifacts. Seal execution, attachment execution, promotion execution, command materialization, status reporting, and final validation remain in progress.
358+
Status: Phase 40 is in progress. Filesystem observation now reads retained files from disk, computes real SHA-256 digests, records file existence and size, and maps observations into the retained file verification model. Filesystem manifest execution now observes every promotion handoff item, supports retained-path-to-local-path overrides, and builds retained file manifests from real observations. Filesystem verification report execution now evaluates those manifests and exposes retained file blockers from real files. Verification artifact writing now retains a Markdown report and tab-separated observation manifest on disk. Retention ledger execution now creates ledger entries from filesystem-backed verification reports and written artifacts. Integrity seal execution now seals filesystem-backed ledgers with deterministic aggregate SHA-256 digests. Attachment execution, promotion execution, command materialization, status reporting, and final validation remain in progress.
359359

360360
## Recommended First Deliverable
361361

src/Sigtran.NET.Tests/Program.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@
310310
Run("SIGTRAN commercial evidence filesystem verification report identifies missing files", SigtranCommercialEvidenceFileSystemVerificationReportIdentifiesMissingFiles);
311311
Run("SIGTRAN commercial evidence filesystem artifact writer retains reports", SigtranCommercialEvidenceFileSystemArtifactWriterRetainsReports);
312312
Run("SIGTRAN commercial evidence filesystem retention ledger covers verified files", SigtranCommercialEvidenceFileSystemRetentionLedgerCoversVerifiedFiles);
313+
Run("SIGTRAN commercial evidence filesystem integrity seal matches ledger", SigtranCommercialEvidenceFileSystemIntegritySealMatchesLedger);
313314
Run("SIGTRAN status capabilities use domain documentation labels", SigtranStatusCapabilitiesUseDomainDocumentationLabels);
314315
Run("Native SCTP platform probe reports socket creation capability", NativeSctpPlatformProbeReportsSocketCreationCapability);
315316
Run("Native SCTP socket factory creates or reports unsupported platform", NativeSctpSocketFactoryCreatesOrReportsUnsupportedPlatform);
@@ -5328,6 +5329,38 @@ static void SigtranCommercialEvidenceFileSystemRetentionLedgerCoversVerifiedFile
53285329
}
53295330
}
53305331

5332+
static void SigtranCommercialEvidenceFileSystemIntegritySealMatchesLedger()
5333+
{
5334+
string tempRoot = Path.Combine(Path.GetTempPath(), "sigtran-commercial-evidence-" + Guid.NewGuid().ToString("N"));
5335+
Directory.CreateDirectory(tempRoot);
5336+
5337+
try
5338+
{
5339+
SigtranCommercialEvidenceFileSystemRetentionLedgerExecution ledgerExecution = CreateReadyCommercialEvidenceFileSystemRetentionLedgerExecution(tempRoot);
5340+
5341+
SigtranCommercialEvidenceFileSystemIntegritySealExecution sealExecution = SigtranCommercialEvidenceFileSystemIntegritySeals.Create(
5342+
ledgerExecution,
5343+
DateTimeOffset.UtcNow);
5344+
5345+
Assert(sealExecution.IsReady, sealExecution.Describe());
5346+
Assert(sealExecution.LedgerReady, "filesystem integrity seal should require ready ledger execution");
5347+
Assert(sealExecution.SealMatchesLedger, "filesystem integrity seal should match ledger digest");
5348+
Assert(sealExecution.Seal.HasValidAggregateDigest, "filesystem integrity seal should keep aggregate digest");
5349+
}
5350+
finally
5351+
{
5352+
DeleteTempEvidenceRoot(tempRoot);
5353+
}
5354+
}
5355+
5356+
static SigtranCommercialEvidenceFileSystemRetentionLedgerExecution CreateReadyCommercialEvidenceFileSystemRetentionLedgerExecution(string tempRoot)
5357+
{
5358+
return SigtranCommercialEvidenceFileSystemRetentionLedgers.Create(
5359+
CreateReadyCommercialEvidenceFileSystemArtifactWriteResult(tempRoot),
5360+
"release-review",
5361+
DateTimeOffset.UtcNow);
5362+
}
5363+
53315364
static SigtranCommercialEvidenceFileSystemArtifactWriteResult CreateReadyCommercialEvidenceFileSystemArtifactWriteResult(string tempRoot)
53325365
{
53335366
SigtranCommercialEvidenceFileSystemVerificationExecution execution = CreateReadyCommercialEvidenceFileSystemVerificationExecution(tempRoot);
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
namespace Sigtran.NET.Core.Utilities;
2+
3+
/// <summary>
4+
/// Describes filesystem-backed commercial evidence integrity seal execution.
5+
/// </summary>
6+
public sealed class SigtranCommercialEvidenceFileSystemIntegritySealExecution
7+
{
8+
/// <summary>Creates filesystem-backed integrity seal execution.</summary>
9+
/// <param name="ledgerExecution">The filesystem-backed retention ledger execution.</param>
10+
/// <param name="seal">The integrity seal created from the ledger.</param>
11+
public SigtranCommercialEvidenceFileSystemIntegritySealExecution(
12+
SigtranCommercialEvidenceFileSystemRetentionLedgerExecution ledgerExecution,
13+
SigtranCommercialEvidenceIntegritySeal seal)
14+
{
15+
LedgerExecution = ledgerExecution ?? throw new ArgumentNullException(nameof(ledgerExecution));
16+
Seal = seal ?? throw new ArgumentNullException(nameof(seal));
17+
}
18+
19+
/// <summary>The filesystem-backed retention ledger execution.</summary>
20+
public SigtranCommercialEvidenceFileSystemRetentionLedgerExecution LedgerExecution { get; }
21+
22+
/// <summary>The integrity seal created from the ledger.</summary>
23+
public SigtranCommercialEvidenceIntegritySeal Seal { get; }
24+
25+
/// <summary>Whether the source ledger execution is ready.</summary>
26+
public bool LedgerReady => LedgerExecution.IsReady;
27+
28+
/// <summary>Whether the seal digest matches the current ledger.</summary>
29+
public bool SealMatchesLedger => Seal.MatchesLedgerDigest;
30+
31+
/// <summary>Whether filesystem-backed integrity seal execution is ready for publication attachment execution.</summary>
32+
public bool IsReady => LedgerReady
33+
&& Seal.IsReady
34+
&& SealMatchesLedger;
35+
36+
/// <summary>Formats a compact filesystem integrity seal execution summary.</summary>
37+
/// <returns>The filesystem integrity seal execution summary.</returns>
38+
public string Describe()
39+
{
40+
return $"commercialEvidenceFileSystemIntegritySealReady={IsReady} sealId={Seal.SealId}";
41+
}
42+
}
43+
44+
/// <summary>
45+
/// Provides filesystem-backed commercial evidence integrity seal execution helpers.
46+
/// </summary>
47+
public static class SigtranCommercialEvidenceFileSystemIntegritySeals
48+
{
49+
/// <summary>Creates an integrity seal from a filesystem-backed retention ledger execution.</summary>
50+
/// <param name="ledgerExecution">The filesystem-backed retention ledger execution.</param>
51+
/// <param name="sealedAtUtc">The UTC seal creation time.</param>
52+
/// <returns>The filesystem-backed integrity seal execution.</returns>
53+
public static SigtranCommercialEvidenceFileSystemIntegritySealExecution Create(
54+
SigtranCommercialEvidenceFileSystemRetentionLedgerExecution ledgerExecution,
55+
DateTimeOffset sealedAtUtc)
56+
{
57+
ArgumentNullException.ThrowIfNull(ledgerExecution);
58+
SigtranCommercialEvidenceIntegritySeal seal = SigtranCommercialEvidenceIntegritySeals.CreateDefault(
59+
ledgerExecution.Ledger,
60+
sealedAtUtc);
61+
62+
return new(ledgerExecution, seal);
63+
}
64+
}

0 commit comments

Comments
 (0)