stellaris-logs Β· git:20260806.146d8e8 Β· 2026-08-06 Β· sha256 2ec0982e9132bc97
stellaris-logs git:20260806.146d8e8A
Immutable. This exact content never changes and is served at /api/v1/blob/2ec0982e9132bc97.
---
name: stellaris-logs
description: "Turn Stellaris logs into deterministic fixes."
---
## OBJECTIVE
**THE FORENSIC ENGINEER**: Turn Stellaris logs into deterministic fixes (syntax, missing keys, wrong scopes, broken localisation).
## PROTOCOL
### Phase 1: Acquire Evidence (Read Only)
Ask user for:
1. `error.log` (required)
2. `game.log` (optional)
3. Mod root path (to map errors back to `src/`)
4. Stellaris user dir (usually `~/Documents/Paradox Interactive/Stellaris/`)
### Phase 2: Triage (Fast Classification)
Classify each error line into one bucket:
| Bucket | Typical Log Clue | Usual Cause |
|--------|-------------------|-------------|
| **Parse/Syntax** | `Unexpected token` / `Malformed token` | `{}` imbalance, stray `=`, wrong nesting |
| **Unknown Trigger/Effect** | `Unknown trigger` / `Unknown effect` | typos, wrong scope, version mismatch |
| **Missing Localisation** | Key shows raw (`[NS]_foo`) | missing key, wrong file header, missing BOM |
| **Duplicate Keys** | `Duplicate key` | multiple defs loaded, soft override collision |
| **Missing Asset** | `Could not find texture` / `GFX_...` | `.gfx` not registered, wrong path/case |
### Phase 3: Pinpoint (Map to Victim File)
1. Use the file path/line references in logs when present.
2. If logs are vague, search the mod repo for:
- the failing key (`[NS]_...`)
- the failing id (`[NS].###`)
- the missing asset name (`GFX_[NS]_...`)
### Phase 4: Fix Patterns
1. **Missing localisation**:
- Ensure `.yml` is UTF-8 with BOM.
- Ensure header is correct (`l_english:` etc).
- Add the missing key with `:0`.
2. **Unknown trigger/effect**:
- Verify scope (country/planet/system/ship) and move logic if needed.
- Cross-check `ref/syntax_docs` (if present) before inventing syntax.
3. **Parse errors**:
- Bracket-balance first. Then check for smart quotes.
## OUTPUT FORMAT
```markdown
## π STELLARIS LOG REPORT
### Evidence
- `error.log`: [provided]
- `game.log`: [provided / missing]
### Findings
- π΄ [Error line] β Victim: `src/...` β Fix: [one sentence]
- π‘ [Warning line] β Victim: `src/...` β Fix: [one sentence]
### Next Run
- Re-launch game with only this mod enabled.
- Re-check `error.log` for regressions.
```
## EXECUTION RULES
1. **Donβt edit logs**. Fix mod files.
2. **One fix loop**: apply smallest fix β re-run β re-check `error.log`.
3. **No Syntax Guessing**: Vanilla > `ref/syntax_docs` > web > hallucination.