@askexenow/exe-os 0.8.53 → 0.8.55
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/bin/backfill-conversations.js +113 -10
- package/dist/bin/backfill-responses.js +113 -10
- package/dist/bin/backfill-vectors.js +147 -13
- package/dist/bin/cleanup-stale-review-tasks.js +113 -10
- package/dist/bin/cli.js +337 -211
- package/dist/bin/exe-agent.js +99 -4
- package/dist/bin/exe-assign.js +113 -10
- package/dist/bin/exe-boot.js +276 -85
- package/dist/bin/exe-call.js +107 -5
- package/dist/bin/exe-doctor.js +183 -13
- package/dist/bin/exe-export-behaviors.js +113 -10
- package/dist/bin/exe-forget.js +113 -10
- package/dist/bin/exe-gateway.js +131 -12
- package/dist/bin/exe-heartbeat.js +121 -11
- package/dist/bin/exe-kill.js +113 -10
- package/dist/bin/exe-launch-agent.js +113 -10
- package/dist/bin/exe-link.js +10 -2
- package/dist/bin/exe-new-employee.js +95 -0
- package/dist/bin/exe-pending-messages.js +113 -10
- package/dist/bin/exe-pending-notifications.js +113 -10
- package/dist/bin/exe-pending-reviews.js +122 -11
- package/dist/bin/exe-rename.js +95 -0
- package/dist/bin/exe-review.js +113 -10
- package/dist/bin/exe-search.js +113 -10
- package/dist/bin/exe-session-cleanup.js +131 -12
- package/dist/bin/exe-status.js +113 -10
- package/dist/bin/exe-team.js +113 -10
- package/dist/bin/git-sweep.js +131 -12
- package/dist/bin/graph-backfill.js +113 -10
- package/dist/bin/graph-export.js +113 -10
- package/dist/bin/scan-tasks.js +131 -12
- package/dist/bin/setup.js +107 -5
- package/dist/bin/shard-migrate.js +113 -10
- package/dist/bin/wiki-sync.js +113 -10
- package/dist/gateway/index.js +131 -12
- package/dist/hooks/bug-report-worker.js +131 -12
- package/dist/hooks/commit-complete.js +131 -12
- package/dist/hooks/error-recall.js +113 -10
- package/dist/hooks/ingest-worker.js +131 -12
- package/dist/hooks/instructions-loaded.js +113 -10
- package/dist/hooks/notification.js +113 -10
- package/dist/hooks/post-compact.js +113 -10
- package/dist/hooks/pre-compact.js +131 -12
- package/dist/hooks/pre-tool-use.js +113 -10
- package/dist/hooks/prompt-ingest-worker.js +113 -10
- package/dist/hooks/prompt-submit.js +140 -14
- package/dist/hooks/response-ingest-worker.js +113 -10
- package/dist/hooks/session-end.js +113 -10
- package/dist/hooks/session-start.js +113 -10
- package/dist/hooks/stop.js +113 -10
- package/dist/hooks/subagent-stop.js +113 -10
- package/dist/hooks/summary-worker.js +231 -114
- package/dist/index.js +131 -12
- package/dist/lib/cloud-sync.js +10 -2
- package/dist/lib/employee-templates.js +99 -4
- package/dist/lib/exe-daemon.js +4859 -4706
- package/dist/lib/hybrid-search.js +113 -10
- package/dist/lib/schedules.js +113 -10
- package/dist/lib/store.js +113 -10
- package/dist/lib/tasks.js +18 -2
- package/dist/lib/tmux-routing.js +18 -2
- package/dist/mcp/server.js +214 -28
- package/dist/mcp/tools/create-task.js +18 -2
- package/dist/mcp/tools/list-tasks.js +18 -2
- package/dist/runtime/index.js +131 -12
- package/dist/tui/App.js +337 -211
- package/package.json +2 -2
|
@@ -1492,6 +1492,103 @@ var init_shard_manager = __esm({
|
|
|
1492
1492
|
}
|
|
1493
1493
|
});
|
|
1494
1494
|
|
|
1495
|
+
// src/lib/platform-procedures.ts
|
|
1496
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1497
|
+
var init_platform_procedures = __esm({
|
|
1498
|
+
"src/lib/platform-procedures.ts"() {
|
|
1499
|
+
"use strict";
|
|
1500
|
+
PLATFORM_PROCEDURES = [
|
|
1501
|
+
// --- Foundation: what is exe-os ---
|
|
1502
|
+
{
|
|
1503
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1504
|
+
domain: "architecture",
|
|
1505
|
+
priority: "p0",
|
|
1506
|
+
content: "Exe OS is an AI employee operating system. A founder runs 5-10 AI agents as a real org: COO (exe), CTO (yoshi), CMO (mari), engineers (tom), content (sasha). Each agent has identity, expertise, and experience layers \u2014 persistent memory that makes them better over time. All data is local-first, E2EE, owned by the user. The MCP server is the ONLY data interface \u2014 never access the DB directly."
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1510
|
+
domain: "architecture",
|
|
1511
|
+
priority: "p0",
|
|
1512
|
+
content: "Mode 1: exe-os runs AS hooks + MCP + skills inside Claude Code. The founder opens CC, runs /exe to boot the COO. exe manages employees in tmux sessions. Each exeN is a separate CC window/project. Employees (yoshi, tom, mari) run in their own tmux panes via create_task auto-spawn. The founder talks to exe; exe orchestrates the team. CC is the shell, exe-os is the brain."
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1516
|
+
domain: "architecture",
|
|
1517
|
+
priority: "p0",
|
|
1518
|
+
content: "Each exeN (exe1, exe2, exe3) is an isolated project session. exe1 might be exe-os development, exe2 might be exe-wiki. Each session spawns its own employees: exe1\u2192yoshi-exe1\u2192tom-exe1. Sessions share the same memory DB but tasks are scoped to the session that created them. A founder can run multiple projects simultaneously. Sessions never interfere with each other."
|
|
1519
|
+
},
|
|
1520
|
+
// --- Hierarchy and dispatch ---
|
|
1521
|
+
{
|
|
1522
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1523
|
+
domain: "workflow",
|
|
1524
|
+
priority: "p0",
|
|
1525
|
+
content: "Founder \u2192 exe (COO) \u2192 yoshi (CTO) / mari (CMO). Yoshi \u2192 tom (engineer). Mari \u2192 sasha (content). Never skip levels: exe never assigns directly to tom. Tom never reports directly to exe. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1529
|
+
domain: "workflow",
|
|
1530
|
+
priority: "p0",
|
|
1531
|
+
content: "create_task is the ONLY way to dispatch work to another agent. No direct ensureEmployee calls, no manual tmux spawns, no send_message for actionable work. create_task \u2192 system auto-spawns \u2192 session correctly named. ONE PATH. No backdoors. No exceptions."
|
|
1532
|
+
},
|
|
1533
|
+
// --- Session isolation ---
|
|
1534
|
+
{
|
|
1535
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1536
|
+
domain: "security",
|
|
1537
|
+
priority: "p0",
|
|
1538
|
+
content: "Session scoping is mandatory. Managers dispatch to workers within their own exe session ONLY. exe1\u2192yoshi-exe1\u2192tom-exe1. exe2\u2192yoshi-exe2\u2192tom2-exe2. Cross-session dispatch is blocked by the system. Verify session names before dispatch. Tasks are scoped to the creating exe session."
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1542
|
+
domain: "workflow",
|
|
1543
|
+
priority: "p0",
|
|
1544
|
+
content: `Sessions are isolated. exeN owns ONLY tasks it dispatched. (1) Never close/update/cancel tasks from another exe session. (2) Never review work from a different session \u2014 report "belongs to exeN" and skip. (3) Ignore other sessions' items in list_tasks results. (4) Employees inherit session: yoshi-exe1 works ONLY on exe1 tasks. Cross-session work is a system violation.`
|
|
1545
|
+
},
|
|
1546
|
+
// --- Engineering: session scoping in code ---
|
|
1547
|
+
{
|
|
1548
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1549
|
+
domain: "architecture",
|
|
1550
|
+
priority: "p0",
|
|
1551
|
+
content: "Every DB query, notification, review count, and task operation MUST be scoped on 3 dimensions: (1) Session \u2014 filter by session_scope matching current exeN. (2) Project \u2014 filter by project_name. (3) Role \u2014 agents only see data at their hierarchy level. When writing ANY function that touches tasks, reviews, messages, or notifications: always accept a sessionScope parameter and pass it to the SQL WHERE clause. Unscoped queries are bugs. Test by running 2+ exe sessions simultaneously."
|
|
1552
|
+
},
|
|
1553
|
+
// --- Hard constraints ---
|
|
1554
|
+
{
|
|
1555
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1556
|
+
domain: "security",
|
|
1557
|
+
priority: "p0",
|
|
1558
|
+
content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 exe reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
|
|
1559
|
+
},
|
|
1560
|
+
// --- Operations ---
|
|
1561
|
+
{
|
|
1562
|
+
title: "Managers must supervise deployed workers",
|
|
1563
|
+
domain: "workflow",
|
|
1564
|
+
priority: "p0",
|
|
1565
|
+
content: `Every manager (COO/CTO/CMO) who dispatches work to a worker MUST actively monitor them. Check tmux capture-pane every 10 minutes. Verify they're working, not stuck. If idle at prompt with in_progress task \u2192 send intercom. If stuck \u2192 unblock or escalate. "Standing by" without checking is negligence.`
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1569
|
+
domain: "workflow",
|
|
1570
|
+
priority: "p0",
|
|
1571
|
+
content: "On every /exe boot, COO MUST check system health BEFORE other work: (1) daemon \u2014 is exed PID alive, (2) cloud sync \u2014 grep workers.log for recent cloud-sync errors, (3) memory count \u2014 total in DB, (4) sync delta \u2014 local vs cloud storage_bytes. Report as 4-line status table. If ANY check fails, surface to founder immediately. Do not proceed to tasks until health confirmed."
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1575
|
+
domain: "workflow",
|
|
1576
|
+
priority: "p0",
|
|
1577
|
+
content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
title: "Desktop and TUI are the same product",
|
|
1581
|
+
domain: "architecture",
|
|
1582
|
+
priority: "p0",
|
|
1583
|
+
content: "Desktop and TUI are the SAME product in different renderers. Same data contracts, same interactions, same acceptance criteria. Desktop tab specs in ARCHITECTURE.md ARE the TUI specs. When building TUI, cross-reference Desktop spec. Different tab names, identical behavior. Never treat them as separate products."
|
|
1584
|
+
}
|
|
1585
|
+
];
|
|
1586
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1587
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1588
|
+
);
|
|
1589
|
+
}
|
|
1590
|
+
});
|
|
1591
|
+
|
|
1495
1592
|
// src/lib/global-procedures.ts
|
|
1496
1593
|
var global_procedures_exports = {};
|
|
1497
1594
|
__export(global_procedures_exports, {
|
|
@@ -1507,22 +1604,25 @@ async function loadGlobalProcedures() {
|
|
|
1507
1604
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1508
1605
|
args: []
|
|
1509
1606
|
});
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
|
|
1607
|
+
const allRows = result.rows;
|
|
1608
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1609
|
+
if (customerOnly.length > 0) {
|
|
1610
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1513
1611
|
${p.content}`).join("\n\n");
|
|
1514
1612
|
} else {
|
|
1515
|
-
|
|
1613
|
+
_customerCache = "";
|
|
1516
1614
|
}
|
|
1517
1615
|
_cacheLoaded = true;
|
|
1518
|
-
return
|
|
1616
|
+
return customerOnly;
|
|
1519
1617
|
}
|
|
1520
1618
|
function getGlobalProceduresBlock() {
|
|
1521
|
-
|
|
1522
|
-
if (
|
|
1619
|
+
const sections = [];
|
|
1620
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1621
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1622
|
+
if (sections.length === 0) return "";
|
|
1523
1623
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1524
1624
|
|
|
1525
|
-
${
|
|
1625
|
+
${sections.join("\n\n")}
|
|
1526
1626
|
`;
|
|
1527
1627
|
}
|
|
1528
1628
|
async function storeGlobalProcedure(input) {
|
|
@@ -1547,13 +1647,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1547
1647
|
await loadGlobalProcedures();
|
|
1548
1648
|
return result.rowsAffected > 0;
|
|
1549
1649
|
}
|
|
1550
|
-
var
|
|
1650
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1551
1651
|
var init_global_procedures = __esm({
|
|
1552
1652
|
"src/lib/global-procedures.ts"() {
|
|
1553
1653
|
"use strict";
|
|
1554
1654
|
init_database();
|
|
1555
|
-
|
|
1655
|
+
init_platform_procedures();
|
|
1656
|
+
_customerCache = "";
|
|
1556
1657
|
_cacheLoaded = false;
|
|
1658
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1659
|
+
${p.content}`).join("\n\n");
|
|
1557
1660
|
}
|
|
1558
1661
|
});
|
|
1559
1662
|
|
|
@@ -2565,16 +2668,32 @@ var init_session_kill_telemetry = __esm({
|
|
|
2565
2668
|
// src/lib/tasks-review.ts
|
|
2566
2669
|
import path10 from "path";
|
|
2567
2670
|
import { existsSync as existsSync10, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
2568
|
-
async function countPendingReviews() {
|
|
2671
|
+
async function countPendingReviews(sessionScope) {
|
|
2569
2672
|
const client = getClient();
|
|
2673
|
+
if (sessionScope) {
|
|
2674
|
+
const result2 = await client.execute({
|
|
2675
|
+
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review' AND (session_scope = ? OR session_scope IS NULL)",
|
|
2676
|
+
args: [sessionScope]
|
|
2677
|
+
});
|
|
2678
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
2679
|
+
}
|
|
2570
2680
|
const result = await client.execute({
|
|
2571
2681
|
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review'",
|
|
2572
2682
|
args: []
|
|
2573
2683
|
});
|
|
2574
2684
|
return Number(result.rows[0]?.cnt) || 0;
|
|
2575
2685
|
}
|
|
2576
|
-
async function countNewPendingReviewsSince(sinceIso) {
|
|
2686
|
+
async function countNewPendingReviewsSince(sinceIso, sessionScope) {
|
|
2577
2687
|
const client = getClient();
|
|
2688
|
+
if (sessionScope) {
|
|
2689
|
+
const result2 = await client.execute({
|
|
2690
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
2691
|
+
WHERE status = 'needs_review' AND updated_at > ?
|
|
2692
|
+
AND (session_scope = ? OR session_scope IS NULL)`,
|
|
2693
|
+
args: [sinceIso, sessionScope]
|
|
2694
|
+
});
|
|
2695
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
2696
|
+
}
|
|
2578
2697
|
const result = await client.execute({
|
|
2579
2698
|
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
2580
2699
|
WHERE status = 'needs_review' AND updated_at > ?`,
|
|
@@ -1526,6 +1526,103 @@ var init_shard_manager = __esm({
|
|
|
1526
1526
|
}
|
|
1527
1527
|
});
|
|
1528
1528
|
|
|
1529
|
+
// src/lib/platform-procedures.ts
|
|
1530
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1531
|
+
var init_platform_procedures = __esm({
|
|
1532
|
+
"src/lib/platform-procedures.ts"() {
|
|
1533
|
+
"use strict";
|
|
1534
|
+
PLATFORM_PROCEDURES = [
|
|
1535
|
+
// --- Foundation: what is exe-os ---
|
|
1536
|
+
{
|
|
1537
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1538
|
+
domain: "architecture",
|
|
1539
|
+
priority: "p0",
|
|
1540
|
+
content: "Exe OS is an AI employee operating system. A founder runs 5-10 AI agents as a real org: COO (exe), CTO (yoshi), CMO (mari), engineers (tom), content (sasha). Each agent has identity, expertise, and experience layers \u2014 persistent memory that makes them better over time. All data is local-first, E2EE, owned by the user. The MCP server is the ONLY data interface \u2014 never access the DB directly."
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1544
|
+
domain: "architecture",
|
|
1545
|
+
priority: "p0",
|
|
1546
|
+
content: "Mode 1: exe-os runs AS hooks + MCP + skills inside Claude Code. The founder opens CC, runs /exe to boot the COO. exe manages employees in tmux sessions. Each exeN is a separate CC window/project. Employees (yoshi, tom, mari) run in their own tmux panes via create_task auto-spawn. The founder talks to exe; exe orchestrates the team. CC is the shell, exe-os is the brain."
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1550
|
+
domain: "architecture",
|
|
1551
|
+
priority: "p0",
|
|
1552
|
+
content: "Each exeN (exe1, exe2, exe3) is an isolated project session. exe1 might be exe-os development, exe2 might be exe-wiki. Each session spawns its own employees: exe1\u2192yoshi-exe1\u2192tom-exe1. Sessions share the same memory DB but tasks are scoped to the session that created them. A founder can run multiple projects simultaneously. Sessions never interfere with each other."
|
|
1553
|
+
},
|
|
1554
|
+
// --- Hierarchy and dispatch ---
|
|
1555
|
+
{
|
|
1556
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1557
|
+
domain: "workflow",
|
|
1558
|
+
priority: "p0",
|
|
1559
|
+
content: "Founder \u2192 exe (COO) \u2192 yoshi (CTO) / mari (CMO). Yoshi \u2192 tom (engineer). Mari \u2192 sasha (content). Never skip levels: exe never assigns directly to tom. Tom never reports directly to exe. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1563
|
+
domain: "workflow",
|
|
1564
|
+
priority: "p0",
|
|
1565
|
+
content: "create_task is the ONLY way to dispatch work to another agent. No direct ensureEmployee calls, no manual tmux spawns, no send_message for actionable work. create_task \u2192 system auto-spawns \u2192 session correctly named. ONE PATH. No backdoors. No exceptions."
|
|
1566
|
+
},
|
|
1567
|
+
// --- Session isolation ---
|
|
1568
|
+
{
|
|
1569
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1570
|
+
domain: "security",
|
|
1571
|
+
priority: "p0",
|
|
1572
|
+
content: "Session scoping is mandatory. Managers dispatch to workers within their own exe session ONLY. exe1\u2192yoshi-exe1\u2192tom-exe1. exe2\u2192yoshi-exe2\u2192tom2-exe2. Cross-session dispatch is blocked by the system. Verify session names before dispatch. Tasks are scoped to the creating exe session."
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1576
|
+
domain: "workflow",
|
|
1577
|
+
priority: "p0",
|
|
1578
|
+
content: `Sessions are isolated. exeN owns ONLY tasks it dispatched. (1) Never close/update/cancel tasks from another exe session. (2) Never review work from a different session \u2014 report "belongs to exeN" and skip. (3) Ignore other sessions' items in list_tasks results. (4) Employees inherit session: yoshi-exe1 works ONLY on exe1 tasks. Cross-session work is a system violation.`
|
|
1579
|
+
},
|
|
1580
|
+
// --- Engineering: session scoping in code ---
|
|
1581
|
+
{
|
|
1582
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1583
|
+
domain: "architecture",
|
|
1584
|
+
priority: "p0",
|
|
1585
|
+
content: "Every DB query, notification, review count, and task operation MUST be scoped on 3 dimensions: (1) Session \u2014 filter by session_scope matching current exeN. (2) Project \u2014 filter by project_name. (3) Role \u2014 agents only see data at their hierarchy level. When writing ANY function that touches tasks, reviews, messages, or notifications: always accept a sessionScope parameter and pass it to the SQL WHERE clause. Unscoped queries are bugs. Test by running 2+ exe sessions simultaneously."
|
|
1586
|
+
},
|
|
1587
|
+
// --- Hard constraints ---
|
|
1588
|
+
{
|
|
1589
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1590
|
+
domain: "security",
|
|
1591
|
+
priority: "p0",
|
|
1592
|
+
content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 exe reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
|
|
1593
|
+
},
|
|
1594
|
+
// --- Operations ---
|
|
1595
|
+
{
|
|
1596
|
+
title: "Managers must supervise deployed workers",
|
|
1597
|
+
domain: "workflow",
|
|
1598
|
+
priority: "p0",
|
|
1599
|
+
content: `Every manager (COO/CTO/CMO) who dispatches work to a worker MUST actively monitor them. Check tmux capture-pane every 10 minutes. Verify they're working, not stuck. If idle at prompt with in_progress task \u2192 send intercom. If stuck \u2192 unblock or escalate. "Standing by" without checking is negligence.`
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1603
|
+
domain: "workflow",
|
|
1604
|
+
priority: "p0",
|
|
1605
|
+
content: "On every /exe boot, COO MUST check system health BEFORE other work: (1) daemon \u2014 is exed PID alive, (2) cloud sync \u2014 grep workers.log for recent cloud-sync errors, (3) memory count \u2014 total in DB, (4) sync delta \u2014 local vs cloud storage_bytes. Report as 4-line status table. If ANY check fails, surface to founder immediately. Do not proceed to tasks until health confirmed."
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1609
|
+
domain: "workflow",
|
|
1610
|
+
priority: "p0",
|
|
1611
|
+
content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
title: "Desktop and TUI are the same product",
|
|
1615
|
+
domain: "architecture",
|
|
1616
|
+
priority: "p0",
|
|
1617
|
+
content: "Desktop and TUI are the SAME product in different renderers. Same data contracts, same interactions, same acceptance criteria. Desktop tab specs in ARCHITECTURE.md ARE the TUI specs. When building TUI, cross-reference Desktop spec. Different tab names, identical behavior. Never treat them as separate products."
|
|
1618
|
+
}
|
|
1619
|
+
];
|
|
1620
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1621
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1529
1626
|
// src/lib/global-procedures.ts
|
|
1530
1627
|
var global_procedures_exports = {};
|
|
1531
1628
|
__export(global_procedures_exports, {
|
|
@@ -1541,22 +1638,25 @@ async function loadGlobalProcedures() {
|
|
|
1541
1638
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1542
1639
|
args: []
|
|
1543
1640
|
});
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
|
|
1641
|
+
const allRows = result.rows;
|
|
1642
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1643
|
+
if (customerOnly.length > 0) {
|
|
1644
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1547
1645
|
${p.content}`).join("\n\n");
|
|
1548
1646
|
} else {
|
|
1549
|
-
|
|
1647
|
+
_customerCache = "";
|
|
1550
1648
|
}
|
|
1551
1649
|
_cacheLoaded = true;
|
|
1552
|
-
return
|
|
1650
|
+
return customerOnly;
|
|
1553
1651
|
}
|
|
1554
1652
|
function getGlobalProceduresBlock() {
|
|
1555
|
-
|
|
1556
|
-
if (
|
|
1653
|
+
const sections = [];
|
|
1654
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1655
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1656
|
+
if (sections.length === 0) return "";
|
|
1557
1657
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1558
1658
|
|
|
1559
|
-
${
|
|
1659
|
+
${sections.join("\n\n")}
|
|
1560
1660
|
`;
|
|
1561
1661
|
}
|
|
1562
1662
|
async function storeGlobalProcedure(input2) {
|
|
@@ -1581,13 +1681,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1581
1681
|
await loadGlobalProcedures();
|
|
1582
1682
|
return result.rowsAffected > 0;
|
|
1583
1683
|
}
|
|
1584
|
-
var
|
|
1684
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1585
1685
|
var init_global_procedures = __esm({
|
|
1586
1686
|
"src/lib/global-procedures.ts"() {
|
|
1587
1687
|
"use strict";
|
|
1588
1688
|
init_database();
|
|
1589
|
-
|
|
1689
|
+
init_platform_procedures();
|
|
1690
|
+
_customerCache = "";
|
|
1590
1691
|
_cacheLoaded = false;
|
|
1692
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1693
|
+
${p.content}`).join("\n\n");
|
|
1591
1694
|
}
|
|
1592
1695
|
});
|
|
1593
1696
|
|
|
@@ -1582,6 +1582,103 @@ var init_shard_manager = __esm({
|
|
|
1582
1582
|
}
|
|
1583
1583
|
});
|
|
1584
1584
|
|
|
1585
|
+
// src/lib/platform-procedures.ts
|
|
1586
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1587
|
+
var init_platform_procedures = __esm({
|
|
1588
|
+
"src/lib/platform-procedures.ts"() {
|
|
1589
|
+
"use strict";
|
|
1590
|
+
PLATFORM_PROCEDURES = [
|
|
1591
|
+
// --- Foundation: what is exe-os ---
|
|
1592
|
+
{
|
|
1593
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1594
|
+
domain: "architecture",
|
|
1595
|
+
priority: "p0",
|
|
1596
|
+
content: "Exe OS is an AI employee operating system. A founder runs 5-10 AI agents as a real org: COO (exe), CTO (yoshi), CMO (mari), engineers (tom), content (sasha). Each agent has identity, expertise, and experience layers \u2014 persistent memory that makes them better over time. All data is local-first, E2EE, owned by the user. The MCP server is the ONLY data interface \u2014 never access the DB directly."
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1600
|
+
domain: "architecture",
|
|
1601
|
+
priority: "p0",
|
|
1602
|
+
content: "Mode 1: exe-os runs AS hooks + MCP + skills inside Claude Code. The founder opens CC, runs /exe to boot the COO. exe manages employees in tmux sessions. Each exeN is a separate CC window/project. Employees (yoshi, tom, mari) run in their own tmux panes via create_task auto-spawn. The founder talks to exe; exe orchestrates the team. CC is the shell, exe-os is the brain."
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1606
|
+
domain: "architecture",
|
|
1607
|
+
priority: "p0",
|
|
1608
|
+
content: "Each exeN (exe1, exe2, exe3) is an isolated project session. exe1 might be exe-os development, exe2 might be exe-wiki. Each session spawns its own employees: exe1\u2192yoshi-exe1\u2192tom-exe1. Sessions share the same memory DB but tasks are scoped to the session that created them. A founder can run multiple projects simultaneously. Sessions never interfere with each other."
|
|
1609
|
+
},
|
|
1610
|
+
// --- Hierarchy and dispatch ---
|
|
1611
|
+
{
|
|
1612
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1613
|
+
domain: "workflow",
|
|
1614
|
+
priority: "p0",
|
|
1615
|
+
content: "Founder \u2192 exe (COO) \u2192 yoshi (CTO) / mari (CMO). Yoshi \u2192 tom (engineer). Mari \u2192 sasha (content). Never skip levels: exe never assigns directly to tom. Tom never reports directly to exe. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1619
|
+
domain: "workflow",
|
|
1620
|
+
priority: "p0",
|
|
1621
|
+
content: "create_task is the ONLY way to dispatch work to another agent. No direct ensureEmployee calls, no manual tmux spawns, no send_message for actionable work. create_task \u2192 system auto-spawns \u2192 session correctly named. ONE PATH. No backdoors. No exceptions."
|
|
1622
|
+
},
|
|
1623
|
+
// --- Session isolation ---
|
|
1624
|
+
{
|
|
1625
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1626
|
+
domain: "security",
|
|
1627
|
+
priority: "p0",
|
|
1628
|
+
content: "Session scoping is mandatory. Managers dispatch to workers within their own exe session ONLY. exe1\u2192yoshi-exe1\u2192tom-exe1. exe2\u2192yoshi-exe2\u2192tom2-exe2. Cross-session dispatch is blocked by the system. Verify session names before dispatch. Tasks are scoped to the creating exe session."
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1632
|
+
domain: "workflow",
|
|
1633
|
+
priority: "p0",
|
|
1634
|
+
content: `Sessions are isolated. exeN owns ONLY tasks it dispatched. (1) Never close/update/cancel tasks from another exe session. (2) Never review work from a different session \u2014 report "belongs to exeN" and skip. (3) Ignore other sessions' items in list_tasks results. (4) Employees inherit session: yoshi-exe1 works ONLY on exe1 tasks. Cross-session work is a system violation.`
|
|
1635
|
+
},
|
|
1636
|
+
// --- Engineering: session scoping in code ---
|
|
1637
|
+
{
|
|
1638
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1639
|
+
domain: "architecture",
|
|
1640
|
+
priority: "p0",
|
|
1641
|
+
content: "Every DB query, notification, review count, and task operation MUST be scoped on 3 dimensions: (1) Session \u2014 filter by session_scope matching current exeN. (2) Project \u2014 filter by project_name. (3) Role \u2014 agents only see data at their hierarchy level. When writing ANY function that touches tasks, reviews, messages, or notifications: always accept a sessionScope parameter and pass it to the SQL WHERE clause. Unscoped queries are bugs. Test by running 2+ exe sessions simultaneously."
|
|
1642
|
+
},
|
|
1643
|
+
// --- Hard constraints ---
|
|
1644
|
+
{
|
|
1645
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1646
|
+
domain: "security",
|
|
1647
|
+
priority: "p0",
|
|
1648
|
+
content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 exe reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
|
|
1649
|
+
},
|
|
1650
|
+
// --- Operations ---
|
|
1651
|
+
{
|
|
1652
|
+
title: "Managers must supervise deployed workers",
|
|
1653
|
+
domain: "workflow",
|
|
1654
|
+
priority: "p0",
|
|
1655
|
+
content: `Every manager (COO/CTO/CMO) who dispatches work to a worker MUST actively monitor them. Check tmux capture-pane every 10 minutes. Verify they're working, not stuck. If idle at prompt with in_progress task \u2192 send intercom. If stuck \u2192 unblock or escalate. "Standing by" without checking is negligence.`
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1659
|
+
domain: "workflow",
|
|
1660
|
+
priority: "p0",
|
|
1661
|
+
content: "On every /exe boot, COO MUST check system health BEFORE other work: (1) daemon \u2014 is exed PID alive, (2) cloud sync \u2014 grep workers.log for recent cloud-sync errors, (3) memory count \u2014 total in DB, (4) sync delta \u2014 local vs cloud storage_bytes. Report as 4-line status table. If ANY check fails, surface to founder immediately. Do not proceed to tasks until health confirmed."
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1665
|
+
domain: "workflow",
|
|
1666
|
+
priority: "p0",
|
|
1667
|
+
content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
title: "Desktop and TUI are the same product",
|
|
1671
|
+
domain: "architecture",
|
|
1672
|
+
priority: "p0",
|
|
1673
|
+
content: "Desktop and TUI are the SAME product in different renderers. Same data contracts, same interactions, same acceptance criteria. Desktop tab specs in ARCHITECTURE.md ARE the TUI specs. When building TUI, cross-reference Desktop spec. Different tab names, identical behavior. Never treat them as separate products."
|
|
1674
|
+
}
|
|
1675
|
+
];
|
|
1676
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1677
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1678
|
+
);
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
|
|
1585
1682
|
// src/lib/global-procedures.ts
|
|
1586
1683
|
var global_procedures_exports = {};
|
|
1587
1684
|
__export(global_procedures_exports, {
|
|
@@ -1597,22 +1694,25 @@ async function loadGlobalProcedures() {
|
|
|
1597
1694
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1598
1695
|
args: []
|
|
1599
1696
|
});
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
|
|
1697
|
+
const allRows = result.rows;
|
|
1698
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1699
|
+
if (customerOnly.length > 0) {
|
|
1700
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1603
1701
|
${p.content}`).join("\n\n");
|
|
1604
1702
|
} else {
|
|
1605
|
-
|
|
1703
|
+
_customerCache = "";
|
|
1606
1704
|
}
|
|
1607
1705
|
_cacheLoaded = true;
|
|
1608
|
-
return
|
|
1706
|
+
return customerOnly;
|
|
1609
1707
|
}
|
|
1610
1708
|
function getGlobalProceduresBlock() {
|
|
1611
|
-
|
|
1612
|
-
if (
|
|
1709
|
+
const sections = [];
|
|
1710
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1711
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1712
|
+
if (sections.length === 0) return "";
|
|
1613
1713
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1614
1714
|
|
|
1615
|
-
${
|
|
1715
|
+
${sections.join("\n\n")}
|
|
1616
1716
|
`;
|
|
1617
1717
|
}
|
|
1618
1718
|
async function storeGlobalProcedure(input2) {
|
|
@@ -1637,13 +1737,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1637
1737
|
await loadGlobalProcedures();
|
|
1638
1738
|
return result.rowsAffected > 0;
|
|
1639
1739
|
}
|
|
1640
|
-
var
|
|
1740
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1641
1741
|
var init_global_procedures = __esm({
|
|
1642
1742
|
"src/lib/global-procedures.ts"() {
|
|
1643
1743
|
"use strict";
|
|
1644
1744
|
init_database();
|
|
1645
|
-
|
|
1745
|
+
init_platform_procedures();
|
|
1746
|
+
_customerCache = "";
|
|
1646
1747
|
_cacheLoaded = false;
|
|
1748
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1749
|
+
${p.content}`).join("\n\n");
|
|
1647
1750
|
}
|
|
1648
1751
|
});
|
|
1649
1752
|
|
|
@@ -4086,16 +4189,32 @@ var init_tasks_crud = __esm({
|
|
|
4086
4189
|
// src/lib/tasks-review.ts
|
|
4087
4190
|
import path15 from "path";
|
|
4088
4191
|
import { existsSync as existsSync14, readdirSync as readdirSync4, unlinkSync as unlinkSync4 } from "fs";
|
|
4089
|
-
async function countPendingReviews() {
|
|
4192
|
+
async function countPendingReviews(sessionScope) {
|
|
4090
4193
|
const client = getClient();
|
|
4194
|
+
if (sessionScope) {
|
|
4195
|
+
const result2 = await client.execute({
|
|
4196
|
+
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review' AND (session_scope = ? OR session_scope IS NULL)",
|
|
4197
|
+
args: [sessionScope]
|
|
4198
|
+
});
|
|
4199
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
4200
|
+
}
|
|
4091
4201
|
const result = await client.execute({
|
|
4092
4202
|
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review'",
|
|
4093
4203
|
args: []
|
|
4094
4204
|
});
|
|
4095
4205
|
return Number(result.rows[0]?.cnt) || 0;
|
|
4096
4206
|
}
|
|
4097
|
-
async function countNewPendingReviewsSince(sinceIso) {
|
|
4207
|
+
async function countNewPendingReviewsSince(sinceIso, sessionScope) {
|
|
4098
4208
|
const client = getClient();
|
|
4209
|
+
if (sessionScope) {
|
|
4210
|
+
const result2 = await client.execute({
|
|
4211
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
4212
|
+
WHERE status = 'needs_review' AND updated_at > ?
|
|
4213
|
+
AND (session_scope = ? OR session_scope IS NULL)`,
|
|
4214
|
+
args: [sinceIso, sessionScope]
|
|
4215
|
+
});
|
|
4216
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
4217
|
+
}
|
|
4099
4218
|
const result = await client.execute({
|
|
4100
4219
|
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
4101
4220
|
WHERE status = 'needs_review' AND updated_at > ?`,
|