@guyghost/swarm-dao-core 0.1.0
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/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/prompts.d.ts +38 -0
- package/dist/agents/prompts.d.ts.map +1 -0
- package/dist/agents/prompts.js +142 -0
- package/dist/agents/prompts.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +100 -0
- package/dist/config.js.map +1 -0
- package/dist/control/audit.d.ts +7 -0
- package/dist/control/audit.d.ts.map +1 -0
- package/dist/control/audit.js +25 -0
- package/dist/control/audit.js.map +1 -0
- package/dist/control/gates.d.ts +4 -0
- package/dist/control/gates.d.ts.map +1 -0
- package/dist/control/gates.js +252 -0
- package/dist/control/gates.js.map +1 -0
- package/dist/control/index.d.ts +3 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +4 -0
- package/dist/control/index.js.map +1 -0
- package/dist/delivery/artefacts.d.ts +20 -0
- package/dist/delivery/artefacts.d.ts.map +1 -0
- package/dist/delivery/artefacts.js +222 -0
- package/dist/delivery/artefacts.js.map +1 -0
- package/dist/delivery/dry-run.d.ts +14 -0
- package/dist/delivery/dry-run.d.ts.map +1 -0
- package/dist/delivery/dry-run.js +100 -0
- package/dist/delivery/dry-run.js.map +1 -0
- package/dist/delivery/execution.d.ts +23 -0
- package/dist/delivery/execution.d.ts.map +1 -0
- package/dist/delivery/execution.js +99 -0
- package/dist/delivery/execution.js.map +1 -0
- package/dist/delivery/index.d.ts +5 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +6 -0
- package/dist/delivery/index.js.map +1 -0
- package/dist/delivery/plans.d.ts +7 -0
- package/dist/delivery/plans.d.ts.map +1 -0
- package/dist/delivery/plans.js +172 -0
- package/dist/delivery/plans.js.map +1 -0
- package/dist/governance/agents.d.ts +7 -0
- package/dist/governance/agents.d.ts.map +1 -0
- package/dist/governance/agents.js +310 -0
- package/dist/governance/agents.js.map +1 -0
- package/dist/governance/amendments.d.ts +20 -0
- package/dist/governance/amendments.d.ts.map +1 -0
- package/dist/governance/amendments.js +242 -0
- package/dist/governance/amendments.js.map +1 -0
- package/dist/governance/index.d.ts +6 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +7 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/lifecycle.d.ts +13 -0
- package/dist/governance/lifecycle.d.ts.map +1 -0
- package/dist/governance/lifecycle.js +86 -0
- package/dist/governance/lifecycle.js.map +1 -0
- package/dist/governance/scoring.d.ts +16 -0
- package/dist/governance/scoring.d.ts.map +1 -0
- package/dist/governance/scoring.js +118 -0
- package/dist/governance/scoring.js.map +1 -0
- package/dist/governance/voting.d.ts +6 -0
- package/dist/governance/voting.d.ts.map +1 -0
- package/dist/governance/voting.js +73 -0
- package/dist/governance/voting.js.map +1 -0
- package/dist/health-score.d.ts +25 -0
- package/dist/health-score.d.ts.map +1 -0
- package/dist/health-score.js +201 -0
- package/dist/health-score.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/bitbucket.d.ts +26 -0
- package/dist/integrations/bitbucket.d.ts.map +1 -0
- package/dist/integrations/bitbucket.js +76 -0
- package/dist/integrations/bitbucket.js.map +1 -0
- package/dist/integrations/github.d.ts +39 -0
- package/dist/integrations/github.d.ts.map +1 -0
- package/dist/integrations/github.js +126 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations/gitlab.d.ts +29 -0
- package/dist/integrations/gitlab.d.ts.map +1 -0
- package/dist/integrations/gitlab.js +86 -0
- package/dist/integrations/gitlab.js.map +1 -0
- package/dist/integrations/index.d.ts +4 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +5 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/utils.d.ts +2 -0
- package/dist/integrations/utils.d.ts.map +1 -0
- package/dist/integrations/utils.js +8 -0
- package/dist/integrations/utils.js.map +1 -0
- package/dist/intelligence/index.d.ts +3 -0
- package/dist/intelligence/index.d.ts.map +1 -0
- package/dist/intelligence/index.js +4 -0
- package/dist/intelligence/index.js.map +1 -0
- package/dist/intelligence/roundtable.d.ts +16 -0
- package/dist/intelligence/roundtable.d.ts.map +1 -0
- package/dist/intelligence/roundtable.js +113 -0
- package/dist/intelligence/roundtable.js.map +1 -0
- package/dist/intelligence/swarm.d.ts +27 -0
- package/dist/intelligence/swarm.d.ts.map +1 -0
- package/dist/intelligence/swarm.js +113 -0
- package/dist/intelligence/swarm.js.map +1 -0
- package/dist/intelligence/synthesis.d.ts +4 -0
- package/dist/intelligence/synthesis.d.ts.map +1 -0
- package/dist/intelligence/synthesis.js +84 -0
- package/dist/intelligence/synthesis.js.map +1 -0
- package/dist/observability/alerts.d.ts +40 -0
- package/dist/observability/alerts.d.ts.map +1 -0
- package/dist/observability/alerts.js +162 -0
- package/dist/observability/alerts.js.map +1 -0
- package/dist/observability/index.d.ts +4 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +5 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/metrics.d.ts +64 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +224 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/tracing.d.ts +44 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +129 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/persistence.d.ts +50 -0
- package/dist/persistence.d.ts.map +1 -0
- package/dist/persistence.js +486 -0
- package/dist/persistence.js.map +1 -0
- package/dist/types/index.d.ts +652 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +131 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/host.d.ts +14 -0
- package/dist/utils/host.d.ts.map +1 -0
- package/dist/utils/host.js +42 -0
- package/dist/utils/host.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Core — Proposal Lifecycle & State Machine
|
|
3
|
+
// ============================================================
|
|
4
|
+
import { PROPOSAL_COUNCIL, RISK_ZONE_DEFINITIONS } from "../types/index.js";
|
|
5
|
+
// ── Transitions ──────────────────────────────────────────────
|
|
6
|
+
const VALID_TRANSITIONS = {
|
|
7
|
+
open: ["deliberating"],
|
|
8
|
+
deliberating: ["approved", "rejected"],
|
|
9
|
+
approved: ["controlled", "rejected", "failed"],
|
|
10
|
+
controlled: ["executed", "failed"],
|
|
11
|
+
rejected: [],
|
|
12
|
+
executed: [],
|
|
13
|
+
failed: [],
|
|
14
|
+
};
|
|
15
|
+
export function canTransition(from, to) {
|
|
16
|
+
return VALID_TRANSITIONS[from]?.includes(to) ?? false;
|
|
17
|
+
}
|
|
18
|
+
export function transitionProposal(proposal, action) {
|
|
19
|
+
const transitions = {
|
|
20
|
+
open: { deliberate: "deliberating" },
|
|
21
|
+
deliberating: { approve: "approved", reject: "rejected" },
|
|
22
|
+
approved: { control: "controlled", reject: "rejected", fail: "failed" },
|
|
23
|
+
controlled: { execute: "executed", fail: "failed" },
|
|
24
|
+
};
|
|
25
|
+
const newStatus = transitions[proposal.status]?.[action];
|
|
26
|
+
if (!newStatus) {
|
|
27
|
+
return { success: false, error: `Cannot ${action} from ${proposal.status}` };
|
|
28
|
+
}
|
|
29
|
+
proposal.status = newStatus;
|
|
30
|
+
if (["rejected", "executed", "failed"].includes(newStatus)) {
|
|
31
|
+
proposal.resolvedAt = new Date().toISOString();
|
|
32
|
+
}
|
|
33
|
+
return { success: true, newStatus };
|
|
34
|
+
}
|
|
35
|
+
// ── Risk Zone Classification ─────────────────────────────────
|
|
36
|
+
export function classifyRiskZone(proposal) {
|
|
37
|
+
// Security and governance changes are at least orange
|
|
38
|
+
if (proposal.type === "security-change" || proposal.type === "governance-change") {
|
|
39
|
+
return "red";
|
|
40
|
+
}
|
|
41
|
+
// Check for sensitive keywords in title/description
|
|
42
|
+
const text = `${proposal.title} ${proposal.description}`.toLowerCase();
|
|
43
|
+
const redKeywords = [
|
|
44
|
+
"auth",
|
|
45
|
+
"permission",
|
|
46
|
+
"security",
|
|
47
|
+
"credential",
|
|
48
|
+
"secret",
|
|
49
|
+
"token",
|
|
50
|
+
"password",
|
|
51
|
+
"encryption",
|
|
52
|
+
"firewall",
|
|
53
|
+
];
|
|
54
|
+
if (redKeywords.some((k) => text.includes(k))) {
|
|
55
|
+
return "red";
|
|
56
|
+
}
|
|
57
|
+
// Default based on type
|
|
58
|
+
if (proposal.type === "release-change")
|
|
59
|
+
return "green";
|
|
60
|
+
if (proposal.type === "product-feature")
|
|
61
|
+
return "orange";
|
|
62
|
+
return "orange";
|
|
63
|
+
}
|
|
64
|
+
export function getRequiredApprovals(zone) {
|
|
65
|
+
return RISK_ZONE_DEFINITIONS[zone].humanApprovals;
|
|
66
|
+
}
|
|
67
|
+
export function requiresSecurityReview(zone) {
|
|
68
|
+
return RISK_ZONE_DEFINITIONS[zone].requiresSecurityReview;
|
|
69
|
+
}
|
|
70
|
+
// ── Status Labels ────────────────────────────────────────────
|
|
71
|
+
export function statusLabel(status) {
|
|
72
|
+
const labels = {
|
|
73
|
+
open: "📝 Open",
|
|
74
|
+
deliberating: "🗳️ Deliberating",
|
|
75
|
+
approved: "✅ Approved",
|
|
76
|
+
controlled: "🛡️ Controlled",
|
|
77
|
+
rejected: "❌ Rejected",
|
|
78
|
+
executed: "🚀 Executed",
|
|
79
|
+
failed: "💥 Failed",
|
|
80
|
+
};
|
|
81
|
+
return labels[status];
|
|
82
|
+
}
|
|
83
|
+
export function getCouncilsForType(type) {
|
|
84
|
+
return PROPOSAL_COUNCIL[type] || [];
|
|
85
|
+
}
|
|
86
|
+
//# source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,UAAU,oBAAoB,CAAC,IAAc;IACjD,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAc;IACnD,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,sBAAsB,CAAC;AAC5D,CAAC;AAED,gEAAgE;AAEhE,MAAM,UAAU,WAAW,CAAC,MAAsB;IAChD,MAAM,MAAM,GAAmC;QAC7C,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,kBAAkB;QAChC,QAAQ,EAAE,YAAY;QACtB,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,YAAY;QACtB,QAAQ,EAAE,aAAa;QACvB,MAAM,EAAE,WAAW;KACpB,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAsB;IACvD,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentOutput, AxisScore, CompositeScore, RICEScore } from "../types/index.js";
|
|
2
|
+
export declare function parseScoresFromOutput(content: string): Partial<AxisScore>;
|
|
3
|
+
export declare function calculateCompositeScore(outputs: AgentOutput[]): CompositeScore;
|
|
4
|
+
export declare function formatCompositeScore(score: CompositeScore): string;
|
|
5
|
+
export declare function calculateRICEScore(reach: number, impact: number, confidence: number, effort: number): RICEScore;
|
|
6
|
+
export declare function parseRICEFromOutput(content: string): Partial<RICEScore>;
|
|
7
|
+
export declare function rankByRICE(proposals: {
|
|
8
|
+
id: number;
|
|
9
|
+
riceScore?: RICEScore;
|
|
10
|
+
}[]): {
|
|
11
|
+
id: number;
|
|
12
|
+
riceScore: RICEScore;
|
|
13
|
+
rank: number;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function formatRICEScore(score: RICEScore): string;
|
|
16
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../src/governance/scoring.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAY,MAAM,mBAAmB,CAAC;AAcrG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CASzE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,cAAc,CAqD9E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAgBlE;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAS/G;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAYvE;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,EAAE,GACjD;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAWtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAExD"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Core — Composite & RICE Scoring
|
|
3
|
+
// ============================================================
|
|
4
|
+
import { RISK_ZONE_LABELS, SCORING_WEIGHTS } from "../types/index.js";
|
|
5
|
+
// ── Composite Score ──────────────────────────────────────────
|
|
6
|
+
const _SCORE_PATTERN = /##\s*Composite Score Inputs \(0-10\)\s*\n([\s\S]*?)(?=\n##|$)/i;
|
|
7
|
+
const AXIS_PATTERNS = {
|
|
8
|
+
userImpact: /userImpact[:\s]+(\d+(?:\.\d+)?)/i,
|
|
9
|
+
businessImpact: /businessImpact[:\s]+(\d+(?:\.\d+)?)/i,
|
|
10
|
+
effort: /effort[:\s]+(\d+(?:\.\d+)?)/i,
|
|
11
|
+
securityRisk: /securityRisk[:\s]+(\d+(?:\.\d+)?)/i,
|
|
12
|
+
confidence: /confidence[:\s]+(\d+(?:\.\d+)?)/i,
|
|
13
|
+
};
|
|
14
|
+
export function parseScoresFromOutput(content) {
|
|
15
|
+
const scores = {};
|
|
16
|
+
for (const [axis, pattern] of Object.entries(AXIS_PATTERNS)) {
|
|
17
|
+
const match = content?.match(pattern);
|
|
18
|
+
if (match) {
|
|
19
|
+
scores[axis] = Math.min(10, Math.max(0, parseFloat(match[1] ?? "0")));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return scores;
|
|
23
|
+
}
|
|
24
|
+
export function calculateCompositeScore(outputs) {
|
|
25
|
+
const allScores = outputs
|
|
26
|
+
.filter((o) => !o.error && o.content)
|
|
27
|
+
.map((o) => parseScoresFromOutput(o.content));
|
|
28
|
+
const validScores = allScores.filter((s) => s.userImpact !== undefined &&
|
|
29
|
+
s.businessImpact !== undefined &&
|
|
30
|
+
s.effort !== undefined &&
|
|
31
|
+
s.securityRisk !== undefined &&
|
|
32
|
+
s.confidence !== undefined);
|
|
33
|
+
if (validScores.length === 0) {
|
|
34
|
+
return {
|
|
35
|
+
axes: { userImpact: 0, businessImpact: 0, effort: 0, securityRisk: 0, confidence: 0 },
|
|
36
|
+
weighted: 0,
|
|
37
|
+
riskZone: "red",
|
|
38
|
+
breakdown: "No valid scores provided",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const avg = (key) => validScores.reduce((sum, s) => sum + (s[key] || 0), 0) / validScores.length;
|
|
42
|
+
const axes = {
|
|
43
|
+
userImpact: avg("userImpact"),
|
|
44
|
+
businessImpact: avg("businessImpact"),
|
|
45
|
+
effort: avg("effort"),
|
|
46
|
+
securityRisk: avg("securityRisk"),
|
|
47
|
+
confidence: avg("confidence"),
|
|
48
|
+
};
|
|
49
|
+
// Invert effort and securityRisk (lower is better)
|
|
50
|
+
const normalizedEffort = 10 - axes.effort;
|
|
51
|
+
const normalizedSecurityRisk = 10 - axes.securityRisk;
|
|
52
|
+
const weighted = axes.userImpact * SCORING_WEIGHTS.userImpact +
|
|
53
|
+
axes.businessImpact * SCORING_WEIGHTS.businessImpact +
|
|
54
|
+
normalizedEffort * SCORING_WEIGHTS.effort +
|
|
55
|
+
normalizedSecurityRisk * SCORING_WEIGHTS.securityRisk +
|
|
56
|
+
axes.confidence * SCORING_WEIGHTS.confidence;
|
|
57
|
+
const riskZone = weighted >= 7.0 ? "green" : weighted >= 4.0 ? "orange" : "red";
|
|
58
|
+
return {
|
|
59
|
+
axes,
|
|
60
|
+
weighted: Math.round(weighted * 10) / 10,
|
|
61
|
+
riskZone,
|
|
62
|
+
breakdown: `${axes.userImpact.toFixed(1)}×${SCORING_WEIGHTS.userImpact} + ${axes.businessImpact.toFixed(1)}×${SCORING_WEIGHTS.businessImpact} + ${normalizedEffort.toFixed(1)}×${SCORING_WEIGHTS.effort} + ${normalizedSecurityRisk.toFixed(1)}×${SCORING_WEIGHTS.securityRisk} + ${axes.confidence.toFixed(1)}×${SCORING_WEIGHTS.confidence} = ${weighted.toFixed(1)}`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function formatCompositeScore(score) {
|
|
66
|
+
return `## Composite Score
|
|
67
|
+
|
|
68
|
+
**Weighted:** ${score.weighted}/10
|
|
69
|
+
**Zone:** ${RISK_ZONE_LABELS[score.riskZone]}
|
|
70
|
+
|
|
71
|
+
### Axes
|
|
72
|
+
| Axis | Score | Weight |
|
|
73
|
+
|------|-------|--------|
|
|
74
|
+
| User Impact | ${score.axes.userImpact.toFixed(1)} | ${SCORING_WEIGHTS.userImpact} |
|
|
75
|
+
| Business Impact | ${score.axes.businessImpact.toFixed(1)} | ${SCORING_WEIGHTS.businessImpact} |
|
|
76
|
+
| Effort (inverted) | ${(10 - score.axes.effort).toFixed(1)} | ${SCORING_WEIGHTS.effort} |
|
|
77
|
+
| Security Risk (inv) | ${(10 - score.axes.securityRisk).toFixed(1)} | ${SCORING_WEIGHTS.securityRisk} |
|
|
78
|
+
| Confidence | ${score.axes.confidence.toFixed(1)} | ${SCORING_WEIGHTS.confidence} |
|
|
79
|
+
|
|
80
|
+
**Formula:** ${score.breakdown}`;
|
|
81
|
+
}
|
|
82
|
+
// ── RICE Scoring ─────────────────────────────────────────────
|
|
83
|
+
export function calculateRICEScore(reach, impact, confidence, effort) {
|
|
84
|
+
const riceScore = (reach * impact * (confidence / 100)) / effort;
|
|
85
|
+
return {
|
|
86
|
+
reach,
|
|
87
|
+
impact: Math.min(10, Math.max(1, impact)),
|
|
88
|
+
confidence: Math.min(100, Math.max(0, confidence)),
|
|
89
|
+
effort: Math.max(0.1, effort),
|
|
90
|
+
riceScore: Math.round(riceScore * 10) / 10,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export function parseRICEFromOutput(content) {
|
|
94
|
+
const reachMatch = content?.match(/RICE[\s\S]*?reach[:\s]+(\d+)/i);
|
|
95
|
+
const impactMatch = content?.match(/RICE[\s\S]*?impact[:\s]+(\d+)/i);
|
|
96
|
+
const confidenceMatch = content?.match(/RICE[\s\S]*?confidence[:\s]+(\d+)/i);
|
|
97
|
+
const effortMatch = content?.match(/RICE[\s\S]*?effort[:\s]+(\d+(?:\.\d+)?)/i);
|
|
98
|
+
return {
|
|
99
|
+
reach: reachMatch ? parseInt(reachMatch[1] ?? "0", 10) : undefined,
|
|
100
|
+
impact: impactMatch ? parseInt(impactMatch[1] ?? "0", 10) : undefined,
|
|
101
|
+
confidence: confidenceMatch ? parseInt(confidenceMatch[1] ?? "0", 10) : undefined,
|
|
102
|
+
effort: effortMatch ? parseFloat(effortMatch[1] ?? "0") : undefined,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export function rankByRICE(proposals) {
|
|
106
|
+
const scored = proposals
|
|
107
|
+
.filter((p) => p.riceScore !== undefined)
|
|
108
|
+
.map((p) => ({ id: p.id, riceScore: p.riceScore, rank: 0 }));
|
|
109
|
+
scored.sort((a, b) => b.riceScore.riceScore - a.riceScore.riceScore);
|
|
110
|
+
scored.forEach((item, index) => {
|
|
111
|
+
item.rank = index + 1;
|
|
112
|
+
});
|
|
113
|
+
return scored;
|
|
114
|
+
}
|
|
115
|
+
export function formatRICEScore(score) {
|
|
116
|
+
return `**RICE Score:** ${score.riceScore.toFixed(1)} (Reach: ${score.reach} × Impact: ${score.impact} × Confidence: ${score.confidence}% / Effort: ${score.effort})`;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=scoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/governance/scoring.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4CAA4C;AAC5C,+DAA+D;AAG/D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEtE,gEAAgE;AAEhE,MAAM,cAAc,GAAG,gEAAgE,CAAC;AACxF,MAAM,aAAa,GAAoC;IACrD,UAAU,EAAE,kCAAkC;IAC9C,cAAc,EAAE,sCAAsC;IACtD,MAAM,EAAE,8BAA8B;IACtC,YAAY,EAAE,oCAAoC;IAClD,UAAU,EAAE,kCAAkC;CAC/C,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAgC,EAAE,CAAC;QAC3F,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,C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B,MAAM,CAAC,CAAC,CAAC,EAA6C,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;SACnF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE/D,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACrE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,OAAO,mBAAmB,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,KAAK,CAAC,KAAK,cAAc,KAAK,CAAC,MAAM,kBAAkB,KAAK,CAAC,UAAU,eAAe,KAAK,CAAC,MAAM,GAAG,CAAC;AACxK,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentOutput, DAOConfig, Proposal, TallyResult, Vote } from "../types/index.js";
|
|
2
|
+
export declare function parseVoteFromOutput(agentId: string, agentName: string, weight: number, content: string): Vote | undefined;
|
|
3
|
+
export declare function parseVoteFromAgentOutput(output: AgentOutput): Vote | undefined;
|
|
4
|
+
export declare function tallyVotes(proposal: Proposal, config: DAOConfig): TallyResult;
|
|
5
|
+
export declare function formatTallyResult(tally: TallyResult): string;
|
|
6
|
+
//# sourceMappingURL=voting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAgB,MAAM,mBAAmB,CAAC;AAO3G,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,GAAG,SAAS,CAclB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAG9E;AAID,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,WAAW,CA0C7E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAe5D"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Core — Vote Parsing & Tally
|
|
3
|
+
// ============================================================
|
|
4
|
+
// ── Vote Parsing ─────────────────────────────────────────────
|
|
5
|
+
const VOTE_PATTERN = /##\s*Vote\s*\n\s*(for|against|abstain)/i;
|
|
6
|
+
const REASONING_PATTERN = /##\s*Reasoning\s*\n\s*([\s\S]*?)(?=\n##|$)/i;
|
|
7
|
+
export function parseVoteFromOutput(agentId, agentName, weight, content) {
|
|
8
|
+
const voteMatch = content.match(VOTE_PATTERN);
|
|
9
|
+
const reasoningMatch = content.match(REASONING_PATTERN);
|
|
10
|
+
const position = voteMatch?.[1]?.toLowerCase() || "abstain";
|
|
11
|
+
const reasoning = reasoningMatch?.[1]?.trim() || "No reasoning provided";
|
|
12
|
+
return {
|
|
13
|
+
agentId,
|
|
14
|
+
agentName,
|
|
15
|
+
position,
|
|
16
|
+
reasoning,
|
|
17
|
+
weight,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function parseVoteFromAgentOutput(output) {
|
|
21
|
+
if (!output.content)
|
|
22
|
+
return undefined;
|
|
23
|
+
return parseVoteFromOutput(output.agentId, output.agentName, 0, output.content);
|
|
24
|
+
}
|
|
25
|
+
// ── Tally ────────────────────────────────────────────────────
|
|
26
|
+
export function tallyVotes(proposal, config) {
|
|
27
|
+
const votes = proposal.votes || [];
|
|
28
|
+
const totalAgents = proposal.agentOutputs?.length || votes.length;
|
|
29
|
+
const weightedFor = votes.filter((v) => v.position === "for").reduce((sum, v) => sum + v.weight, 0);
|
|
30
|
+
const weightedAgainst = votes.filter((v) => v.position === "against").reduce((sum, v) => sum + v.weight, 0);
|
|
31
|
+
const weightedAbstain = votes.filter((v) => v.position === "abstain").reduce((sum, v) => sum + v.weight, 0);
|
|
32
|
+
const totalVotingWeight = weightedFor + weightedAgainst + weightedAbstain;
|
|
33
|
+
const votingAgents = votes.filter((v) => v.position !== "abstain").length;
|
|
34
|
+
// Quorum check: % of total agent weight that participated
|
|
35
|
+
const totalPossibleWeight = totalAgents > 0
|
|
36
|
+
? votes.reduce((sum, v) => sum + v.weight, 0) + (totalAgents - votes.length) * 1
|
|
37
|
+
: totalVotingWeight;
|
|
38
|
+
const quorumPercent = totalPossibleWeight > 0 ? Math.round((totalVotingWeight / totalPossibleWeight) * 100) : 0;
|
|
39
|
+
const quorumMet = quorumPercent >= config.quorumPercent;
|
|
40
|
+
// Approval: % of non-abstain weight that voted for
|
|
41
|
+
const decisiveWeight = weightedFor + weightedAgainst;
|
|
42
|
+
const approvalScore = decisiveWeight > 0 ? Math.round((weightedFor / decisiveWeight) * 100) : 0;
|
|
43
|
+
const approved = quorumMet && approvalScore >= config.approvalThreshold;
|
|
44
|
+
return {
|
|
45
|
+
proposalId: proposal.id,
|
|
46
|
+
approved,
|
|
47
|
+
quorumMet,
|
|
48
|
+
totalAgents,
|
|
49
|
+
votingAgents,
|
|
50
|
+
quorumPercent,
|
|
51
|
+
weightedFor,
|
|
52
|
+
weightedAgainst,
|
|
53
|
+
totalVotingWeight,
|
|
54
|
+
approvalScore,
|
|
55
|
+
votes,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function formatTallyResult(tally) {
|
|
59
|
+
const status = tally.approved ? "✅ APPROVED" : "❌ REJECTED";
|
|
60
|
+
const quorumStatus = tally.quorumMet ? "✅ Met" : "❌ Not met";
|
|
61
|
+
return `## Vote Tally — #${tally.proposalId}
|
|
62
|
+
|
|
63
|
+
**Result:** ${status}
|
|
64
|
+
**Quorum:** ${tally.quorumPercent}% / ${quorumStatus}
|
|
65
|
+
**Approval Score:** ${tally.approvalScore}%
|
|
66
|
+
**Votes Cast:** ${tally.votingAgents} / ${tally.totalAgents} agents
|
|
67
|
+
**Weighted For:** ${tally.weightedFor}
|
|
68
|
+
**Weighted Against:** ${tally.weightedAgainst}
|
|
69
|
+
|
|
70
|
+
### Vote Breakdown
|
|
71
|
+
${tally.votes.map((v) => `- ${v.agentName}: **${v.position}** (w=${v.weight}) — ${v.reasoning.slice(0, 100)}${v.reasoning.length > 100 ? "..." : ""}`).join("\n")}`;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=voting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wCAAwC;AACxC,+DAA+D;AAI/D,gEAAgE;AAEhE,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAExE,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,SAAiB,EACjB,MAAc,EACd,OAAe;IAEf,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAExD,MAAM,QAAQ,GAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAmB,IAAI,SAAS,CAAC;IAC9E,MAAM,SAA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,aAAa;QACb,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAkB;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;IAC5D,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;IAE7D,OAAO,oBAAoB,KAAK,CAAC,UAAU;;cAE/B,MAAM;cACN,KAAK,CAAC,aAAa,OAAO,YAAY;sBAC9B,KAAK,CAAC,aAAa;kBACvB,KAAK,CAAC,YAAY,MAAM,KAAK,CAAC,WAAW;oBACvC,KAAK,CAAC,WAAW;wBACb,KAAK,CAAC,eAAe;;;EAG3C,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,QAAQ,SAAS,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACpK,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HealthScore, HealthSnapshot, HealthWeights, Proposal, ProposalOutcome } from "./types/index.js";
|
|
2
|
+
export declare const DEFAULT_HEALTH_WEIGHTS: HealthWeights;
|
|
3
|
+
export declare function validateWeights(weights: Partial<HealthWeights>): {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
errors: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function computeHealthScore(proposals: Proposal[], outcomes: Record<number, ProposalOutcome>, weights?: HealthWeights): HealthScore;
|
|
8
|
+
export declare function formatHealthScore(score: HealthScore): string;
|
|
9
|
+
export declare function getHealthTrend(snapshots: HealthSnapshot[]): {
|
|
10
|
+
improving: boolean;
|
|
11
|
+
change: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function formatHealthTrend(trend: {
|
|
14
|
+
improving: boolean;
|
|
15
|
+
change: number;
|
|
16
|
+
}): string;
|
|
17
|
+
export declare function recordHealthSnapshot(): Promise<HealthSnapshot>;
|
|
18
|
+
export declare function getHealthSnapshots(): HealthSnapshot[];
|
|
19
|
+
export declare function getLatestHealthSnapshot(): HealthSnapshot | undefined;
|
|
20
|
+
export declare function generateDashboard(proposals: Proposal[], outcomes: Record<number, ProposalOutcome>, agents: {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
weight: number;
|
|
24
|
+
}[], snapshots?: HealthSnapshot[]): string;
|
|
25
|
+
//# sourceMappingURL=health-score.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-score.d.ts","sourceRoot":"","sources":["../src/health-score.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,WAAW,EACX,cAAc,EACd,aAAa,EACb,QAAQ,EACR,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,sBAAsB,EAAE,aAKpC,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CASrG;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,QAAQ,EAAE,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACzC,OAAO,GAAE,aAAsC,GAC9C,WAAW,CAmFb;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAe5D;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKlG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIvF;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,cAAc,CAAC,CAgCpE;AAED,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAErD;AAED,wBAAgB,uBAAuB,IAAI,cAAc,GAAG,SAAS,CAGpE;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,EAAE,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACzC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,EACtD,SAAS,CAAC,EAAE,cAAc,EAAE,GAC3B,MAAM,CA8CR"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Core — Health Score & Dashboard
|
|
3
|
+
// ============================================================
|
|
4
|
+
import { getState, saveState } from "./persistence.js";
|
|
5
|
+
export const DEFAULT_HEALTH_WEIGHTS = {
|
|
6
|
+
passRate: 25,
|
|
7
|
+
avgRating: 25,
|
|
8
|
+
deliberationDepth: 25,
|
|
9
|
+
participation: 25,
|
|
10
|
+
};
|
|
11
|
+
export function validateWeights(weights) {
|
|
12
|
+
const errors = [];
|
|
13
|
+
const values = Object.values(weights).filter((v) => v !== undefined);
|
|
14
|
+
const sum = values.reduce((a, b) => a + b, 0);
|
|
15
|
+
if (sum !== 100)
|
|
16
|
+
errors.push(`Weights must sum to 100, got ${sum}`);
|
|
17
|
+
for (const [k, v] of Object.entries(weights)) {
|
|
18
|
+
if (v !== undefined && (v < 0 || v > 100))
|
|
19
|
+
errors.push(`${k} must be 0-100`);
|
|
20
|
+
}
|
|
21
|
+
return { valid: errors.length === 0, errors };
|
|
22
|
+
}
|
|
23
|
+
export function computeHealthScore(proposals, outcomes, weights = DEFAULT_HEALTH_WEIGHTS) {
|
|
24
|
+
const resolved = proposals.filter((p) => p.status === "executed" || p.status === "rejected" || p.status === "failed");
|
|
25
|
+
const executed = proposals.filter((p) => p.status === "executed");
|
|
26
|
+
if (resolved.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
score: 0,
|
|
29
|
+
label: "No Data",
|
|
30
|
+
metrics: [],
|
|
31
|
+
insufficientData: true,
|
|
32
|
+
proposalCount: proposals.length,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Pass rate: % of resolved that were executed
|
|
36
|
+
const passRateRaw = resolved.length > 0 ? (executed.length / resolved.length) * 100 : 0;
|
|
37
|
+
// Avg rating: average of outcome ratings
|
|
38
|
+
const allRatings = Object.values(outcomes).flatMap((o) => o.ratings);
|
|
39
|
+
const avgRatingRaw = allRatings.length > 0
|
|
40
|
+
? (allRatings.reduce((sum, r) => sum + r.score, 0) / allRatings.length) * 20 // scale 1-5 to 0-100
|
|
41
|
+
: 0;
|
|
42
|
+
// Deliberation depth: avg agent outputs per proposal
|
|
43
|
+
const avgOutputs = proposals.length > 0 ? proposals.reduce((sum, p) => sum + (p.agentOutputs?.length || 0), 0) / proposals.length : 0;
|
|
44
|
+
const deliberationDepthRaw = Math.min(100, avgOutputs * 15); // 7 agents = ~100%
|
|
45
|
+
// Participation: % of proposals that reached deliberation
|
|
46
|
+
const deliberated = proposals.filter((p) => p.status !== "open").length;
|
|
47
|
+
const participationRaw = proposals.length > 0 ? (deliberated / proposals.length) * 100 : 0;
|
|
48
|
+
const metrics = [
|
|
49
|
+
{
|
|
50
|
+
name: "Pass Rate",
|
|
51
|
+
rawValue: passRateRaw,
|
|
52
|
+
normalizedScore: passRateRaw,
|
|
53
|
+
weight: weights.passRate,
|
|
54
|
+
contribution: (passRateRaw * weights.passRate) / 100,
|
|
55
|
+
displayValue: `${executed.length}/${resolved.length} executed`,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "Avg Rating",
|
|
59
|
+
rawValue: avgRatingRaw,
|
|
60
|
+
normalizedScore: avgRatingRaw,
|
|
61
|
+
weight: weights.avgRating,
|
|
62
|
+
contribution: (avgRatingRaw * weights.avgRating) / 100,
|
|
63
|
+
displayValue: allRatings.length > 0 ? `${(avgRatingRaw / 20).toFixed(1)}/5` : "No ratings",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Deliberation Depth",
|
|
67
|
+
rawValue: deliberationDepthRaw,
|
|
68
|
+
normalizedScore: deliberationDepthRaw,
|
|
69
|
+
weight: weights.deliberationDepth,
|
|
70
|
+
contribution: (deliberationDepthRaw * weights.deliberationDepth) / 100,
|
|
71
|
+
displayValue: `${avgOutputs.toFixed(1)} avg outputs/proposal`,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "Participation",
|
|
75
|
+
rawValue: participationRaw,
|
|
76
|
+
normalizedScore: participationRaw,
|
|
77
|
+
weight: weights.participation,
|
|
78
|
+
contribution: (participationRaw * weights.participation) / 100,
|
|
79
|
+
displayValue: `${deliberated}/${proposals.length} deliberated`,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
const score = Math.round(metrics.reduce((sum, m) => sum + m.contribution, 0));
|
|
83
|
+
let label;
|
|
84
|
+
if (score >= 80)
|
|
85
|
+
label = "Healthy";
|
|
86
|
+
else if (score >= 60)
|
|
87
|
+
label = "Stable";
|
|
88
|
+
else if (score >= 40)
|
|
89
|
+
label = "At Risk";
|
|
90
|
+
else
|
|
91
|
+
label = "Critical";
|
|
92
|
+
return {
|
|
93
|
+
score,
|
|
94
|
+
label,
|
|
95
|
+
metrics,
|
|
96
|
+
insufficientData: resolved.length < 3,
|
|
97
|
+
proposalCount: proposals.length,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export function formatHealthScore(score) {
|
|
101
|
+
let output = `# 🏥 DAO Health Score: ${score.score}/100 (${score.label})\n\n`;
|
|
102
|
+
if (score.insufficientData) {
|
|
103
|
+
output += `> ⚠️ Insufficient data (${score.proposalCount} proposals, need ≥3 resolved)\n\n`;
|
|
104
|
+
}
|
|
105
|
+
output += "## Metrics\n";
|
|
106
|
+
output += "| Metric | Score | Weight | Contribution |\n";
|
|
107
|
+
output += "|--------|-------|--------|-------------|\n";
|
|
108
|
+
for (const m of score.metrics) {
|
|
109
|
+
output += `| ${m.name} | ${m.normalizedScore.toFixed(1)} | ${m.weight}% | ${m.contribution.toFixed(1)} | ${m.displayValue}\n`;
|
|
110
|
+
}
|
|
111
|
+
return output;
|
|
112
|
+
}
|
|
113
|
+
export function getHealthTrend(snapshots) {
|
|
114
|
+
if (snapshots.length < 2)
|
|
115
|
+
return { improving: false, change: 0 };
|
|
116
|
+
const recent = snapshots.slice(-2);
|
|
117
|
+
const change = (recent[1]?.score ?? 0) - (recent[0]?.score ?? 0);
|
|
118
|
+
return { improving: change > 0, change };
|
|
119
|
+
}
|
|
120
|
+
export function formatHealthTrend(trend) {
|
|
121
|
+
const arrow = trend.improving ? "📈" : trend.change < 0 ? "📉" : "➡️";
|
|
122
|
+
const sign = trend.change > 0 ? "+" : "";
|
|
123
|
+
return `${arrow} ${sign}${trend.change.toFixed(1)} points`;
|
|
124
|
+
}
|
|
125
|
+
export async function recordHealthSnapshot() {
|
|
126
|
+
const state = getState();
|
|
127
|
+
const score = computeHealthScore(state.proposals, state.outcomes, state.config.healthWeights);
|
|
128
|
+
const now = new Date();
|
|
129
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
130
|
+
const week = Math.ceil(((now.getTime() - start.getTime()) / 86400000 + start.getDay() + 1) / 7);
|
|
131
|
+
const weekKey = `${now.getFullYear()}-W${week.toString().padStart(2, "0")}`;
|
|
132
|
+
const snapshot = {
|
|
133
|
+
weekKey,
|
|
134
|
+
year: now.getFullYear(),
|
|
135
|
+
week,
|
|
136
|
+
score: score.score,
|
|
137
|
+
metrics: score.metrics,
|
|
138
|
+
proposalCount: score.proposalCount,
|
|
139
|
+
createdAt: now.toISOString(),
|
|
140
|
+
};
|
|
141
|
+
if (!state.healthSnapshots)
|
|
142
|
+
state.healthSnapshots = [];
|
|
143
|
+
const existingIndex = state.healthSnapshots.findIndex((s) => s.weekKey === snapshot.weekKey);
|
|
144
|
+
if (existingIndex !== -1) {
|
|
145
|
+
state.healthSnapshots[existingIndex] = snapshot;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
state.healthSnapshots.push(snapshot);
|
|
149
|
+
}
|
|
150
|
+
// Prune to last 52 snapshots to avoid unbounded growth
|
|
151
|
+
if (state.healthSnapshots.length > 52) {
|
|
152
|
+
state.healthSnapshots = state.healthSnapshots.slice(-52);
|
|
153
|
+
}
|
|
154
|
+
await saveState();
|
|
155
|
+
return snapshot;
|
|
156
|
+
}
|
|
157
|
+
export function getHealthSnapshots() {
|
|
158
|
+
return getState().healthSnapshots ?? [];
|
|
159
|
+
}
|
|
160
|
+
export function getLatestHealthSnapshot() {
|
|
161
|
+
const snaps = getState().healthSnapshots;
|
|
162
|
+
return snaps && snaps.length > 0 ? snaps[snaps.length - 1] : undefined;
|
|
163
|
+
}
|
|
164
|
+
export function generateDashboard(proposals, outcomes, agents, snapshots) {
|
|
165
|
+
const byStatus = {};
|
|
166
|
+
for (const p of proposals) {
|
|
167
|
+
byStatus[p.status] = (byStatus[p.status] || 0) + 1;
|
|
168
|
+
}
|
|
169
|
+
const health = computeHealthScore(proposals, outcomes);
|
|
170
|
+
let output = "# 🏛️ DAO Dashboard\n\n";
|
|
171
|
+
output += `## Overview\n`;
|
|
172
|
+
output += `- **Proposals:** ${proposals.length} total\n`;
|
|
173
|
+
output += `- **Agents:** ${agents.length} active (${agents.reduce((s, a) => s + a.weight, 0)} total weight)\n`;
|
|
174
|
+
output += `- **Health:** ${health.score}/100 ${health.label}\n\n`;
|
|
175
|
+
output += `## Proposal Pipeline\n`;
|
|
176
|
+
for (const [status, count] of Object.entries(byStatus)) {
|
|
177
|
+
const emoji = { open: "📝", deliberating: "🗳️", approved: "✅", controlled: "🛡️", rejected: "❌", executed: "🚀", failed: "💥" }[status] || "•";
|
|
178
|
+
output += `- ${emoji} ${status}: ${count}\n`;
|
|
179
|
+
}
|
|
180
|
+
if (health.metrics.length > 0) {
|
|
181
|
+
output += `\n## Health Metrics\n`;
|
|
182
|
+
for (const m of health.metrics) {
|
|
183
|
+
const bar = "█".repeat(Math.round(m.normalizedScore / 10)).padEnd(10, "░");
|
|
184
|
+
output += `- ${m.name}: ${bar} ${m.normalizedScore.toFixed(0)}% (${m.displayValue})\n`;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const openProposals = proposals.filter((p) => p.status === "open" || p.status === "deliberating");
|
|
188
|
+
if (openProposals.length > 0) {
|
|
189
|
+
output += `\n## Open Proposals\n`;
|
|
190
|
+
for (const p of openProposals) {
|
|
191
|
+
output += `- #${p.id}: ${p.title} (${p.type})\n`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Show health trend if snapshots exist
|
|
195
|
+
if (snapshots && snapshots.length >= 2) {
|
|
196
|
+
output += `\n## Health Trend\n`;
|
|
197
|
+
output += `${formatHealthTrend(getHealthTrend(snapshots))}\n`;
|
|
198
|
+
}
|
|
199
|
+
return output;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=health-score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health-score.js","sourceRoot":"","sources":["../src/health-score.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4CAA4C;AAC5C,+DAA+D;AAE/D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAUvD,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;IACb,iBAAiB,EAAE,EAAE;IACrB,aAAa,EAAE,EA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C,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC;IAClG,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,uBAAuB,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;YAC9B,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC;QACnD,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,qBAAqB,CAAC;QAChC,MAAM,IAAI,GAAG,iBAAiB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./agents/index.js";
|
|
2
|
+
export * from "./config.js";
|
|
3
|
+
export * from "./control/index.js";
|
|
4
|
+
export * from "./delivery/index.js";
|
|
5
|
+
export * from "./governance/index.js";
|
|
6
|
+
export * from "./health-score.js";
|
|
7
|
+
export * from "./integrations/index.js";
|
|
8
|
+
export * from "./intelligence/index.js";
|
|
9
|
+
export * from "./intelligence/roundtable.js";
|
|
10
|
+
export * from "./observability/index.js";
|
|
11
|
+
export * from "./persistence.js";
|
|
12
|
+
export * from "./types/index.js";
|
|
13
|
+
export * from "./utils/host.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,mBAAmB,CAAC;AAElC,cAAc,aAAa,CAAC;AAE5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,mBAAmB,CAAC;AAElC,cAAc,yBAAyB,CAAC;AAExC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Swarm DAO Core — Public API
|
|
3
|
+
// ============================================================
|
|
4
|
+
// Agents
|
|
5
|
+
export * from "./agents/index.js";
|
|
6
|
+
// Configuration
|
|
7
|
+
export * from "./config.js";
|
|
8
|
+
// Control (L4)
|
|
9
|
+
export * from "./control/index.js";
|
|
10
|
+
// Delivery (L3)
|
|
11
|
+
export * from "./delivery/index.js";
|
|
12
|
+
// Governance (L1)
|
|
13
|
+
export * from "./governance/index.js";
|
|
14
|
+
// Health Score
|
|
15
|
+
export * from "./health-score.js";
|
|
16
|
+
// Integrations
|
|
17
|
+
export * from "./integrations/index.js";
|
|
18
|
+
// Intelligence (L2)
|
|
19
|
+
export * from "./intelligence/index.js";
|
|
20
|
+
export * from "./intelligence/roundtable.js";
|
|
21
|
+
// Observability
|
|
22
|
+
export * from "./observability/index.js";
|
|
23
|
+
// Persistence
|
|
24
|
+
export * from "./persistence.js";
|
|
25
|
+
// Types
|
|
26
|
+
export * from "./types/index.js";
|
|
27
|
+
// Utils
|
|
28
|
+
export * from "./utils/host.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,8BAA8B;AAC9B,+DAA+D;AAE/D,SAAS;AACT,cAAc,mBAAmB,CAAC;AAClC,gBAAgB;AAChB,cAAc,aAAa,CAAC;AAC5B,eAAe;AACf,cAAc,oBAAoB,CAAC;AACnC,gBAAgB;AAChB,cAAc,qBAAqB,CAAC;AACpC,kBAAkB;AAClB,cAAc,uBAAuB,CAAC;AACtC,eAAe;AACf,cAAc,mBAAmB,CAAC;AAClC,eAAe;AACf,cAAc,yBAAyB,CAAC;AACxC,oBAAoB;AACpB,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,gBAAgB;AAChB,cAAc,0BAA0B,CAAC;AACzC,cAAc;AACd,cAAc,kBAAkB,CAAC;AACjC,QAAQ;AACR,cAAc,kBAAkB,CAAC;AACjC,QAAQ;AACR,cAAc,iBAAiB,CAAC"}
|