@ijfw/memory-server 1.5.0 → 1.5.1

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/bin/ijfw-memorize CHANGED
@@ -4,9 +4,13 @@
4
4
  // payload on stdin (Stop-hook json), produces structured memory entries,
5
5
  // and appends them to .ijfw/memory/knowledge.md via the existing store helpers.
6
6
  //
7
- // Deterministic by default: feedback/signals promote 1:1. LLM-based synthesis
8
- // activates only when IJFW_AUTOMEM_MODEL is set (documented as a wiring point;
9
- // current build emits a TODO marker instead of calling an LLM).
7
+ // Deterministic by default: feedback/signals promote 1:1 directly into
8
+ // knowledge.md -- this is the fully-functional production path. When
9
+ // IJFW_AUTOMEM_MODEL is set, an additional LLM-synthesis path runs: it
10
+ // appends a {pending:true} record to .ijfw/.automem-llm-queue.jsonl for
11
+ // later batch processing. That is a deliberate deferred-queue design (the
12
+ // queue decouples session-end from the LLM call) -- NOT an unimplemented
13
+ // stub. It never writes literal TODO text into user memory.
10
14
  //
11
15
  // Consent: reads .ijfw/.automem-consent. If absent or consented=false, exits 0
12
16
  // silently. User sets consent via `/ijfw memory consent yes|no|ask`.
@@ -241,11 +245,14 @@ async function main() {
241
245
  thisRunSummaries.add(capped.summary);
242
246
  }
243
247
 
244
- // TODO: LLM-synthesis path (IJFW_AUTOMEM_MODEL). Stub emits a marker
245
- // so downstream tooling can detect that a richer synthesis could run.
248
+ // LLM-synthesis path (IJFW_AUTOMEM_MODEL). When a model is configured,
249
+ // enqueue a {pending:true} record onto .ijfw/.automem-llm-queue.jsonl for
250
+ // batch processing by the LLM-synthesis worker. This is a deliberate
251
+ // deferred-queue design -- the queue decouples the latency-sensitive
252
+ // session-end hook from the LLM round-trip -- not an unimplemented stub.
253
+ // Nothing here is written into user memory (knowledge.md); the queue file
254
+ // is a separate, internal work list.
246
255
  if (process.env.IJFW_AUTOMEM_MODEL && process.env.IJFW_AUTOMEM_MODEL !== 'off') {
247
- // Wiring point -- Phase 5+ connects this to Anthropic SDK / Ollama.
248
- // For now, record the opportunity.
249
256
  try {
250
257
  mkdirSync(IJFW_DIR, { recursive: true });
251
258
  appendFileSync(join(IJFW_DIR, '.automem-llm-queue.jsonl'),
@@ -5,7 +5,7 @@
5
5
  "project_archetypes": ["book"],
6
6
  "roles": [
7
7
  {
8
- "name": "chapter-writer",
8
+ "name": "ijfw-line-editor",
9
9
  "role_type": "book",
10
10
  "model": "sonnet",
11
11
  "effort": "medium",
@@ -16,7 +16,7 @@
16
16
  "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": ["manuscript/chapters/**"]}
17
17
  },
18
18
  {
19
- "name": "continuity-editor",
19
+ "name": "ijfw-narrative-continuity-checker",
20
20
  "role_type": "review",
21
21
  "model": "sonnet",
22
22
  "effort": "medium",
@@ -32,8 +32,8 @@
32
32
  "schema_version": "team-workflow/v1",
33
33
  "project_archetypes": ["book"],
34
34
  "artifacts": [
35
- {"id": "chapter-draft", "type": "chapter", "paths": ["manuscript/chapters/ch01.md"], "owner": "chapter-writer", "reviewers": ["continuity-editor"], "depends_on": [], "verification": ["continuity review"]},
36
- {"id": "continuity-notes", "type": "continuity_notes", "paths": ["manuscript/notes/continuity.md"], "owner": "continuity-editor", "reviewers": ["chapter-writer"], "depends_on": ["chapter-draft"], "verification": ["open thread audit"]}
35
+ {"id": "chapter-draft", "type": "chapter", "paths": ["manuscript/chapters/ch01.md"], "owner": "ijfw-line-editor", "reviewers": ["ijfw-narrative-continuity-checker"], "depends_on": [], "verification": ["continuity review"]},
36
+ {"id": "continuity-notes", "type": "continuity_notes", "paths": ["manuscript/notes/continuity.md"], "owner": "ijfw-narrative-continuity-checker", "reviewers": ["ijfw-line-editor"], "depends_on": ["chapter-draft"], "verification": ["open thread audit"]}
37
37
  ],
38
38
  "waves": [
39
39
  {"id": "w1", "mode": "parallel", "artifact_ids": ["chapter-draft"]},
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "blackboard": {
44
- "tasks": [{"id": "task-chapter", "title": "Draft chapter one", "status": "ready", "artifact_ids": ["chapter-draft"], "owner": "chapter-writer"}],
45
- "claims": [{"id": "claim-chapter", "artifact_id": "chapter-draft", "agent": "chapter-writer", "status": "active", "paths": ["manuscript/chapters/ch01.md"]}]
44
+ "tasks": [{"id": "task-chapter", "title": "Draft chapter one", "status": "ready", "artifact_ids": ["chapter-draft"], "owner": "ijfw-line-editor"}],
45
+ "claims": [{"id": "claim-chapter", "artifact_id": "chapter-draft", "agent": "ijfw-line-editor", "status": "active", "paths": ["manuscript/chapters/ch01.md"]}]
46
46
  }
47
47
  }
@@ -2,46 +2,172 @@
2
2
  "charter": {
3
3
  "schema_version": "team-charter/v1",
4
4
  "team_name": "strategy-operations-team",
5
- "project_archetypes": ["business"],
5
+ "project_archetypes": [
6
+ "business"
7
+ ],
6
8
  "roles": [
7
9
  {
8
- "name": "strategy-lead",
10
+ "name": "ijfw-strategy-lead",
9
11
  "role_type": "business",
10
12
  "model": "sonnet",
11
13
  "effort": "medium",
12
- "phase_scope": ["diagnose", "plan", "decide"],
13
- "owns": [{"artifact_type": "strategy_doc", "paths": ["strategy/**"]}],
14
- "reviews": [{"artifact_type": "risk_register", "criteria": ["assumptions", "decision-quality"]}],
15
- "handoff": {"format": "markdown", "required_sections": ["recommendation", "assumptions", "tradeoffs"]},
16
- "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": []}
14
+ "phase_scope": [
15
+ "diagnose",
16
+ "plan",
17
+ "decide"
18
+ ],
19
+ "owns": [
20
+ {
21
+ "artifact_type": "strategy_doc",
22
+ "paths": [
23
+ "strategy/**"
24
+ ]
25
+ }
26
+ ],
27
+ "reviews": [
28
+ {
29
+ "artifact_type": "risk_register",
30
+ "criteria": [
31
+ "assumptions",
32
+ "decision-quality"
33
+ ]
34
+ }
35
+ ],
36
+ "handoff": {
37
+ "format": "markdown",
38
+ "required_sections": [
39
+ "recommendation",
40
+ "assumptions",
41
+ "tradeoffs"
42
+ ]
43
+ },
44
+ "coordination": {
45
+ "parallel_safe": true,
46
+ "claim_required": true,
47
+ "conflicts_with": []
48
+ }
17
49
  },
18
50
  {
19
- "name": "risk-reviewer",
51
+ "name": "ijfw-risk-reviewer",
20
52
  "role_type": "review",
21
53
  "model": "sonnet",
22
54
  "effort": "medium",
23
- "phase_scope": ["review", "verify"],
24
- "owns": [{"artifact_type": "risk_register", "paths": ["strategy/risks/**"]}],
25
- "reviews": [{"artifact_type": "strategy_doc", "criteria": ["feasibility", "downside", "metrics"]}],
26
- "handoff": {"format": "markdown", "required_sections": ["risks", "mitigations", "decision_points"]},
27
- "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": []}
55
+ "phase_scope": [
56
+ "review",
57
+ "verify"
58
+ ],
59
+ "owns": [
60
+ {
61
+ "artifact_type": "risk_register",
62
+ "paths": [
63
+ "strategy/risks/**"
64
+ ]
65
+ }
66
+ ],
67
+ "reviews": [
68
+ {
69
+ "artifact_type": "strategy_doc",
70
+ "criteria": [
71
+ "feasibility",
72
+ "downside",
73
+ "metrics"
74
+ ]
75
+ }
76
+ ],
77
+ "handoff": {
78
+ "format": "markdown",
79
+ "required_sections": [
80
+ "risks",
81
+ "mitigations",
82
+ "decision_points"
83
+ ]
84
+ },
85
+ "coordination": {
86
+ "parallel_safe": true,
87
+ "claim_required": true,
88
+ "conflicts_with": []
89
+ }
28
90
  }
29
91
  ]
30
92
  },
31
93
  "workflow": {
32
94
  "schema_version": "team-workflow/v1",
33
- "project_archetypes": ["business"],
95
+ "project_archetypes": [
96
+ "business"
97
+ ],
34
98
  "artifacts": [
35
- {"id": "operating-plan", "type": "strategy_doc", "paths": ["strategy/operating-plan.md"], "owner": "strategy-lead", "reviewers": ["risk-reviewer"], "depends_on": [], "verification": ["decision review"]},
36
- {"id": "risk-register", "type": "risk_register", "paths": ["strategy/risks/register.md"], "owner": "risk-reviewer", "reviewers": ["strategy-lead"], "depends_on": ["operating-plan"], "verification": ["assumption audit"]}
99
+ {
100
+ "id": "operating-plan",
101
+ "type": "strategy_doc",
102
+ "paths": [
103
+ "strategy/operating-plan.md"
104
+ ],
105
+ "owner": "ijfw-strategy-lead",
106
+ "reviewers": [
107
+ "ijfw-risk-reviewer"
108
+ ],
109
+ "depends_on": [],
110
+ "verification": [
111
+ "decision review"
112
+ ]
113
+ },
114
+ {
115
+ "id": "risk-register",
116
+ "type": "risk_register",
117
+ "paths": [
118
+ "strategy/risks/register.md"
119
+ ],
120
+ "owner": "ijfw-risk-reviewer",
121
+ "reviewers": [
122
+ "ijfw-strategy-lead"
123
+ ],
124
+ "depends_on": [
125
+ "operating-plan"
126
+ ],
127
+ "verification": [
128
+ "assumption audit"
129
+ ]
130
+ }
37
131
  ],
38
132
  "waves": [
39
- {"id": "w1", "mode": "sequential", "artifact_ids": ["operating-plan"]},
40
- {"id": "w2", "mode": "review", "artifact_ids": ["risk-register"]}
133
+ {
134
+ "id": "w1",
135
+ "mode": "sequential",
136
+ "artifact_ids": [
137
+ "operating-plan"
138
+ ]
139
+ },
140
+ {
141
+ "id": "w2",
142
+ "mode": "review",
143
+ "artifact_ids": [
144
+ "risk-register"
145
+ ]
146
+ }
41
147
  ]
42
148
  },
43
149
  "blackboard": {
44
- "tasks": [{"id": "task-plan", "title": "Draft operating plan", "status": "ready", "artifact_ids": ["operating-plan"], "owner": "strategy-lead"}],
45
- "claims": [{"id": "claim-plan", "artifact_id": "operating-plan", "agent": "strategy-lead", "status": "active", "paths": ["strategy/operating-plan.md"]}]
150
+ "tasks": [
151
+ {
152
+ "id": "task-plan",
153
+ "title": "Draft operating plan",
154
+ "status": "ready",
155
+ "artifact_ids": [
156
+ "operating-plan"
157
+ ],
158
+ "owner": "ijfw-strategy-lead"
159
+ }
160
+ ],
161
+ "claims": [
162
+ {
163
+ "id": "claim-plan",
164
+ "artifact_id": "operating-plan",
165
+ "agent": "ijfw-strategy-lead",
166
+ "status": "active",
167
+ "paths": [
168
+ "strategy/operating-plan.md"
169
+ ]
170
+ }
171
+ ]
46
172
  }
47
173
  }
@@ -5,7 +5,7 @@
5
5
  "project_archetypes": ["content"],
6
6
  "roles": [
7
7
  {
8
- "name": "content-strategist",
8
+ "name": "ijfw-campaign-strategist",
9
9
  "role_type": "content",
10
10
  "model": "sonnet",
11
11
  "effort": "medium",
@@ -16,7 +16,7 @@
16
16
  "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": []}
17
17
  },
18
18
  {
19
- "name": "editor",
19
+ "name": "ijfw-copy-reviewer",
20
20
  "role_type": "review",
21
21
  "model": "sonnet",
22
22
  "effort": "medium",
@@ -32,8 +32,8 @@
32
32
  "schema_version": "team-workflow/v1",
33
33
  "project_archetypes": ["content"],
34
34
  "artifacts": [
35
- {"id": "campaign-brief", "type": "brief", "paths": ["content/briefs/campaign.md"], "owner": "content-strategist", "reviewers": ["editor"], "depends_on": [], "verification": ["brand voice review"]},
36
- {"id": "article-draft", "type": "article", "paths": ["content/posts/*.mdx"], "owner": "editor", "reviewers": ["content-strategist"], "depends_on": ["campaign-brief"], "verification": ["seo checklist"]}
35
+ {"id": "campaign-brief", "type": "brief", "paths": ["content/briefs/campaign.md"], "owner": "ijfw-campaign-strategist", "reviewers": ["ijfw-copy-reviewer"], "depends_on": [], "verification": ["brand voice review"]},
36
+ {"id": "article-draft", "type": "article", "paths": ["content/posts/*.mdx"], "owner": "ijfw-copy-reviewer", "reviewers": ["ijfw-campaign-strategist"], "depends_on": ["campaign-brief"], "verification": ["seo checklist"]}
37
37
  ],
38
38
  "waves": [
39
39
  {"id": "w1", "mode": "sequential", "artifact_ids": ["campaign-brief"]},
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "blackboard": {
44
- "tasks": [{"id": "task-brief", "title": "Prepare campaign brief", "status": "ready", "artifact_ids": ["campaign-brief"], "owner": "content-strategist"}],
45
- "claims": [{"id": "claim-brief", "artifact_id": "campaign-brief", "agent": "content-strategist", "status": "active", "paths": ["content/briefs/campaign.md"]}]
44
+ "tasks": [{"id": "task-brief", "title": "Prepare campaign brief", "status": "ready", "artifact_ids": ["campaign-brief"], "owner": "ijfw-campaign-strategist"}],
45
+ "claims": [{"id": "claim-brief", "artifact_id": "campaign-brief", "agent": "ijfw-campaign-strategist", "status": "active", "paths": ["content/briefs/campaign.md"]}]
46
46
  }
47
47
  }
@@ -2,46 +2,174 @@
2
2
  "charter": {
3
3
  "schema_version": "team-charter/v1",
4
4
  "team_name": "design-studio-team",
5
- "project_archetypes": ["design"],
5
+ "project_archetypes": [
6
+ "design"
7
+ ],
6
8
  "roles": [
7
9
  {
8
- "name": "product-designer",
10
+ "name": "ijfw-design-critic",
9
11
  "role_type": "design",
10
12
  "model": "sonnet",
11
13
  "effort": "medium",
12
- "phase_scope": ["discovery", "shape", "execute"],
13
- "owns": [{"artifact_type": "screen", "paths": ["design/screens/**"]}],
14
- "reviews": [{"artifact_type": "prototype", "criteria": ["usability", "accessibility"]}],
15
- "handoff": {"format": "markdown", "required_sections": ["rationale", "changed_artifacts", "open_questions"]},
16
- "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": ["design/tokens/**"]}
14
+ "phase_scope": [
15
+ "discovery",
16
+ "shape",
17
+ "execute"
18
+ ],
19
+ "owns": [
20
+ {
21
+ "artifact_type": "screen",
22
+ "paths": [
23
+ "design/screens/**"
24
+ ]
25
+ }
26
+ ],
27
+ "reviews": [
28
+ {
29
+ "artifact_type": "prototype",
30
+ "criteria": [
31
+ "usability",
32
+ "accessibility"
33
+ ]
34
+ }
35
+ ],
36
+ "handoff": {
37
+ "format": "markdown",
38
+ "required_sections": [
39
+ "rationale",
40
+ "changed_artifacts",
41
+ "open_questions"
42
+ ]
43
+ },
44
+ "coordination": {
45
+ "parallel_safe": true,
46
+ "claim_required": true,
47
+ "conflicts_with": [
48
+ "design/tokens/**"
49
+ ]
50
+ }
17
51
  },
18
52
  {
19
- "name": "visual-qa",
53
+ "name": "ijfw-accessibility-reviewer",
20
54
  "role_type": "review",
21
55
  "model": "sonnet",
22
56
  "effort": "low",
23
- "phase_scope": ["review", "verify"],
24
- "owns": [{"artifact_type": "audit", "paths": ["design/reviews/**"]}],
25
- "reviews": [{"artifact_type": "screen", "criteria": ["layout", "contrast", "responsive-fit"]}],
26
- "handoff": {"format": "markdown", "required_sections": ["findings", "severity", "recommendations"]},
27
- "coordination": {"parallel_safe": true, "claim_required": true, "conflicts_with": []}
57
+ "phase_scope": [
58
+ "review",
59
+ "verify"
60
+ ],
61
+ "owns": [
62
+ {
63
+ "artifact_type": "audit",
64
+ "paths": [
65
+ "design/reviews/**"
66
+ ]
67
+ }
68
+ ],
69
+ "reviews": [
70
+ {
71
+ "artifact_type": "screen",
72
+ "criteria": [
73
+ "layout",
74
+ "contrast",
75
+ "responsive-fit"
76
+ ]
77
+ }
78
+ ],
79
+ "handoff": {
80
+ "format": "markdown",
81
+ "required_sections": [
82
+ "findings",
83
+ "severity",
84
+ "recommendations"
85
+ ]
86
+ },
87
+ "coordination": {
88
+ "parallel_safe": true,
89
+ "claim_required": true,
90
+ "conflicts_with": []
91
+ }
28
92
  }
29
93
  ]
30
94
  },
31
95
  "workflow": {
32
96
  "schema_version": "team-workflow/v1",
33
- "project_archetypes": ["design"],
97
+ "project_archetypes": [
98
+ "design"
99
+ ],
34
100
  "artifacts": [
35
- {"id": "screen-system", "type": "screen", "paths": ["design/screens/**"], "owner": "product-designer", "reviewers": ["visual-qa"], "depends_on": [], "verification": ["visual audit"]},
36
- {"id": "design-review", "type": "audit", "paths": ["design/reviews/**"], "owner": "visual-qa", "reviewers": ["product-designer"], "depends_on": ["screen-system"], "verification": ["accessibility checklist"]}
101
+ {
102
+ "id": "screen-system",
103
+ "type": "screen",
104
+ "paths": [
105
+ "design/screens/**"
106
+ ],
107
+ "owner": "ijfw-design-critic",
108
+ "reviewers": [
109
+ "ijfw-accessibility-reviewer"
110
+ ],
111
+ "depends_on": [],
112
+ "verification": [
113
+ "visual audit"
114
+ ]
115
+ },
116
+ {
117
+ "id": "design-review",
118
+ "type": "audit",
119
+ "paths": [
120
+ "design/reviews/**"
121
+ ],
122
+ "owner": "ijfw-accessibility-reviewer",
123
+ "reviewers": [
124
+ "ijfw-design-critic"
125
+ ],
126
+ "depends_on": [
127
+ "screen-system"
128
+ ],
129
+ "verification": [
130
+ "accessibility checklist"
131
+ ]
132
+ }
37
133
  ],
38
134
  "waves": [
39
- {"id": "w1", "mode": "parallel", "artifact_ids": ["screen-system"]},
40
- {"id": "w2", "mode": "review", "artifact_ids": ["design-review"]}
135
+ {
136
+ "id": "w1",
137
+ "mode": "parallel",
138
+ "artifact_ids": [
139
+ "screen-system"
140
+ ]
141
+ },
142
+ {
143
+ "id": "w2",
144
+ "mode": "review",
145
+ "artifact_ids": [
146
+ "design-review"
147
+ ]
148
+ }
41
149
  ]
42
150
  },
43
151
  "blackboard": {
44
- "tasks": [{"id": "task-screens", "title": "Draft core screens", "status": "ready", "artifact_ids": ["screen-system"], "owner": "product-designer"}],
45
- "claims": [{"id": "claim-screens", "artifact_id": "screen-system", "agent": "product-designer", "status": "active", "paths": ["design/screens/**"]}]
152
+ "tasks": [
153
+ {
154
+ "id": "task-screens",
155
+ "title": "Draft core screens",
156
+ "status": "ready",
157
+ "artifact_ids": [
158
+ "screen-system"
159
+ ],
160
+ "owner": "ijfw-design-critic"
161
+ }
162
+ ],
163
+ "claims": [
164
+ {
165
+ "id": "claim-screens",
166
+ "artifact_id": "screen-system",
167
+ "agent": "ijfw-design-critic",
168
+ "status": "active",
169
+ "paths": [
170
+ "design/screens/**"
171
+ ]
172
+ }
173
+ ]
46
174
  }
47
175
  }