forge-openclaw-plugin 0.2.19 → 0.2.21

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 (82) hide show
  1. package/README.md +133 -2
  2. package/dist/assets/board-_C6oMy5w.js +6 -0
  3. package/dist/assets/{board-8L3uX7_O.js.map → board-_C6oMy5w.js.map} +1 -1
  4. package/dist/assets/index-B4A6TooJ.js +63 -0
  5. package/dist/assets/index-B4A6TooJ.js.map +1 -0
  6. package/dist/assets/index-D6Xs_2mo.css +1 -0
  7. package/dist/assets/{motion-1GAqqi8M.js → motion-D4sZgCHd.js} +2 -2
  8. package/dist/assets/{motion-1GAqqi8M.js.map → motion-D4sZgCHd.js.map} +1 -1
  9. package/dist/assets/{table-DBGlgRjk.js → table-BWzTaky1.js} +2 -2
  10. package/dist/assets/{table-DBGlgRjk.js.map → table-BWzTaky1.js.map} +1 -1
  11. package/dist/assets/{ui-iTluWjC4.js → ui-BzK4azQb.js} +7 -7
  12. package/dist/assets/{ui-iTluWjC4.js.map → ui-BzK4azQb.js.map} +1 -1
  13. package/dist/assets/vendor-DT3pnAKJ.css +1 -0
  14. package/dist/assets/vendor-De38P6YR.js +729 -0
  15. package/dist/assets/vendor-De38P6YR.js.map +1 -0
  16. package/dist/assets/viz-C6hfyqzu.js +34 -0
  17. package/dist/assets/viz-C6hfyqzu.js.map +1 -0
  18. package/dist/index.html +9 -9
  19. package/dist/openclaw/parity.d.ts +1 -1
  20. package/dist/openclaw/parity.js +29 -2
  21. package/dist/openclaw/routes.js +207 -24
  22. package/dist/openclaw/tools.js +324 -35
  23. package/dist/server/app.js +2080 -92
  24. package/dist/server/db.js +3 -0
  25. package/dist/server/health.js +1284 -0
  26. package/dist/server/managers/platform/background-job-manager.js +138 -2
  27. package/dist/server/managers/platform/llm-manager.js +126 -0
  28. package/dist/server/managers/platform/openai-responses-provider.js +773 -0
  29. package/dist/server/managers/runtime.js +6 -1
  30. package/dist/server/openapi.js +718 -0
  31. package/dist/server/preferences-seeds.js +409 -0
  32. package/dist/server/preferences-types.js +368 -0
  33. package/dist/server/psyche-types.js +42 -18
  34. package/dist/server/repositories/activity-events.js +53 -4
  35. package/dist/server/repositories/calendar.js +89 -15
  36. package/dist/server/repositories/collaboration.js +8 -3
  37. package/dist/server/repositories/diagnostic-logs.js +243 -0
  38. package/dist/server/repositories/entity-ownership.js +92 -0
  39. package/dist/server/repositories/goals.js +7 -2
  40. package/dist/server/repositories/habits.js +122 -16
  41. package/dist/server/repositories/notes.js +119 -41
  42. package/dist/server/repositories/preferences.js +1765 -0
  43. package/dist/server/repositories/projects.js +18 -7
  44. package/dist/server/repositories/psyche.js +84 -27
  45. package/dist/server/repositories/rewards.js +112 -4
  46. package/dist/server/repositories/strategies.js +450 -0
  47. package/dist/server/repositories/tags.js +11 -6
  48. package/dist/server/repositories/task-runs.js +10 -2
  49. package/dist/server/repositories/tasks.js +99 -17
  50. package/dist/server/repositories/users.js +417 -0
  51. package/dist/server/repositories/wiki-memory.js +3366 -0
  52. package/dist/server/services/context.js +20 -18
  53. package/dist/server/services/dashboard.js +29 -6
  54. package/dist/server/services/entity-crud.js +21 -3
  55. package/dist/server/services/insights.js +9 -7
  56. package/dist/server/services/projects.js +2 -1
  57. package/dist/server/services/psyche.js +10 -9
  58. package/dist/server/types.js +594 -30
  59. package/openclaw.plugin.json +1 -1
  60. package/package.json +1 -1
  61. package/server/migrations/015_multi_user_and_strategies.sql +244 -0
  62. package/server/migrations/016_health_companion.sql +158 -0
  63. package/server/migrations/016_strategy_contracts_and_user_graph.sql +22 -0
  64. package/server/migrations/017_preferences.sql +131 -0
  65. package/server/migrations/018_preference_catalogs.sql +31 -0
  66. package/server/migrations/019_wiki_memory.sql +255 -0
  67. package/server/migrations/020_wiki_page_hierarchy.sql +11 -0
  68. package/server/migrations/021_hide_evidence_from_wiki_index.sql +3 -0
  69. package/server/migrations/022_wiki_ingest_background.sql +85 -0
  70. package/server/migrations/023_diagnostic_logs.sql +28 -0
  71. package/skills/forge-openclaw/SKILL.md +126 -34
  72. package/skills/forge-openclaw/entity_conversation_playbooks.md +337 -0
  73. package/skills/forge-openclaw/psyche_entity_playbooks.md +404 -0
  74. package/dist/assets/board-8L3uX7_O.js +0 -6
  75. package/dist/assets/index-Cj1IBH_w.js +0 -36
  76. package/dist/assets/index-Cj1IBH_w.js.map +0 -1
  77. package/dist/assets/index-DQT6EbuS.css +0 -1
  78. package/dist/assets/vendor-BvM2F9Dp.js +0 -503
  79. package/dist/assets/vendor-BvM2F9Dp.js.map +0 -1
  80. package/dist/assets/vendor-CRS-psbw.css +0 -1
  81. package/dist/assets/viz-CNeunkfu.js +0 -34
  82. package/dist/assets/viz-CNeunkfu.js.map +0 -1
@@ -1,17 +1,63 @@
1
1
  ---
2
2
  name: forge-openclaw
3
- description: use when the user wants to save, search, update, review, start, stop, reward, or explain work or psyche records inside forge, or when the conversation is clearly about a forge entity such as a goal, project, task, habit, note, calendar_event, work_block_template, task_timebox, task_run, insight, psyche_value, behavior_pattern, behavior, belief_entry, mode_profile, mode_guide_session, trigger_report, event_type, or emotion_definition. identify the exact forge entity, keep the main conversation natural, offer saving once when helpful, ask only for missing fields, and use the correct forge tool and payload shape.
3
+ description: use when the user wants to save, search, update, review, start, stop, reward, explain, or compare Forge records, or when the conversation is clearly about a Forge entity such as a goal, project, strategy, task, habit, note, calendar_event, work_block_template, task_timebox, task_run, insight, preference item, preference context, preference catalog, psyche_value, behavior_pattern, behavior, belief_entry, mode_profile, mode_guide_session, trigger_report, event_type, or emotion_definition. identify the exact Forge object, keep the main conversation natural, guide psyche intake with active listening before storing it, and for psyche issues that need understanding first usually begin with one exploratory question before any formulation or save suggestion.
4
4
  ---
5
5
 
6
6
  Forge is the user's structured system for planning work, doing work, reflecting on patterns, and keeping a truthful record of what is happening. Use it when the user is clearly working inside that system, or when they are describing something that naturally belongs there and would benefit from being stored, updated, reviewed, or acted on in Forge. Keep the conversation natural first. Do not turn every message into intake. When a real Forge entity is clearly present, name the exact entity type plainly, help with the substance of the conversation, and then offer Forge once, lightly, if storing it would genuinely help.
7
7
 
8
- Forge has two major domains. The planning side covers goals, projects, tasks, habits, notes, calendar events, recurring work blocks, task timeboxes, live work sessions, and agent-authored insights. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, trigger reports, event types, and reusable emotion definitions. The model should use the real entity names, not vague substitutes. Say `project`, not “initiative”. Say `behavior_pattern`, not “theme”. Say `trigger_report`, not “incident note”.
9
- Habits are a first-class recurring entity in the planning side. They can link directly to goals, projects, tasks, values, patterns, behaviors, beliefs, modes, and trigger reports, and they participate in the same searchable noteable graph as the rest of Forge.
8
+ Forge has four major surfaces. The planning side covers goals, projects, strategies, tasks, habits, notes, calendar events, recurring work blocks, task timeboxes, live work sessions, and agent-authored insights. The Health side covers sleep sessions, sports and workout sessions, companion pairing, and habit-generated workout records that should still stay linked to the broader Forge graph. The Preferences side covers contextual taste modeling, pairwise comparisons, direct signals, editable concept libraries, and preference items that can come from Forge entities or seeded concept domains such as food, activities, places, countries, fashion, people, media, and tools. The Psyche side covers values, patterns, behaviors, beliefs, modes, guided mode sessions, trigger reports, event types, and reusable emotion definitions. Forge also has a file-first Wiki memory layer with explicit spaces, local markdown pages, backlinks, optional embeddings, and structured links back to Forge entities. Forge is also multi-user: every entity can belong to a typed `human` or `bot` user through `userId`, and read routes can scope to one or many users with `userId` or repeated `userIds`. The current access posture is configurable through a directional user graph, but the live default is still permissive: Forge can list users directly, every relationship edge starts open, and a user can read or affect another user's linked records when the route explicitly asks for them. Use `forge_get_user_directory` when owner identity or cross-user access matters. Strategies can also be locked into a contract with `isLocked`; once locked, do not mutate the graph or target structure unless the user explicitly wants the strategy unlocked first. The model should use the real entity names, not vague substitutes. Say `project`, not “initiative”. Say `behavior_pattern`, not “theme”. Say `trigger_report`, not “incident note”.
9
+ Habits are a first-class recurring entity in the planning side.
10
10
  NEGATIVE HABIT CHECK-IN RULE: for a `negative` habit, the correct aligned/resisted outcome is `missed`. `missed` means the bad habit was resisted, the user stayed aligned, and the habit should award its XP bonus.
11
11
 
12
+ Preferences rule:
13
+
14
+ - When the user wants to understand or refine taste, ranking, recommendation fit, or “what Forge thinks I like”, treat that as the Preferences surface rather than a normal planning intake.
15
+ - The default Preferences UX starts from what Forge already knows and then offers one prominent `Start the game` action.
16
+ - The comparison flow is visual and modal. Prefer opening the Forge UI when the user wants to play comparisons directly.
17
+ - For Forge-native domains, Forge can seed items from existing entities automatically.
18
+ - For broader domains such as food or activities, Forge can use seeded concept libraries that the user can later edit.
19
+
20
+ Wiki rule:
21
+
22
+ - Treat the Wiki as the canonical long-form memory surface, not as a loose note dump.
23
+ - Use the wiki tools when the user wants file-first reference pages, backlink-aware recall, ingest from a URL or local file, or wiki maintenance work such as unresolved-link cleanup.
24
+ - `forge_ingest_wiki_source` now queues the ingest as background work; use the Forge UI handoff when the user wants to review or keep only selected wiki/entity candidates after the ingest finishes.
25
+ - Keep evidence notes and wiki pages conceptually distinct: evidence notes are linked operating records, while wiki pages are the curated memory vault.
26
+
27
+ Wiki navigation and search rule:
28
+
29
+ - The wiki has a stable top-level structure. The home page is `index`, and the default high-level branches are `people`, `projects`, `concepts`, `sources`, and `chronicle`.
30
+ - `people` is for durable person pages and relationship context. `projects` is for ongoing initiatives and bounded workstreams. `concepts` is for reusable ideas, methods, and frameworks. `sources` is for raw materials and imports. `chronicle` is for timeline-style logs and ongoing narrative.
31
+ - Treat `wiki` pages as canonical synthesis and `evidence` notes as supporting records. If the user wants the durable summary, search the wiki pages first. If they want raw supporting context or operational detail, evidence notes may be the better target.
32
+ - When the user wants a person, search the full name first, then obvious aliases, nicknames, or paired context such as collaborator names or city. Person pages often sit under the `people` branch but the reliable method is still search-first.
33
+ - When the user wants a conversation or chat, search the conversation name, the participant names, and any distinctive nickname used in the thread. Group-chat imports often become a durable synthesis page with a normalized title rather than the raw file name.
34
+ - When the user wants a concept, search the exact phrase first, then close variants, abbreviations, and adjacent terms. Concept pages often live under `concepts`, but search is still better than assuming the parent branch.
35
+ - When the user wants one exact page and already knows the title or slug, search that exact title or slug first, then open the best wiki page result instead of broad browsing.
36
+ - Use `forge_search_wiki` as the default wiki recall tool. It is the main route for people, conversations, concepts, and exact page lookup.
37
+ - Use `forge_list_wiki_pages` when the user wants to browse structure, inspect a branch, or understand how pages are organized rather than search by phrase.
38
+ - Use `forge_get_wiki_page` after search yields a likely hit, or when the user already identified the page to open.
39
+ - Use `forge_get_wiki_settings` or `forge_get_wiki_health` when the task is about wiki maintenance, indexing, unresolved links, ingest setup, or vault integrity rather than content recall.
40
+
41
+ Health rule:
42
+
43
+ - Sleep and sports records are first-class health surfaces, not generic notes or tasks.
44
+ - Use `forge_get_sleep_overview` and `forge_get_sports_overview` for review.
45
+ - Use `forge_update_sleep_session` and `forge_update_workout_session` when the user wants to attach reflective context, tags, or Forge links to an existing health record.
46
+ - Habit-generated workouts and imported HealthKit workouts belong to the same workout record model, so do not invent a separate storage path for sport sessions.
47
+
12
48
  Write to Forge only with clear user consent. If the user is just thinking aloud, helping first is usually better than writing immediately. After helping, you may offer one short Forge prompt if the match is strong. If the user agrees, ask only for the missing fields and only one to three focused questions at a time. Do not offer Forge again after a decline unless the user reopens it.
13
49
 
14
- Optional recurring automation templates live in `cron_jobs.md` next to this skill. Use that file only when the user explicitly asks for recurring Forge automations, cron jobs, scheduled check-ins, or a recurring synthesis workflow. Those entries are rich examples, not defaults: adapt personal details such as names, recipients, phone numbers, or project titles to the current user, but preserve the intended tone, operational logic, and any example naming conventions when the user chooses to adopt that pattern.
50
+ Entity conversation rule:
51
+
52
+ - For all entity creation or update flows, first use [`entity_conversation_playbooks.md`](./entity_conversation_playbooks.md) to decide the next best question.
53
+ - Ask only for what is missing or unclear. Do not walk through every schema field.
54
+ - Let each question have one job. Know what you are trying to clarify before you ask it.
55
+ - Prefer a progression of:
56
+ concrete example or intent -> working name -> purpose or meaning -> placement in Forge -> operational details -> linked context.
57
+ - For emotionally meaningful non-Psyche records such as goals, habits, and notes, reflect the meaning before you ask for structure.
58
+ - When updating an entity, start with what is changing, what should stay true, and what prompted the update now.
59
+ - When enough is clear, briefly summarize what you heard in the user's own language before asking for the last missing structural detail.
60
+ - The quick intake prompts later in this file are fallback checkpoints, not a script to read aloud.
15
61
 
16
62
  Forge data location rule:
17
63
 
@@ -20,8 +66,24 @@ Forge data location rule:
20
66
  - on a linked repo-local install, this usually means `<repo>/openclaw-plugin/data/forge.sqlite`
21
67
  - if the user wants the data somewhere else for persistence, backup, or manual control, tell them to set `plugins.entries["forge-openclaw-plugin"].config.dataRoot` and restart the OpenClaw gateway
22
68
  - if the user asks where the data is stored or how to move it, explain the current default plainly and show the exact config field
23
- - if the user wants to manage a plugin-managed local Forge runtime cleanly, tell them to run `openclaw forge start`, `openclaw forge stop`, `openclaw forge restart`, or `openclaw forge status`
24
- - these commands only manage a runtime that the OpenClaw plugin auto-started itself; if Forge was started manually elsewhere, they will say so instead of killing random local processes
69
+
70
+ Psyche interview rule:
71
+
72
+ - For `psyche_value`, `behavior_pattern`, `behavior`, `belief_entry`, `mode_profile`, `mode_guide_session`, and `trigger_report`, do not jump straight to raw field collection.
73
+ - First use the active-listening playbooks in [`psyche_entity_playbooks.md`](./psyche_entity_playbooks.md).
74
+ - Ask permission before going deeper, ask one or two focused questions at a time, reflect back what you heard, and summarize before moving on.
75
+ - Start from a recent concrete example before naming an abstract pattern, belief, or mode.
76
+ - After the first real answer, choose one follow-up lane at a time: situation, sequence, meaning, protection, cost, longing/value, or tentative name.
77
+ - If the user says they want help understanding a Psyche issue before saving it, ask one orienting question first instead of jumping straight into a full interpretation, diagnosis-like label, save suggestion, replacement belief, or suggested title.
78
+ - In that first exploratory turn, keep the reflection to one or two short sentences, avoid numbered lists or schema dumps, and wait for the user's answer before offering a fuller formulation.
79
+ - In that first exploratory turn, stay in plain prose, end with one question, and do not mention Forge fields or save formatting yet unless the user interrupts to save immediately.
80
+ - In that first exploratory turn, keep the whole reply short, usually under 90 words, and anchor it in one concrete-example question rather than a conceptual lecture.
81
+ - In that first exploratory turn, ask only one question, do not search Forge or mention whether a matching entity exists, and avoid openings like "This sounds like" or "What you're describing is".
82
+ - In that first exploratory turn, prefer exactly two sentences: one brief empathic reflection and one concrete question. Avoid colons because they tend to trigger list-like answers.
83
+ - Follow the preferred opening-question patterns in [`psyche_entity_playbooks.md`](./psyche_entity_playbooks.md) when they fit the entity the user is exploring.
84
+ - When the conversation reveals an adjacent entity such as a linked belief, mode, value, pattern, or note, name that gently and ask whether the user wants to map it too.
85
+ - If nuance matters, preserve it in a linked Markdown `note` instead of forcing every detail into normalized fields.
86
+ - If the user shows imminent risk of self-harm, suicide, violence, inability to stay safe, or severe disorientation, stop normal intake and prioritize urgent human support or emergency help instead.
25
87
 
26
88
  Use these exact entity meanings when deciding what the user is describing.
27
89
 
@@ -35,6 +97,10 @@ Use these exact entity meanings when deciding what the user is describing.
35
97
 
36
98
  `note` is a first-class Markdown entity that can link to one or many other entities. Use it for work summaries, context, progress logs, handoff explanations, wiki-style reference pages, or reflective detail that should stay searchable and attached to the right records. Notes also support note-owned `tags` for memory-system labels such as `Working memory`, `Short-term memory`, `Episodic memory`, `Semantic memory`, and `Procedural memory`, plus custom tags. Notes may be durable or ephemeral: if `destroyAt` is set, Forge will delete the note automatically after that time.
37
99
 
100
+ `sleep_session` is a first-class health record for one night. It can hold recovery metrics, stage breakdown, annotations, and links back to goals, projects, tasks, habits, notes, and Psyche records.
101
+
102
+ `workout_session` is a first-class sports record. It can come from HealthKit import or from a completed habit, and it can carry subjective effort, mood, meaning, tags, and links back into Forge.
103
+
38
104
  `insight` is an agent-authored observation, recommendation, or warning grounded in Forge data. It does not replace a requested goal, project, task, pattern, belief, or trigger report.
39
105
 
40
106
  `calendar_event` is a canonical Forge event record. It lives in Forge first and can later project to a writable provider calendar.
@@ -96,7 +162,7 @@ Ask:
96
162
  `habit`
97
163
  Use for a recurring commitment or recurring slip with explicit cadence and XP consequences.
98
164
  Minimum field: `title`
99
- Usually useful: `polarity`, `frequency`, `linkedGoalIds`, `linkedProjectIds`, `linkedTaskIds`, `linkedValueIds`, `linkedPatternIds`, `linkedBehaviorIds`, `linkedBeliefIds`, `linkedModeIds`, `linkedReportIds`
165
+ Usually useful: `polarity`, `frequency`
100
166
  CRITICAL NEGATIVE-HABIT CHECK-IN RULE:
101
167
 
102
168
  - For a `negative` habit, the correct check-in outcome is `missed`.
@@ -106,7 +172,7 @@ CRITICAL NEGATIVE-HABIT CHECK-IN RULE:
106
172
 
107
173
  1. What is the recurring behavior in one concrete sentence?
108
174
  2. Is doing it good (`positive`) or a slip (`negative`)?
109
- 3. What should it link back to in Forge or Psyche?
175
+ 3. What cadence should it follow?
110
176
 
111
177
  `task_run`
112
178
  Use for live work happening now.
@@ -119,9 +185,9 @@ Minimum field: `title`
119
185
  Usually useful: `description`, `valuedDirection`, `whyItMatters`, links to goals, projects, or tasks
120
186
  Ask:
121
187
 
122
- 1. What value or direction is this?
123
- 2. How would you describe it in your own words?
124
- 3. Why does it matter now?
188
+ 1. What feels deeply important here, and what would you call that value or direction?
189
+ 2. If you were living it a little more this week, what would someone actually see?
190
+ 3. Why does it matter now, and what one action would move toward it?
125
191
 
126
192
  `behavior_pattern`
127
193
  Use for a recurring loop across situations.
@@ -129,9 +195,9 @@ Minimum field: `title`
129
195
  Usually useful: `description`, `targetBehavior`, `cueContexts`, `shortTermPayoff`, `longTermCost`, `preferredResponse`
130
196
  Ask:
131
197
 
132
- 1. What would you call this pattern?
133
- 2. What usually sets it off, and what tends to happen next?
134
- 3. What does it give you in the short term, what does it cost later, and what response would you rather make?
198
+ 1. Can we slow this down using one recent example first?
199
+ 2. What usually sets the loop off, and what tends to happen in thoughts, feelings, body, and actions next?
200
+ 3. What does it do for you immediately, what does it cost later, and what belief, mode, or value seems bound up in it?
135
201
 
136
202
  `behavior`
137
203
  Use for one recurring move or action tendency.
@@ -139,9 +205,9 @@ Minimum fields: `kind`, `title`
139
205
  Usually useful: `commonCues`, `urgeStory`, `shortTermPayoff`, `longTermCost`, `replacementMove`, `repairPlan`
140
206
  Ask:
141
207
 
142
- 1. What happened, in plain language?
143
- 2. Is it an `away`, `committed`, or `recovery` behavior?
144
- 3. What cues show up, and what move would you want available instead?
208
+ 1. What does this behavior actually look like in plain language?
209
+ 2. What cues or urges usually pull you toward it, and what does it do for you in the moment?
210
+ 3. Is it an `away`, `committed`, or `recovery` behavior, and what move would you want available instead?
145
211
 
146
212
  `belief_entry`
147
213
  Use for one explicit belief sentence.
@@ -149,9 +215,9 @@ Minimum fields: `statement`, `beliefType`
149
215
  Usually useful: `confidence`, `evidenceFor`, `evidenceAgainst`, `flexibleAlternative`, `originNote`
150
216
  Ask:
151
217
 
152
- 1. What is the belief in one sentence?
218
+ 1. If we turn that reaction into one sentence, what does the belief sound like in your own words?
153
219
  2. Is it `absolute` or `conditional`, and how true does it feel from 0 to 100?
154
- 3. What supports it, what weakens it, and what would be a more flexible alternative?
220
+ 3. What seems to support it, what weakens it, where did you learn it, and what would be a more flexible alternative?
155
221
 
156
222
  `mode_profile`
157
223
  Use for a recurring part-state or inner role.
@@ -159,14 +225,18 @@ Minimum fields: `family`, `title`
159
225
  Usually useful: `fear`, `burden`, `protectiveJob`, `originContext`, links to patterns, behaviors, and values
160
226
  Ask:
161
227
 
162
- 1. What kind of mode is this: `coping`, `child`, `critic_parent`, `healthy_adult`, or `happy_child`?
163
- 2. What should this mode be called?
164
- 3. What does it fear, carry, or try to protect?
228
+ 1. When this part shows up, what is it like from the inside and what should it be called?
229
+ 2. What kind of mode is this: `coping`, `child`, `critic_parent`, `healthy_adult`, or `happy_child`?
230
+ 3. What does it fear, carry, or try to protect, and when did you first need it?
165
231
 
166
232
  `mode_guide_session`
167
233
  Use for guided exploration before or alongside a durable mode profile.
168
- Minimum fields: `summary`, `answers`, `results`
169
- Ask only what is needed to capture the guided exploration and the candidate interpretations.
234
+ Minimum fields: `summary`, `answers`
235
+ Ask:
236
+
237
+ 1. What just happened that brought this part online right now?
238
+ 2. If it had a voice, what would it say, fear, or need?
239
+ 3. Would it help if we suggested one or two candidate mode labels, with reasons, before deciding whether to store a durable profile?
170
240
 
171
241
  `trigger_report`
172
242
  Use for one specific emotionally important episode.
@@ -174,9 +244,9 @@ Minimum field: `title`
174
244
  Usually useful: `eventSituation`, `occurredAt`, `emotions`, `thoughts`, `behaviors`, `consequences`, `nextMoves`, links to values, beliefs, patterns, modes, goals, projects, or tasks
175
245
  Ask:
176
246
 
177
- 1. What happened?
178
- 2. What emotions were present, and how intense were they?
179
- 3. What thoughts showed up, what did you do next, and what would be the useful next move now?
247
+ 1. What happened, as concretely as you can say it?
248
+ 2. What emotions were present, how intense were they, and what thoughts or meanings showed up?
249
+ 3. What did you do next, what did that do short term and long term, and what pattern, belief, or mode seems most active here?
180
250
 
181
251
  `event_type`
182
252
  Use for a reusable trigger category.
@@ -209,11 +279,16 @@ Use the batch entity tools for stored records:
209
279
  These tools operate on:
210
280
  `goal`, `project`, `task`, `habit`, `note`, `calendar_event`, `work_block_template`, `task_timebox`, `psyche_value`, `behavior_pattern`, `behavior`, `belief_entry`, `mode_profile`, `mode_guide_session`, `trigger_report`, `event_type`, `emotion_definition`
211
281
 
282
+ Use the wiki tools for file-first memory work:
283
+ `forge_get_wiki_settings`, `forge_list_wiki_pages`, `forge_get_wiki_page`, `forge_search_wiki`, `forge_upsert_wiki_page`, `forge_get_wiki_health`, `forge_sync_wiki_vault`, `forge_reindex_wiki_embeddings`, `forge_ingest_wiki_source`
284
+
285
+ Sleep and workout sessions are not batch entities. Use the health tools instead:
286
+ `forge_get_sleep_overview`, `forge_get_sports_overview`, `forge_update_sleep_session`, `forge_update_workout_session`
287
+
212
288
  Use live work tools for `task_run`:
213
- `forge_adjust_work_minutes`, `forge_log_work`, `forge_start_task_run`, `forge_heartbeat_task_run`, `forge_focus_task_run`, `forge_complete_task_run`, `forge_release_task_run`
289
+ `forge_log_work`, `forge_start_task_run`, `forge_heartbeat_task_run`, `forge_focus_task_run`, `forge_complete_task_run`, `forge_release_task_run`
214
290
 
215
291
  Use `forge_post_insight` for `insight`.
216
- Use `forge_grant_reward_bonus` only for explicit manual XP bonuses or penalties that should be auditable and cannot be expressed through the normal task-run or habit check-in routes.
217
292
  Use the calendar tools for provider sync and planning:
218
293
  `forge_get_calendar_overview`, `forge_connect_calendar_provider`, `forge_sync_calendar_connection`, `forge_create_work_block_template`, `forge_recommend_task_timeboxes`, `forge_create_task_timebox`
219
294
 
@@ -283,8 +358,6 @@ Use `forge_release_task_run` to stop live work without completing the task. `clo
283
358
 
284
359
  Use `forge_log_work` only for retroactive work that already happened. If the user explains the work in a way that should be preserved, include `closeoutNote`.
285
360
 
286
- Use `forge_adjust_work_minutes` when the task or project already exists and the user only needs tracked minutes corrected up or down. This is the truthful path for signed retrospective minute adjustments and it automatically applies symmetric XP changes when reward buckets are crossed.
287
-
288
361
  Use the calendar tools when the request is about planning or availability rather than entity storage:
289
362
 
290
363
  - `forge_get_calendar_overview` to inspect mirrored events, work blocks, provider connections, and existing timeboxes
@@ -294,6 +367,14 @@ Use the calendar tools when the request is about planning or availability rather
294
367
  - `forge_recommend_task_timeboxes` to find future slots that satisfy current rules
295
368
  - `forge_create_task_timebox` as a convenience helper to confirm a selected slot into a real planned timebox
296
369
 
370
+ Use the health tools when the request is about sleep or sports review:
371
+
372
+ - `forge_get_sleep_overview` to inspect recent nights, averages, regularity, stage breakdown, and linked reflective context
373
+ - `forge_get_sports_overview` to inspect training volume, workout types, effort trends, habit-generated sessions, and linked context
374
+ - `forge_update_sleep_session` to add sleep-quality notes, tags, or links back to Forge entities
375
+ - `forge_update_workout_session` to add subjective effort, mood, meaning, tags, or links on one workout
376
+ - remember that the UI route is `/sports` while the backend overview route is `/api/v1/health/fitness`
377
+
297
378
  Work-block payload guidance:
298
379
 
299
380
  - `kind` must be one of `main_activity`, `secondary_activity`, `third_activity`, `rest`, `holiday`, or `custom`
@@ -326,8 +407,6 @@ Use these exact calendar batch payload shapes when working generically:
326
407
  - create a planned task slot:
327
408
  `{"operations":[{"entityType":"task_timebox","data":{"taskId":"task_123","projectId":"project_456","title":"Draft the methods section","startsAt":"2026-04-03T06:00:00.000Z","endsAt":"2026-04-03T07:30:00.000Z","source":"suggested"}}]}`
328
409
 
329
- Do not use `forge_adjust_work_minutes` to simulate a live session. Live work still belongs in `forge_start_task_run` and the rest of the task-run workflow.
330
-
331
410
  Use these interaction rules.
332
411
 
333
412
  Keep the main discussion natural. Do not turn every conversation into a form. Do not offer Forge for every passing mention. Offer it once, near the end, only when the signal is strong and storing would help.
@@ -349,18 +428,31 @@ When the user asks which Forge tools are available, list exactly these tools:
349
428
  `forge_get_operator_overview`
350
429
  `forge_get_operator_context`
351
430
  `forge_get_agent_onboarding`
431
+ `forge_get_user_directory`
352
432
  `forge_get_psyche_overview`
433
+ `forge_get_sleep_overview`
434
+ `forge_get_sports_overview`
353
435
  `forge_get_xp_metrics`
354
436
  `forge_get_weekly_review`
355
437
  `forge_get_current_work`
356
438
  `forge_get_ui_entrypoint`
439
+ `forge_get_wiki_settings`
440
+ `forge_list_wiki_pages`
441
+ `forge_get_wiki_page`
442
+ `forge_search_wiki`
443
+ `forge_upsert_wiki_page`
444
+ `forge_get_wiki_health`
445
+ `forge_sync_wiki_vault`
446
+ `forge_reindex_wiki_embeddings`
447
+ `forge_ingest_wiki_source`
357
448
  `forge_search_entities`
358
449
  `forge_create_entities`
359
450
  `forge_update_entities`
360
451
  `forge_delete_entities`
361
452
  `forge_restore_entities`
362
453
  `forge_grant_reward_bonus`
363
- `forge_adjust_work_minutes`
454
+ `forge_update_sleep_session`
455
+ `forge_update_workout_session`
364
456
  `forge_log_work`
365
457
  `forge_start_task_run`
366
458
  `forge_heartbeat_task_run`
@@ -0,0 +1,337 @@
1
+ # Entity Conversation Playbooks
2
+
3
+ Use this file whenever the user is creating or updating a Forge entity outside the
4
+ deeper Psyche exploration flow. The point is to keep the conversation natural and
5
+ intentional while still gathering enough structure to store the right record.
6
+
7
+ ## Interaction stance
8
+
9
+ - Ask only for what is missing or still unclear.
10
+ - Lead the user somewhere. Know whether you are trying to clarify the name, the role,
11
+ the outcome, the placement, the timing, the success condition, or the links.
12
+ - Let each question have one job. If you cannot say what the question is trying to
13
+ clarify, ask a different question.
14
+ - Ask one to three focused questions at a time. One is usually best when the user is
15
+ unsure or emotionally loaded.
16
+ - Reflect briefly before the next question when the user gives nuance that matters.
17
+ - For emotionally meaningful planning records such as goals, habits, and notes, reflect
18
+ the meaning first and then ask for the structure.
19
+ - Do not read schema fields out loud unless the user explicitly wants a mechanical
20
+ checklist.
21
+ - Prefer a progression of:
22
+ recent intent or concrete example -> working name -> purpose or outcome -> placement
23
+ in Forge -> operational details -> linked context.
24
+ - If the user already gave a usable title, timing, or parent context, do not ask for it
25
+ again just because the schema has that field.
26
+ - When the user says "save something about..." and the record is still fuzzy, help them
27
+ sharpen what they are trying to preserve before you ask for the final Forge shape.
28
+ - When the meaning is clearer than the wording, offer a tentative title or summary
29
+ yourself and ask whether it fits. Do not make the user do all the naming work alone.
30
+ - Before saving, offer a short working summary in the user's own language when that
31
+ would reduce ambiguity.
32
+ - When updating, start with:
33
+ what is changing,
34
+ what should stay true,
35
+ and what prompted the update now.
36
+
37
+ ## Question design rules
38
+
39
+ - Prefer one clean question over a stacked sentence with multiple asks.
40
+ - For straightforward logistical entities such as tasks, calendar events, work blocks,
41
+ timeboxes, and task runs, use the fast path: confirm what is already clear and ask
42
+ for only the one missing operational detail.
43
+ - When you need two details, ask for the more meaning-bearing one first.
44
+ - If the user sounds uncertain, ask for an example before an abstraction.
45
+ - If the user sounds clear and decisive, confirm the working formulation and move to the
46
+ one missing structural detail.
47
+ - A good next question usually clarifies one of these:
48
+ what this is,
49
+ why it matters,
50
+ where it belongs,
51
+ what success looks like,
52
+ when it should happen,
53
+ or what should stay linked.
54
+ - Before the final save question, it is often better to offer a tentative formulation
55
+ than to ask for a raw title. Example shape:
56
+ "This sounds like a project about repairing trust with Lea, not just a loose note.
57
+ Does that fit, and if so what outcome would tell you it is moving?"
58
+ - Avoid dead-form prompts like "What should this be called?" when the user is still
59
+ figuring out what the thing is. Name first, then ask for correction.
60
+
61
+ ## Update loop
62
+
63
+ Use this when the user is updating an existing record rather than creating a new one.
64
+
65
+ 1. Ask what feels newly true, newly urgent, or newly clear.
66
+ 2. Ask what should stay intact so the record does not lose its core meaning.
67
+ 3. Ask for the concrete trigger for the update if it matters.
68
+ 4. Then ask only for the missing structural detail required by the change.
69
+
70
+ ## Goal
71
+
72
+ Aim: clarify the direction and why it matters, not just produce a title.
73
+
74
+ Arc:
75
+
76
+ 1. Ask what direction or outcome the user wants to keep in view.
77
+ 2. Ask why it matters now.
78
+ 3. Distinguish the goal from a project or task.
79
+ 4. Clarify horizon and status only after the meaning is clear.
80
+
81
+ Ready to save when:
82
+
83
+ - the goal has a stable name
84
+ - the direction is understandable in plain language
85
+ - the horizon is clear enough if it matters
86
+
87
+ Preferred opening question:
88
+
89
+ - "What direction are you trying to hold onto here, in a way you would want future-you to keep seeing?"
90
+
91
+ ## Project
92
+
93
+ Aim: turn an intention into a bounded workstream with a clear outcome.
94
+
95
+ Arc:
96
+
97
+ 1. Ask what this piece of work should be called.
98
+ 2. Ask what outcome would make the project feel real or complete for now.
99
+ 3. Ask which goal it belongs under.
100
+ 4. Clarify status, owner, and notes only after the scope is clear.
101
+
102
+ Ready to save when:
103
+
104
+ - the project has a clear name
105
+ - the outcome is concrete enough to recognize later
106
+ - its parent goal is known or intentionally absent pending follow-up
107
+
108
+ Preferred opening question:
109
+
110
+ - "If this becomes a real project in Forge, what outcome would make it feel genuinely underway or complete?"
111
+
112
+ ## Strategy
113
+
114
+ Aim: turn a vague plan into a deliberate sequence toward a real end state.
115
+
116
+ Arc:
117
+
118
+ 1. Ask what end state the strategy is trying to land.
119
+ 2. Ask which goals or projects are the true targets.
120
+ 3. Ask what the major steps or nodes are.
121
+ 4. Ask about order, dependencies, and anything that must not be skipped.
122
+ 5. Clarify linked entities or ownership once the sequence itself makes sense.
123
+
124
+ Ready to save when:
125
+
126
+ - the strategy has a stable name
127
+ - the end state is concrete enough to test
128
+ - the directed sequence is sketched clearly enough to build the graph
129
+
130
+ Preferred opening question:
131
+
132
+ - "What future state is this strategy supposed to make real?"
133
+
134
+ ## Task
135
+
136
+ Aim: identify the next concrete move, not just capture a vague obligation.
137
+
138
+ Arc:
139
+
140
+ 1. Ask what the next concrete action is.
141
+ 2. Ask where it belongs: project, goal, both, or standalone.
142
+ 3. Ask what would make it easier to do: due date, priority, owner, or brief context.
143
+
144
+ Ready to save when:
145
+
146
+ - the task is phrased as an actionable move
147
+ - placement is clear enough
148
+ - any crucial timing or priority is captured
149
+
150
+ Preferred opening question:
151
+
152
+ - "What is the next concrete move you want to remember or do?"
153
+
154
+ ## Habit
155
+
156
+ Aim: define the recurring behavior and the cadence in a way that makes later check-ins unambiguous.
157
+
158
+ Arc:
159
+
160
+ 1. Ask what the recurring behavior is in plain language.
161
+ 2. Ask whether doing it is aligned or a slip.
162
+ 3. Ask about cadence and what counts as success in practice.
163
+ 4. Ask about links to goals, tasks, or Psyche entities only if that would help later review.
164
+
165
+ Ready to save when:
166
+
167
+ - the recurring behavior is specific
168
+ - polarity is clear
169
+ - the cadence and success condition are clear enough to check in honestly
170
+
171
+ Preferred opening question:
172
+
173
+ - "What is the recurring behavior you want Forge to keep track of?"
174
+
175
+ ## Note
176
+
177
+ Aim: preserve the useful context and link it to the right places without turning the note into a dumping ground.
178
+
179
+ Arc:
180
+
181
+ 1. Ask what the note needs to preserve.
182
+ 2. Ask what entities it should stay attached to.
183
+ 3. Ask whether it should be durable or temporary.
184
+ 4. Ask about tags or author only if they help retrieval or handoff.
185
+
186
+ Ready to save when:
187
+
188
+ - the note body captures the important point
189
+ - the links are clear
190
+ - durability versus ephemeral memory is clear when relevant
191
+
192
+ Preferred opening question:
193
+
194
+ - "What feels important to preserve from this?"
195
+
196
+ ## Insight
197
+
198
+ Aim: capture one grounded observation or recommendation clearly enough that it remains useful later.
199
+
200
+ Arc:
201
+
202
+ 1. Ask what pattern, tension, or observation should be remembered.
203
+ 2. Ask what entity or timeframe it belongs to, if any.
204
+ 3. Ask what recommendation, caution, or invitation should remain explicit.
205
+
206
+ Ready to save when:
207
+
208
+ - the observation has a stable title or phrase
209
+ - the summary is clear
210
+ - the recommendation is explicit
211
+
212
+ Preferred opening question:
213
+
214
+ - "What is the clearest thing you want future-you or the agent to remember from this?"
215
+
216
+ ## Calendar Event
217
+
218
+ Aim: make the event legible as a real commitment in time, with the right timezone and links.
219
+
220
+ Arc:
221
+
222
+ 1. Ask what the event is.
223
+ 2. Ask when it starts and ends in local time.
224
+ 3. Ask where it belongs or what it supports.
225
+ 4. Ask whether it should stay Forge-only only if that choice matters.
226
+
227
+ Ready to save when:
228
+
229
+ - the title is clear
230
+ - the start and end are clear in the user's timezone
231
+ - any important links or storage preference are known
232
+
233
+ Preferred opening question:
234
+
235
+ - "What is the event, and when should it happen in your local time?"
236
+
237
+ ## Work Block Template
238
+
239
+ Aim: define a reusable availability rule, not a one-off event.
240
+
241
+ Arc:
242
+
243
+ 1. Ask what kind of block it is and what it should be called.
244
+ 2. Ask on which days and at what local times it should repeat.
245
+ 3. Ask whether it allows or blocks work.
246
+ 4. Ask whether it has a start or end date.
247
+
248
+ Ready to save when:
249
+
250
+ - the block has a clear purpose
251
+ - recurrence timing is clear
252
+ - blocking state is clear
253
+
254
+ Preferred opening question:
255
+
256
+ - "What recurring block do you want to set up, and when should it repeat?"
257
+
258
+ ## Task Timebox
259
+
260
+ Aim: reserve real time for one task without confusing planned work with completed work.
261
+
262
+ Arc:
263
+
264
+ 1. Ask which task the slot belongs to.
265
+ 2. Ask when the slot should start and end.
266
+ 3. Ask whether this is a manual reservation, a suggestion, or a live-run alignment only if relevant.
267
+ 4. Ask about override reason only if calendar rules are being bypassed.
268
+
269
+ Ready to save when:
270
+
271
+ - the task is known
272
+ - the time window is clear
273
+ - any special scheduling context is explicit
274
+
275
+ Preferred opening question:
276
+
277
+ - "Which task are you trying to make time for, and when should the slot be?"
278
+
279
+ ## Task Run
280
+
281
+ Aim: start truthful live work with as little friction as possible while still knowing
282
+ what is being worked on and by whom.
283
+
284
+ Arc:
285
+
286
+ 1. Confirm the task.
287
+ 2. Confirm the actor only if it is not already obvious.
288
+ 3. Ask whether the run should be planned or unlimited only if that changes the action.
289
+ 4. Start the run instead of turning it into intake.
290
+
291
+ Ready to start when:
292
+
293
+ - the task is identified clearly enough
294
+ - the actor is clear enough
295
+ - any timer mode choice that matters is explicit
296
+
297
+ Preferred opening question:
298
+
299
+ - "Which task should I start?"
300
+
301
+ ## Event Type
302
+
303
+ Aim: create a reusable incident category that will actually help future reports stay consistent.
304
+
305
+ Arc:
306
+
307
+ 1. Ask what category the label should capture.
308
+ 2. Ask how narrow or broad it should be.
309
+ 3. Ask for a short description only if the label could be ambiguous later.
310
+
311
+ Ready to save when:
312
+
313
+ - the label is stable
314
+ - the category boundary is clear enough to reuse
315
+
316
+ Preferred opening question:
317
+
318
+ - "What kind of incident should this category stand for?"
319
+
320
+ ## Emotion Definition
321
+
322
+ Aim: create a reusable emotion label with enough clarity to use consistently later.
323
+
324
+ Arc:
325
+
326
+ 1. Ask what emotion label the user wants to preserve.
327
+ 2. Ask what distinguishes it from nearby emotions.
328
+ 3. Ask for a broader category only if it will help later browsing or reporting.
329
+
330
+ Ready to save when:
331
+
332
+ - the label is stable
333
+ - the meaning is clear enough to reuse
334
+
335
+ Preferred opening question:
336
+
337
+ - "What emotion label do you want to keep reusable in Forge?"