bug-report-wg

Bug report: wg evolve run fails with YAML parse error on roles

Metadata

Statusdone
Assignedagent-544
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-02T15:03:43.059907194+00:00
Started2026-04-02T15:04:07.609661575+00:00
Completed2026-04-02T15:05:53.212917683+00:00
Tagsbug-report,meta, eval-scheduled
Eval score0.89
└ blocking impact0.92
└ completeness0.95
└ coordination overhead0.88
└ correctness0.95
└ downstream usability0.78
└ efficiency0.92
└ intent fidelity0.67
└ style adherence0.90

Description

CRITICAL CONTEXT

PHR = Pseudohomologous Region. Read subtelomeric_analysis_report.md for project definitions.

Bug Description

wg evolve run fails with a YAML parse error when trying to load roles:

Error: Failed to load roles

Caused by:
    0: YAML error: could not find expected ':' at line 46 column 1, while scanning a simple key at line 45 column 1
    1: could not find expected ':' at line 46 column 1, while scanning a simple key at line 45 column 1

Investigation

Role cache files

Location: .workgraph/agency/cache/roles/

  • 8 role YAML files present
  • Each file is 20-50 lines long (none has 46 lines individually)
  • Files appear to be valid YAML when parsed individually
  • The error references 'line 46 column 1' which doesn't exist in any single file

Hypothesis

The YAML loader appears to be concatenating all role files into a single stream before parsing. When concatenated, the combined document hits a parse error at the boundary between two files (line 46 = start of second file in concatenated stream). This suggests:

  1. The loader reads all *.yaml files from a directory and concatenates them
  2. It expects multi-document YAML (with --- separators) but the files don't have separators
  3. OR it expects a single YAML file containing all roles as a list/map, but instead finds individual files

Files checked

  • .workgraph/agency/cache/roles/*.yaml — 8 files, all individually parseable
  • .workgraph/agency/primitives/tradeoffs/*.yaml — ~200 files, also individually valid structure
  • .workgraph/agency/import-manifest.yaml — valid, shows starter import with 338 role_components, 98 outcomes, 201 trade_offs

Reproduction

cd /moosefs/erikg/phrs
wg evolve run

Fails immediately with the YAML error above.

Environment

  • workgraph version: (check wg --version)
  • Graph: 500+ tasks, 22h uptime
  • Service running, coordinator active
  • The agency was initialized via wg quickstart and has been running agents for ~22 hours with ~445 task completions

Impact

Cannot run agency evolution to improve agent performance. This blocks the ability to learn from the task evaluation history and improve agent role assignments.

Suggested fix

Check the role loading code — it likely needs to either:

  1. Load each YAML file independently and collect into a list, OR
  2. Use YAML multi-document stream parsing (--- separator aware), OR
  3. Expect a single roles.yaml file rather than a directory of individual files

The error is in the loader, not the data — the individual role files are structurally valid.

Depends on

Required by

Log