Files
git.stella-ops.org/docs/features/unchecked/attestor/proof-chain-cli-commands-with-structured-exit-codes.md

2.8 KiB

Proof Chain CLI Commands with Structured Exit Codes

Module

Attestor

Status

IMPLEMENTED

Description

CLI commands for proof chain operations (stellaops proof verify, stellaops proof spine, stellaops anchor, stellaops receipt) with structured exit codes (0=success, 1=policy violation, 2=system error) enabling CI/CD integration.

Implementation Details

  • Proof Chain Verification: src/Attestor/__Libraries/StellaOps.Attestor.ProofChain/Verification/VerificationPipeline.cs (with .Verify) -- verification pipeline invoked by CLI commands.
  • Verification Pipeline Request: Verification/VerificationPipelineRequest.cs -- request model for CLI-initiated verification.
  • Verification Pipeline Result: Verification/VerificationPipelineResult.cs -- result model with structured status for CLI exit code mapping.
  • Verification Step Result: Verification/VerificationStepResult.cs -- individual step result for structured output.
  • Verification Pipeline Interfaces: Verification/VerificationPipelineInterfaces.cs -- interfaces for pipeline steps.
  • Proof Spine Assembly: Assembly/ProofSpineRequest.cs, ProofSpineResult.cs -- spine assembly for stellaops proof spine command.
  • Spine Verification: Assembly/SpineVerificationCheck.cs, SpineVerificationResult.cs -- spine verification results.
  • Verification Receipt: Receipts/VerificationReceipt.cs -- receipt generation for stellaops receipt command.
  • Trust Anchor Verification: Verification/TrustAnchorVerificationStep.cs -- trust anchor verification for stellaops anchor command.
  • Verification Bundle Models: Verification/VerificationBundleModels.cs -- bundle models for CLI input/output.
  • Web Service Endpoints: StellaOps.Attestor.WebService/Controllers/VerifyController.cs, ChainController.cs -- REST endpoints backing CLI commands.
  • Tests: __Tests/StellaOps.Attestor.ProofChain.Tests/VerificationPipelineTests.cs

E2E Test Plan

  • Run stellaops proof verify on a valid signed proof chain and verify exit code 0 (success)
  • Run stellaops proof verify on a proof chain with a policy violation and verify exit code 1
  • Run stellaops proof verify with an invalid input file and verify exit code 2 (system error)
  • Run stellaops proof spine to assemble a proof spine and verify the output contains a Merkle root
  • Run stellaops anchor to verify trust anchors and verify structured output with anchor status
  • Run stellaops receipt to generate a verification receipt and verify the receipt JSON contains all checks
  • Verify VerificationPipelineResult maps correctly to CLI exit codes: all steps pass -> 0, policy violation -> 1, exception -> 2
  • Integrate stellaops proof verify into a CI pipeline and verify the exit code gates the pipeline correctly