Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions crates/arc-kit-au/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn content_hash(parts: &[&str]) -> String {
}

/// Source document evidence.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct SourceDoc {
/// Original filename (must follow VENDOR--ACCOUNT--YYYY-MM--DOCTYPE.ext)
pub filename: String,
Expand All @@ -151,7 +151,7 @@ impl SourceDoc {
}

/// Extracted row from document parsing.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct ExtractedRow {
pub account_id: String,
pub date: String,
Expand All @@ -176,7 +176,7 @@ impl ExtractedRow {
}

/// Deterministic transaction record.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct Transaction {
/// Blake3 hash of account/date/amount/description
pub tx_id: String,
Expand All @@ -194,7 +194,7 @@ impl Transaction {
}

/// Classification applied to transaction.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct Classification {
pub tx_id: String,
pub category: String,
Expand All @@ -221,7 +221,7 @@ impl Classification {
}

/// Model-generated classification proposal.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct ModelProposal {
pub tx_id: String,
pub model_name: String,
Expand All @@ -247,7 +247,7 @@ impl ModelProposal {
}

/// Operator approval/rejection of model proposal.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct OperatorApproval {
pub tx_id: String,
pub operator_id: String,
Expand Down Expand Up @@ -275,7 +275,7 @@ impl OperatorApproval {
/// Distinct from Classification — validation artifacts represent rule/constraint
/// failures, not categorization decisions. PRD-4 Phase 2 requires
/// classification_artifact → validation_artifact as a separate chain step.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct ValidationIssue {
pub tx_id: String,
pub rule: String,
Expand All @@ -301,7 +301,7 @@ impl ValidationIssue {
}

/// Final workbook row in CPA export.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, SysmlBlock)]
pub struct WorkbookRow {
pub tx_id: String,
pub sheet_name: String,
Expand Down
15 changes: 15 additions & 0 deletions crates/ledger-core/src/iso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ pub enum SemanticType {
Issue,
Proof,
Attestation,
/// SysML-v2 systems-modeling requirement record — see `ZLayer::SystemsModel`.
Requirement,
/// SysML-v2 systems-modeling decision record — see `ZLayer::SystemsModel`.
Decision,
/// SysML-v2 systems-modeling cost record — see `ZLayer::SystemsModel`.
Cost,
Unknown,
}

Expand All @@ -155,6 +161,9 @@ impl SemanticType {
SemanticType::Issue => "issue",
SemanticType::Proof => "proof",
SemanticType::Attestation => "attestation",
SemanticType::Requirement => "requirement",
SemanticType::Decision => "decision",
SemanticType::Cost => "cost",
SemanticType::Unknown => "unknown",
}
}
Expand Down Expand Up @@ -690,6 +699,9 @@ mod tests {
SemanticType::Issue,
SemanticType::Proof,
SemanticType::Attestation,
SemanticType::Requirement,
SemanticType::Decision,
SemanticType::Cost,
SemanticType::Unknown,
];
for st in all {
Expand Down Expand Up @@ -816,6 +828,9 @@ mod tests {
SemanticType::Issue,
SemanticType::Proof,
SemanticType::Attestation,
SemanticType::Requirement,
SemanticType::Decision,
SemanticType::Cost,
SemanticType::Unknown,
];
for st in all {
Expand Down
64 changes: 63 additions & 1 deletion crates/ledger-core/src/iso_objects.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `HasVisualization` implementations for the 28 domain types that participate
//! `HasVisualization` implementations for the 31 domain types that participate
//! in the isometric pipeline view.
//!
//! Every `impl HasVisualization` added here must also be registered in
Expand Down Expand Up @@ -469,9 +469,64 @@
}
}

// ============================================================================
// SYSTEMS MODEL — Requirement/Decision/Cost (z=6, SystemsModel layer)
// ============================================================================

#[cfg(feature = "arc-kit-au")]
mod systems_model {
use arc_kit_au::node::{Cost, Decision, Requirement};

use crate::iso::{HasVisualization, RhaiDsl, SemanticType, VisualizationSpec, ZLayer};

impl HasVisualization for Requirement {
fn viz_spec() -> VisualizationSpec {
VisualizationSpec {
semantic_type: SemanticType::Requirement,
z_layer: ZLayer::SystemsModel,
rhai_dsl: RhaiDsl::new(
r#"let req = load_requirement(source);
if req.status == "active" { link_decisions(req.related_decisions) }"#,
),
description: "SysML v2 systems-modeling requirement — traceable spec record, linked to the decisions it constrains",
}
}
}

impl HasVisualization for Decision {
fn viz_spec() -> VisualizationSpec {
VisualizationSpec {
semantic_type: SemanticType::Decision,
z_layer: ZLayer::SystemsModel,
rhai_dsl: RhaiDsl::new(
r#"let decision = record_decision(subject, rationale, decided_by);
link_requirements(decision.related_requirements);"#,
),
description: "Version-controlled decision record — rationale + decider, linked back to the requirements it satisfies",
}
}
}

impl HasVisualization for Cost {
fn viz_spec() -> VisualizationSpec {
VisualizationSpec {
semantic_type: SemanticType::Cost,
z_layer: ZLayer::SystemsModel,
rhai_dsl: RhaiDsl::new(
r#"let cost = record_cost(subject, amount, currency);
if cost.related_decision.is_some() { attribute_to_decision(cost) }"#,
),
description: "Version-controlled cost record — monetary amount attributed to a decision for systems-modeling cost traceability",
}
}
}
}

#[cfg(test)]
mod tests {

Check warning

Code scanning / clippy

items after a test module Warning

items after a test module

Check warning

Code scanning / clippy

items after a test module Warning

items after a test module
use super::*;
#[cfg(feature = "arc-kit-au")]
use arc_kit_au::node::{Cost, Decision, Requirement};

#[test]
fn all_viz_spec_rhai_dsl_has_valid_syntax() {
Expand Down Expand Up @@ -517,6 +572,13 @@
check!(UsRdcCredit);
check!(CryptoTx);
check!(CryptoWallet);
// Systems-modeling domain
#[cfg(feature = "arc-kit-au")]
{
check!(Requirement);
check!(Decision);
check!(Cost);
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion crates/ledgerr-mcp/tests/pipeline_e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn pipe_viz_manifest_entry_count_matches_registered_types() {
// `impl HasVisualization` blocks in `ledger_core::iso_objects`. It must be
// regenerated (and this count updated) whenever an impl is added, removed,
// or registered/deregistered in xtask/src/viz_manifest.rs.
const EXPECTED_ENTRY_COUNT: usize = 28;
const EXPECTED_ENTRY_COUNT: usize = 31;

let manifest_path = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
Expand Down Expand Up @@ -218,6 +218,9 @@ fn pipe_viz_manifest_entry_count_matches_registered_types() {
"AuRdActivity",
"UsRdcCredit",
"CryptoWallet",
"Requirement",
"Decision",
"Cost",
] {
assert!(names.contains(&expected), "missing {expected} entry");
}
Expand Down
Loading
Loading