From 91903a3ae23ef738a24515666119d8f1921e91e9 Mon Sep 17 00:00:00 2001 From: Karl Maximilien KOHLER Date: Wed, 31 Dec 2025 11:53:52 +0530 Subject: [PATCH 1/7] Expand supplychain-risk README with MVP definition Expanded the README to include scope, inputs, outputs, and example scenario for the supply-chain risk module. --- modules/supplychain-risk/README.md | 50 ++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/modules/supplychain-risk/README.md b/modules/supplychain-risk/README.md index 9217f8c..2e5cbfc 100644 --- a/modules/supplychain-risk/README.md +++ b/modules/supplychain-risk/README.md @@ -1,4 +1,50 @@ -# Supply-Chain Risk (Quantum tech) +# Supply-Chain Risk (Quantum tech) Owner: Karl M. Kohler -Goal: /score, /brief + demo dataset. + +## Scope +This module provides a first-order supply-chain risk assessment for quantum-technology components and segments. It is designed as an +independent micro-service within OpenPolicyStack, returning a simple risk score, key drivers, and a short policy-oriented brief for +scenario analysis. + +The MVP focuses on reproducibility and a clear interface rather than +final data or models. + +## Inputs (MVP) +- country_or_region + Target economy or region (e.g. EU, US, China). +- segment_or_component + Quantum-technology segment or component (e.g. cryogenics, photonics, + ion-trap components, control electronics). +- optional: scenario + High-level disruption or policy scenario (e.g. export restriction, + supplier disruption). +- optional: year / time window + +## Outputs (MVP) +- risk_score + Relative risk score (0–100). +- risk_level + Categorical label (Low / Medium / High). +- key_drivers + Main contributing factors (e.g. supplier concentration, + geo-exposure, regulatory risk). +- brief + Short text explanation suitable for a policy dashboard or demo. + +## How to run (MVP) +Preferred interface:I chose API. + +My MVP will expose a minimal API endpoint that takes (country_or_region, segment_or_component, optional scenario) and returns the outputs above. Data sources and scoring logic will of course be refined in later phases. + +## Example scenario +Input: +- country_or_region: EU +- segment_or_component: quantum cryogenic systems +- scenario: export restriction + +Output: +- risk_score: 80 +- risk_level: High +- key_drivers: supplier concentration, limited substitution, regulatory exposure +- brief: Short summary of vulnerabilities and potential mitigation options. From 95ee01cb02629cc797bc3d08dba0fe9b014da3a4 Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:36:34 +0100 Subject: [PATCH 2/7] Expand README with module details and MVPs Added detailed module overview, inputs, and scenario parameters for the Policy Simulator. --- modules/policy-simulator/README.md | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index 1d9ebce..bc5fc24 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -2,3 +2,55 @@ Owner: Andrés Gerli Milian Goal: run_scenario → KPIs/plots/brief + 2–3 demo scenarios. +This module is a **policy scenario simulator microservice** focused on business taxation and its effects on **firm dynamics** and **labour outcomes**. + +--- + +## 1) Overview & scope + +### What this module does (MVP) +The MVP provides a Dockerised FastAPI service that: + +- Accepts a **scenario JSON** (country, sector, time window, tax parameters, run params). +- Returns: + - a **KPI table** (birth/death/net formation, employment index, salary index), + - **artifact paths** (at least one PNG plot, plus a JSON/Markdown brief), + - a structured **policy brief** (JSON object). + +**Important:** The MVP uses **deterministic dummy logic** (not the final ABM). The goal is to lock the **interface contract** and enable early integration into OpenPolicyStack. + +### Out of scope (later; not implemented in MVP) +- Real ETL from Eurostat / DG TAXUD / OECD / ECB. +- The full ABM of firm entry/exit and hiring. +- DiD/event-study validation around real reforms. + +(These items are intentionally excluded from this MVP to keep it integration-ready and realistic.) + +--- + +## 2) Inputs + +### 2.1 Scenario parameters (required) +`POST /run_scenario` expects a JSON request body: + +| Field | Type | Required | Default | Notes | +|---|---:|---:|---:|---| +| `country` | string | yes | — | ISO 3166-1 alpha-2 (e.g., `"FR"`, `"SE"`, `"DE"`, `"NL"`). MVP accepts any 2-letter string. | +| `sector` | string | yes | — | MVP: `"manufacturing"` or `"market_services"`. | +| `start_year` | int | yes | — | Analysis window start year (metadata + future ETL slice). | +| `end_year` | int | yes | — | Analysis window end year (metadata + future ETL slice). | +| `employer_payroll_tax_rate` | float | yes | — | Employer social contributions as a share of gross wage (0–1). | +| `employee_payroll_tax_rate` | float | yes | — | Employee social contributions as a share of gross wage (0–1). | +| `cit_rate` | float | yes | — | Corporate income tax rate (0–1). | +| `seed` | int | no | 42 | Ensures deterministic simulation and artifacts. | +| `timesteps` | int | no | 12 | Number of simulated periods (MVP: for plotting only). | + +### 2.2 Optional calibration reference (MVP accepts; does not use yet) +The request may include an optional `calibration` object to align with future integration: + +```json +"calibration": { + "baseline_year": 2010, + "tax_source": "dummy", + "kpi_source": "dummy" +} From dbc2f708bdaa165e6e02cf3291906b6c75848dc7 Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:25:58 +0100 Subject: [PATCH 3/7] Refactor README formatting and section headers Updated formatting and capitalization for consistency in README. --- modules/policy-simulator/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index bc5fc24..9994d58 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -1,21 +1,21 @@ -# Policy Simulator / Fiscal Evaluation -Owner: Andrés Gerli Milian -Goal: run_scenario → KPIs/plots/brief + 2–3 demo scenarios. +# Policy Simulator / Fiscal Evaluation +**Owner:** Andrés Gerli Milian +**Goal:** `run_scenario` → KPIs/plots/brief + 2–3 demo scenarios. -This module is a **policy scenario simulator microservice** focused on business taxation and its effects on **firm dynamics** and **labour outcomes**. +This module is a **policy scenario simulator microservice** focused on business taxation and its effects on **firm dynamics** and **labour outcomes**. --- -## 1) Overview & scope +## 1) Overview & Scope ### What this module does (MVP) The MVP provides a Dockerised FastAPI service that: - Accepts a **scenario JSON** (country, sector, time window, tax parameters, run params). - Returns: - - a **KPI table** (birth/death/net formation, employment index, salary index), - - **artifact paths** (at least one PNG plot, plus a JSON/Markdown brief), - - a structured **policy brief** (JSON object). + - A **KPI table** (birth/death/net formation, employment index, salary index). + - **Artifact paths** (at least one PNG plot, plus a JSON/Markdown brief). + - A structured **policy brief** (JSON object). **Important:** The MVP uses **deterministic dummy logic** (not the final ABM). The goal is to lock the **interface contract** and enable early integration into OpenPolicyStack. @@ -35,8 +35,8 @@ The MVP provides a Dockerised FastAPI service that: | Field | Type | Required | Default | Notes | |---|---:|---:|---:|---| -| `country` | string | yes | — | ISO 3166-1 alpha-2 (e.g., `"FR"`, `"SE"`, `"DE"`, `"NL"`). MVP accepts any 2-letter string. | -| `sector` | string | yes | — | MVP: `"manufacturing"` or `"market_services"`. | +| `country` | string | yes | — | ISO 3166-1 alpha-2 (e.g., "FR", "SE", "DE", "NL"). MVP accepts any 2-letter string. | +| `sector` | string | yes | — | MVP: "manufacturing" or "market_services". | | `start_year` | int | yes | — | Analysis window start year (metadata + future ETL slice). | | `end_year` | int | yes | — | Analysis window end year (metadata + future ETL slice). | | `employer_payroll_tax_rate` | float | yes | — | Employer social contributions as a share of gross wage (0–1). | @@ -45,8 +45,8 @@ The MVP provides a Dockerised FastAPI service that: | `seed` | int | no | 42 | Ensures deterministic simulation and artifacts. | | `timesteps` | int | no | 12 | Number of simulated periods (MVP: for plotting only). | -### 2.2 Optional calibration reference (MVP accepts; does not use yet) -The request may include an optional `calibration` object to align with future integration: +### 2.2 Optional calibration reference +The MVP accepts this object to align with future integration, though it does not use it yet: ```json "calibration": { From 6ecefe21b15cabeb541daf1e1612540b7ff3ee85 Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:33:55 +0100 Subject: [PATCH 4/7] Update README with run instructions for policy simulator Added instructions for running the policy simulator module using Docker and local development. --- modules/policy-simulator/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index 9994d58..b7b01a6 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -54,3 +54,21 @@ The MVP accepts this object to align with future integration, though it does not "tax_source": "dummy", "kpi_source": "dummy" } + +--- + +## 3) How to run + +This module is built with **Python 3.10+** and **FastAPI**. It can be run locally for development or as a containerized service. + +### 3.1 Docker (Recommended) +To ensure the environment matches the production target: + +```bash +# 1. Build the image +docker build -t policy-simulator. + +# 2. Run the container (mapping port 8000) +docker run -p 8000:8000 policy-simulator + +## 3.2) Local Development From 8ba21f77bfab49c363323425d8140fbb806ab46f Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:38:27 +0100 Subject: [PATCH 5/7] Update README with local development and example scenario Added local development instructions and example scenario for the policy simulator. --- modules/policy-simulator/README.md | 54 +++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index b7b01a6..708d8a4 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -66,9 +66,61 @@ To ensure the environment matches the production target: ```bash # 1. Build the image -docker build -t policy-simulator. +docker build -t policy-simulator . # 2. Run the container (mapping port 8000) docker run -p 8000:8000 policy-simulator ## 3.2) Local Development + +# 1. Create a virtual environment +python -m venv venv +source venv/bin/activate # On Windows use: venv\Scripts\activate + +# 2. Install dependencies +pip install -r requirements.txt + +# 3. Run the server (with hot-reload) +uvicorn main:app --reload + +4) Example Scenario + +To test the POST /run_scenario endpoint, you can use the Swagger UI or the following curl command. + +4.1 Sample JSON Payload +Matches the schema defined in Section 2. + +{ + "country": "FR", + "sector": "manufacturing", + "start_year": 2024, + "end_year": 2026, + "employer_payroll_tax_rate": 0.25, + "employee_payroll_tax_rate": 0.15, + "cit_rate": 0.25, + "seed": 12345, + "timesteps": 12, + "calibration": { + "baseline_year": 2023, + "tax_source": "dummy_defaults", + "kpi_source": "dummy_defaults" + } +} + +4.2 CURL Command + +curl -X 'POST' \ + 'http://localhost:8000/run_scenario' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "country": "FR", + "sector": "manufacturing", + "start_year": 2024, + "end_year": 2026, + "employer_payroll_tax_rate": 0.25, + "employee_payroll_tax_rate": 0.15, + "cit_rate": 0.25, + "seed": 12345, + "timesteps": 12 +}' From badb2578cabb8aa6bc101bf9be4665dac9a79a25 Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:12:07 +0100 Subject: [PATCH 6/7] Update README.md --- modules/policy-simulator/README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index 708d8a4..079c3f0 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -54,14 +54,14 @@ The MVP accepts this object to align with future integration, though it does not "tax_source": "dummy", "kpi_source": "dummy" } - +``` --- ## 3) How to run This module is built with **Python 3.10+** and **FastAPI**. It can be run locally for development or as a containerized service. -### 3.1 Docker (Recommended) +### 3.1 Docker To ensure the environment matches the production target: ```bash @@ -70,9 +70,9 @@ docker build -t policy-simulator . # 2. Run the container (mapping port 8000) docker run -p 8000:8000 policy-simulator - +``` ## 3.2) Local Development - +``` # 1. Create a virtual environment python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate @@ -82,6 +82,7 @@ pip install -r requirements.txt # 3. Run the server (with hot-reload) uvicorn main:app --reload +``` 4) Example Scenario @@ -90,6 +91,7 @@ To test the POST /run_scenario endpoint, you can use the Swagger UI or the follo 4.1 Sample JSON Payload Matches the schema defined in Section 2. +```json { "country": "FR", "sector": "manufacturing", @@ -106,9 +108,10 @@ Matches the schema defined in Section 2. "kpi_source": "dummy_defaults" } } - +``` 4.2 CURL Command +```bash curl -X 'POST' \ 'http://localhost:8000/run_scenario' \ -H 'accept: application/json' \ @@ -124,3 +127,4 @@ curl -X 'POST' \ "seed": 12345, "timesteps": 12 }' +``` From c0c3411f05286075387fe3440fa6ac2259382c09 Mon Sep 17 00:00:00 2001 From: Andres Gerli <126095106+andresgerli@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:26:58 +0100 Subject: [PATCH 7/7] README fuk formatting and section headers fix --- modules/policy-simulator/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/policy-simulator/README.md b/modules/policy-simulator/README.md index 079c3f0..770efa9 100644 --- a/modules/policy-simulator/README.md +++ b/modules/policy-simulator/README.md @@ -71,8 +71,8 @@ docker build -t policy-simulator . # 2. Run the container (mapping port 8000) docker run -p 8000:8000 policy-simulator ``` -## 3.2) Local Development -``` +### 3.2 Local Development +```bash # 1. Create a virtual environment python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate @@ -84,11 +84,11 @@ pip install -r requirements.txt uvicorn main:app --reload ``` -4) Example Scenario +## 4) Example Scenario To test the POST /run_scenario endpoint, you can use the Swagger UI or the following curl command. -4.1 Sample JSON Payload +### 4.1 Sample JSON Payload Matches the schema defined in Section 2. ```json @@ -109,7 +109,7 @@ Matches the schema defined in Section 2. } } ``` -4.2 CURL Command +### 4.2 CURL Command ```bash curl -X 'POST' \