@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
package/dist/bin/exe-forget.js
CHANGED
|
@@ -1458,6 +1458,103 @@ var init_shard_manager = __esm({
|
|
|
1458
1458
|
}
|
|
1459
1459
|
});
|
|
1460
1460
|
|
|
1461
|
+
// src/lib/platform-procedures.ts
|
|
1462
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1463
|
+
var init_platform_procedures = __esm({
|
|
1464
|
+
"src/lib/platform-procedures.ts"() {
|
|
1465
|
+
"use strict";
|
|
1466
|
+
PLATFORM_PROCEDURES = [
|
|
1467
|
+
// --- Foundation: what is exe-os ---
|
|
1468
|
+
{
|
|
1469
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1470
|
+
domain: "architecture",
|
|
1471
|
+
priority: "p0",
|
|
1472
|
+
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."
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1476
|
+
domain: "architecture",
|
|
1477
|
+
priority: "p0",
|
|
1478
|
+
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."
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1482
|
+
domain: "architecture",
|
|
1483
|
+
priority: "p0",
|
|
1484
|
+
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."
|
|
1485
|
+
},
|
|
1486
|
+
// --- Hierarchy and dispatch ---
|
|
1487
|
+
{
|
|
1488
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1489
|
+
domain: "workflow",
|
|
1490
|
+
priority: "p0",
|
|
1491
|
+
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."
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1495
|
+
domain: "workflow",
|
|
1496
|
+
priority: "p0",
|
|
1497
|
+
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."
|
|
1498
|
+
},
|
|
1499
|
+
// --- Session isolation ---
|
|
1500
|
+
{
|
|
1501
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1502
|
+
domain: "security",
|
|
1503
|
+
priority: "p0",
|
|
1504
|
+
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."
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1508
|
+
domain: "workflow",
|
|
1509
|
+
priority: "p0",
|
|
1510
|
+
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.`
|
|
1511
|
+
},
|
|
1512
|
+
// --- Engineering: session scoping in code ---
|
|
1513
|
+
{
|
|
1514
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1515
|
+
domain: "architecture",
|
|
1516
|
+
priority: "p0",
|
|
1517
|
+
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."
|
|
1518
|
+
},
|
|
1519
|
+
// --- Hard constraints ---
|
|
1520
|
+
{
|
|
1521
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1522
|
+
domain: "security",
|
|
1523
|
+
priority: "p0",
|
|
1524
|
+
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."
|
|
1525
|
+
},
|
|
1526
|
+
// --- Operations ---
|
|
1527
|
+
{
|
|
1528
|
+
title: "Managers must supervise deployed workers",
|
|
1529
|
+
domain: "workflow",
|
|
1530
|
+
priority: "p0",
|
|
1531
|
+
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.`
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1535
|
+
domain: "workflow",
|
|
1536
|
+
priority: "p0",
|
|
1537
|
+
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."
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1541
|
+
domain: "workflow",
|
|
1542
|
+
priority: "p0",
|
|
1543
|
+
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."
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
title: "Desktop and TUI are the same product",
|
|
1547
|
+
domain: "architecture",
|
|
1548
|
+
priority: "p0",
|
|
1549
|
+
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."
|
|
1550
|
+
}
|
|
1551
|
+
];
|
|
1552
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1553
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1554
|
+
);
|
|
1555
|
+
}
|
|
1556
|
+
});
|
|
1557
|
+
|
|
1461
1558
|
// src/lib/global-procedures.ts
|
|
1462
1559
|
var global_procedures_exports = {};
|
|
1463
1560
|
__export(global_procedures_exports, {
|
|
@@ -1473,22 +1570,25 @@ async function loadGlobalProcedures() {
|
|
|
1473
1570
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1474
1571
|
args: []
|
|
1475
1572
|
});
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1478
|
-
|
|
1573
|
+
const allRows = result.rows;
|
|
1574
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1575
|
+
if (customerOnly.length > 0) {
|
|
1576
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1479
1577
|
${p.content}`).join("\n\n");
|
|
1480
1578
|
} else {
|
|
1481
|
-
|
|
1579
|
+
_customerCache = "";
|
|
1482
1580
|
}
|
|
1483
1581
|
_cacheLoaded = true;
|
|
1484
|
-
return
|
|
1582
|
+
return customerOnly;
|
|
1485
1583
|
}
|
|
1486
1584
|
function getGlobalProceduresBlock() {
|
|
1487
|
-
|
|
1488
|
-
if (
|
|
1585
|
+
const sections = [];
|
|
1586
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1587
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1588
|
+
if (sections.length === 0) return "";
|
|
1489
1589
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1490
1590
|
|
|
1491
|
-
${
|
|
1591
|
+
${sections.join("\n\n")}
|
|
1492
1592
|
`;
|
|
1493
1593
|
}
|
|
1494
1594
|
async function storeGlobalProcedure(input) {
|
|
@@ -1513,13 +1613,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1513
1613
|
await loadGlobalProcedures();
|
|
1514
1614
|
return result.rowsAffected > 0;
|
|
1515
1615
|
}
|
|
1516
|
-
var
|
|
1616
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1517
1617
|
var init_global_procedures = __esm({
|
|
1518
1618
|
"src/lib/global-procedures.ts"() {
|
|
1519
1619
|
"use strict";
|
|
1520
1620
|
init_database();
|
|
1521
|
-
|
|
1621
|
+
init_platform_procedures();
|
|
1622
|
+
_customerCache = "";
|
|
1522
1623
|
_cacheLoaded = false;
|
|
1624
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1625
|
+
${p.content}`).join("\n\n");
|
|
1523
1626
|
}
|
|
1524
1627
|
});
|
|
1525
1628
|
|
package/dist/bin/exe-gateway.js
CHANGED
|
@@ -2209,6 +2209,103 @@ var init_shard_manager = __esm({
|
|
|
2209
2209
|
}
|
|
2210
2210
|
});
|
|
2211
2211
|
|
|
2212
|
+
// src/lib/platform-procedures.ts
|
|
2213
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
2214
|
+
var init_platform_procedures = __esm({
|
|
2215
|
+
"src/lib/platform-procedures.ts"() {
|
|
2216
|
+
"use strict";
|
|
2217
|
+
PLATFORM_PROCEDURES = [
|
|
2218
|
+
// --- Foundation: what is exe-os ---
|
|
2219
|
+
{
|
|
2220
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
2221
|
+
domain: "architecture",
|
|
2222
|
+
priority: "p0",
|
|
2223
|
+
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."
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
2227
|
+
domain: "architecture",
|
|
2228
|
+
priority: "p0",
|
|
2229
|
+
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."
|
|
2230
|
+
},
|
|
2231
|
+
{
|
|
2232
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
2233
|
+
domain: "architecture",
|
|
2234
|
+
priority: "p0",
|
|
2235
|
+
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."
|
|
2236
|
+
},
|
|
2237
|
+
// --- Hierarchy and dispatch ---
|
|
2238
|
+
{
|
|
2239
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
2240
|
+
domain: "workflow",
|
|
2241
|
+
priority: "p0",
|
|
2242
|
+
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."
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
2246
|
+
domain: "workflow",
|
|
2247
|
+
priority: "p0",
|
|
2248
|
+
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."
|
|
2249
|
+
},
|
|
2250
|
+
// --- Session isolation ---
|
|
2251
|
+
{
|
|
2252
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
2253
|
+
domain: "security",
|
|
2254
|
+
priority: "p0",
|
|
2255
|
+
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."
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
2259
|
+
domain: "workflow",
|
|
2260
|
+
priority: "p0",
|
|
2261
|
+
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.`
|
|
2262
|
+
},
|
|
2263
|
+
// --- Engineering: session scoping in code ---
|
|
2264
|
+
{
|
|
2265
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
2266
|
+
domain: "architecture",
|
|
2267
|
+
priority: "p0",
|
|
2268
|
+
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."
|
|
2269
|
+
},
|
|
2270
|
+
// --- Hard constraints ---
|
|
2271
|
+
{
|
|
2272
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
2273
|
+
domain: "security",
|
|
2274
|
+
priority: "p0",
|
|
2275
|
+
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."
|
|
2276
|
+
},
|
|
2277
|
+
// --- Operations ---
|
|
2278
|
+
{
|
|
2279
|
+
title: "Managers must supervise deployed workers",
|
|
2280
|
+
domain: "workflow",
|
|
2281
|
+
priority: "p0",
|
|
2282
|
+
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.`
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
2286
|
+
domain: "workflow",
|
|
2287
|
+
priority: "p0",
|
|
2288
|
+
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."
|
|
2289
|
+
},
|
|
2290
|
+
{
|
|
2291
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
2292
|
+
domain: "workflow",
|
|
2293
|
+
priority: "p0",
|
|
2294
|
+
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."
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
title: "Desktop and TUI are the same product",
|
|
2298
|
+
domain: "architecture",
|
|
2299
|
+
priority: "p0",
|
|
2300
|
+
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."
|
|
2301
|
+
}
|
|
2302
|
+
];
|
|
2303
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
2304
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
});
|
|
2308
|
+
|
|
2212
2309
|
// src/lib/global-procedures.ts
|
|
2213
2310
|
var global_procedures_exports = {};
|
|
2214
2311
|
__export(global_procedures_exports, {
|
|
@@ -2224,22 +2321,25 @@ async function loadGlobalProcedures() {
|
|
|
2224
2321
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
2225
2322
|
args: []
|
|
2226
2323
|
});
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2229
|
-
|
|
2324
|
+
const allRows = result.rows;
|
|
2325
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
2326
|
+
if (customerOnly.length > 0) {
|
|
2327
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
2230
2328
|
${p.content}`).join("\n\n");
|
|
2231
2329
|
} else {
|
|
2232
|
-
|
|
2330
|
+
_customerCache = "";
|
|
2233
2331
|
}
|
|
2234
2332
|
_cacheLoaded = true;
|
|
2235
|
-
return
|
|
2333
|
+
return customerOnly;
|
|
2236
2334
|
}
|
|
2237
2335
|
function getGlobalProceduresBlock() {
|
|
2238
|
-
|
|
2239
|
-
if (
|
|
2336
|
+
const sections = [];
|
|
2337
|
+
if (_platformCache) sections.push(_platformCache);
|
|
2338
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
2339
|
+
if (sections.length === 0) return "";
|
|
2240
2340
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
2241
2341
|
|
|
2242
|
-
${
|
|
2342
|
+
${sections.join("\n\n")}
|
|
2243
2343
|
`;
|
|
2244
2344
|
}
|
|
2245
2345
|
async function storeGlobalProcedure(input) {
|
|
@@ -2264,13 +2364,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
2264
2364
|
await loadGlobalProcedures();
|
|
2265
2365
|
return result.rowsAffected > 0;
|
|
2266
2366
|
}
|
|
2267
|
-
var
|
|
2367
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
2268
2368
|
var init_global_procedures = __esm({
|
|
2269
2369
|
"src/lib/global-procedures.ts"() {
|
|
2270
2370
|
"use strict";
|
|
2271
2371
|
init_database();
|
|
2272
|
-
|
|
2372
|
+
init_platform_procedures();
|
|
2373
|
+
_customerCache = "";
|
|
2273
2374
|
_cacheLoaded = false;
|
|
2375
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
2376
|
+
${p.content}`).join("\n\n");
|
|
2274
2377
|
}
|
|
2275
2378
|
});
|
|
2276
2379
|
|
|
@@ -5470,16 +5573,32 @@ var init_tasks_crud = __esm({
|
|
|
5470
5573
|
// src/lib/tasks-review.ts
|
|
5471
5574
|
import path13 from "path";
|
|
5472
5575
|
import { existsSync as existsSync12, readdirSync as readdirSync3, unlinkSync as unlinkSync3 } from "fs";
|
|
5473
|
-
async function countPendingReviews() {
|
|
5576
|
+
async function countPendingReviews(sessionScope) {
|
|
5474
5577
|
const client = getClient();
|
|
5578
|
+
if (sessionScope) {
|
|
5579
|
+
const result2 = await client.execute({
|
|
5580
|
+
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review' AND (session_scope = ? OR session_scope IS NULL)",
|
|
5581
|
+
args: [sessionScope]
|
|
5582
|
+
});
|
|
5583
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
5584
|
+
}
|
|
5475
5585
|
const result = await client.execute({
|
|
5476
5586
|
sql: "SELECT COUNT(*) as cnt FROM tasks WHERE status = 'needs_review'",
|
|
5477
5587
|
args: []
|
|
5478
5588
|
});
|
|
5479
5589
|
return Number(result.rows[0]?.cnt) || 0;
|
|
5480
5590
|
}
|
|
5481
|
-
async function countNewPendingReviewsSince(sinceIso) {
|
|
5591
|
+
async function countNewPendingReviewsSince(sinceIso, sessionScope) {
|
|
5482
5592
|
const client = getClient();
|
|
5593
|
+
if (sessionScope) {
|
|
5594
|
+
const result2 = await client.execute({
|
|
5595
|
+
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
5596
|
+
WHERE status = 'needs_review' AND updated_at > ?
|
|
5597
|
+
AND (session_scope = ? OR session_scope IS NULL)`,
|
|
5598
|
+
args: [sinceIso, sessionScope]
|
|
5599
|
+
});
|
|
5600
|
+
return Number(result2.rows[0]?.cnt) || 0;
|
|
5601
|
+
}
|
|
5483
5602
|
const result = await client.execute({
|
|
5484
5603
|
sql: `SELECT COUNT(*) as cnt FROM tasks
|
|
5485
5604
|
WHERE status = 'needs_review' AND updated_at > ?`,
|
|
@@ -1420,6 +1420,103 @@ var init_shard_manager = __esm({
|
|
|
1420
1420
|
}
|
|
1421
1421
|
});
|
|
1422
1422
|
|
|
1423
|
+
// src/lib/platform-procedures.ts
|
|
1424
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1425
|
+
var init_platform_procedures = __esm({
|
|
1426
|
+
"src/lib/platform-procedures.ts"() {
|
|
1427
|
+
"use strict";
|
|
1428
|
+
PLATFORM_PROCEDURES = [
|
|
1429
|
+
// --- Foundation: what is exe-os ---
|
|
1430
|
+
{
|
|
1431
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1432
|
+
domain: "architecture",
|
|
1433
|
+
priority: "p0",
|
|
1434
|
+
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."
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1438
|
+
domain: "architecture",
|
|
1439
|
+
priority: "p0",
|
|
1440
|
+
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."
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1444
|
+
domain: "architecture",
|
|
1445
|
+
priority: "p0",
|
|
1446
|
+
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."
|
|
1447
|
+
},
|
|
1448
|
+
// --- Hierarchy and dispatch ---
|
|
1449
|
+
{
|
|
1450
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1451
|
+
domain: "workflow",
|
|
1452
|
+
priority: "p0",
|
|
1453
|
+
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."
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1457
|
+
domain: "workflow",
|
|
1458
|
+
priority: "p0",
|
|
1459
|
+
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."
|
|
1460
|
+
},
|
|
1461
|
+
// --- Session isolation ---
|
|
1462
|
+
{
|
|
1463
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1464
|
+
domain: "security",
|
|
1465
|
+
priority: "p0",
|
|
1466
|
+
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."
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1470
|
+
domain: "workflow",
|
|
1471
|
+
priority: "p0",
|
|
1472
|
+
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.`
|
|
1473
|
+
},
|
|
1474
|
+
// --- Engineering: session scoping in code ---
|
|
1475
|
+
{
|
|
1476
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1477
|
+
domain: "architecture",
|
|
1478
|
+
priority: "p0",
|
|
1479
|
+
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."
|
|
1480
|
+
},
|
|
1481
|
+
// --- Hard constraints ---
|
|
1482
|
+
{
|
|
1483
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1484
|
+
domain: "security",
|
|
1485
|
+
priority: "p0",
|
|
1486
|
+
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."
|
|
1487
|
+
},
|
|
1488
|
+
// --- Operations ---
|
|
1489
|
+
{
|
|
1490
|
+
title: "Managers must supervise deployed workers",
|
|
1491
|
+
domain: "workflow",
|
|
1492
|
+
priority: "p0",
|
|
1493
|
+
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.`
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1497
|
+
domain: "workflow",
|
|
1498
|
+
priority: "p0",
|
|
1499
|
+
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."
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1503
|
+
domain: "workflow",
|
|
1504
|
+
priority: "p0",
|
|
1505
|
+
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."
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
title: "Desktop and TUI are the same product",
|
|
1509
|
+
domain: "architecture",
|
|
1510
|
+
priority: "p0",
|
|
1511
|
+
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."
|
|
1512
|
+
}
|
|
1513
|
+
];
|
|
1514
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1515
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1516
|
+
);
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1519
|
+
|
|
1423
1520
|
// src/lib/global-procedures.ts
|
|
1424
1521
|
var global_procedures_exports = {};
|
|
1425
1522
|
__export(global_procedures_exports, {
|
|
@@ -1435,22 +1532,25 @@ async function loadGlobalProcedures() {
|
|
|
1435
1532
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1436
1533
|
args: []
|
|
1437
1534
|
});
|
|
1438
|
-
const
|
|
1439
|
-
|
|
1440
|
-
|
|
1535
|
+
const allRows = result.rows;
|
|
1536
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1537
|
+
if (customerOnly.length > 0) {
|
|
1538
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1441
1539
|
${p.content}`).join("\n\n");
|
|
1442
1540
|
} else {
|
|
1443
|
-
|
|
1541
|
+
_customerCache = "";
|
|
1444
1542
|
}
|
|
1445
1543
|
_cacheLoaded = true;
|
|
1446
|
-
return
|
|
1544
|
+
return customerOnly;
|
|
1447
1545
|
}
|
|
1448
1546
|
function getGlobalProceduresBlock() {
|
|
1449
|
-
|
|
1450
|
-
if (
|
|
1547
|
+
const sections = [];
|
|
1548
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1549
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1550
|
+
if (sections.length === 0) return "";
|
|
1451
1551
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1452
1552
|
|
|
1453
|
-
${
|
|
1553
|
+
${sections.join("\n\n")}
|
|
1454
1554
|
`;
|
|
1455
1555
|
}
|
|
1456
1556
|
async function storeGlobalProcedure(input) {
|
|
@@ -1475,13 +1575,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1475
1575
|
await loadGlobalProcedures();
|
|
1476
1576
|
return result.rowsAffected > 0;
|
|
1477
1577
|
}
|
|
1478
|
-
var
|
|
1578
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1479
1579
|
var init_global_procedures = __esm({
|
|
1480
1580
|
"src/lib/global-procedures.ts"() {
|
|
1481
1581
|
"use strict";
|
|
1482
1582
|
init_database();
|
|
1483
|
-
|
|
1583
|
+
init_platform_procedures();
|
|
1584
|
+
_customerCache = "";
|
|
1484
1585
|
_cacheLoaded = false;
|
|
1586
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1587
|
+
${p.content}`).join("\n\n");
|
|
1485
1588
|
}
|
|
1486
1589
|
});
|
|
1487
1590
|
|
|
@@ -1887,7 +1990,14 @@ function hashOutput(text) {
|
|
|
1887
1990
|
return createHash("sha256").update(text).digest("hex");
|
|
1888
1991
|
}
|
|
1889
1992
|
async function queryPendingReviews() {
|
|
1890
|
-
|
|
1993
|
+
let sessionScope;
|
|
1994
|
+
try {
|
|
1995
|
+
const { execSync: execSync5 } = await import("child_process");
|
|
1996
|
+
const tmuxSession = execSync5("tmux display-message -p '#{session_name}'", { encoding: "utf8", timeout: 2e3 }).trim();
|
|
1997
|
+
if (/^exe\d+$/.test(tmuxSession)) sessionScope = tmuxSession;
|
|
1998
|
+
} catch {
|
|
1999
|
+
}
|
|
2000
|
+
const rows = await listPendingReviews(PENDING_REVIEW_LIMIT, sessionScope);
|
|
1891
2001
|
if (rows.length === 0) return "";
|
|
1892
2002
|
const lines = [`MANDATORY: process ${rows.length} reviews`];
|
|
1893
2003
|
for (const row of rows) {
|