Skip to content

Commit fa0a80a

Browse files
committed
Add commercial evidence filesystem promotion execution
1 parent 7e3b615 commit fa0a80a

7 files changed

Lines changed: 139 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, ledger execution, seal execution, and publication attachment 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, sealing those ledgers with deterministic aggregate SHA-256 digests, and creating release dossier attachments with redaction approval gates; 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, seal execution, publication attachment execution, and promotion 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, sealing those ledgers with deterministic aggregate SHA-256 digests, creating release dossier attachments with redaction approval gates, and evaluating reviewer-approved promotion gates; command materialization, status reporting, and final validation remain |
7979

8080
## Requirements
8181

docs/PHASE40_COMMERCIAL_EVIDENCE_FILESYSTEM_EXECUTION.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ This unit gives filesystem-backed evidence the same integrity seal contract used
8585

8686
This unit connects sealed filesystem evidence to release dossier attachment planning without bypassing trace protection.
8787

88+
## Unit 8 - Promotion Gate Execution
89+
90+
`SigtranCommercialEvidenceFileSystemPromotions` evaluates filesystem-backed publication attachments against the verified promotion gate:
91+
92+
- Requires publication attachment execution to be ready.
93+
- Evaluates the current attachment manifest and seal digest.
94+
- Records reviewer identity and UTC evaluation time.
95+
- Requires explicit evidence approval before promotion.
96+
- Carries gate blockers such as `commercial-evidence-approval-missing`.
97+
98+
This unit makes the filesystem-backed evidence path promotion-aware while preserving the existing commercial approval gate.
99+
88100
## Validation
89101

90102
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
@@ -11,7 +11,8 @@ Phase 40 prepares the SDK to run commercial evidence file verification against r
1111
- Retention ledger execution that creates ledger entries from filesystem-backed verification reports and written artifacts.
1212
- Integrity seal execution that signs the filesystem-backed ledger with a deterministic aggregate SHA-256 seal.
1313
- Publication attachment execution that creates release dossier attachments from the filesystem-backed seal and requires redaction approval for trace-bearing artifacts.
14+
- Promotion gate execution that evaluates filesystem-backed attachments with reviewer identity, UTC evaluation time, and explicit approval blockers.
1415

1516
## Readiness Position
1617

17-
The phase is in progress. Filesystem observation, manifest execution, report execution, artifact writing, ledger execution, seal execution, and publication attachment execution are available. Promotion execution, command materialization, status reporting, and final validation remain.
18+
The phase is in progress. Filesystem observation, manifest execution, report execution, artifact writing, ledger execution, seal execution, publication attachment execution, and promotion execution are available. 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 publication attachment 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 promotion 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. Integrity seal execution now seals filesystem-backed ledgers with deterministic aggregate SHA-256 digests. Publication attachment execution now creates release dossier attachments from the filesystem-backed seal and requires approved redaction state for trace-bearing artifacts. 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. Publication attachment execution now creates release dossier attachments from the filesystem-backed seal and requires approved redaction state for trace-bearing artifacts. Promotion execution now evaluates filesystem-backed attachments through reviewer approval, UTC evaluation, and explicit blockers. Command materialization, status reporting, and final validation remain in progress.
359359

360360
## Recommended First Deliverable
361361

src/Sigtran.NET.Tests/Program.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@
312312
Run("SIGTRAN commercial evidence filesystem retention ledger covers verified files", SigtranCommercialEvidenceFileSystemRetentionLedgerCoversVerifiedFiles);
313313
Run("SIGTRAN commercial evidence filesystem integrity seal matches ledger", SigtranCommercialEvidenceFileSystemIntegritySealMatchesLedger);
314314
Run("SIGTRAN commercial evidence filesystem publication attachments protect trace evidence", SigtranCommercialEvidenceFileSystemPublicationAttachmentsProtectTraceEvidence);
315+
Run("SIGTRAN commercial evidence filesystem promotion gate requires approval", SigtranCommercialEvidenceFileSystemPromotionGateRequiresApproval);
315316
Run("SIGTRAN status capabilities use domain documentation labels", SigtranStatusCapabilitiesUseDomainDocumentationLabels);
316317
Run("Native SCTP platform probe reports socket creation capability", NativeSctpPlatformProbeReportsSocketCreationCapability);
317318
Run("Native SCTP socket factory creates or reports unsupported platform", NativeSctpSocketFactoryCreatesOrReportsUnsupportedPlatform);
@@ -5383,6 +5384,44 @@ static void SigtranCommercialEvidenceFileSystemPublicationAttachmentsProtectTrac
53835384
}
53845385
}
53855386

5387+
static void SigtranCommercialEvidenceFileSystemPromotionGateRequiresApproval()
5388+
{
5389+
string tempRoot = Path.Combine(Path.GetTempPath(), "sigtran-commercial-evidence-" + Guid.NewGuid().ToString("N"));
5390+
Directory.CreateDirectory(tempRoot);
5391+
5392+
try
5393+
{
5394+
SigtranCommercialEvidenceFileSystemPublicationAttachmentExecution attachmentExecution = CreateReadyCommercialEvidenceFileSystemPublicationAttachmentExecution(tempRoot);
5395+
5396+
SigtranCommercialEvidenceFileSystemPromotionExecution approved = SigtranCommercialEvidenceFileSystemPromotions.Evaluate(
5397+
attachmentExecution,
5398+
"release-review",
5399+
DateTimeOffset.UtcNow);
5400+
SigtranCommercialEvidenceFileSystemPromotionExecution blocked = SigtranCommercialEvidenceFileSystemPromotions.Evaluate(
5401+
attachmentExecution,
5402+
"release-review",
5403+
DateTimeOffset.UtcNow,
5404+
evidenceApproved: false);
5405+
5406+
Assert(approved.IsReady, approved.Describe());
5407+
Assert(approved.AttachmentsReady, "filesystem promotion should require ready attachments");
5408+
Assert(approved.UsesCurrentAttachmentManifest, "filesystem promotion should evaluate the current attachment manifest");
5409+
Assert(approved.CanPromoteEvidence, "approved filesystem evidence should promote");
5410+
Assert(!blocked.IsReady, "missing approval should block filesystem promotion");
5411+
Assert(blocked.PromotionGate.Blockers.Contains("commercial-evidence-approval-missing"), "filesystem promotion should expose approval blocker");
5412+
}
5413+
finally
5414+
{
5415+
DeleteTempEvidenceRoot(tempRoot);
5416+
}
5417+
}
5418+
5419+
static SigtranCommercialEvidenceFileSystemPublicationAttachmentExecution CreateReadyCommercialEvidenceFileSystemPublicationAttachmentExecution(string tempRoot)
5420+
{
5421+
return SigtranCommercialEvidenceFileSystemPublicationAttachments.Create(
5422+
CreateReadyCommercialEvidenceFileSystemIntegritySealExecution(tempRoot));
5423+
}
5424+
53865425
static SigtranCommercialEvidenceFileSystemIntegritySealExecution CreateReadyCommercialEvidenceFileSystemIntegritySealExecution(string tempRoot)
53875426
{
53885427
return SigtranCommercialEvidenceFileSystemIntegritySeals.Create(
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
namespace Sigtran.NET.Core.Utilities;
2+
3+
/// <summary>
4+
/// Describes filesystem-backed commercial evidence promotion gate execution.
5+
/// </summary>
6+
public sealed class SigtranCommercialEvidenceFileSystemPromotionExecution
7+
{
8+
/// <summary>Creates filesystem-backed commercial evidence promotion execution.</summary>
9+
/// <param name="attachmentExecution">The filesystem-backed publication attachment execution.</param>
10+
/// <param name="promotionGate">The verified promotion gate result.</param>
11+
public SigtranCommercialEvidenceFileSystemPromotionExecution(
12+
SigtranCommercialEvidenceFileSystemPublicationAttachmentExecution attachmentExecution,
13+
SigtranCommercialEvidenceVerifiedPromotionGateResult promotionGate)
14+
{
15+
AttachmentExecution = attachmentExecution ?? throw new ArgumentNullException(nameof(attachmentExecution));
16+
PromotionGate = promotionGate ?? throw new ArgumentNullException(nameof(promotionGate));
17+
}
18+
19+
/// <summary>The filesystem-backed publication attachment execution.</summary>
20+
public SigtranCommercialEvidenceFileSystemPublicationAttachmentExecution AttachmentExecution { get; }
21+
22+
/// <summary>The verified promotion gate result.</summary>
23+
public SigtranCommercialEvidenceVerifiedPromotionGateResult PromotionGate { get; }
24+
25+
/// <summary>Whether publication attachment execution is ready.</summary>
26+
public bool AttachmentsReady => AttachmentExecution.IsReady;
27+
28+
/// <summary>Whether the promotion gate was explicitly approved.</summary>
29+
public bool PromotionApproved => PromotionGate.EvidenceApproved;
30+
31+
/// <summary>Whether the promotion gate references the current filesystem-backed attachment manifest.</summary>
32+
public bool UsesCurrentAttachmentManifest => string.Equals(PromotionGate.AttachmentManifest.Seal.SealId, AttachmentExecution.AttachmentManifest.Seal.SealId, StringComparison.Ordinal)
33+
&& string.Equals(PromotionGate.AttachmentManifest.Seal.AggregateSha256, AttachmentExecution.AttachmentManifest.Seal.AggregateSha256, StringComparison.OrdinalIgnoreCase)
34+
&& PromotionGate.AttachmentManifest.Attachments.Count == AttachmentExecution.AttachmentManifest.Attachments.Count;
35+
36+
/// <summary>Whether the promotion gate produced no blockers.</summary>
37+
public bool HasNoPromotionBlockers => PromotionGate.Blockers.Count == 0;
38+
39+
/// <summary>Whether filesystem-backed evidence can be promoted toward release publication.</summary>
40+
public bool CanPromoteEvidence => PromotionGate.CanPromoteEvidence;
41+
42+
/// <summary>Whether filesystem-backed promotion execution is ready for command materialization and status reporting.</summary>
43+
public bool IsReady => AttachmentsReady
44+
&& UsesCurrentAttachmentManifest
45+
&& PromotionApproved
46+
&& HasNoPromotionBlockers
47+
&& CanPromoteEvidence;
48+
49+
/// <summary>Formats a compact filesystem promotion execution summary.</summary>
50+
/// <returns>The filesystem promotion execution summary.</returns>
51+
public string Describe()
52+
{
53+
return $"commercialEvidenceFileSystemPromotionReady={IsReady} blockers={PromotionGate.Blockers.Count} reviewer={PromotionGate.ReleaseReviewer}";
54+
}
55+
}
56+
57+
/// <summary>
58+
/// Provides filesystem-backed commercial evidence promotion helpers.
59+
/// </summary>
60+
public static class SigtranCommercialEvidenceFileSystemPromotions
61+
{
62+
/// <summary>Evaluates filesystem-backed commercial evidence promotion readiness.</summary>
63+
/// <param name="attachmentExecution">The filesystem-backed publication attachment execution.</param>
64+
/// <param name="releaseReviewer">The reviewer that evaluated promotion readiness.</param>
65+
/// <param name="evaluatedAtUtc">The UTC evaluation time.</param>
66+
/// <param name="evidenceApproved">Whether promotion is explicitly approved.</param>
67+
/// <returns>The filesystem-backed promotion execution result.</returns>
68+
public static SigtranCommercialEvidenceFileSystemPromotionExecution Evaluate(
69+
SigtranCommercialEvidenceFileSystemPublicationAttachmentExecution attachmentExecution,
70+
string releaseReviewer,
71+
DateTimeOffset evaluatedAtUtc,
72+
bool evidenceApproved = true)
73+
{
74+
ArgumentNullException.ThrowIfNull(attachmentExecution);
75+
SigtranCommercialEvidenceVerifiedPromotionGateResult gate = SigtranCommercialEvidenceVerifiedPromotionGates.Evaluate(
76+
attachmentExecution.AttachmentManifest,
77+
releaseReviewer,
78+
evaluatedAtUtc,
79+
evidenceApproved);
80+
81+
return new(attachmentExecution, gate);
82+
}
83+
}

0 commit comments

Comments
 (0)