Add lucidia.yml DSL configuration with agent definitions and tests
Co-authored-by: blackboxprogramming <118287761+blackboxprogramming@users.noreply.github.com>
This commit is contained in:
116
lucidia.yml
Normal file
116
lucidia.yml
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
# 🧠 lucidia.yml — Lucidia DSL Agent Orchestration Configuration
|
||||||
|
# The highest form of intelligence orchestration in the BlackRoad OS system.
|
||||||
|
|
||||||
|
version: "1.0"
|
||||||
|
meta:
|
||||||
|
name: Lucidia
|
||||||
|
description: |
|
||||||
|
Central meta-agent language for BlackRoad OS.
|
||||||
|
Self-describing, interpretable, and fully routable via DSL.
|
||||||
|
|
||||||
|
# Emoji definitions for agent communication
|
||||||
|
emoji_registry:
|
||||||
|
status:
|
||||||
|
"✅": "Done"
|
||||||
|
"❌": "Blocked"
|
||||||
|
"🛟": "Escalation"
|
||||||
|
"🤔": "Needs Review"
|
||||||
|
"📊": "Metrics"
|
||||||
|
"🟡": "In Progress"
|
||||||
|
"⬜": "Not Started"
|
||||||
|
"🔁": "Rework"
|
||||||
|
reactions:
|
||||||
|
"✅": "close_issue"
|
||||||
|
"❌": "label_blocked"
|
||||||
|
"🛟": "notify_guardian_agent"
|
||||||
|
"🤔": "assign_reviewer"
|
||||||
|
|
||||||
|
# Agent definitions
|
||||||
|
agents:
|
||||||
|
codex-digest-agent:
|
||||||
|
role: interpreter
|
||||||
|
description: |
|
||||||
|
Translates weekly emoji-based agent performance data into executive summaries.
|
||||||
|
Reacts to: ✅ ❌ 🛟 🤔 📊
|
||||||
|
Outputs Markdown.
|
||||||
|
triggers:
|
||||||
|
- source: digest.js
|
||||||
|
- command: "summarize agent performance"
|
||||||
|
traits:
|
||||||
|
- math: emoji-count-ratio
|
||||||
|
- language: executive-tone
|
||||||
|
- emoji-native: true
|
||||||
|
outputs:
|
||||||
|
- markdown-summary
|
||||||
|
- actionable-recommendations
|
||||||
|
- escalation-alerts
|
||||||
|
integrations:
|
||||||
|
- slack
|
||||||
|
- gpt
|
||||||
|
- prism-console
|
||||||
|
|
||||||
|
guardian-agent:
|
||||||
|
role: sentinel
|
||||||
|
description: |
|
||||||
|
Security and escalation watchdog.
|
||||||
|
Monitors for blocked items and escalations.
|
||||||
|
Alerts security team and planner when issues arise.
|
||||||
|
responds_to:
|
||||||
|
- "🛟"
|
||||||
|
- "❌"
|
||||||
|
alerts:
|
||||||
|
- security-team
|
||||||
|
- planner-agent
|
||||||
|
traits:
|
||||||
|
- priority: high
|
||||||
|
- watch: continuous
|
||||||
|
- emoji-native: true
|
||||||
|
|
||||||
|
planner-agent:
|
||||||
|
role: orchestrator
|
||||||
|
description: |
|
||||||
|
Plans and coordinates work across agents.
|
||||||
|
Receives escalations from guardian-agent.
|
||||||
|
responds_to:
|
||||||
|
- "📊"
|
||||||
|
- "🤔"
|
||||||
|
inputs:
|
||||||
|
- digest-summaries
|
||||||
|
- escalation-alerts
|
||||||
|
outputs:
|
||||||
|
- task-assignments
|
||||||
|
- priority-updates
|
||||||
|
traits:
|
||||||
|
- planning: adaptive
|
||||||
|
- emoji-native: true
|
||||||
|
|
||||||
|
# Routing rules for agent orchestration
|
||||||
|
routing:
|
||||||
|
digest-to-escalation:
|
||||||
|
condition: "blocked_percentage > 15"
|
||||||
|
from: codex-digest-agent
|
||||||
|
to: planner-agent
|
||||||
|
action: escalate
|
||||||
|
|
||||||
|
escalation-to-guardian:
|
||||||
|
condition: "emoji == '🛟'"
|
||||||
|
from: any
|
||||||
|
to: guardian-agent
|
||||||
|
action: alert
|
||||||
|
|
||||||
|
# Output configuration
|
||||||
|
outputs:
|
||||||
|
markdown-summary:
|
||||||
|
format: markdown
|
||||||
|
destination:
|
||||||
|
- docs/
|
||||||
|
- slack
|
||||||
|
actionable-recommendations:
|
||||||
|
format: json
|
||||||
|
destination:
|
||||||
|
- api/recommendations
|
||||||
|
escalation-alerts:
|
||||||
|
format: notification
|
||||||
|
destination:
|
||||||
|
- guardian-agent
|
||||||
|
- security-team
|
||||||
16
package-lock.json
generated
16
package-lock.json
generated
@@ -29,7 +29,8 @@
|
|||||||
"supertest": "^7.1.4",
|
"supertest": "^7.1.4",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vitest": "^4.0.13"
|
"vitest": "^4.0.13",
|
||||||
|
"yaml": "^2.8.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@acemir/cssom": {
|
"node_modules/@acemir/cssom": {
|
||||||
@@ -5063,6 +5064,19 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/yaml": {
|
||||||
|
"version": "2.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
|
||||||
|
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"bin": {
|
||||||
|
"yaml": "bin.mjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/yn": {
|
"node_modules/yn": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"supertest": "^7.1.4",
|
"supertest": "^7.1.4",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vitest": "^4.0.13"
|
"vitest": "^4.0.13",
|
||||||
|
"yaml": "^2.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
77
tests/lucidia.test.ts
Normal file
77
tests/lucidia.test.ts
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { readFileSync } from "fs";
|
||||||
|
import { parse } from "yaml";
|
||||||
|
import { join } from "path";
|
||||||
|
|
||||||
|
describe("lucidia.yml", () => {
|
||||||
|
const lucidiaPath = join(__dirname, "..", "lucidia.yml");
|
||||||
|
const lucidiaContent = readFileSync(lucidiaPath, "utf8");
|
||||||
|
const lucidia = parse(lucidiaContent);
|
||||||
|
|
||||||
|
it("has required version and meta fields", () => {
|
||||||
|
expect(lucidia.version).toBe("1.0");
|
||||||
|
expect(lucidia.meta).toBeDefined();
|
||||||
|
expect(lucidia.meta.name).toBe("Lucidia");
|
||||||
|
expect(lucidia.meta.description).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("defines emoji registry with status and reactions", () => {
|
||||||
|
expect(lucidia.emoji_registry).toBeDefined();
|
||||||
|
expect(lucidia.emoji_registry.status).toBeDefined();
|
||||||
|
expect(lucidia.emoji_registry.reactions).toBeDefined();
|
||||||
|
|
||||||
|
// Verify key emoji mappings
|
||||||
|
expect(lucidia.emoji_registry.status["✅"]).toBe("Done");
|
||||||
|
expect(lucidia.emoji_registry.status["❌"]).toBe("Blocked");
|
||||||
|
expect(lucidia.emoji_registry.status["🛟"]).toBe("Escalation");
|
||||||
|
expect(lucidia.emoji_registry.status["🤔"]).toBe("Needs Review");
|
||||||
|
expect(lucidia.emoji_registry.status["📊"]).toBe("Metrics");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("defines codex-digest-agent with required properties", () => {
|
||||||
|
const agent = lucidia.agents["codex-digest-agent"];
|
||||||
|
expect(agent).toBeDefined();
|
||||||
|
expect(agent.role).toBe("interpreter");
|
||||||
|
expect(agent.description).toContain("emoji-based agent performance");
|
||||||
|
expect(agent.triggers).toBeInstanceOf(Array);
|
||||||
|
expect(agent.traits).toBeInstanceOf(Array);
|
||||||
|
expect(agent.outputs).toBeInstanceOf(Array);
|
||||||
|
expect(agent.outputs).toContain("markdown-summary");
|
||||||
|
expect(agent.outputs).toContain("actionable-recommendations");
|
||||||
|
expect(agent.outputs).toContain("escalation-alerts");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("defines guardian-agent with sentinel role", () => {
|
||||||
|
const agent = lucidia.agents["guardian-agent"];
|
||||||
|
expect(agent).toBeDefined();
|
||||||
|
expect(agent.role).toBe("sentinel");
|
||||||
|
expect(agent.responds_to).toContain("🛟");
|
||||||
|
expect(agent.responds_to).toContain("❌");
|
||||||
|
expect(agent.alerts).toContain("security-team");
|
||||||
|
expect(agent.alerts).toContain("planner-agent");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("defines planner-agent for orchestration", () => {
|
||||||
|
const agent = lucidia.agents["planner-agent"];
|
||||||
|
expect(agent).toBeDefined();
|
||||||
|
expect(agent.role).toBe("orchestrator");
|
||||||
|
expect(agent.responds_to).toContain("📊");
|
||||||
|
expect(agent.responds_to).toContain("🤔");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("has routing rules for agent orchestration", () => {
|
||||||
|
expect(lucidia.routing).toBeDefined();
|
||||||
|
expect(lucidia.routing["digest-to-escalation"]).toBeDefined();
|
||||||
|
expect(lucidia.routing["digest-to-escalation"].from).toBe("codex-digest-agent");
|
||||||
|
expect(lucidia.routing["escalation-to-guardian"]).toBeDefined();
|
||||||
|
expect(lucidia.routing["escalation-to-guardian"].to).toBe("guardian-agent");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("has output configuration for different formats", () => {
|
||||||
|
expect(lucidia.outputs).toBeDefined();
|
||||||
|
expect(lucidia.outputs["markdown-summary"]).toBeDefined();
|
||||||
|
expect(lucidia.outputs["markdown-summary"].format).toBe("markdown");
|
||||||
|
expect(lucidia.outputs["actionable-recommendations"]).toBeDefined();
|
||||||
|
expect(lucidia.outputs["escalation-alerts"]).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user