gaia-framework 1.58.1 → 1.60.0

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/CLAUDE.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # GAIA Framework v1.58.1
2
+ # GAIA Framework v1.60.0
3
3
 
4
4
  This project uses the **GAIA** (Generative Agile Intelligence Architecture) framework — an AI agent framework for Claude Code that orchestrates software product development through 26 specialized agents, 65 workflows, and 8 shared skills.
5
5
 
package/README.md CHANGED
@@ -460,7 +460,7 @@ The single source of truth is `_gaia/_config/global.yaml`:
460
460
 
461
461
  ```yaml
462
462
  framework_name: "GAIA"
463
- framework_version: "1.58.1"
463
+ framework_version: "1.60.0"
464
464
  user_name: "your-name"
465
465
  project_name: "your-project"
466
466
  ```
@@ -3,7 +3,7 @@
3
3
  # After modifying this file, run /gaia-build-configs to regenerate resolved configs.
4
4
 
5
5
  framework_name: "GAIA"
6
- framework_version: "1.58.1"
6
+ framework_version: "1.60.0"
7
7
 
8
8
  # User settings
9
9
  user_name: "jlouage"
@@ -3,11 +3,11 @@
3
3
 
4
4
  modules:
5
5
  - name: core
6
- version: "1.12.1"
6
+ version: "1.13.0"
7
7
  path: "_gaia/core"
8
8
  type: built-in
9
9
  - name: lifecycle
10
- version: "1.37.1"
10
+ version: "1.38.0"
11
11
  path: "_gaia/lifecycle"
12
12
  type: built-in
13
13
  - name: dev
@@ -19,6 +19,6 @@ modules:
19
19
  path: "_gaia/creative"
20
20
  type: built-in
21
21
  - name: testing
22
- version: "1.8.1"
22
+ version: "1.8.0"
23
23
  path: "_gaia/testing"
24
24
  type: built-in
@@ -2,7 +2,7 @@
2
2
  inherits: "{project-root}/_gaia/_config/global.yaml"
3
3
 
4
4
  module_name: "core"
5
- module_version: "1.12.1"
5
+ module_version: "1.13.0"
6
6
 
7
7
  engine_path: "{project-root}/_gaia/core/engine/workflow.xml"
8
8
  tasks_path: "{project-root}/_gaia/core/tasks"
@@ -68,8 +68,17 @@ execution modes (normal/yolo/planning), checkpoints, and quality gates.
68
68
  <action if="agent is 'dev-*' (wildcard)">Check if workflow.yaml declares agent_auto_detect: true. If true, execute the agent_auto_detect_strategy from workflow.yaml to determine the stack. If auto-detection succeeds, resolve to {project-root}/_gaia/dev/agents/{detected_stack}-dev.md and inform user: "Auto-detected developer: {agent_name} based on {detection_source}." If auto-detection fails or agent_auto_detect is false/absent: ask user which stack developer to use (typescript, angular, flutter, java, python, mobile, go), then resolve to {project-root}/_gaia/dev/agents/{stack}-dev.md</action>
69
69
  <action if="agent file resolved">Read the agent persona file — adopt its persona, name, communication style, rules, and domain knowledge for the duration of this workflow</action>
70
70
  <action if="agent file resolved">Do NOT execute the agent's activation protocol, greeting, or menu — the workflow engine controls step execution</action>
71
- <action if="agent file resolved">Do NOT load the agent's memory sidecar — the workflow engine manages its own checkpoints</action>
72
71
  <action if="agent file resolved">Check for {project-root}/_gaia/_config/agents/{agent-id}.customize.yaml. If found, load and merge overrides (persona_overrides, menu_additions, menu_removals, skill_additions, rule_additions, skill_overrides, skill_section_overrides). For dev agents, also check all-dev.customize.yaml and merge (agent-specific takes precedence over all-dev).</action>
72
+
73
+ <!-- Memory Load Protocol (E9-S7) — Load agent memory sidecar files after persona, before instructions -->
74
+ <action if="agent file resolved">Read {project-root}/_memory/config.yaml to resolve agent tier and sidecar path. If the file does not exist, log "Memory config not found — skipping memory loading." and skip all remaining memory load actions in this step.</action>
75
+ <action if="agent file resolved">Resolve the agent's tier classification: look up the resolved agent ID in _memory/config.yaml tier lists — check tiers.tier_1.agents, tiers.tier_2.agents, and tiers.tier_3.agents in that order. If the agent ID is not found in any tier list (untiered), treat as Tier 3 by default — load decision-log.md only if it exists, with no budget enforcement.</action>
76
+ <action if="agent file resolved">Resolve sidecar path: read agents.{agent-id}.sidecar from _memory/config.yaml, construct absolute path as {project-root}/_memory/{sidecar_value}/. If the agent entry is not found in the agents section, construct path as {project-root}/_memory/{agent-id}-sidecar/.</action>
77
+ <action if="agent file resolved">Check if the sidecar directory exists. If the directory does not exist or is empty, skip all file loading silently — no error, no warning. Proceed to Step 4.</action>
78
+ <action if="agent file resolved and tier == 1">Load canonical sidecar files (silently skip any that do not exist): ground-truth.md, decision-log.md, conversation-context.md (3 files). These provide the agent's persistent ground truth, decision history, and recent conversation context.</action>
79
+ <action if="agent file resolved and tier == 2">Load canonical sidecar files (silently skip any that do not exist): decision-log.md, conversation-context.md (2 files). Tier 2 agents do not have ground-truth.md.</action>
80
+ <action if="agent file resolved and tier == 3 or untiered">Load canonical sidecar file (silently skip if it does not exist): decision-log.md (1 file). Tier 3 and untiered agents receive minimal memory context.</action>
81
+ <action if="agent file resolved and tier in [1, 2]">Estimate token budget usage: sum the byte lengths of all loaded sidecar files, divide by the token_approximation value (default: 4 chars per token, from _memory/config.yaml archival.token_approximation). Compare against the agent's session_budget from the tier definition in _memory/config.yaml. If usage reaches or exceeds the budget_warn_at threshold (0.8 / 80% from _memory/config.yaml archival.budget_warn_at): display warning "Memory budget at {N}% for {agent_name} — {used}K of {budget}K tokens." For Tier 3 and untiered agents (session_budget: null), skip the token budget check entirely.</action>
73
82
  </step>
74
83
 
75
84
  <step n="4" title="Load Instructions">
@@ -171,10 +180,7 @@ execution modes (normal/yolo/planning), checkpoints, and quality gates.
171
180
  <execution-modes>
172
181
  <mode name="normal">
173
182
  Pause at every template-output for user confirmation.
174
- Prompt: "[c] Continue | [y] Switch to YOLO | [e] Edit output | [v] Review with Val"
175
- The [v] option is shown when Val integration is enabled (val_integration.template_output_review: true in global.yaml,
176
- validator.md exists, and validator-sidecar/ exists). When [v] is selected, the engine invokes val-validate-artifact
177
- as a subagent to validate the saved artifact. If Val is not enabled, only [c]/[y]/[e] are shown.
183
+ Prompt: "[c] Continue | [y] Switch to YOLO | [e] Edit output"
178
184
  Pause at every ask tag — present the question and WAIT for user response.
179
185
  NEVER infer or skip an ask, even if the answer appears available from context.
180
186
  Pause when a subagent returns — show results summary and wait for [c]ontinue.
@@ -1,9 +1,3 @@
1
- ---
2
- template: 'brainstorming'
3
- version: 1.0.0
4
- used_by: ['brainstorming']
5
- ---
6
-
7
1
  # Brainstorming Session: {topic}
8
2
 
9
3
  **Date:** {date}
@@ -2,7 +2,7 @@
2
2
  inherits: "{project-root}/_gaia/_config/global.yaml"
3
3
 
4
4
  module_name: "lifecycle"
5
- module_version: "1.37.1"
5
+ module_version: "1.38.0"
6
6
 
7
7
  planning_artifacts: "{project-root}/docs/planning-artifacts"
8
8
  implementation_artifacts: "{project-root}/docs/implementation-artifacts"
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: memory-management-cross-agent
3
+ version: '1.0'
4
+ applicable_agents: [all]
5
+ description: 'Cross-agent memory extensions: cross-reference loading (ADR-015) and budget monitoring (ADR-014). Split from memory-management.md per 300-line skill limit.'
6
+ ---
7
+
8
+ <!-- SECTION: cross-reference-loading -->
9
+ ## Cross-Reference Loading (ADR-015)
10
+
11
+ Load another agent's sidecar files as read-only cross-references. All cross-ref loading is JIT (just-in-time) — never preloaded at session start.
12
+
13
+ ### Schema: `<memory-reads>` Tag
14
+
15
+ Agent persona files declare cross-references using this XML schema inside the `<agent>` block:
16
+
17
+ ```xml
18
+ <memory-reads>
19
+ <cross-ref agent="{agent-id}" file="{file-name}" mode="{recent|full|summary}" required="{true|false}" />
20
+ </memory-reads>
21
+ ```
22
+
23
+ **Attributes:**
24
+ - `agent` (required) — the agent ID whose sidecar to read (e.g., "architect", "validator")
25
+ - `file` (required) — the sidecar file to read (e.g., "decision-log", "ground-truth", "conversation-context")
26
+ - `mode` (required) — loading mode: `recent`, `full`, or `summary`
27
+ - `required` (optional, default: "true") — if "false", skip gracefully when the sidecar is absent
28
+
29
+ ### Read-Only Access: `load_cross_ref()`
30
+
31
+ Cross-references are loaded through `load_cross_ref()`, which is a **read-only** path — separate from `load_own()` (the agent's own sidecar, which supports read/write).
32
+
33
+ **Parameters:**
34
+ - `sidecar_path` — absolute path to the **target** agent's sidecar directory (e.g., `_memory/architect-sidecar/`)
35
+ - `file_name` — which file to read (e.g., "decision-log.md", "ground-truth.md")
36
+ - `mode` — loading mode: `recent`, `full`, or `summary`
37
+ - `budget_remaining` — remaining token budget for cross-references
38
+
39
+ **Write-Guard:**
40
+ Any attempt to write to a sidecar that is not the current agent's own sidecar MUST raise a **hard error** (not a warning). The write-guard blocks all write operations through `load_cross_ref()`. Only `load_own()` permits writes, and only to the agent's own sidecar directory.
41
+
42
+ **Procedure:**
43
+ 1. Validate the target sidecar path is NOT the current agent's own sidecar (self-reference guard)
44
+ 2. Check budget_remaining BEFORE loading — if insufficient, apply progressive downgrade
45
+ 3. Read the target file from disk (read-only — no file creation, no modification)
46
+ 4. Apply mode filtering (see Loading Modes below)
47
+ 5. Calculate token estimate: character count / 4 (using `token_approximation` from `_memory/config.yaml`)
48
+ 6. Return filtered content as read-only data with token estimate for caller budget deduction
49
+
50
+ ### Loading Modes
51
+
52
+ **`recent` mode** — Load entries from the last 2 sprints only:
53
+ - Parse decision-log entries using ADR-016 format
54
+ - Filter by Sprint field: keep entries where sprint matches current sprint or previous sprint
55
+ - If sprint metadata is absent from entries, fall back to date-based filtering (last 30 days)
56
+ - Approximate token cost: character count / 4
57
+
58
+ **`full` mode** — Load the entire file content:
59
+ - Read full file, respect budget cap
60
+ - If file exceeds budget_remaining: truncate oldest entries first (keep most recent)
61
+ - Approximate token cost: character count / 4
62
+
63
+ **`summary` mode** — Load section headers only:
64
+ - Parse the file for markdown headers (lines starting with `#`, `##`, `###`)
65
+ - Stop at section boundaries — do not load body content
66
+ - Minimal token cost
67
+
68
+ ### JIT Loading
69
+
70
+ Cross-references are loaded **just-in-time** during workflow step execution — NOT at agent activation or session start. Loading is triggered only when a workflow step explicitly requires cross-agent context.
71
+
72
+ **Trigger:** The workflow engine checks `<memory-reads>` declarations and loads cross-references only when the current step's execution context requires cross-agent data. No cross-references are preloaded eagerly.
73
+
74
+ ### Budget Enforcement
75
+
76
+ **Pre-load budget check:** Before each cross-reference load, calculate:
77
+ - Tokens already consumed by own sidecar
78
+ - Tokens already consumed by previously loaded cross-references
79
+ - Estimated tokens for the next cross-reference (based on mode and file size)
80
+
81
+ **Per-agent `cross_ref_budget_cap`:** Some agents have a `cross_ref_budget_cap` in `_memory/config.yaml` (e.g., validator: 0.5). This caps cross-reference token consumption at that fraction of the agent's session budget. If loading would exceed the cap, halt loading and downgrade remaining cross-refs progressively.
82
+
83
+ **Progressive downgrade chain:** When budget is insufficient for the requested mode:
84
+ 1. `full` → downgrade to `recent`
85
+ 2. `recent` → downgrade to `summary`
86
+ 3. `summary` → downgrade to `skip` (do not load, log warning)
87
+
88
+ Log every downgrade as a warning in the session checkpoint:
89
+ `"Cross-ref downgraded: {agent}/{file} from {original_mode} to {new_mode} — budget {used}/{total}"`
90
+
91
+ **Val's 50% cross-ref budget cap:**
92
+ Val (validator) has a `cross_ref_budget_cap` of 0.5 in `_memory/config.yaml`, meaning cross-references may consume at most 50% of Val's 300K session budget (= 150K tokens max for cross-refs). Val's load priority order: architect, pm, sm. If the 150K cap is hit mid-load, remaining cross-references are downgraded progressively.
93
+
94
+ **Tier budget ceilings:**
95
+ - Tier 1 agents: 300K session budget (own sidecar + cross-refs combined)
96
+ - Tier 2 agents: 100K session budget (own sidecar + cross-refs combined)
97
+ - Tier 3 agents: no explicit budget enforcement
98
+
99
+ ### Graceful Error Handling
100
+
101
+ **Missing sidecar directory or file:**
102
+ - If the target sidecar directory does not exist: log a warning ("Cross-ref skipped: {agent} sidecar directory not found"), skip this cross-reference, and continue workflow execution without error
103
+ - If the target file within the sidecar does not exist: log a warning ("Cross-ref skipped: {agent}/{file} not found"), skip, continue
104
+
105
+ **Empty sidecar directory:**
106
+ - If the target sidecar directory exists but contains no files: return empty result gracefully with no error — matching the contract of the `session-load` section
107
+
108
+ **Malformed or corrupt sidecar files:**
109
+ - If the target file exists but cannot be parsed (malformed markdown, corrupt content, unparseable entries): log a warning ("Cross-ref skipped: {agent}/{file} is malformed"), skip this cross-reference, and continue
110
+ - Never halt the workflow due to a cross-reference loading failure
111
+
112
+ **Absent optional cross-references:**
113
+ - If `<cross-ref required="false">` and the target is absent: skip silently (no warning)
114
+ - If `<cross-ref required="true">` (default) and the target is absent: log warning but still continue
115
+
116
+ **Agent not in cross-reference matrix:**
117
+ - If the calling agent has no entry in `_memory/config.yaml` `cross_references`, return empty result with no error
118
+
119
+ ### Consistency Validation
120
+
121
+ At session start, validate that agent persona `<memory-reads>` declarations are consistent with `_memory/config.yaml` cross_references matrix:
122
+
123
+ 1. Parse the agent's `<memory-reads>` block from the persona file
124
+ 2. Load the agent's entry from `_memory/config.yaml` → `cross_references.{agent_id}.reads_from`
125
+ 3. Compare: every entry in config.yaml should have a matching `<cross-ref>` in the persona file
126
+ 4. If mismatch found: produce a **warning** (not an error) — `_memory/config.yaml` is the authoritative source
127
+
128
+ **Self-reference guard:**
129
+ If an agent's `<memory-reads>` declares a `<cross-ref>` where the `agent` attribute matches the current agent's own ID, reject it with a validation error at session start. An agent must not reference its own sidecar as a cross-reference — own-sidecar access is through `load_own()`.
130
+
131
+ ### Checkpoint Provenance
132
+
133
+ After loading cross-references, record in the session checkpoint:
134
+ - Which cross-references were loaded (agent, file, mode)
135
+ - File checksums (`shasum -a 256`) of each loaded cross-reference file
136
+ - Any downgrades or skips that occurred
137
+ - Total tokens consumed by cross-references
138
+
139
+ This enables `/gaia-resume` to detect stale cross-references when resuming a session.
140
+ <!-- END SECTION -->
141
+
142
+ <!-- SECTION: budget-monitoring -->
143
+ ## Budget Monitoring (ADR-014)
144
+
145
+ Shared utility for checking token budget usage against tier-defined thresholds. Used by `session-save` and other memory operations to determine when archival is needed.
146
+
147
+ ### Parameters
148
+
149
+ - `sidecar_path` — absolute path to the agent's sidecar directory
150
+ - `tier_budget` — session token budget for this agent's tier (from `_memory/config.yaml`). If null or absent, the agent is untiered.
151
+ - `current_usage` — current token count (own sidecar files + cross-refs loaded in this session)
152
+ - `projected_addition` — token count of content about to be written/loaded
153
+
154
+ ### Threshold Definitions (config-driven)
155
+
156
+ All thresholds are read from `_memory/config.yaml` `archival` block at runtime. Never hardcode these values.
157
+
158
+ - `budget_warn_at` — fraction of budget at which a warning is returned (e.g., 0.8 = 80%)
159
+ - `budget_alert_at` — fraction of budget at which an alert is returned (e.g., 0.9 = 90%)
160
+ - `budget_archive_at` — fraction of budget at which archival is triggered (e.g., 1.0 = 100%)
161
+ - `token_approximation` — characters per token for size estimation (e.g., 4)
162
+ - `archive_subdir` — subdirectory name within sidecar for archived entries (e.g., "archive")
163
+
164
+ ### Procedure
165
+
166
+ 1. Read `_memory/config.yaml` archival block to get threshold values
167
+ 2. Calculate `projected_total = current_usage + projected_addition`
168
+ 3. Calculate `usage_ratio = projected_total / tier_budget`
169
+ 4. Return threshold status:
170
+ - `usage_ratio < budget_warn_at` → status: `ok` (no action needed)
171
+ - `usage_ratio >= budget_warn_at AND < budget_alert_at` → status: `warn` ("approaching budget limit")
172
+ - `usage_ratio >= budget_alert_at AND < budget_archive_at` → status: `alert` ("near budget limit")
173
+ - `usage_ratio >= budget_archive_at` → status: `archive_needed` ("budget exceeded, archival required")
174
+
175
+ ### Archival Protocol
176
+
177
+ When status is `archive_needed`:
178
+ 1. Identify the oldest N entries in `decision-log.md` that would free sufficient tokens
179
+ 2. Move those entries to `{sidecar_path}/{archive_subdir}/` (e.g., `_memory/architect-sidecar/archive/`)
180
+ 3. Create the archive subdirectory if it does not exist (`mkdir -p`)
181
+ 4. Use atomic read-modify-write pattern: read full file, remove archived entries, write full file back
182
+ 5. Re-check budget after archival — if still over budget, archive more entries (up to 3 iterations)
183
+ 6. Archive subdirectory is gitignored — archived entries are historical, not version-controlled
184
+
185
+ ### Token Estimation
186
+
187
+ Token count is approximated using the `token_approximation` value from `_memory/config.yaml` (default: 4 chars per token). No tokenizer library is used — this aligns with ADR-005 (zero runtime dependencies).
188
+
189
+ Formula: `tokens = character_count / token_approximation`
190
+
191
+ ### Running Session Total
192
+
193
+ Track cumulative token usage across the session:
194
+ - Own sidecar files loaded via `session-load`
195
+ - Cross-references loaded via `cross-reference-loading`
196
+ - New entries being written via `session-save`
197
+
198
+ The combined total is checked against the tier budget ceiling.
199
+
200
+ ### Untiered Agent Handling
201
+
202
+ If `tier_budget` is null, absent, or the agent has no tier assignment in `_memory/config.yaml` (applies to 9 untiered agents: analyst, data-engineer, performance, ux-designer, brainstorming-coach, design-thinking-coach, innovation-strategist, presentation-designer, problem-solver):
203
+ - Skip all budget enforcement — no threshold checks, no archival trigger
204
+ - Return status: `no_budget` with no error
205
+ - This is a no-op: the caller proceeds without any budget constraint
206
+ - Never raise an error for untiered agents
207
+
208
+ ### Return Value
209
+
210
+ ```yaml
211
+ status: ok | warn | alert | archive_needed | no_budget
212
+ usage_ratio: 0.75 # current usage as fraction of budget (null if no_budget)
213
+ tokens_used: 225000 # current token count (null if no_budget)
214
+ tokens_budget: 300000 # tier budget ceiling (null if no_budget)
215
+ tokens_projected: 230000 # projected total after addition (null if no_budget)
216
+ message: "Budget at 75% — no action needed"
217
+ ```
218
+ <!-- END SECTION -->
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: memory-management
3
- version: '1.0'
3
+ version: '1.1'
4
4
  applicable_agents: [all]
5
- description: 'Session load/save, decision formatting, stale detection, deduplication, context summarization'
5
+ description: 'Core memory operations: session load/save, decision formatting, stale detection, deduplication, context summarization. Cross-agent sections in memory-management-cross-agent.md.'
6
6
  ---
7
7
 
8
8
  <!-- SECTION: decision-formatting -->
@@ -96,13 +96,13 @@ Persist agent session data to sidecar files. Agent-agnostic — takes sidecar pa
96
96
  - Read entire file, replace in memory, write entire file back
97
97
 
98
98
  **Token budget enforcement (before write):**
99
- - Calculate projected file size after append (current size + new entries size)
100
- - Approximate tokens: character count / 4
101
- - If projected size exceeds `tier_budget`: warn with current/max budget and offer options:
102
- - **Archive oldest entries** — move oldest N entries to `archive/` subdirectory to make room
103
- - **Force save** save anyway, exceeding the budget
99
+ - Before writing, invoke the `budget-monitoring` section (from `memory-management-cross-agent.md`) to check projected usage against tier budget
100
+ - Pass: sidecar_path, tier_budget, projected_size (current size + new entries size)
101
+ - `budget-monitoring` returns the threshold status: ok, warn, alert, or archive_needed
102
+ - If `archive_needed`: move oldest N entries to `{sidecar_path}/{archive_subdir}/` subdirectory to make room, then re-check
103
+ - If user declines archival: force save anyway, exceeding the budget
104
104
  - Never silently truncate or block a save operation
105
- - Warn at 80% of budget ("approaching limit"), warn at 90% ("near limit"), trigger archival prompt at 100%
105
+ - See `budget-monitoring` section in `memory-management-cross-agent.md` for threshold definitions and config source
106
106
  <!-- END SECTION -->
107
107
 
108
108
  <!-- SECTION: context-summarization -->
@@ -195,128 +195,4 @@ Detect and merge duplicate decision entries within a decision log.
195
195
  **Output:** List of duplicate pairs with recommended action (auto-archive or review).
196
196
  <!-- END SECTION -->
197
197
 
198
- <!-- SECTION: cross-ref-loading -->
199
- ## Cross-Reference Loading (ADR-015)
200
-
201
- Load another agent's sidecar files as read-only cross-references. All cross-ref loading is JIT (just-in-time) — never preloaded at session start.
202
-
203
- ### Schema: `<memory-reads>` Tag
204
-
205
- Agent persona files declare cross-references using this XML schema inside the `<agent>` block:
206
-
207
- ```xml
208
- <memory-reads>
209
- <cross-ref agent="{agent-id}" file="{file-name}" mode="{recent|full|summary}" required="{true|false}" />
210
- <!-- Additional cross-ref entries -->
211
- </memory-reads>
212
- ```
213
-
214
- **Attributes:**
215
- - `agent` (required) — the agent ID whose sidecar to read (e.g., "architect", "validator")
216
- - `file` (required) — the sidecar file to read (e.g., "decision-log", "ground-truth", "conversation-context")
217
- - `mode` (required) — loading mode: `recent`, `full`, or `summary`
218
- - `required` (optional, default: "true") — if "false", skip gracefully when the sidecar is absent
219
-
220
- ### Read-Only Access: `load_cross_ref()`
221
-
222
- Cross-references are loaded through `load_cross_ref()`, which is a **read-only** path — separate from `load_own()` (the agent's own sidecar, which supports read/write).
223
-
224
- **Parameters:**
225
- - `sidecar_path` — absolute path to the **target** agent's sidecar directory (e.g., `_memory/architect-sidecar/`)
226
- - `file_name` — which file to read (e.g., "decision-log.md", "ground-truth.md")
227
- - `mode` — loading mode: `recent`, `full`, or `summary`
228
- - `budget_remaining` — remaining token budget for cross-references
229
-
230
- **Write-Guard:**
231
- Any attempt to write to a sidecar that is not the current agent's own sidecar MUST raise a **hard error** (not a warning). The write-guard blocks all write operations through `load_cross_ref()`. Only `load_own()` permits writes, and only to the agent's own sidecar directory.
232
-
233
- **Procedure:**
234
- 1. Validate the target sidecar path is NOT the current agent's own sidecar (self-reference guard — see Validation section below)
235
- 2. Check budget_remaining BEFORE loading — if insufficient, apply progressive downgrade
236
- 3. Read the target file from disk (read-only — no file creation, no modification)
237
- 4. Apply mode filtering (see Loading Modes below)
238
- 5. Return filtered content as read-only data
239
-
240
- ### Loading Modes
241
-
242
- **`recent` mode** — Load entries from the last 2 sprints only:
243
- - Parse decision-log entries using ADR-016 format
244
- - Filter by Sprint field: keep entries where sprint matches current sprint or previous sprint
245
- - If sprint metadata is absent from entries, fall back to date-based filtering (last 30 days)
246
- - Approximate token cost: character count / 4
247
-
248
- **`full` mode** — Load the entire file content:
249
- - Read full file, respect budget cap
250
- - If file exceeds budget_remaining: truncate oldest entries first (keep most recent)
251
- - Approximate token cost: character count / 4
252
-
253
- **`summary` mode** — Load section headers only:
254
- - Parse the file for markdown headers (lines starting with `#`, `##`, `###`)
255
- - Stop at section boundaries — do not load body content
256
- - Minimal token cost
257
-
258
- ### JIT Loading
259
-
260
- Cross-references are loaded **just-in-time** during workflow step execution — NOT at agent activation or session start. Loading is triggered only when a workflow step explicitly requires cross-agent context.
261
-
262
- **Trigger:** The workflow engine checks `<memory-reads>` declarations and loads cross-references only when the current step's execution context requires cross-agent data. No cross-references are preloaded eagerly.
263
-
264
- ### Budget Enforcement
265
-
266
- **Pre-load budget check:** Before each cross-reference load, calculate:
267
- - Tokens already consumed by own sidecar
268
- - Tokens already consumed by previously loaded cross-references
269
- - Estimated tokens for the next cross-reference (based on mode and file size)
270
-
271
- **Progressive downgrade chain:** When budget is insufficient for the requested mode:
272
- 1. `full` → downgrade to `recent`
273
- 2. `recent` → downgrade to `summary`
274
- 3. `summary` → downgrade to `skip` (do not load, log warning)
275
-
276
- Log every downgrade as a warning in the session checkpoint:
277
- `"Cross-ref downgraded: {agent}/{file} from {original_mode} to {new_mode} — budget {used}/{total}"`
278
-
279
- **Val's 50% cross-ref budget cap:**
280
- Val (validator) has a `cross_ref_budget_cap` of 0.5 in `_memory/config.yaml`, meaning cross-references may consume at most 50% of Val's 300K session budget (= 150K tokens max for cross-refs). Val's load priority order: architect → pm → sm. If the 150K cap is hit mid-load, remaining cross-references are downgraded progressively.
281
-
282
- **Tier budget ceilings:**
283
- - Tier 1 agents: 300K session budget (own sidecar + cross-refs combined)
284
- - Tier 2 agents: 100K session budget (own sidecar + cross-refs combined)
285
- - Tier 3 agents: no explicit budget enforcement
286
-
287
- ### Graceful Error Handling
288
-
289
- **Missing sidecar directory or file:**
290
- - If the target sidecar directory does not exist: log a warning ("Cross-ref skipped: {agent} sidecar directory not found"), skip this cross-reference, and continue workflow execution
291
- - If the target file within the sidecar does not exist: log a warning ("Cross-ref skipped: {agent}/{file} not found"), skip, continue
292
-
293
- **Malformed or corrupt sidecar files:**
294
- - If the target file exists but cannot be parsed (malformed markdown, corrupt content, unparseable entries): log a warning ("Cross-ref skipped: {agent}/{file} is malformed"), skip this cross-reference, and continue
295
- - Never halt the workflow due to a cross-reference loading failure
296
-
297
- **Absent optional cross-references:**
298
- - If `<cross-ref required="false">` and the target is absent: skip silently (no warning)
299
- - If `<cross-ref required="true">` (default) and the target is absent: log warning but still continue
300
-
301
- ### Consistency Validation
302
-
303
- At session start, validate that agent persona `<memory-reads>` declarations are consistent with `_memory/config.yaml` cross_references matrix:
304
-
305
- 1. Parse the agent's `<memory-reads>` block from the persona file
306
- 2. Load the agent's entry from `_memory/config.yaml` → `cross_references.{agent_id}.reads_from`
307
- 3. Compare: every entry in config.yaml should have a matching `<cross-ref>` in the persona file
308
- 4. If mismatch found: produce a **warning** (not an error) — `_memory/config.yaml` is the authoritative source. The persona file declaration should mirror it.
309
-
310
- **Self-reference guard:**
311
- If an agent's `<memory-reads>` declares a `<cross-ref>` where the `agent` attribute matches the current agent's own ID, reject it with a validation error at session start. An agent must not reference its own sidecar as a cross-reference — own-sidecar access is through `load_own()`.
312
-
313
- ### Checkpoint Provenance
314
-
315
- After loading cross-references, record in the session checkpoint:
316
- - Which cross-references were loaded (agent, file, mode)
317
- - File checksums (`shasum -a 256`) of each loaded cross-reference file
318
- - Any downgrades or skips that occurred
319
- - Total tokens consumed by cross-references
320
-
321
- This enables `/gaia-resume` to detect stale cross-references when resuming a session.
322
- <!-- END SECTION -->
198
+ <!-- Cross-agent extensions (cross-reference-loading, budget-monitoring) are in memory-management-cross-agent.md -->
@@ -7,7 +7,6 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/lifecycle/workflows/1-analysis/create-product-brief"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
- template: "{project-root}/_gaia/lifecycle/templates/product-brief-template.md"
11
10
  input_file_patterns:
12
11
  brainstorm:
13
12
  whole: "{planning_artifacts}/project-brainstorm.md"
@@ -7,7 +7,6 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/code-review"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
- template: "{project-root}/_gaia/lifecycle/templates/review-template.md"
11
10
  input_file_patterns:
12
11
  architecture:
13
12
  whole: "{planning_artifacts}/architecture.md"
@@ -8,7 +8,6 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
8
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/sprint-planning"
9
9
  instructions: "{installed_path}/instructions.xml"
10
10
  validation: "{installed_path}/checklist.md"
11
- template: "{project-root}/_gaia/lifecycle/templates/sprint-plan-template.md"
12
11
  input_file_patterns:
13
12
  epics:
14
13
  whole: "{planning_artifacts}/epics-and-stories.md"
@@ -7,7 +7,6 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/lifecycle/workflows/5-deployment/deployment-checklist"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
- template: "{project-root}/_gaia/lifecycle/templates/deployment-template.md"
11
10
  input_file_patterns:
12
11
  architecture:
13
12
  whole: "{planning_artifacts}/architecture.md"
@@ -2,7 +2,7 @@
2
2
  inherits: "{project-root}/_gaia/_config/global.yaml"
3
3
 
4
4
  module_name: "testing"
5
- module_version: "1.8.1"
5
+ module_version: "1.8.0"
6
6
 
7
7
  test_artifacts: "{project-root}/docs/test-artifacts"
8
8
  knowledge_path: "{project-root}/_gaia/testing/knowledge"
@@ -7,6 +7,5 @@ config_source: "{project-root}/_gaia/testing/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/testing/workflows/test-design"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
- template: "{project-root}/_gaia/lifecycle/templates/test-plan-template.md"
11
10
  output:
12
11
  primary: "{test_artifacts}/test-plan.md"
package/gaia-install.sh CHANGED
@@ -6,7 +6,7 @@ set -euo pipefail
6
6
  # Installs, updates, validates, and reports on GAIA installations.
7
7
  # ─────────────────────────────────────────────────────────────────────────────
8
8
 
9
- readonly VERSION="1.58.1"
9
+ readonly VERSION="1.60.0"
10
10
  readonly GITHUB_REPO="https://github.com/jlouage/Gaia-framework.git"
11
11
  readonly MANIFEST_REL="_gaia/_config/manifest.yaml"
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaia-framework",
3
- "version": "1.58.1",
3
+ "version": "1.60.0",
4
4
  "description": "GAIA — Generative Agile Intelligence Architecture installer",
5
5
  "bin": {
6
6
  "gaia-framework": "./bin/gaia-framework.js"