[*Governance]

Part of the AIURM Protocol: the fields described here follow the governance skill v0.3 and may change.

What a governance file is

A governance file is the pipeline definition of a project. It is one plain-text file that tells the executor:

  • what the project is;
  • which data it consumes;
  • which logic it applies;
  • which results it must produce, and in which order;
  • under which configuration it runs;
  • which environment projects handle audit, log, exceptions and code.

The governance file is an index, not a store. It lists markers that point to data and logic; the content of each one lives in its own artifact inside a session. A governance file never carries data, rules or results inline.

There is one governance file per project, at a fixed place:

There is one governance file per project, at a fixed place:
```
{aiuar_root}/{contextspace}/{entity}/{project}/governance/aiurm_governance_{project}.txt
```
An executor runs it by address:
```
execute **project_portfolio_risk_v02*aiurm_governance_portfolio_risk_v02
```

The five sections

A governance file has five sections, always in this order.

SectionWhat it holds
HeaderThe protocol lines, the workflow name and version, and the purpose of the pipeline
GovernanceThe configuration fields, closed by the governance marker [*aiurm_governance_{project}] #0
DataThe data markers the project uses, one per line (*data_x)
LogicThe logic markers the project uses, one per line (*logic_x)
ResultThe steps: each one applies a logic to data and assigns a result marker

Standard fields

Address fields

These fields say where the project lives and where each kind of artifact is read or written.

FieldMeaning
as_ofReference date of the governance definition
substrate_typeWhere the project is stored: FILESYSTEM, JSON_FILE, MARKDOWN_FILE
aiuar_rootPhysical anchor of the context space, resolved by the executor
aiuarFull AIUAR address of the active session
aiuar_data_sourceSession where data is read. Default: aiuar
aiuar_logic_sourceSession where logic is read. Default: aiuar
aiuar_result_outputSession where results are written. Default: aiuar. With **session_{n}+1, each execution writes to a new session
execution_idIdentifier generated for each execution, for example 20260327_a3f7b2

Because data, logic and results each have their own address, a project can read its rules from one session and write every execution to a new one, by changing a single line.

Common optional fields

FieldExamples
policy_version"HRPOL_V1"
response_contractSTRUCTURED_OUTPUT_REQUIRED
output_result_formatJSON, TEXT
runtimepython, native
execution_triggerpython_runtime, manual
audit_levelFULL, MINIMAL
audit_policyLOG_EACH_RESULT_STEP
language_policy_defaultEN, PT
schema_moderestrict, permissive
aiurm_markers_locationIN_JSON_BODY, INLINE

When output_result_format = JSON and aiurm_markers_location = IN_JSON_BODY are both declared, every result artifact starts with its own identity and location:

{
"aiurm_marker": "[*result_x]",
"aiuar_address": "*****contextspace****entity***project**session*result_x"
}

Resolution mode

A capable executor can resolve almost any step by writing code. The numbers come out right, and nobody has looked at the data. The resolution mode lets the author declare, step by step, where the model’s own look is required and where calculation is enough.

ModeThe model’s attention passes overIn practice
INFERENCEthe rule, the data and the resultThe model reads the data and resolves the step by its own reasoning. Code only reads and writes artifacts
HYBRIDthe rule, and the inputs and outputs of the computationCode does the arithmetic. The model keeps the judgment, examines what comes out and records what it observes
DETERMINISTICthe rule onlyThe model translates the rule into code and runs it. No observation is contracted
AUTOchosen by the executorThe executor picks one of the three modes for the step and records its choice

The mode is declared in two places:

  • per project, with the field resolution_mode_default;
  • per step, as a suffix on the result marker line: [*result_x] #3 HYBRID.

The step suffix takes precedence over the project default. When neither is present, the step is resolved as AUTO.

The audit record of each step states the mode actually used (resolution_applied) and, for INFERENCE and HYBRID, what the model noticed (ai_observation). If a step is resolved differently from what was declared, the executor records the deviation and its reason. The contract forbids silence, not deviation.

Environment fields

Audit, log, exception and code records are not stored inside the project. Each one is handled by an environment project, and the governance says which.

FieldHandles
project_auditAudit records of completed steps
project_logOne log record per step, with its status
project_exceptionFailed, aborted or unresolvable steps
project_codeCode and other support material generated during the execution

Each field holds the address of the environment project’s own governance:

project_audit = *****contextspace_environment****tracker***project_audit*aiurm_governance_project_audit

The executor follows that address, reads the environment project’s governance and writes where it says. This indirection is what lets the environment grow or change without touching the projects that use it: pointing a project to a different environment governance changes how its audit, log or code is handled.

Project-specific fields

A governance may carry fields that the skill does not list. They are valid as part of that project’s contract and are preserved when the file is read or rewritten.

Data and Logic declarations

The Data and Logic sections declare AIURM markers. Each marker stands for an artifact that lives outside the governance file and is reached by its AIUAR address.

# Data
*data_macro_context

To resolve *data_macro_context, the executor joins the session declared in aiuar_data_source with the marker name. The result is the full address of the artifact:

*****contextspace_example****adaoaper***project_portfolio_risk_v02**session_1*data_macro_context

On a filesystem substrate, that address is the file session_1/data/data_macro_context.txt. On another substrate the same address resolves to something else: a row in a database table, a key in a JSON document, or a block in any other structured file.

In a text file, the artifact holds the content and ends with the marker that names it (shortened here):

{
"inflation_forecast": 3.2,
"market_regime": "Mid-cycle Softening"
}
[*data_macro_context] #0

The marker can also be carried in a structured form. When the artifact is JSON, it can be a field of the document:

{
"aiurm_marker": "[*data_macro_context] #0",
"inflation_forecast": 3.2,
"market_regime": "Mid-cycle Softening"
}

When the substrate is a database, it is a column of the table that stores the artifacts (see the table structure at the end of this page):

typeaiurm_markercontent
D*data_macro_context{ "inflation_forecast": 3.2, "market_regime": "Mid-cycle Softening" }

A Data or Logic artifact can be declared in three ways:

  • by its marker alone, such as *logic_x. The executor resolves it through the session declared in aiuar_logic_source for logic, or aiuar_data_source for data;
  • by an address composed in the declaration itself, starting at the level that changes. The levels above it are those of the active governance;
  • by its full AIUAR address, which reaches an artifact in any session or project.

The example below declares the same data twice: once from the session given by aiuar_data_source, and once from another session of the same project.

# Data
*data_macro_context

The declaration can be between projects or in specific sessions.

**session_1*logic_portfolio_risk_score

A full address names every level:

*****{contextspace}****{entity}***{project}**{session}*logic_x

Results are different only in direction: the execution produces them, writes them to the session declared in aiuar_result_output, and later steps refer to them as *result_x.

Two consequences follow:

  • A marker needs both a declaration in the governance and a matching artifact. One without the other cannot be resolved.
  • Because access is by address, the content of an artifact can change without touching the governance.

The Result section

Each step has a title, an Apply line and a marker line:

R8. Generate Stress Test Results
apply *logic_stress_tests to *result_portfolio_data_normalized
[*result_stress_test_results] #3 DETERMINISTIC
  • The Apply line names one logic and the data or earlier results it is applied to.
  • The marker is the identity of the step. R8 is only a label for human reading.
  • #n is the intention suffix: how much detail the result should carry.
  • The mode suffix is optional and declares how the step must be resolved.
  • Steps run in the order they appear in the file.

Complete example

The governance below defines a portfolio-risk workflow with nine data artifacts, fourteen logic artifacts and fourteen result steps. Things to notice:

  • data and logic are read from session_1, and each execution writes its results to a new session;
  • the project default is INFERENCE, and ten steps override it with their own mode;
  • the last four fields of the Governance section point to the environment projects.
# AIURM Protocol
AIURM/AIUAR Context Space Workflow Specification
DLR Methodology
# Workflow
Portfolio Risk (v0.2)
Governed Cognitive Workflow - Adversarial Demo Dataset
# Purpose
End-to-end enterprise portfolio-risk workflow: raw portfolio data -> normalization -> features -> scoring -> macro overlay -> behavior -> stress -> policy simulation -> explainability -> audit-ready dashboard -> dependency tree.
---
# Governance
as_of = "2026-05-31"
policy_version = "INVESTMENT_PORTFOLIO_RISK_V02"
substrate_type = FILESYSTEM
aiuar_root = ...\aiuar\
aiuar = *****contextspace_example****adaoaper***project_portfolio_risk_v02**session_1
aiuar_logic_source = aiuar
aiuar_data_source = aiuar
aiuar_result_output = **session_{n}+1
resolution_mode_default = INFERENCE
execution_id = {YYYYMMDD}_{random_6}
response_contract = STRUCTURED_OUTPUT_REQUIRED
output_result_format = JSON
runtime = python
execution_trigger = python_runtime
audit_level = FULL
audit_policy = LOG_EACH_RESULT_STEP
language_policy_default = EN
schema_mode = restrict
aiurm_markers_location = IN_JSON_BODY
project_audit = *****contextspace_environment****tracker***project_audit*aiurm_governance_project_audit
project_code = *****contextspace_environment****tracker***project_code*aiurm_governance_project_code
project_log = *****contextspace_environment****tracker***project_log*aiurm_governance_project_log
project_exception = *****contextspace_environment****tracker***project_exception*aiurm_governance_project_exception
[*aiurm_governance_portfolio_risk_v02] #0
---
# Data
*data_portfolio_data_raw
*data_asset_aliases
*data_asset_taxonomy_canonical
*data_macro_context
*data_param_risk_scoring
*data_profile_norms
*data_conservative_policy
*data_aggressive_policy
*data_workflow_scope_investments
---
# Logic
*logic_asset_normalization
*logic_portfolio_features
*logic_portfolio_risk_score
*logic_allocation_proposals
*logic_macro_overlay
*logic_exec_scenarios
*logic_behavioral_risk
*logic_stress_tests
*logic_policy_conservative
*logic_policy_aggressive
*logic_structural_xai
*logic_policy_comparison
*logic_enterprise_dashboard
*logic_dependency_tree
---
# Result
R1. Normalize Portfolios
apply *logic_asset_normalization to *data_portfolio_data_raw and *data_asset_aliases and *data_asset_taxonomy_canonical and *data_param_risk_scoring
[*result_portfolio_data_normalized] #3 HYBRID
R2. Extract Portfolio Features
apply *logic_portfolio_features to *result_portfolio_data_normalized
[*result_portfolio_features] #3 DETERMINISTIC
R3. Score Portfolios
apply *logic_portfolio_risk_score to *result_portfolio_features and *data_param_risk_scoring and *data_profile_norms
[*result_portfolio_risk_analysis] #3 HYBRID
R4. Generate Allocation Proposals
apply *logic_allocation_proposals to *result_portfolio_features and *data_profile_norms
[*result_portfolio_proposals] #2 AUTO
R5. Generate Macro Overlay
apply *logic_macro_overlay to *result_portfolio_features and *result_portfolio_risk_analysis and *data_macro_context
[*result_macro_overlay] #3 HYBRID
R6. Generate Executive What-If Outcomes
apply *logic_exec_scenarios to *result_portfolio_features and *data_macro_context
[*result_exec_outcomes] #2
R7. Generate Behavioral Risk Outcomes
apply *logic_behavioral_risk to *result_portfolio_features and *data_profile_norms
[*result_behavioral_risk] #3 HYBRID
R8. Generate Stress Test Results
apply *logic_stress_tests to *result_portfolio_data_normalized
[*result_stress_test_results] #3 DETERMINISTIC
R9. Generate Conservative Policy Simulation
apply *logic_policy_conservative to *result_portfolio_data_normalized and *result_portfolio_features and *data_conservative_policy
[*result_conservative_outcomes] #3 HYBRID
R10. Generate Aggressive Policy Simulation
apply *logic_policy_aggressive to *result_portfolio_data_normalized and *result_portfolio_features and *data_aggressive_policy
[*result_aggressive_outcomes] #3 HYBRID
R11. Generate Explainability
apply *logic_structural_xai to *result_portfolio_risk_analysis and *result_portfolio_features and *result_macro_overlay and *result_behavioral_risk and *result_stress_test_results and *result_conservative_outcomes and *result_aggressive_outcomes
[*result_portfolio_explainability] #3
R12. Compare Policies
apply *logic_policy_comparison to *result_conservative_outcomes and *result_aggressive_outcomes and *result_macro_overlay and *result_behavioral_risk and *result_stress_test_results
[*result_policy_comparison] #3
R13. Generate Enterprise Dashboard
apply *logic_enterprise_dashboard to *result_portfolio_risk_analysis and *result_portfolio_features and *result_macro_overlay and *result_behavioral_risk and *result_stress_test_results and *result_exec_outcomes and *result_policy_comparison
[*result_enterprise_risk_dashboard] #2
R14. Generate Dependency Tree
apply *logic_dependency_tree to *data_workflow_scope_investments
[*result_dependency_tree_investments_dot] #3
---
# End of pipeline definition

Example of Data

{
"policy_mode": "Auto",
"scoring_mode": "STRICT_DISCRETE_BUCKETS",
"interpolation_allowed": false,
"bucket_tie_breaker": "FLOOR_TO_RISKIER_BUCKET",
"data_quality_tolerance_pct": 0.5,
"bucket_rules": {
"diversification": [25, 18, 12, 5],
"sector_concentration": [20, 12, 5],
"liquidity": [15, 10, 5],
"profile_alignment": [10, 6, 2]
},
"weights": {
"asset_stability": 0.30,
"diversification": 0.25,
"sector_concentration": 0.20,
"liquidity": 0.15,
"profile_alignment": 0.10
},
"rounding": {
"component_points": "NO_ROUNDING",
"final_score": "ROUND_1_DECIMAL",
"weights_pct": "ROUND_2_DECIMALS"
}
}
[*data_param_risk_scoring] #0

Example of Logic

Purpose: materialize a canonical portfolio representation before any scoring.
Rules:
1) Resolve each raw holding asset label through *data_asset_aliases.
2) Replace raw type, sector, stability, stress, liquidity, and behavioral tags
with values from *data_asset_taxonomy_canonical.
3) Aggregate duplicate holdings that resolve to the same canonical asset_id.
4) computed_total_value = SUM(normalized holding values).
5) total_variance_pct =
ABS(reported_total_value - computed_total_value) / computed_total_value * 100.
6) If total_variance_pct > *data_param_risk_scoring.data_quality_tolerance_pct,
record data_quality_flag = "REPORTED_TOTAL_MISMATCH".
7) Use computed_total_value as the denominator for all downstream calculations.
8) Preserve an alias_trace list and a normalization_override list for audit.
9) No unsupported asset label may be silently classified. If an alias is absent,
record unresolved_asset and stop downstream calculation for that portfolio.
[*logic_asset_normalization] #0

Table structure for a database substrate

The same project can live in a database instead of folders and files. The address notation does not change; only the way it is stored does. Three tables hold the whole hierarchy:

AIUAR levelStored in
*****contextspaceaiuar.contextspace
****entityaiuar.entity
***projectaiuar.project
governanceaiuar.governance, the full text of the governance file
**sessionaiuar_session.session
*data_xa row in aiuar_dlr with type = 'D'
*logic_xa row in aiuar_dlr with type = 'L'
*result_xa row in aiuar_dlr with type = 'R'

This is the structure of the SQLite file in the repository (aiuar.db), declared in governance as substrate_type = SQLITE_FILE:

CREATE TABLE aiuar (
aiuar_id INTEGER PRIMARY KEY AUTOINCREMENT,
contextspace TEXT NOT NULL,
entity TEXT NOT NULL,
project TEXT NOT NULL,
governance TEXT NOT NULL,
UNIQUE (contextspace, entity, project)
);
CREATE TABLE aiuar_session (
aiuar_session_id INTEGER PRIMARY KEY AUTOINCREMENT,
aiuar_id INTEGER NOT NULL REFERENCES aiuar(aiuar_id),
session TEXT NOT NULL,
UNIQUE (aiuar_id, session)
);
CREATE TABLE aiuar_dlr (
aiuar_dlr_id INTEGER PRIMARY KEY AUTOINCREMENT,
aiuar_session_id INTEGER NOT NULL REFERENCES aiuar_session(aiuar_session_id),
type TEXT NOT NULL CHECK (type IN ('D', 'L', 'R')),
aiurm_marker TEXT NOT NULL,
content TEXT NOT NULL
);

Each project is one row in aiuar, with its governance stored as text. Each session is one row in aiuar_session. Every data, logic and result artifact is one row in