pef-me
Style Examples Used in the Docs
PDF links:
TODOs
Internal Links:
See Data & Compliance Models - 1. Global Disclosure Ontology (GDO).
All Tables (Automatic (recommended for engine specs))
Engine Metadata
No registry entry found for pef-me yet.
Inline Tables (Manual placement (recommended for docs, overviews, comparisons))
Input Table Structure
dim_countriesStable| Signal | Type | Example | Description |
|---|---|---|---|
iso_cc_id | string | iso-028 | Internal surrogate key for ISO country record |
iso_cd_id | string | iso-028 | Internal surrogate key for ISO country record |
Repo Links:
For the exact PEF-ME request format, see .
The Monte Carlo configuration is illustrated in .
Inline badge:
iso_cc_id Experimental
Table Relationships (PEF-ME Neighborhood)
Table Graph Explorer
Loading table relationship graph…
E-C-O™ Numbers
- Client
- Verifier
- Government
- NGO
- Energy Supplier
ECO-196-123-456-789
VER-123-324-622
GOV-033-003-303
NGO-010-422-773
ESU-176-255-564
Output Table Structure
dim_countriesStable| Signal | Type | Example | Description |
|---|---|---|---|
iso_cc_id | string | iso-028 | Internal surrogate key for ISO country record |
iso_cd_id | string | iso-028 | Internal surrogate key for ISO country record |
Link to associates assets (does not work and must be fixed) - Search for DocExamplesMenu.tsx in ChatGPT to find the right spot:
1. Overview
Purpose. Compute product-level PEF metrics with uncertainty bounds and traceable EF references.
Scope. SKU/BOM-level; supports BOM interpolation via BIME; outputs are consumable by EPDEX.
We route hazard intelligence through ZHIF, while product footprints are calculated via PEF-ME.
iso_cc_id Stable
This signal family is still evolving; avoid production dependencies.
Table dependencies are compiled and in sync with graph_lineage.json.
This engine is safe to use with the default profile in SEM.
.zyz-callout--chat
How can I reduce GHG by 20% by 2030?
Some content with Markdown syntax. Check this api.
Some content with Markdown syntax. Check this api.
Some content with Markdown syntax. Check this api.
Some content with Markdown syntax. Check this api.
Some content with Markdown syntax. Check this api.
2. Inputs
nace_code(string) — activity classifier; source:nacetablebom_lines[](array<object>) — material composition & masses; source: BIMEenergy_mix(object) — grid mix or supplier energy; source: countries/energy or ESU feedgeography(string) — ISO3; source: countriesef_refs[](array<string>, optional) — override EF IDs; source: efdb
JSON Schema contract: /schemas/mice_io.schema.json
3. Outputs
pef_score(number, unit: 'mPt') +uncertainty(p05/p50/p95)hotspots[](array<object>) — ranked contributorsprovenance_ref(string) — hash to EF references bundlequality_score(0–1)
4. Algorithms
- Material mapping: BOM → EFDB category
- Energy adjustment: country/plant energy mix application
- Uncertainty: Monte Carlo over EF distributions; Bayesian update if verifier priors exist
- Python
- TypeScript
from zayaz.engines.pef_me import compute_pef
result = compute_pef(bom_lines, nace_code="C.25.11", geography="NOR")
print(result["pef_score"], result["uncertainty"]["p95"])
import { computePEF } from '@zayaz/engines/pef-me';
const out = computePEF({ bomLines, naceCode: 'C.25.11', geography: 'NOR' });
console.log(out.pef_score, out.provenance_ref);
5. Data Dependencies
efdb.json– emission factorsnace.json– NACE classificationcountries.json– country metadataunits.json– canonical unitsmice_io.schema.json– shared MICE IO schema
6. Telemetry
Emitted events:
engine.invoked,engine.ok,engine.validation_failed,engine.timeoutKey metrics:latency_ms,records,p95_uncertainty,quality_score_mean
7. API
POST /api/v1/engines/pef-me:run
Request/response conform to /schemas/mice_io.schema.json.
8. Validation & Tests
- Deterministic fixtures:
/tests/fixtures/pef-me/ - Stochastic CI: 1,000-run MC sanity; assert p50 within tolerance window
9. RBAC & Security
- invoke_roles:
admin,client.pro,verifier - view_roles:
admin,verifier
10. Error Model & Fallbacks
- If EF missing → fallback to parent EF category with penalty factor
- If energy mix unknown → default to country baseline + warning
11. Versioning
- Spec v0.2; API v1
- Breaking changes recorded in
CHANGELOG.md
12. Open Questions
- PCR alignment for sector X
- Treatment of recycled content credit in BOM lines
JSON Schema (Draft 2020-12)
/src/components/policy-generator.json{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://zayaz.eco/schemas/policy-generation.json",
"title": "ZAYAZ Policy Generation Schemas",
"type": "object",
"properties": {
"companyProfile": { "$ref": "#/$defs/CompanyProfile" },
"policyGenerationSpec": { "$ref": "#/$defs/PolicyGenerationSpec" }
},
"required": ["companyProfile", "policyGenerationSpec"],
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://zayaz.eco/schemas/policy-generation.json",
"title": "ZAYAZ Policy Generation Schemas",
"type": "object",
"properties": {
"companyProfile": { "$ref": "#/$defs/CompanyProfile" },
"policyGenerationSpec": { "$ref": "#/$defs/PolicyGenerationSpec" }
},
"required": ["companyProfile", "policyGenerationSpec"],
"$defs": {
"CompanyProfile": {
"title": "CompanyProfile",
"type": "object",
"additionalProperties": false,
"properties": {
"companyId": {
"type": "string",
"description": "Internal unique identifier for the company in ZAYAZ."
},
"legalName": {
"type": "string",
"description": "Official legal name of the company."
},
"brandName": {
"type": "string",
"description": "Common brand or trade name (if different from legalName)."
},
"size": {
"type": "object",
"description": "Size metrics and CSRD-related classification.",
"additionalProperties": false,
"properties": {
"employees": {
"type": "integer",
"minimum": 0
},
"turnoverEUR": {
"type": "number",
"minimum": 0
},
"balanceSheetTotalEUR": {
"type": "number",
"minimum": 0
},
"csrdScope": {
"type": "string",
"description": "Categorisation relative to CSRD thresholds.",
"enum": [
"micro",
"small",
"medium",
"large_undertaking",
"listed_sme",
"consolidated_group",
"non_eu_parent",
"not_in_scope",
"unknown"
]
}
},
"required": ["csrdScope"]
},
"jurisdictions": {
"type": "array",
"description": "List of main jurisdictions where the company operates or is regulated. Typically ISO 3166 country codes or higher-level labels like EU.",
"items": { "type": "string" },
"uniqueItems": true
},
"headquartersCountry": {
"type": "string",
"description": "Primary country of headquarters (ISO 3166-1 alpha-2 or alpha-3)."
},
"naceCodes": {
"type": "array",
"description": "Primary and secondary NACE activity codes.",
"items": {
"type": "string",
"pattern": "^[A-U][0-9]{2}(\\.[0-9]{1,2})?$"
},
"uniqueItems": true
},
"sectors": {
"type": "array",
"description": "Normalised sector tags used by ZAYAZ (ontology can be maintained separately).",
"items": { "type": "string" },
"uniqueItems": true
},
"languages": {
"type": "array",
"description": "Preferred languages for generated content (BCP-47 or ISO 639).",
"items": { "type": "string" },
"uniqueItems": true,
"default": ["en"]
},
"esrsApplicability": {
"type": "object",
"description": "Per-standard qualitative materiality/priority signal (from SIS/materiality engine).",
"additionalProperties": false,
"properties": {
"E1": { "$ref": "#/$defs/MaterialityLevel" },
"E2": { "$ref": "#/$defs/MaterialityLevel" },
"E3": { "$ref": "#/$defs/MaterialityLevel" },
"E4": { "$ref": "#/$defs/MaterialityLevel" },
"E5": { "$ref": "#/$defs/MaterialityLevel" },
"S1": { "$ref": "#/$defs/MaterialityLevel" },
"S2": { "$ref": "#/$defs/MaterialityLevel" },
"S3": { "$ref": "#/$defs/MaterialityLevel" },
"S4": { "$ref": "#/$defs/MaterialityLevel" },
"G1": { "$ref": "#/$defs/MaterialityLevel" }
}
},
"riskSignals": {
"type": "object",
"description": "High-level risk signals that can influence ambition, emphasis and examples.",
"additionalProperties": false,
"properties": {
"climatePhysical": { "$ref": "#/$defs/RiskLevel" },
"climateTransition": { "$ref": "#/$defs/RiskLevel" },
"biodiversity": { "$ref": "#/$defs/RiskLevel" },
"waterStress": { "$ref": "#/$defs/RiskLevel" },
"supplyChainHumanRights": { "$ref": "#/$defs/RiskLevel" },
"dataPrivacySecurity": { "$ref": "#/$defs/RiskLevel" },
"corruptionBribery": { "$ref": "#/$defs/RiskLevel" },
"productSafety": { "$ref": "#/$defs/RiskLevel" }
}
},
"tonePreferences": {
"type": "object",
"description": "Content style and tone preferences to steer policy drafting.",
"additionalProperties": false,
"properties": {
"formality": {
"type": "string",
"enum": ["low", "medium", "high"],
"default": "high"
},
"length": {
"type": "string",
"enum": ["short", "medium", "long"],
"default": "medium"
},
"audience": {
"type": "string",
"enum": ["internal_only", "external_only", "internal_external"],
"default": "internal_external"
},
"readingLevel": {
"type": "string",
"description": "Approximate CEFR-style reading level.",
"enum": ["B1", "B2", "C1", "C2"],
"default": "B2"
}
}
},
"contacts": {
"type": "object",
"description": "Optional key ESG-related roles used for governance sections.",
"additionalProperties": false,
"properties": {
"esgLeadTitle": { "type": "string" },
"boardCommitteeName": { "type": "string" },
"sustainabilityDepartmentName": { "type": "string" }
}
},
"metadata": {
"type": "object",
"description": "Free-form extension for internal use (e.g. tags, clusters, scoring).",
"additionalProperties": true
}
},
"required": ["companyId", "legalName", "size"]
},
"PolicyGenerationSpec": {
"title": "PolicyGenerationSpec",
"type": "object",
"additionalProperties": false,
"properties": {
"requestId": {
"type": "string",
"description": "Idempotency / trace ID for this generation request."
},
"companyId": {
"type": "string",
"description": "Must match CompanyProfile.companyId. Used for logging and storage."
},
"templateId": {
"type": "string",
"description": "The template to base the policy on (e.g. tpl_policy_env_climate_change_v1)."
},
"language": {
"type": "string",
"description": "Language for the generated policy content (BCP-47 or ISO 639).",
"default": "en"
},
"targetAudience": {
"type": "string",
"enum": ["internal_only", "external_only", "internal_external"],
"default": "internal_external"
},
"policyPurpose": {
"type": "string",
"description": "How the policy will be used.",
"enum": [
"core_policy",
"supporting_policy",
"guideline",
"procedure",
"supplier_addendum",
"customer_facing_statement"
],
"default": "core_policy"
},
"strictnessLevel": {
"type": "string",
"description": "Desired ambition/strictness of commitments.",
"enum": ["low", "medium", "medium_high", "high"],
"default": "medium_high"
},
"detailLevel": {
"type": "string",
"description": "Granularity of operational detail.",
"enum": ["principles_only", "balanced", "detailed"],
"default": "balanced"
},
"includeFrameworks": {
"type": "array",
"description": "Framework tags that MUST be referenced or at least considered in phrasing.",
"items": { "type": "string" },
"uniqueItems": true
},
"excludeFrameworks": {
"type": "array",
"description": "Framework tags that MUST NOT be referenced explicitly (e.g. not applicable jurisdictions).",
"items": { "type": "string" },
"uniqueItems": true
},
"jurisdictionOverride": {
"type": "array",
"description": "If set, restrict adaptation to these jurisdictions instead of full companyProfile.jurisdictions.",
"items": { "type": "string" },
"uniqueItems": true
},
"maxWords": {
"type": "integer",
"minimum": 200,
"maximum": 10000,
"description": "Soft maximum word count for generated content."
},
"sectionsToInclude": {
"type": "array",
"description": "Optional whitelist of section IDs/names from the template to include.",
"items": { "type": "string" },
"uniqueItems": true
},
"sectionsToExclude": {
"type": "array",
"description": "Optional blacklist of section IDs/names from the template to remove.",
"items": { "type": "string" },
"uniqueItems": true
},
"enablePlaceholdersFallback": {
"type": "boolean",
"description": "If true, the AI is allowed to fill unresolved placeholders with generic but sensible text; if false, unresolved placeholders should be left as-is.",
"default": false
},
"rewriteExistingText": {
"type": "string",
"description": "Control how much the AI is allowed to modify baseline template wording.",
"enum": ["minimal", "moderate", "extensive"],
"default": "moderate"
},
"debugMode": {
"type": "boolean",
"description": "If true, engine may attach extra diagnostics (e.g. section mapping, applied frameworks).",
"default": false
},
"metadata": {
"type": "object",
"description": "Free-form extension point (e.g. UI origin, userId, scenario).",
"additionalProperties": true
}
},
"required": ["companyId", "templateId"]
},
"MaterialityLevel": {
"type": "string",
"enum": ["none", "low", "medium", "high", "unknown"],
"description": "Qualitative importance / materiality level for a topic."
},
"RiskLevel": {
"type": "string",
"enum": ["none", "low", "medium", "high", "unknown"],
"description": "Qualitative risk level classification."
}
}
}