Skip to content

Commit 1dbc381

Browse files
committed
Add commercial evidence execution blocker classifier
1 parent dedf07f commit 1dbc381

7 files changed

Lines changed: 201 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The first production milestone is M3UA over a transport abstraction. SCCP, TCAP,
7272
| Supply-chain release execution | Phase 34 foundation-complete: final versioned SBOM, trusted timestamped package signing, provenance attestation, public API diff, artifact upload, ordered command-plan, release promotion gate, concrete workflow execution, status reporting, and final validation are available; retained release-run artifacts and commercial evidence are still required |
7373
| RC publish and commercial gate | Phase 35 complete: dry-run release rehearsal, gated NuGet prerelease publication, retained release notes, retained migration notes, final commercial readiness reporting, RC/stable decisioning, RC publication evidence manifest, release workflow channel wiring, status reporting, and final commercial gate report are available; stable publication remains blocked until commercial evidence is complete |
7474
| Commercial evidence readiness lockdown | Phase 36 foundation-complete: release target locking, protected secret readiness, evidence retention mapping, commercial evidence checklist, release preflight, protected release environments, dossier handoff, go/no-go gating, status reporting, and final validation are available; RC and stable publication remain blocked until retained commercial release evidence is complete |
75-
| Commercial evidence execution orchestration | Phase 37 in progress: evidence execution run identity, stage catalog, operator command plan, execution environment contract, artifact collection manifest, and digest/redaction verification are available; blocker handling, retry/resume, and status reporting are still being implemented |
75+
| Commercial evidence execution orchestration | Phase 37 in progress: evidence execution run identity, stage catalog, operator command plan, execution environment contract, artifact collection manifest, digest/redaction verification, and blocker classification are available; retry/resume and status reporting are still being implemented |
7676

7777
## Requirements
7878

docs/PHASE37_COMMERCIAL_EVIDENCE_EXECUTION_ORCHESTRATION.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ The manifest validates checklist coverage, known stage ownership, unique paths,
7676

7777
This plan keeps evidence review auditable and prevents sensitive telecom traces from entering the public dossier without redaction review.
7878

79+
## Unit 7 - Execution Blocker Classifier
80+
81+
`SigtranCommercialEvidenceExecutionBlockers` classifies execution failures into stable categories:
82+
83+
- Readiness preflight.
84+
- Environment.
85+
- Command failure.
86+
- Native SCTP.
87+
- External peer.
88+
- Artifact retention.
89+
- Digest verification.
90+
- Redaction review.
91+
- Protected approval.
92+
93+
Each blocker declares whether it is retryable after correction. Unknown blockers are not retried automatically and require manual triage.
94+
7995
## Validation
8096

8197
Each unit in this phase is validated with:

docs/PHASE37_SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Phase 37 prepares the SDK to execute real commercial evidence runs after readine
1010
- Execution environment contract that binds run identity, lab inputs, and protected secrets without storing secret values.
1111
- Artifact collection manifest that maps checklist artifacts to known stage roots and retained output paths.
1212
- Digest and redaction verification plan for every retained execution artifact.
13+
- Execution blocker classifier for readiness, environment, command, native SCTP, external peer, artifact, digest, redaction, and approval failures.
1314

1415
## Readiness Position
1516

16-
The phase is in progress. Execution orchestration still requires blocker classification, retry/resume policy, status reporting, and final validation.
17+
The phase is in progress. Execution orchestration still requires retry/resume policy, status reporting, and final validation.

docs/PHASE_INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This index is the complete phase map for Sigtran.NET. It links each phase to the
4141
| 34 | Supply-chain release execution | [Phase 34 Supply Chain Release Execution](PHASE34_SUPPLY_CHAIN_RELEASE_EXECUTION.md), [Phase 34 Summary](PHASE34_SUMMARY.md) | Foundation complete; retained release run pending |
4242
| 35 | RC publish and commercial gate | [Phase 35 RC Publish And Commercial Gate](PHASE35_RC_PUBLISH_COMMERCIAL_GATE.md), [Phase 35 Summary](PHASE35_SUMMARY.md), [Phase 35 Commercial Gate Report](PHASE35_COMMERCIAL_GATE_REPORT.md) | RC gate foundation complete; stable publication blocked |
4343
| 36 | Commercial evidence readiness lockdown | [Phase 36 Commercial Evidence Readiness Lockdown](PHASE36_COMMERCIAL_EVIDENCE_READINESS_LOCKDOWN.md), [Phase 36 Summary](PHASE36_SUMMARY.md) | Foundation complete; real commercial evidence still required |
44-
| 37 | Commercial evidence execution orchestration | [Phase 37 Commercial Evidence Execution Orchestration](PHASE37_COMMERCIAL_EVIDENCE_EXECUTION_ORCHESTRATION.md), [Phase 37 Summary](PHASE37_SUMMARY.md) | In progress; verification plan complete |
44+
| 37 | Commercial evidence execution orchestration | [Phase 37 Commercial Evidence Execution Orchestration](PHASE37_COMMERCIAL_EVIDENCE_EXECUTION_ORCHESTRATION.md), [Phase 37 Summary](PHASE37_SUMMARY.md) | In progress; blocker classifier complete |
4545

4646
## Current Commercial Gate
4747

docs/SDK_ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Status: Phase 36 is foundation-complete. The release target lock binds an RC ver
331331
- Define execution stages, operator commands, environment contracts, artifact collection, digest and redaction verification, blocker handling, retry/resume behavior, and execution status.
332332
- Keep the phase separate from real passing evidence: orchestration can prepare a run, but publication remains blocked until retained artifacts prove execution success.
333333

334-
Status: Phase 37 is in progress. Evidence execution run identity now binds a locked release target to a stable run id, operator identity, UTC start time, and run-scoped artifact root. The stage catalog now covers readiness preflight, native SCTP lab, external peer interoperability, protocol validation, performance benchmark, supply-chain evidence, release workflow dry-run, and dossier assembly with run-scoped artifact roots. The operator command plan now maps every stage to an ordered run-id-aware command and requires protected approval for supply-chain, workflow, and dossier assembly execution. The environment contract now binds run identity, lab inputs, and protected secrets while preventing fixed secret values from being stored. Artifact collection now maps all checklist artifacts to known stage roots and retained output paths. Digest and redaction verification now requires digest coverage for every artifact and redaction review for trace-bearing evidence. Blocker handling, retry/resume, status reporting, and final validation remain in progress.
334+
Status: Phase 37 is in progress. Evidence execution run identity now binds a locked release target to a stable run id, operator identity, UTC start time, and run-scoped artifact root. The stage catalog now covers readiness preflight, native SCTP lab, external peer interoperability, protocol validation, performance benchmark, supply-chain evidence, release workflow dry-run, and dossier assembly with run-scoped artifact roots. The operator command plan now maps every stage to an ordered run-id-aware command and requires protected approval for supply-chain, workflow, and dossier assembly execution. The environment contract now binds run identity, lab inputs, and protected secrets while preventing fixed secret values from being stored. Artifact collection now maps all checklist artifacts to known stage roots and retained output paths. Digest and redaction verification now requires digest coverage for every artifact and redaction review for trace-bearing evidence. Blocker classification now categorizes readiness, environment, command, native SCTP, external peer, artifact, digest, redaction, and approval failures with retryability guidance. Retry/resume, status reporting, and final validation remain in progress.
335335

336336
## Recommended First Deliverable
337337

src/Sigtran.NET.Tests/Program.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@
284284
Run("SIGTRAN commercial evidence execution environment contract protects run inputs", SigtranCommercialEvidenceExecutionEnvironmentContractProtectsRunInputs);
285285
Run("SIGTRAN commercial evidence execution artifact manifest covers retained outputs", SigtranCommercialEvidenceExecutionArtifactManifestCoversRetainedOutputs);
286286
Run("SIGTRAN commercial evidence execution verification requires digests and redaction", SigtranCommercialEvidenceExecutionVerificationRequiresDigestsAndRedaction);
287+
Run("SIGTRAN commercial evidence execution blocker classifier categorizes failures", SigtranCommercialEvidenceExecutionBlockerClassifierCategorizesFailures);
287288
Run("SIGTRAN status capabilities use domain documentation labels", SigtranStatusCapabilitiesUseDomainDocumentationLabels);
288289
Run("Native SCTP platform probe reports socket creation capability", NativeSctpPlatformProbeReportsSocketCreationCapability);
289290
Run("Native SCTP socket factory creates or reports unsupported platform", NativeSctpSocketFactoryCreatesOrReportsUnsupportedPlatform);
@@ -4711,6 +4712,27 @@ static void SigtranCommercialEvidenceExecutionVerificationRequiresDigestsAndReda
47114712
Assert(!missingRedaction.RequiresRedactionForTraceArtifacts, "missing redaction review should block trace evidence");
47124713
}
47134714

4715+
static void SigtranCommercialEvidenceExecutionBlockerClassifierCategorizesFailures()
4716+
{
4717+
SigtranCommercialEvidenceExecutionBlockerClassifier classifier = SigtranCommercialEvidenceExecutionBlockers.CreateDefault();
4718+
SigtranCommercialEvidenceExecutionBlocker missingEnvironment = classifier.Classify("environment-missing");
4719+
SigtranCommercialEvidenceExecutionBlocker peerUnavailable = classifier.Classify("external-peer-unavailable");
4720+
SigtranCommercialEvidenceExecutionBlocker nativeSctpUnavailable = classifier.Classify("native-sctp-unavailable");
4721+
SigtranCommercialEvidenceExecutionBlocker unknown = classifier.Classify("operator-note-required");
4722+
4723+
Assert(classifier.IsReady, classifier.Describe());
4724+
Assert(classifier.HasUniqueCodes, "blocker classifier should use unique codes");
4725+
Assert(classifier.CoversOperationalKinds, "blocker classifier should cover operational blocker kinds");
4726+
Assert(missingEnvironment.Kind == SigtranCommercialEvidenceExecutionBlockerKind.Environment, "environment blocker should be classified");
4727+
Assert(missingEnvironment.Retryable, "missing environment can be retried after correction");
4728+
Assert(peerUnavailable.Kind == SigtranCommercialEvidenceExecutionBlockerKind.ExternalPeer, "external peer blocker should be classified");
4729+
Assert(peerUnavailable.Retryable, "external peer availability can be retried");
4730+
Assert(nativeSctpUnavailable.Kind == SigtranCommercialEvidenceExecutionBlockerKind.NativeSctp, "native SCTP blocker should be classified");
4731+
Assert(!nativeSctpUnavailable.Retryable, "native SCTP host capability should require host correction");
4732+
Assert(unknown.Kind == SigtranCommercialEvidenceExecutionBlockerKind.Unknown, "unknown blocker should require manual triage");
4733+
Assert(!unknown.Retryable, "unknown blocker should not be automatically retried");
4734+
}
4735+
47144736
static void SigtranStatusCapabilitiesUseDomainDocumentationLabels()
47154737
{
47164738
IReadOnlyList<string>[] statusCapabilities =
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
namespace Sigtran.NET.Core.Utilities;
2+
3+
/// <summary>
4+
/// Identifies commercial evidence execution blocker kinds.
5+
/// </summary>
6+
public enum SigtranCommercialEvidenceExecutionBlockerKind
7+
{
8+
/// <summary>Readiness preflight blocker.</summary>
9+
ReadinessPreflight,
10+
11+
/// <summary>Missing or mismatched execution environment variable.</summary>
12+
Environment,
13+
14+
/// <summary>Stage command failure.</summary>
15+
CommandFailure,
16+
17+
/// <summary>Native SCTP host capability blocker.</summary>
18+
NativeSctp,
19+
20+
/// <summary>External peer availability blocker.</summary>
21+
ExternalPeer,
22+
23+
/// <summary>Missing retained artifact blocker.</summary>
24+
ArtifactRetention,
25+
26+
/// <summary>Missing digest verification blocker.</summary>
27+
DigestVerification,
28+
29+
/// <summary>Missing redaction review blocker.</summary>
30+
RedactionReview,
31+
32+
/// <summary>Protected approval blocker.</summary>
33+
ProtectedApproval,
34+
35+
/// <summary>Unknown blocker.</summary>
36+
Unknown
37+
}
38+
39+
/// <summary>
40+
/// Describes one commercial evidence execution blocker.
41+
/// </summary>
42+
public sealed class SigtranCommercialEvidenceExecutionBlocker
43+
{
44+
/// <summary>Creates a commercial evidence execution blocker.</summary>
45+
/// <param name="code">The stable blocker code.</param>
46+
/// <param name="kind">The blocker kind.</param>
47+
/// <param name="retryable">Whether the blocker can be retried after correction.</param>
48+
/// <param name="summary">The blocker summary.</param>
49+
public SigtranCommercialEvidenceExecutionBlocker(
50+
string code,
51+
SigtranCommercialEvidenceExecutionBlockerKind kind,
52+
bool retryable,
53+
string summary)
54+
{
55+
Code = string.IsNullOrWhiteSpace(code) ? throw new ArgumentException("Blocker code is required.", nameof(code)) : code;
56+
Kind = kind;
57+
Retryable = retryable;
58+
Summary = string.IsNullOrWhiteSpace(summary) ? throw new ArgumentException("Blocker summary is required.", nameof(summary)) : summary;
59+
}
60+
61+
/// <summary>The stable blocker code.</summary>
62+
public string Code { get; }
63+
64+
/// <summary>The blocker kind.</summary>
65+
public SigtranCommercialEvidenceExecutionBlockerKind Kind { get; }
66+
67+
/// <summary>Whether the blocker can be retried after correction.</summary>
68+
public bool Retryable { get; }
69+
70+
/// <summary>The blocker summary.</summary>
71+
public string Summary { get; }
72+
}
73+
74+
/// <summary>
75+
/// Describes the commercial evidence execution blocker classifier.
76+
/// </summary>
77+
public sealed class SigtranCommercialEvidenceExecutionBlockerClassifier
78+
{
79+
/// <summary>Creates a commercial evidence execution blocker classifier.</summary>
80+
/// <param name="knownBlockers">The known blocker definitions.</param>
81+
public SigtranCommercialEvidenceExecutionBlockerClassifier(IReadOnlyList<SigtranCommercialEvidenceExecutionBlocker> knownBlockers)
82+
{
83+
ArgumentNullException.ThrowIfNull(knownBlockers);
84+
KnownBlockers = knownBlockers.Count == 0 ? throw new ArgumentException("At least one blocker is required.", nameof(knownBlockers)) : knownBlockers.ToArray();
85+
}
86+
87+
/// <summary>The known blocker definitions.</summary>
88+
public IReadOnlyList<SigtranCommercialEvidenceExecutionBlocker> KnownBlockers { get; }
89+
90+
/// <summary>Whether blocker codes are unique.</summary>
91+
public bool HasUniqueCodes => KnownBlockers.Select(static blocker => blocker.Code).Distinct(StringComparer.OrdinalIgnoreCase).Count() == KnownBlockers.Count;
92+
93+
/// <summary>Whether the classifier covers operational blocker kinds expected during execution.</summary>
94+
public bool CoversOperationalKinds => RequiredKinds.All(kind => KnownBlockers.Any(blocker => blocker.Kind == kind));
95+
96+
/// <summary>Whether the classifier is ready for execution failure handling.</summary>
97+
public bool IsReady => HasUniqueCodes
98+
&& CoversOperationalKinds;
99+
100+
/// <summary>Classifies a blocker code.</summary>
101+
/// <param name="code">The blocker code.</param>
102+
/// <returns>The matching blocker definition, or an unknown blocker.</returns>
103+
public SigtranCommercialEvidenceExecutionBlocker Classify(string code)
104+
{
105+
if (string.IsNullOrWhiteSpace(code))
106+
{
107+
throw new ArgumentException("Blocker code is required.", nameof(code));
108+
}
109+
110+
return KnownBlockers.FirstOrDefault(blocker => string.Equals(blocker.Code, code, StringComparison.OrdinalIgnoreCase))
111+
?? new(code, SigtranCommercialEvidenceExecutionBlockerKind.Unknown, retryable: false, "Unknown blocker requires manual triage.");
112+
}
113+
114+
/// <summary>Formats a compact blocker classifier summary.</summary>
115+
/// <returns>The blocker classifier summary.</returns>
116+
public string Describe()
117+
{
118+
return $"commercialEvidenceBlockerClassifierReady={IsReady} blockers={KnownBlockers.Count}";
119+
}
120+
121+
private static readonly SigtranCommercialEvidenceExecutionBlockerKind[] RequiredKinds =
122+
[
123+
SigtranCommercialEvidenceExecutionBlockerKind.ReadinessPreflight,
124+
SigtranCommercialEvidenceExecutionBlockerKind.Environment,
125+
SigtranCommercialEvidenceExecutionBlockerKind.CommandFailure,
126+
SigtranCommercialEvidenceExecutionBlockerKind.NativeSctp,
127+
SigtranCommercialEvidenceExecutionBlockerKind.ExternalPeer,
128+
SigtranCommercialEvidenceExecutionBlockerKind.ArtifactRetention,
129+
SigtranCommercialEvidenceExecutionBlockerKind.DigestVerification,
130+
SigtranCommercialEvidenceExecutionBlockerKind.RedactionReview,
131+
SigtranCommercialEvidenceExecutionBlockerKind.ProtectedApproval
132+
];
133+
}
134+
135+
/// <summary>
136+
/// Provides commercial evidence execution blocker classifier helpers.
137+
/// </summary>
138+
public static class SigtranCommercialEvidenceExecutionBlockers
139+
{
140+
/// <summary>Creates the default commercial evidence execution blocker classifier.</summary>
141+
/// <returns>The default blocker classifier.</returns>
142+
public static SigtranCommercialEvidenceExecutionBlockerClassifier CreateDefault()
143+
{
144+
return new(
145+
[
146+
new("preflight-not-ready", SigtranCommercialEvidenceExecutionBlockerKind.ReadinessPreflight, false, "Readiness preflight failed before execution."),
147+
new("environment-missing", SigtranCommercialEvidenceExecutionBlockerKind.Environment, true, "Required execution environment variable is missing."),
148+
new("environment-mismatch", SigtranCommercialEvidenceExecutionBlockerKind.Environment, true, "Execution environment variable does not match the locked run."),
149+
new("command-failed", SigtranCommercialEvidenceExecutionBlockerKind.CommandFailure, true, "Execution command failed and needs log review."),
150+
new("native-sctp-unavailable", SigtranCommercialEvidenceExecutionBlockerKind.NativeSctp, false, "Host does not provide usable native SCTP support."),
151+
new("external-peer-unavailable", SigtranCommercialEvidenceExecutionBlockerKind.ExternalPeer, true, "External SIGTRAN peer is unavailable or unreachable."),
152+
new("artifact-missing", SigtranCommercialEvidenceExecutionBlockerKind.ArtifactRetention, true, "Required retained artifact is missing."),
153+
new("digest-missing", SigtranCommercialEvidenceExecutionBlockerKind.DigestVerification, true, "Required artifact digest is missing."),
154+
new("redaction-review-missing", SigtranCommercialEvidenceExecutionBlockerKind.RedactionReview, true, "Required redaction review is missing."),
155+
new("protected-approval-missing", SigtranCommercialEvidenceExecutionBlockerKind.ProtectedApproval, false, "Protected approval is required before execution can continue.")
156+
]);
157+
}
158+
}

0 commit comments

Comments
 (0)