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/atomics/96.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 96,
|
|
3
|
+
"successBps": 9860,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_CMO_BRANDTUNER",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-CMO-BrandTuner Technical Logic Specification\n\n## 1. System Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────────â”\n│ A-CMO-BrandTuner Core Engine │\n├─────────────────────────────────────────────────────────────────────┤\n│ ┌──────────────┠┌──────────────┠┌──────────────┠│\n│ │ Brand Signal │ │ Sentiment │ │ Competitive │ │\n│ │ Ingestion │──│ Analysis │──│ Indexing │ │\n│ └──────────────┘ └──────────────┘ └──────────────┘ │\n│ │ │ │ │\n│ â–¼ â–¼ â–¼ │\n│ ┌─────────────────────────────────────────────────────────┠│\n│ │ Brand Health Score Calculator │ │\n│ │ BHS = Σ(wáµ¢ × Sáµ¢) / Σwáµ¢ × (1 - DegradationFactor)│ │\n│ └─────────────────────────────────────────────────────────┘ │\n│ │ │\n│ â–¼ │\n│ ┌──────────────┠┌──────────────┠┌──────────────┠│\n│ │ Tuning │ │ Threshold │ │ Alert │ │\n│ │ Engine │──│ Evaluator │──│ Dispatcher │ │\n│ └──────────────┘ └──────────────┘ └──────────────┘ │\n└─────────────────────────────────────────────────────────────────────┘\n```\n\n---\n\n## 2. Core Mathematical Models\n\n### 2.1 Brand Health Score (BHS)\n\n```\nBHS(t) = (α × Awareness(t) + β × Sentiment(t) + γ × Engagement(t) + δ × Loyalty(t)) / (α + β + γ + δ)\n\nWhere:\n α = 0.25 (Awareness weight)\n β = 0.30 (Sentiment weight)\n γ = 0.25 (Engagement weight)\n δ = 0.20 (Loyalty weight)\n\nNormalized Range: [0.0, 1.0]\n```\n\n### 2.2 Brand Velocity Index (BVI)\n\n```\nBVI(t) = (BHS(t) - BHS(t-Δt)) / Δt\n\nWhere:\n Δt = measurement interval (default: 24h)\n \nInterpretation:\n BVI \u003e 0.05 → Positive momentum\n BVI ∈ [-0.05, 0.05] → Stable\n BVI \u003c -0.05 → Negative momentum (trigger alert)\n```\n\n### 2.3 Competitive Position Score (CPS)\n\n```\nCPS = (BHS_self - μ_competitors) / σ_competitors\n\nWhere:\n μ_competitors = mean BHS of competitor set\n σ_competitors = standard deviation of competitor BHS\n \nZ-score interpretation:\n CPS \u003e 2.0 → Market leader\n CPS ∈ [0, 2.0] → Above average\n CPS ∈ [-2.0, 0] → Below average\n CPS \u003c -2.0 → Critical position\n```\n\n### 2.4 Tuning Coefficient Calculation\n\n```\nTuneCoeff(channel) = (TargetBHS - CurrentBHS) × ChannelElasticity(channel) × BudgetConstraint\n\nChannelElasticity:\n Social = 0.15\n Search = 0.12\n Display = 0.08\n Email = 0.10\n Content = 0.18\n PR = 0.22\n```\n\n---\n\n## 3. Breakdown Point Score (BPS) Matrix\n\n### 3.1 BPS Calculation Formula\n\n```\nBPS(component) = Σ(Páµ¢ × Iáµ¢ × Dáµ¢) / 100\n\nWhere:\n Páµ¢ = Probability of failure (0-100)\n Iáµ¢ = Impact severity (1-10)\n Dáµ¢ = Detection difficulty (1-10)\n\nRisk Classification:\n BPS ∈ [0, 50) → LOW\n BPS ∈ [50, 150) → MEDIUM\n BPS ∈ [150, 300) → HIGH\n BPS ≥ 300 → CRITICAL\n```\n\n### 3.2 Component BPS Matrix\n\n| Component | Failure Mode | P (0-100) | I (1-10) | D (1-10) | BPS | Risk Level |\n|-----------|--------------|-----------|----------|----------|-----|------------|\n| Data Ingestion Pipeline | Source API timeout | 35 | 8 | 3 | 84 | MEDIUM |\n| Data Ingestion Pipeline | Schema drift | 25 | 9 | 7 | 157.5 | HIGH |\n| Data Ingestion Pipeline | Rate limit exceeded | 45 | 6 | 2 | 54 | MEDIUM |\n| Sentiment Analyzer | Model degradation | 20 | 8 | 8 | 128 | MEDIUM |\n| Sentiment Analyzer | Language detection failure | 15 | 5 | 4 | 30 | LOW |\n| Sentiment Analyzer | Context misclassification | 40 | 7 | 9 | 252 | HIGH |\n| BHS Calculator | Weight misconfiguration | 10 | 10 | 6 | 60 | MEDIUM |\n| BHS Calculator | Null signal propagation | 25 | 9 | 5 | 112.5 | MEDIUM |\n| BHS Calculator | Temporal alignment drift | 30 | 7 | 8 | 168 | HIGH |\n| Tuning Engine | Recommendation oscillation | 35 | 8 | 7 | 196 | HIGH |\n| Tuning Engine | Budget constraint violation | 20 | 9 | 4 | 72 | MEDIUM |\n| Tuning Engine | Channel elasticity stale | 45 | 6 | 6 | 162 | HIGH |\n| Alert Dispatcher | Notification queue overflow | 25 | 7 | 3 | 52.5 | MEDIUM |\n| Alert Dispatcher | Threshold false positive | 50 | 4 | 5 | 100 | MEDIUM |\n| Alert Dispatcher | Escalation path failure | 15 | 10 | 4 | 60 | MEDIUM |\n| Database Layer | Connection pool exhaustion | 20 | 9 | 3 | 54 | MEDIUM |\n| Database Layer | Replication lag \u003e 30s | 30 | 8 | 4 | 96 | MEDIUM |\n| Database Layer | Index corruption | 5 | 10 | 8 | 40 | LOW |\n| Cache Layer | Cache stampede | 25 | 7 | 5 | 87.5 | MEDIUM |\n| Cache Layer | Stale data serving | 40 | 6 | 7 | 168 | HIGH |\n| External Dependencies | Social API deprecation | 10 | 10 | 2 | 20 | LOW |\n| External Dependencies | Third-party rate limiting | 55 | 5 | 2 | 55 | MEDIUM |\n\n### 3.3 Aggregate System BPS\n\n```\nSystem_BPS = Σ(Component_BPS × CriticalityWeight) / Σ(CriticalityWeight)\n\nComponent Criticality Weights:\n Data Ingestion Pipeline = 1.5\n Sentiment Analyzer = 1.3\n BHS Calculator = 1.8\n Tuning Engine = 1.6\n Alert Dispatcher = 1.0\n Database Layer = 1.4\n Cache Layer = 0.9\n External Dependencies = 1.2\n\nCurrent System_BPS = 127.4 (MEDIUM)\n```\n\n---\n\n## 4. JSON Schema Specifications\n\n### 4.1 Brand Configuration Input Schema\n\n```json\n{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://a-cmo.io/schemas/brand-tuner/config/v2\",\n \"title\": \"BrandTunerConfiguration\",\n \"type\": \"object\",\n \"required\": [\"brand_id\", \"tenant_id\", \"config_version\", \"brand_profile\", \"tuning_parameters\", \"alert_thresholds\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"brand_id\": {\n \"type\": \"string\",\n \"pattern\": \"^BRD-[A-Z0-9]{8}$\",\n \"description\": \"Unique brand identifier\"\n },\n \"tenant_id\": {\n \"type\": \"string\",\n \"pattern\": \"^TNT-[A-Z0-9]{6}$\"\n },\n \"config_version\": {\n \"type\": \"string\",\n \"pattern\": \"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\"\n },\n \"brand_profile\": {\n \"type\": \"object\",\n \"required\": [\"name\", \"industry\", \"market_segment\", \"competitors\"],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"maxLength\": 256\n },\n \"industry\": {\n \"type\": \"string\",\n \"enum\": [\"technology\", \"finance\", \"healthcare\", \"retail\", \"manufacturing\", \"media\", \"automotive\", \"energy\", \"telecom\", \"other\"]\n },\n \"market_segment\": {\n \"type\": \"string\",\n \"enum\": [\"enterprise\", \"smb\", \"consumer\", \"mixed\"]\n },\n \"competitors\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 20,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"competitor_id\", \"name\", \"weight\"],\n \"properties\": {\n \"competitor_id\": {\n \"type\": \"string\",\n \"pattern\": \"^CMP-[A-Z0-9]{8}$\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"weight\": {\n \"type\": \"number\",\n \"minimum\": 0.1,\n \"maximum\": 1.0\n }\n }\n }\n },\n \"brand_keywords\": {\n \"type\": \"array\",\n \"maxItems\": 100,\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 2,\n \"maxLength\": 64\n }\n }\n }\n },\n \"tuning_parameters\": {\n \"type\": \"object\",\n \"required\": [\"weights\", \"channels\", \"budget_constraints\"],\n \"properties\": {\n \"weights\": {\n \"type\": \"object\",\n \"required\": [\"awareness\", \"sentiment\", \"engagement\", \"loyalty\"],\n \"properties\": {\n \"awareness\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"sentiment\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"engagement\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"loyalty\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n },\n \"additionalProperties\": false\n },\n \"channels\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"channel_id\", \"type\", \"enabled\", \"elasticity_override\"],\n \"properties\": {\n \"channel_id\": {\n \"type\": \"string\",\n \"pattern\": \"^CHN-[A-Z0-9]{6}$\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"social\", \"search\", \"display\", \"email\", \"content\", \"pr\", \"influencer\", \"podcast\", \"video\"]\n },\n \"enabled\": { \"type\": \"boolean\" },\n \"elasticity_override\": {\n \"type\": [\"number\", \"null\"],\n \"minimum\": 0.01,\n \"maximum\": 0.50\n }\n }\n }\n },\n \"budget_constraints\": {\n \"type\": \"object\",\n \"required\": [\"total_monthly\", \"currency\", \"allocation_mode\"],\n \"properties\": {\n \"total_monthly\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100000000\n },\n \"currency\": {\n \"type\": \"string\",\n \"pattern\": \"^[A-Z]{3}$\"\n },\n \"allocation_mode\": {\n \"type\": \"string\",\n \"enum\": [\"fixed\", \"dynamic\", \"hybrid\"]\n },\n \"channel_caps\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1\n }\n }\n }\n },\n \"tuning_frequency\": {\n \"type\": \"string\",\n \"enum\": [\"realtime\", \"hourly\", \"daily\", \"weekly\"],\n \"default\": \"daily\"\n },\n \"smoothing_factor\": {\n \"type\": \"number\",\n \"minimum\": 0.1,\n \"maximum\": 0.9,\n \"default\": 0.3\n }\n }\n },\n \"alert_thresholds\": {\n \"type\": \"object\",\n \"required\": [\"bhs_critical\", \"bhs_warning\", \"bvi_negative_threshold\", \"cps_floor\"],\n \"properties\": {\n \"bhs_critical\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 0.5\n },\n \"bhs_warning\": {\n \"type\": \"number\",\n \"minimum\": 0.2,\n \"maximum\": 0.7\n },\n \"bvi_negative_threshold\": {\n \"type\": \"number\",\n \"minimum\": -0.2,\n \"maximum\": 0\n },\n \"cps_floor\": {\n \"type\": \"number\",\n \"minimum\": -3,\n \"maximum\": 0\n },\n \"sentiment_spike_threshold\": {\n \"type\": \"number\",\n \"minimum\": 0.1,\n \"maximum\": 0.5,\n \"default\": 0.25\n }\n }\n },\n \"data_sources\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"source_id\", \"type\", \"priority\", \"refresh_interval_seconds\"],\n \"properties\": {\n \"source_id\": {\n \"type\": \"string\",\n \"pattern\": \"^SRC-[A-Z0-9]{8}$\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"social_api\", \"web_scraper\", \"survey\", \"crm\", \"analytics\", \"custom\"]\n },\n \"priority\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 10\n },\n \"refresh_interval_seconds\": {\n \"type\": \"integer\",\n \"minimum\": 60,\n \"maximum\": 86400\n },\n \"credentials_ref\": {\n \"type\": \"string\",\n \"pattern\": \"^vault://[a-z0-9-]+/[a-z0-9-]+$\"\n }\n }\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"created_at\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"updated_at\":\n```}}}}]]]",
|
|
7
|
+
"outcome": "A-CMO-BrandTuner",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "CMO",
|
|
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": "brand_health_score_delta",
|
|
31
|
+
"type": "Float",
|
|
32
|
+
"description": "The difference between `current_bhs` and `bhs_forecast_30d`.",
|
|
33
|
+
"downstream_intent": "A-CEO-KPISiphon",
|
|
34
|
+
"bps_sensitivity": "Yes"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "tuning_coefficient_array",
|
|
38
|
+
"type": "Array",
|
|
39
|
+
"description": "Recommended budget adjustments per channel (ID, recommended_budget, rationale).",
|
|
40
|
+
"downstream_intent": "Marketing-Persona",
|
|
41
|
+
"bps_sensitivity": "No"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "competitive_z_score",
|
|
45
|
+
"type": "Float",
|
|
46
|
+
"description": "Deterministic CPS value relative to industry competitor mean.",
|
|
47
|
+
"downstream_intent": "A-CMO-PulseHarvester",
|
|
48
|
+
"bps_sensitivity": "No"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "optimization_roi_multiplier",
|
|
52
|
+
"type": "Float",
|
|
53
|
+
"description": "Projected increase in ROI based on proposed reallocations.",
|
|
54
|
+
"downstream_intent": "A-CFO-LedgerSiphon",
|
|
55
|
+
"bps_sensitivity": "Yes"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"field_name": "sentiment_volatility_flag",
|
|
59
|
+
"type": "Boolean",
|
|
60
|
+
"description": "`True` if `sentiment_volatility` exceeds the `sentiment_spike_threshold`.",
|
|
61
|
+
"downstream_intent": "A-CMO-FearMapper",
|
|
62
|
+
"bps_sensitivity": "Yes"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
package/atomics/97.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 97,
|
|
3
|
+
"successBps": 9999,
|
|
4
|
+
"cid": "ar://SYNTH_ATOMIC_COO_WORKFLOWMAPPER",
|
|
5
|
+
"costUsd": 1500,
|
|
6
|
+
"details": "# A-COO-WorkflowMapper Technical Specification\n\n## 1. Core Logic Definition\n\n### 1.1 Workflow Mapping Function\n\n```\nW(x) = Σ(Tᵢ × Dᵢ × Cᵢ) / N\n\nWhere:\n- W(x) = Workflow efficiency score for process x\n- Tᵢ = Task completion time for step i (seconds)\n- Dᵢ = Dependency weight factor [0.1 - 1.0]\n- Cᵢ = Criticality coefficient [1 - 10]\n- N = Total number of workflow steps\n```\n\n### 1.2 Process State Machine\n\n```\nStates: {INIT, QUEUED, PROCESSING, BLOCKED, COMPLETED, FAILED, ROLLBACK}\n\nTransitions:\nINIT → QUEUED: trigger(task_submitted)\nQUEUED → PROCESSING: trigger(resource_available ∧ dependencies_met)\nPROCESSING → COMPLETED: trigger(exit_code == 0 ∧ validation_passed)\nPROCESSING → FAILED: trigger(exit_code != 0 ∨ timeout_exceeded)\nPROCESSING → BLOCKED: trigger(dependency_unavailable ∨ resource_contention)\nBLOCKED → QUEUED: trigger(blocker_resolved)\nFAILED → ROLLBACK: trigger(rollback_policy == enabled)\nROLLBACK → INIT: trigger(state_restored)\n```\n\n---\n\n## 2. Breakdown Point Score (BPS) Matrix\n\n### 2.1 BPS Calculation Formula\n\n```\nBPS = (F × S × P) / R\n\nWhere:\n- F = Failure frequency (incidents/hour)\n- S = Severity multiplier [1-5]\n- P = Propagation factor (affected downstream systems)\n- R = Recovery capability score [0.1 - 1.0]\n\nRisk Classification:\n- BPS \u003c 10: LOW\n- BPS 10-50: MODERATE \n- BPS 51-100: HIGH\n- BPS \u003e 100: CRITICAL\n```\n\n### 2.2 BPS Risk Matrix\n\n| Component | Failure Mode | F (inc/hr) | S | P | R | BPS | Risk Level |\n|-----------|--------------|------------|---|---|-----|-----|------------|\n| Task Scheduler | Queue overflow | 0.05 | 4 | 8 | 0.7 | 2.29 | LOW |\n| Task Scheduler | Deadlock | 0.01 | 5 | 12 | 0.3 | 2.00 | LOW |\n| Dependency Resolver | Circular reference | 0.02 | 5 | 15 | 0.4 | 3.75 | LOW |\n| Dependency Resolver | Stale cache | 0.15 | 3 | 6 | 0.8 | 3.38 | LOW |\n| State Manager | Data corruption | 0.001 | 5 | 20 | 0.2 | 0.50 | LOW |\n| State Manager | Split-brain | 0.005 | 5 | 25 | 0.15 | 4.17 | LOW |\n| Resource Allocator | Exhaustion | 0.08 | 4 | 10 | 0.5 | 6.40 | LOW |\n| Resource Allocator | Fragmentation | 0.12 | 3 | 5 | 0.6 | 3.00 | LOW |\n| Event Bus | Message loss | 0.03 | 5 | 18 | 0.4 | 6.75 | LOW |\n| Event Bus | Ordering violation | 0.07 | 4 | 8 | 0.6 | 3.73 | LOW |\n| Validation Engine | Schema drift | 0.04 | 3 | 4 | 0.9 | 0.53 | LOW |\n| Validation Engine | False positive | 0.20 | 2 | 2 | 0.95 | 0.84 | LOW |\n| Rollback Handler | Incomplete restore | 0.008 | 5 | 15 | 0.25 | 2.40 | LOW |\n| Rollback Handler | Cascade failure | 0.002 | 5 | 30 | 0.1 | 3.00 | LOW |\n| API Gateway | Rate limit breach | 0.10 | 3 | 6 | 0.85 | 2.12 | LOW |\n| API Gateway | Auth token expiry | 0.25 | 4 | 3 | 0.9 | 3.33 | LOW |\n\n### 2.3 Aggregate System BPS\n\n```\nBPS_system = √(Σ BPSᵢ²) × (1 + correlation_factor)\n\ncorrelation_factor = count(shared_dependencies) / total_components\n\nCurrent System BPS: 14.82 (MODERATE)\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-coo-workflow-mapper/v1\",\n \"title\": \"A-COO-WorkflowMapper Input Schema\",\n \"type\": \"object\",\n \"required\": [\"workflow_id\", \"version\", \"tasks\", \"metadata\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"workflow_id\": {\n \"type\": \"string\",\n \"pattern\": \"^WF-[A-Z0-9]{8}-[A-Z0-9]{4}$\",\n \"description\": \"Unique workflow identifier\"\n },\n \"version\": {\n \"type\": \"string\",\n \"pattern\": \"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\"\n },\n \"priority\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 10,\n \"default\": 5\n },\n \"timeout_ms\": {\n \"type\": \"integer\",\n \"minimum\": 1000,\n \"maximum\": 86400000,\n \"default\": 300000\n },\n \"retry_policy\": {\n \"type\": \"object\",\n \"required\": [\"max_attempts\", \"backoff_type\"],\n \"properties\": {\n \"max_attempts\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 10\n },\n \"backoff_type\": {\n \"type\": \"string\",\n \"enum\": [\"linear\", \"exponential\", \"fibonacci\", \"constant\"]\n },\n \"base_delay_ms\": {\n \"type\": \"integer\",\n \"minimum\": 100,\n \"maximum\": 60000,\n \"default\": 1000\n },\n \"max_delay_ms\": {\n \"type\": \"integer\",\n \"minimum\": 1000,\n \"maximum\": 300000,\n \"default\": 30000\n },\n \"jitter_factor\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"default\": 0.1\n }\n }\n },\n \"tasks\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"maxItems\": 500,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"task_id\", \"type\", \"executor\"],\n \"properties\": {\n \"task_id\": {\n \"type\": \"string\",\n \"pattern\": \"^T-[A-Z0-9]{6}$\"\n },\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\"compute\", \"io\", \"network\", \"validation\", \"transform\", \"aggregate\"]\n },\n \"executor\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z][a-z0-9-]{2,63}$\"\n },\n \"dependencies\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^T-[A-Z0-9]{6}$\"\n },\n \"uniqueItems\": true,\n \"maxItems\": 50\n },\n \"criticality\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 10,\n \"default\": 5\n },\n \"idempotent\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"resource_requirements\": {\n \"type\": \"object\",\n \"properties\": {\n \"cpu_millicores\": {\n \"type\": \"integer\",\n \"minimum\": 50,\n \"maximum\": 64000\n },\n \"memory_mb\": {\n \"type\": \"integer\",\n \"minimum\": 64,\n \"maximum\": 524288\n },\n \"gpu_count\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 8\n },\n \"ephemeral_storage_mb\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"maximum\": 1048576\n }\n }\n },\n \"input_schema\": {\n \"$ref\": \"#/$defs/data_contract\"\n },\n \"output_schema\": {\n \"$ref\": \"#/$defs/data_contract\"\n }\n }\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"required\": [\"owner\", \"created_at\"],\n \"properties\": {\n \"owner\": {\n \"type\": \"string\",\n \"format\": \"email\"\n },\n \"created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9-_]{1,64}$\"\n },\n \"maxItems\": 20\n },\n \"cost_center\": {\n \"type\": \"string\",\n \"pattern\": \"^CC-[0-9]{6}$\"\n },\n \"sla_tier\": {\n \"type\": \"string\",\n \"enum\": [\"platinum\", \"gold\", \"silver\", \"bronze\"]\n }\n }\n },\n \"rollback_config\": {\n \"type\": \"object\",\n \"properties\": {\n \"enabled\": {\n \"type\": \"boolean\",\n \"default\": true\n },\n \"checkpoint_interval_tasks\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"maximum\": 100\n },\n \"preserve_partial_results\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n }\n }\n },\n \"$defs\": {\n \"data_contract\": {\n \"type\": \"object\",\n \"required\": [\"format\", \"version\"],\n \"properties\": {\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\"json\", \"avro\", \"protobuf\", \"parquet\"]\n },\n \"version\": {\n \"type\": \"string\",\n \"pattern\": \"^\\\\d+\\\\.\\\\d+$\"\n },\n \"schema_registry_id\": {\n \"type\": \"string\",\n \"pattern\": \"^SR-[A-Z0-9]{12}$\"\n },\n \"compression\": {\n \"type\": \"string\",\n \"enum\": [\"none\", \"gzip\", \"snappy\", \"lz4\", \"zstd\"]\n }\n }\n }\n }\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| `workflow_completion_rate` | Gauge | `completed_workflows / total_workflows` | ratio |\n| `task_latency_p50` | Histogram | `percentile(task_duration, 0.50)` | ms |\n| `task_latency_p95` | Histogram | `percentile(task_duration, 0.95)` | ms |\n| `task_latency_p99` | Histogram | `percentile(task_duration, 0.99)` | ms |\n| `dependency_resolution_time` | Histogram | `resolve_end - resolve_start` | ms |\n| `queue_depth` | Gauge | `count(tasks WHERE state = QUEUED)` | count |\n| `error_rate` | Counter | `failed_tasks / total_tasks` | ratio |\n| `rollback_frequency` | Counter | `rollback_events / time_window` | events/hr |\n| `resource_utilization_cpu` | Gauge | `allocated_cpu / available_cpu` | ratio |\n| `resource_utilization_memory` | Gauge | `allocated_mem / available_mem` | ratio |\n| `checkpoint_success_rate` | Gauge | `successful_checkpoints / total_checkpoints` | ratio |\n| `state_sync_lag` | Gauge | `current_time - last_sync_time` | ms |\n\n### 4.2 Service Level Objectives (SLOs)\n\n```yaml\nslos:\n availability:\n target: 99.95%\n window: 30d\n calculation: |\n 1 - (sum(workflow_failures) / sum(workflow_attempts))\n error_budget_burn_rate_alert:\n fast: 14.4 # 2% budget in 1 hour\n slow: 6.0 # 5% budget in 6 hours\n\n latency:\n p50_target: 500ms\n p95_target: 2000ms\n p99_target: 5000ms\n window: 7d\n calculation: |\n count(requests WHERE latency \u003c= threshold) / count(requests)\n\n throughput:\n target: 10000 workflows/minute\n sustained_window: 5m\n burst_capacity: 25000 workflows/minute\n burst_window: 30s\n\n correctness:\n target: 99.99%\n window: 30d\n calculation: |\n 1 - (sum(data_corruption_events + ordering_violations) / sum(processed_tasks))\n\n durability:\n target: 99.999%\n window: 365d\n calculation: |\n 1 - (sum(lost_workflow_states) / sum(total_workflow_states))\n```\n\n### 4.3 Alerting Thresholds\n\n```yaml\nalerts:\n - name: WorkflowCompletionRateLow\n expr: workflow_completion_rate \u003c 0.95\n for: 5m\n severity: warning\n \n - name: WorkflowCompletionRateCritical\n expr: workflow_completion_rate \u003c 0.90\n for: 2m\n severity: critical\n \n - name: TaskLatencyP99High\n expr: task_latency_p99 \u003e 5000\n for: 10m\n severity: warning\n \n - name: QueueDepthExceeded\n expr: queue_depth \u003e 10000\n for: 5m\n severity: warning\n \n - name: QueueDepthCritical\n expr: queue_depth \u003e 50000\n for: 2m\n severity: critical\n \n - name: ErrorRateElevated\n expr: rate(error_rate[5m]) \u003e 0.01\n for: 5m\n severity: warning\n \n - name: ErrorRateCritical\n expr: rate(error_rate[5m]) \u003e 0.05\n for: 2m\n severity: critical\n \n - name: RollbackFrequencyHigh\n expr: rollback_frequency \u003e 10\n for: 15m\n severity: warning\n \n - name: StateSyncLagHigh\n expr: state_sync_lag \u003e 5000\n for: 5m\n severity: warning\n \n - name: ResourceExhaustion\n expr: resource_utilization_cpu \u003e 0.90 OR resource_utilization_memory \u003e 0.85\n for: 10m\n severity: warning\n \n - name: CheckpointFailure\n expr: checkpoint_success_rate \u003c 0.99\n```\n\n## 3. Resilience Layer\n- **Noise_Tolerance**: 0.15\n- **Confidence_Threshold**: 0.85\n- **Logic_Smoothing**: Bayesian",
|
|
7
|
+
"outcome": "A-COO-WorkflowMapper",
|
|
8
|
+
"rType": 0,
|
|
9
|
+
"persona": "COO",
|
|
10
|
+
"primary_model": "Claude-3.5-Reasoning",
|
|
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": "workflow_efficiency_score",
|
|
31
|
+
"type": "Integer",
|
|
32
|
+
"description": "Normalized score (0-10,000) based on .",
|
|
33
|
+
"downstream_intent": "**A-CEO-KPISiphon** for operational health tracking.",
|
|
34
|
+
"bps_sensitivity": "Yes"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"field_name": "task_execution_summary",
|
|
38
|
+
"type": "Array",
|
|
39
|
+
"description": "Objects containing `task_id`, `state`, `duration_ms`, and `bps_contribution`.",
|
|
40
|
+
"downstream_intent": "**A-COO-BottleneckSim** to identify slow-path nodes.",
|
|
41
|
+
"bps_sensitivity": "Yes"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"field_name": "critical_path_latency_ms",
|
|
45
|
+
"type": "Integer",
|
|
46
|
+
"description": "Total duration of the longest dependency chain.",
|
|
47
|
+
"downstream_intent": "**A-COO-AllocLogic** for resource scaling triggers.",
|
|
48
|
+
"bps_sensitivity": "No"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"field_name": "validation_verdict",
|
|
52
|
+
"type": "Object",
|
|
53
|
+
"description": "Nested signal containing `circular_deps` (boolean) and `schema_drift_detected` (boolean).",
|
|
54
|
+
"downstream_intent": "**Sentinel Audit** for security and integrity checks.",
|
|
55
|
+
"bps_sensitivity": "Yes"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import { runAudit } from '../src/forge.js';
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.name('synl')
|
|
7
|
+
.description('Synthesis Ledger Sovereign SDK')
|
|
8
|
+
.version('1.0.0');
|
|
9
|
+
|
|
10
|
+
program
|
|
11
|
+
.command('run')
|
|
12
|
+
.argument('<id>', 'Atomic ID to execute')
|
|
13
|
+
.argument('[data]', 'Input data for the audit (optional)')
|
|
14
|
+
.action(async (id, data) => {
|
|
15
|
+
// If no data is provided, it falls back to the internal default
|
|
16
|
+
await runAudit(id, data);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
program.parse();
|
package/bin/synl.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { program } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { runAudit } from '../src/forge.js';
|
|
5
|
+
|
|
6
|
+
program
|
|
7
|
+
.name('synl')
|
|
8
|
+
.description('Synthesis Ledger Sovereign SDK')
|
|
9
|
+
.version('1.0.0');
|
|
10
|
+
|
|
11
|
+
program.command('run')
|
|
12
|
+
.description('Execute a Genesis Atomic logic audit')
|
|
13
|
+
.argument('<id>', 'Atomic ID')
|
|
14
|
+
.action(async (id) => {
|
|
15
|
+
await runAudit(id);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
program.command('status')
|
|
19
|
+
.description('Genesis 100 Progress & Lid Countdown')
|
|
20
|
+
.action(() => {
|
|
21
|
+
const current = 39;
|
|
22
|
+
console.log(chalk.cyan('\n--- SYNTHESIS LEDGER STATUS ---'));
|
|
23
|
+
console.log(chalk.white(`Progress: [${'#'.repeat(current/5)}${'.'.repeat((100-current)/5)}] ${current}/100`));
|
|
24
|
+
console.log(chalk.red('LID CLOSURE: DECEMBER 31, 2025 - 23:59 UTC'));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
program.parse();
|