// Track goal progress, derive state from execution, identify gaps, trigger actions. Use for goal status checks, progress reviews, and operational goal management.
| name | goal-tracker |
| description | Track goal progress, derive state from execution, identify gaps, trigger actions. Use for goal status checks, progress reviews, and operational goal management. |
Derive goal state from execution, track progress, identify gaps, trigger actions.
Goals are the primary operating mode for LeanOS. Tracker maintains goal state.
PROACTIVE (primary): Goal โ Plan โ Threads โ Artifacts โ Learning โ Canvas
โ
goal-tracker derives state from here
Goal-tracker reads:
Goal-tracker writes:
GoalTracker : Goal ร Threads ร Time โ UpdatedGoal ร [Action]
Where:
Goal : strategy/goals/active/{id}.md
Threads : threads/{type}/{name}/ (linked to goal)
Time : Current date for trajectory calculation
UpdatedGoal : Goal with refreshed State section
Action : Recommended or auto-executed intervention
State is computed, not manually tracked. Derive from execution:
For goal G:
1. Find linked threads:
- Scan G.Plan.Subgoals[*].Threads
- Load each thread's current state
2. Aggregate execution metrics:
threads_active = count(thread.status == "active")
threads_completed = count(thread.status == "completed")
threads_blocked = count(thread.status == "blocked")
3. Extract outcome metrics:
For each completed thread:
Read Stage 6 (Learning) outcomes
Map to goal success criteria
4. Calculate derived metrics:
For each success criterion:
current = sum/count from thread outcomes
gap = target - current
trend = compare to previous state (โโโ)
For each subgoal SG:
If SG.Threads is empty:
status = "pending"
Else if any(thread.status == "active"):
status = "in_progress"
Else if all(thread.status == "completed") AND SG.Success met:
status = "completed"
Else if any(thread.status == "blocked"):
status = "blocked"
For each milestone M:
If M.criterion is satisfied:
Mark [x] completed
Log completion date
Given:
current = current metric value
target = target metric value
start_date = goal.created
deadline = goal.deadline
today = current date
Calculate:
elapsed = today - start_date
remaining = deadline - today
progress_rate = (current - initial) / elapsed
projected_final = current + (progress_rate ร remaining)
Determine:
on_track = projected_final >= target
projected_completion = start_date + ((target - initial) / progress_rate)
Risk level:
Low = on_track AND remaining > 30 days
Medium = on_track AND remaining <= 30 days
High = NOT on_track
Critical = NOT on_track AND remaining <= 14 days
For each success criterion:
gap = target - current
gap_percent = gap / target ร 100
If gap_percent > 50%:
Flag: "Significant gap on {criterion}"
If trend == "โ" AND gap_percent > 20%:
Flag: "Declining metric: {criterion}"
Based on gaps and autonomy mode:
If gap detected AND goal.autonomy allows:
For autonomy == "auto":
Create thread directly
Log: "Auto-created thread {id} to address {gap}"
For autonomy == "ask":
Generate recommendation
Present to user with options
For autonomy == "hybrid":
Calculate action impact
If impact < 0.5: auto-create
If impact >= 0.5: ask user
Action types:
| Gap Type | Recommended Action |
|---|---|
| Pipeline gap | Create outbound campaign thread |
| Conversion gap | Create optimization thread |
| Content gap | Create content thread |
| Technical gap | Create engineering thread |
| Knowledge gap | Create learning thread |
Update strategy/goals/active/{goal-id}.md:
## State
### Metrics
| Metric | Current | Target | Gap | Trend |
|--------|---------|--------|-----|-------|
| MRR | $12,500 | $50,000 | $37,500 | โ |
| Customers | 6 | 10 | 4 | โ |
| Pipeline | 12 | 20 | 8 | โ |
### Execution
- **Active threads:** 3 (campaign-q1, sales-process, content-linkedin)
- **Completed threads:** 5
- **Blocked:** 1 (waiting on legal review)
### Trajectory
- **On track:** No
- **Projected completion:** 2025-07-15 (15 days late)
- **Risk level:** Medium
## Log
- {previous entries}
- {today}: State updated. MRR +$2,500. Pipeline stalled. Risk: Medium.
# Goal Progress: {Goal Title}
**Status:** {On Track | At Risk | Off Track}
**Progress:** {X}% toward objective
**Time remaining:** {N} days
## Metrics Summary
{Table of current vs target}
## What's Working
- {Positive trend 1}
- {Positive trend 2}
## Gaps Identified
- {Gap 1}: {Current} vs {Target} ({gap%} behind)
- {Gap 2}: {description}
## Recommended Actions
1. {Action 1} - addresses {gap}
2. {Action 2} - addresses {gap}
## Subgoal Status
- [x] SG1: {completed}
- [โ] SG2: {in progress}
- [ ] SG3: {pending}
## Next Milestone
{Milestone description} - due {date} ({N} days)
Trigger: User asks for status, or periodic review
1. Load all active goals
2. For each goal:
a. Derive current state
b. Check trajectory
c. Identify gaps and risks
3. Generate snapshot report (see Output section)
4. Present recommendations
5. Execute auto actions if autonomy allows
No daily file generated. Snapshot is computed on-demand, not stored. Goals themselves are the persistent state - snapshot is a derived view.
Trigger: Thread reaches Stage 6 (Learning)
1. Find goal linked to thread
2. Update subgoal status
3. Extract metrics from thread learning
4. Update goal state
5. Check if goal completed
6. If completed: move to strategy/goals/completed/
Trigger: User asks about goal progress
1. Load specified goal (or all if unspecified)
2. Derive current state
3. Generate progress report
4. Present with recommendations if gaps exist
Trigger: All success criteria met
1. Mark goal status: completed
2. Update all subgoals: completed
3. Mark remaining milestones
4. Add completion log entry
5. Move file to strategy/goals/completed/
6. Generate completion summary
7. Identify follow-on goals if any
meta.json contains goal_id and subgoal referenceGap detected โ Create thread โ Execute โ Log
No user interaction unless error
Gap detected โ Generate recommendation โ Present options:
[1] Create suggested thread
[2] Modify recommendation
[3] Ignore for now
[4] Pause goal
Gap detected โ Calculate impact:
- Cost of action
- Time commitment
- Risk level
Impact < 0.5 โ Auto mode
Impact >= 0.5 โ Ask mode
No linked threads:
Warning: "Goal {id} has no execution threads.
Subgoals defined but not activated.
Recommend: Create initial threads for SG1."
Stale goal (no updates >14 days):
Warning: "Goal {id} has no activity for {N} days.
Options: (1) Review and update, (2) Pause goal, (3) Abandon goal"
Conflicting metrics:
Warning: "Metric {name} has conflicting values from threads.
Thread A: {value}, Thread B: {value}
Using: {resolution strategy}"
Goal deadline passed:
Alert: "Goal {id} deadline was {date}.
Status: {achieved | not achieved}
Options: (1) Extend deadline, (2) Mark completed as-is, (3) Abandon"