@askexenow/exe-os 0.8.54 → 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 +305 -181
- 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 +131 -12
- 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 +305 -181
- package/package.json +2 -2
|
@@ -1346,6 +1346,103 @@ var init_shard_manager = __esm({
|
|
|
1346
1346
|
}
|
|
1347
1347
|
});
|
|
1348
1348
|
|
|
1349
|
+
// src/lib/platform-procedures.ts
|
|
1350
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1351
|
+
var init_platform_procedures = __esm({
|
|
1352
|
+
"src/lib/platform-procedures.ts"() {
|
|
1353
|
+
"use strict";
|
|
1354
|
+
PLATFORM_PROCEDURES = [
|
|
1355
|
+
// --- Foundation: what is exe-os ---
|
|
1356
|
+
{
|
|
1357
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1358
|
+
domain: "architecture",
|
|
1359
|
+
priority: "p0",
|
|
1360
|
+
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."
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1364
|
+
domain: "architecture",
|
|
1365
|
+
priority: "p0",
|
|
1366
|
+
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."
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1370
|
+
domain: "architecture",
|
|
1371
|
+
priority: "p0",
|
|
1372
|
+
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."
|
|
1373
|
+
},
|
|
1374
|
+
// --- Hierarchy and dispatch ---
|
|
1375
|
+
{
|
|
1376
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1377
|
+
domain: "workflow",
|
|
1378
|
+
priority: "p0",
|
|
1379
|
+
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."
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1383
|
+
domain: "workflow",
|
|
1384
|
+
priority: "p0",
|
|
1385
|
+
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."
|
|
1386
|
+
},
|
|
1387
|
+
// --- Session isolation ---
|
|
1388
|
+
{
|
|
1389
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1390
|
+
domain: "security",
|
|
1391
|
+
priority: "p0",
|
|
1392
|
+
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."
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1396
|
+
domain: "workflow",
|
|
1397
|
+
priority: "p0",
|
|
1398
|
+
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.`
|
|
1399
|
+
},
|
|
1400
|
+
// --- Engineering: session scoping in code ---
|
|
1401
|
+
{
|
|
1402
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1403
|
+
domain: "architecture",
|
|
1404
|
+
priority: "p0",
|
|
1405
|
+
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."
|
|
1406
|
+
},
|
|
1407
|
+
// --- Hard constraints ---
|
|
1408
|
+
{
|
|
1409
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1410
|
+
domain: "security",
|
|
1411
|
+
priority: "p0",
|
|
1412
|
+
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."
|
|
1413
|
+
},
|
|
1414
|
+
// --- Operations ---
|
|
1415
|
+
{
|
|
1416
|
+
title: "Managers must supervise deployed workers",
|
|
1417
|
+
domain: "workflow",
|
|
1418
|
+
priority: "p0",
|
|
1419
|
+
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.`
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1423
|
+
domain: "workflow",
|
|
1424
|
+
priority: "p0",
|
|
1425
|
+
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."
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1429
|
+
domain: "workflow",
|
|
1430
|
+
priority: "p0",
|
|
1431
|
+
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."
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
title: "Desktop and TUI are the same product",
|
|
1435
|
+
domain: "architecture",
|
|
1436
|
+
priority: "p0",
|
|
1437
|
+
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."
|
|
1438
|
+
}
|
|
1439
|
+
];
|
|
1440
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1441
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
|
|
1349
1446
|
// src/lib/global-procedures.ts
|
|
1350
1447
|
var global_procedures_exports = {};
|
|
1351
1448
|
__export(global_procedures_exports, {
|
|
@@ -1361,22 +1458,25 @@ async function loadGlobalProcedures() {
|
|
|
1361
1458
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1362
1459
|
args: []
|
|
1363
1460
|
});
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1461
|
+
const allRows = result.rows;
|
|
1462
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1463
|
+
if (customerOnly.length > 0) {
|
|
1464
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1367
1465
|
${p.content}`).join("\n\n");
|
|
1368
1466
|
} else {
|
|
1369
|
-
|
|
1467
|
+
_customerCache = "";
|
|
1370
1468
|
}
|
|
1371
1469
|
_cacheLoaded = true;
|
|
1372
|
-
return
|
|
1470
|
+
return customerOnly;
|
|
1373
1471
|
}
|
|
1374
1472
|
function getGlobalProceduresBlock() {
|
|
1375
|
-
|
|
1376
|
-
if (
|
|
1473
|
+
const sections = [];
|
|
1474
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1475
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1476
|
+
if (sections.length === 0) return "";
|
|
1377
1477
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1378
1478
|
|
|
1379
|
-
${
|
|
1479
|
+
${sections.join("\n\n")}
|
|
1380
1480
|
`;
|
|
1381
1481
|
}
|
|
1382
1482
|
async function storeGlobalProcedure(input) {
|
|
@@ -1401,13 +1501,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1401
1501
|
await loadGlobalProcedures();
|
|
1402
1502
|
return result.rowsAffected > 0;
|
|
1403
1503
|
}
|
|
1404
|
-
var
|
|
1504
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1405
1505
|
var init_global_procedures = __esm({
|
|
1406
1506
|
"src/lib/global-procedures.ts"() {
|
|
1407
1507
|
"use strict";
|
|
1408
1508
|
init_database();
|
|
1409
|
-
|
|
1509
|
+
init_platform_procedures();
|
|
1510
|
+
_customerCache = "";
|
|
1410
1511
|
_cacheLoaded = false;
|
|
1512
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1513
|
+
${p.content}`).join("\n\n");
|
|
1411
1514
|
}
|
|
1412
1515
|
});
|
|
1413
1516
|
|
|
@@ -1346,6 +1346,103 @@ var init_shard_manager = __esm({
|
|
|
1346
1346
|
}
|
|
1347
1347
|
});
|
|
1348
1348
|
|
|
1349
|
+
// src/lib/platform-procedures.ts
|
|
1350
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1351
|
+
var init_platform_procedures = __esm({
|
|
1352
|
+
"src/lib/platform-procedures.ts"() {
|
|
1353
|
+
"use strict";
|
|
1354
|
+
PLATFORM_PROCEDURES = [
|
|
1355
|
+
// --- Foundation: what is exe-os ---
|
|
1356
|
+
{
|
|
1357
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1358
|
+
domain: "architecture",
|
|
1359
|
+
priority: "p0",
|
|
1360
|
+
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."
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1364
|
+
domain: "architecture",
|
|
1365
|
+
priority: "p0",
|
|
1366
|
+
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."
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1370
|
+
domain: "architecture",
|
|
1371
|
+
priority: "p0",
|
|
1372
|
+
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."
|
|
1373
|
+
},
|
|
1374
|
+
// --- Hierarchy and dispatch ---
|
|
1375
|
+
{
|
|
1376
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1377
|
+
domain: "workflow",
|
|
1378
|
+
priority: "p0",
|
|
1379
|
+
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."
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1383
|
+
domain: "workflow",
|
|
1384
|
+
priority: "p0",
|
|
1385
|
+
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."
|
|
1386
|
+
},
|
|
1387
|
+
// --- Session isolation ---
|
|
1388
|
+
{
|
|
1389
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1390
|
+
domain: "security",
|
|
1391
|
+
priority: "p0",
|
|
1392
|
+
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."
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1396
|
+
domain: "workflow",
|
|
1397
|
+
priority: "p0",
|
|
1398
|
+
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.`
|
|
1399
|
+
},
|
|
1400
|
+
// --- Engineering: session scoping in code ---
|
|
1401
|
+
{
|
|
1402
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1403
|
+
domain: "architecture",
|
|
1404
|
+
priority: "p0",
|
|
1405
|
+
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."
|
|
1406
|
+
},
|
|
1407
|
+
// --- Hard constraints ---
|
|
1408
|
+
{
|
|
1409
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1410
|
+
domain: "security",
|
|
1411
|
+
priority: "p0",
|
|
1412
|
+
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."
|
|
1413
|
+
},
|
|
1414
|
+
// --- Operations ---
|
|
1415
|
+
{
|
|
1416
|
+
title: "Managers must supervise deployed workers",
|
|
1417
|
+
domain: "workflow",
|
|
1418
|
+
priority: "p0",
|
|
1419
|
+
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.`
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1423
|
+
domain: "workflow",
|
|
1424
|
+
priority: "p0",
|
|
1425
|
+
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."
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1429
|
+
domain: "workflow",
|
|
1430
|
+
priority: "p0",
|
|
1431
|
+
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."
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
title: "Desktop and TUI are the same product",
|
|
1435
|
+
domain: "architecture",
|
|
1436
|
+
priority: "p0",
|
|
1437
|
+
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."
|
|
1438
|
+
}
|
|
1439
|
+
];
|
|
1440
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1441
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
|
|
1349
1446
|
// src/lib/global-procedures.ts
|
|
1350
1447
|
var global_procedures_exports = {};
|
|
1351
1448
|
__export(global_procedures_exports, {
|
|
@@ -1361,22 +1458,25 @@ async function loadGlobalProcedures() {
|
|
|
1361
1458
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1362
1459
|
args: []
|
|
1363
1460
|
});
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1461
|
+
const allRows = result.rows;
|
|
1462
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1463
|
+
if (customerOnly.length > 0) {
|
|
1464
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1367
1465
|
${p.content}`).join("\n\n");
|
|
1368
1466
|
} else {
|
|
1369
|
-
|
|
1467
|
+
_customerCache = "";
|
|
1370
1468
|
}
|
|
1371
1469
|
_cacheLoaded = true;
|
|
1372
|
-
return
|
|
1470
|
+
return customerOnly;
|
|
1373
1471
|
}
|
|
1374
1472
|
function getGlobalProceduresBlock() {
|
|
1375
|
-
|
|
1376
|
-
if (
|
|
1473
|
+
const sections = [];
|
|
1474
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1475
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1476
|
+
if (sections.length === 0) return "";
|
|
1377
1477
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1378
1478
|
|
|
1379
|
-
${
|
|
1479
|
+
${sections.join("\n\n")}
|
|
1380
1480
|
`;
|
|
1381
1481
|
}
|
|
1382
1482
|
async function storeGlobalProcedure(input) {
|
|
@@ -1401,13 +1501,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1401
1501
|
await loadGlobalProcedures();
|
|
1402
1502
|
return result.rowsAffected > 0;
|
|
1403
1503
|
}
|
|
1404
|
-
var
|
|
1504
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1405
1505
|
var init_global_procedures = __esm({
|
|
1406
1506
|
"src/lib/global-procedures.ts"() {
|
|
1407
1507
|
"use strict";
|
|
1408
1508
|
init_database();
|
|
1409
|
-
|
|
1509
|
+
init_platform_procedures();
|
|
1510
|
+
_customerCache = "";
|
|
1410
1511
|
_cacheLoaded = false;
|
|
1512
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1513
|
+
${p.content}`).join("\n\n");
|
|
1411
1514
|
}
|
|
1412
1515
|
});
|
|
1413
1516
|
|
|
@@ -1346,6 +1346,103 @@ var init_shard_manager = __esm({
|
|
|
1346
1346
|
}
|
|
1347
1347
|
});
|
|
1348
1348
|
|
|
1349
|
+
// src/lib/platform-procedures.ts
|
|
1350
|
+
var PLATFORM_PROCEDURES, PLATFORM_PROCEDURE_TITLES;
|
|
1351
|
+
var init_platform_procedures = __esm({
|
|
1352
|
+
"src/lib/platform-procedures.ts"() {
|
|
1353
|
+
"use strict";
|
|
1354
|
+
PLATFORM_PROCEDURES = [
|
|
1355
|
+
// --- Foundation: what is exe-os ---
|
|
1356
|
+
{
|
|
1357
|
+
title: "What is exe-os \u2014 the operating model every agent must understand",
|
|
1358
|
+
domain: "architecture",
|
|
1359
|
+
priority: "p0",
|
|
1360
|
+
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."
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
title: "Mode 1 \u2014 how exe-os runs inside Claude Code",
|
|
1364
|
+
domain: "architecture",
|
|
1365
|
+
priority: "p0",
|
|
1366
|
+
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."
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
title: "Sessions explained \u2014 what exeN means and how projects work",
|
|
1370
|
+
domain: "architecture",
|
|
1371
|
+
priority: "p0",
|
|
1372
|
+
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."
|
|
1373
|
+
},
|
|
1374
|
+
// --- Hierarchy and dispatch ---
|
|
1375
|
+
{
|
|
1376
|
+
title: "Chain of command \u2014 who talks to whom",
|
|
1377
|
+
domain: "workflow",
|
|
1378
|
+
priority: "p0",
|
|
1379
|
+
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."
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
title: "Single dispatch path \u2014 create_task only",
|
|
1383
|
+
domain: "workflow",
|
|
1384
|
+
priority: "p0",
|
|
1385
|
+
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."
|
|
1386
|
+
},
|
|
1387
|
+
// --- Session isolation ---
|
|
1388
|
+
{
|
|
1389
|
+
title: "Session scoping \u2014 stay in your exe boundary",
|
|
1390
|
+
domain: "security",
|
|
1391
|
+
priority: "p0",
|
|
1392
|
+
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."
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
title: "Session isolation \u2014 never touch another session's work",
|
|
1396
|
+
domain: "workflow",
|
|
1397
|
+
priority: "p0",
|
|
1398
|
+
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.`
|
|
1399
|
+
},
|
|
1400
|
+
// --- Engineering: session scoping in code ---
|
|
1401
|
+
{
|
|
1402
|
+
title: "Three-dimensional scoping \u2014 session, project, role \u2014 enforced in every query",
|
|
1403
|
+
domain: "architecture",
|
|
1404
|
+
priority: "p0",
|
|
1405
|
+
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."
|
|
1406
|
+
},
|
|
1407
|
+
// --- Hard constraints ---
|
|
1408
|
+
{
|
|
1409
|
+
title: "What you CANNOT do in exe-os \u2014 hard constraints",
|
|
1410
|
+
domain: "security",
|
|
1411
|
+
priority: "p0",
|
|
1412
|
+
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."
|
|
1413
|
+
},
|
|
1414
|
+
// --- Operations ---
|
|
1415
|
+
{
|
|
1416
|
+
title: "Managers must supervise deployed workers",
|
|
1417
|
+
domain: "workflow",
|
|
1418
|
+
priority: "p0",
|
|
1419
|
+
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.`
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
title: "COO boot health check \u2014 memory, cloud sync, daemon on every launch",
|
|
1423
|
+
domain: "workflow",
|
|
1424
|
+
priority: "p0",
|
|
1425
|
+
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."
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
title: "exe-build-adv mandatory for 3+ files",
|
|
1429
|
+
domain: "workflow",
|
|
1430
|
+
priority: "p0",
|
|
1431
|
+
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."
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
title: "Desktop and TUI are the same product",
|
|
1435
|
+
domain: "architecture",
|
|
1436
|
+
priority: "p0",
|
|
1437
|
+
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."
|
|
1438
|
+
}
|
|
1439
|
+
];
|
|
1440
|
+
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
1441
|
+
PLATFORM_PROCEDURES.map((p) => p.title)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
|
|
1349
1446
|
// src/lib/global-procedures.ts
|
|
1350
1447
|
var global_procedures_exports = {};
|
|
1351
1448
|
__export(global_procedures_exports, {
|
|
@@ -1361,22 +1458,25 @@ async function loadGlobalProcedures() {
|
|
|
1361
1458
|
sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
1362
1459
|
args: []
|
|
1363
1460
|
});
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1461
|
+
const allRows = result.rows;
|
|
1462
|
+
const customerOnly = allRows.filter((p) => !PLATFORM_PROCEDURE_TITLES.has(p.title));
|
|
1463
|
+
if (customerOnly.length > 0) {
|
|
1464
|
+
_customerCache = customerOnly.map((p) => `### ${p.title}
|
|
1367
1465
|
${p.content}`).join("\n\n");
|
|
1368
1466
|
} else {
|
|
1369
|
-
|
|
1467
|
+
_customerCache = "";
|
|
1370
1468
|
}
|
|
1371
1469
|
_cacheLoaded = true;
|
|
1372
|
-
return
|
|
1470
|
+
return customerOnly;
|
|
1373
1471
|
}
|
|
1374
1472
|
function getGlobalProceduresBlock() {
|
|
1375
|
-
|
|
1376
|
-
if (
|
|
1473
|
+
const sections = [];
|
|
1474
|
+
if (_platformCache) sections.push(_platformCache);
|
|
1475
|
+
if (_cacheLoaded && _customerCache) sections.push(_customerCache);
|
|
1476
|
+
if (sections.length === 0) return "";
|
|
1377
1477
|
return `## Organization-Wide Procedures (MANDATORY \u2014 supersedes all other rules)
|
|
1378
1478
|
|
|
1379
|
-
${
|
|
1479
|
+
${sections.join("\n\n")}
|
|
1380
1480
|
`;
|
|
1381
1481
|
}
|
|
1382
1482
|
async function storeGlobalProcedure(input) {
|
|
@@ -1401,13 +1501,16 @@ async function deactivateGlobalProcedure(id) {
|
|
|
1401
1501
|
await loadGlobalProcedures();
|
|
1402
1502
|
return result.rowsAffected > 0;
|
|
1403
1503
|
}
|
|
1404
|
-
var
|
|
1504
|
+
var _customerCache, _cacheLoaded, _platformCache;
|
|
1405
1505
|
var init_global_procedures = __esm({
|
|
1406
1506
|
"src/lib/global-procedures.ts"() {
|
|
1407
1507
|
"use strict";
|
|
1408
1508
|
init_database();
|
|
1409
|
-
|
|
1509
|
+
init_platform_procedures();
|
|
1510
|
+
_customerCache = "";
|
|
1410
1511
|
_cacheLoaded = false;
|
|
1512
|
+
_platformCache = PLATFORM_PROCEDURES.map((p) => `### ${p.title}
|
|
1513
|
+
${p.content}`).join("\n\n");
|
|
1411
1514
|
}
|
|
1412
1515
|
});
|
|
1413
1516
|
|
|
@@ -1935,11 +2038,42 @@ function isMainModule(importMetaUrl) {
|
|
|
1935
2038
|
}
|
|
1936
2039
|
|
|
1937
2040
|
// src/bin/backfill-vectors.ts
|
|
1938
|
-
import { existsSync as existsSync5, unlinkSync as
|
|
2041
|
+
import { existsSync as existsSync5, unlinkSync as unlinkSync3 } from "fs";
|
|
2042
|
+
import path6 from "path";
|
|
2043
|
+
|
|
2044
|
+
// src/lib/worker-gate.ts
|
|
2045
|
+
init_config();
|
|
2046
|
+
import { readdirSync as readdirSync2, writeFileSync, unlinkSync as unlinkSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
1939
2047
|
import path5 from "path";
|
|
2048
|
+
var WORKER_PID_DIR = path5.join(EXE_AI_DIR, "worker-pids");
|
|
2049
|
+
function registerWorkerPid(pid) {
|
|
2050
|
+
try {
|
|
2051
|
+
mkdirSync2(WORKER_PID_DIR, { recursive: true });
|
|
2052
|
+
writeFileSync(path5.join(WORKER_PID_DIR, `worker-${pid}.pid`), String(pid));
|
|
2053
|
+
} catch {
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
function cleanupWorkerPid() {
|
|
2057
|
+
try {
|
|
2058
|
+
unlinkSync2(path5.join(WORKER_PID_DIR, `worker-${process.pid}.pid`));
|
|
2059
|
+
} catch {
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
// src/bin/backfill-vectors.ts
|
|
1940
2064
|
var BATCH_SIZE = 100;
|
|
1941
|
-
var BACKFILL_FLAG =
|
|
2065
|
+
var BACKFILL_FLAG = path6.join(EXE_AI_DIR, "session-cache", "needs-backfill");
|
|
1942
2066
|
async function backfillVectors() {
|
|
2067
|
+
registerWorkerPid(process.pid);
|
|
2068
|
+
process.on("exit", () => cleanupWorkerPid());
|
|
2069
|
+
process.on("SIGTERM", () => {
|
|
2070
|
+
cleanupWorkerPid();
|
|
2071
|
+
process.exit(0);
|
|
2072
|
+
});
|
|
2073
|
+
process.on("SIGINT", () => {
|
|
2074
|
+
cleanupWorkerPid();
|
|
2075
|
+
process.exit(0);
|
|
2076
|
+
});
|
|
1943
2077
|
await initStore();
|
|
1944
2078
|
const connected = await connectEmbedDaemon();
|
|
1945
2079
|
if (!connected) {
|
|
@@ -1989,7 +2123,7 @@ async function backfillVectors() {
|
|
|
1989
2123
|
const remainingCount = Number(remaining.rows[0]?.cnt) || 0;
|
|
1990
2124
|
if (remainingCount === 0) {
|
|
1991
2125
|
try {
|
|
1992
|
-
|
|
2126
|
+
unlinkSync3(BACKFILL_FLAG);
|
|
1993
2127
|
} catch {
|
|
1994
2128
|
}
|
|
1995
2129
|
}
|