Read-only reader for the retired Markdown agent queue.
Purpose
-------
Plan 223 P3 retired the queue machinery: ``oc_chat.core.agent_queue`` and
``oc_chat.scripts.queue_manage`` are deleted and ``agent_queue.md`` is
archived. The M11 legacy migration (:mod:`oc_chat.registry.migrate`) still
has to be able to READ that historical format, so the minimum parser it
needs lives here, with the migration that owns it, rather than keeping a
whole queue subsystem alive for one caller.
This is a legacy-format reader and nothing else: it parses, it never
writes, it has no slot dataclass, no suggester, no pool sidecar, and no
CLI. The queue ``AgentSlot`` dataclass is gone for good (plan 223 W3);
sections here are plain dicts.
Responsibilities
----------------
- :data:`LEGACY_AGENT_POOLS` — the frozen committed roster the migration
projects into registry ``agents`` rows.
- :func:`load_legacy_queue` — parse a queue Markdown file into
``{label: {"pending": [...], "completed": [...]}}``.
- :func:`entry_plan_id` / :func:`parse_entry_overrides` — decode a single
pending bullet, bare or annotated.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - parse lifecycle events
L3 - semantic details
L4 - per-entry tracing
Contracts
---------
- Read-only over every input; a missing file yields empty sections rather
than raising, matching the retired parser's behaviour so the migration's
projection is unchanged.
- Parsing is byte-compatible with the retired ``agent_queue.load_queue``
for the section/bullet grammar the archived file actually uses.
Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
| dict[str, dict[str, list[str]]] oc_chat.registry._legacy_queue.load_legacy_queue |
( |
Path | path | ) |
|
Parse *path* into ``{label: {"pending": [...], "completed": [...]}}``.
Sections are ``## Agent X Queue`` and ``## Agent X Queue, Completed
Tasks``; ``- <entry>`` bullets inside one are collected and every other
line is ignored. A label carrying a section but absent from
:data:`LEGACY_AGENT_POOLS` is still returned, because the archived file
may hold a section for a slot whose registration only ever lived in the
retired sidecar. Completed bullets are stored as bare plan ids.
A missing or unreadable file yields the empty roster rather than
raising: a migration run in a tree without the archived queue projects
no queue entries, which is a true statement about that tree.
Definition at line 166 of file _legacy_queue.py.
| tuple[str | None, str | None, str | None] oc_chat.registry._legacy_queue.parse_entry_overrides |
( |
str | entry | ) |
|
Return ``(model, thinking, session)`` for an annotated pending entry.
An entry reads ``<plan-id> [model=M, thinking=L, session=S]``; any
subset of the annotations may be absent, and an unrecognised session
value is dropped rather than raising, exactly as the retired parser
did (a malformed historical annotation must not fail a migration).
Definition at line 137 of file _legacy_queue.py.