metacore Start a pilot

Showcase · Product lifecycle management

Product lifecycle, as one domain.

Products with their specification, their bill of materials and their release to each market. A change to a specification waits for a second person, and a release needs engineering and compliance together.

The domain, as its schema declares it

4 entities and 7 layers, 5 roles and 3 atoms, in one file.

Model

Each entity, split by who changes it.

A layer is a group of fields that change together: it is the unit of a permission, of an approval and of a release. Its scope is the lowest level at which a value may differ.

EntityLayerScopeKindFields
productidentityglobalReleasedname, family, kind
specificationglobalReleased, second personrevision, description, weight_grams, materials, drawing
compliancemarketReleasedstatus, cleared_on, certificate
availabilitymarketDatedstage
bom linemainglobalReleasedpart, quantity, unit
partmainglobalReleasedname, supplier, cost
familymainglobalReleasedlabel

The entities and their layers

A released layer publishes and rolls back. A dated one holds values by period, one stated once never changes, balances add up, and an overlay is written live by another system.

Roles

A role holds what a job needs, and no more.

A role names operations on layers. Where a person works is in the grant: one role serves every scope value, and a grant gives it on one.

RoleReadsChangesDecides, starts and calls
designerproduct, bom line, part, familyproduct.identity, product.specification, bom_line.main, family.mainStarts release.
engineerproduct, bom line, partNothingApproves product.specification and bom_line.main. Rolls back product.specification. Decides the stage sign_off of release.
complianceproductproduct.complianceDecides the stage sign_off of release.
costingpart, bom linepart.mainNothing
plannerproductproduct.availabilityNothing

Who does what

The engine checks each operation for every caller: a person, a system or an AI agent.

Flow

People decide, and your code acts.

The schema holds no formula and no condition. Whatever computes is an atom: your code, which the engine calls outside itself or in a sandbox.

AtomKindWhat it does
bom_checkGate ruleJudges each change of bom_line.main before it is live: pass, reject, or hold for a person.
releaseHandlerChanges product.availability. Emits product_released.
import_partsSourceBrings part.main in from another system, a batch at a time.

What computes

An atom returns its effects as data, and the engine checks each one.

  1. DesignedA designer changes the specification
  2. ReviewedAn engineer who did not write it approves
  3. Signed offEngineering and compliance decide together
  4. On saleA handler states the stage of each market, from a day

A release, step by step

Each step is a run with its own audit entry.

Connections

What comes in, and what goes out.

A third party reaches the domain through a webhook, and a handler reaches a third party through the engine. A schema holds no address and no secret: an admin binds each one in each environment.

NameKindHow
nightly_partsTriggerOn a schedule, 0 3 * * * in UTC: it starts import_parts.
product_releasedEventA handler emits it for a product. Other domains and the event stream follow it.

The connections of the domain

Every system meets the engine at one public API.

Boundaries

What the engine gives, and what you build.

metacore is not a product of this kind. It is the engine under one that you build: the guarantees come with it, and the rest is yours.

From the engineWhat you get
A public APITyped from the schema, for every entity. There is no private interface.
A back officeEvery record at every level, from the schema, with no code.
Access controlA role holds an operation, on a layer, at a scope value.
Approvals and releasesA change waits where a person must approve it, publishes in one step, and rolls back in one step.
An audit trailAn entry is written in the same step as the operation it records.
Search, events and MCPBuilt in, from the same schema.

With no code

The same for every domain.

Yours to buildHow it meets the engine
The schemaThis file. It is the whole model, and it changes only by deployment.
The atoms3 in this domain, in your repository and in your language.
Design toolsCAD and 3D stay where they are. A drawing enters the domain as a file.
The screens of your teamsAn app of yours on the public API, where the back office is not enough.
The ERPIt follows the event of a release, and feeds the parts every night.

In your code

A product of this kind brings its own screens. Here they are yours.

Schema

The whole domain, in one file.

Every table of this page is read from this file. The check of the CLI finds no problem in it.

plm.txtpb
# proto-file: metacore/api/v1/schema.proto
# proto-message: metacore.api.v1.Schema

# The lifecycle of a product, from its design to the day it leaves the range.
# A message of metacore.api.v1.Schema, in the text format of Protocol Buffers.
#
# A product is one record, by its code:
#
#   identity       global  what the product is
#   specification  global  how it is made: a change waits for a second person
#   compliance     market  what each market asks of it
#   availability   market  when it is on sale there, by period
#
# A line of the bill of materials is a record of its own, by product and
# position, and a part is one by its number. Only the role costing reads what
# a part costs.
#
# A release goes through a workflow: engineering and compliance both sign it
# off, and then a handler puts the product on sale. A gate rule judges each
# change of the bill of materials, and a source brings the parts in from the
# ERP every night.
#
# The org declares the scope market under global before the first deployment.

entities {
  name: "product"
  key { name: "code" type: FIELD_TYPE_TEXT }
  layers {
    name: "identity"
    scope: "global"
    fields { name: "name" type: FIELD_TYPE_TEXT required: true min_length: 2 max_length: 120 exposed: true }
    fields { name: "family" type: FIELD_TYPE_REFERENCE reference { entity: "family" } }
    fields { name: "kind" type: FIELD_TYPE_TEXT allowed_values: "new" allowed_values: "revision" allowed_values: "carry_over" }
  }
  layers {
    name: "specification"
    scope: "global"
    second_person: true
    hold_timeout { seconds: 432000 }
    fields { name: "revision" type: FIELD_TYPE_TEXT pattern: "[A-Z][0-9]{2}" }
    fields { name: "description" type: FIELD_TYPE_TEXT }
    fields { name: "weight_grams" type: FIELD_TYPE_INTEGER least { integer: 0 } }
    fields { name: "materials" type: FIELD_TYPE_TEXT list: true max_length: 60 }
    fields {
      name: "drawing"
      type: FIELD_TYPE_FILE
      file { media_types: FILE_MEDIA_TYPE_PDF max_bytes: 52428800 }
    }
  }
  layers {
    name: "compliance"
    scope: "market"
    fields { name: "status" type: FIELD_TYPE_TEXT allowed_values: "pending" allowed_values: "cleared" allowed_values: "blocked" }
    fields { name: "cleared_on" type: FIELD_TYPE_DATE }
    fields {
      name: "certificate"
      type: FIELD_TYPE_FILE
      file { media_types: FILE_MEDIA_TYPE_PDF max_bytes: 20971520 }
    }
  }
  # A stage holds over a period that its change names: on sale from a day,
  # last orders for the quarter after it.
  layers {
    name: "availability"
    scope: "market"
    dated: true
    fields { name: "stage" type: FIELD_TYPE_TEXT allowed_values: "on_sale" allowed_values: "last_orders" allowed_values: "withdrawn" exposed: true }
  }
}

entities {
  name: "bom_line"
  key { name: "product" type: FIELD_TYPE_TEXT }
  key { name: "position" type: FIELD_TYPE_INTEGER }
  layers {
    name: "main"
    scope: "global"
    fields { name: "part" type: FIELD_TYPE_REFERENCE required: true reference { entity: "part" carries: "name" } }
    fields { name: "quantity" type: FIELD_TYPE_DECIMAL decimal_places: 3 least { decimal: "0" } }
    fields { name: "unit" type: FIELD_TYPE_TEXT allowed_values: "piece" allowed_values: "metre" allowed_values: "gram" }
  }
}

entities {
  name: "part"
  key { name: "number" type: FIELD_TYPE_TEXT }
  layers {
    name: "main"
    scope: "global"
    fields { name: "name" type: FIELD_TYPE_TEXT required: true }
    fields { name: "supplier" type: FIELD_TYPE_TEXT }
    fields {
      name: "cost"
      type: FIELD_TYPE_DECIMAL
      decimal_places: 4
      least { decimal: "0" }
      restricted { read_roles: "costing" write_roles: "costing" }
    }
  }
}

entities {
  name: "family"
  key { name: "code" type: FIELD_TYPE_TEXT }
  layers {
    name: "main"
    scope: "global"
    fields { name: "label" type: FIELD_TYPE_TEXT required: true }
  }
}

roles {
  name: "designer"
  permissions { operation: OPERATION_READ entity: "product" }
  permissions { operation: OPERATION_READ entity: "bom_line" }
  permissions { operation: OPERATION_READ entity: "part" }
  permissions { operation: OPERATION_READ entity: "family" }
  permissions { operation: OPERATION_CHANGE entity: "product" layer: "identity" }
  permissions { operation: OPERATION_CHANGE entity: "product" layer: "specification" }
  permissions { operation: OPERATION_CHANGE entity: "bom_line" layer: "main" }
  permissions { operation: OPERATION_CHANGE entity: "family" layer: "main" }
  permissions { operation: OPERATION_START workflow: "release" }
}

roles {
  name: "engineer"
  permissions { operation: OPERATION_READ entity: "product" }
  permissions { operation: OPERATION_READ entity: "bom_line" }
  permissions { operation: OPERATION_READ entity: "part" }
  permissions { operation: OPERATION_DECIDE entity: "product" layer: "specification" }
  permissions { operation: OPERATION_GO_BACK entity: "product" layer: "specification" }
  permissions { operation: OPERATION_DECIDE entity: "bom_line" layer: "main" }
}

roles {
  name: "compliance"
  permissions { operation: OPERATION_READ entity: "product" }
  permissions { operation: OPERATION_CHANGE entity: "product" layer: "compliance" }
}

roles {
  name: "costing"
  permissions { operation: OPERATION_READ entity: "part" }
  permissions { operation: OPERATION_READ entity: "bom_line" }
  permissions { operation: OPERATION_CHANGE entity: "part" layer: "main" }
}

roles {
  name: "planner"
  permissions { operation: OPERATION_READ entity: "product" }
  permissions { operation: OPERATION_CHANGE entity: "product" layer: "availability" }
}

atoms {
  name: "bom_check"
  connection: "engineering"
  timeout { seconds: 10 }
  gate_rule { layer { entity: "bom_line" layer: "main" } }
}

atoms {
  name: "release"
  connection: "engineering"
  timeout { seconds: 30 }
  handler {
    inputs { name: "code" type: FIELD_TYPE_TEXT required: true }
    outcomes: "released"
    outcomes: "blocked"
    changes { entity: "product" layer: "availability" }
    events: "product_released"
  }
}

atoms {
  name: "import_parts"
  connection: "erp"
  timeout { seconds: 60 }
  source { changes { entity: "part" layer: "main" } }
}

events {
  name: "product_released"
  entity: "product"
  exposed: true
}

triggers {
  name: "nightly_parts"
  schedule { cron: "0 3 * * *" time_zone: "UTC" }
  atom: "import_parts"
}

# Engineering and compliance sign a release off together: one of them can
# send it back, and only both move it on. Then the handler puts the product
# on sale, or blocks it and sends it back to them.
workflows {
  name: "release"
  inputs { name: "code" type: FIELD_TYPE_TEXT required: true }
  first_stage: "sign_off"
  stages {
    name: "sign_off"
    person {
      roles { role: "engineer" }
      roles { role: "compliance" }
      timeout { seconds: 604800 }
      outcomes: "approved"
      outcomes: "sent_back"
      agreed_outcome: "approved"
      second_person: true
    }
    transitions { outcome: "approved" next_stage: "go_live" }
    transitions { outcome: "sent_back" }
  }
  stages {
    name: "go_live"
    handler: "release"
    transitions { outcome: "released" }
    transitions { outcome: "blocked" next_stage: "sign_off" }
  }
}

The schema of the domain

A message of the public contract, in the text format of Protocol Buffers.

See also

Build your domain.

Declare its schema, and take it to production, self-hosted or in a managed region.

Briefing