@askexenow/exe-os 0.9.69 → 0.9.71

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.
Files changed (79) hide show
  1. package/deploy/stack-manifests/v0.9.json +96 -16
  2. package/dist/bin/agentic-ontology-backfill.js +33 -0
  3. package/dist/bin/agentic-reflection-backfill.js +33 -0
  4. package/dist/bin/agentic-semantic-label.js +33 -0
  5. package/dist/bin/backfill-conversations.js +33 -0
  6. package/dist/bin/backfill-responses.js +33 -0
  7. package/dist/bin/backfill-vectors.js +33 -0
  8. package/dist/bin/bulk-sync-postgres.js +33 -0
  9. package/dist/bin/cleanup-stale-review-tasks.js +33 -0
  10. package/dist/bin/cli.js +1284 -178
  11. package/dist/bin/exe-agent.js +6 -0
  12. package/dist/bin/exe-assign.js +33 -0
  13. package/dist/bin/exe-boot.js +33 -0
  14. package/dist/bin/exe-call.js +6 -0
  15. package/dist/bin/exe-cloud.js +33 -0
  16. package/dist/bin/exe-dispatch.js +33 -0
  17. package/dist/bin/exe-doctor.js +33 -0
  18. package/dist/bin/exe-export-behaviors.js +33 -0
  19. package/dist/bin/exe-forget.js +33 -0
  20. package/dist/bin/exe-gateway.js +178 -110
  21. package/dist/bin/exe-heartbeat.js +33 -0
  22. package/dist/bin/exe-kill.js +33 -0
  23. package/dist/bin/exe-launch-agent.js +33 -0
  24. package/dist/bin/exe-new-employee.js +6 -0
  25. package/dist/bin/exe-pending-messages.js +33 -0
  26. package/dist/bin/exe-pending-notifications.js +33 -0
  27. package/dist/bin/exe-pending-reviews.js +33 -0
  28. package/dist/bin/exe-rename.js +40 -4
  29. package/dist/bin/exe-review.js +33 -0
  30. package/dist/bin/exe-search.js +33 -0
  31. package/dist/bin/exe-session-cleanup.js +33 -0
  32. package/dist/bin/exe-start-codex.js +33 -0
  33. package/dist/bin/exe-start-opencode.js +33 -0
  34. package/dist/bin/exe-status.js +33 -0
  35. package/dist/bin/exe-team.js +33 -0
  36. package/dist/bin/git-sweep.js +33 -0
  37. package/dist/bin/graph-backfill.js +177 -110
  38. package/dist/bin/graph-export.js +33 -0
  39. package/dist/bin/intercom-check.js +33 -0
  40. package/dist/bin/registry-proxy.js +207 -0
  41. package/dist/bin/scan-tasks.js +33 -0
  42. package/dist/bin/setup.js +33 -0
  43. package/dist/bin/shard-migrate.js +33 -0
  44. package/dist/bin/stack-update.js +128 -0
  45. package/dist/gateway/index.js +178 -110
  46. package/dist/hooks/bug-report-worker.js +33 -0
  47. package/dist/hooks/codex-stop-task-finalizer.js +33 -0
  48. package/dist/hooks/commit-complete.js +33 -0
  49. package/dist/hooks/error-recall.js +33 -0
  50. package/dist/hooks/ingest.js +33 -0
  51. package/dist/hooks/instructions-loaded.js +33 -0
  52. package/dist/hooks/notification.js +33 -0
  53. package/dist/hooks/post-compact.js +33 -0
  54. package/dist/hooks/post-tool-combined.js +698 -17
  55. package/dist/hooks/pre-compact.js +33 -0
  56. package/dist/hooks/pre-tool-use.js +33 -0
  57. package/dist/hooks/prompt-submit.js +314 -0
  58. package/dist/hooks/session-end.js +33 -0
  59. package/dist/hooks/session-start.js +33 -0
  60. package/dist/hooks/stop.js +279 -12
  61. package/dist/hooks/subagent-stop.js +33 -0
  62. package/dist/hooks/summary-worker.js +33 -0
  63. package/dist/index.js +178 -110
  64. package/dist/lib/cloud-sync.js +27 -0
  65. package/dist/lib/database.js +27 -0
  66. package/dist/lib/db.js +27 -0
  67. package/dist/lib/device-registry.js +27 -0
  68. package/dist/lib/employee-templates.js +6 -0
  69. package/dist/lib/exe-daemon.js +639 -259
  70. package/dist/lib/hybrid-search.js +33 -0
  71. package/dist/lib/registry-proxy.js +162 -0
  72. package/dist/lib/schedules.js +33 -0
  73. package/dist/lib/store.js +33 -0
  74. package/dist/mcp/server.js +561 -244
  75. package/dist/runtime/index.js +33 -0
  76. package/dist/tui/App.js +33 -0
  77. package/package.json +3 -2
  78. package/stack.release.json +6 -4
  79. package/stack.release.schema.json +89 -18
@@ -2292,6 +2292,33 @@ async function ensureSchema() {
2292
2292
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2293
2293
  ON chat_history(session_id, id);
2294
2294
  `);
2295
+ await client.executeMultiple(`
2296
+ CREATE TABLE IF NOT EXISTS session_events (
2297
+ id TEXT PRIMARY KEY,
2298
+ agent_id TEXT NOT NULL,
2299
+ agent_role TEXT NOT NULL,
2300
+ session_id TEXT NOT NULL,
2301
+ session_scope TEXT,
2302
+ project_name TEXT NOT NULL,
2303
+ event_index INTEGER NOT NULL,
2304
+ event_type TEXT NOT NULL,
2305
+ tool_name TEXT,
2306
+ tool_use_id TEXT,
2307
+ content TEXT NOT NULL,
2308
+ payload_json TEXT,
2309
+ has_error INTEGER NOT NULL DEFAULT 0,
2310
+ created_at TEXT NOT NULL
2311
+ );
2312
+
2313
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2314
+ ON session_events(agent_id, created_at DESC);
2315
+
2316
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2317
+ ON session_events(session_id, event_index);
2318
+
2319
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2320
+ ON session_events(session_scope, agent_id, created_at DESC);
2321
+ `);
2295
2322
  await client.executeMultiple(`
2296
2323
  CREATE TABLE IF NOT EXISTS workspaces (
2297
2324
  id TEXT PRIMARY KEY,
@@ -3008,6 +3035,12 @@ var init_platform_procedures = __esm({
3008
3035
  priority: "p0",
3009
3036
  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."
3010
3037
  },
3038
+ {
3039
+ title: "Code context first for repository orientation",
3040
+ domain: "workflow",
3041
+ priority: "p1",
3042
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3043
+ },
3011
3044
  {
3012
3045
  title: "Commit discipline \u2014 never leave verified work floating",
3013
3046
  domain: "workflow",
@@ -5265,10 +5298,7 @@ async function renameEmployee(oldName, newName, opts = {}) {
5265
5298
  const newIdentityPath = path8.join(identityDir, `${newName}.md`);
5266
5299
  if (existsSync8(oldIdentityPath)) {
5267
5300
  const content = readFileSync5(oldIdentityPath, "utf-8");
5268
- const updatedContent = content.replace(
5269
- /^(agent_id:\s*)\S+/m,
5270
- `$1${newName}`
5271
- );
5301
+ const updatedContent = rewriteRenamedEmployeeContent(content, rosterOldName, newName);
5272
5302
  renameSync4(oldIdentityPath, newIdentityPath);
5273
5303
  writeFileSync3(newIdentityPath, updatedContent, "utf-8");
5274
5304
  rollbackStack.push({
@@ -5285,7 +5315,9 @@ async function renameEmployee(oldName, newName, opts = {}) {
5285
5315
  const newAgentPath = path8.join(agentsDir, `${newName}.md`);
5286
5316
  if (existsSync8(oldAgentPath)) {
5287
5317
  const agentContent = readFileSync5(oldAgentPath, "utf-8");
5318
+ const updatedAgentContent = rewriteRenamedEmployeeContent(agentContent, rosterOldName, newName);
5288
5319
  renameSync4(oldAgentPath, newAgentPath);
5320
+ writeFileSync3(newAgentPath, updatedAgentContent, "utf-8");
5289
5321
  rollbackStack.push({
5290
5322
  description: "restore agent file",
5291
5323
  undo: () => {
@@ -5358,6 +5390,10 @@ async function renameEmployee(oldName, newName, opts = {}) {
5358
5390
  return { success: false, error: err instanceof Error ? err.message : String(err) };
5359
5391
  }
5360
5392
  }
5393
+ function rewriteRenamedEmployeeContent(content, oldName, newName) {
5394
+ const withAgentId = content.replace(/^(agent_id:\s*)\S+/m, `$1${newName}`);
5395
+ return personalizePrompt(withAgentId, oldName, newName);
5396
+ }
5361
5397
  function findExeBin2() {
5362
5398
  try {
5363
5399
  return execSync3(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
@@ -2451,6 +2451,33 @@ async function ensureSchema() {
2451
2451
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2452
2452
  ON chat_history(session_id, id);
2453
2453
  `);
2454
+ await client.executeMultiple(`
2455
+ CREATE TABLE IF NOT EXISTS session_events (
2456
+ id TEXT PRIMARY KEY,
2457
+ agent_id TEXT NOT NULL,
2458
+ agent_role TEXT NOT NULL,
2459
+ session_id TEXT NOT NULL,
2460
+ session_scope TEXT,
2461
+ project_name TEXT NOT NULL,
2462
+ event_index INTEGER NOT NULL,
2463
+ event_type TEXT NOT NULL,
2464
+ tool_name TEXT,
2465
+ tool_use_id TEXT,
2466
+ content TEXT NOT NULL,
2467
+ payload_json TEXT,
2468
+ has_error INTEGER NOT NULL DEFAULT 0,
2469
+ created_at TEXT NOT NULL
2470
+ );
2471
+
2472
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2473
+ ON session_events(agent_id, created_at DESC);
2474
+
2475
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2476
+ ON session_events(session_id, event_index);
2477
+
2478
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2479
+ ON session_events(session_scope, agent_id, created_at DESC);
2480
+ `);
2454
2481
  await client.executeMultiple(`
2455
2482
  CREATE TABLE IF NOT EXISTS workspaces (
2456
2483
  id TEXT PRIMARY KEY,
@@ -4139,6 +4166,12 @@ var init_platform_procedures = __esm({
4139
4166
  priority: "p0",
4140
4167
  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."
4141
4168
  },
4169
+ {
4170
+ title: "Code context first for repository orientation",
4171
+ domain: "workflow",
4172
+ priority: "p1",
4173
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4174
+ },
4142
4175
  {
4143
4176
  title: "Commit discipline \u2014 never leave verified work floating",
4144
4177
  domain: "workflow",
@@ -2436,6 +2436,33 @@ async function ensureSchema() {
2436
2436
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2437
2437
  ON chat_history(session_id, id);
2438
2438
  `);
2439
+ await client.executeMultiple(`
2440
+ CREATE TABLE IF NOT EXISTS session_events (
2441
+ id TEXT PRIMARY KEY,
2442
+ agent_id TEXT NOT NULL,
2443
+ agent_role TEXT NOT NULL,
2444
+ session_id TEXT NOT NULL,
2445
+ session_scope TEXT,
2446
+ project_name TEXT NOT NULL,
2447
+ event_index INTEGER NOT NULL,
2448
+ event_type TEXT NOT NULL,
2449
+ tool_name TEXT,
2450
+ tool_use_id TEXT,
2451
+ content TEXT NOT NULL,
2452
+ payload_json TEXT,
2453
+ has_error INTEGER NOT NULL DEFAULT 0,
2454
+ created_at TEXT NOT NULL
2455
+ );
2456
+
2457
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2458
+ ON session_events(agent_id, created_at DESC);
2459
+
2460
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2461
+ ON session_events(session_id, event_index);
2462
+
2463
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2464
+ ON session_events(session_scope, agent_id, created_at DESC);
2465
+ `);
2439
2466
  await client.executeMultiple(`
2440
2467
  CREATE TABLE IF NOT EXISTS workspaces (
2441
2468
  id TEXT PRIMARY KEY,
@@ -4124,6 +4151,12 @@ var init_platform_procedures = __esm({
4124
4151
  priority: "p0",
4125
4152
  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."
4126
4153
  },
4154
+ {
4155
+ title: "Code context first for repository orientation",
4156
+ domain: "workflow",
4157
+ priority: "p1",
4158
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4159
+ },
4127
4160
  {
4128
4161
  title: "Commit discipline \u2014 never leave verified work floating",
4129
4162
  domain: "workflow",
@@ -2480,6 +2480,33 @@ async function ensureSchema() {
2480
2480
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2481
2481
  ON chat_history(session_id, id);
2482
2482
  `);
2483
+ await client.executeMultiple(`
2484
+ CREATE TABLE IF NOT EXISTS session_events (
2485
+ id TEXT PRIMARY KEY,
2486
+ agent_id TEXT NOT NULL,
2487
+ agent_role TEXT NOT NULL,
2488
+ session_id TEXT NOT NULL,
2489
+ session_scope TEXT,
2490
+ project_name TEXT NOT NULL,
2491
+ event_index INTEGER NOT NULL,
2492
+ event_type TEXT NOT NULL,
2493
+ tool_name TEXT,
2494
+ tool_use_id TEXT,
2495
+ content TEXT NOT NULL,
2496
+ payload_json TEXT,
2497
+ has_error INTEGER NOT NULL DEFAULT 0,
2498
+ created_at TEXT NOT NULL
2499
+ );
2500
+
2501
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2502
+ ON session_events(agent_id, created_at DESC);
2503
+
2504
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2505
+ ON session_events(session_id, event_index);
2506
+
2507
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2508
+ ON session_events(session_scope, agent_id, created_at DESC);
2509
+ `);
2483
2510
  await client.executeMultiple(`
2484
2511
  CREATE TABLE IF NOT EXISTS workspaces (
2485
2512
  id TEXT PRIMARY KEY,
@@ -4168,6 +4195,12 @@ var init_platform_procedures = __esm({
4168
4195
  priority: "p0",
4169
4196
  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."
4170
4197
  },
4198
+ {
4199
+ title: "Code context first for repository orientation",
4200
+ domain: "workflow",
4201
+ priority: "p1",
4202
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4203
+ },
4171
4204
  {
4172
4205
  title: "Commit discipline \u2014 never leave verified work floating",
4173
4206
  domain: "workflow",
@@ -2309,6 +2309,33 @@ async function ensureSchema() {
2309
2309
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2310
2310
  ON chat_history(session_id, id);
2311
2311
  `);
2312
+ await client.executeMultiple(`
2313
+ CREATE TABLE IF NOT EXISTS session_events (
2314
+ id TEXT PRIMARY KEY,
2315
+ agent_id TEXT NOT NULL,
2316
+ agent_role TEXT NOT NULL,
2317
+ session_id TEXT NOT NULL,
2318
+ session_scope TEXT,
2319
+ project_name TEXT NOT NULL,
2320
+ event_index INTEGER NOT NULL,
2321
+ event_type TEXT NOT NULL,
2322
+ tool_name TEXT,
2323
+ tool_use_id TEXT,
2324
+ content TEXT NOT NULL,
2325
+ payload_json TEXT,
2326
+ has_error INTEGER NOT NULL DEFAULT 0,
2327
+ created_at TEXT NOT NULL
2328
+ );
2329
+
2330
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2331
+ ON session_events(agent_id, created_at DESC);
2332
+
2333
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2334
+ ON session_events(session_id, event_index);
2335
+
2336
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2337
+ ON session_events(session_scope, agent_id, created_at DESC);
2338
+ `);
2312
2339
  await client.executeMultiple(`
2313
2340
  CREATE TABLE IF NOT EXISTS workspaces (
2314
2341
  id TEXT PRIMARY KEY,
@@ -3440,6 +3467,12 @@ var init_platform_procedures = __esm({
3440
3467
  priority: "p0",
3441
3468
  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."
3442
3469
  },
3470
+ {
3471
+ title: "Code context first for repository orientation",
3472
+ domain: "workflow",
3473
+ priority: "p1",
3474
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3475
+ },
3443
3476
  {
3444
3477
  title: "Commit discipline \u2014 never leave verified work floating",
3445
3478
  domain: "workflow",
@@ -2309,6 +2309,33 @@ async function ensureSchema() {
2309
2309
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2310
2310
  ON chat_history(session_id, id);
2311
2311
  `);
2312
+ await client.executeMultiple(`
2313
+ CREATE TABLE IF NOT EXISTS session_events (
2314
+ id TEXT PRIMARY KEY,
2315
+ agent_id TEXT NOT NULL,
2316
+ agent_role TEXT NOT NULL,
2317
+ session_id TEXT NOT NULL,
2318
+ session_scope TEXT,
2319
+ project_name TEXT NOT NULL,
2320
+ event_index INTEGER NOT NULL,
2321
+ event_type TEXT NOT NULL,
2322
+ tool_name TEXT,
2323
+ tool_use_id TEXT,
2324
+ content TEXT NOT NULL,
2325
+ payload_json TEXT,
2326
+ has_error INTEGER NOT NULL DEFAULT 0,
2327
+ created_at TEXT NOT NULL
2328
+ );
2329
+
2330
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2331
+ ON session_events(agent_id, created_at DESC);
2332
+
2333
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2334
+ ON session_events(session_id, event_index);
2335
+
2336
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2337
+ ON session_events(session_scope, agent_id, created_at DESC);
2338
+ `);
2312
2339
  await client.executeMultiple(`
2313
2340
  CREATE TABLE IF NOT EXISTS workspaces (
2314
2341
  id TEXT PRIMARY KEY,
@@ -3440,6 +3467,12 @@ var init_platform_procedures = __esm({
3440
3467
  priority: "p0",
3441
3468
  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."
3442
3469
  },
3470
+ {
3471
+ title: "Code context first for repository orientation",
3472
+ domain: "workflow",
3473
+ priority: "p1",
3474
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3475
+ },
3443
3476
  {
3444
3477
  title: "Commit discipline \u2014 never leave verified work floating",
3445
3478
  domain: "workflow",
@@ -2459,6 +2459,33 @@ async function ensureSchema() {
2459
2459
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2460
2460
  ON chat_history(session_id, id);
2461
2461
  `);
2462
+ await client.executeMultiple(`
2463
+ CREATE TABLE IF NOT EXISTS session_events (
2464
+ id TEXT PRIMARY KEY,
2465
+ agent_id TEXT NOT NULL,
2466
+ agent_role TEXT NOT NULL,
2467
+ session_id TEXT NOT NULL,
2468
+ session_scope TEXT,
2469
+ project_name TEXT NOT NULL,
2470
+ event_index INTEGER NOT NULL,
2471
+ event_type TEXT NOT NULL,
2472
+ tool_name TEXT,
2473
+ tool_use_id TEXT,
2474
+ content TEXT NOT NULL,
2475
+ payload_json TEXT,
2476
+ has_error INTEGER NOT NULL DEFAULT 0,
2477
+ created_at TEXT NOT NULL
2478
+ );
2479
+
2480
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2481
+ ON session_events(agent_id, created_at DESC);
2482
+
2483
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2484
+ ON session_events(session_id, event_index);
2485
+
2486
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2487
+ ON session_events(session_scope, agent_id, created_at DESC);
2488
+ `);
2462
2489
  await client.executeMultiple(`
2463
2490
  CREATE TABLE IF NOT EXISTS workspaces (
2464
2491
  id TEXT PRIMARY KEY,
@@ -4147,6 +4174,12 @@ var init_platform_procedures = __esm({
4147
4174
  priority: "p0",
4148
4175
  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."
4149
4176
  },
4177
+ {
4178
+ title: "Code context first for repository orientation",
4179
+ domain: "workflow",
4180
+ priority: "p1",
4181
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4182
+ },
4150
4183
  {
4151
4184
  title: "Commit discipline \u2014 never leave verified work floating",
4152
4185
  domain: "workflow",
@@ -2448,6 +2448,33 @@ async function ensureSchema() {
2448
2448
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2449
2449
  ON chat_history(session_id, id);
2450
2450
  `);
2451
+ await client.executeMultiple(`
2452
+ CREATE TABLE IF NOT EXISTS session_events (
2453
+ id TEXT PRIMARY KEY,
2454
+ agent_id TEXT NOT NULL,
2455
+ agent_role TEXT NOT NULL,
2456
+ session_id TEXT NOT NULL,
2457
+ session_scope TEXT,
2458
+ project_name TEXT NOT NULL,
2459
+ event_index INTEGER NOT NULL,
2460
+ event_type TEXT NOT NULL,
2461
+ tool_name TEXT,
2462
+ tool_use_id TEXT,
2463
+ content TEXT NOT NULL,
2464
+ payload_json TEXT,
2465
+ has_error INTEGER NOT NULL DEFAULT 0,
2466
+ created_at TEXT NOT NULL
2467
+ );
2468
+
2469
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2470
+ ON session_events(agent_id, created_at DESC);
2471
+
2472
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2473
+ ON session_events(session_id, event_index);
2474
+
2475
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2476
+ ON session_events(session_scope, agent_id, created_at DESC);
2477
+ `);
2451
2478
  await client.executeMultiple(`
2452
2479
  CREATE TABLE IF NOT EXISTS workspaces (
2453
2480
  id TEXT PRIMARY KEY,
@@ -4136,6 +4163,12 @@ var init_platform_procedures = __esm({
4136
4163
  priority: "p0",
4137
4164
  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."
4138
4165
  },
4166
+ {
4167
+ title: "Code context first for repository orientation",
4168
+ domain: "workflow",
4169
+ priority: "p1",
4170
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4171
+ },
4139
4172
  {
4140
4173
  title: "Commit discipline \u2014 never leave verified work floating",
4141
4174
  domain: "workflow",
@@ -2960,6 +2960,33 @@ async function ensureSchema() {
2960
2960
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2961
2961
  ON chat_history(session_id, id);
2962
2962
  `);
2963
+ await client.executeMultiple(`
2964
+ CREATE TABLE IF NOT EXISTS session_events (
2965
+ id TEXT PRIMARY KEY,
2966
+ agent_id TEXT NOT NULL,
2967
+ agent_role TEXT NOT NULL,
2968
+ session_id TEXT NOT NULL,
2969
+ session_scope TEXT,
2970
+ project_name TEXT NOT NULL,
2971
+ event_index INTEGER NOT NULL,
2972
+ event_type TEXT NOT NULL,
2973
+ tool_name TEXT,
2974
+ tool_use_id TEXT,
2975
+ content TEXT NOT NULL,
2976
+ payload_json TEXT,
2977
+ has_error INTEGER NOT NULL DEFAULT 0,
2978
+ created_at TEXT NOT NULL
2979
+ );
2980
+
2981
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2982
+ ON session_events(agent_id, created_at DESC);
2983
+
2984
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2985
+ ON session_events(session_id, event_index);
2986
+
2987
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2988
+ ON session_events(session_scope, agent_id, created_at DESC);
2989
+ `);
2963
2990
  await client.executeMultiple(`
2964
2991
  CREATE TABLE IF NOT EXISTS workspaces (
2965
2992
  id TEXT PRIMARY KEY,
@@ -7841,6 +7868,12 @@ var init_platform_procedures = __esm({
7841
7868
  priority: "p0",
7842
7869
  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."
7843
7870
  },
7871
+ {
7872
+ title: "Code context first for repository orientation",
7873
+ domain: "workflow",
7874
+ priority: "p1",
7875
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
7876
+ },
7844
7877
  {
7845
7878
  title: "Commit discipline \u2014 never leave verified work floating",
7846
7879
  domain: "workflow",