@cleocode/core 2026.3.45 → 2026.3.47

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 (154) hide show
  1. package/dist/bootstrap.d.ts.map +1 -1
  2. package/dist/index.js +1508 -377
  3. package/dist/index.js.map +4 -4
  4. package/dist/init.d.ts.map +1 -1
  5. package/dist/injection.d.ts +1 -1
  6. package/dist/injection.d.ts.map +1 -1
  7. package/dist/routing/capability-matrix.d.ts +6 -4
  8. package/dist/routing/capability-matrix.d.ts.map +1 -1
  9. package/dist/scaffold.d.ts +35 -9
  10. package/dist/scaffold.d.ts.map +1 -1
  11. package/dist/skills/agents/install.d.ts.map +1 -1
  12. package/dist/skills/routing-table.d.ts +17 -16
  13. package/dist/skills/routing-table.d.ts.map +1 -1
  14. package/dist/skills/skill-paths.d.ts.map +1 -1
  15. package/dist/system/health.d.ts.map +1 -1
  16. package/dist/ui/index.d.ts +0 -1
  17. package/dist/ui/index.d.ts.map +1 -1
  18. package/package.json +9 -4
  19. package/schemas/adr-frontmatter.schema.json +72 -0
  20. package/schemas/agent-configs.schema.json +120 -0
  21. package/schemas/agent-registry.json +243 -0
  22. package/schemas/agent-registry.schema.json +132 -0
  23. package/schemas/archive/research-manifest.schema.json +257 -0
  24. package/schemas/archive.schema.json +450 -0
  25. package/schemas/brain-decision.schema.json +69 -0
  26. package/schemas/brain-learning.schema.json +57 -0
  27. package/schemas/brain-pattern.schema.json +72 -0
  28. package/schemas/config.schema.json +2606 -0
  29. package/schemas/context-state.schema.json +137 -0
  30. package/schemas/contribution.schema.json +722 -0
  31. package/schemas/critical-path.schema.json +246 -0
  32. package/schemas/deps-cache.schema.json +97 -0
  33. package/schemas/doctor-output.schema.json +283 -0
  34. package/schemas/error.schema.json +161 -0
  35. package/schemas/export-package.schema.json +375 -0
  36. package/schemas/global-config.schema.json +219 -0
  37. package/schemas/grade.schema.json +49 -0
  38. package/schemas/log.schema.json +250 -0
  39. package/schemas/metrics.schema.json +328 -0
  40. package/schemas/migrations.schema.json +150 -0
  41. package/schemas/nexus-registry.schema.json +90 -0
  42. package/schemas/operation-constitution.schema.json +438 -0
  43. package/schemas/output.schema.json +164 -0
  44. package/schemas/project-context.schema.json +164 -0
  45. package/schemas/project-info.schema.json +180 -0
  46. package/schemas/projects-registry.schema.json +107 -0
  47. package/schemas/protocol-frontmatter.schema.json +72 -0
  48. package/schemas/rcasd-consensus-report.schema.json +10 -0
  49. package/schemas/rcasd-evidence.schema.json +42 -0
  50. package/schemas/rcasd-gate-result.schema.json +46 -0
  51. package/schemas/rcasd-hitl-resolution.schema.json +10 -0
  52. package/schemas/rcasd-index.schema.json +10 -0
  53. package/schemas/rcasd-manifest.schema.json +10 -0
  54. package/schemas/rcasd-research-output.schema.json +10 -0
  55. package/schemas/rcasd-spec-frontmatter.schema.json +10 -0
  56. package/schemas/rcasd-stage-transition.schema.json +38 -0
  57. package/schemas/releases.schema.json +267 -0
  58. package/schemas/skills-manifest.schema.json +91 -0
  59. package/schemas/skillsmp.schema.json +208 -0
  60. package/schemas/spec-index.schema.json +196 -0
  61. package/schemas/system-flow-atlas.schema.json +125 -0
  62. package/src/__tests__/injection-chain.test.d.ts +4 -3
  63. package/src/__tests__/injection-chain.test.d.ts.map +1 -1
  64. package/src/__tests__/injection-chain.test.js +11 -10
  65. package/src/__tests__/injection-chain.test.js.map +1 -1
  66. package/src/__tests__/injection-chain.test.ts +11 -10
  67. package/src/__tests__/injection-mvi-tiers.test.js +4 -2
  68. package/src/__tests__/injection-mvi-tiers.test.js.map +1 -1
  69. package/src/__tests__/injection-mvi-tiers.test.ts +4 -2
  70. package/src/agents/__tests__/capacity.test.d.ts +7 -0
  71. package/src/agents/__tests__/capacity.test.d.ts.map +1 -0
  72. package/src/agents/__tests__/capacity.test.js +173 -0
  73. package/src/agents/__tests__/capacity.test.js.map +1 -0
  74. package/src/agents/__tests__/registry.test.d.ts +8 -0
  75. package/src/agents/__tests__/registry.test.d.ts.map +1 -0
  76. package/src/agents/__tests__/registry.test.js +348 -0
  77. package/src/agents/__tests__/registry.test.js.map +1 -0
  78. package/src/agents/__tests__/retry.test.d.ts +7 -0
  79. package/src/agents/__tests__/retry.test.d.ts.map +1 -0
  80. package/src/agents/__tests__/retry.test.js +225 -0
  81. package/src/agents/__tests__/retry.test.js.map +1 -0
  82. package/src/bootstrap.ts +37 -6
  83. package/src/init.ts +63 -18
  84. package/src/injection.ts +11 -5
  85. package/src/intelligence/__tests__/impact.test.d.ts +15 -0
  86. package/src/intelligence/__tests__/impact.test.d.ts.map +1 -0
  87. package/src/intelligence/__tests__/impact.test.js +384 -0
  88. package/src/intelligence/__tests__/impact.test.js.map +1 -0
  89. package/src/intelligence/__tests__/patterns.test.d.ts +8 -0
  90. package/src/intelligence/__tests__/patterns.test.d.ts.map +1 -0
  91. package/src/intelligence/__tests__/patterns.test.js +370 -0
  92. package/src/intelligence/__tests__/patterns.test.js.map +1 -0
  93. package/src/intelligence/__tests__/prediction.test.d.ts +8 -0
  94. package/src/intelligence/__tests__/prediction.test.d.ts.map +1 -0
  95. package/src/intelligence/__tests__/prediction.test.js +314 -0
  96. package/src/intelligence/__tests__/prediction.test.js.map +1 -0
  97. package/src/nexus/__tests__/nexus-e2e.test.d.ts +12 -0
  98. package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +1 -0
  99. package/src/nexus/__tests__/nexus-e2e.test.js +1220 -0
  100. package/src/nexus/__tests__/nexus-e2e.test.js.map +1 -0
  101. package/src/nexus/__tests__/transfer.test.d.ts +8 -0
  102. package/src/nexus/__tests__/transfer.test.d.ts.map +1 -0
  103. package/src/nexus/__tests__/transfer.test.js +372 -0
  104. package/src/nexus/__tests__/transfer.test.js.map +1 -0
  105. package/src/nexus/__tests__/transfer.test.ts +1 -1
  106. package/src/routing/capability-matrix.ts +1435 -205
  107. package/src/scaffold.ts +70 -13
  108. package/src/sessions/__tests__/briefing.test.js +28 -2
  109. package/src/sessions/__tests__/briefing.test.js.map +1 -1
  110. package/src/skills/__tests__/routing-table.test.js +48 -31
  111. package/src/skills/__tests__/routing-table.test.js.map +1 -1
  112. package/src/skills/__tests__/routing-table.test.ts +53 -33
  113. package/src/skills/agents/install.ts +9 -1
  114. package/src/skills/orchestrator/__tests__/spawn-tier.test.js +41 -32
  115. package/src/skills/orchestrator/__tests__/spawn-tier.test.js.map +1 -1
  116. package/src/skills/routing-table.ts +39 -253
  117. package/src/skills/skill-paths.ts +3 -2
  118. package/src/store/__tests__/project-detect.test.js +1 -1
  119. package/src/store/__tests__/project-detect.test.js.map +1 -1
  120. package/src/store/__tests__/project-detect.test.ts +1 -1
  121. package/src/store/__tests__/test-db-helper.d.ts.map +1 -1
  122. package/src/store/__tests__/test-db-helper.js +0 -1
  123. package/src/store/__tests__/test-db-helper.js.map +1 -1
  124. package/src/system/health.ts +18 -7
  125. package/src/ui/index.ts +0 -6
  126. package/src/validation/operation-gate-validators.ts +2 -2
  127. package/templates/CLEO-INJECTION.md +120 -0
  128. package/templates/README.md +29 -0
  129. package/templates/agent-registry.json +305 -0
  130. package/templates/cleo-gitignore +74 -0
  131. package/templates/config.template.json +187 -0
  132. package/templates/git-hooks/commit-msg +149 -0
  133. package/templates/git-hooks/pre-commit +40 -0
  134. package/templates/git-hooks/pre-push +79 -0
  135. package/templates/github/ISSUE_TEMPLATE/bug_report.yml +143 -0
  136. package/templates/github/ISSUE_TEMPLATE/config.yml +8 -0
  137. package/templates/github/ISSUE_TEMPLATE/feature_request.yml +125 -0
  138. package/templates/github/ISSUE_TEMPLATE/help_question.yml +99 -0
  139. package/templates/global-config.template.json +56 -0
  140. package/templates/hooks/precompact-safestop.sh +89 -0
  141. package/templates/issue-templates/bug_report.yml +143 -0
  142. package/templates/issue-templates/config.yml +8 -0
  143. package/templates/issue-templates/feature_request.yml +125 -0
  144. package/templates/issue-templates/help_question.yml +99 -0
  145. package/templates/skillsmp.json.example +28 -0
  146. package/templates/skillsmp.json.example.md +214 -0
  147. package/dist/ui/injection-legacy.d.ts +0 -26
  148. package/dist/ui/injection-legacy.d.ts.map +0 -1
  149. package/src/ui/__tests__/injection-registry.test.d.ts +0 -11
  150. package/src/ui/__tests__/injection-registry.test.d.ts.map +0 -1
  151. package/src/ui/__tests__/injection-registry.test.js +0 -46
  152. package/src/ui/__tests__/injection-registry.test.js.map +0 -1
  153. package/src/ui/__tests__/injection-registry.test.ts +0 -57
  154. package/src/ui/injection-legacy.ts +0 -44
@@ -0,0 +1,219 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "schemaVersion": "1.0.0",
4
+ "$id": "https://cleo-dev.com/schemas/v1/global-config.schema.json",
5
+ "title": "Claude-TODO Global Configuration",
6
+ "description": "User-level global configuration for cleo CLI. These settings apply across all projects unless overridden by project-specific config.",
7
+ "type": "object",
8
+ "required": ["version"],
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string",
12
+ "description": "JSON Schema reference"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "pattern": "^\\d+\\.\\d+\\.\\d+",
17
+ "description": "Configuration schema version"
18
+ },
19
+ "output": {
20
+ "type": "object",
21
+ "description": "Output formatting preferences (applies to all commands)",
22
+ "properties": {
23
+ "defaultFormat": {
24
+ "type": "string",
25
+ "enum": ["text", "json", "jsonl", "csv", "tsv", "markdown", "table"],
26
+ "default": "text",
27
+ "description": "Default output format. Set to 'json' for LLM agent automation."
28
+ },
29
+ "showColor": {
30
+ "type": "boolean",
31
+ "default": true,
32
+ "description": "Enable colored output in terminal. Respects NO_COLOR env var."
33
+ },
34
+ "showUnicode": {
35
+ "type": "boolean",
36
+ "default": true,
37
+ "description": "Use Unicode symbols (checkmarks, progress bars, etc.)"
38
+ },
39
+ "showProgressBars": {
40
+ "type": "boolean",
41
+ "default": true,
42
+ "description": "Display progress bars for long operations"
43
+ },
44
+ "dateFormat": {
45
+ "type": "string",
46
+ "enum": ["iso8601", "relative", "unix", "locale"],
47
+ "default": "iso8601",
48
+ "description": "Date display format"
49
+ },
50
+ "showCompactTitles": {
51
+ "type": "boolean",
52
+ "default": false,
53
+ "description": "Truncate long task titles"
54
+ },
55
+ "maxTitleLength": {
56
+ "type": "integer",
57
+ "minimum": 20,
58
+ "maximum": 200,
59
+ "default": 80,
60
+ "description": "Maximum title length when compact mode is enabled"
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ },
65
+ "display": {
66
+ "type": "object",
67
+ "description": "Display preferences for status and informational output",
68
+ "properties": {
69
+ "showArchiveCount": {
70
+ "type": "boolean",
71
+ "default": true,
72
+ "description": "Show count of archived tasks in status"
73
+ },
74
+ "showLogSummary": {
75
+ "type": "boolean",
76
+ "default": true,
77
+ "description": "Show recent log summary in status"
78
+ },
79
+ "warnStaleDays": {
80
+ "type": "integer",
81
+ "minimum": 1,
82
+ "default": 30,
83
+ "description": "Warn about tasks older than this many days"
84
+ }
85
+ },
86
+ "additionalProperties": false
87
+ },
88
+ "cli": {
89
+ "type": "object",
90
+ "description": "CLI behavior and customization",
91
+ "properties": {
92
+ "aliases": {
93
+ "type": "object",
94
+ "description": "Custom command aliases (alias → command)",
95
+ "additionalProperties": {
96
+ "type": "string"
97
+ },
98
+ "default": {},
99
+ "examples": [
100
+ {"ls": "list", "done": "complete", "new": "add"}
101
+ ]
102
+ },
103
+ "plugins": {
104
+ "type": "object",
105
+ "description": "Plugin system configuration",
106
+ "properties": {
107
+ "enabled": {
108
+ "type": "boolean",
109
+ "default": true,
110
+ "description": "Enable plugin discovery and loading"
111
+ },
112
+ "directories": {
113
+ "type": "array",
114
+ "items": {"type": "string"},
115
+ "default": ["~/.cleo/plugins", "./.claude/plugins"],
116
+ "description": "Directories to search for plugins"
117
+ },
118
+ "autoDiscover": {
119
+ "type": "boolean",
120
+ "default": true,
121
+ "description": "Auto-discover plugins in plugin directories"
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ },
126
+ "debug": {
127
+ "type": "object",
128
+ "description": "Debug and diagnostic settings",
129
+ "properties": {
130
+ "enabled": {
131
+ "type": "boolean",
132
+ "default": false,
133
+ "description": "Enable debug output"
134
+ },
135
+ "validateMappings": {
136
+ "type": "boolean",
137
+ "default": true,
138
+ "description": "Validate command mappings on startup"
139
+ },
140
+ "checksumVerify": {
141
+ "type": "boolean",
142
+ "default": true,
143
+ "description": "Verify script checksums"
144
+ },
145
+ "showTimings": {
146
+ "type": "boolean",
147
+ "default": false,
148
+ "description": "Show execution timing information"
149
+ }
150
+ },
151
+ "additionalProperties": false
152
+ }
153
+ },
154
+ "additionalProperties": false
155
+ },
156
+ "defaults": {
157
+ "type": "object",
158
+ "description": "Default values for new tasks (can be overridden per-project)",
159
+ "properties": {
160
+ "priority": {
161
+ "type": "string",
162
+ "enum": ["critical", "high", "medium", "low"],
163
+ "default": "medium",
164
+ "description": "Default priority for new tasks"
165
+ },
166
+ "labels": {
167
+ "type": "array",
168
+ "items": {"type": "string"},
169
+ "default": [],
170
+ "description": "Default labels for new tasks"
171
+ }
172
+ },
173
+ "additionalProperties": false
174
+ },
175
+ "multiSession": {
176
+ "type": "object",
177
+ "description": "Multi-session configuration for concurrent agent work",
178
+ "properties": {
179
+ "enabled": {
180
+ "type": "boolean",
181
+ "default": true,
182
+ "description": "Enable multi-session support"
183
+ },
184
+ "maxConcurrentSessions": {
185
+ "type": "integer",
186
+ "minimum": 1,
187
+ "maximum": 20,
188
+ "default": 5,
189
+ "description": "Maximum concurrent sessions allowed"
190
+ },
191
+ "maxActiveTasksPerScope": {
192
+ "type": "integer",
193
+ "minimum": 1,
194
+ "maximum": 10,
195
+ "default": 1,
196
+ "description": "Maximum active tasks per session scope"
197
+ },
198
+ "scopeValidation": {
199
+ "type": "string",
200
+ "enum": ["strict", "warn", "none"],
201
+ "default": "strict",
202
+ "description": "Scope validation level"
203
+ },
204
+ "allowNestedScopes": {
205
+ "type": "boolean",
206
+ "default": true,
207
+ "description": "Allow nested session scopes"
208
+ },
209
+ "allowScopeOverlap": {
210
+ "type": "boolean",
211
+ "default": false,
212
+ "description": "Allow overlapping session scopes"
213
+ }
214
+ },
215
+ "additionalProperties": false
216
+ }
217
+ },
218
+ "additionalProperties": false
219
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "GradeResult",
4
+ "description": "Agent behavioral grade result from session audit analysis",
5
+ "_meta": {
6
+ "schemaVersion": "1.0.0"
7
+ },
8
+ "type": "object",
9
+ "required": ["sessionId", "totalScore", "maxScore", "dimensions", "flags", "timestamp", "entryCount"],
10
+ "properties": {
11
+ "sessionId": { "type": "string", "description": "Session ID that was graded" },
12
+ "taskId": { "type": "string", "description": "Optional associated task ID" },
13
+ "totalScore": { "type": "number", "minimum": 0, "maximum": 100 },
14
+ "maxScore": { "type": "number", "minimum": 0, "maximum": 100, "default": 100 },
15
+ "dimensions": {
16
+ "type": "object",
17
+ "properties": {
18
+ "sessionDiscipline": { "$ref": "#/definitions/dimensionScore" },
19
+ "discoveryEfficiency": { "$ref": "#/definitions/dimensionScore" },
20
+ "taskHygiene": { "$ref": "#/definitions/dimensionScore" },
21
+ "errorProtocol": { "$ref": "#/definitions/dimensionScore" },
22
+ "disclosureUse": { "$ref": "#/definitions/dimensionScore" }
23
+ }
24
+ },
25
+ "flags": {
26
+ "type": "array",
27
+ "items": { "type": "string" },
28
+ "description": "Specific violations or improvement suggestions"
29
+ },
30
+ "timestamp": { "type": "string", "format": "date-time" },
31
+ "entryCount": { "type": "number", "minimum": 0 },
32
+ "evaluator": { "type": "string", "enum": ["auto", "manual"] }
33
+ },
34
+ "definitions": {
35
+ "dimensionScore": {
36
+ "type": "object",
37
+ "required": ["score", "max", "evidence"],
38
+ "properties": {
39
+ "score": { "type": "number", "minimum": 0 },
40
+ "max": { "type": "number", "minimum": 0 },
41
+ "evidence": {
42
+ "type": "array",
43
+ "items": { "type": "string" },
44
+ "description": "Specific observations contributing to this score"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,250 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://cleo-dev.com/schemas/v1/log.schema.json",
4
+ "schemaVersion": "2.4.0",
5
+ "title": "CLEO Change Log Schema",
6
+ "description": "Immutable audit trail of all task operations. Used for debugging, history, and anti-hallucination verification.",
7
+ "type": "object",
8
+ "required": [
9
+ "version",
10
+ "project",
11
+ "entries",
12
+ "_meta"
13
+ ],
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "version": {
17
+ "type": "string",
18
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
19
+ "description": "Legacy schema version field (deprecated, use _meta.schemaVersion)"
20
+ },
21
+ "project": {
22
+ "type": "string",
23
+ "description": "Project identifier. Must match todo.json."
24
+ },
25
+ "_meta": {
26
+ "type": "object",
27
+ "required": [
28
+ "schemaVersion",
29
+ "totalEntries",
30
+ "firstEntry",
31
+ "lastEntry"
32
+ ],
33
+ "additionalProperties": false,
34
+ "properties": {
35
+ "schemaVersion": {
36
+ "type": "string",
37
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
38
+ "description": "Schema version for this file (semver). Canonical source for schema version (replaces root version field)."
39
+ },
40
+ "formatVersion": {
41
+ "type": "string",
42
+ "pattern": "^\\d+$",
43
+ "default": "1",
44
+ "description": "Log entry format version for future compatibility. Increment when entry structure changes."
45
+ },
46
+ "totalEntries": {
47
+ "type": "integer",
48
+ "minimum": 0
49
+ },
50
+ "firstEntry": {
51
+ "type": [
52
+ "string",
53
+ "null"
54
+ ],
55
+ "format": "date-time"
56
+ },
57
+ "lastEntry": {
58
+ "type": [
59
+ "string",
60
+ "null"
61
+ ],
62
+ "format": "date-time"
63
+ },
64
+ "entriesPruned": {
65
+ "type": "integer",
66
+ "default": 0,
67
+ "description": "Count of entries removed due to retention policy."
68
+ }
69
+ }
70
+ },
71
+ "entries": {
72
+ "type": "array",
73
+ "description": "Log entries in chronological order. Append-only.",
74
+ "items": {
75
+ "$ref": "#/definitions/logEntry"
76
+ }
77
+ }
78
+ },
79
+ "definitions": {
80
+ "logEntry": {
81
+ "type": "object",
82
+ "required": [
83
+ "id",
84
+ "timestamp",
85
+ "action",
86
+ "actor"
87
+ ],
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "id": {
91
+ "type": "string",
92
+ "pattern": "^log_[a-f0-9]{12}$",
93
+ "description": "Unique log entry ID. Format: log_<12-hex-chars>"
94
+ },
95
+ "timestamp": {
96
+ "type": "string",
97
+ "format": "date-time",
98
+ "description": "When this action occurred."
99
+ },
100
+ "sessionId": {
101
+ "type": [
102
+ "string",
103
+ "null"
104
+ ],
105
+ "description": "Session that performed this action."
106
+ },
107
+ "action": {
108
+ "type": "string",
109
+ "enum": [
110
+ "session_start",
111
+ "session_end",
112
+ "session_suspended",
113
+ "session_resumed",
114
+ "session_scope_defined",
115
+ "session_scope_conflict",
116
+ "session_focus_changed",
117
+ "session_timeout_warning",
118
+ "session_orphan_detected",
119
+ "session_auto_suspended",
120
+ "task_created",
121
+ "task_updated",
122
+ "status_changed",
123
+ "task_archived",
124
+ "focus_changed",
125
+ "config_changed",
126
+ "validation_run",
127
+ "checksum_updated",
128
+ "error_occurred",
129
+ "phase_changed",
130
+ "phase_started",
131
+ "phase_completed",
132
+ "phase_rollback"
133
+ ],
134
+ "description": "Type of action logged. Session actions (multi-session): session_suspended (paused), session_resumed (continued), session_scope_defined (scope created), session_scope_conflict (overlap detected), session_focus_changed (focus within session), session_timeout_warning (stale session), session_orphan_detected (crashed session), session_auto_suspended (timeout suspend). Phase actions: phase_changed, phase_started, phase_completed, phase_rollback."
135
+ },
136
+ "actor": {
137
+ "type": "string",
138
+ "enum": [
139
+ "human",
140
+ "claude",
141
+ "system"
142
+ ],
143
+ "description": "Who/what performed the action."
144
+ },
145
+ "taskId": {
146
+ "type": [
147
+ "string",
148
+ "null"
149
+ ],
150
+ "pattern": "^T\\d{3,}$",
151
+ "description": "Task ID if action relates to a specific task."
152
+ },
153
+ "before": {
154
+ "type": [
155
+ "object",
156
+ "null"
157
+ ],
158
+ "description": "State before the action (for changes)."
159
+ },
160
+ "after": {
161
+ "type": [
162
+ "object",
163
+ "null"
164
+ ],
165
+ "description": "State after the action (for changes)."
166
+ },
167
+ "details": {
168
+ "type": [
169
+ "object",
170
+ "string",
171
+ "null"
172
+ ],
173
+ "description": "Additional context about the action."
174
+ },
175
+ "scope": {
176
+ "type": [
177
+ "object",
178
+ "null"
179
+ ],
180
+ "description": "Session scope context for multi-session log entries. Null for single-session mode.",
181
+ "additionalProperties": false,
182
+ "properties": {
183
+ "type": {
184
+ "type": "string",
185
+ "enum": [
186
+ "task",
187
+ "taskGroup",
188
+ "subtree",
189
+ "epicPhase",
190
+ "epic",
191
+ "custom"
192
+ ],
193
+ "description": "Scope type from session definition."
194
+ },
195
+ "rootTaskId": {
196
+ "type": "string",
197
+ "pattern": "^T\\d{3,}$",
198
+ "description": "Root task defining the scope."
199
+ },
200
+ "phaseFilter": {
201
+ "type": [
202
+ "string",
203
+ "null"
204
+ ],
205
+ "description": "Phase filter if scope is phase-limited."
206
+ },
207
+ "taskCount": {
208
+ "type": "integer",
209
+ "minimum": 0,
210
+ "description": "Number of tasks in scope at log time."
211
+ }
212
+ }
213
+ },
214
+ "agentId": {
215
+ "type": [
216
+ "string",
217
+ "null"
218
+ ],
219
+ "description": "Agent identifier in multi-session mode (e.g., 'opus-1', 'haiku-2')."
220
+ },
221
+ "otherActiveSessions": {
222
+ "type": [
223
+ "integer",
224
+ "null"
225
+ ],
226
+ "minimum": 0,
227
+ "description": "Count of other active sessions at log time. Useful for concurrency auditing."
228
+ },
229
+ "error": {
230
+ "type": [
231
+ "object",
232
+ "null"
233
+ ],
234
+ "description": "Error details if action failed.",
235
+ "properties": {
236
+ "code": {
237
+ "type": "string"
238
+ },
239
+ "message": {
240
+ "type": "string"
241
+ },
242
+ "recoverable": {
243
+ "type": "boolean"
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }