moonmold

Governed spatial modeling and representation validation for Moon Suite.

moonbit
spatial-modeling
lineage
blender
moonsuite
moon add vectie/moonmold@0.1.0
Download zip
Author
Version
0.1.0
License
Apache-2.0
Last updated
14 days ago
Downloads
1

Dependencies

README

#MoonMold

Domain pack · early digital-model alpha. Read the product contract for representation truth, Blender qualification, authority limits and release gates.

MoonMold is a first-class installable MoonSuite domain pack. It transforms governed spatial intent, references, constraints, and procedures into editable digital models and representation-specific validation evidence. It may prepare a manufacturing candidate, but it cannot claim structural safety, physical readiness, or authorize a physical effect.

The public MoonBit package owns backend-neutral spatial artifacts, representation lineage, validation findings, and bounded semantic adapter requests. The first runtime supports an in-process mock backend and an optional Blender adapter; there is deliberately no public script or shell operation.

///|
test "a presentation sibling cannot replace engineering truth" {
let source = @moonmold.new_artifact(
artifact_id="habitat-source",
representation=EditableSource,
digest="mm1-source",
units="m",
coordinate_frame="z-up-right-handed",
parent_digest=None,
relation=None,
known_losses=[],
)
let styled = @moonmold.derive_artifact(
source,
artifact_id="habitat-presentation",
representation=Presentation,
digest="mm1-present",
relation=StyledFrom,
known_losses=["collision fidelity", "engineering materials"],
)
assert_true(styled.parent_digest() == Some(source.digest()))
assert_eq(styled.is_lossless_engineering_representation(), false)
}

See docs/CONSTITUTION.md, docs/ARCHITECTURE.md, and docs/EXPERIMENT_REPORT.md for the product boundary, implementation journey, quality trials, and current limitations.

The executable ownership rules and test seams are documented in docs/RESPONSIBILITY_AND_TESTABILITY.md.

#Qualification

moon check --target all --warn-list +unnecessary_annotation moon test --target all npm test npm run demo npm run demo:transfer

The demos create ignored evidence only under this checkout's evidence/generated directory. The two fixtures use one general procedure but different topology and dimensions.

Start the bounded stdio MCP adapter with npm run mcp. Blender is optional; when unavailable, live-backend requests fail explicitly and only mock-reference receipts may be produced.

The unattended product boundary is owned by moonmold flow-adapter execute and moonmold flow-adapter attest. Execution creates real Blender evidence; attestation re-hashes every declared output, preserves concrete unknowns, and publishes an immutable digital-only final artifact. product-registry-entry.json is the canonical MoonDesk registry entry for a suite installation.

#First-class pack adapter and operator

MoonMold now publishes the exact three manifest tools through a pack-local MoonBit moonflow.adapter.v2 implementation with durable attempts, journal replay, reconciliation, short-lived health evidence and SHA-256 binding. See docs/PACK_ADAPTER.md.

The Rabbita operator at ui/rabbita-moonmold creates and loads governed requests, shows backend qualification and representation lineage, runs the bounded adapter, and records a named-human review without adding another agent runtime. See docs/OPERATOR_APP.md.

#
AdapterError

pub(all) suberror AdapterError {
InvalidIdentity(String)
InvalidDeadline(Int)
AuthorityExceeded(AuthorityClass)
WorkspaceBoundaryViolation(String)
StaleParent(expected~ : String, actual~ : String)
ConflictingIdempotencyKey(String)
UnsupportedTransportMethod(String)
InvalidOperation(String)
} derive(Eq,
Debug
)

#
AdapterOutcome

pub(all) enum AdapterOutcome {
Applied
IdempotentNoOp
Rejected
} derive(Eq, ToJson,
Debug
)

#
AdapterReceipt

pub(all) struct AdapterReceipt {
request_id : String
idempotency_key : String
outcome : AdapterOutcome
before_digest : String
after_digest : String
changed_objects : Array[String]
warnings : Array[String]
evidence : ValidationEvidence
} derive(Eq, ToJson,
Debug
)

#
AdapterRequest

pub(all) struct AdapterRequest {
project_id : String
session_id : String
model_id : String
request_id : String
idempotency_key : String
expected_parent_digest : String
workspace_root : String
deadline_ms : Int
authority : AuthorityClass
operation : SemanticOperation
}

#
AppliedRequest

type AppliedRequest

#
AuthorityClass

pub(all) enum AuthorityClass {
Observe
CognitiveMaintenance
SandboxExecution
WorkspaceMutation
ExternalEffect
PhysicalEffect
} derive(Eq, ToJson,
Debug
)

MoonMold's initial authority ceiling is digital and workspace-local.

#
FindingSeverity

pub(all) enum FindingSeverity {
Info
Warning
Error
} derive(Eq, ToJson,
Debug
)

A finding is machine-readable while keeping a useful human explanation.

#
LineageRelation

pub(all) enum LineageRelation {
InterpretedFrom
ModeledFrom
DimensionedBy
StyledFrom
OptimizedFrom
CollisionDerivedFrom
PhysicsDerivedFrom
ManufacturingDerivedFrom
ValidatedBy
RejectedBy
SupersededBy
PlacedAs
SimulatedAs
} derive(Eq, ToJson,
Debug
)

Portable lineage relations used by MoonBook, MoonTown, MoonRobo, and MoonMoon. Consumers may preserve additional domain-specific relations.

#
MockBackend

pub struct MockBackend {
scene_digest : String
applied : Array[AppliedRequest]
}

#
MockBackend::execute

fn MockBackend::execute(self : MockBackend, request : AdapterRequest) -> AdapterReceipt raise AdapterError

#
MockBackend::new

fn MockBackend::new(initial_digest? : String) -> MockBackend

#
MockBackend::scene_digest

fn MockBackend::scene_digest(self : MockBackend) -> String

#
RepresentationKind

pub(all) enum RepresentationKind {
ReferenceSet
SpatialIntent
EditableSource
Engineering
Presentation
Simulation
ManufacturingCandidate
} derive(Eq, ToJson,
Debug
)

A representation is a declared view of spatial truth, never an implicit upgrade in authority.

#
RequestResponsibility

pub(all) struct RequestResponsibility {
owner_product : String
disposition : String
claim_ceiling : String
reasons : Array[String]
} derive(Eq, ToJson,
Debug
)

The responsibility result is computed before backend execution. It makes ownership and claim ceilings inspectable without starting Blender or any other adapter process.

#
SemanticOperation

pub(all) enum SemanticOperation {
CreateModel(name~ : String, units~ : String, coordinate_frame~ : String)
CreateBox(object_id~ : String, width_mm~ : Int, depth_mm~ : Int, height_mm~ : Int)
CreateCylinder(object_id~ : String, radius_mm~ : Int, height_mm~ : Int, sides~ : Int)
SetTransform(object_id~ : String, x_mm~ : Int, y_mm~ : Int, z_mm~ : Int)
AssignMaterial(object_id~ : String, material_id~ : String)
BooleanSubtract(target_id~ : String, cutter_id~ : String)
ValidateScene
ExportRepresentation(representation~ : RepresentationKind, output_path~ : String)
} derive(Eq, ToJson,
Debug
)

Semantic operations are the complete public modeling surface. There is no ExecuteScript, Python, shell, eval, or arbitrary-code constructor.

#
SpatialArtifact

pub struct SpatialArtifact {
artifact_id : String
representation : RepresentationKind
digest : String
units : String
coordinate_frame : String
parent_digest : String?
relation : LineageRelation?
known_losses : Array[String]
}

Artifact fields are intentionally close to MoonLib's portable contract: identity, representation class, parent lineage, declared losses, units, coordinate frame, digest, and validation stay explicit.

#
SpatialArtifact::artifact_id

fn SpatialArtifact::artifact_id(self : SpatialArtifact) -> String

#
SpatialArtifact::canonical_manifest

fn SpatialArtifact::canonical_manifest(self : SpatialArtifact) -> String

Canonical manifests use fixed field order and preserve declared loss order. The format is stable text so other Moon Suite products can hash or sign it.

#
SpatialArtifact::coordinate_frame

fn SpatialArtifact::coordinate_frame(self : SpatialArtifact) -> String

#
SpatialArtifact::digest

fn SpatialArtifact::digest(self : SpatialArtifact) -> String

#
SpatialArtifact::is_lossless_engineering_representation

fn SpatialArtifact::is_lossless_engineering_representation(self : SpatialArtifact) -> Bool

This is a representation-shape predicate, not validation or permission to replace an accepted engineering artifact.

#
SpatialArtifact::known_losses

fn SpatialArtifact::known_losses(self : SpatialArtifact) -> Array[String]

#
SpatialArtifact::manifest_key

fn SpatialArtifact::manifest_key(self : SpatialArtifact) -> String

#
SpatialArtifact::parent_digest

fn SpatialArtifact::parent_digest(self : SpatialArtifact) -> String?

#
SpatialArtifact::relation

#
SpatialArtifact::representation

fn SpatialArtifact::representation(self : SpatialArtifact) -> RepresentationKind

#
SpatialArtifact::units

fn SpatialArtifact::units(self : SpatialArtifact) -> String

#
ValidationEvidence

pub(all) struct ValidationEvidence {
validator : String
validator_version : String
subject_digest : String
accepted : Bool
findings : Array[ValidationFinding]
} derive(Eq, ToJson,
Debug
)

#
ValidationFinding

pub(all) struct ValidationFinding {
code : String
severity : FindingSeverity
message : String
criterion : String
} derive(Eq, ToJson,
Debug
)

#
derive_artifact

fn derive_artifact(parent : SpatialArtifact, artifact_id~ : String, representation~ : RepresentationKind, digest~ : String, relation~ : LineageRelation, known_losses~ : Array[String]) -> SpatialArtifact

#
deterministic_manifest_key

fn deterministic_manifest_key(canonical : String) -> String

A deterministic integrity key. This deliberately calls itself mm1, not SHA-256: it is stable addressing for manifests, not a cryptographic claim.

#
is_moonsuite_workspace_root

fn is_moonsuite_workspace_root(root : String) -> Bool

#
is_scoped_output_path

fn is_scoped_output_path(root : String, path : String) -> Bool

#
new_artifact

fn new_artifact(artifact_id~ : String, representation~ : RepresentationKind, digest~ : String, units~ : String, coordinate_frame~ : String, parent_digest~ : String?, relation~ : LineageRelation?, known_losses~ : Array[String]) -> SpatialArtifact

#
request_responsibility

fn request_responsibility(request : AdapterRequest) -> RequestResponsibility

Classifies the authority boundary without performing IO. MoonMold owns digital model mutation and validation only. External and physical effects remain host-owned even when a manufacturing candidate is being prepared.

#
validate_request

fn validate_request(request : AdapterRequest) -> Unit raise AdapterError

#
validate_transport_method

fn validate_transport_method(method_name : String) -> Unit raise AdapterError