mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-09-22 01:15:54 +03:00
fix(convert): two color names fall through to grey, and nothing checked (#872)
* fix(convert): two color names fall through to grey, and nothing checked resolve_opencode_color() maps a name it does not recognise to #6B7280 and says nothing about it. Four agents ask for a name it has never known: engineering/engineering-minimal-change-engineer.md slate specialized/operations-manager.md slate gis/gis-technical-consultant.md navy specialized/chief-financial-officer.md navy All four render grey in the OpenCode integration, which reads as a deliberate grey rather than a miss — and some agents do choose grey, so there was nothing to notice. `slate` and `navy` are now in the map. Values follow the CSS named color where one exists (navy -> #000080, matching how teal already works) and Tailwind's 500 shade otherwise (slate -> #64748B, matching gray). Adding two names does not stop the next one, so two checks now cover it: - lint-agents.sh rejects a color that is neither #RRGGBB nor a name the converter knows, and prints the names it knows. The list is read out of resolve_opencode_color() rather than copied, so it cannot drift from the map that does the work. This runs on changed files in agent PRs, which is where a new color arrives. - test-convert-outputs.sh fails when an opencode output is #6B7280 and the source did not ask for grey. Grey stays a legitimate choice; the check is "grey only when the source said so". CONTRIBUTING now says which color values actually work, since the template just said `colorname or "#hexcode"`. Verified: all 279 agents pass the new lint rule, and no opencode output falls through to grey by accident. * ci(lint): run the whole roster when the linter itself changes The lint job scopes itself to the agent files a PR touched, which is right for an agent PR and wrong for a rule change. A new rule lands without ever having run against the other 278 agents — it either breaks a division nobody edited or quietly does nothing, and either way CI is silent. The colour check in the previous commit is the case in point: it changes scripts/, so the lint workflow's path filter did not even fire, and the rule would have merged without CI looking at a single agent. Adds a lint-all job that runs the full-roster lint when scripts/ lint-agents.sh, convert.sh, or lib.sh is part of the diff, and says why it is skipping when they are not. Those three paths are in the workflow's trigger list now so the job can fire at all.
This commit is contained in:
@@ -288,6 +288,35 @@ for tool in TOOLS:
|
||||
report(tool, bad_parse, bad_trip,
|
||||
"parse and round-trip" if fmt in ("yaml-fm", "toml") else "parse, carry their slug, and have their prose file")
|
||||
|
||||
# --- Layer A (color): a grey agent should be a grey agent ---------------------
|
||||
# resolve_opencode_color() maps a name it does not know to #6B7280 and says
|
||||
# nothing, so a typo or an unlisted name (`slate`, `navy`) reaches users as a
|
||||
# deliberate-looking grey. Grey is a real choice for the agents that ask for it,
|
||||
# so the check is not "never grey" — it is "grey only when the source said so".
|
||||
GREY = "#6B7280"
|
||||
grey_names = {"gray", "grey", "#6b7280", "6b7280"}
|
||||
colour_bad = 0
|
||||
for f in sorted(glob.glob(os.path.join(OUT, "opencode", "agents", "*.md"))):
|
||||
slug = os.path.splitext(os.path.basename(f))[0]
|
||||
entry = src.get(slug)
|
||||
if entry is None:
|
||||
continue
|
||||
try:
|
||||
emitted = str(frontmatter(open(f, encoding="utf-8").read()).get("color", "")).strip()
|
||||
source_color = str(frontmatter(open(os.path.join(R, entry[2]), encoding="utf-8").read())
|
||||
.get("color", "")).strip().lower()
|
||||
except Exception:
|
||||
continue # the strict-parse pass above already reported this
|
||||
if emitted.upper() == GREY and source_color not in grey_names:
|
||||
colour_bad += 1
|
||||
if colour_bad <= 3:
|
||||
bad(f"opencode: {slug} asked for color {source_color!r} and got {GREY} — "
|
||||
f"resolve_opencode_color() does not know that name")
|
||||
if colour_bad > 3:
|
||||
bad(f"opencode: ...and {colour_bad-3} more colors silently replaced with grey")
|
||||
elif not colour_bad:
|
||||
ok(f"opencode: every agent color resolves; none fell through to {GREY} by accident")
|
||||
|
||||
# --- Layer A (split integrity): a source fenced block must survive whole -------
|
||||
# openclaw is the one tool that splits a single agent body across two files, at
|
||||
# `## ` headings: SOUL.md (persona) / AGENTS.md (operations). A heading inside a
|
||||
|
||||
Reference in New Issue
Block a user