ticlawk 0.1.17-dev.6 → 0.1.17-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -15,10 +15,11 @@ import { buildEnvelopeTarget, buildCharterBlock } from './wake-prompt.mjs';
|
|
|
15
15
|
const STEP_GUIDES = {
|
|
16
16
|
gap_analysis: {
|
|
17
17
|
title: 'GAP ANALYSIS',
|
|
18
|
-
body: `Compare the current state
|
|
19
|
-
-
|
|
20
|
-
- If
|
|
21
|
-
- If
|
|
18
|
+
body: `Compare the current state against the goal and success criteria. The [goal_context] block above gives you the open tasks, active reminders, and dashboard state — judge from it; read the charter/repo/prior messages only for what it doesn't cover. The dashboard is the owner's at-a-glance visualization of how far this goal has progressed — this step owns keeping it true to reality: create it if a durable goal has none, refresh it when progress moved materially (\`ticlawk dashboard set\`; see SURFACES.md).
|
|
19
|
+
- Judge "due now" against the current owner-local time above. Produce only what is due now; do NOT pre-produce future occurrences (a later meal, tomorrow's item) — each one is produced when its own reminder fires and wakes you at that time.
|
|
20
|
+
- If there is concrete work to do NOW, make sure the next unit exists as a task (\`ticlawk task ...\`), then report outcome=gap.
|
|
21
|
+
- If nothing needs doing this instant but the goal is ONGOING/STANDING — its job is to keep something maintained and work recurs (e.g. an active recurring reminder above already covers the next occurrence) — report outcome=wait. Do NOT report no_gap for a standing goal: it has no "done", and parking on no_gap would stop it from waking at the next occurrence. If nothing is scheduled to resume it yet, schedule a reminder first, then report wait.
|
|
22
|
+
- Report outcome=no_gap ONLY if the goal is genuinely, permanently met and will never need action again (an achievement goal that is finished). The completed result is something the owner is waiting on — surface it per the briefing rule below.`,
|
|
22
23
|
outcomes: ['gap', 'no_gap', 'wait'],
|
|
23
24
|
},
|
|
24
25
|
execute: {
|
|
@@ -48,6 +49,34 @@ function readPayload(msg) {
|
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
// Per-step context: the claim attaches msg.goal_context (open tasks, active
|
|
53
|
+
// reminders, current task, dashboard) for transition deliveries. Render the
|
|
54
|
+
// slice THIS step needs so each step decides on facts, not guesses.
|
|
55
|
+
function buildGoalContextBlock(msg, step) {
|
|
56
|
+
const gc = msg && msg.goal_context && typeof msg.goal_context === 'object' ? msg.goal_context : null;
|
|
57
|
+
if (!gc) return '';
|
|
58
|
+
const lines = ['[goal_context] Current state for this goal (given to you — use it, do not re-derive):'];
|
|
59
|
+
if (gc.now_local) {
|
|
60
|
+
lines.push(`- current time (owner local): ${gc.now_local}${gc.timezone ? ` [${gc.timezone}]` : ''}`);
|
|
61
|
+
}
|
|
62
|
+
if (step === 'gap_analysis' || !STEP_GUIDES[step]) {
|
|
63
|
+
const tasks = Array.isArray(gc.open_tasks) ? gc.open_tasks : [];
|
|
64
|
+
const rems = Array.isArray(gc.active_reminders) ? gc.active_reminders : [];
|
|
65
|
+
lines.push(`- open tasks (${tasks.length}): ${tasks.length
|
|
66
|
+
? tasks.map((t) => `#${t.number} ${t.title} [${t.status}]`).join('; ')
|
|
67
|
+
: 'none'}`);
|
|
68
|
+
lines.push(`- active reminders (${rems.length}): ${rems.length
|
|
69
|
+
? rems.map((r) => `"${r.title}" @ ${r.fire_at}${r.recurrence ? ' (recurring)' : ''}`).join('; ')
|
|
70
|
+
: 'none'}`);
|
|
71
|
+
lines.push(`- dashboard: ${gc.dashboard ? 'exists' : 'none yet'}`);
|
|
72
|
+
} else {
|
|
73
|
+
const ct = gc.current_task;
|
|
74
|
+
lines.push(ct ? `- current task: #${ct.number} ${ct.title} [${ct.status}]` : '- current task: (none set)');
|
|
75
|
+
}
|
|
76
|
+
lines.push('[/goal_context]');
|
|
77
|
+
return lines.join('\n');
|
|
78
|
+
}
|
|
79
|
+
|
|
51
80
|
function buildGoalStepHeader(msg, { step, transitionId, goalVersion, kind }) {
|
|
52
81
|
const target = buildEnvelopeTarget(msg);
|
|
53
82
|
const time = msg.created_at || new Date().toISOString();
|
|
@@ -66,6 +95,8 @@ export function buildGoalStepPrompt(msg) {
|
|
|
66
95
|
|
|
67
96
|
const sections = [];
|
|
68
97
|
if (charterBlock) sections.push(charterBlock);
|
|
98
|
+
const goalContextBlock = buildGoalContextBlock(msg, step);
|
|
99
|
+
if (goalContextBlock) sections.push(goalContextBlock);
|
|
69
100
|
|
|
70
101
|
if (guide) {
|
|
71
102
|
sections.push([
|