moontrustflow

A lightweight MoonBit Policy-as-Code toolkit for trusted flow governance, boundary rules, and explainable compliance reports.

security
policy-as-code
governance
trust-boundary
compliance
contest
moon add lllg123/moontrustflow@0.2.0
Download zip
Author
Version
0.2.0
License
Apache-2.0
Last updated
yesterday
Downloads
4
README

#MoonTrustFlow

MoonTrustFlow is a MoonBit Policy-as-Code toolkit for trusted data-flow governance. It turns a compact .mtf rule file into deterministic findings that can be reused in code review, CI audit, architecture governance, and security acceptance work.

This project is intentionally scoped as the policy and path-analysis middle layer. It does not claim to be a full compiler frontend or a production-ready whole-program analyzer. Instead, it focuses on the part many MoonBit projects still lack today: a small, reviewable, explainable trust-flow engine that can later accept AST, call-graph, or architecture-adapter inputs.

#Why It Matters

  • MoonBit ecosystem projects need reusable governance tooling, not only runtime libraries.
  • Security and compliance reviews often need deterministic source-to-sink evidence instead of prose.
  • A compact rule language is easier to audit, version, and discuss in pull requests than ad hoc scripts.

#Current Capabilities

  • Parse .mtf models with stable line and column diagnostics.
  • Model source, sink, sanitizer, boundary, node, and edge.
  • Evaluate deny, require through=, and exact-path allow policies.
  • Report complex scenarios including multi-sink, branching, and cycle-pruned paths.
  • Emit both plain-text and JSON findings.
  • Emit SARIF 2.1.0 findings for GitHub code-scanning and security review pipelines.
  • Produce graph exports, node-impact rankings, policy audits, risk assessments, and deployment contracts.
  • Compare findings against a versioned baseline to distinguish new, resolved, and regressed risks.
  • Analyze multiple models in one deterministic batch report.
  • Drive real fixture analysis through repository scripts without changing the core package target surface.
  • Import a lightweight call-graph JSON description into .mtf for adapter-oriented experiments.
  • Run a repeatable performance smoke test over generated larger trust-flow graphs.

#Public API

  • parse_model(input : String) -> Result[Model, TrustFlowError]
  • analyze(model : Model) -> Array[Finding]
  • analyze_text(input : String) -> Result[Array[Finding], TrustFlowError]
  • format_finding(finding : Finding) -> String
  • format_report(findings : Array[Finding]) -> String
  • format_report_json(findings : Array[Finding]) -> String
  • format_error(err : TrustFlowError) -> String

Core public types include NodeKind, RuleKind, Node, Edge, Policy, Model, Finding, and TrustFlowError.

#Example Model

source request_body "external input" boundary api_gateway "trusted service boundary" sanitizer escape_html "html output encoding" sink render_html "html response renderer" edge request_body -> api_gateway "ingress" edge api_gateway -> render_html "response output" edge api_gateway -> escape_html "encode" edge escape_html -> render_html "safe render" deny request_body -> render_html severity=high "raw input must not render directly" require request_body -> render_html through=escape_html severity=medium "html output must be encoded" allow request_body -> api_gateway -> escape_html -> render_html "encoded response path"

#Quick Start

Install the package from Mooncakes:

moon add lllg123/moontrustflow

Validate the repository locally:

# MoonBit 0.10.3+16975d007 moon check --target all --deny-warn moon test --deny-warn moon fmt moon info moon run cmd/main

moon test --target all --deny-warn additionally exercises the native backend and therefore requires a system C compiler. The three-platform CI workflow installs the required compiler toolchains explicitly.

Analyze a real .mtf fixture through the repository wrapper:

powershell -ExecutionPolicy Bypass -File scripts\analyze_model.ps1 -Path fixtures\models\webapp_taint.mtf -Json

Cross-platform wrapper:

python scripts/analyze_model.py fixtures/models/webapp_taint.mtf --json

The wrapper reads the file, exports MOONTRUSTFLOW_MODEL_TEXT, and then reuses moon run cmd/main for deterministic JSON or text output.

Import a simple call-graph fixture into .mtf:

python scripts/import_callgraph.py fixtures/adapters/service_callgraph.json

Run a lightweight performance smoke test:

python scripts/benchmark_analysis.py --hops 64

Run the full representative fixture and boundary corpus:

python scripts/verify_fixture_corpus.py

The corpus covers web-service security, message pipelines, call-graph adapters, branching, cycles, disconnected paths, quoted text, comments, and empty input. Expected node/edge/policy/finding summaries are versioned in fixtures/benchmarks/manifest.json.

#CLI Behavior

moon run cmd/main always works with the embedded sample model.

MoonTrustFlow policy evaluation source=embedded-sample nodes=4, edges=4, policies=3, findings=2

Add --json or -j to emit structured output:

moon run cmd/main -- --json

The CLI also exposes application-facing review modes:

moon run cmd/main -- --sarif # SARIF 2.1.0 for security tooling moon run cmd/main -- --assessment # risk score, graph metrics, and remediation issues moon run cmd/main -- --graph # human-readable graph and boundary summary moon run cmd/main -- --contract # deployment-time model contract gate

For real files, use the wrapper script shown above. This keeps the core package cross-target friendly while still providing a practical repository CLI for actual .mtf inputs.

#Adapter Fixture

fixtures/adapters/service_callgraph.json demonstrates a minimal adapter schema:

  • nodes: typed graph nodes that become source, sink, sanitizer, boundary, or node
  • edges: graph edges with optional labels
  • policies: allow, deny, and require rules with optional through and severity

The generated fixtures/models/service_callgraph_imported.mtf gives us a reviewable text artifact that can still be fed into the normal MoonTrustFlow analysis flow.

#Engineering Status

  • Main implementation language: MoonBit
  • License: Apache-2.0
  • Application-valued MoonBit implementation scale on 2026-08-16: 3048 production lines across .mbt files, excluding tests and generated interfaces
  • Test implementation scale: 449 lines, with 26 tests passing on each Wasm, Wasm-GC, and JS target
  • Fixture coverage includes branching, cycle-pruning, multi-sink, and reviewed-exception scenarios
  • The deterministic fixture corpus contains 9 representative models with expected summaries and boundary cases
  • Application modules include risk metrics, policy audits, graph queries/exports, SARIF, batch analysis, baselines, quality gates, and model contracts
  • Mooncakes module: lllg123/moontrustflow
  • CI workflow: .github/workflows/ci.yml
  • Contribution and license notices: CONTRIBUTING.md, LICENSE, and NOTICE
  • GitHub contributor API checked on 2026-08-14: only lllg123 is currently exposed as a public GitHub contributor login for the GitHub mirror
  • Remote HEAD audit on 2026-08-14: GitHub defaults to main, while GitLink defaults to master

#OSC2026 Notes

The official OSC2026 pages and committee notices are the source of truth for current dates, submission logistics, and acceptance arrangements. This repository records the durable engineering requirements rather than freezing a potentially outdated schedule snapshot:

  • public development traces and complete commit history
  • clear project scope, documentation, usage instructions, and limitations
  • reproducible build/run commands and runnable tests
  • maintainable structure, boundary coverage, and ecosystem value
  • OSI-approved licensing and third-party attribution compliance

MoonTrustFlow is still below that reference LOC band, so this repository now responds by making the implemented scope more concrete:

  • split MoonBit modules instead of one large file
  • richer fixtures and edge-case tests
  • JSON output in addition to text output
  • cross-platform wrapper scripts, call-graph import, and benchmark smoke checks
  • contributor identity and acceptance self-check scripts
  • CI aligned to the MoonBit 0.10.3-compatible command set, including strict warning checks and native compiler setup

Important toolchain note: on MoonBit 0.10.3, cmd/main/moon.pkg must use options("is-main": true). The newer pkgtype(kind: "executable") syntax is introduced in 0.10.4 and is intentionally not used here.

On MoonBit 0.10.3, moon fmt --deny-warn and moon info --deny-warn are not accepted commands. This repo therefore uses the community-compatible validation pattern:

  • moon fmt + git diff --exit-code
  • moon info + git diff --exit-code

#Competition Materials

#License

Apache-2.0. See LICENSE and NOTICE for the license and attribution boundary.

#
BaselineComparison

pub(all) struct BaselineComparison {
baseline_count : Int
current_count : Int
new_findings : Array[BaselineFinding]
resolved_findings : Array[BaselineFinding]
unchanged_findings : Array[BaselineFinding]
severity_regressions : Array[BaselineFinding]
passed : Bool
} derive(Eq, ToJson,
Debug
)

#
BaselineFinding

pub(all) struct BaselineFinding {
fingerprint : String
rule : String
severity : String
source : String
sink : String
path : String
} derive(Eq, ToJson,
Debug
)

#
BatchInput

pub(all) struct BatchInput {
source : String
text : String
} derive(Eq, ToJson,
Debug
)

#
BatchItem

pub(all) struct BatchItem {
source : String
parsed : Bool
finding_count : Int
risk_score : Int
risk_band : String
error : String
} derive(Eq, ToJson,
Debug
)

#
BatchReport

pub(all) struct BatchReport {
items : Array[BatchItem]
summary : BatchSummary
} derive(Eq, ToJson,
Debug
)

#
BatchSummary

pub(all) struct BatchSummary {
total_models : Int
parsed_models : Int
failed_models : Int
finding_count : Int
high_finding_count : Int
medium_finding_count : Int
low_finding_count : Int
average_risk_score : Int
maximum_risk_score : Int
} derive(Eq, ToJson,
Debug
)

#
ContractCheck

pub(all) struct ContractCheck {
kind : ContractCheckKind
name : String
passed : Bool
observed : String
expected : String
detail : String
} derive(Eq, ToJson,
Debug
)

#
ContractCheckKind

pub(all) enum ContractCheckKind {
RequiredNode
MinimumGraphSize
RequiredPolicy
RequiredControlPoint
Reachability
SeverityContract
} derive(Eq, ToJson,
Debug
)

#
ContractReport

pub(all) struct ContractReport {
contract : String
passed : Bool
checks : Array[ContractCheck]
passed_count : Int
failed_count : Int
} derive(Eq, ToJson,
Debug
)

#
Edge

pub(all) struct Edge {
from : String
to : String
label : String
} derive(Eq, ToJson,
Debug
)

#
ExplanationKind

pub(all) enum ExplanationKind {
ForbiddenRoute
MissingSanitizer
ReviewedException
UnknownRule
} derive(Eq, ToJson,
Debug
)

#
Finding

pub(all) struct Finding {
severity : String
rule : String
source : String
sink : String
path : Array[String]
message : String
suggestion : String
} derive(Eq, ToJson,
Debug
)

#
FindingExplanation

pub(all) struct FindingExplanation {
kind : ExplanationKind
title : String
summary : String
affected_path : String
risk : String
actions : Array[RemediationAction]
} derive(Eq, ToJson,
Debug
)

#
GraphEdgeRecord

pub(all) struct GraphEdgeRecord {
from : String
to : String
label : String
boundary_crossing : Bool
} derive(Eq, ToJson,
Debug
)

#
GraphExport

pub(all) struct GraphExport {
format : String
nodes : Array[GraphNodeRecord]
edges : Array[GraphEdgeRecord]
digest : String
} derive(Eq, ToJson,
Debug
)

#
GraphExportFormat

pub(all) enum GraphExportFormat {
GraphJson
GraphDot
GraphText
} derive(Eq, ToJson,
Debug
)

#
GraphMetrics

pub(all) struct GraphMetrics {
node_count : Int
edge_count : Int
source_count : Int
sink_count : Int
sanitizer_count : Int
boundary_count : Int
policy_count : Int
reachable_source_count : Int
reachable_sink_count : Int
max_out_degree : Int
max_in_degree : Int
connected_component_count : Int
cycle_hint_count : Int
} derive(Eq, ToJson,
Debug
)

#
GraphNodeRecord

pub(all) struct GraphNodeRecord {
id : String
kind : String
description : String
incoming : Int
outgoing : Int
source_reachable : Bool
sink_reachable : Bool
} derive(Eq, ToJson,
Debug
)

#
Model

pub(all) struct Model {
nodes : Array[Node]
edges : Array[Edge]
policies : Array[Policy]
} derive(Eq, ToJson,
Debug
)

#
ModelAssessment

pub(all) struct ModelAssessment {
metrics : GraphMetrics
coverage : PolicyCoverage
issues : Array[ModelIssue]
risk_score : Int
risk_band : RiskBand
recommendation_count : Int
} derive(Eq, ToJson,
Debug
)

#
ModelContract

pub(all) struct ModelContract {
name : String
required_node_kinds : Array[String]
minimum_nodes : Int
minimum_edges : Int
required_policy_kinds : Array[String]
required_control_points : Array[String]
minimum_severity : String
} derive(Eq, ToJson,
Debug
)

#
ModelIssue

pub(all) struct ModelIssue {
kind : ModelIssueKind
subject : String
detail : String
severity : String
recommendation : String
} derive(Eq, ToJson,
Debug
)

#
ModelIssueKind

pub(all) enum ModelIssueKind {
EmptyModel
OrphanNode
MissingSource
MissingSink
BrokenEdge
UnreachableSink
UnusedPolicy
InvalidSeverity
DuplicatePolicy
} derive(Eq, ToJson,
Debug
)

#
Node

pub(all) struct Node {
name : String
kind : NodeKind
description : String
} derive(Eq, ToJson,
Debug
)

#
NodeImpact

pub(all) struct NodeImpact {
node : String
kind : String
paths_from_sources : Int
paths_to_sinks : Int
policy_count : Int
is_control_point : Bool
impact_score : Int
} derive(Eq, ToJson,
Debug
)

#
NodeKind

pub(all) enum NodeKind {
Source
Sink
Sanitizer
Boundary
Normal
} derive(Eq, ToJson,
Debug
)

#
PathQuery

pub(all) struct PathQuery {
source : String
sink : String
include_allowed : Bool
maximum_paths : Int
} derive(Eq, ToJson,
Debug
)

#
PathSummary

pub(all) struct PathSummary {
source : String
sink : String
path_count : Int
allowed_count : Int
unsafe_count : Int
shortest_length : Int
longest_length : Int
paths : Array[Array[String]]
} derive(Eq, ToJson,
Debug
)

#
Policy

pub(all) struct Policy {
kind : RuleKind
path : Array[String]
through : String
severity : String
description : String
} derive(Eq, ToJson,
Debug
)

#
PolicyAudit

pub(all) struct PolicyAudit {
items : Array[PolicyAuditItem]
total : Int
executable : Int
unreachable_count : Int
duplicates : Int
high_risk : Int
coverage_percent : Int
} derive(Eq, ToJson,
Debug
)

#
PolicyAuditItem

pub(all) struct PolicyAuditItem {
index : Int
kind : String
endpoint : String
severity : String
reachable : Bool
executable : Bool
duplicate : Bool
advice : String
} derive(Eq, ToJson,
Debug
)

#
PolicyCoverage

pub(all) struct PolicyCoverage {
allow_count : Int
deny_count : Int
require_count : Int
covered_policy_count : Int
reachable_policy_count : Int
high_severity_count : Int
medium_severity_count : Int
low_severity_count : Int
coverage_percent : Int
} derive(Eq, ToJson,
Debug
)

#
Position

pub(all) struct Position {
line : Int
column : Int
} derive(Eq, ToJson,
Debug
)

#
QualityGateOptions

pub(all) struct QualityGateOptions {
minimum_coverage_percent : Int
maximum_risk_score : Int
reject_unreachable_policies : Bool
reject_invalid_severity : Bool
require_source_and_sink : Bool
} derive(Eq, ToJson,
Debug
)

#
QualityGateResult

pub(all) struct QualityGateResult {
passed : Bool
reasons : Array[String]
assessment : ModelAssessment
policy_audit : PolicyAudit
finding_count : Int
high_finding_count : Int
checked_source_sink_pairs : Int
} derive(Eq, ToJson,
Debug
)

#
RemediationAction

pub(all) struct RemediationAction {
title : String
command : String
rationale : String
priority : String
} derive(Eq, ToJson,
Debug
)

#
RiskBand

pub(all) enum RiskBand {
Low
Guarded
High
Critical
} derive(Eq, ToJson,
Debug
)

#
RuleKind

pub(all) enum RuleKind {
Allow
Deny
Require
} derive(Eq, ToJson,
Debug
)

#
SarifArtifactLocation

pub(all) struct SarifArtifactLocation {
uri : String
} derive(Eq, ToJson,
Debug
)

#
SarifDriver

pub(all) struct SarifDriver {
name : String
version : String
information_uri : String
rules : Array[SarifRule]
} derive(Eq, ToJson,
Debug
)

#
SarifLocation

pub(all) struct SarifLocation {
artifact_location : SarifArtifactLocation
logical_regions : Array[SarifRegion]
} derive(Eq, ToJson,
Debug
)

#
SarifMessage

pub(all) struct SarifMessage {
text : String
} derive(Eq, ToJson,
Debug
)

#
SarifOptions

pub(all) struct SarifOptions {
tool_name : String
tool_version : String
repository_uri : String
include_help : Bool
} derive(Eq, ToJson,
Debug
)

#
SarifRegion

pub(all) struct SarifRegion {
start_line : Int
start_column : Int
} derive(Eq, ToJson,
Debug
)

#
SarifReport

pub(all) struct SarifReport {
version : String
schema : String
runs : Array[SarifRun]
} derive(Eq, ToJson,
Debug
)

#
SarifResult

pub(all) struct SarifResult {
rule_id : String
level : String
message : SarifMessage
locations : Array[SarifLocation]
fingerprints : Map[String, String]
} derive(Eq, ToJson,
Debug
)

#
SarifRule

pub(all) struct SarifRule {
id : String
name : String
short_description : String
help_uri : String
} derive(Eq, ToJson,
Debug
)

#
SarifRun

pub(all) struct SarifRun {
tool : SarifToolWrapper
results : Array[SarifResult]
} derive(Eq, ToJson,
Debug
)

#
SarifTool

pub(all) struct SarifTool {
name : String
version : String
information_uri : String
} derive(Eq, ToJson,
Debug
)

#
SarifToolWrapper

pub(all) struct SarifToolWrapper {
driver : SarifDriver
} derive(Eq, ToJson,
Debug
)

#
TrustFlowError

pub(all) enum TrustFlowError {
UnknownDirective(Position, String)
MissingNodeName(Position)
DuplicateNode(Position, String)
MissingArrow(Position)
MissingPathNode(Position)
MissingThrough(Position)
UnterminatedQuote(Position)
} derive(Eq, ToJson,
Debug
)

#
WorkflowRun

pub(all) struct WorkflowRun {
source : String
model : Model
findings : Array[Finding]
assessment : ModelAssessment
policy_audit : PolicyAudit
quality_gate : QualityGateResult
sarif : String
} derive(Eq, ToJson,
Debug
)

#
analyze

fn analyze(model : Model) -> Array[Finding]

#
analyze_batch

fn analyze_batch(inputs : Array[BatchInput]) -> BatchReport

#
analyze_text

fn analyze_text(input : String) -> Result[Array[Finding], TrustFlowError]

#
assess_model

fn assess_model(model : Model) -> ModelAssessment

#
assessment_json

fn assessment_json(assessment : ModelAssessment) -> String

#
audit_policies

fn audit_policies(model : Model) -> PolicyAudit

#
baseline_comparison_json

fn baseline_comparison_json(comparison : BaselineComparison) -> String

#
baseline_count_by_severity

fn baseline_count_by_severity(baseline : Array[BaselineFinding], severity : String) -> Int

#
baseline_fingerprint

fn baseline_fingerprint(finding : Finding) -> String

#
baseline_is_empty

fn baseline_is_empty(baseline : Array[BaselineFinding]) -> Bool

#
batch_has_failures

fn batch_has_failures(report : BatchReport) -> Bool

#
batch_is_clean

fn batch_is_clean(report : BatchReport) -> Bool

#
batch_item_for

fn batch_item_for(report : BatchReport, source : String) -> BatchItem?

#
batch_report_json

fn batch_report_json(report : BatchReport) -> String

#
batch_sources

fn batch_sources(report : BatchReport) -> Array[String]

#
build_baseline

fn build_baseline(findings : Array[Finding]) -> Array[BaselineFinding]

#
compare_baseline

fn compare_baseline(baseline : Array[BaselineFinding], current : Array[Finding]) -> BaselineComparison

#
contract_is_release_ready

fn contract_is_release_ready(report : ContractReport) -> Bool

#
contract_report_json

fn contract_report_json(report : ContractReport) -> String

#
count_explanations_by_priority

fn count_explanations_by_priority(explanations : Array[FindingExplanation], priority : String) -> Int

#
default_model_contract

fn default_model_contract() -> ModelContract

#
default_path_query

fn default_path_query(source : String, sink : String) -> PathQuery

#
default_quality_gate_options

fn default_quality_gate_options() -> QualityGateOptions

#
default_sarif_options

fn default_sarif_options() -> SarifOptions

#
empty_model

fn empty_model() -> Model

#
evaluate_contract

fn evaluate_contract(model : Model, contract : ModelContract) -> ContractReport

#
explain_finding

fn explain_finding(finding : Finding) -> FindingExplanation

#
explain_findings

fn explain_findings(findings : Array[Finding]) -> Array[FindingExplanation]

#
explanation_has_action

fn explanation_has_action(explanation : FindingExplanation, title : String) -> Bool

#
explanation_kind_name

fn explanation_kind_name(kind : ExplanationKind) -> String

#
explanation_priority

fn explanation_priority(explanation : FindingExplanation) -> String

#
explanation_summary_line

fn explanation_summary_line(explanations : Array[FindingExplanation]) -> String

#
explanations_json

fn explanations_json(findings : Array[Finding]) -> String

#
export_graph

fn export_graph(model : Model, format : GraphExportFormat) -> String

#
export_graph_dot

fn export_graph_dot(model : Model) -> String

#
export_graph_json

fn export_graph_json(model : Model) -> String

#
export_graph_text

fn export_graph_text(model : Model) -> String

#
find_nodes_by_text

fn find_nodes_by_text(model : Model, query : String) -> Array[Node]

#
format_assessment

fn format_assessment(assessment : ModelAssessment) -> String

#
format_baseline_comparison

fn format_baseline_comparison(comparison : BaselineComparison) -> String

#
format_batch_report

fn format_batch_report(report : BatchReport) -> String

#
format_contract_report

fn format_contract_report(report : ContractReport) -> String

#
format_error

fn format_error(err : TrustFlowError) -> String

#
format_explanation

fn format_explanation(explanation : FindingExplanation) -> String

#
format_explanations

fn format_explanations(findings : Array[Finding]) -> String

#
format_finding

fn format_finding(finding : Finding) -> String

#
format_path_summary

fn format_path_summary(summary : PathSummary) -> String

#
format_policy_audit

fn format_policy_audit(audit : PolicyAudit) -> String

#
format_quality_gate

fn format_quality_gate(result : QualityGateResult) -> String

#
format_report

fn format_report(findings : Array[Finding]) -> String

#
format_report_json

fn format_report_json(findings : Array[Finding]) -> String

#
format_sarif

fn format_sarif(findings : Array[Finding]) -> String

#
format_sarif_with_options

fn format_sarif_with_options(findings : Array[Finding], options : SarifOptions) -> String

#
graph_boundary_edges

fn graph_boundary_edges(model : Model) -> Array[Edge]

#
graph_critical_nodes

fn graph_critical_nodes(model : Model) -> Array[String]

#
graph_digest

fn graph_digest(model : Model) -> String

#
graph_export

fn graph_export(model : Model, format : String) -> GraphExport

#
graph_node_names_by_kind

fn graph_node_names_by_kind(model : Model, kind : NodeKind) -> Array[String]

#
issue_kind_name

fn issue_kind_name(kind : ModelIssueKind) -> String

#
measure_model

fn measure_model(model : Model) -> GraphMetrics

#
merge_batch_reports

fn merge_batch_reports(left : BatchReport, right : BatchReport) -> BatchReport

#
node_kind_name

fn node_kind_name(kind : NodeKind) -> String

#
nodes_for_policy

fn nodes_for_policy(model : Model, policy_index : Int) -> Array[String]

#
normalize_severity

fn normalize_severity(severity : String) -> String

#
parse_model

fn parse_model(input : String) -> Result[Model, TrustFlowError]

#
policy_audit_json

fn policy_audit_json(audit : PolicyAudit) -> String

#
policy_endpoint

fn policy_endpoint(policy : Policy) -> String

#
policy_endpoint_reachable

fn policy_endpoint_reachable(model : Model, policy : Policy) -> Bool

#
policy_is_executable

fn policy_is_executable(model : Model, policy : Policy) -> Bool

#
query_paths

fn query_paths(model : Model, query : PathQuery) -> PathSummary

#
query_paths_json

fn query_paths_json(summary : PathSummary) -> String

#
query_policy_impact

fn query_policy_impact(model : Model, node_name : String) -> Array[Policy]

#
query_reachable_nodes

fn query_reachable_nodes(model : Model, start : String) -> Array[String]

#
query_source_sink_pairs

fn query_source_sink_pairs(model : Model) -> Array[(String, String)]

#
rank_node_impact

fn rank_node_impact(model : Model) -> Array[NodeImpact]

#
risk_band_name

fn risk_band_name(band : RiskBand) -> String

#
rule_kind_name

fn rule_kind_name(kind : RuleKind) -> String

#
run_quality_gate

fn run_quality_gate(model : Model) -> QualityGateResult

#
run_quality_gate_with_options

fn run_quality_gate_with_options(model : Model, options : QualityGateOptions) -> QualityGateResult

#
run_workflow

fn run_workflow(source : String, model : Model) -> WorkflowRun

#
run_workflow_text

fn run_workflow_text(source : String, input : String) -> Result[WorkflowRun, TrustFlowError]

#
sample_model_text

fn sample_model_text() -> String

#
workflow_changed_since_baseline

fn workflow_changed_since_baseline(baseline : Array[BaselineFinding], run : WorkflowRun) -> BaselineComparison

#
workflow_is_release_ready

fn workflow_is_release_ready(run : WorkflowRun) -> Bool

#
workflow_json

fn workflow_json(run : WorkflowRun) -> String