@jaguilar87/gaia-ops 3.10.2 → 3.10.3

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.
@@ -152,6 +152,75 @@ def _load_agent_skills(subagent_type: str) -> str:
152
152
  return "\n\n---\n\n".join(parts) if parts else ""
153
153
 
154
154
 
155
+ def _build_context_update_reminder(subagent_type: str) -> str:
156
+ """
157
+ Check which writable sections are empty and build a reminder.
158
+
159
+ Reads the context contracts to find writable sections for this agent,
160
+ then checks project-context.json to see which are empty.
161
+
162
+ Returns:
163
+ Reminder string or empty string if no empty sections.
164
+ """
165
+ if subagent_type not in PROJECT_AGENTS:
166
+ return ""
167
+
168
+ # Load contracts to find writable sections
169
+ contracts_paths = [
170
+ Path(".claude/config/context-contracts.gcp.json"),
171
+ Path(".claude/config/context-contracts.aws.json"),
172
+ Path(__file__).parent.parent / "config" / "context-contracts.gcp.json",
173
+ Path(__file__).parent.parent / "config" / "context-contracts.aws.json",
174
+ ]
175
+
176
+ writable = []
177
+ for cp in contracts_paths:
178
+ if cp.exists():
179
+ try:
180
+ data = json.loads(cp.read_text())
181
+ agent_perms = data.get("agents", {}).get(subagent_type, {})
182
+ writable = agent_perms.get("write", [])
183
+ if writable:
184
+ break
185
+ except Exception:
186
+ continue
187
+
188
+ if not writable:
189
+ return ""
190
+
191
+ # Load project-context.json to find empty sections
192
+ pc_paths = [
193
+ Path(".claude/project-context/project-context.json"),
194
+ Path("project-context.json"),
195
+ ]
196
+
197
+ sections = {}
198
+ for pp in pc_paths:
199
+ if pp.exists():
200
+ try:
201
+ pc = json.loads(pp.read_text())
202
+ sections = pc.get("sections", {})
203
+ break
204
+ except Exception:
205
+ continue
206
+
207
+ # Find empty writable sections
208
+ empty = []
209
+ for section_name in writable:
210
+ section_data = sections.get(section_name, {})
211
+ if not section_data or section_data == {}:
212
+ empty.append(section_name)
213
+
214
+ if not empty:
215
+ return ""
216
+
217
+ empty_list = ", ".join(f"`{s}`" for s in empty)
218
+ return (
219
+ f"\n**CONTEXT_UPDATE REQUIRED:** Your writable sections {empty_list} "
220
+ f"are currently EMPTY. After completing your task, you MUST emit a "
221
+ f"CONTEXT_UPDATE block with any data you discovered. "
222
+ f"See \"Context Updater Protocol\" above for the format.\n\n"
223
+ )
155
224
 
156
225
 
157
226
  def _should_inject_on_resume(parameters: dict) -> bool:
@@ -339,13 +408,16 @@ def _inject_project_context(parameters: dict) -> dict:
339
408
  skills_content = _load_agent_skills(subagent_type)
340
409
  skills_section = f"\n\n---\n\n# Agent Skills (Auto-Injected)\n\n{skills_content}" if skills_content else ""
341
410
 
411
+ # Build context update reminder for empty writable sections
412
+ update_reminder = _build_context_update_reminder(subagent_type)
413
+
342
414
  # Inject context and skills into prompt
343
415
  enriched_prompt = f"""# Project Context (Auto-Injected)
344
416
 
345
417
  {json.dumps(context_payload, indent=2)}
346
418
 
347
419
  {pending_warning}---{skills_section}
348
-
420
+ {update_reminder}
349
421
  # User Task
350
422
 
351
423
  {prompt}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaguilar87/gaia-ops",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "description": "Multi-agent orchestration system for Claude Code - DevOps automation toolkit",
5
5
  "main": "index.js",
6
6
  "type": "module",