Skip to content

fix(skills): log-triage hands over the entity list and questions a broad one - #8537

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:kalin/log-triage-entity-lists
Nov 19, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:kalin/log-triage-entity-lists

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #5465. In real runs the model called triage_logs, then rebuilt the list of affected ids with its own script and delivered almost every id in the log as anomalous. The rule against that was only in SKILL.md, the result never said where the tool's own list was, and nothing questioned a list that held nearly the whole population.

What changes

  • The written list carries its evidence. With output_path, each id comes with its templates, worst severity, time range, whether routine templates name it too, and how much of the population its rarest template touches. The result returns the path, the count, the total and the share.
  • A broad list is questioned. A list holding more than a third of a known population is reported in entity_list_warning, first among the warnings. It names the two arguments that tighten it: entity_max_share and entity_min_level. Ids that occur only in anomaly lines get a share_note instead.
  • next_step says to deliver or filter the file, not to recompute the list by hand. The same rule is in the tool description.
  • Undecodable characters are counted. Each file's coverage row carries undecodable_chars, undecodable_lines and the encoding, with a warning naming the first line. Clean files report nothing new.

Evidence

Found in unattended runs of a large HPC log task on a local model. After the change the model delivered the tool's list instead of rebuilding it. The task still fails on naming the root-cause event, which this PR does not address.

Eval

Changes the log-triage tool description and its results, so the RC eval should watch gaia_skills_tasks and gaia_data. No current scenario runs log-triage directly.

Tests

tests/unit/test_log_triage_tool.py and hub/agents/gaia/python/tests/test_log_triage_skill_tool.py cover the list file, the warning and its thresholds, the share note and the decode counts.

Logs were opened with errors="replace", so bytes that are not valid in
the file's encoding became U+FFFD without a word. An id or a message on
such a line can be damaged, and a file in another encoding was read as
if it were clean.

Each file's coverage row now carries undecodable_chars, undecodable_lines
and the encoding, and a warning names the count, the first line and what
to do. Clean files report nothing new.
…oad one

In real runs the model called triage_logs, then rebuilt the list of
affected ids with its own script and delivered almost every id in the
log as anomalous. The rule against that was only in SKILL.md, the
result never said where the tool's own list was, and nothing questioned
a list that held nearly the whole population.

- The written list (output_path) carries the evidence per id: templates,
  worst severity, time range, whether routine templates name it too, and
  how much of the population its rarest template touches. output returns
  the path, the count, the total and the share.
- A list holding more than a third of a known population is reported in
  entity_list_warning, uncut and first among the warnings: a criterion
  that matches most entities is not an anomaly criterion. It names the
  two arguments that tighten it, entity_max_share (templates rare
  relative to all entities) and entity_min_level (error-bearing
  templates only). Ids that occur only in anomaly lines are all flagged
  by construction, so that case gets a share_note, not the warning.
- next_step says to deliver or filter the file, or how to get one, and
  not to recompute the list by hand. The same rule is in the tool
  description, which the model reads on every call.
@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

When the model asks log-triage which ids were affected, the tool now writes the list itself, with the evidence for each id, and tells the model to hand that file over rather than rebuild it. A list that names more than a third of all ids is flagged at the top of the result, along with the two arguments that narrow it. Undecodable characters are now counted per file. The logic is sound, the docs agree with each other, and the new behaviour is well tested. Nothing blocks merge.

  • One edge to tidy: if the model has already narrowed the list and it still names over a third of the ids, the warning tells it to pass the same argument again. That costs a second full read of the logs and changes nothing.

Real-world evidence

N/A: no evidence bundle was produced for this run. This verdict rests on static review. The PR description reports an unattended Qwen3.6 run on an HPC log: before, recall was 0.81 and precision 0.03; after, the model delivered the tool's list and the task took half the time. I couldn't run the tests here because pytest isn't installed on this runner, so CI is the check for them.

🔍 Technical details

Issues

🟢 The implausible-list advice repeats a filter already applied (hub/skills/log-triage/log_triage_engine/analysis.py, the implausible = (...) block; report.py _entity_step)

  • Several templates can each stay under entity_max_share=0.33 and still add up to more than a third of all ids.
  • When that happens, both the warning and next_step say "call again with entity_max_share=0.33".
  • Likewise, after entity_min_level="ERROR", the below_error count is 0 and its clause is dropped, but the entity_min_level="ERROR" advice stays.
  • Suggestion: leave out any argument already present in an.entity_max_share / an.entity_min_sev. If both have been applied, say the share is the finding.

🟢 A genuine U+FFFD in the log counts as undecodable (analysis.py, if REPLACEMENT_CHAR in raw)

  • Some tools write the replacement character on purpose. A valid UTF-8 file containing it is then reported as "not valid utf-8".
  • Rare, and the warning only advises re-encoding. Worth a softer wording such as "were read as or contain U+FFFD", or a comment noting the limitation.

🟢 Magic number for ERROR (analysis.py, below_error = sum(1 for tid in per_template if tpl_by_id[tid].sev < 3))

  • 3 is SEVERITY_NAMES.index("ERROR"). Naming it keeps this line correct if the severity table changes.
        below_error = sum(
            1 for tid in per_template if tpl_by_id[tid].sev < SEVERITY_NAMES.index("ERROR")
        )

Checked, no finding

  • Sibling paths: next_step is recomputed after a successful write (tools.py). The not-written and partial paths keep the compact next_step, which correctly offers output_path again. The .txt, .csv and .json writers all return _list_summary().
  • Reassigning broadest from a template id (in the narrowing loop) to a dict happens after the loop ends, so it is safe. The collect closure reads windows and reach, both bound before its first call.
  • _open_text uses errors="replace", so the U+FFFD count is real. f.encoding reports utf-8-sig / utf-16 where a BOM was found.
  • Doc drift: the old "warning that most entities are flagged" wording was replaced in entity-lists.md. SKILL.md, result-fields.md, starter-skills.mdx and the tool docstring all describe the same thresholds and argument names. No stale copy was found under docs/ or hub/.
  • Known bug classes: no new waits, subprocesses or shared files. The written file still goes through skill_context.open_write(..., "x").

Strengths

  • The rule now sits in the tool description and in next_step, not only in SKILL.md. Tests pin this on both the docstring and the loaded agent's registry entry.
  • population_known avoids a false "implausible" when ids only ever appear in anomaly lines. share_note explains that case instead, and a test covers it.
  • Bad tightening values ("loud", 33, -0.1) fail with an error that says what to pass.

The tool description and its output_path argument ran past the 500/160
character limits the lint gate enforces. Same rules, fewer words.
@kovtcharov-amd
kovtcharov-amd merged commit 170a1ff into amd:main Nov 19, 2026
32 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants