ZAMG-CCIN
ZAMG–CSI/CMI Integration Spec
1. Purpose
This specification defines how ZAMG resolves, validates, and uses CMI and CSI inside the ZAR framework.
It covers:
- how artifact identity is resolved from
zar.cmi_registry - how signal identity is resolved from
zar.signal_csi_binding - how proposal paths are triggered when canonical matches do not exist
- how these identities are incorporated into compiled manifests
- how approval policy should treat CMI/CSI ambiguity
- how deterministic and AI-assisted resolution should interact
This spec assumes:
- ZAR is the canonical registry backbone
- ZAMG is a compiler over ZAR-backed data
- canonical manifests are stored in
zar.artifact_manifest_registry - approval evidence and review workflow operate through ZAR-backed tables
2. Core principle
CMI and CSI are not generated as free-floating strings inside ZAMG. They are resolved from ZAR-native registry structures wherever possible.
That means:
- CMI authority =
zar.cmi_registry - CSI authority =
zar.signal_csi_binding
If no canonical match exists, ZAMG should produce:
- a proposal path
- a review-required candidate
- or a rejected/quarantined result
It should not silently invent production identities.
3. Canonical identity sources
3.1. CMI source
Primary canonical artifact identity source:
zar.cmi_registry
Key fields:
cmimodule_codecomponent_idcmi_kindartifact_nameversion_majorversion_minorversion_patchversion_textzar_codetitledescriptionsemantic_roleruntime_classartifact_locationimplementation_refowner_teamsource_doc_idsource_filemd_document_linkstatuslifecycle_status
3.2. CSI source
Primary canonical signal identity source:
zar.signal_csi_binding
Key fields:
signal_idcsi_modulecsi_componentcsi_kindcsi_namecsi_version_majcsi_version_mincsistatusversionsort_ordercsi_proposal_id
4. Integration goals
ZAMG must be able to:
For CMI
- identify the correct artifact identity
- distinguish existing canonical artifacts from new candidates
- use the correct versioned artifact identity in the compiled manifest
- avoid accidental duplication or identity drift
For CSI
- resolve input and output signal contracts
- prefer approved/stable CSI bindings
- detect ambiguity when multiple candidate bindings exist
- produce reviewable candidate contracts where exact signal mapping is not yet settled
5. CMI resolution model
5.1. Inputs used for CMI resolution
ZAMG may use:
- source docs/frontmatter
- code paths
- component mappings
- engine/micro-engine registries
- documented component registries
- module registry and aliases
- explicit CMI references if already present
- version metadata
- artifact type and operation context
5.2. CMI resolution order
ZAMG should resolve CMI in this order:
Step 1 — explicit canonical reference
If source metadata already contains a known valid cmi, validate against zar.cmi_registry.
If found and valid:
- use it
- capture resolution mode as registry_lookup
Step 2 — exact identity match
Attempt exact match using:
module_codecomponent_idcmi_kindartifact_nameversion_text
against:
zar.cmi_registry
If unique match found:
- use it
- capture resolution mode as
deterministic + registry_lookup
Step 3 — deterministic candidate derivation
If no exact match:
- derive candidate values from module/component metadata
- normalize artifact name to meet registry format
- derive version from source or default versioning policy
- construct candidate CMI using registry rules
Then:
- validate candidate format
- check for uniqueness collision in
zar.cmi_registry
If unique and allowed:
- route to proposal/review flow
Step 4 — proposal path
If canonical CMI does not exist:
- insert or enrich candidate in
cmi_proposal_results - compile manifest in
review_requiredorquarantined_candidatestate depending on policy
6. CMI status policy
ZAMG must not treat all CMI rows equally.
6.1. Production preference
For production manifest promotion, prefer:
status = activelifecycle_status = active
6.2. Allowed in preview/internal modes
For internal, preview, or staging modes, allow:
- `draft
- active`
if policy permits.
6.3. Auto-promotion restrictions
Do not auto-promote into production if:
status = deprecatedstatus = retiredlifecycle_status = deprecatedlifecycle_status = retired
These should trigger review or rejection depending on context.
7. CMI fields projected into the canonical manifest
The compiled manifest should not duplicate all CMI columns, but it should project the most important ones.
Required projection fields
artifact.cmiartifact.zar_codeartifact.readable_namefrom title/source normalizationartifact.artifact_typeartifact.owner_teamartifact.status
Recommended projected metadata
artifact.source_refsartifact.lineage.parent_artifact_cmi- selected semantic/runtime metadata where useful
Internal resolution metadata
Even if not exposed in the visible manifest shape, ZAMG should preserve internally:
component_idmodule_codecmi_kindversion_textcmi_registry_idif you choose to expose or track it internally later
8. CSI resolution model
8.1. Core principle
CSI should be resolved signal-first, not prose-first.
That means ZAMG should try to identify the underlying signal or signal binding source before deciding the final CSI set.
8.2. Inputs used for CSI resolution
ZAMG may use:
- explicit
signal_id - known signal registry references
- engine/signal bindings
- component/signal bindings
- input/output schema field mappings
- existing documented signal mappings
- route payload models
- approved prior manifests for the same artifact family
- AI suggestions where signal meaning is ambiguous
8.3. CSI resolution order
Step 1 — explicit signal_id
If source metadata or binding data identifies signal_id:
- join to
zar.signal_csi_binding - retrieve candidate CSI rows
Step 2 — binding-assisted signal discovery
If no direct signal_id:
- resolve through:
signal_engine_bindingsignal_component_bindingsignal_binding_registry- related documented component structures
- then join to
signal_csi_binding
Step 3 — schema-to-signal mapping
If still unresolved:
- attempt deterministic mapping from schema fields or known signal naming patterns
- identify likely
signal_id - then join to
signal_csi_binding
Step 4 — AI-assisted signal interpretation
Only if deterministic resolution is insufficient:
- infer likely signal intent
- propose likely
signal_idor CSI candidates - mark as AI-suggested
- require review for critical fields
Step 5 — proposal path
If no acceptable CSI exists:
- create or enrich proposal through CSI/signal proposal workflow
- keep manifest in
review_requiredorquarantined_candidatestate depending on risk
9. CSI candidate prioritization
When multiple CSI rows are available for a given signal, ZAMG should use a deterministic ranking policy.
Recommended status priority
For production use:
- stable
- experimental
- draft
- legacy
- deprecated
- retired
Additional tie-breakers
If multiple rows share acceptable status, rank by:
- exact component/module fit
- exact kind fit
- exact name fit
- preferred version
- lowest sort_order
- latest updated/approved path if you later track that formally
Production auto-approval policy
For production manifests:
- prefer stable
- allow experimental only if explicitly policy-approved
- do not auto-approve draft, deprecated, or retired
10. CSI fields projected into the canonical manifest
The manifest should primarily emit the assembled CSI strings, because they are the contract-level identifiers.
Required operation-level fields
operations[*].input.csioperations[*].output.csi
Recommended internal preservation
ZAMG should keep internally:
signal_idcsi_modulecsi_componentcsi_kindcsi_namecsi_version_majcsi_version_minstatus
This is important because:
- deterministic review is easier with decomposed parts
- later remapping/version transitions become easier
- approval evidence becomes more precise
11. Manifest generation behavior for CMI/CSI states
11.1. Canonical happy path
When:
- CMI resolves uniquely to active canonical row
- CSI resolves uniquely to acceptable canonical bindings
- no ambiguity exists
Then:
- compile candidate manifest
- apply deterministic defaults
- proceed to approval logic normally
11.2. Mixed certainty path
When:
- CMI is canonical
- CSI is partially ambiguous or AI-suggested
Then:
- compile manifest
- flag critical unresolved/review-needed fields
- send to review queue
- record field-level resolution provenance
11.3. Proposal path
When:
- CMI is missing or
- critical CSI bindings are missing
Then:
- compile proposal-assisted manifest candidate
- set
approval_statetoreview_requiredorquarantined_candidate - link to proposal/result structures where possible
- prevent canonical production promotion
12. Proposal integration model
ZAMG should use your existing proposal/result tables rather than invent a separate candidate identity system.
CMI-related proposal structures
zar.cmi_proposal_results
CSI-related proposal structures
zar.csi_proposal_results- potentially
signal_proposal_resultsdepending on whether signal identity itself is unresolved
Recommended behavior
- if candidate identity is new, unresolved, or ambiguous, record proposal row
- bind proposal refs into
resolution_metaorchange_control - approval process confirms whether proposal becomes canonical registry entry before production promotion
This aligns ZAMG with the broader ZAR governance model.
13. Resolution metadata requirements for CMI/CSI
Every CMI and CSI field used in a manifest should carry provenance in resolution_meta.
For CMI
At minimum capture:
- resolution mode
- source table
- source key
- confidence
- review status
Example:
resolution_meta:
field_resolution:
artifact.cmi:
resolution_mode: "registry_lookup"
source_ref: "zar.cmi_registry:cmi=MICE.InvoiceEmissions.Engine.1_1_0"
confidence: 1.0
review_status: "not_required"
For CSI
Example:
resolution_meta:
field_resolution:
operations[0].input.csi:
resolution_mode: "registry_lookup"
source_ref: "zar.signal_csi_binding:signal_id=sig_12345"
confidence: 0.98
review_status: "not_required"
If AI-assisted:
resolution_meta:
field_resolution:
operations[0].output.csi:
resolution_mode: "ai_suggested_human_confirmed"
source_ref: "zamg-ai-csi-mapper-v0.1"
confidence: 0.87
review_status: "confirmed"
14. Approval policy implications for CMI/CSI
Because CMI and CSI are critical fields, the approval policy must treat them strictly.
CMI review triggers
Always require review when:
- CMI must be newly allocated
- CMI collides
- artifact type conflicts with resolved CMI
- active CMI is not available for production use
- a different canonical CMI than expected is selected
CSI review triggers
Always require review when:
- CSI is AI-suggested for critical input/output contract
- multiple acceptable CSI candidates exist
- only draft or experimental candidates exist for production
- output CSI is missing
- signal meaning conflicts with candidate CSI family/kind
15. ZAMG query behavior against ZAR
Recommended query pattern for CMI
ZAMG should:
- look up exact rows in cmi_registry
- validate status/lifecycle
- reuse zar_code if present
- never generate a new zar_code silently for production use without review
Recommended query pattern for CSI
ZAMG should:
- resolve through signal relationships first
- join to signal_csi_binding
- apply status priority and tie-break rules
- preserve both assembled csi and decomposed parts internally
16. Recommended future enhancement
Once you are ready, I strongly recommend adding or exposing consistent linkages between:
engine_registrymicro_engine_registrycomponent_registrysignal_engine_bindingsignal_component_bindingdocumented_component_registry
The stronger those deterministic relationships become, the less AI ZAMG will need for CSI/CMI interpretation.
That will improve:
- confidence
- automation rate
- approval throughput
- contract consistency
17. Example integration flows
Example 1 — Existing micro-engine
Input:
- documented micro-engine page
- matching component
- known engine entry
- existing active CMI
- known input/output signals with stable CSI
Result:
- exact CMI resolved
- input/output CSI resolved
- manifest compiled from canonical identities
- likely reviewer-free if other conditions are low-risk
Example 2 — New exporter with partial CSI
Input:
- new exporter docs and route
- no exact CMI row yet
- likely output signal exists but input packaging CSI is ambiguous
Result:
- CMI proposal path triggered
- CSI partially AI-suggested
- review queue entry created
- manifest stored as review-required candidate
- no production promotion until identities are confirmed
18. Final rules
Rule 1
CMI and CSI are resolved from ZAR canonical tables whenever possible.
Rule 2
ZAMG may propose identities, but may not silently promote invented production identities.
Rule 3
CMI and CSI are critical fields and must carry resolution provenance.
Rule 4
Production manifests require stricter status filtering than internal or preview manifests.
Rule 5
Proposal tables should be reused as the staging path for unresolved CMI/CSI.
19. Final conclusion
This integration model makes ZAMG:
- ZAR-native
- deterministic-first
- proposal-aware
- approval-aware
- compatible with future automation