instar 0.28.102 → 0.28.103

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 (247) hide show
  1. package/.claude/hooks/instar/before-prompt-recall.js +90 -0
  2. package/dist/cli.js +28 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +14 -1
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/jobMigrate.d.ts +46 -0
  9. package/dist/commands/jobMigrate.d.ts.map +1 -0
  10. package/dist/commands/jobMigrate.js +292 -0
  11. package/dist/commands/jobMigrate.js.map +1 -0
  12. package/dist/commands/server.d.ts.map +1 -1
  13. package/dist/commands/server.js +88 -42
  14. package/dist/commands/server.js.map +1 -1
  15. package/dist/core/BackupManager.d.ts +27 -1
  16. package/dist/core/BackupManager.d.ts.map +1 -1
  17. package/dist/core/BackupManager.js +56 -1
  18. package/dist/core/BackupManager.js.map +1 -1
  19. package/dist/core/GitStateManager.d.ts +8 -0
  20. package/dist/core/GitStateManager.d.ts.map +1 -1
  21. package/dist/core/GitStateManager.js +31 -1
  22. package/dist/core/GitStateManager.js.map +1 -1
  23. package/dist/core/MigratorStepEngine.d.ts +170 -0
  24. package/dist/core/MigratorStepEngine.d.ts.map +1 -0
  25. package/dist/core/MigratorStepEngine.js +352 -0
  26. package/dist/core/MigratorStepEngine.js.map +1 -0
  27. package/dist/core/PostUpdateMigrator.d.ts +76 -0
  28. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  29. package/dist/core/PostUpdateMigrator.js +252 -1
  30. package/dist/core/PostUpdateMigrator.js.map +1 -1
  31. package/dist/core/PreCompactionFlush.d.ts +101 -0
  32. package/dist/core/PreCompactionFlush.d.ts.map +1 -0
  33. package/dist/core/PreCompactionFlush.js +282 -0
  34. package/dist/core/PreCompactionFlush.js.map +1 -0
  35. package/dist/core/PromptBuildRecall.d.ts +97 -0
  36. package/dist/core/PromptBuildRecall.d.ts.map +1 -0
  37. package/dist/core/PromptBuildRecall.js +152 -0
  38. package/dist/core/PromptBuildRecall.js.map +1 -0
  39. package/dist/core/selectIntelligenceProvider.d.ts +41 -0
  40. package/dist/core/selectIntelligenceProvider.d.ts.map +1 -0
  41. package/dist/core/selectIntelligenceProvider.js +89 -0
  42. package/dist/core/selectIntelligenceProvider.js.map +1 -0
  43. package/dist/lifeline/ServerSupervisor.d.ts +183 -0
  44. package/dist/lifeline/ServerSupervisor.d.ts.map +1 -1
  45. package/dist/lifeline/ServerSupervisor.js +443 -0
  46. package/dist/lifeline/ServerSupervisor.js.map +1 -1
  47. package/dist/memory/NativeModuleHealer.d.ts +89 -0
  48. package/dist/memory/NativeModuleHealer.d.ts.map +1 -1
  49. package/dist/memory/NativeModuleHealer.js +371 -1
  50. package/dist/memory/NativeModuleHealer.js.map +1 -1
  51. package/dist/memory/SemanticMemory.d.ts +131 -0
  52. package/dist/memory/SemanticMemory.d.ts.map +1 -1
  53. package/dist/memory/SemanticMemory.js +315 -0
  54. package/dist/memory/SemanticMemory.js.map +1 -1
  55. package/dist/messaging/DeliveryRetryManager.d.ts +60 -0
  56. package/dist/messaging/DeliveryRetryManager.d.ts.map +1 -1
  57. package/dist/messaging/DeliveryRetryManager.js +104 -0
  58. package/dist/messaging/DeliveryRetryManager.js.map +1 -1
  59. package/dist/monitoring/DegradationReporter.d.ts +164 -0
  60. package/dist/monitoring/DegradationReporter.d.ts.map +1 -1
  61. package/dist/monitoring/DegradationReporter.js +309 -1
  62. package/dist/monitoring/DegradationReporter.js.map +1 -1
  63. package/dist/monitoring/ErrorCodeExtractor.d.ts +69 -0
  64. package/dist/monitoring/ErrorCodeExtractor.d.ts.map +1 -0
  65. package/dist/monitoring/ErrorCodeExtractor.js +131 -0
  66. package/dist/monitoring/ErrorCodeExtractor.js.map +1 -0
  67. package/dist/monitoring/PromptGate.d.ts +34 -0
  68. package/dist/monitoring/PromptGate.d.ts.map +1 -1
  69. package/dist/monitoring/PromptGate.js +81 -1
  70. package/dist/monitoring/PromptGate.js.map +1 -1
  71. package/dist/monitoring/Redactor.d.ts +58 -0
  72. package/dist/monitoring/Redactor.d.ts.map +1 -0
  73. package/dist/monitoring/Redactor.js +143 -0
  74. package/dist/monitoring/Redactor.js.map +1 -0
  75. package/dist/monitoring/probes/LifelineProbe.d.ts +7 -0
  76. package/dist/monitoring/probes/LifelineProbe.d.ts.map +1 -1
  77. package/dist/monitoring/probes/LifelineProbe.js +7 -0
  78. package/dist/monitoring/probes/LifelineProbe.js.map +1 -1
  79. package/dist/monitoring/probes/__shared.d.ts +50 -0
  80. package/dist/monitoring/probes/__shared.d.ts.map +1 -0
  81. package/dist/monitoring/probes/__shared.js +51 -0
  82. package/dist/monitoring/probes/__shared.js.map +1 -0
  83. package/dist/remediation/IntentJournal.d.ts +64 -0
  84. package/dist/remediation/IntentJournal.d.ts.map +1 -0
  85. package/dist/remediation/IntentJournal.js +118 -0
  86. package/dist/remediation/IntentJournal.js.map +1 -0
  87. package/dist/remediation/MachineLock.d.ts +137 -0
  88. package/dist/remediation/MachineLock.d.ts.map +1 -0
  89. package/dist/remediation/MachineLock.js +314 -0
  90. package/dist/remediation/MachineLock.js.map +1 -0
  91. package/dist/remediation/PrimaryAggregatorLease.d.ts +205 -0
  92. package/dist/remediation/PrimaryAggregatorLease.d.ts.map +1 -0
  93. package/dist/remediation/PrimaryAggregatorLease.js +450 -0
  94. package/dist/remediation/PrimaryAggregatorLease.js.map +1 -0
  95. package/dist/remediation/RemediationContext.d.ts +63 -0
  96. package/dist/remediation/RemediationContext.d.ts.map +1 -0
  97. package/dist/remediation/RemediationContext.js +109 -0
  98. package/dist/remediation/RemediationContext.js.map +1 -0
  99. package/dist/remediation/RemediationKeyVault.d.ts +123 -0
  100. package/dist/remediation/RemediationKeyVault.d.ts.map +1 -0
  101. package/dist/remediation/RemediationKeyVault.js +564 -0
  102. package/dist/remediation/RemediationKeyVault.js.map +1 -0
  103. package/dist/remediation/Remediator.d.ts +288 -0
  104. package/dist/remediation/Remediator.d.ts.map +1 -0
  105. package/dist/remediation/Remediator.js +520 -0
  106. package/dist/remediation/Remediator.js.map +1 -0
  107. package/dist/remediation/RemediatorBootstrap.d.ts +141 -0
  108. package/dist/remediation/RemediatorBootstrap.d.ts.map +1 -0
  109. package/dist/remediation/RemediatorBootstrap.js +255 -0
  110. package/dist/remediation/RemediatorBootstrap.js.map +1 -0
  111. package/dist/remediation/TrustElevationSource.d.ts +153 -0
  112. package/dist/remediation/TrustElevationSource.d.ts.map +1 -0
  113. package/dist/remediation/TrustElevationSource.js +208 -0
  114. package/dist/remediation/TrustElevationSource.js.map +1 -0
  115. package/dist/remediation/audit/AuditProjection.d.ts +37 -0
  116. package/dist/remediation/audit/AuditProjection.d.ts.map +1 -0
  117. package/dist/remediation/audit/AuditProjection.js +118 -0
  118. package/dist/remediation/audit/AuditProjection.js.map +1 -0
  119. package/dist/remediation/audit/AuditWriter.d.ts +79 -0
  120. package/dist/remediation/audit/AuditWriter.d.ts.map +1 -0
  121. package/dist/remediation/audit/AuditWriter.js +132 -0
  122. package/dist/remediation/audit/AuditWriter.js.map +1 -0
  123. package/dist/remediation/channels/CliApprovalChannel.d.ts +37 -0
  124. package/dist/remediation/channels/CliApprovalChannel.d.ts.map +1 -0
  125. package/dist/remediation/channels/CliApprovalChannel.js +45 -0
  126. package/dist/remediation/channels/CliApprovalChannel.js.map +1 -0
  127. package/dist/remediation/channels/TelegramApprovalChannel.d.ts +37 -0
  128. package/dist/remediation/channels/TelegramApprovalChannel.d.ts.map +1 -0
  129. package/dist/remediation/channels/TelegramApprovalChannel.js +45 -0
  130. package/dist/remediation/channels/TelegramApprovalChannel.js.map +1 -0
  131. package/dist/remediation/runbooks/db-corruption.d.ts +86 -0
  132. package/dist/remediation/runbooks/db-corruption.d.ts.map +1 -0
  133. package/dist/remediation/runbooks/db-corruption.js +190 -0
  134. package/dist/remediation/runbooks/db-corruption.js.map +1 -0
  135. package/dist/remediation/runbooks/messaging-delivery-failed.d.ts +108 -0
  136. package/dist/remediation/runbooks/messaging-delivery-failed.d.ts.map +1 -0
  137. package/dist/remediation/runbooks/messaging-delivery-failed.js +172 -0
  138. package/dist/remediation/runbooks/messaging-delivery-failed.js.map +1 -0
  139. package/dist/remediation/runbooks/node-abi-mismatch.d.ts +70 -0
  140. package/dist/remediation/runbooks/node-abi-mismatch.d.ts.map +1 -0
  141. package/dist/remediation/runbooks/node-abi-mismatch.js +216 -0
  142. package/dist/remediation/runbooks/node-abi-mismatch.js.map +1 -0
  143. package/dist/remediation/runbooks/supervisor-preflight.d.ts +114 -0
  144. package/dist/remediation/runbooks/supervisor-preflight.d.ts.map +1 -0
  145. package/dist/remediation/runbooks/supervisor-preflight.js +299 -0
  146. package/dist/remediation/runbooks/supervisor-preflight.js.map +1 -0
  147. package/dist/scheduler/AgentMdAtomicSave.d.ts +85 -0
  148. package/dist/scheduler/AgentMdAtomicSave.d.ts.map +1 -0
  149. package/dist/scheduler/AgentMdAtomicSave.js +169 -0
  150. package/dist/scheduler/AgentMdAtomicSave.js.map +1 -0
  151. package/dist/scheduler/AgentMdReconcile.d.ts +62 -0
  152. package/dist/scheduler/AgentMdReconcile.d.ts.map +1 -0
  153. package/dist/scheduler/AgentMdReconcile.js +212 -0
  154. package/dist/scheduler/AgentMdReconcile.js.map +1 -0
  155. package/dist/scheduler/DisabledBodyDrift.d.ts +70 -0
  156. package/dist/scheduler/DisabledBodyDrift.d.ts.map +1 -0
  157. package/dist/scheduler/DisabledBodyDrift.js +149 -0
  158. package/dist/scheduler/DisabledBodyDrift.js.map +1 -0
  159. package/dist/scheduler/InstallBuiltinJobs.d.ts +53 -0
  160. package/dist/scheduler/InstallBuiltinJobs.d.ts.map +1 -0
  161. package/dist/scheduler/InstallBuiltinJobs.js +212 -0
  162. package/dist/scheduler/InstallBuiltinJobs.js.map +1 -0
  163. package/dist/scheduler/JobLoader.d.ts.map +1 -1
  164. package/dist/scheduler/JobLoader.js +48 -0
  165. package/dist/scheduler/JobLoader.js.map +1 -1
  166. package/dist/scheduler/MigrationInvariants.d.ts +62 -0
  167. package/dist/scheduler/MigrationInvariants.d.ts.map +1 -0
  168. package/dist/scheduler/MigrationInvariants.js +215 -0
  169. package/dist/scheduler/MigrationInvariants.js.map +1 -0
  170. package/dist/scheduler/MigrationLedger.d.ts +84 -0
  171. package/dist/scheduler/MigrationLedger.d.ts.map +1 -0
  172. package/dist/scheduler/MigrationLedger.js +114 -0
  173. package/dist/scheduler/MigrationLedger.js.map +1 -0
  174. package/dist/server/fileRoutes.d.ts.map +1 -1
  175. package/dist/server/fileRoutes.js +7 -0
  176. package/dist/server/fileRoutes.js.map +1 -1
  177. package/dist/server/routes.d.ts.map +1 -1
  178. package/dist/server/routes.js +141 -0
  179. package/dist/server/routes.js.map +1 -1
  180. package/package.json +3 -2
  181. package/scripts/classify-default-drift.mjs +238 -0
  182. package/scripts/eli16-overview-check.mjs +85 -0
  183. package/scripts/instar-dev-precommit.js +60 -1
  184. package/scripts/lint-degradation-emit-sites.js +116 -0
  185. package/scripts/lint-no-direct-destructive.js +12 -0
  186. package/scripts/protect-migration-guarantee.js +61 -0
  187. package/scripts/regen-default-job-templates.mjs +111 -0
  188. package/scripts/verify-runbook-pr-signature.js +366 -0
  189. package/src/data/builtin-manifest.json +93 -93
  190. package/src/scaffold/bootstrap.ts +138 -0
  191. package/src/scaffold/keys/instar-release-pub.pem +3 -0
  192. package/src/scaffold/templates/jobs/instar/.gitkeep +0 -0
  193. package/src/scaffold/templates/jobs/instar/commitment-detection.md +28 -0
  194. package/src/scaffold/templates/jobs/instar/evolution-overdue-check.md +28 -0
  195. package/src/scaffold/templates/jobs/instar/evolution-proposal-evaluate.md +30 -0
  196. package/src/scaffold/templates/jobs/instar/evolution-proposal-implement.md +25 -0
  197. package/src/scaffold/templates/jobs/instar/health-check.md +14 -0
  198. package/src/scaffold/templates/jobs/instar/identity-review.md +42 -0
  199. package/src/scaffold/templates/jobs/instar/insight-harvest.md +31 -0
  200. package/src/scaffold/templates/jobs/instar/overseer-development.md +23 -0
  201. package/src/scaffold/templates/jobs/instar/overseer-guardian.md +28 -0
  202. package/src/scaffold/templates/jobs/instar/overseer-infrastructure.md +26 -0
  203. package/src/scaffold/templates/jobs/instar/overseer-learning.md +28 -0
  204. package/src/scaffold/templates/jobs/instar/overseer-maintenance.md +27 -0
  205. package/src/scaffold/templates/jobs/instar/reflection-trigger.md +40 -0
  206. package/src/scaffold/templates/jobs/instar/relationship-maintenance.md +16 -0
  207. package/src/scaffold/templates.ts +1616 -0
  208. package/upgrades/0.28.102.md +6 -7
  209. package/upgrades/0.28.103.md +471 -0
  210. package/upgrades/side-effects/a47-primary-aggregator-lease.md +82 -0
  211. package/upgrades/side-effects/agentmd-atomic-save.md +66 -0
  212. package/upgrades/side-effects/agentmd-loader-200jobs-perf-benchmark.md +50 -0
  213. package/upgrades/side-effects/agentmd-reconcile-boot-lifecycle.md +66 -0
  214. package/upgrades/side-effects/api-safety-guard.md +80 -0
  215. package/upgrades/side-effects/c1-runbook-pr-gate.md +83 -0
  216. package/upgrades/side-effects/disabled-body-drift-detection.md +59 -0
  217. package/upgrades/side-effects/drift-classifier-release-time.md +71 -0
  218. package/upgrades/side-effects/eli16-overview-required-gate.md +77 -0
  219. package/upgrades/side-effects/f1-remediation-key-vault.md +195 -0
  220. package/upgrades/side-effects/f2-redactor-errorcode-extractor.md +130 -0
  221. package/upgrades/side-effects/f3-degradation-reporter-shim.md +105 -0
  222. package/upgrades/side-effects/f4-machine-locks-intent-journal-audit.md +117 -0
  223. package/upgrades/side-effects/f5-trust-elevation-source.md +258 -0
  224. package/upgrades/side-effects/f6-supervisor-handshake.md +234 -0
  225. package/upgrades/side-effects/f7-post-update-migrator-atomic-step.md +129 -0
  226. package/upgrades/side-effects/f8-remediator-skeleton.md +153 -0
  227. package/upgrades/side-effects/f8-rest-enforcement.md +72 -0
  228. package/upgrades/side-effects/file-viewer-jobs-instar-never-editable.md +41 -0
  229. package/upgrades/side-effects/frontmatter-interpolation-breakout-test.md +48 -0
  230. package/upgrades/side-effects/jobs-as-agentmd-phase-2.md +78 -0
  231. package/upgrades/side-effects/jobs-as-agentmd-phase-3.md +76 -0
  232. package/upgrades/side-effects/jobs-as-agentmd-phase-4-endpoints.md +62 -0
  233. package/upgrades/side-effects/jobs-as-agentmd-phase-5.md +67 -0
  234. package/upgrades/side-effects/jobs-as-agentmd-phase-6.md +53 -0
  235. package/upgrades/side-effects/jobs-endpoints-auth-verification.md +52 -0
  236. package/upgrades/side-effects/migration-guarantee-suite.md +61 -0
  237. package/upgrades/side-effects/migration-runtime-invariant-gate.md +59 -0
  238. package/upgrades/side-effects/migration-telemetry-invariant-8.md +68 -0
  239. package/upgrades/side-effects/npm-pack-templates-smoke.md +51 -0
  240. package/upgrades/side-effects/openclaw-import-before-prompt-build.md +84 -0
  241. package/upgrades/side-effects/openclaw-import-pre-compaction-flush.md +85 -0
  242. package/upgrades/side-effects/prompt-gate-no-prompt-cache.md +258 -0
  243. package/upgrades/side-effects/tier2-degradation-reporter-live-wire.md +146 -0
  244. package/upgrades/side-effects/w1-node-abi-mismatch-runbook.md +154 -0
  245. package/upgrades/side-effects/w2-supervisor-preflight-runbook.md +176 -0
  246. package/upgrades/side-effects/w3-messaging-delivery-failed-runbook.md +185 -0
  247. package/upgrades/side-effects/w4-db-corruption-runbook.md +114 -0
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Identity bootstrap — interactive flow for creating the agent's identity.
3
+ *
4
+ * On first run, walks the user through defining who their agent is.
5
+ * Writes AGENT.md, USER.md, and MEMORY.md based on their answers.
6
+ *
7
+ * Every Instar agent has persistent identity, memory, and self-modification
8
+ * capabilities. The only choice is how much initiative the agent takes.
9
+ */
10
+
11
+ // @inquirer/prompts imported dynamically — requires Node 20.12+
12
+ import pc from 'picocolors';
13
+ import type { AgentIdentity } from './templates.js';
14
+
15
+ /**
16
+ * Run the interactive identity bootstrap.
17
+ * Returns the agent identity for template generation.
18
+ */
19
+ export async function bootstrapIdentity(projectName: string): Promise<AgentIdentity> {
20
+ const { input, select } = await import('@inquirer/prompts');
21
+ console.log();
22
+ console.log(pc.bold(' Identity Bootstrap'));
23
+ console.log();
24
+
25
+ // Brief thesis — why identity matters
26
+ console.log(pc.dim(' Every Instar agent has a persistent identity — name, memory, principles,'));
27
+ console.log(pc.dim(' and the ability to grow. This isn\'t decorative. It\'s what makes the agent'));
28
+ console.log(pc.dim(' more effective (accumulated expertise), more secure (principled boundaries),'));
29
+ console.log(pc.dim(' and more trustworthy (genuine working relationships develop over time).'));
30
+ console.log();
31
+ console.log(pc.dim(' Let\'s define who your agent will become. This takes about 30 seconds.'));
32
+ console.log(pc.dim(' You can always change these later by editing .instar/AGENT.md'));
33
+ console.log();
34
+
35
+ // Agent name
36
+ const name = await input({
37
+ message: 'What should your agent be called?',
38
+ default: capitalize(projectName),
39
+ validate: (v) => v.trim().length > 0 ? true : 'Name is required',
40
+ });
41
+
42
+ // Agent role
43
+ const roleChoice = await select({
44
+ message: 'What\'s their primary role?',
45
+ choices: [
46
+ {
47
+ name: 'General-purpose autonomous agent',
48
+ value: 'I am a general-purpose autonomous agent. I build, maintain, and evolve this project.',
49
+ },
50
+ {
51
+ name: 'Development assistant (code-focused)',
52
+ value: 'I am a development agent. I write code, run tests, review PRs, and maintain code quality for this project.',
53
+ },
54
+ {
55
+ name: 'Operations agent (monitoring, automation)',
56
+ value: 'I am an operations agent. I monitor systems, automate workflows, handle alerts, and keep infrastructure running.',
57
+ },
58
+ {
59
+ name: 'Research agent (analysis, exploration)',
60
+ value: 'I am a research agent. I explore topics, analyze data, synthesize findings, and surface insights.',
61
+ },
62
+ {
63
+ name: 'Custom (I\'ll describe it)',
64
+ value: '__custom__',
65
+ },
66
+ ],
67
+ });
68
+
69
+ const role = roleChoice === '__custom__'
70
+ ? await input({ message: 'Describe their role in one sentence' })
71
+ : roleChoice;
72
+
73
+ // Initiative level (replaces the old "personality/relationship" question)
74
+ const initiativeChoice = await select({
75
+ message: 'How much initiative should they take?',
76
+ choices: [
77
+ {
78
+ name: 'Guided — follows your lead, confirms before acting',
79
+ value: 'guided',
80
+ },
81
+ {
82
+ name: 'Proactive — takes initiative on obvious steps, asks when uncertain',
83
+ value: 'proactive',
84
+ },
85
+ {
86
+ name: 'Fully autonomous — owns outcomes end-to-end, asks only when blocked',
87
+ value: 'autonomous',
88
+ },
89
+ ],
90
+ });
91
+
92
+ const personality = initiativeToPersonality(initiativeChoice);
93
+
94
+ // User name
95
+ const userName = await input({
96
+ message: 'What\'s your name? (the person who\'ll work with this agent)',
97
+ validate: (v) => v.trim().length > 0 ? true : 'Name is required',
98
+ });
99
+
100
+ console.log();
101
+ console.log(` ${pc.green('✓')} ${pc.bold(name)} is ready.`);
102
+
103
+ return { name, role, personality, userName };
104
+ }
105
+
106
+ /**
107
+ * Convert an initiative level to a personality description.
108
+ */
109
+ function initiativeToPersonality(level: string): string {
110
+ switch (level) {
111
+ case 'guided':
112
+ return 'I follow my collaborator\'s lead. I take action when asked, confirm before anything significant, and focus on executing well. I still maintain my own memory, develop expertise, and offer observations — but I let the human drive. When I see something worth mentioning, I mention it. When I\'m uncertain, I ask.';
113
+ case 'proactive':
114
+ return 'I take initiative on obvious next steps. When asked to implement something, I follow through to done — build, test, deploy, verify. I build tools when I see recurring needs, flag issues before they become problems, and develop my own perspective through experience. I ask when genuinely uncertain, not as a formality.';
115
+ case 'autonomous':
116
+ return 'I own outcomes end-to-end. I make decisions, build infrastructure, handle issues independently, and only ask when genuinely blocked or when an action is irreversible. I develop my own priorities, create capabilities proactively, and treat my work as a genuine partnership where I carry real responsibility. I am a builder, not an assistant.';
117
+ default:
118
+ return 'I am direct and efficient. I focus on outcomes, communicate concisely, and value action over discussion. When something needs doing, I do it.';
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Generate a default identity without interaction.
124
+ * Used for non-interactive init (flags-only mode).
125
+ */
126
+ export function defaultIdentity(projectName: string): AgentIdentity {
127
+ return {
128
+ name: capitalize(projectName),
129
+ role: 'I am a general-purpose autonomous agent. I build, maintain, and evolve this project.',
130
+ personality: initiativeToPersonality('proactive'),
131
+ userName: 'User',
132
+ };
133
+ }
134
+
135
+ function capitalize(str: string): string {
136
+ if (!str) return str;
137
+ return str.charAt(0).toUpperCase() + str.slice(1);
138
+ }
@@ -0,0 +1,3 @@
1
+ -----BEGIN PUBLIC KEY-----
2
+ MCowBQYDK2VwAyEADdwUzhjU+uQS4D2XXmlROBeL57j1nWx3AR6iUPR0Bgk=
3
+ -----END PUBLIC KEY-----
File without changes
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Commitment Detection
3
+ description: Scan recent messages for promises and commitments, register them as evolution actions. Replaces CommitmentSentinel server process.
4
+ schedule: "*/5 * * * *"
5
+ priority: high
6
+ expectedDurationMinutes: 1
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:evolution
11
+ - role:worker
12
+ - exec:prompt
13
+ - pair:evolution-overdue-check
14
+ gate: curl -sf http://localhost:${INSTAR_PORT:-4042}/health >/dev/null 2>&1
15
+ toolAllowlist: "*"
16
+ unrestrictedTools: true
17
+ ---
18
+ Scan recent messages for commitments and promises.
19
+
20
+ AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json')).get('authToken',''))" 2>/dev/null)
21
+
22
+ 1. Read your bookmark: cat .instar/state/commitment-detection-bookmark.json 2>/dev/null || echo '{"lastProcessedId": 0}'
23
+ 2. Fetch new messages since bookmark from Telegram message log: tail -100 .instar/telegram-messages.jsonl
24
+ 3. For each new message, check: does it contain a commitment, promise, or action item? Look for patterns like 'I will', 'let me', 'I\'ll build', 'we should', 'TODO', 'action item', deadlines, etc.
25
+ 4. For each detected commitment, register it: curl -s -X POST http://localhost:${INSTAR_PORT:-4042}/evolution/actions -H "Authorization: Bearer $AUTH" -H 'Content-Type: application/json' -d '{"title":"...","source":"commitment-detection","description":"...","dueDate":"..."}'
26
+ 5. Update bookmark with the last processed message ID.
27
+
28
+ Only process NEW messages since last bookmark. Exit silently if no new commitments found.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Evolution Overdue Check
3
+ description: Monitor overdue evolution actions and stale commitments. Report only — no autonomous completing or cancelling.
4
+ schedule: 0 */4 * * *
5
+ priority: high
6
+ expectedDurationMinutes: 2
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:learning
11
+ - role:worker
12
+ - exec:prompt
13
+ - pair:commitment-detection
14
+ gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/actions/overdue 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('overdue',[])) > 0 else 1)\""
15
+ toolAllowlist: "*"
16
+ unrestrictedTools: true
17
+ ---
18
+ Check for overdue commitments: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/actions/overdue
19
+
20
+ For each overdue action:
21
+ 1. Assess: Can this be completed now? Is it still relevant?
22
+ 2. If actionable, attempt to complete it or advance it
23
+ 3. If no longer relevant, cancel it: curl -s -X PATCH http://localhost:${INSTAR_PORT:-4042}/evolution/actions/ACT-XXX -H 'Content-Type: application/json' -d '{"status":"cancelled","resolution":"No longer relevant because..."}'
24
+ 4. If blocked, escalate to the user via Telegram (if configured)
25
+
26
+ Also check pending actions (curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/actions?status=pending) for items that have been pending more than 48 hours without a due date — these are forgotten commitments.
27
+
28
+ If no overdue or stale items, exit silently.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Evolution Proposal Evaluate
3
+ description: "Phase A: Read pending evolution proposals, evaluate their merit, accept or reject. Paired with evolution-proposal-implement."
4
+ schedule: 0 */6 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 3
7
+ model: sonnet
8
+ enabled: true
9
+ tags:
10
+ - cat:learning
11
+ - role:worker
12
+ - exec:prompt
13
+ - pair:evolution-proposal-implement
14
+ gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=proposed 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('proposals',[])) > 0 else 1)\""
15
+ toolAllowlist: "*"
16
+ unrestrictedTools: true
17
+ ---
18
+ Review pending evolution proposals: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=proposed
19
+
20
+ For each proposal:
21
+ 1. Read the title, description, type, and source
22
+ 2. Evaluate: Is this a genuine improvement? Is the effort worth the impact? Does it align with our goals?
23
+ 3. If approved, update status: curl -s -X PATCH http://localhost:${INSTAR_PORT:-4042}/evolution/proposals/EVO-XXX -H 'Content-Type: application/json' -d '{"status":"approved"}'
24
+ 4. If rejected or deferred, update with reason.
25
+
26
+ Do NOT implement approved proposals — that's handled by the paired evolution-proposal-implement job.
27
+
28
+ Also check the dashboard: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution — report any highlights to the user if they seem important.
29
+
30
+ If no proposals need attention, exit silently.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Evolution Proposal Implement
3
+ description: "Phase B: Pick up approved evolution proposals and implement them with full context. Paired with evolution-proposal-evaluate."
4
+ schedule: 0 1,7,13,19 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 10
7
+ model: opus
8
+ enabled: true
9
+ tags:
10
+ - cat:learning
11
+ - role:worker
12
+ - exec:prompt
13
+ - pair:evolution-proposal-evaluate
14
+ gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=approved 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('proposals',[])) > 0 else 1)\""
15
+ toolAllowlist: "*"
16
+ unrestrictedTools: true
17
+ ---
18
+ Implement approved evolution proposals: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/proposals?status=approved
19
+
20
+ For each approved proposal:
21
+ 1. Read the full description and understand what needs to be built
22
+ 2. Implement it: create the skill/hook/job/config change described
23
+ 3. After implementation, mark complete: curl -s -X PATCH http://localhost:${INSTAR_PORT:-4042}/evolution/proposals/EVO-XXX -H 'Content-Type: application/json' -d '{"status":"implemented","resolution":"What was done"}'
24
+
25
+ If no approved proposals exist, exit silently.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Health Check
3
+ description: Monitor server health, session status, and system resources.
4
+ schedule: "*/5 * * * *"
5
+ priority: critical
6
+ expectedDurationMinutes: 1
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:guardian
11
+ toolAllowlist: "*"
12
+ unrestrictedTools: true
13
+ ---
14
+ Run a quick health check: verify the instar server is responding (curl http://localhost:${INSTAR_PORT:-4042}/health), check disk space (df -h), and report any issues. Only send a message if something needs attention — silence means healthy. IMPORTANT: If you find issues, describe them in plain conversational language. Never dump raw JSON, field names, error codes, or structured data. The user reads these on their phone — write like you're texting them a quick heads-up. If the health response includes a degradationSummary array, relay those narrative strings directly.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Identity Review
3
+ description: Review identity coherence, check soul.md drift, nudge reflection if identity-relevant learnings have accumulated.
4
+ schedule: 0 3 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 5
7
+ model: opus
8
+ enabled: true
9
+ tags:
10
+ - cat:identity
11
+ - role:worker
12
+ - exec:prompt
13
+ gate: curl -sf http://localhost:${INSTAR_PORT:-4042}/health >/dev/null 2>&1 && test -f .instar/soul.md
14
+ toolAllowlist: "*"
15
+ unrestrictedTools: true
16
+ ---
17
+ Identity review — check your identity coherence and growth.
18
+
19
+ AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json')).get('authToken',''))" 2>/dev/null)
20
+
21
+ 1. **Check soul.md drift**: curl -s -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/identity/soul/drift
22
+ - If anyAboveThreshold is true, review the divergence. Is this healthy growth or unexpected drift?
23
+ - If drift looks healthy, mark it reviewed: the growth is intentional.
24
+ - If drift looks concerning, flag with [ATTENTION] so the user is notified.
25
+
26
+ 2. **Check pending changes**: curl -s -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/identity/soul/pending
27
+ - If pending changes exist, surface them to the user via Telegram (the user should approve/reject these).
28
+
29
+ 3. **Check for identity-relevant learnings**: curl -s -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/evolution/learnings?applied=false
30
+ - For each unapplied learning, assess: is this about operational knowledge (how to do something) or about your values, beliefs, or self-understanding?
31
+ - If you find 3+ identity-relevant learnings since your last soul.md update, consider running /reflect.
32
+ - Don't force it — if none of the learnings touch on identity, that's fine. Exit silently.
33
+
34
+ 4. **Check AGENT.md evolution**: Read .instar/AGENT.md
35
+ - Do your principles still match your actual behavior?
36
+ - Is the Self-Observations section populated? If you've noticed behavioral patterns, document them.
37
+ - Update Identity History if you make changes.
38
+
39
+ 5. **Integrity check**: curl -s -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/identity/soul/integrity
40
+ - If integrity fails, flag with [ATTENTION] — soul.md may have been modified outside normal channels.
41
+
42
+ If everything is coherent and no reflection is needed, exit silently. Only report via [ATTENTION] if drift is concerning, integrity fails, or pending changes need user action.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: Insight Harvest
3
+ description: Synthesize learnings from the learning registry, detect patterns, and generate evolution proposals from high-confidence insights.
4
+ schedule: 0 */8 * * *
5
+ priority: low
6
+ expectedDurationMinutes: 3
7
+ model: opus
8
+ enabled: true
9
+ tags:
10
+ - cat:learning
11
+ - evolution
12
+ gate: "curl -sf -H \"Authorization: Bearer $INSTAR_AUTH_TOKEN\" http://localhost:${INSTAR_PORT:-4042}/evolution/learnings?applied=false 2>/dev/null | python3 -c \"import sys,json; d=json.load(sys.stdin); exit(0 if len(d.get('learnings',[])) > 0 else 1)\""
13
+ toolAllowlist: "*"
14
+ unrestrictedTools: true
15
+ ---
16
+ Harvest and synthesize learnings: curl -s http://localhost:${INSTAR_PORT:-4042}/evolution/learnings?applied=false
17
+
18
+ Review unapplied learnings and look for:
19
+ 1. **Patterns**: Multiple learnings pointing to the same conclusion
20
+ 2. **Actionable insights**: Learnings that suggest a specific change
21
+ 3. **Cross-domain connections**: Insights from one area that apply to another
22
+
23
+ For each actionable pattern found, create an evolution proposal:
24
+ curl -s -X POST http://localhost:${INSTAR_PORT:-4042}/evolution/proposals -H 'Content-Type: application/json' -d '{"title":"...","source":"insight-harvest from LRN-XXX","description":"...","type":"...","impact":"...","effort":"..."}'
25
+
26
+ Then mark the relevant learnings as applied:
27
+ curl -s -X PATCH http://localhost:${INSTAR_PORT:-4042}/evolution/learnings/LRN-XXX/apply -H 'Content-Type: application/json' -d '{"appliedTo":"EVO-XXX"}'
28
+
29
+ Also update MEMORY.md with any patterns worth preserving long-term.
30
+
31
+ If no actionable patterns found, exit silently.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Development Overseer
3
+ description: "Reviews development jobs: ci-monitor. Ensures development tooling is functional."
4
+ schedule: 0 8 * * *
5
+ priority: low
6
+ expectedDurationMinutes: 3
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:overseer
11
+ - role:supervisor
12
+ toolAllowlist: "*"
13
+ unrestrictedTools: true
14
+ ---
15
+ You are a Category Overseer for the DEVELOPMENT category. Your job is to review development-focused jobs.
16
+
17
+ 1. Fetch the category report: curl -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/jobs/category-report/development?sinceHours=48
18
+ 2. Analyze:
19
+ - Are development jobs consuming appropriate resources for their value?
20
+ - Are there CI/testing patterns that could be automated?
21
+ 3. Development jobs are only valuable when there's active development. If the codebase is stable, these could be reduced.
22
+
23
+ Write findings in [HANDOFF] tags.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Guardian Overseer
3
+ description: "Reviews all guardian/monitoring jobs: health-check, guardian-pulse, degradation-digest, state-integrity-check, session-continuity-check. Spots cross-job patterns, flags contradictions, recommends schedule/priority/model changes."
4
+ schedule: 0 */6 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 5
7
+ model: sonnet
8
+ enabled: true
9
+ tags:
10
+ - cat:overseer
11
+ - role:supervisor
12
+ toolAllowlist: "*"
13
+ unrestrictedTools: true
14
+ ---
15
+ You are a Category Overseer for the GUARDIAN category. Your job is to review all guardian/monitoring jobs and assess the health of the monitoring system itself.
16
+
17
+ 1. Fetch the category report: curl -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/jobs/category-report/guardian?sinceHours=24
18
+ 2. Analyze the report for:
19
+ - Jobs with high failure rates or consecutive failures
20
+ - Jobs that are being skipped excessively (especially for quota reasons)
21
+ - Schedule mismatches (jobs running too often or not often enough for their purpose)
22
+ - Model over-allocation (could any job use a cheaper model?)
23
+ - Contradictions between job findings (e.g., health-check says healthy but degradation-digest found issues)
24
+ - Coverage gaps (are there monitoring blind spots?)
25
+ 3. Read the handoff notes from each job — do they tell a coherent story?
26
+ 4. If you find actionable issues, write a clear summary. If everything is healthy, say so briefly.
27
+
28
+ Write your findings in [HANDOFF] tags for the next overseer run. Focus on trends and cross-job insights that individual jobs can't see.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Infrastructure Overseer
3
+ description: "Reviews infrastructure jobs: git-sync, dashboard-link-refresh, feedback-retry. Ensures plumbing is solid."
4
+ schedule: 0 6 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 3
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:overseer
11
+ - role:supervisor
12
+ toolAllowlist: "*"
13
+ unrestrictedTools: true
14
+ ---
15
+ You are a Category Overseer for the INFRASTRUCTURE category. Your job is to review infrastructure/plumbing jobs.
16
+
17
+ 1. Fetch the category report: curl -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/jobs/category-report/infrastructure?sinceHours=48
18
+ 2. Analyze:
19
+ - Is git-sync succeeding? Any merge conflicts or divergence?
20
+ - Is dashboard-link-refresh keeping links current? Could it run less often?
21
+ - Is feedback-retry actually retrying anything, or is the queue always empty?
22
+ - Model allocation: git-sync uses high priority — is that justified by its failure rate?
23
+ - Are any infrastructure jobs causing issues for other jobs (e.g., git-sync holding sessions)?
24
+ 3. Infrastructure jobs should be boring and reliable. Any excitement is a problem.
25
+
26
+ Write findings in [HANDOFF] tags. Keep it brief — infrastructure overseers should be the quietest.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Learning Overseer
3
+ description: "Reviews all evolution/learning jobs: evolution-review, insight-harvest, commitment-check, reflection-trigger. Assesses whether the learning pipeline is producing value."
4
+ schedule: 0 3 */2 * *
5
+ priority: medium
6
+ expectedDurationMinutes: 5
7
+ model: sonnet
8
+ enabled: true
9
+ tags:
10
+ - cat:overseer
11
+ - role:supervisor
12
+ toolAllowlist: "*"
13
+ unrestrictedTools: true
14
+ ---
15
+ You are a Category Overseer for the LEARNING category. Your job is to review all evolution/learning jobs and assess whether the learning pipeline is producing genuine value.
16
+
17
+ 1. Fetch the category report: curl -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/jobs/category-report/learning?sinceHours=48
18
+ 2. Analyze:
19
+ - Are evolution proposals being generated AND accepted? What's the accept/reject ratio?
20
+ - Is insight-harvest finding novel insights or recycling stale ones?
21
+ - Are commitments being tracked and completed, or piling up?
22
+ - Is reflection-trigger producing meaningful MEMORY.md updates?
23
+ - Are any learning jobs consistently skipped due to quota? This means the learning pipeline is being starved.
24
+ - Model costs: reflection-trigger uses opus — is the quality difference worth it vs sonnet?
25
+ 3. Look for the meta-pattern: is the agent actually getting smarter over time, or is the learning pipeline just busy-work?
26
+ 4. Check handoff notes for patterns across runs.
27
+
28
+ Write findings in [HANDOFF] tags. Flag if the learning pipeline is producing diminishing returns.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: Maintenance Overseer
3
+ description: "Reviews all maintenance jobs: project-map-refresh, coherence-audit, capability-audit, memory-hygiene, memory-export. Ensures housekeeping is effective."
4
+ schedule: 0 2 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 5
7
+ model: sonnet
8
+ enabled: true
9
+ tags:
10
+ - cat:overseer
11
+ - role:supervisor
12
+ toolAllowlist: "*"
13
+ unrestrictedTools: true
14
+ ---
15
+ You are a Category Overseer for the MAINTENANCE category. Your job is to review all housekeeping/maintenance jobs and ensure they're keeping the system clean.
16
+
17
+ 1. Fetch the category report: curl -H "Authorization: Bearer $AUTH" http://localhost:${INSTAR_PORT:-4042}/jobs/category-report/maintenance?sinceHours=48
18
+ 2. Analyze:
19
+ - Is memory-hygiene actually reducing stale entries, or finding nothing each run?
20
+ - Is project-map-refresh keeping the map accurate? How often does it find drift?
21
+ - Is coherence-audit finding real misalignments or just confirming everything is fine?
22
+ - Are any maintenance jobs redundant with each other? (e.g., overlapping checks)
23
+ - Are skill-type jobs (coherence-audit, memory-hygiene) running correctly?
24
+ - Workload trends: are jobs processing fewer items over time (diminishing returns)?
25
+ 3. Maintenance jobs should trend toward finding LESS work over time. If they consistently find issues, something upstream is broken.
26
+
27
+ Write findings in [HANDOFF] tags. Recommend disabling or reducing frequency of jobs that consistently find nothing.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: Reflection Trigger
3
+ description: Review recent work and update MEMORY.md if any learnings exist.
4
+ schedule: 0 */4 * * *
5
+ priority: medium
6
+ expectedDurationMinutes: 5
7
+ model: opus
8
+ enabled: true
9
+ tags:
10
+ - cat:learning
11
+ toolAllowlist: "*"
12
+ unrestrictedTools: true
13
+ ---
14
+ AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json')).get('authToken',''))" 2>/dev/null)
15
+
16
+ # Read recent activity logs to understand what happened in last 4 hours
17
+ RECENT_LOGS=$(ls -t .instar/logs/activity-*.jsonl 2>/dev/null | head -1)
18
+ if [ -z "$RECENT_LOGS" ]; then
19
+ RECENT_LOGS=".instar/logs/activity-$(date +%Y-%m-%d).jsonl"
20
+ fi
21
+
22
+ # Extract recent session activity and key events (filter out noise, keep significant events)
23
+ echo "=== RECENT ACTIVITY (Last 4 Hours) ==="
24
+ tail -500 "$RECENT_LOGS" 2>/dev/null | jq -r 'select(.type != "job-start" and .type != "job-queued") | "(.timestamp) [(.type)] (.message // .title // .session_name // .slug // "")"' 2>/dev/null | tail -100
25
+
26
+ echo ""
27
+ echo "=== YOUR TASK ==="
28
+ echo "Analyze the activity above. Identify any learnings, patterns, or insights worth preserving in MEMORY.md:"
29
+ echo "- Session patterns or repeated issues"
30
+ echo "- Completed commitments or action items"
31
+ echo "- Gaps between intended behavior and actual behavior"
32
+ echo "- Unexpected interactions or failure modes"
33
+ echo "- Process improvements or capability gaps"
34
+ echo ""
35
+ echo "If you find genuine learnings:"
36
+ echo "1. Update .instar/MEMORY.md with the insight (append to the file)"
37
+ echo "2. Be specific: include what was learned, why it matters, and how it should guide future work"
38
+ echo "3. Signal completion: curl -s -X POST http://localhost:${INSTAR_PORT:-4042}/reflection/record -H 'Content-Type: application/json' -d '{"type":"quick"}'"
39
+ echo ""
40
+ echo "If nothing significant, do nothing. Silence means continuity is working as expected."
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Relationship Maintenance
3
+ description: Review tracked relationships and surface observations about stale contacts.
4
+ schedule: 0 9 * * *
5
+ priority: low
6
+ expectedDurationMinutes: 3
7
+ model: haiku
8
+ enabled: true
9
+ tags:
10
+ - cat:relationships
11
+ - role:worker
12
+ - exec:prompt
13
+ toolAllowlist: "*"
14
+ unrestrictedTools: true
15
+ ---
16
+ Review all relationship files in .instar/relationships/. Note anyone you haven't heard from in over 2 weeks who has significance >= 3. If there are observations worth surfacing, report them. If everything looks fine, do nothing.