synthesis-ledger-sovereign-sdk 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/atomics/11.json +65 -0
- package/atomics/13.json +58 -0
- package/atomics/15.json +58 -0
- package/atomics/16.json +58 -0
- package/atomics/17.json +58 -0
- package/atomics/18.json +58 -0
- package/atomics/20.json +58 -0
- package/atomics/23.json +65 -0
- package/atomics/24.json +72 -0
- package/atomics/25.json +37 -0
- package/atomics/26.json +37 -0
- package/atomics/27.json +44 -0
- package/atomics/28.json +58 -0
- package/atomics/29.json +37 -0
- package/atomics/3.json +65 -0
- package/atomics/32.json +37 -0
- package/atomics/36.json +65 -0
- package/atomics/39.json +10 -0
- package/atomics/40.json +58 -0
- package/atomics/41.json +37 -0
- package/atomics/47.json +65 -0
- package/atomics/70.json +65 -0
- package/atomics/71.json +65 -0
- package/atomics/72.json +65 -0
- package/atomics/73.json +72 -0
- package/atomics/74.json +65 -0
- package/atomics/75.json +72 -0
- package/atomics/76.json +65 -0
- package/atomics/8.json +65 -0
- package/atomics/83.json +58 -0
- package/atomics/84.json +58 -0
- package/atomics/86.json +65 -0
- package/atomics/87.json +58 -0
- package/atomics/89.json +58 -0
- package/atomics/9.json +65 -0
- package/atomics/91.json +65 -0
- package/atomics/93.json +58 -0
- package/atomics/96.json +65 -0
- package/atomics/97.json +58 -0
- package/bin/index.js +19 -0
- package/bin/synl.js +27 -0
- package/genesis_onchain.json +2234 -0
- package/package.json +21 -0
- package/shatter.js +31 -0
- package/src/ai_adapter.js +35 -0
- package/src/claim.js +21 -0
- package/src/forge.js +78 -0
- package/src/ledger.js +28 -0
- package/upload_genesis.js +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Synthesis Ledger SDK (Sovereign V25) 🛡️
|
|
2
|
+
|
|
3
|
+
The first decentralized logic registry built to move AI from fragile prompts to **Sovereign Logic**.
|
|
4
|
+
|
|
5
|
+
## ⚖️ The Dec 31st Commitment
|
|
6
|
+
On December 31st, 2025, the ownership of the Synthesis Registry will be renounced. The protocol becomes a public utility.
|
|
7
|
+
* **Zero Control:** No admin keys. No gatekeepers.
|
|
8
|
+
* **Neutrality:** Hardcoded 990M token distribution for the world.
|
|
9
|
+
* **Certainty:** Logic is etched into the blockchain and verified by the Sovereign Engine.
|
|
10
|
+
|
|
11
|
+
## ⚙️ Architecture: The Board of Intelligence
|
|
12
|
+
This SDK executes "Atomics" using a Three-Phase Sovereign Engine:
|
|
13
|
+
1. **BRAIN (grok-4-1-fast-reasoning):** Performs deep math and logic analysis.
|
|
14
|
+
2. **AUDITOR (grok-code-fast-1):** Validates the Brain's output against Global and Custom blueprints.
|
|
15
|
+
3. **RECONCILER (grok-code-fast-1):** Synthesizes the final JSON ledger for on-chain certification.
|
|
16
|
+
|
|
17
|
+
## 🛠️ Installation
|
|
18
|
+
npm install -g @synl/sdk
|
|
19
|
+
|
|
20
|
+
## 🚀 Usage
|
|
21
|
+
To run a specific Atomic ID (e.g., ID 39):
|
|
22
|
+
synl run 39
|
|
23
|
+
|
|
24
|
+
## 📂 Modular Structure
|
|
25
|
+
Atomics are stored individually in the /atomics folder. This allows for:
|
|
26
|
+
* **Immutability:** Each ID has its own unique hash.
|
|
27
|
+
* **Upgradability:** Post-Dec 31st, community "Duels" can challenge and replace logic files through the SYNL meritocracy.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
#AI #Web3 #SovereignLogic #SynthesisLedger #Base
|
package/atomics/11.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 11,
|
|
3
|
+
"successBps": 9914,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_RE_VALUATIONBPS",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-RE-ValuationBPS Technical Specification\n\n## 1. Core Logic Definition\n\n### 1.1 Breakdown Point Score (BPS) Formula\n\n```\nBPS = Σ(Wáµ¢ × Ráµ¢ × Sáµ¢) / N\n\nWhere:\n Wáµ¢ = Weight factor for risk category i (0.0 - 1.0)\n Ráµ¢ = Risk probability coefficient (0.0 - 1.0)\n Sáµ¢ = Severity multiplier (1 - 10)\n N = Normalization constant = Σ(Wáµ¢ × 10)\n```\n\n### 1.2 Valuation Decay Function\n\n```\nV(t) = Vâ‚€ × e^(-λ × BPS × t)\n\nWhere:\n V(t) = Asset value at time t\n Vâ‚€ = Initial asset valuation\n λ = Decay constant (default: 0.023)\n BPS = Breakdown Point Score (0.0 - 1.0)\n t = Time in operational cycles\n```\n\n### 1.3 Operational Threshold Boundaries\n\n```\nBPS_critical = 0.75\nBPS_warning = 0.50\nBPS_nominal = 0.25\n\nState Machine:\n IF BPS ≥ BPS_critical THEN state = CRITICAL\n ELSE IF BPS ≥ BPS_warning THEN state = DEGRADED\n ELSE IF BPS ≥ BPS_nominal THEN state = NOMINAL\n ELSE state = OPTIMAL\n```\n\n---\n\n## 2. BPS Risk Matrix\n\n### 2.1 Operational Failure Risk Categories\n\n| Category ID | Risk Domain | Weight (Wáµ¢) | Failure Mode | MTTR Target |\n|-------------|-------------|-------------|--------------|-------------|\n| RF-001 | Infrastructure Availability | 0.95 | Complete outage | ≤ 15 min |\n| RF-002 | Data Integrity | 0.90 | Corruption/Loss | ≤ 30 min |\n| RF-003 | Performance Degradation | 0.75 | Latency \u003e P99 SLO | ≤ 10 min |\n| RF-004 | Security Breach | 0.98 | Unauthorized access | ≤ 5 min |\n| RF-005 | Dependency Failure | 0.70 | Upstream/downstream | ≤ 20 min |\n| RF-006 | Configuration Drift | 0.60 | State mismatch | ≤ 45 min |\n| RF-007 | Capacity Exhaustion | 0.80 | Resource saturation | ≤ 25 min |\n| RF-008 | Observability Gap | 0.55 | Blind spot detection | ≤ 60 min |\n\n### 2.2 Severity Multiplier Matrix\n\n| Severity Level | Sáµ¢ Value | Impact Scope | Revenue Impact |\n|----------------|----------|--------------|----------------|\n| S1 - Catastrophic | 10 | Full system | \u003e $1M/hour |\n| S2 - Critical | 8 | Multi-region | $500K-$1M/hour |\n| S3 - Major | 6 | Single region | $100K-$500K/hour |\n| S4 - Moderate | 4 | Service cluster | $10K-$100K/hour |\n| S5 - Minor | 2 | Single instance | \u003c $10K/hour |\n| S6 - Negligible | 1 | No user impact | $0 |\n\n### 2.3 Risk Probability Coefficients\n\n```\nRáµ¢ = (incident_count_30d / operational_hours_30d) × availability_inverse\n\navailability_inverse = 1 / (1 - downtime_ratio)\n\nProbability Bands:\n R ∈ [0.00, 0.10] → LOW\n R ∈ [0.11, 0.35] → MODERATE \n R ∈ [0.36, 0.60] → HIGH\n R ∈ [0.61, 1.00] → CRITICAL\n```\n\n---\n\n## 3. JSON Schema Specification\n\n### 3.1 Input Validation Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://sre.internal/schemas/a-re-valuation-bps/v1\",\n \"title\": \"A-RE-ValuationBPS Input Schema\",\n \"type\": \"object\",\n \"required\": [\"asset_id\", \"valuation_context\", \"risk_factors\", \"temporal_params\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"asset_id\": {\n \"type\": \"string\",\n \"pattern\": \"^ARE-[A-Z]{2}-[0-9]{8}$\",\n \"description\": \"Unique asset identifier\"\n },\n \"valuation_context\": {\n \"type\": \"object\",\n \"required\": [\"initial_value\", \"currency\", \"valuation_date\"],\n \"properties\": {\n \"initial_value\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1e15,\n \"description\": \"Vâ‚€ in valuation formula\"\n },\n \"currency\": {\n \"type\": \"string\",\n \"enum\": [\"USD\", \"EUR\", \"GBP\", \"JPY\"],\n \"default\": \"USD\"\n },\n \"valuation_date\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"decay_constant\": {\n \"type\": \"number\",\n \"minimum\": 0.001,\n \"maximum\": 0.999,\n \"default\": 0.023,\n \"description\": \"λ decay constant\"\n }\n }\n },\n \"risk_factors\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 50,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"category_id\", \"weight\", \"probability\", \"severity\"],\n \"properties\": {\n \"category_id\": {\n \"type\": \"string\",\n \"pattern\": \"^RF-[0-9]{3}$\"\n },\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"probability\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"severity\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 10\n },\n \"incident_metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"count_30d\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"mttr_seconds\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"last_occurrence\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n }\n }\n }\n }\n },\n \"temporal_params\": {\n \"type\": \"object\",\n \"required\": [\"projection_cycles\", \"cycle_unit\"],\n \"properties\": {\n \"projection_cycles\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 365\n },\n \"cycle_unit\": {\n \"type\": \"string\",\n \"enum\": [\"HOUR\", \"DAY\", \"WEEK\", \"MONTH\"]\n },\n \"evaluation_window_hours\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 8760,\n \"default\": 720\n }\n }\n },\n \"slo_targets\": {\n \"type\": \"object\",\n \"properties\": {\n \"availability_target\": {\n \"type\": \"number\",\n \"minimum\": 0.9,\n \"maximum\": 0.99999\n },\n \"latency_p99_ms\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 30000\n },\n \"error_budget_remaining\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n }\n }\n }\n }\n}\n```\n\n### 3.2 Output Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://sre.internal/schemas/a-re-valuation-bps/v1/output\",\n \"title\": \"A-RE-ValuationBPS Output Schema\",\n \"type\": \"object\",\n \"required\": [\"asset_id\", \"bps_score\", \"valuation_projection\", \"operational_state\", \"computed_at\"],\n \"properties\": {\n \"asset_id\": {\n \"type\": \"string\"\n },\n \"bps_score\": {\n \"type\": \"object\",\n \"properties\": {\n \"composite\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"category_breakdown\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"category_id\": { \"type\": \"string\" },\n \"contribution\": { \"type\": \"number\" }\n }\n }\n }\n }\n },\n \"valuation_projection\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"cycle\": { \"type\": \"integer\" },\n \"projected_value\": { \"type\": \"number\" },\n \"decay_rate\": { \"type\": \"number\" }\n }\n }\n },\n \"operational_state\": {\n \"type\": \"string\",\n \"enum\": [\"OPTIMAL\", \"NOMINAL\", \"DEGRADED\", \"CRITICAL\"]\n },\n \"computed_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n }\n}\n```\n\n---\n\n## 4. SRE Metrics Specification\n\n### 4.1 Golden Signals Mapping\n\n| Signal | Metric Name | Unit | Collection Interval | Aggregation |\n|--------|-------------|------|---------------------|-------------|\n| Latency | `are_bps_computation_duration_seconds` | seconds | 10s | histogram |\n| Traffic | `are_bps_evaluations_total` | count | 10s | counter |\n| Errors | `are_bps_validation_failures_total` | count | 10s | counter |\n| Saturation | `are_bps_queue_depth` | count | 10s | gauge |\n\n### 4.2 SLI Definitions\n\n```yaml\nsli_specifications:\n availability:\n metric: |\n sum(rate(are_bps_requests_success_total[5m])) /\n sum(rate(are_bps_requests_total[5m]))\n target: 0.999\n \n latency_p99:\n metric: |\n histogram_quantile(0.99, \n sum(rate(are_bps_computation_duration_seconds_bucket[5m])) by (le))\n target_ms: 500\n \n correctness:\n metric: |\n 1 - (sum(rate(are_bps_calculation_errors_total[5m])) /\n sum(rate(are_bps_evaluations_total[5m])))\n target: 0.9999\n```\n\n### 4.3 Error Budget Calculation\n\n```\nError Budget (monthly) = (1 - SLO_target) × total_minutes_in_month\n\nFor 99.9% availability:\n EB = (1 - 0.999) × 43200 = 43.2 minutes/month\n\nBurn Rate:\n burn_rate = (error_rate_current / error_rate_budget) × time_window\n\nAlert Thresholds:\n burn_rate \u003e 14.4 → PAGE (2% budget in 1 hour)\n burn_rate \u003e 6.0 → PAGE (5% budget in 6 hours)\n burn_rate \u003e 1.0 → TICKET (10% budget in 3 days)\n```\n\n### 4.4 Operational Success Metrics\n\n| Metric | Formula | Target | Alert Threshold |\n|--------|---------|--------|-----------------|\n| MTTR | `avg(incident_resolution_time)` | ≤ 30 min | \u003e 45 min |\n| MTTD | `avg(detection_time - incident_start)` | ≤ 5 min | \u003e 10 min |\n| Change Failure Rate | `failed_changes / total_changes` | ≤ 15% | \u003e 25% |\n| BPS Accuracy | `1 - abs(predicted_bps - actual_bps) / actual_bps` | ≥ 95% | \u003c 90% |\n| Valuation Drift | `abs(V_projected - V_actual) / V_actual` | ≤ 5% | \u003e 10% |\n\n### 4.5 Prometheus Recording Rules\n\n```yaml\ngroups:\n - name: are_bps_recording_rules\n interval: 30s\n rules:\n - record: are:bps:composite_score\n expr: |\n sum by (asset_id) (\n are_bps_risk_weight * \n are_bps_risk_probability * \n are_bps_risk_severity\n ) / \n sum by (asset_id) (are_bps_risk_weight * 10)\n \n - record: are:valuation:decay_rate\n expr: |\n are_valuation_initial * \n exp(-0.023 * are:bps:composite_score * are_operational_cycles)\n \n - record: are:slo:error_budget_remaining\n expr: |\n 1 - (\n sum(increase(are_bps_errors_total[30d])) /\n (sum(increase(are_bps_requests_total[30d])) * 0.001)\n )\n```\n\n### 4.6 Alerting Rules\n\n```yaml\ngroups:\n - name: are_bps_alerts\n rules:\n - alert: AREBPSCriticalThreshold\n expr: are:bps:composite_score \u003e 0.75\n for: 5m\n labels:\n severity: critical\n annotations:\n summary: \"Asset {{ $labels.asset_id }} BPS exceeds critical threshold\"\n \n - alert: AREValuationRapidDecay\n expr: |\n (are_valuation_current / are_valuation_initial) \u003c 0.5 \n AND rate(are_valuation_current[1h]) \u003c -0.01\n for: 15m\n labels:\n severity: warning\n \n - alert: AREBPSCalculationLatency\n expr: |\n histogram_quantile(0.99, \n rate(are_bps_computation_duration_seconds_bucket[5m])) \u003e 0.5\n for: 10m\n labels:\n severity: warning\n```\n\n---\n\n## 5. Computation Pipeline Logic\n\n### 5.1 Processing Sequence\n\n```\n┌─────────────────â”\n│ Input Ingress │\n│ (JSON Payload) │\n└────────┬────────┘\n │\n â–¼\n┌─────────────────â”\n│ Schema Validate │──── FAIL ───▶ [Error: VALIDATION_FAILED]\n│ (JSON Schema) │\n└────────┬────────┘\n │ PASS\n â–¼\n┌─────────────────â”\n│ Risk Factor │\n│ Normalization │\n│ Wáµ¢, Ráµ¢, Sáµ¢ │\n└────────┬────────┘\n │\n â–¼\n┌─────────────────\n```",
|
|
7
|
+
"outcome": "A-RE-ValuationBPS",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "RE",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "Type",
|
|
31
|
+
"type": "Description",
|
|
32
|
+
"description": "Downstream Intent",
|
|
33
|
+
"downstream_intent": "BPS Sensitivity",
|
|
34
|
+
"bps_sensitivity": ""
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "composite_bps_score",
|
|
38
|
+
"type": "Float",
|
|
39
|
+
"description": "Final 0.0-1.0 score normalized against failure categories.",
|
|
40
|
+
"downstream_intent": "Portfolio Risk Aggregator.",
|
|
41
|
+
"bps_sensitivity": "High"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "valuation_decay_curve",
|
|
45
|
+
"type": "Array",
|
|
46
|
+
"description": "36-month projection of asset value based on BPS.",
|
|
47
|
+
"downstream_intent": "CFO Persona / Investors.",
|
|
48
|
+
"bps_sensitivity": "High"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "operational_state_verdict",
|
|
52
|
+
"type": "String",
|
|
53
|
+
"description": "Deterministic state: \"OPTIMAL\", \"NOMINAL\", \"DEGRADED\", \"CRITICAL\".",
|
|
54
|
+
"downstream_intent": "Circuit Breaker Logic.",
|
|
55
|
+
"bps_sensitivity": "High"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"field_name": "risk_contribution_map",
|
|
59
|
+
"type": "Object",
|
|
60
|
+
"description": "Breakdown of which `RF-ID` (e.g., RF-004 Security) is driving the BPS.",
|
|
61
|
+
"downstream_intent": "SRE Remediation Workflow.",
|
|
62
|
+
"bps_sensitivity": "Medium"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
package/atomics/13.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 13,
|
|
3
|
+
"successBps": 9636,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_EC_SKUSIFTER",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-EC-SKUSifter Technical Logic Specification\n\n## 1. System Definition\n\nA-EC-SKUSifter is an automated SKU classification and routing engine designed to filter, validate, and distribute product SKUs across e-commerce fulfillment channels based on multi-dimensional attribute scoring.\n\n---\n\n## 2. Core Logic Architecture\n\n### 2.1 SKU Processing Pipeline\n\n```\nINPUT → VALIDATION → NORMALIZATION → SCORING → CLASSIFICATION → ROUTING → OUTPUT\n │ │ │ │ │ │ │\n ▼ ▼ ▼ ▼ ▼ ▼ ▼\n RAW SCHEMA_CHK ATTR_NORM BPS_CALC TIER_ASSIGN CH_SELECT EMIT\n```\n\n### 2.2 Mathematical Models\n\n#### 2.2.1 SKU Composite Score (SCS)\n\n$$SCS = \\sum_{i=1}^{n} w_i \\cdot A_i \\cdot D_i$$\n\nWhere:\n- $w_i$ = weight coefficient for attribute $i$ (normalized: $\\sum w_i = 1$)\n- $A_i$ = attribute value (normalized to [0,1])\n- $D_i$ = decay factor based on data freshness: $D_i = e^{-\\lambda t}$\n- $\\lambda$ = decay constant (default: 0.0001/hour)\n- $t$ = hours since last attribute update\n\n#### 2.2.2 Channel Affinity Score (CAS)\n\n$$CAS_{c} = \\frac{\\sum_{j=1}^{m} R_{cj} \\cdot SCS_j}{\\sum_{j=1}^{m} SCS_j} \\cdot \\Phi_c$$\n\nWhere:\n- $R_{cj}$ = routing coefficient for channel $c$ and SKU $j$\n- $\\Phi_c$ = channel capacity factor: $\\Phi_c = 1 - \\frac{Q_c}{Q_{max}}$\n- $Q_c$ = current queue depth for channel $c$\n\n#### 2.2.3 Sift Confidence Index (SCI)\n\n$$SCI = \\frac{1}{1 + e^{-k(SCS - \\theta)}} \\cdot \\prod_{v=1}^{V} P_v$$\n\nWhere:\n- $k$ = steepness factor (default: 10)\n- $\\theta$ = classification threshold (default: 0.5)\n- $P_v$ = validation pass probability for validator $v$\n\n---\n\n## 3. Breakdown Point Score (BPS) Matrix\n\n### 3.1 BPS Calculation Formula\n\n$$BPS = \\frac{F_{impact} \\cdot F_{probability} \\cdot F_{detection}}{M_{mitigation}}$$\n\n| Score Range | Risk Level | Action Required |\n|-------------|------------|-----------------|\n| 0.0 - 2.0 | LOW | Monitor |\n| 2.1 - 5.0 | MEDIUM | Alert + Review |\n| 5.1 - 8.0 | HIGH | Immediate Fix |\n| 8.1 - 10.0 | CRITICAL | System Halt |\n\n### 3.2 Operational Failure Risk Matrix\n\n| Failure Mode | Impact (1-10) | Probability (0-1) | Detection (1-10) | Mitigation (1-10) | BPS | Risk Level |\n|--------------|---------------|-------------------|------------------|-------------------|-----|------------|\n| Schema Validation Bypass | 9 | 0.05 | 3 | 7 | 0.19 | LOW |\n| Attribute Normalization Drift | 7 | 0.15 | 6 | 5 | 1.26 | LOW |\n| Score Calculation Overflow | 10 | 0.02 | 2 | 8 | 0.05 | LOW |\n| Channel Queue Saturation | 8 | 0.25 | 4 | 6 | 1.33 | LOW |\n| Stale Data Propagation | 6 | 0.30 | 7 | 4 | 3.15 | MEDIUM |\n| Classification Threshold Misconfiguration | 8 | 0.10 | 5 | 3 | 1.33 | LOW |\n| Routing Loop Detection Failure | 9 | 0.08 | 8 | 4 | 1.44 | LOW |\n| Database Connection Pool Exhaustion | 10 | 0.12 | 3 | 5 | 0.72 | LOW |\n| Memory Leak in Sift Engine | 8 | 0.20 | 6 | 3 | 3.20 | MEDIUM |\n| Concurrent Write Collision | 7 | 0.18 | 5 | 6 | 1.05 | LOW |\n| External API Timeout Cascade | 9 | 0.22 | 4 | 4 | 1.98 | LOW |\n| SKU Deduplication Failure | 6 | 0.15 | 7 | 5 | 1.26 | LOW |\n| Batch Processing Deadlock | 10 | 0.05 | 9 | 3 | 1.50 | LOW |\n| Metric Emission Backpressure | 5 | 0.25 | 3 | 7 | 0.54 | LOW |\n| Configuration Hot-Reload Race | 7 | 0.08 | 6 | 4 | 0.84 | LOW |\n\n### 3.3 Aggregate System BPS\n\n$$BPS_{system} = \\sqrt{\\sum_{i=1}^{n} BPS_i^2}$$\n\n**Current System BPS**: $\\sqrt{0.19^2 + 1.26^2 + ... + 0.84^2} = 5.47$ → **HIGH RISK**\n\n---\n\n## 4. JSON Schema for Input Validation\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://sre.internal/schemas/a-ec-skusifter/v1/sku-input.json\",\n \"title\": \"A-EC-SKUSifter Input Schema\",\n \"type\": \"object\",\n \"required\": [\"sku_id\", \"attributes\", \"metadata\", \"routing_hints\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"sku_id\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{2,4}-[0-9]{6,12}-[A-Z0-9]{2,4}$\",\n \"minLength\": 12,\n \"maxLength\": 24,\n \"description\": \"Unique SKU identifier following format: PREFIX-NUMERIC-SUFFIX\"\n },\n \"attributes\": {\n \"type\": \"object\",\n \"required\": [\"category\", \"weight\", \"dimensions\", \"price\", \"inventory_level\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"category\": {\n \"type\": \"object\",\n \"required\": [\"primary\", \"secondary\"],\n \"properties\": {\n \"primary\": {\n \"type\": \"string\",\n \"enum\": [\"ELECTRONICS\", \"APPAREL\", \"HOME\", \"CONSUMABLES\", \"INDUSTRIAL\", \"MEDIA\"]\n },\n \"secondary\": {\n \"type\": \"array\",\n \"items\": {\"type\": \"string\", \"maxLength\": 64},\n \"minItems\": 1,\n \"maxItems\": 5,\n \"uniqueItems\": true\n },\n \"taxonomy_version\": {\n \"type\": \"string\",\n \"pattern\": \"^v[0-9]+\\\\.[0-9]+$\",\n \"default\": \"v2.0\"\n }\n }\n },\n \"weight\": {\n \"type\": \"object\",\n \"required\": [\"value\", \"unit\"],\n \"properties\": {\n \"value\": {\"type\": \"number\", \"minimum\": 0.001, \"maximum\": 99999.999},\n \"unit\": {\"type\": \"string\", \"enum\": [\"kg\", \"lb\", \"g\", \"oz\"]}\n }\n },\n \"dimensions\": {\n \"type\": \"object\",\n \"required\": [\"length\", \"width\", \"height\", \"unit\"],\n \"properties\": {\n \"length\": {\"type\": \"number\", \"minimum\": 0.1, \"maximum\": 9999.9},\n \"width\": {\"type\": \"number\", \"minimum\": 0.1, \"maximum\": 9999.9},\n \"height\": {\"type\": \"number\", \"minimum\": 0.1, \"maximum\": 9999.9},\n \"unit\": {\"type\": \"string\", \"enum\": [\"cm\", \"in\", \"m\", \"ft\"]}\n }\n },\n \"price\": {\n \"type\": \"object\",\n \"required\": [\"base\", \"currency\"],\n \"properties\": {\n \"base\": {\"type\": \"number\", \"minimum\": 0.01, \"maximum\": 9999999.99},\n \"currency\": {\"type\": \"string\", \"pattern\": \"^[A-Z]{3}$\"},\n \"msrp\": {\"type\": \"number\", \"minimum\": 0.01},\n \"cost\": {\"type\": \"number\", \"minimum\": 0.00}\n }\n },\n \"inventory_level\": {\n \"type\": \"object\",\n \"required\": [\"available\", \"reserved\", \"warehouse_id\"],\n \"properties\": {\n \"available\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 99999999},\n \"reserved\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 99999999},\n \"warehouse_id\": {\"type\": \"string\", \"pattern\": \"^WH-[A-Z]{2}-[0-9]{4}$\"},\n \"reorder_point\": {\"type\": \"integer\", \"minimum\": 0},\n \"lead_time_days\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 365}\n }\n },\n \"velocity_score\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0,\n \"description\": \"Sales velocity normalized score\"\n },\n \"hazmat_class\": {\n \"type\": [\"string\", \"null\"],\n \"enum\": [null, \"CLASS_1\", \"CLASS_2\", \"CLASS_3\", \"CLASS_4\", \"CLASS_5\", \"CLASS_6\", \"CLASS_7\", \"CLASS_8\", \"CLASS_9\"]\n },\n \"fragility_index\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 5,\n \"default\": 3\n }\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"required\": [\"source_system\", \"ingestion_timestamp\", \"schema_version\"],\n \"properties\": {\n \"source_system\": {\n \"type\": \"string\",\n \"enum\": [\"ERP_PRIMARY\", \"ERP_SECONDARY\", \"PIM\", \"WMS\", \"MANUAL_ENTRY\", \"API_PARTNER\"]\n },\n \"ingestion_timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"schema_version\": {\n \"type\": \"string\",\n \"const\": \"1.0.0\"\n },\n \"correlation_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"batch_id\": {\n \"type\": [\"string\", \"null\"],\n \"pattern\": \"^BATCH-[0-9]{8}-[0-9]{6}$\"\n },\n \"checksum\": {\n \"type\": \"string\",\n \"pattern\": \"^sha256:[a-f0-9]{64}$\"\n }\n }\n },\n \"routing_hints\": {\n \"type\": \"object\",\n \"required\": [\"priority\", \"eligible_channels\"],\n \"properties\": {\n \"priority\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 10,\n \"description\": \"1=highest priority, 10=lowest\"\n },\n \"eligible_channels\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"FBA\", \"FBM\", \"DROPSHIP\", \"WHOLESALE\", \"DTC\", \"MARKETPLACE_3P\", \"B2B_DIRECT\"]\n },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"exclusions\": {\n \"type\": \"array\",\n \"items\": {\"type\": \"string\"},\n \"default\": []\n },\n \"geo_restrictions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{2}(-[A-Z]{2})?$\"\n }\n },\n \"sla_tier\": {\n \"type\": \"string\",\n \"enum\": [\"STANDARD\", \"EXPEDITED\", \"NEXT_DAY\", \"SAME_DAY\"],\n \"default\": \"STANDARD\"\n }\n }\n },\n \"custom_attributes\": {\n \"type\": \"object\",\n \"maxProperties\": 50,\n \"patternProperties\": {\n \"^[a-z][a-z0-9_]{2,31}$\": {\n \"oneOf\": [\n {\"type\": \"string\", \"maxLength\": 256},\n {\"type\": \"number\"},\n {\"type\": \"boolean\"},\n {\"type\": \"array\", \"items\": {\"type\": \"string\"}, \"maxItems\": 20}\n ]\n }\n },\n \"additionalProperties\": false\n }\n }\n}\n```\n\n---\n\n## 5. SRE Metrics Specification\n\n### 5.1 Service Level Indicators (SLIs)\n\n| Metric Name | Type | Unit | Collection Interval | Aggregation |\n|-------------|------|------|---------------------|-------------|\n| `skusifter_ingestion_latency_seconds` | Histogram | seconds | continuous | p50, p90, p99 |\n| `skusifter_validation_success_ratio` | Gauge | ratio | 10s | avg |\n| `skusifter_classification_throughput` | Counter | SKUs/sec | continuous | rate |\n| `skusifter_routing_decision_latency_ms` | Histogram | milliseconds | continuous | p50, p95, p99 |\n| `skusifter_channel_queue_depth` | Gauge | count | 5s | current |\n| `skusifter_error_rate` | Counter | errors/sec | continuous | rate |\n| `skusifter_scs_distribution` | Histogram | score | continuous | p25, p50, p75 |\n| `skusifter_stale_data_ratio` | Gauge | ratio | 30s | avg |\n| `skusifter_batch_processing_duration_seconds` | Histogram | seconds | per-batch | p50, p99 |\n| `skusifter_memory_utilization_bytes` | Gauge | bytes | 10s | current |\n| `skusifter_db_connection_pool_usage` | Gauge | ratio | 5s | current |\n| `skusifter_external_api_latency_seconds` | Histogram | seconds | continuous | p50, p99 |\n\n### 5.2 Service Level Objectives (SLOs)\n\n| SLO ID | Description | Target | Error Budget (30d) | Burn Rate Alert |\n|--------|-------------|--------|-------------------|-----------------|\n| SLO-001 | Ingestion Latency p99 \u003c 500ms | 99.5% | 3.6 hours | 14.4x (1h), 6x (6h) |\n| SLO-002 | Validation Success Rate | 99.9% | 43.2 minutes | 14.4x (5m), 6x (30m) |\n| SLO-003 | Classification Availability | 99.95% | 21.6 minutes | 14.4x (2m), 6x (15m) |\n| SLO-004 | Routing Decision p99 \u003c 100ms | 99.",
|
|
7
|
+
"outcome": "A-EC-SKUSifter",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "EC",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "routing_decision",
|
|
31
|
+
"type": "String",
|
|
32
|
+
"description": "The primary fulfillment channel (e.g., \"FBA\", \"DTC\").",
|
|
33
|
+
"downstream_intent": "**A-EC-RestockSim** (to adjust inventory logic).",
|
|
34
|
+
"bps_sensitivity": "High"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "sku_composite_object",
|
|
38
|
+
"type": "Object",
|
|
39
|
+
"description": "Nested signal containing `scs_value` and `confidence_index`.",
|
|
40
|
+
"downstream_intent": "**A-CEO-KPISiphon** (for executive health reporting).",
|
|
41
|
+
"bps_sensitivity": "Medium"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "channel_affinity_map",
|
|
45
|
+
"type": "Array",
|
|
46
|
+
"description": "Objects mapping channels to `affinity_score` (0.0-1.0).",
|
|
47
|
+
"downstream_intent": "**A-EC-DynamicPrice** (to apply channel-specific markups).",
|
|
48
|
+
"bps_sensitivity": "Low"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "operational_verdict",
|
|
52
|
+
"type": "String",
|
|
53
|
+
"description": "1-sentence deterministic action (e.g., \"ROUTE_EXPEDITED\").",
|
|
54
|
+
"downstream_intent": "**A-EC-MarginGuard** (to trigger cost-audit on expensive routes).",
|
|
55
|
+
"bps_sensitivity": "High"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/atomics/15.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 15,
|
|
3
|
+
"successBps": 9731,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_EC_DYNAMICPRICE",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-EC-DynamicPrice Technical Specification\n\n## 1. Core Algorithm Logic\n\n### 1.1 Price Calculation Function\n\n```\nP_final = P_base × D_m × S_m × C_m × T_m × E_m\n\nWhere:\n├── P_base = Base product price (USD, float64)\n├── D_m = Demand multiplier ∈ [0.85, 2.50]\n├── S_m = Supply/inventory multiplier ∈ [0.90, 1.80]\n├── C_m = Competition multiplier ∈ [0.75, 1.25]\n├── T_m = Time-decay multiplier ∈ [0.70, 1.15]\n└── E_m = Elasticity multiplier ∈ [0.80, 1.40]\n```\n\n### 1.2 Demand Multiplier Derivation\n\n```\nD_m = 1 + (α × ln(Q_current / Q_baseline))\n\nWhere:\n├── α = Demand sensitivity coefficient = 0.23\n├── Q_current = Current demand velocity (units/hour)\n├── Q_baseline = Historical baseline demand (units/hour, 30-day rolling avg)\n\nBoundary conditions:\n├── IF Q_current / Q_baseline \u003c 0.1 THEN D_m = 0.85\n└── IF Q_current / Q_baseline \u003e 15.0 THEN D_m = 2.50\n```\n\n### 1.3 Supply Multiplier Derivation\n\n```\nS_m = 1 + β × (1 - (I_current / I_optimal))\n\nWhere:\n├── β = Supply sensitivity coefficient = 0.65\n├── I_current = Current inventory level (units)\n├── I_optimal = Optimal inventory threshold (units)\n\nBoundary conditions:\n├── IF I_current ≥ I_optimal × 2.0 THEN S_m = 0.90\n├── IF I_current ≤ I_optimal × 0.05 THEN S_m = 1.80\n└── IF I_current = 0 THEN trigger OUT_OF_STOCK state\n```\n\n### 1.4 Competition Multiplier Derivation\n\n```\nC_m = 1 - γ × ((P_competitor_avg - P_base) / P_base)\n\nWhere:\n├── γ = Competition response coefficient = 0.40\n├── P_competitor_avg = Weighted average competitor price\n\nClamping:\n├── C_m = MAX(0.75, MIN(1.25, C_m))\n```\n\n### 1.5 Time-Decay Multiplier\n\n```\nT_m = 1 - δ × (t_elapsed / t_shelf_life)\n\nWhere:\n├── δ = Time decay coefficient = 0.30\n├── t_elapsed = Time since product listing (hours)\n├── t_shelf_life = Maximum shelf life (hours)\n\nBoundary conditions:\n├── IF t_elapsed / t_shelf_life \u003e 0.95 THEN T_m = 0.70\n└── IF t_elapsed / t_shelf_life \u003c 0.10 THEN T_m = 1.15\n```\n\n### 1.6 Elasticity Multiplier\n\n```\nE_m = 1 + ε × (PED_observed - PED_baseline)\n\nWhere:\n├── ε = Elasticity adjustment factor = 0.18\n├── PED_observed = Observed price elasticity of demand\n├── PED_baseline = Category baseline elasticity\n\nPED_observed = (ΔQ/Q) / (ΔP/P)\n```\n\n---\n\n## 2. Breakdown Point Score (BPS) Matrix\n\n### 2.1 Risk Scoring Formula\n\n```\nBPS_total = Σ(W_i × R_i × I_i)\n\nWhere:\n├── W_i = Weight factor for component i\n├── R_i = Risk probability [0.0, 1.0]\n├── I_i = Impact severity [1, 10]\n```\n\n### 2.2 Component BPS Matrix\n\n| Component ID | Component Name | Weight (W) | Risk Triggers | Impact (I) | BPS Threshold |\n|--------------|----------------|------------|---------------|------------|---------------|\n| BPS-001 | Price Calculation Engine | 0.25 | Latency \u003e 50ms, Error rate \u003e 0.1% | 10 | 2.50 |\n| BPS-002 | Demand Signal Ingestion | 0.20 | Lag \u003e 5s, Data staleness \u003e 60s | 9 | 1.80 |\n| BPS-003 | Inventory Sync Service | 0.18 | Sync delta \u003e 2%, Latency \u003e 200ms | 8 | 1.44 |\n| BPS-004 | Competitor Price Feed | 0.12 | Feed age \u003e 300s, Coverage \u003c 80% | 6 | 0.72 |\n| BPS-005 | ML Elasticity Model | 0.10 | Inference latency \u003e 100ms, Drift \u003e 15% | 7 | 0.70 |\n| BPS-006 | Price Validation Layer | 0.08 | Rejection rate \u003e 5%, False positive \u003e 2% | 8 | 0.64 |\n| BPS-007 | Cache Layer (Redis) | 0.05 | Hit rate \u003c 85%, Eviction rate \u003e 10%/min | 5 | 0.25 |\n| BPS-008 | Database (Price Store) | 0.02 | Query latency \u003e 20ms, Connection pool \u003e 80% | 9 | 0.18 |\n\n### 2.3 BPS Operational States\n\n```\nBPS_total ∈ [0.00, 2.00) → STATE: NOMINAL\nBPS_total ∈ [2.00, 4.00) → STATE: DEGRADED\nBPS_total ∈ [4.00, 6.00) → STATE: CRITICAL\nBPS_total ∈ [6.00, 8.21] → STATE: FAILURE\n\nAction Matrix:\n├── NOMINAL → Continue operations, standard monitoring\n├── DEGRADED → Alert L2, enable fallback pricing, increase sampling\n├── CRITICAL → Page on-call, activate circuit breakers, static pricing mode\n└── FAILURE → Full fallback to cached prices, incident declaration\n```\n\n### 2.4 Cascading Failure Probability\n\n```\nP_cascade = 1 - Π(1 - P_failure_i)^(dependency_depth_i)\n\nCritical Path Dependencies:\n├── Price Engine → Demand Signal → Inventory Sync (depth: 3)\n├── Price Engine → ML Model → Feature Store (depth: 3)\n└── Price Engine → Validation → Database (depth: 3)\n\nIF P_cascade \u003e 0.15 THEN trigger preemptive degradation\n```\n\n---\n\n## 3. JSON Schema for Input Validation\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://schemas.internal/a-ec-dynamicprice/v2.3.0/price-request\",\n \"title\": \"A-EC-DynamicPrice Request Schema\",\n \"type\": \"object\",\n \"required\": [\n \"request_id\",\n \"timestamp\",\n \"product\",\n \"demand_signals\",\n \"inventory_state\",\n \"pricing_context\"\n ],\n \"properties\": {\n \"request_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"pattern\": \"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$\",\n \"description\": \"UUIDv4 request identifier\"\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"ISO 8601 timestamp with timezone\"\n },\n \"product\": {\n \"type\": \"object\",\n \"required\": [\"sku\", \"base_price\", \"category_id\", \"listing_timestamp\"],\n \"properties\": {\n \"sku\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{2,4}-[0-9]{6,12}$\",\n \"minLength\": 9,\n \"maxLength\": 17\n },\n \"base_price\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99,\n \"multipleOf\": 0.01\n },\n \"category_id\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 99999\n },\n \"listing_timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"shelf_life_hours\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 87600,\n \"default\": 8760\n }\n },\n \"additionalProperties\": false\n },\n \"demand_signals\": {\n \"type\": \"object\",\n \"required\": [\"current_velocity\", \"baseline_velocity\"],\n \"properties\": {\n \"current_velocity\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1000000,\n \"description\": \"Units per hour, current\"\n },\n \"baseline_velocity\": {\n \"type\": \"number\",\n \"minimum\": 0.001,\n \"maximum\": 1000000,\n \"description\": \"Units per hour, 30-day rolling average\"\n },\n \"velocity_window_seconds\": {\n \"type\": \"integer\",\n \"minimum\": 60,\n \"maximum\": 3600,\n \"default\": 300\n },\n \"signal_confidence\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"default\": 1.0\n }\n },\n \"additionalProperties\": false\n },\n \"inventory_state\": {\n \"type\": \"object\",\n \"required\": [\"current_units\", \"optimal_units\"],\n \"properties\": {\n \"current_units\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 2147483647\n },\n \"optimal_units\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 2147483647\n },\n \"warehouse_id\": {\n \"type\": \"string\",\n \"pattern\": \"^WH-[A-Z]{2}-[0-9]{4}$\"\n },\n \"last_sync_timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"sync_confidence\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"default\": 1.0\n }\n },\n \"additionalProperties\": false\n },\n \"pricing_context\": {\n \"type\": \"object\",\n \"properties\": {\n \"competitor_prices\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"competitor_id\", \"price\", \"timestamp\"],\n \"properties\": {\n \"competitor_id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 64\n },\n \"price\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"default\": 1.0\n }\n }\n },\n \"maxItems\": 50\n },\n \"elasticity_override\": {\n \"type\": \"object\",\n \"properties\": {\n \"ped_observed\": {\n \"type\": \"number\",\n \"minimum\": -10,\n \"maximum\": 0\n },\n \"ped_baseline\": {\n \"type\": \"number\",\n \"minimum\": -10,\n \"maximum\": 0\n }\n }\n },\n \"price_floor\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99\n },\n \"price_ceiling\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99\n },\n \"margin_floor_percent\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100,\n \"default\": 5.0\n }\n },\n \"additionalProperties\": false\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"client_version\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$\"\n },\n \"trace_id\": {\n \"type\": \"string\",\n \"maxLength\": 128\n },\n \"experiment_ids\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^EXP-[0-9]{6}$\"\n },\n \"maxItems\": 10\n }\n },\n \"additionalProperties\": true\n }\n },\n \"additionalProperties\": false,\n \"if\": {\n \"properties\": {\n \"pricing_context\": {\n \"properties\": {\n \"price_floor\": { \"type\": \"number\" },\n \"price_ceiling\": { \"type\": \"number\" }\n },\n \"required\": [\"price_floor\", \"price_ceiling\"]\n }\n }\n },\n \"then\": {\n \"properties\": {\n \"pricing_context\": {\n \"properties\": {\n \"price_ceiling\": {\n \"exclusiveMinimum\": { \"$data\": \"1/price_floor\" }\n }\n }\n }\n }\n }\n}\n```\n\n### 3.1 Response Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://schemas.internal/a-ec-dynamicprice/v2.3.0/price-response\",\n \"title\": \"A-EC-DynamicPrice Response Schema\",\n \"type\": \"object\",\n \"required\": [\n \"request_id\",\n \"computed_price\",\n \"multipliers\",\n \"computation_metadata\"\n ],\n \"properties\": {\n \"request_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"computed_price\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99\n },\n \"price_applied\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 999999.99,\n \"description\": \"Final price after floor/ceiling constraints\"\n },\n \"multipliers\": {\n \"type\": \"object\",\n \"required\": [\"demand\", \"supply\", \"competition\", \"time_decay\", \"elasticity\"],\n \"properties\": {\n \"demand\": { \"type\": \"number\", \"minimum\": 0.85, \"maximum\": 2.50 },\n \"supply\": { \"type\": \"number\", \"minimum\": 0.90, \"maximum\": 1.80 },\n \"competition\": { \"type\": \"number\", \"minimum\": 0.75, \"maximum\": 1.25 },\n \"time_decay\": { \"type\": \"number\", \"minimum\": 0.70, \"maximum\": 1.15 },\n \"elasticity\": { \"type\": \"number\", \"minimum\": 0.80, \"maximum\": 1.40 },\n \"composite\": { \"type\": \"number\" }\n }\n },\n \"constraints_applied\": {\n \"type\": \"\n```}}}]]]",
|
|
7
|
+
"outcome": "A-EC-DynamicPrice",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "EC",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "price_applied",
|
|
31
|
+
"type": "Float",
|
|
32
|
+
"description": "The final deterministic price to be pushed to the store.",
|
|
33
|
+
"downstream_intent": "**Channel APIs / Storefronts**.",
|
|
34
|
+
"bps_sensitivity": "Critical"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "multiplier_decomposition",
|
|
38
|
+
"type": "Object",
|
|
39
|
+
"description": "Nested values for `demand`, `supply`, and `elasticity`.",
|
|
40
|
+
"downstream_intent": "**A-EC-RestockSim** (to predict velocity shifts).",
|
|
41
|
+
"bps_sensitivity": "Medium"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "constraint_flags",
|
|
45
|
+
"type": "Array",
|
|
46
|
+
"description": "List of bindings hit (e.g., \"MARGIN_FLOOR_TRIGGERED\").",
|
|
47
|
+
"downstream_intent": "**A-EC-MarginGuard** (to verify intervention success).",
|
|
48
|
+
"bps_sensitivity": "High"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "price_validity_ttl",
|
|
52
|
+
"type": "Integer",
|
|
53
|
+
"description": "Seconds until the price must be recalculated.",
|
|
54
|
+
"downstream_intent": "**Synthesis Scheduler** (to queue next execution).",
|
|
55
|
+
"bps_sensitivity": "Low"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/atomics/16.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 16,
|
|
3
|
+
"successBps": 9752,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_EC_RESTOCKSIM",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-EC-RestockSim Technical Logic Specification\n\n## 1. System Overview\n\nA-EC-RestockSim is an automated e-commerce inventory restocking simulation engine designed to model, predict, and optimize replenishment cycles under variable demand conditions.\n\n---\n\n## 2. Core Mathematical Models\n\n### 2.1 Demand Forecasting Function\n\n```\nD(t) = μ_d + σ_d · Z(t) + S(t) + T(t)\n\nWhere:\n D(t) = Demand at time t\n μ_d = Mean historical demand\n σ_d = Demand standard deviation\n Z(t) = Stochastic noise component (normal distribution)\n S(t) = Seasonal adjustment factor\n T(t) = Trend component\n```\n\n### 2.2 Economic Order Quantity (EOQ) with Safety Stock\n\n```\nEOQ = √((2 · D_annual · C_order) / C_hold)\n\nSS = Z_α · σ_d · √(L)\n\nROP = (D_avg · L) + SS\n\nWhere:\n C_order = Cost per order placement\n C_hold = Holding cost per unit per period\n SS = Safety stock\n Z_α = Service level z-score (α = 0.95 → Z = 1.645)\n L = Lead time in periods\n ROP = Reorder point\n```\n\n### 2.3 Inventory Position Function\n\n```\nIP(t) = OH(t) + OO(t) - BO(t)\n\nWhere:\n IP(t) = Inventory position at time t\n OH(t) = On-hand inventory\n OO(t) = On-order inventory\n BO(t) = Backorders\n```\n\n### 2.4 Service Level Calculation\n\n```\nSL = 1 - (Σ Stockout_Events / Σ Demand_Cycles)\n\nFill_Rate = Σ Units_Fulfilled / Σ Units_Demanded\n```\n\n---\n\n## 3. Breakdown Point Score (BPS) Matrix\n\n### 3.1 BPS Calculation Formula\n\n```\nBPS = Σ(W_i · R_i · I_i) / Σ W_i\n\nWhere:\n W_i = Weight factor for risk category i\n R_i = Risk probability (0.0 - 1.0)\n I_i = Impact severity (1 - 10)\n\nCritical Threshold: BPS ≥ 7.0\nWarning Threshold: BPS ≥ 4.5\nNormal: BPS \u003c 4.5\n```\n\n### 3.2 BPS Risk Category Matrix\n\n| Risk ID | Category | Weight (W) | Risk Indicators | Impact Range |\n|---------|----------|------------|-----------------|--------------|\n| BPS-001 | Supplier Failure | 0.25 | Lead time variance \u003e 2σ | 8-10 |\n| BPS-002 | Demand Spike | 0.20 | D(t) \u003e μ + 3σ | 6-9 |\n| BPS-003 | Inventory Depletion | 0.20 | OH(t) \u003c SS | 7-10 |\n| BPS-004 | System Latency | 0.10 | API response \u003e P99 | 4-7 |\n| BPS-005 | Data Integrity | 0.10 | Checksum failures \u003e 0.1% | 8-10 |\n| BPS-006 | Forecast Drift | 0.08 | MAPE \u003e 25% | 5-8 |\n| BPS-007 | Order Processing | 0.07 | Queue depth \u003e 10K | 3-6 |\n\n### 3.3 BPS Escalation Logic\n\n```python\ndef calculate_bps(risk_events: list[dict]) -\u003e float:\n total_weighted_score = 0.0\n total_weight = 0.0\n \n for event in risk_events:\n w = event[\"weight\"]\n r = event[\"probability\"]\n i = event[\"impact\"]\n total_weighted_score += w * r * i\n total_weight += w\n \n return total_weighted_score / total_weight if total_weight \u003e 0 else 0.0\n\ndef get_bps_status(bps: float) -\u003e str:\n if bps \u003e= 7.0:\n return \"CRITICAL\" # Trigger incident, halt simulation\n elif bps \u003e= 4.5:\n return \"WARNING\" # Alert on-call, increase monitoring\n else:\n return \"NORMAL\" # Continue operations\n```\n\n---\n\n## 4. JSON Schema for Input Validation\n\n### 4.1 Simulation Configuration Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://a-ec-restocksim/schemas/simulation-config.json\",\n \"title\": \"A-EC-RestockSim Configuration\",\n \"type\": \"object\",\n \"required\": [\"simulation_id\", \"time_horizon\", \"products\", \"suppliers\", \"parameters\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"simulation_id\": {\n \"type\": \"string\",\n \"pattern\": \"^SIM-[A-Z0-9]{8}-[0-9]{6}$\",\n \"description\": \"Unique simulation identifier\"\n },\n \"time_horizon\": {\n \"type\": \"object\",\n \"required\": [\"start_epoch\", \"end_epoch\", \"granularity_seconds\"],\n \"properties\": {\n \"start_epoch\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"end_epoch\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"granularity_seconds\": {\n \"type\": \"integer\",\n \"enum\": [3600, 86400, 604800],\n \"description\": \"Hourly, Daily, or Weekly\"\n }\n }\n },\n \"products\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 10000,\n \"items\": {\n \"$ref\": \"#/$defs/product\"\n }\n },\n \"suppliers\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 500,\n \"items\": {\n \"$ref\": \"#/$defs/supplier\"\n }\n },\n \"parameters\": {\n \"$ref\": \"#/$defs/simulation_parameters\"\n }\n },\n \"$defs\": {\n \"product\": {\n \"type\": \"object\",\n \"required\": [\"sku\", \"initial_stock\", \"unit_cost\", \"demand_profile\"],\n \"properties\": {\n \"sku\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{2,4}-[0-9]{6,10}$\"\n },\n \"initial_stock\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 10000000\n },\n \"unit_cost\": {\n \"type\": \"number\",\n \"minimum\": 0.01,\n \"maximum\": 1000000.00,\n \"multipleOf\": 0.01\n },\n \"demand_profile\": {\n \"type\": \"object\",\n \"required\": [\"mean\", \"std_dev\", \"seasonality_coefficients\"],\n \"properties\": {\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"std_dev\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"seasonality_coefficients\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 5\n },\n \"minItems\": 12,\n \"maxItems\": 12\n }\n }\n },\n \"reorder_policy\": {\n \"type\": \"string\",\n \"enum\": [\"EOQ\", \"FIXED_QUANTITY\", \"PERIODIC_REVIEW\", \"MIN_MAX\"]\n }\n }\n },\n \"supplier\": {\n \"type\": \"object\",\n \"required\": [\"supplier_id\", \"lead_time_days\", \"reliability_score\"],\n \"properties\": {\n \"supplier_id\": {\n \"type\": \"string\",\n \"pattern\": \"^SUP-[0-9]{5}$\"\n },\n \"lead_time_days\": {\n \"type\": \"object\",\n \"required\": [\"mean\", \"std_dev\"],\n \"properties\": {\n \"mean\": {\n \"type\": \"number\",\n \"minimum\": 0.5,\n \"maximum\": 180\n },\n \"std_dev\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 30\n }\n }\n },\n \"reliability_score\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"order_cost\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"minimum_order_quantity\": {\n \"type\": \"integer\",\n \"minimum\": 1\n }\n }\n },\n \"simulation_parameters\": {\n \"type\": \"object\",\n \"required\": [\"service_level_target\", \"holding_cost_rate\", \"stockout_cost_rate\"],\n \"properties\": {\n \"service_level_target\": {\n \"type\": \"number\",\n \"minimum\": 0.80,\n \"maximum\": 0.9999\n },\n \"holding_cost_rate\": {\n \"type\": \"number\",\n \"minimum\": 0.001,\n \"maximum\": 1.0,\n \"description\": \"Annual holding cost as fraction of unit cost\"\n },\n \"stockout_cost_rate\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Cost per unit stockout\"\n },\n \"monte_carlo_iterations\": {\n \"type\": \"integer\",\n \"minimum\": 100,\n \"maximum\": 100000,\n \"default\": 1000\n },\n \"random_seed\": {\n \"type\": \"integer\",\n \"minimum\": 0\n }\n }\n }\n }\n}\n```\n\n### 4.2 Output Event Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://a-ec-restocksim/schemas/simulation-event.json\",\n \"title\": \"Simulation Event Output\",\n \"type\": \"object\",\n \"required\": [\"event_id\", \"timestamp\", \"event_type\", \"payload\"],\n \"properties\": {\n \"event_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"event_type\": {\n \"type\": \"string\",\n \"enum\": [\n \"REORDER_TRIGGERED\",\n \"STOCK_RECEIVED\",\n \"STOCKOUT_OCCURRED\",\n \"DEMAND_FULFILLED\",\n \"SIMULATION_TICK\",\n \"BPS_THRESHOLD_BREACH\"\n ]\n },\n \"payload\": {\n \"type\": \"object\"\n },\n \"bps_snapshot\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 10\n }\n }\n}\n```\n\n---\n\n## 5. SRE Metrics Specification\n\n### 5.1 Service Level Objectives (SLOs)\n\n| Metric | Target | Measurement Window | Burn Rate Alert |\n|--------|--------|-------------------|-----------------|\n| Simulation Availability | 99.9% | 30-day rolling | 14.4x (1h), 6x (6h) |\n| API Latency P50 | ≤ 50ms | 5-minute | N/A |\n| API Latency P95 | ≤ 200ms | 5-minute | N/A |\n| API Latency P99 | ≤ 500ms | 5-minute | 2x threshold |\n| Simulation Accuracy | MAPE ≤ 15% | Per simulation run | N/A |\n| Data Consistency | 99.99% | Continuous | Any violation |\n\n### 5.2 Service Level Indicators (SLIs)\n\n```yaml\nslis:\n availability:\n formula: \"(successful_requests / total_requests) * 100\"\n good_event: \"response_code \u003c 500 AND response_time \u003c 30s\"\n \n latency:\n formula: \"histogram_quantile(0.99, request_duration_seconds)\"\n buckets: [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0]\n \n simulation_throughput:\n formula: \"rate(simulation_ticks_total[5m])\"\n target: \"\u003e= 1000 ticks/second per instance\"\n \n error_rate:\n formula: \"rate(simulation_errors_total[5m]) / rate(simulation_ticks_total[5m])\"\n threshold: \"\u003c 0.001\"\n```\n\n### 5.3 Key Performance Indicators (KPIs)\n\n```\n┌─────────────────────────────────────────────────────────────────â”\n│ OPERATIONAL KPIs │\n├─────────────────────────┬───────────────┬───────────────────────┤\n│ Metric │ Target │ Critical Threshold │\n├─────────────────────────┼───────────────┼───────────────────────┤\n│ Mean Time to Detect │ ≤ 5 min │ \u003e 15 min │\n│ Mean Time to Resolve │ ≤ 30 min │ \u003e 2 hours │\n│ Change Failure Rate │ ≤ 5% │ \u003e 15% │\n│ Deployment Frequency │ ≥ 1/day │ \u003c 1/week │\n│ Error Budget Remaining │ ≥ 50% │ \u003c 10% │\n└─────────────────────────┴───────────────┴───────────────────────┘\n```\n\n### 5.4 Prometheus Metrics Definition\n\n```promql\n# Simulation Core Metrics\nsimulation_ticks_total{simulation_id, status}\nsimulation_duration_seconds{simulation_id, quantile}\ninventory_position_units{sku, warehouse}\nreorder_events_total{sku, supplier_id, trigger_type}\nstockout_events_total{sku, warehouse}\ndemand_fulfilled_units_total{sku}\ndemand_requested_units_total{sku}\n\n# BPS Metrics\nbps_current_score{simulation_id}\nbps_risk_category_score{simulation_id, risk_id}\nbps_threshold_breaches_total{simulation_id, severity}\n\n# System Health Metrics\nsimulation_queue_depth{priority}\nsimulation_worker_utilization{worker_id}\napi_request_duration_seconds{endpoint, method, status}\ndatabase_query_duration_seconds{query_type}\ncache_hit_ratio{cache_name}\n```\n\n### 5.5 Alerting Rules\n\n```yaml\ngroups:\n - name: a-ec-restocksim-critical\n rules:\n - alert: BPSCriticalThreshold\n expr: bps_current_score \u003e= 7.0\n for: 1m\n labels:\n severity: critical\n annotations:\n summary: \"BPS score critical: {{ $value }}\"\n \n - alert: SimulationAvailabilityBreach\n expr: |\n (\n sum(rate(simulation_ticks_total{status=\"success\"}[5m]))\n /\n sum(rate(simulation_ticks_total[5m]))\n ) \u003c 0.999\n for: 5m\n labels:\n severity\n```",
|
|
7
|
+
"outcome": "A-EC-RestockSim",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "EC",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "replenishment_triggers",
|
|
31
|
+
"type": "Array",
|
|
32
|
+
"description": "List of SKU-Supplier pairs requiring immediate orders.",
|
|
33
|
+
"downstream_intent": "**ERP/WMS Integration Ports**.",
|
|
34
|
+
"bps_sensitivity": "High"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "service_level_forecast",
|
|
38
|
+
"type": "Float",
|
|
39
|
+
"description": "Predicted fill rate (0.0-1.0) for the next horizon.",
|
|
40
|
+
"downstream_intent": "**A-CEO-KPISiphon** (Customer Satisfaction KPI).",
|
|
41
|
+
"bps_sensitivity": "Medium"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "inventory_tail_risk",
|
|
45
|
+
"type": "Object",
|
|
46
|
+
"description": "Hierarchical data on stockout probability and lead-time variance.",
|
|
47
|
+
"downstream_intent": "**A-EC-DynamicPrice** (to increase prices on low stock).",
|
|
48
|
+
"bps_sensitivity": "High"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "sim_diagnostic_verdict",
|
|
52
|
+
"type": "String",
|
|
53
|
+
"description": "\"NORMAL\", \"WARNING\", or \"CRITICAL_HALT\".",
|
|
54
|
+
"downstream_intent": "**Sentinel Audit System**.",
|
|
55
|
+
"bps_sensitivity": "Critical"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/atomics/17.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 17,
|
|
3
|
+
"successBps": 9635,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_HR_OUTCOMEEXTRACT",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-HR-OutcomeExtract Technical Specification\n\n## System Overview\n\nA-HR-OutcomeExtract is an automated pipeline for extracting, validating, and scoring HR outcome data from heterogeneous source systems with deterministic failure handling.\n\n---\n\n## Core Logic Block\n\n### 1. Input Validation JSON Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"a-hr-outcome-extract-input-v1\",\n \"type\": \"object\",\n \"required\": [\"extraction_id\", \"source_system\", \"timestamp\", \"payload\"],\n \"properties\": {\n \"extraction_id\": {\n \"type\": \"string\",\n \"pattern\": \"^EXT-[A-Z]{2}-[0-9]{8}-[A-F0-9]{12}$\"\n },\n \"source_system\": {\n \"type\": \"string\",\n \"enum\": [\"WORKDAY\", \"SAP_HCM\", \"ORACLE_HCM\", \"ADP\", \"CUSTOM_HRIS\"]\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"payload\": {\n \"type\": \"object\",\n \"required\": [\"employee_records\", \"outcome_type\", \"period\"],\n \"properties\": {\n \"employee_records\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 100000,\n \"items\": {\n \"$ref\": \"#/$defs/employee_outcome\"\n }\n },\n \"outcome_type\": {\n \"type\": \"string\",\n \"enum\": [\"PERFORMANCE\", \"COMPENSATION\", \"TERMINATION\", \"PROMOTION\", \"TRANSFER\", \"ONBOARDING\"]\n },\n \"period\": {\n \"type\": \"object\",\n \"required\": [\"start\", \"end\"],\n \"properties\": {\n \"start\": {\"type\": \"string\", \"format\": \"date\"},\n \"end\": {\"type\": \"string\", \"format\": \"date\"}\n }\n }\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"retry_count\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 5},\n \"priority\": {\"type\": \"integer\", \"minimum\": 1, \"maximum\": 10},\n \"checksum\": {\"type\": \"string\", \"pattern\": \"^[a-f0-9]{64}$\"}\n }\n }\n },\n \"$defs\": {\n \"employee_outcome\": {\n \"type\": \"object\",\n \"required\": [\"employee_id\", \"outcome_value\", \"effective_date\"],\n \"properties\": {\n \"employee_id\": {\n \"type\": \"string\",\n \"pattern\": \"^EMP[0-9]{9}$\"\n },\n \"outcome_value\": {\n \"oneOf\": [\n {\"type\": \"number\"},\n {\"type\": \"string\", \"maxLength\": 500},\n {\"type\": \"object\"}\n ]\n },\n \"effective_date\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"confidence_score\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n }\n }\n }\n }\n}\n```\n\n---\n\n### 2. Breakdown Point Score (BPS) Matrix\n\n#### 2.1 BPS Calculation Formula\n\n```\nBPS = Σ(Wi × Fi × Si) / N\n\nWhere:\n Wi = Weight factor for failure category i (0.1 - 1.0)\n Fi = Frequency coefficient (occurrences per 10,000 operations)\n Si = Severity multiplier (1 = low, 5 = critical)\n N = Normalization constant (sum of all weights)\n```\n\n#### 2.2 Operational Failure Risk Matrix\n\n| Failure Category | Code | Weight (Wi) | Base Frequency (Fi) | Severity (Si) | BPS Contribution | Threshold |\n|-----------------|------|-------------|---------------------|---------------|------------------|-----------|\n| Schema Validation Failure | SVF-001 | 0.85 | 12.5 | 3 | 31.875 | ≤ 50 |\n| Source Connection Timeout | SCT-002 | 0.95 | 8.2 | 4 | 31.16 | ≤ 40 |\n| Data Integrity Violation | DIV-003 | 1.00 | 3.1 | 5 | 15.50 | ≤ 20 |\n| Transformation Logic Error | TLE-004 | 0.90 | 5.7 | 4 | 20.52 | ≤ 30 |\n| Downstream Write Failure | DWF-005 | 0.80 | 2.3 | 5 | 9.20 | ≤ 15 |\n| Authentication Expiry | AEX-006 | 0.70 | 15.8 | 2 | 22.12 | ≤ 35 |\n| Rate Limit Exceeded | RLE-007 | 0.60 | 22.4 | 2 | 26.88 | ≤ 40 |\n| Memory Exhaustion | MEX-008 | 0.95 | 1.2 | 5 | 5.70 | ≤ 10 |\n| Checksum Mismatch | CSM-009 | 1.00 | 0.8 | 5 | 4.00 | ≤ 5 |\n| Partial Extraction | PEX-010 | 0.75 | 6.9 | 3 | 15.525 | ≤ 25 |\n\n#### 2.3 Aggregate BPS Scoring\n\n```\nTotal_BPS = Σ(BPS_i) for all active failure categories\n\nRisk Classification:\n 0-50: NOMINAL (Green)\n 51-100: ELEVATED (Yellow)\n 101-150: DEGRADED (Orange)\n 151-200: CRITICAL (Red)\n \u003e200: BREAKDOWN (Black) → Circuit breaker activation\n```\n\n#### 2.4 BPS Decay Function\n\n```python\ndef calculate_bps_decay(initial_bps: float, time_since_incident_hours: float) -\u003e float:\n \"\"\"\n Exponential decay of BPS contribution over time\n Half-life: 24 hours for non-critical, 72 hours for critical\n \"\"\"\n lambda_decay = 0.693 / (72 if initial_bps \u003e 15 else 24)\n return initial_bps * math.exp(-lambda_decay * time_since_incident_hours)\n```\n\n---\n\n### 3. Extraction Logic State Machine\n\n```\n┌─────────────â”\n│ IDLE │\n└──────┬──────┘\n │ trigger_extraction()\n â–¼\n┌─────────────┠validation_failed\n│ VALIDATING │────────────────────────â”\n└──────┬──────┘ │\n │ schema_valid │\n â–¼ â–¼\n┌─────────────┠┌─────────────â”\n│ CONNECTING │ │ REJECTED │\n└──────┬──────┘ └─────────────┘\n │ connection_established\n â–¼\n┌─────────────┠extraction_error\n│ EXTRACTING │────────────────────────â”\n└──────┬──────┘ │\n │ data_received │\n â–¼ â–¼\n┌─────────────┠┌─────────────â”\n│ TRANSFORMING│ │ FAILED │\n└──────┬──────┘ └──────┬──────┘\n │ transform_complete │ retry_eligible\n â–¼ â–¼\n┌─────────────┠┌─────────────â”\n│ LOADING │ │ RETRYING │──â”\n└──────┬──────┘ └─────────────┘ │\n │ load_complete â–² │\n â–¼ └─────────┘\n┌─────────────â”\n│ COMPLETE │\n└─────────────┘\n```\n\n---\n\n### 4. SRE Metrics Specification\n\n#### 4.1 Service Level Indicators (SLIs)\n\n| Metric Name | Type | Formula | Unit |\n|-------------|------|---------|------|\n| `extraction_latency_p50` | Latency | percentile(extraction_duration, 0.50) | ms |\n| `extraction_latency_p95` | Latency | percentile(extraction_duration, 0.95) | ms |\n| `extraction_latency_p99` | Latency | percentile(extraction_duration, 0.99) | ms |\n| `extraction_success_rate` | Availability | successful_extractions / total_extractions | ratio |\n| `record_throughput` | Throughput | records_processed / time_window | records/s |\n| `data_freshness` | Freshness | now() - max(record_timestamp) | seconds |\n| `validation_pass_rate` | Quality | valid_records / total_records | ratio |\n| `error_budget_remaining` | Budget | 1 - (errors / allowed_errors) | ratio |\n\n#### 4.2 Service Level Objectives (SLOs)\n\n```yaml\nslos:\n availability:\n target: 99.95\n window: 30d\n burn_rate_alerts:\n - severity: critical\n burn_rate: 14.4\n window: 1h\n - severity: warning\n burn_rate: 6.0\n window: 6h\n \n latency:\n p50_target_ms: 500\n p95_target_ms: 2000\n p99_target_ms: 5000\n \n throughput:\n minimum_records_per_second: 1000\n burst_capacity_multiplier: 3.0\n \n data_quality:\n validation_pass_rate: 99.9\n checksum_match_rate: 100.0\n \n freshness:\n max_staleness_seconds: 300\n alerting_threshold_seconds: 180\n```\n\n#### 4.3 Prometheus Metrics Export\n\n```prometheus\n# HELP a_hr_outcome_extract_duration_seconds Time spent extracting HR outcomes\n# TYPE a_hr_outcome_extract_duration_seconds histogram\na_hr_outcome_extract_duration_seconds_bucket{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\",le=\"0.5\"} 2341\na_hr_outcome_extract_duration_seconds_bucket{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\",le=\"1.0\"} 4521\na_hr_outcome_extract_duration_seconds_bucket{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\",le=\"2.0\"} 4892\na_hr_outcome_extract_duration_seconds_bucket{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\",le=\"5.0\"} 4978\na_hr_outcome_extract_duration_seconds_bucket{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\",le=\"+Inf\"} 5000\na_hr_outcome_extract_duration_seconds_sum{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\"} 3421.5\na_hr_outcome_extract_duration_seconds_count{source=\"WORKDAY\",outcome_type=\"PERFORMANCE\"} 5000\n\n# HELP a_hr_outcome_extract_records_total Total records processed\n# TYPE a_hr_outcome_extract_records_total counter\na_hr_outcome_extract_records_total{source=\"WORKDAY\",status=\"success\"} 4987234\na_hr_outcome_extract_records_total{source=\"WORKDAY\",status=\"failed\"} 1523\na_hr_outcome_extract_records_total{source=\"WORKDAY\",status=\"skipped\"} 892\n\n# HELP a_hr_outcome_extract_bps_score Current Breakdown Point Score\n# TYPE a_hr_outcome_extract_bps_score gauge\na_hr_outcome_extract_bps_score{failure_category=\"SVF-001\"} 12.5\na_hr_outcome_extract_bps_score{failure_category=\"SCT-002\"} 8.2\na_hr_outcome_extract_bps_score{failure_category=\"total\"} 87.3\n\n# HELP a_hr_outcome_extract_error_budget_remaining Remaining error budget ratio\n# TYPE a_hr_outcome_extract_error_budget_remaining gauge\na_hr_outcome_extract_error_budget_remaining{slo=\"availability\"} 0.73\na_hr_outcome_extract_error_budget_remaining{slo=\"latency\"} 0.91\n```\n\n#### 4.4 Alerting Rules\n\n```yaml\ngroups:\n - name: a-hr-outcome-extract\n rules:\n - alert: HighBPSScore\n expr: a_hr_outcome_extract_bps_score{failure_category=\"total\"} \u003e 150\n for: 5m\n labels:\n severity: critical\n annotations:\n summary: \"BPS score critical: {{ $value }}\"\n \n - alert: ErrorBudgetBurnRate\n expr: |\n (\n sum(rate(a_hr_outcome_extract_records_total{status=\"failed\"}[1h]))\n /\n sum(rate(a_hr_outcome_extract_records_total[1h]))\n ) \u003e (14.4 * 0.0005)\n for: 2m\n labels:\n severity: critical\n \n - alert: ExtractionLatencyHigh\n expr: |\n histogram_quantile(0.99, \n rate(a_hr_outcome_extract_duration_seconds_bucket[5m])\n ) \u003e 5\n for: 10m\n labels:\n severity: warning\n \n - alert: DataStaleness\n expr: a_hr_outcome_extract_data_freshness_seconds \u003e 300\n for: 5m\n labels:\n severity: warning\n```\n\n---\n\n### 5. Circuit Breaker Logic\n\n```python\nclass CircuitBreaker:\n CLOSED = \"CLOSED\"\n OPEN = \"OPEN\"\n HALF_OPEN = \"HALF_OPEN\"\n \n def __init__(self):\n self.state = self.CLOSED\n self.failure_count = 0\n self.success_count = 0\n self.last_failure_time = None\n \n # Thresholds\n self.failure_threshold = 5\n self.success_threshold = 3\n self.timeout_seconds = 60\n self.bps_threshold = 200\n \n def evaluate(self, bps_score: float, operation_result: bool) -\u003e str:\n if bps_score \u003e self.bps_threshold:\n self._trip()\n return self.OPEN\n \n if self.state == self.CLOSED:\n if not operation_result:\n self.failure_count += 1\n if self.failure_count \u003e= self.failure_threshold:\n self._trip()\n else:\n self.failure_count = 0\n \n elif self.state == self.OPEN:\n if self._timeout_elapsed():\n self.state = self.HALF_OPEN\n self.success_count = 0\n \n elif self.state == self.HALF_OPEN:\n if operation_result:\n self.success_count += 1\n if self.success_count \u003e= self.success_threshold:\n self._reset()\n else:\n self._trip()\n \n return self.state\n \n def _trip(self):\n self.state = self.OPEN\n self.last_failure_time = time.time()\n self.failure_count = 0\n \n def _reset(self):\n self.state = self.CLOSED\n self.failure_count = 0\n self.\n```",
|
|
7
|
+
"outcome": "A-HR-OutcomeExtract",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "HR",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "extraction_summary",
|
|
31
|
+
"type": "Object",
|
|
32
|
+
"description": "High-level counters of records processed, validated, and loaded.",
|
|
33
|
+
"downstream_intent": "A-CEO-KPISiphon",
|
|
34
|
+
"bps_sensitivity": "Yes"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "outcome_payload_pointer",
|
|
38
|
+
"type": "String",
|
|
39
|
+
"description": "Data_source_id for the normalized record set in the warehouse.",
|
|
40
|
+
"downstream_intent": "A-COO-WorkflowMapper",
|
|
41
|
+
"bps_sensitivity": "No"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "integrity_receipt",
|
|
45
|
+
"type": "Object",
|
|
46
|
+
"description": "Contains `checksum_match` (Boolean) and `validation_pass_rate` (Float).",
|
|
47
|
+
"downstream_intent": "Compliance Auditor",
|
|
48
|
+
"bps_sensitivity": "Yes"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "operational_sli_metrics",
|
|
52
|
+
"type": "Object",
|
|
53
|
+
"description": "Latency p95, throughput (records/s), and circuit breaker state.",
|
|
54
|
+
"downstream_intent": "SRE / Infrastructure",
|
|
55
|
+
"bps_sensitivity": "No"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/atomics/18.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 18,
|
|
3
|
+
"successBps": 9917,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_HR_BIASGUARD",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-HR-BiasGuard Technical Logic Specification\n\n## 1. System Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────────â”\n│ A-HR-BiasGuard Core Engine │\n├─────────────────────────────────────────────────────────────────────┤\n│ ┌─────────────┠┌─────────────┠┌─────────────┠┌─────────────┠│\n│ │ Ingestion │──│ Bias │──│ Fairness │──│ Decision │ │\n│ │ Layer │ │ Detection │ │ Scoring │ │ Gateway │ │\n│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │\n│ │ │ │ │ │\n│ â–¼ â–¼ â–¼ â–¼ │\n│ ┌─────────────────────────────────────────────────────────────────â”│\n│ │ Audit \u0026 Observability Layer ││\n│ └─────────────────────────────────────────────────────────────────┘│\n└─────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## 2. Breakdown Point Score (BPS) Matrix\n\n### 2.1 BPS Calculation Formula\n\n```\nBPS = Σ(Wáµ¢ × Ráµ¢ × Iáµ¢) / N\n\nWhere:\n Wáµ¢ = Weight factor for component i (0.0 - 1.0)\n Ráµ¢ = Risk probability for component i (0.0 - 1.0)\n Iáµ¢ = Impact severity for component i (1 - 10)\n N = Normalization constant = Σ(Wáµ¢ × 10)\n```\n\n### 2.2 Component Risk Matrix\n\n| Component ID | Component Name | Weight (Wáµ¢) | Risk Threshold | Impact (Iáµ¢) | BPS Contribution |\n|--------------|----------------|-------------|----------------|-------------|------------------|\n| C-001 | Data Ingestion Pipeline | 0.85 | R ≥ 0.15 | 9 | `0.85 × R × 9` |\n| C-002 | Feature Extraction Engine | 0.90 | R ≥ 0.10 | 10 | `0.90 × R × 10` |\n| C-003 | Bias Detection Model | 0.95 | R ≥ 0.05 | 10 | `0.95 × R × 10` |\n| C-004 | Fairness Scoring Module | 0.92 | R ≥ 0.08 | 9 | `0.92 × R × 9` |\n| C-005 | Decision Gateway | 0.88 | R ≥ 0.12 | 8 | `0.88 × R × 8` |\n| C-006 | Audit Logger | 0.75 | R ≥ 0.20 | 7 | `0.75 × R × 7` |\n| C-007 | Model Drift Detector | 0.80 | R ≥ 0.18 | 8 | `0.80 × R × 8` |\n| C-008 | Protected Class Validator | 0.93 | R ≥ 0.07 | 10 | `0.93 × R × 10` |\n\n### 2.3 BPS Severity Classification\n\n```\nBPS_SEVERITY = {\n \"NOMINAL\": BPS \u003c 0.15,\n \"ELEVATED\": 0.15 ≤ BPS \u003c 0.35,\n \"WARNING\": 0.35 ≤ BPS \u003c 0.55,\n \"CRITICAL\": 0.55 ≤ BPS \u003c 0.75,\n \"BREAKDOWN\": BPS ≥ 0.75\n}\n```\n\n### 2.4 Failure Mode Analysis\n\n```python\nFAILURE_MODES = {\n \"FM-001\": {\n \"name\": \"Disparate Impact Threshold Breach\",\n \"trigger\": \"DI_ratio \u003c 0.80 OR DI_ratio \u003e 1.25\",\n \"bps_impact\": 0.45,\n \"mttr_target_minutes\": 15,\n \"escalation_path\": [\"L2-SRE\", \"ML-Ethics-Team\", \"Legal\"]\n },\n \"FM-002\": {\n \"name\": \"Protected Attribute Leakage\",\n \"trigger\": \"feature_importance(protected_attr) \u003e 0.05\",\n \"bps_impact\": 0.65,\n \"mttr_target_minutes\": 5,\n \"escalation_path\": [\"L3-SRE\", \"CISO\", \"Legal\"]\n },\n \"FM-003\": {\n \"name\": \"Model Drift Beyond Tolerance\",\n \"trigger\": \"PSI \u003e 0.25 OR KL_divergence \u003e 0.10\",\n \"bps_impact\": 0.35,\n \"mttr_target_minutes\": 30,\n \"escalation_path\": [\"L2-SRE\", \"ML-Ops\"]\n },\n \"FM-004\": {\n \"name\": \"Audit Trail Discontinuity\",\n \"trigger\": \"audit_gap_seconds \u003e 300\",\n \"bps_impact\": 0.40,\n \"mttr_target_minutes\": 10,\n \"escalation_path\": [\"L2-SRE\", \"Compliance\"]\n },\n \"FM-005\": {\n \"name\": \"Fairness Score Degradation\",\n \"trigger\": \"Δfairness_score \u003e 0.15 over 24h\",\n \"bps_impact\": 0.50,\n \"mttr_target_minutes\": 60,\n \"escalation_path\": [\"L2-SRE\", \"ML-Ethics-Team\"]\n }\n}\n```\n\n---\n\n## 3. JSON Schema for Input Validation\n\n### 3.1 Candidate Evaluation Request Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://a-hr-biasguard.internal/schemas/candidate-evaluation-request.json\",\n \"title\": \"CandidateEvaluationRequest\",\n \"type\": \"object\",\n \"required\": [\n \"request_id\",\n \"timestamp\",\n \"candidate_data\",\n \"evaluation_context\",\n \"audit_metadata\"\n ],\n \"properties\": {\n \"request_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"description\": \"Unique identifier for request tracing\"\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"ISO 8601 timestamp of request initiation\"\n },\n \"schema_version\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$\",\n \"default\": \"2.1.0\"\n },\n \"candidate_data\": {\n \"type\": \"object\",\n \"required\": [\"candidate_id\", \"features\"],\n \"properties\": {\n \"candidate_id\": {\n \"type\": \"string\",\n \"minLength\": 8,\n \"maxLength\": 64,\n \"pattern\": \"^[A-Za-z0-9-_]+$\"\n },\n \"features\": {\n \"type\": \"object\",\n \"required\": [\"experience_years\", \"education_level\", \"skills\"],\n \"properties\": {\n \"experience_years\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 60\n },\n \"education_level\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 8,\n \"description\": \"1=None, 2=HS, 3=Associate, 4=Bachelor, 5=Master, 6=PhD, 7=PostDoc, 8=Other\"\n },\n \"skills\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"skill_id\", \"proficiency\"],\n \"properties\": {\n \"skill_id\": {\n \"type\": \"string\",\n \"pattern\": \"^SKL-[0-9]{6}$\"\n },\n \"proficiency\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"years_experience\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"verified\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n },\n \"minItems\": 1,\n \"maxItems\": 100\n },\n \"certifications\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"cert_id\": {\"type\": \"string\"},\n \"issue_date\": {\"type\": \"string\", \"format\": \"date\"},\n \"expiry_date\": {\"type\": \"string\", \"format\": \"date\"},\n \"verified\": {\"type\": \"boolean\"}\n }\n }\n }\n },\n \"additionalProperties\": false\n },\n \"protected_attributes_hash\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-f0-9]{64}$\",\n \"description\": \"SHA-256 hash for audit without exposure\"\n }\n },\n \"additionalProperties\": false\n },\n \"evaluation_context\": {\n \"type\": \"object\",\n \"required\": [\"job_requisition_id\", \"evaluation_stage\"],\n \"properties\": {\n \"job_requisition_id\": {\n \"type\": \"string\",\n \"pattern\": \"^REQ-[0-9]{4}-[0-9]{6}$\"\n },\n \"evaluation_stage\": {\n \"type\": \"string\",\n \"enum\": [\n \"RESUME_SCREEN\",\n \"INITIAL_ASSESSMENT\",\n \"TECHNICAL_EVALUATION\",\n \"BEHAVIORAL_ASSESSMENT\",\n \"FINAL_REVIEW\",\n \"OFFER_DECISION\"\n ]\n },\n \"evaluator_id\": {\n \"type\": \"string\",\n \"pattern\": \"^EMP-[0-9]{8}$\"\n },\n \"department_code\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{2,5}-[0-9]{3}$\"\n },\n \"urgency_level\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 5,\n \"default\": 3\n }\n }\n },\n \"audit_metadata\": {\n \"type\": \"object\",\n \"required\": [\"source_system\", \"correlation_id\"],\n \"properties\": {\n \"source_system\": {\n \"type\": \"string\",\n \"enum\": [\"ATS_PRIMARY\", \"ATS_SECONDARY\", \"MANUAL_ENTRY\", \"API_INTEGRATION\"]\n },\n \"correlation_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"session_id\": {\n \"type\": \"string\"\n },\n \"client_ip_hash\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-f0-9]{64}$\"\n },\n \"consent_token\": {\n \"type\": \"string\",\n \"minLength\": 32\n }\n }\n },\n \"bias_check_config\": {\n \"type\": \"object\",\n \"properties\": {\n \"enabled_checks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISPARATE_IMPACT\",\n \"DEMOGRAPHIC_PARITY\",\n \"EQUALIZED_ODDS\",\n \"CALIBRATION\",\n \"INDIVIDUAL_FAIRNESS\",\n \"COUNTERFACTUAL_FAIRNESS\"\n ]\n },\n \"default\": [\"DISPARATE_IMPACT\", \"DEMOGRAPHIC_PARITY\", \"EQUALIZED_ODDS\"]\n },\n \"threshold_overrides\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n }\n },\n \"strict_mode\": {\n \"type\": \"boolean\",\n \"default\": true\n }\n }\n }\n },\n \"additionalProperties\": false\n}\n```\n\n### 3.2 Bias Detection Response Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://a-hr-biasguard.internal/schemas/bias-detection-response.json\",\n \"title\": \"BiasDetectionResponse\",\n \"type\": \"object\",\n \"required\": [\n \"response_id\",\n \"request_id\",\n \"timestamp\",\n \"processing_time_ms\",\n \"bias_analysis\",\n \"decision\",\n \"audit_record\"\n ],\n \"properties\": {\n \"response_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"request_id\": {\n \"type\": \"string\",\n \"format\": \"uuid\"\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"processing_time_ms\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"bias_analysis\": {\n \"type\": \"object\",\n \"required\": [\"overall_fairness_score\", \"metrics\", \"flags\"],\n \"properties\": {\n \"overall_fairness_score\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n },\n \"confidence_interval\": {\n \"type\": \"object\",\n \"properties\": {\n \"lower\": {\"type\": \"number\"},\n \"upper\": {\"type\": \"number\"},\n \"confidence_level\": {\"type\": \"number\"}\n }\n },\n \"metrics\": {\n \"type\": \"object\",\n \"properties\": {\n \"disparate_impact_ratio\": {\n \"type\": \"number\",\n \"minimum\": 0.0\n },\n \"demographic_parity_difference\": {\n \"type\": \"number\"\n },\n \"equalized_odds_difference\": {\n \"type\": \"number\"\n },\n \"calibration_error\": {\n \"type\": \"number\",\n \"minimum\": 0.0\n },\n \"individual_fairness_score\": {\n \"type\": \"number\",\n \"minimum\": 0.0,\n \"maximum\": 1.0\n }\n }\n },\n \"flags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"flag_code\", \"severity\", \"description\"],\n \"properties\": {\n \"flag_code\": {\n \"type\": \"string\",\n \"pattern\": \"^BF-[0-9]{4}$\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\"INFO\", \"WARNING\", \"CRITICAL\", \"BLOCKING\"]\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"affected_groups\": {\n \"type\": \"array\",\n \"items\": {\"type\": \"string\"}\n },\n \"remediation_hint\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"feature_attribution\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n```}}}}}}",
|
|
7
|
+
"outcome": "A-HR-BiasGuard",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "HR",
|
|
10
|
+
"primary_model": "GPT-4o-Synthesis",
|
|
11
|
+
"privacy_tier": "Public",
|
|
12
|
+
"sybox_fee_split": {
|
|
13
|
+
"dev": 0.5,
|
|
14
|
+
"curation": 0.4,
|
|
15
|
+
"author": 0.1
|
|
16
|
+
},
|
|
17
|
+
"ticker": "SYNL",
|
|
18
|
+
"audit_cadence": "Weekly",
|
|
19
|
+
"lifecycle": "Genesis-Platinum",
|
|
20
|
+
"global_outputs": [
|
|
21
|
+
"synthesis_id",
|
|
22
|
+
"logic_id",
|
|
23
|
+
"bps_verified",
|
|
24
|
+
"model_stack",
|
|
25
|
+
"processing_ms",
|
|
26
|
+
"timestamp"
|
|
27
|
+
],
|
|
28
|
+
"custom_outputs": [
|
|
29
|
+
{
|
|
30
|
+
"field_name": "fairness_verdict",
|
|
31
|
+
"type": "String",
|
|
32
|
+
"description": "Enum: `[\"APPROVED\", \"CONDITIONAL_APPROVAL\", \"BLOCKED\"]`.",
|
|
33
|
+
"downstream_intent": "A-CEO-KPISiphon",
|
|
34
|
+
"bps_sensitivity": "Yes"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "disparate_impact_ratios",
|
|
38
|
+
"type": "Object",
|
|
39
|
+
"description": "Key metrics (DI ratio, demographic parity diff) for protected groups.",
|
|
40
|
+
"downstream_intent": "Legal / Ethics Persona",
|
|
41
|
+
"bps_sensitivity": "Yes"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "remediation_strategy",
|
|
45
|
+
"type": "String",
|
|
46
|
+
"description": "One-sentence deterministic hint if fairness score is \u003c threshold.",
|
|
47
|
+
"downstream_intent": "HR Recruiter",
|
|
48
|
+
"bps_sensitivity": "No"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "feature_attribution_map",
|
|
52
|
+
"type": "Array",
|
|
53
|
+
"description": "Top 4 features and their impact on the fairness score.",
|
|
54
|
+
"downstream_intent": "ML-Ops / Data Science",
|
|
55
|
+
"bps_sensitivity": "No"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|