fix(P2-3): check [SKILL_PRUNED] marker directly in summary, not skill_view(name)

The P1 Skill Safety Rule only triggers on [SKILL_PRUNED].
Checking skill_view(name='...') in the LLM summary is insufficient —
the LLM can mention a skill name without the canonical marker, causing
the re-injection to be skipped while P1 remains inactive.

Use the simpler and more correct check: '[SKILL_PRUNED]' not in summary.
Fixes #32106.
This commit is contained in:
Jonathan Boisson 2026-06-11 11:58:08 +02:00
parent 57b0ac2b8d
commit 52341f6ca3

View file

@ -1691,10 +1691,10 @@ This compaction should PRIORITISE preserving all information related to the focu
# Defensive: append canonical markers so the system Skill Safety Rule
# can detect them. Fixes #32106 (Ghost Skill — summary loss).
if _pruned_skill_names:
_has_markers = all(
f"skill_view(name='{sn}')" in summary for sn in _pruned_skill_names
)
if not _has_markers:
# The P1 Skill Safety Rule only triggers on [SKILL_PRUNED].
# Merely mentioning a skill name is not enough — the marker
# must survive. Re-inject if the canonical marker is absent.
if "[SKILL_PRUNED]" not in summary:
_ps = []
for sn in _pruned_skill_names:
_ps.append(