This repository was archived by the owner on May 12, 2026. It is now read-only.
docs: add ADR and SGHFA standards architecture reference - #135
Draft
justinlietz93 wants to merge 3 commits into
Draft
docs: add ADR and SGHFA standards architecture reference#135justinlietz93 wants to merge 3 commits into
justinlietz93 wants to merge 3 commits into
Conversation
Reviewer's GuideAdds two documentation-only architecture references: a canonical standards document defining the Standards-Governed Hexagonal Falsification Architecture (SGHFA) for Prometheus_VDM and an ADR that inventories the current pipeline, analyzes gaps, and lays out a migration plan to that target architecture. Sequence diagram for SGHFA mandatory falsification workflowsequenceDiagram
actor Scientist
participant experiment_control
participant execution_pipeline
participant ApprovalPort
participant PredictorPort
participant ValidationGatePort
participant ProvenancePort
participant ArtifactRegistryPort
participant ContradictionReporterPort
participant CanonResolverPort
Scientist->>experiment_control: Submit_run_request_with_ProposalDocument
experiment_control->>execution_pipeline: startRun(proposal_id)
execution_pipeline->>ProvenancePort: appendLedgerEntry(stage_name=Proposal, input_hashes, output_hashes, parent_hash)
ProvenancePort-->>execution_pipeline: ProvenanceLedgerEntry
execution_pipeline->>ApprovalPort: validateApproval(ApprovalArtifact)
ApprovalPort-->>execution_pipeline: ApprovalArtifact
execution_pipeline->>CanonResolverPort: resolveThresholds(canon_anchor_ids)
CanonResolverPort-->>execution_pipeline: resolved_threshold_values
execution_pipeline->>PredictorPort: buildPredictionEnvelope(prereg_id, approval_id, canon_anchor_refs)
PredictorPort-->>execution_pipeline: PredictionEnvelope
execution_pipeline->>ProvenancePort: recordExecution(run_id, spec_hash, git_commit, tree_hash, seeds, runtime_hardware)
ProvenancePort-->>execution_pipeline: ExecutionReceipt
execution_pipeline->>ArtifactRegistryPort: registerArtifacts(run_id, artifact_descriptors, parent_manifest_hash)
ArtifactRegistryPort-->>execution_pipeline: ArtifactManifest
execution_pipeline->>ValidationGatePort: evaluateGates(ExecutionReceipt, PredictionEnvelope)
ValidationGatePort-->>execution_pipeline: GateEvaluation_set
alt all_gates_pass
execution_pipeline->>ProvenancePort: appendLedgerEntry(stage_name=PassRouting, input_hashes, output_hashes, parent_hash)
ProvenancePort-->>execution_pipeline: ProvenanceLedgerEntry
else any_gate_or_provenance_failure
execution_pipeline->>ContradictionReporterPort: emitContradiction(run_id, failed_gate_ids, evidence_artifact_pointers, severity)
ContradictionReporterPort-->>execution_pipeline: ContradictionReport
execution_pipeline->>ProvenancePort: appendLedgerEntry(stage_name=ContradictionRouting, input_hashes, output_hashes, parent_hash)
ProvenancePort-->>execution_pipeline: ProvenanceLedgerEntry
end
execution_pipeline-->>experiment_control: Run_result_summary
experiment_control-->>Scientist: Publish_pass_package_or_ContradictionReport
Entity relationship diagram for SGHFA artifacts and provenance chainerDiagram
ProposalDocument {
string proposal_id
string title
string domain
string proposal_hash
}
PreRegistrationRecord {
string prereg_id
string proposal_id
string prereg_hash
}
ApprovalArtifact {
string approval_id
string proposal_id
string prereg_id
string approval_hash
}
PredictionEnvelope {
string prediction_id
string prereg_id
string approval_id
string prediction_hash
}
ExecutionReceipt {
string run_id
string execution_hash
}
GateEvaluation {
string gate_id
string run_id
boolean passed
string gate_hash
}
ContradictionReport {
string contradiction_id
string run_id
string contradiction_hash
}
ArtifactManifest {
string manifest_id
string run_id
string parent_hash
}
ProvenanceLedgerEntry {
string entry_id
string stage_name
string parent_hash
}
ProposalDocument ||--o{ PreRegistrationRecord : has
ProposalDocument ||--o{ ApprovalArtifact : referenced_by
PreRegistrationRecord ||--o{ ApprovalArtifact : constrained_by
PreRegistrationRecord ||--o{ PredictionEnvelope : source_for
ApprovalArtifact ||--o{ PredictionEnvelope : authorizes
ApprovalArtifact ||--o{ ExecutionReceipt : enables
PredictionEnvelope ||--o{ ExecutionReceipt : precedes
ExecutionReceipt ||--o{ GateEvaluation : produces
ExecutionReceipt ||--o{ ArtifactManifest : indexed_by
ExecutionReceipt ||--o{ ContradictionReport : may_generate
ArtifactManifest ||--o{ ProvenanceLedgerEntry : summarized_by
ProvenanceLedgerEntry ||--|| ProvenanceLedgerEntry : parent_child_chain
Class diagram for SGHFA domain contracts and portsclassDiagram
class ProposalDocument {
+string proposal_id
+string title
+string domain
+list hypotheses
+list canon_anchor_refs
+string proposal_hash
}
class PreRegistrationRecord {
+string prereg_id
+string proposal_id
+string variables
+string controls
+string pass_fail_criteria
+string spec_refs
+string salted_provenance
+string prereg_hash
}
class ApprovalArtifact {
+string proposal_id
+string prereg_id
+string tag
+string approved_by
+datetime approved_at
+string approval_key
+string script_scope
+string approval_hash
}
class PredictionEnvelope {
+string prediction_id
+string prereg_id
+string approval_id
+string metric_envelopes
+string thresholds
+string confidence_metadata
+string prediction_hash
}
class ExecutionReceipt {
+string run_id
+string spec_hash
+string git_commit
+string tree_hash
+string seeds
+string runtime_hardware
+string execution_hash
}
class GateEvaluation {
+string gate_id
+list canon_anchor_refs
+string measured_values
+string threshold_values
+bool passed
+string gate_hash
}
class ContradictionReport {
+string run_id
+list failed_gate_ids
+list evidence_artifact_pointers
+string severity
+string contradiction_hash
}
class ArtifactManifest {
+string manifest_id
+list artifact_entries
+string parent_hash
}
class ProvenanceLedgerEntry {
+string stage_name
+string actor
+datetime timestamp
+list input_hashes
+list output_hashes
+string parent_hash
}
class PredictorPort {
<<interface>>
+PredictionEnvelope buildPredictionEnvelope(string prereg_id, string approval_id, list canon_anchor_refs)
}
class ApprovalPort {
<<interface>>
+ApprovalArtifact validateApproval(ApprovalArtifact approval_artifact)
}
class ValidationGatePort {
<<interface>>
+list evaluateGates(ExecutionReceipt execution_receipt, PredictionEnvelope prediction_envelope)
}
class ProvenancePort {
<<interface>>
+ExecutionReceipt recordExecution(string run_id, string spec_hash, string git_commit, string tree_hash, string seeds, string runtime_hardware)
+ProvenanceLedgerEntry appendLedgerEntry(string stage_name, list input_hashes, list output_hashes, string parent_hash)
}
class ArtifactRegistryPort {
<<interface>>
+ArtifactManifest registerArtifacts(string run_id, list artifact_descriptors, string parent_manifest_hash)
}
class ContradictionReporterPort {
<<interface>>
+ContradictionReport emitContradiction(string run_id, list failed_gate_ids, list evidence_artifact_pointers, string severity)
}
class CanonResolverPort {
<<interface>>
+string resolveConstant(string canon_anchor_id)
+string resolveEquation(string canon_anchor_id)
+string resolveThreshold(string canon_anchor_id)
}
ProposalDocument "1" --> "*" PreRegistrationRecord : referenced_by
PreRegistrationRecord "1" --> "1" ApprovalArtifact : approved_into
ApprovalArtifact "1" --> "1" PredictionEnvelope : enables
PredictionEnvelope "1" --> "*" GateEvaluation : evaluated_by
ExecutionReceipt "1" --> "*" GateEvaluation : produces
ExecutionReceipt "1" --> "*" ArtifactManifest : indexed_by
ArtifactManifest "1" --> "*" ProvenanceLedgerEntry : chained_by
ExecutionReceipt "1" --> "*" ContradictionReport : may_generate
PredictorPort --> PredictionEnvelope
PredictorPort --> PreRegistrationRecord
ApprovalPort --> ApprovalArtifact
ApprovalPort --> ProposalDocument
ApprovalPort --> PreRegistrationRecord
ValidationGatePort --> GateEvaluation
ValidationGatePort --> PredictionEnvelope
ValidationGatePort --> ExecutionReceipt
ProvenancePort --> ExecutionReceipt
ProvenancePort --> ProvenanceLedgerEntry
ArtifactRegistryPort --> ArtifactManifest
ContradictionReporterPort --> ContradictionReport
CanonResolverPort --> ProposalDocument
CanonResolverPort --> PreRegistrationRecord
CanonResolverPort --> GateEvaluation
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
docs/ADR_CURRENT_TO_TARGET_SGHFA.mdwhich inventories the existing pipeline (proposal/prereg/approval touchpoints, validation/gates, provenance, CI), documents gaps vs. the target, and supplies a detailed current→target migration plan.STANDARDS_GOVERNED_HEXAGONAL_FALSIFICATION_ARCHITECTURE.mdas the canonical, living standards reference that defines inviolable principles, required hexagonal layers (experiment_control,execution_pipeline,theory_core,infrastructure_adapters,governance_automation), explicit domain contracts (e.g.,ProposalDocument,PredictionEnvelope,ContradictionReport), required ports (e.g.,ApprovalPort,ProvenancePort,ValidationGatePort), mandatory workflow sequence, enforcement matrix, and glossary.Testing
git status --short,git add+git commit -m "docs: add current-to-target ADR and SGHFA architecture standard", and inspected the new files withnl/sed; all commands completed successfully.Codex Task
Summary by Sourcery
Add a canonical standards document defining the Standards-Governed Hexagonal Falsification Architecture (SGHFA) and an ADR documenting the current Prometheus_VDM pipeline and its migration path to the target architecture.
Documentation: