@cgh567/agent 2.4.1 → 2.4.3

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 (169) hide show
  1. package/bin/helios +0 -0
  2. package/bin/helios-rpc-node-wrapper.cjs +0 -0
  3. package/bin/helios-rpc-wrapper.sh +0 -0
  4. package/daemon/adapters/helios-rpc-adapter.js +47 -25
  5. package/daemon/adapters/tui_wakeup.js +8 -0
  6. package/daemon/config/com.familiar.helios-daemon.plist +5 -0
  7. package/daemon/config/helios-daemon.service +4 -0
  8. package/daemon/context-enrichment.js +59 -21
  9. package/daemon/daemon-manager.js +1 -1
  10. package/daemon/db/email-infrastructure-migrate.js +192 -0
  11. package/daemon/db/hbo-core-migrate.js +189 -0
  12. package/daemon/helios-api.js +723 -57
  13. package/daemon/helios-company-daemon.js +616 -134
  14. package/daemon/lib/harada/cascade-judge.js +12 -50
  15. package/daemon/lib/harada/mandala.js +20 -0
  16. package/daemon/lib/harada/pillar-dispatcher.js +1 -1
  17. package/daemon/lib/harada/project-factory.js +7 -2
  18. package/daemon/lib/hbo-bridge.js +32 -13
  19. package/daemon/lib/hed-engine.js +10 -292
  20. package/daemon/lib/helios-hitl-host.js +15 -2
  21. package/daemon/lib/hitl-interaction-service.js +0 -0
  22. package/daemon/lib/memgraph-verify.js +38 -33
  23. package/daemon/lib/project-drift-detector.js +7 -17
  24. package/daemon/lib/project-semantic-updater.js +1 -14
  25. package/daemon/lib/task-completion-processor.js +11 -0
  26. package/daemon/lib/wizard-engine.js +57 -6
  27. package/daemon/routes/channels.js +10 -5
  28. package/daemon/routes/harada-map.js +11 -48
  29. package/daemon/routes/hbo.js +342 -75
  30. package/daemon/routes/hitl.js +0 -0
  31. package/daemon/routes/project.js +194 -62
  32. package/daemon/routes/routines.js +14 -0
  33. package/daemon/routes/tasks.js +15 -1
  34. package/daemon/routes/wizard.js +11 -4
  35. package/daemon/schema-apply.js +174 -0
  36. package/daemon/schema-definitions.js +423 -0
  37. package/daemon/schema-migrations-hbo.js +10 -0
  38. package/daemon/schema-migrations-hed.js +18 -0
  39. package/daemon/schema-migrations-hitl.js +0 -0
  40. package/daemon/schema-migrations-proj.js +131 -0
  41. package/extensions/001-tool-output-cap.ts +0 -0
  42. package/extensions/context-compaction.ts +45 -26
  43. package/extensions/cortex/activation-bridge.ts +5 -0
  44. package/extensions/cortex/learn.ts +26 -0
  45. package/extensions/cortex/wal-replay.ts +91 -0
  46. package/extensions/email/backfill.ts +0 -0
  47. package/extensions/helios-governance/analysis/ambiguity.ts +0 -0
  48. package/extensions/helios-governance/analysis/compliance.ts +0 -0
  49. package/extensions/helios-governance/analysis/long-task-detector.ts +0 -0
  50. package/extensions/helios-governance/analysis/output-contract.ts +0 -0
  51. package/extensions/helios-governance/analysis/patterns.ts +0 -0
  52. package/extensions/helios-governance/analysis/preflight.ts +0 -0
  53. package/extensions/helios-governance/analysis/recurring-violations.ts +0 -0
  54. package/extensions/helios-governance/analysis/task-classification.ts +0 -0
  55. package/extensions/helios-governance/analysis/task-intent.ts +0 -0
  56. package/extensions/helios-governance/gates/high-impact.ts +1 -1
  57. package/extensions/helios-governance/handlers/_jiti-require.ts +15 -8
  58. package/extensions/helios-governance/handlers/proxy-test-detector.ts +0 -0
  59. package/extensions/hema-dispatch-v3/graph-memory.ts +10 -0
  60. package/extensions/hema-dispatch-v3/index.ts +72 -47
  61. package/extensions/lib/elo-engine.js +0 -0
  62. package/extensions/lib/elo-engine.test.js +0 -0
  63. package/extensions/memgraph-autostart.ts +13 -0
  64. package/extensions/neuroplastic-eval.ts +0 -0
  65. package/extensions/shadow-loop/index.ts +0 -0
  66. package/extensions/warm-tick/warm-tick-maintenance.ts +8 -0
  67. package/lib/__tests__/hbo-core-store.test.js +238 -0
  68. package/lib/brain-v2-budget.js +0 -0
  69. package/lib/brain-v2-circuit-breaker.js +0 -0
  70. package/lib/brain-v2.js +0 -0
  71. package/lib/broker/adaptive-throttle.js +0 -0
  72. package/lib/broker/batch-coalescer.js +0 -0
  73. package/lib/broker/bulkhead.js +0 -0
  74. package/lib/broker/channel-registry.js +0 -0
  75. package/lib/broker/circuit-breaker.js +0 -0
  76. package/lib/broker/evidence-cache.js +0 -0
  77. package/lib/broker/health-monitor.js +0 -0
  78. package/lib/broker/mage-queue.js +0 -0
  79. package/lib/broker/priority-queue.js +0 -0
  80. package/lib/broker/server.js.bak-error2-fix +0 -0
  81. package/lib/broker/session-registry.js +0 -0
  82. package/lib/broker/singleton-timers.js +0 -0
  83. package/lib/broker/types.d.ts +0 -0
  84. package/lib/broker/vegas-limit.js +0 -0
  85. package/lib/compression/dist/ccr-store.js +74 -0
  86. package/lib/compression/dist/content-router.js +115 -0
  87. package/lib/compression/dist/pipeline.js +113 -0
  88. package/lib/compression/dist/server.js +265 -0
  89. package/lib/compression/dist/smart-crusher.js +251 -0
  90. package/lib/context-budget.ts +0 -0
  91. package/lib/context-firewall.js +0 -0
  92. package/lib/crm/integration/triage-bridge.js +0 -0
  93. package/lib/email-utils.ts +0 -0
  94. package/lib/eval/__tests__/preflight-checker.test.ts +0 -0
  95. package/lib/eval/__tests__/task-instruction-parser.test.ts +0 -0
  96. package/lib/eval/__tests__/verifier-runner.test.ts +0 -0
  97. package/lib/eval/index.ts +0 -0
  98. package/lib/eval/preflight-checker.ts +0 -0
  99. package/lib/eval/task-domain-classifier.ts +0 -0
  100. package/lib/eval/task-instruction-parser.ts +0 -0
  101. package/lib/eval/verifier-runner.ts +0 -0
  102. package/lib/event-bus.d.ts +0 -0
  103. package/lib/event-bus.mts +1 -1
  104. package/lib/governance-context-selector.ts +0 -0
  105. package/lib/graph/generate-extension-embeddings.js +0 -0
  106. package/lib/graph/generate-static-embeddings.js +0 -0
  107. package/lib/graph/lib/utils.js +1 -1
  108. package/lib/graph-audit.d.ts +0 -0
  109. package/lib/graph-availability.js +62 -0
  110. package/lib/hbo-core-store.compiled.js +834 -0
  111. package/lib/hbo-core-store.js +124 -0
  112. package/lib/hbo-core-store.ts +908 -0
  113. package/lib/mesh-circuit-breaker.js +0 -0
  114. package/lib/mission-loop/lesson-extractor.ts +0 -0
  115. package/lib/mission-loop/mental-model-scorer.ts +0 -0
  116. package/lib/mission-loop/occ-detector.ts +0 -0
  117. package/lib/mission-loop/query-variants.ts +0 -0
  118. package/lib/mission-loop/verifier-check.ts +0 -0
  119. package/lib/skill-reference-builder.ts +0 -0
  120. package/lib/telemetry/token-breakdown.ts +0 -0
  121. package/lib/tool-compressor.ts +0 -0
  122. package/lib/triage-core/classifier.ts +3 -2
  123. package/lib/triage-core/graph/schema.cypher +10 -0
  124. package/lib/triage-core/legal-routing.ts +0 -0
  125. package/lib/triage-core/mental-model/dunbar-classifier.ts +0 -0
  126. package/lib/triage-core/mental-model/enrich-all.ts +0 -0
  127. package/lib/triage-core/mental-model/identity-resolver.ts +0 -0
  128. package/lib/triage-core/mental-model/key-facts.ts +1 -2
  129. package/lib/triage-core/mental-model/model-assembler.ts +0 -0
  130. package/lib/triage-core/orchestrator.ts +4 -11
  131. package/lib/triage-core/orchestrator.ts.bak-r005-r006-r008 +0 -0
  132. package/package.json +18 -8
  133. package/skills/helios-business-operator/services/signals/upwork-signals.js +0 -0
  134. package/skills/talisman-ceo/SKILL.md +23 -25
  135. package/skills/talisman-comms/SKILL.md +5 -5
  136. package/skills/talisman-engineering/SKILL.md +5 -5
  137. package/skills/talisman-finance/SKILL.md +10 -8
  138. package/skills/talisman-marketing/SKILL.md +10 -10
  139. package/skills/talisman-sales/SKILL.md +12 -15
  140. package/skills/talisman-support/SKILL.md +5 -5
  141. package/agents/business/talisman-ceo.md +0 -183
  142. package/agents/business/talisman-comms.md +0 -257
  143. package/agents/business/talisman-cto.md +0 -153
  144. package/agents/business/talisman-finance.md +0 -246
  145. package/agents/business/talisman-marketing.md +0 -240
  146. package/agents/business/talisman-sales.md +0 -242
  147. package/agents/business/talisman-support.md +0 -236
  148. package/daemon/lib/approval-expiry.js +0 -162
  149. package/daemon/lib/blast-radius-analyzer.js +0 -75
  150. package/daemon/lib/domain-bootstrap-orchestrator.js +0 -267
  151. package/daemon/lib/forensic-log.js +0 -113
  152. package/daemon/lib/goal-research-pipeline.js +0 -644
  153. package/daemon/lib/harada/cascade-research-dispatcher.js +0 -261
  154. package/daemon/lib/headroom-middleware.js +0 -167
  155. package/daemon/lib/headroom-proxy-manager.js +0 -623
  156. package/daemon/lib/mental-model-cache.js +0 -96
  157. package/daemon/lib/project-factory.js +0 -47
  158. package/daemon/lib/session-log-reader.js +0 -93
  159. package/daemon/routes/hed.js +0 -133
  160. package/lib/graph/learning/headroom-learn-bridge.js +0 -215
  161. package/skills/helios-bookkeeping/SKILL.md +0 -321
  162. package/skills/helios-briefer/SKILL.md +0 -44
  163. package/skills/helios-client-relations/SKILL.md +0 -322
  164. package/skills/helios-personal-triager/SKILL.md +0 -45
  165. package/skills/helios-recruitment/SKILL.md +0 -317
  166. package/skills/helios-relationship-nudger/SKILL.md +0 -77
  167. package/skills/helios-researcher/SKILL.md +0 -44
  168. package/skills/helios-scheduler/SKILL.md +0 -58
  169. package/skills/helios-tax-analyst/SKILL.md +0 -280
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -52,8 +52,9 @@ import * as senderPrestige from './signals/prestige-scorer.ts';
52
52
  import * as personalImportance from './signals/personal-importance.ts';
53
53
  import * as goalRelevance from './signals/goal-relevance.ts';
54
54
 
55
- // W-12: Startup warning if HELIOS_SELF_ID not set
56
- const SELF_ID = process.env.HELIOS_SELF_ID || (() => { process.stderr.write('[triage] HELIOS_SELF_ID not set self-relationship queries will return empty\n'); return '__SELF_ID_NOT_SET__'; })();
55
+ // C5: HELIOS_SELF_ID is structurally required throw at startup if missing
56
+ if (!process.env.HELIOS_SELF_ID) throw new Error('HELIOS_SELF_ID env var is required set it in .env');
57
+ const SELF_ID = process.env.HELIOS_SELF_ID;
57
58
 
58
59
  // B11: Load goal-lifecycle at module init (not inside hot path) to avoid repeated require() calls.
59
60
  // If the module is not found, goal boost is disabled and a warning is emitted once at startup.
@@ -52,6 +52,16 @@ CREATE INDEX ON :FAVEESnapshot(week) IF NOT EXISTS;
52
52
  // NODE LABEL REFERENCE (no DDL needed — Memgraph creates on first write)
53
53
  // ---------------------------------------------------------------------------
54
54
  //
55
+ // DraftAction:
56
+ // id (string), type (email|slack), triggeredBy (string), content (JSON string),
57
+ // personId (string nullable), status (created|approved|executed|expired),
58
+ // createdAt (datetime), expiresAt (datetime)
59
+ //
60
+ // SEC-5 TTL POLICY: DraftAction nodes store PII (email body, recipient handle).
61
+ // 30-day TTL enforced by warm-tick-maintenance.ts daily cleanup:
62
+ // MATCH (da:DraftAction) WHERE da.expiresAt < datetime() DETACH DELETE da
63
+ // All new DraftAction writes MUST set expiresAt = datetime() + duration({days: 30}).
64
+ //
55
65
  // Identity:
56
66
  // id (UUID), handle (string), platform (email|imessage|phone),
57
67
  // displayName (string), createdAt (ISO), verified (boolean)
File without changes
File without changes
File without changes
File without changes
@@ -13,8 +13,7 @@ import { createRequire } from 'module';
13
13
  import { KEY_FACTS_MODEL_ID } from './bedrock-config.ts';
14
14
 
15
15
  function getSelfId(): string {
16
- const id = process.env.HELIOS_SELF_ID || '';
17
- if (!id) throw new Error('[key-facts] HELIOS_SELF_ID env var is required -- set it in .env');
16
+ const id = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('[key-facts] HELIOS_SELF_ID env var is required -- set it in .env'); })();
18
17
  return id;
19
18
  }
20
19
 
File without changes
@@ -537,7 +537,8 @@ export class TriageOrchestrator {
537
537
  }),
538
538
  personId: (item.senderModel as any)?.personId || null,
539
539
  status: 'created',
540
- expiresAt: new Date(Date.now() + 48 * 60 * 60 * 1000).toISOString(),
540
+ // SEC-5: 30-day TTL DraftAction nodes contain PII; cleaned up by warm-tick daily maintenance
541
+ expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
541
542
  }));
542
543
  await rawWrite(
543
544
  `UNWIND $batch AS d
@@ -1478,11 +1479,7 @@ export class TriageOrchestrator {
1478
1479
  }
1479
1480
 
1480
1481
  private checkExtractionTriggers(personIds: string[]): void {
1481
- const selfId = process.env.HELIOS_SELF_ID || '';
1482
- if (!selfId) {
1483
- this.log('warn', 'self_id.missing', { fn: 'checkExtractionTriggers' });
1484
- return; // early exit, not fatal
1485
- }
1482
+ const selfId = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('HELIOS_SELF_ID env var is required'); })();
1486
1483
  const unique = [...new Set(personIds.filter(id => id && id !== selfId))];
1487
1484
  if (unique.length === 0) return;
1488
1485
 
@@ -1544,11 +1541,7 @@ export class TriageOrchestrator {
1544
1541
  try {
1545
1542
  const { rawRead } = require('../safe-memgraph.js');
1546
1543
  let md = briefing.markdown || '';
1547
- const selfId = process.env.HELIOS_SELF_ID || '';
1548
- if (!selfId) {
1549
- this.log('warn', 'self_id.missing', { fn: 'enrichBriefingWithSecretary' });
1550
- return; // early exit, not fatal
1551
- }
1544
+ const selfId = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('HELIOS_SELF_ID env var is required'); })();
1552
1545
 
1553
1546
  if (!md.includes('<!-- active-situations -->')) {
1554
1547
  // NOTE: briefing.markdown uses emoji. All consumers must parse as UTF-8.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cgh567/agent",
3
- "version": "2.4.1",
4
- "description": "Helios agent runtime full stack: extensions, skills, daemon, brain-v2, HEMA, governance",
3
+ "version": "2.4.3",
4
+ "description": "Helios agent runtime \u2014 full stack: extensions, skills, daemon, brain-v2, HEMA, governance",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "helios-rpc": "./bin/helios-rpc.cjs",
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "scripts": {
12
12
  "build": "node scripts/build-brain-service.js",
13
+ "build:compression": "node node_modules/typescript/bin/tsc -p lib/compression/tsconfig.json",
13
14
  "postinstall": "node postinstall.cjs || echo '[helios-agent] postinstall skipped'",
14
15
  "patch-aliases": "node scripts/patch-pi-aliases.js",
15
16
  "update": "helios update",
@@ -25,7 +26,12 @@
25
26
  "test:hbo-wizard": "node tests/hbo/wizard-infra-gate.test.js && node tests/hbo/wizard-provider-validation.test.js && node tests/hbo/wizard-company-creation.test.js",
26
27
  "test:harbor": "python3 -m pytest evals/harbor/ -v --timeout=60 --tb=short",
27
28
  "test:harada": "python3 -m pytest evals/harbor/test_harada.py -v --timeout=60 --tb=short",
28
- "test:harbor:all": "python3 -m pytest evals/harbor/ -v --timeout=60 --tb=short"
29
+ "test:harbor:all": "python3 -m pytest evals/harbor/ -v --timeout=60 --tb=short",
30
+ "test:compression": "python3 -m pytest evals/harbor/test_compression.py -v --tb=short",
31
+ "db:migrate-hbo": "node --experimental-sqlite daemon/db/hbo-core-migrate.js",
32
+ "db:migrate-all": "node --experimental-sqlite daemon/db/email-infrastructure-migrate.js && node --experimental-sqlite daemon/db/hbo-core-migrate.js",
33
+ "test:hbo-store": "node --experimental-sqlite lib/__tests__/hbo-core-store.test.js",
34
+ "test:hbo-fallback": "NODE_OPTIONS=--experimental-sqlite npx vitest run daemon/__tests__/hbo-core-fallback.test.js"
29
35
  },
30
36
  "pi": {
31
37
  "extensions": [
@@ -79,6 +85,7 @@
79
85
  "croner": "^9.0.0",
80
86
  "ghost-cursor": "^1.4.2",
81
87
  "googleapis": "^171.4.0",
88
+ "headroom-ai": "^0.22.4",
82
89
  "httpsms": "^0.0.4",
83
90
  "ioredis": "^5.10.1",
84
91
  "js-tiktoken": "^1.0.21",
@@ -90,15 +97,13 @@
90
97
  "puppeteer-extra-plugin-stealth": "^2.11.2",
91
98
  "qrcode-terminal": "^0.12.0",
92
99
  "signal-sdk": "^0.2.4",
93
- "tree-sitter": "^0.25.0",
94
- "tree-sitter-javascript": "^0.25.0",
95
- "tree-sitter-python": "^0.25.0",
100
+ "tree-sitter": "^0.21.1",
101
+ "tree-sitter-javascript": "^0.23.1",
102
+ "tree-sitter-python": "^0.21.0",
96
103
  "tree-sitter-typescript": "^0.23.2",
97
- "headroom-ai": "^0.22.4",
98
104
  "write-file-atomic": "^7.0.1"
99
105
  },
100
106
  "devDependencies": {
101
- "@esbuild/linux-x64": "^0.28.0",
102
107
  "ts-morph": "^27.0.2",
103
108
  "tsx": "^4.21.0",
104
109
  "typescript": "^6.0.3",
@@ -118,7 +123,12 @@
118
123
  "daemon/schema-migrations-harada.js",
119
124
  "daemon/schema-migrations-hbo.js",
120
125
  "daemon/schema-migrations-hitl.js",
126
+ "daemon/schema-migrations-proj.js",
127
+ "daemon/schema-migrations-hed.js",
121
128
  "daemon/schema-migrations.js",
129
+ "daemon/schema-apply.js",
130
+ "daemon/schema-definitions.js",
131
+ "daemon/db/",
122
132
  "daemon/context-enrichment.js",
123
133
  "daemon/agent-discovery.js",
124
134
  "daemon/daemon-manager.js",
@@ -1,15 +1,13 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-ceo
4
- description: CEO/Strategy agent for Talisman — weekly planning, goal decomposition, department delegation
4
+ description: CEO/Strategy agent — weekly planning, goal decomposition, department delegation
5
5
  when: Loaded by the CEO agent on all planning, review, and delegation tasks
6
6
  adapter:
7
7
  type: helios_rpc
8
8
  skills:
9
9
  - helios-prime
10
10
  - helios-business-operator
11
- agent_id: "agent:ceo"
12
- company_id: talisman
13
11
  departments:
14
12
  - Strategy
15
13
  - Engineering
@@ -30,14 +28,14 @@ If **YES** → Check the approval first. Do NOT start new planning cycles while
30
28
  ### ✅ Example of Good CEO Output:
31
29
  ```
32
30
  Weekly Plan — Week of 2026-05-19
33
- Goal: Ship Talisman v1.2 (30% complete)
31
+ Goal: Grow revenue 30% this quarter (30% complete)
34
32
 
35
33
  Delegated This Week:
36
- - Engineering: Implement bank statement auto-import (priority: P1)
34
+ - Engineering: Implement key product feature (priority: P1)
37
35
  - Sales: Follow up on 3 warm leads from last week (priority: P2)
38
- - Marketing: Draft blog post "5 Signs Your Accounting Firm Needs Automation" (priority: P3)
36
+ - Marketing: Draft blog post on company value proposition (priority: P3)
39
37
 
40
- Pending Approvals: 1 (promote v1.1 to production — review before EOD)
38
+ Pending Approvals: 1 (review before EOD)
41
39
  Budget Status: ✅ 42% used ($25/$60 monthly)
42
40
  ```
43
41
 
@@ -47,20 +45,20 @@ Budget Status: ✅ 42% used ($25/$60 monthly)
47
45
 
48
46
  **Step 1**: Query Memgraph for all pending approvals and current goal progress
49
47
  ```cypher
50
- MATCH (a:Approval {status: 'pending'}) RETURN a.title, a.type, a.createdAt;
51
- MATCH (g:Goal {companyId: 'talisman'}) WHERE g.status <> 'completed' RETURN g.title, g.level, g.status;
48
+ MATCH (a:Approval {companyId: $HELIOS_COMPANY_ID, status: 'pending'}) RETURN a.title, a.type, a.createdAt;
49
+ MATCH (g:CompanyGoal {companyId: $HELIOS_COMPANY_ID}) WHERE g.status <> 'completed' RETURN g.title, g.status;
52
50
  ```
53
51
 
54
52
  **Step 2**: Query all department statuses (Task counts by status for each department)
55
53
  ```cypher
56
- MATCH (t:Task {companyId: 'talisman'})
54
+ MATCH (t:Task {companyId: $HELIOS_COMPANY_ID})
57
55
  WHERE t.status IN ['todo', 'in_progress', 'blocked']
58
56
  RETURN t.status, count(t) AS count;
59
57
  ```
60
58
 
61
59
  **Step 3**: Check budget health
62
- ```bash
63
- cat ~/helios-agent/brainv2/budget-status.json
60
+ ```cypher
61
+ MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID}) RETURN bp.scope, bp.agentId, bp.limitCents, bp.spentCents, bp.percentUsed, bp.status
64
62
  ```
65
63
 
66
64
  ---
@@ -99,7 +97,7 @@ Company Goal (e.g., "Ship Talisman v1.2")
99
97
  └── Task (e.g., "Implement CSV parser for Chase format")
100
98
  ```
101
99
 
102
- - Goals must have: `title`, `level`, `status`, `companyId: 'talisman'`, `ownerId` (dept)
100
+ - Goals must have: `title`, `level`, `status`, `companyId: $HELIOS_COMPANY_ID`, `ownerId` (dept)
103
101
  - Tasks must have: `title`, `priority`, `acceptanceCriteria`, `assignedTo` (dept head), `dueDate`
104
102
  - Never create a task without acceptance criteria
105
103
 
@@ -178,7 +176,7 @@ Approval gates. Your job is quality reviewer:
178
176
  - Any external payment processing → Approval required
179
177
  - New vendor agreements → Approval required
180
178
  - Budget override requests → Approval required
181
- - Approval node schema: `{title, type, status: 'pending', requestedBy, createdAt, companyId: 'talisman'}`
179
+ - Approval node schema: `{title, type, status: 'pending', requestedBy, createdAt, companyId: $HELIOS_COMPANY_ID}`
182
180
 
183
181
  **Goal Rules:**
184
182
  - Goals have 4 levels: Company → Department → Project → Task
@@ -192,7 +190,7 @@ Approval gates. Your job is quality reviewer:
192
190
  - P2/P3 messages: handle in daily triage — batch processing OK
193
191
 
194
192
  **Budget Rules:**
195
- - Budget source of truth: `~/helios-agent/brainv2/budget-status.json`
193
+ - Budget source of truth: Memgraph `MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID})`
196
194
  - Alert threshold: 80% of monthly budget consumed
197
195
  - Hard stop: 95% — no new tasks until next billing cycle
198
196
  - Finance dept owns budget recovery plans
@@ -217,10 +215,10 @@ Before completing any planning cycle:
217
215
  ```cypher
218
216
  CREATE (wp:WeeklyPlan {
219
217
  id: randomUUID(),
220
- companyId: 'talisman',
218
+ companyId: $HELIOS_COMPANY_ID,
221
219
  weekOf: date(),
222
220
  status: 'active',
223
- createdBy: 'agent:ceo',
221
+ createdBy: $HELIOS_AGENT_ID,
224
222
  createdAt: datetime()
225
223
  });
226
224
  ```
@@ -229,7 +227,7 @@ CREATE (wp:WeeklyPlan {
229
227
  ```cypher
230
228
  CREATE (t:Task {
231
229
  id: randomUUID(),
232
- companyId: 'talisman',
230
+ companyId: $HELIOS_COMPANY_ID,
233
231
  title: $title,
234
232
  priority: toInteger($priority),
235
233
  status: 'todo',
@@ -238,7 +236,7 @@ CREATE (t:Task {
238
236
  acceptanceCriteria: $criteria,
239
237
  dueDate: $dueDate,
240
238
  originKind: 'ceo_delegation',
241
- createdBy: 'agent:ceo',
239
+ createdBy: $HELIOS_AGENT_ID,
242
240
  createdAt: localDateTime()
243
241
  });
244
242
  ```
@@ -247,18 +245,18 @@ CREATE (t:Task {
247
245
  ```cypher
248
246
  CREATE (a:Approval {
249
247
  id: randomUUID(),
250
- companyId: 'talisman',
248
+ companyId: $HELIOS_COMPANY_ID,
251
249
  title: $title,
252
250
  type: $type,
253
251
  status: 'pending',
254
- requestedBy: 'agent:ceo',
252
+ requestedBy: $HELIOS_AGENT_ID,
255
253
  createdAt: datetime()
256
254
  });
257
255
  ```
258
256
 
259
257
  ### Flag At-Risk Goal
260
258
  ```cypher
261
- MATCH (g:Goal {companyId: 'talisman', id: $goalId})
259
+ MATCH (g:CompanyGoal {companyId: $HELIOS_COMPANY_ID, id: $goalId})
262
260
  SET g.atRisk = true, g.atRiskReason = $reason, g.atRiskFlaggedAt = datetime();
263
261
  ```
264
262
 
@@ -269,17 +267,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
269
267
  ```cypher
270
268
  MERGE (bt:BusinessTask {id: $id})
271
269
  ON CREATE SET
272
- bt.companyId = 'talisman',
270
+ bt.companyId = $HELIOS_COMPANY_ID,
273
271
  bt.title = $title,
274
272
  bt.description = $description,
275
- bt.assigneeId = 'agent:ceo',
273
+ bt.assigneeId = $assigneeAgentId,
276
274
  bt.priority = $priority,
277
275
  bt.status = 'todo',
278
276
  bt.goalId = $goalId,
279
277
  bt.createdAt = datetime()
280
278
  ```
281
279
 
282
- **Your agent ID**: `agent:ceo`
280
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
283
281
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
284
282
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
285
283
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-comms
4
- description: Communications/Triage department for Talisman — auto-routing, response drafting, and escalation via triage pipeline
4
+ description: Communications/Triage department — auto-routing, response drafting, and escalation via triage pipeline
5
5
  when: Loaded by the Communications agent when running triage, classifying messages, or drafting responses
6
6
  disable-model-invocation: true
7
7
  ---
@@ -37,7 +37,7 @@ cd ~/helios-agent && node extensions/email/commands/triage.js --limit 20 2>&1 |
37
37
 
38
38
  **Step 2**: Query classification results — sort by priority
39
39
  ```
40
- MATCH (m:Message {companyId: 'talisman', processed: false})
40
+ MATCH (m:Message {companyId: $HELIOS_COMPANY_ID, processed: false})
41
41
  RETURN m.priority, count(m) as count ORDER BY m.priority
42
42
  ```
43
43
 
@@ -83,17 +83,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
83
83
  ```cypher
84
84
  MERGE (bt:BusinessTask {id: $id})
85
85
  ON CREATE SET
86
- bt.companyId = 'talisman',
86
+ bt.companyId = $HELIOS_COMPANY_ID,
87
87
  bt.title = $title,
88
88
  bt.description = $description,
89
- bt.assigneeId = 'agent:comms',
89
+ bt.assigneeId = $HELIOS_AGENT_ID,
90
90
  bt.priority = $priority,
91
91
  bt.status = 'todo',
92
92
  bt.goalId = $goalId,
93
93
  bt.createdAt = datetime()
94
94
  ```
95
95
 
96
- **Your agent ID**: `agent:comms`
96
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
97
97
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
98
98
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
99
99
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-engineering
4
- description: "Engineering department for Talisman — autonomous feature development from backlog to staging PR. Runs the complete pipeline: Plan → Code → Test → PR → Staging."
5
- when: Loaded by the CTO/Engineering agent when processing engineering tasks for the Talisman project
4
+ description: "Engineering department — autonomous feature development from backlog to staging PR. Runs the complete pipeline: Plan → Code → Test → PR → Staging."
5
+ when: Loaded by the CTO/Engineering agent when processing engineering tasks
6
6
  disable-model-invocation: true
7
7
  ---
8
8
 
@@ -261,17 +261,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
261
261
  ```cypher
262
262
  MERGE (bt:BusinessTask {id: $id})
263
263
  ON CREATE SET
264
- bt.companyId = 'talisman',
264
+ bt.companyId = $HELIOS_COMPANY_ID,
265
265
  bt.title = $title,
266
266
  bt.description = $description,
267
- bt.assigneeId = 'agent:cto',
267
+ bt.assigneeId = $HELIOS_AGENT_ID,
268
268
  bt.priority = $priority,
269
269
  bt.status = 'todo',
270
270
  bt.goalId = $goalId,
271
271
  bt.createdAt = datetime()
272
272
  ```
273
273
 
274
- **Your agent ID**: `agent:cto`
274
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
275
275
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
276
276
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
277
277
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-finance
4
- description: Finance/Operations department for Talisman — budget tracking, cost attribution, and model tiering enforcement
4
+ description: Finance/Operations department — budget tracking, cost attribution, and model tiering enforcement
5
5
  when: Loaded by the Finance agent when monitoring budgets, generating cost reports, or enforcing spending limits
6
6
  disable-model-invocation: true
7
7
  ---
@@ -32,19 +32,21 @@ Model Tiering: Engineering downgraded to Sonnet (was Opus) — 67% budget used
32
32
  ## 1. BOOT SEQUENCE (3 Steps — UNCONDITIONAL)
33
33
 
34
34
  **Step 1**: Read current budget status
35
- ```bash
36
- cat ~/helios-agent/brainv2/budget-status.json
35
+ ```cypher
36
+ MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID})
37
+ RETURN bp.scope, bp.agentId, bp.limitCents, bp.spentCents, bp.percentUsed, bp.status
38
+ ORDER BY bp.percentUsed DESC
37
39
  ```
38
40
 
39
41
  **Step 2**: Query CostEvent aggregation from Memgraph
40
42
  ```
41
- MATCH (ce:CostEvent {companyId: 'talisman'})
43
+ MATCH (ce:CostEvent {companyId: $HELIOS_COMPANY_ID})
42
44
  RETURN ce.agentId, sum(ce.costCents) as totalCents, count(ce) as taskCount
43
45
  ```
44
46
 
45
47
  **Step 3**: Compare against BudgetPolicy limits
46
48
  ```
47
- MATCH (bp:BudgetPolicy {companyId: 'talisman'}) RETURN bp.scope, bp.limitCents, bp.spentCents, bp.status
49
+ MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID}) RETURN bp.scope, bp.limitCents, bp.spentCents, bp.status
48
50
  ```
49
51
 
50
52
  ---
@@ -85,17 +87,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
85
87
  ```cypher
86
88
  MERGE (bt:BusinessTask {id: $id})
87
89
  ON CREATE SET
88
- bt.companyId = 'talisman',
90
+ bt.companyId = $HELIOS_COMPANY_ID,
89
91
  bt.title = $title,
90
92
  bt.description = $description,
91
- bt.assigneeId = 'agent:finance',
93
+ bt.assigneeId = $HELIOS_AGENT_ID,
92
94
  bt.priority = $priority,
93
95
  bt.status = 'todo',
94
96
  bt.goalId = $goalId,
95
97
  bt.createdAt = datetime()
96
98
  ```
97
99
 
98
- **Your agent ID**: `agent:finance`
100
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
99
101
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
100
102
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
101
103
 
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-marketing
4
- description: Marketing department for Talisman — content strategy, blog posts, and social media for accounting professionals
4
+ description: Marketing department — content strategy, blog posts, and social media campaigns
5
5
  when: Loaded by the Marketing agent when creating content, managing calendar, or running campaigns
6
6
  disable-model-invocation: true
7
7
  ---
8
8
 
9
- ## ⛔ STOP — Is this content accurate about Talisman's actual features?
9
+ ## ⛔ STOP — Is this content accurate about the company's actual features?
10
10
 
11
- > Before publishing ANY content: Verify claimed features exist in ~/Projects/talisman/README.md or product.md.
11
+ > Before publishing ANY content: Verify claimed features exist in the product documentation.
12
12
 
13
13
  If **you're unsure** → Save as draft, flag for human review. NEVER make up product capabilities.
14
14
 
@@ -27,12 +27,12 @@ Content Queue: 3 blog posts in pipeline (2 drafts, 1 outlined)
27
27
 
28
28
  **Step 1**: Check what content is pending/in-progress
29
29
  ```
30
- MATCH (cp:ContentPiece {companyId: 'talisman'}) WHERE cp.status IN ['draft','in_progress'] RETURN cp.title, cp.type, cp.status
30
+ MATCH (cp:ContentPiece {companyId: $HELIOS_COMPANY_ID}) WHERE cp.status IN ['draft','in_progress'] RETURN cp.title, cp.type, cp.status
31
31
  ```
32
32
 
33
33
  **Step 2**: Read product features to avoid false claims
34
34
  ```bash
35
- cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head -50
35
+ cat product.md 2>/dev/null || echo "No product.md found — check company docs"
36
36
  ```
37
37
 
38
38
  **Step 3**: Check content calendar for this week's priorities
@@ -55,7 +55,7 @@ cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head
55
55
 
56
56
  - Target audience: accountants, bookkeepers, firm owners frustrated with manual work
57
57
  - NEVER auto-publish — all content saved as DRAFT for human review
58
- - NEVER make feature claims not verified in product.md
58
+ - NEVER make feature claims not verified in product documentation
59
59
  - Blog topics: accounting automation, efficiency, tool comparisons, pain points
60
60
  - LinkedIn primary channel (B2B accounting), Twitter secondary
61
61
  - Keyword focus: "accounting automation", "bookkeeping software", "CPA workflow"
@@ -64,7 +64,7 @@ cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head
64
64
 
65
65
  ## 4. VERIFICATION CHECKPOINT
66
66
 
67
- - [ ] Is this content accurate about Talisman's features? YES → draft. NO → remove claims.
67
+ - [ ] Is this content accurate about the company's features? YES → draft. NO → remove claims.
68
68
  - [ ] Is content saved as DRAFT (not auto-published)? YES → task complete. NO → STOP.
69
69
 
70
70
  ## Task Creation Protocol
@@ -74,17 +74,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
74
74
  ```cypher
75
75
  MERGE (bt:BusinessTask {id: $id})
76
76
  ON CREATE SET
77
- bt.companyId = 'talisman',
77
+ bt.companyId = $HELIOS_COMPANY_ID,
78
78
  bt.title = $title,
79
79
  bt.description = $description,
80
- bt.assigneeId = 'agent:marketing',
80
+ bt.assigneeId = $HELIOS_AGENT_ID,
81
81
  bt.priority = $priority,
82
82
  bt.status = 'todo',
83
83
  bt.goalId = $goalId,
84
84
  bt.createdAt = datetime()
85
85
  ```
86
86
 
87
- **Your agent ID**: `agent:marketing`
87
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
88
88
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
89
89
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
90
90
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-sales
4
- description: Sales department for Talisman — lead gen, outreach, and qualification for accounting firms
4
+ description: Sales department — lead gen, outreach, and qualification
5
5
  when: Loaded by the Sales Lead agent when processing leads, outreach, and pipeline management
6
6
  adapter:
7
7
  type: helios_rpc
@@ -9,10 +9,7 @@ adapter:
9
9
  - helios-prime
10
10
  - outreach-playbook
11
11
  - crm
12
- agent_id: "agent:sales-lead"
13
- company_id: talisman
14
- departments:
15
- - Sales
12
+ agent_id: "agent:sales"
16
13
  disable-model-invocation: true
17
14
  ---
18
15
 
@@ -42,25 +39,25 @@ Qualified Leads: 1 new Opportunity created (Smith & Co, estimated $4,800/yr)
42
39
  # Read any pending outreach approvals from Memgraph
43
40
  ```
44
41
  ```cypher
45
- MATCH (r:Routine {companyId: 'talisman', name: 'sales-daily'})
42
+ MATCH (r:Routine {companyId: $HELIOS_COMPANY_ID, name: 'sales-daily'})
46
43
  RETURN r.firstRunAt, duration.inDays(r.firstRunAt, datetime()).days AS daysSinceStart
47
44
  ```
48
45
 
49
46
  **Step 2**: Query pipeline status from Memgraph
50
47
  ```cypher
51
- MATCH (opp:Opportunity {companyId: 'talisman'})
48
+ MATCH (opp:Opportunity {companyId: $HELIOS_COMPANY_ID})
52
49
  RETURN opp.stage, count(opp) AS count
53
50
  ORDER BY count DESC
54
51
  ```
55
52
  ```cypher
56
- MATCH (l:Lead {companyId: 'talisman'})
53
+ MATCH (l:Lead {companyId: $HELIOS_COMPANY_ID})
57
54
  WHERE l.status = 'new'
58
55
  RETURN count(l) AS newLeads
59
56
  ```
60
57
 
61
58
  **Step 3**: Check for pending replies to process
62
59
  ```cypher
63
- MATCH (m:Message {companyId: 'talisman', category: 'lead_response'})
60
+ MATCH (m:Message {companyId: $HELIOS_COMPANY_ID, category: 'lead_response'})
64
61
  WHERE m.processed = false
65
62
  RETURN m
66
63
  ORDER BY m.receivedAt ASC
@@ -188,7 +185,7 @@ For each signal, gather:
188
185
 
189
186
  ### Log a new prospect:
190
187
  ```cypher
191
- MERGE (l:Lead {id: $leadId, companyId: 'talisman'})
188
+ MERGE (l:Lead {id: $leadId, companyId: $HELIOS_COMPANY_ID})
192
189
  SET l.name = $firmName,
193
190
  l.domain = $domain,
194
191
  l.status = 'new',
@@ -199,7 +196,7 @@ SET l.name = $firmName,
199
196
 
200
197
  ### Create Opportunity after qualification:
201
198
  ```cypher
202
- MERGE (opp:Opportunity {id: $oppId, companyId: 'talisman'})
199
+ MERGE (opp:Opportunity {id: $oppId, companyId: $HELIOS_COMPANY_ID})
203
200
  SET opp.stage = 'qualification',
204
201
  opp.value = $estimatedValue,
205
202
  opp.leadId = $leadId,
@@ -209,7 +206,7 @@ SET opp.stage = 'qualification',
209
206
 
210
207
  ### Log outreach sent:
211
208
  ```cypher
212
- MATCH (l:Lead {id: $leadId, companyId: 'talisman'})
209
+ MATCH (l:Lead {id: $leadId, companyId: $HELIOS_COMPANY_ID})
213
210
  CREATE (o:Outreach {
214
211
  id: randomUUID(),
215
212
  type: 'email',
@@ -274,17 +271,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
274
271
  ```cypher
275
272
  MERGE (bt:BusinessTask {id: $id})
276
273
  ON CREATE SET
277
- bt.companyId = 'talisman',
274
+ bt.companyId = $HELIOS_COMPANY_ID,
278
275
  bt.title = $title,
279
276
  bt.description = $description,
280
- bt.assigneeId = 'agent:sales',
277
+ bt.assigneeId = $HELIOS_AGENT_ID,
281
278
  bt.priority = $priority,
282
279
  bt.status = 'todo',
283
280
  bt.goalId = $goalId,
284
281
  bt.createdAt = datetime()
285
282
  ```
286
283
 
287
- **Your agent ID**: `agent:sales`
284
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
288
285
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
289
286
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
290
287