The official AGENTS.md template uses '## Every Session' and '## Safety',
but post-compaction context extraction expects '## Session Startup' and
'## Red Lines'. This causes workspaces using the official template to
lose startup context and safety rules after compaction.
Changes:
- Rename template sections to match code expectations (both EN and zh-CN)
- Add legacy fallback: code now tries 'Every Session'/'Safety' when
'Session Startup'/'Red Lines' are not found (backward compatible)
- Add tests for legacy fallback and precedence when both exist