oc_chat
Loading...
Searching...
No Matches
work_queue_file.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# oc_chat/core/work_queue_file.py
4
5# OCT-LINT: disable=tests_exist reason="Re-export shim; the module it names is covered by oc_orchestrator/tests/, and this path by test_271_queue_shims.py"
6"""
7The queue's file backend. — moved to :mod:`oc_orchestrator.work_queue_file`.
8
9Purpose
10-------
11Plan 271 P3. This module's code now lives in the standalone
12``oc_orchestrator`` package; this file keeps
13``oc_chat.core.work_queue_file`` working for every importer that has
14always spelled it that way — ``scripts/hub_manage.py`` among them, until
15plan 272 moves the hub and rewrites its imports.
16
17It is a REBINDING, not a wrapper, for the reasons
18``core/work_queue.py`` gives: the last statement replaces this module's
19entry in :data:`sys.modules` with the moved module itself, so the two
20paths are one object and every private name, ``monkeypatch`` and
21``isinstance`` keeps working across the seam.
22
23Responsibilities
24----------------
25- Bind the moved module to this path. Nothing else: no behaviour, no
26 defaults, no wiring.
27
28Diagnostics
29-----------
30Domain: OC_CHAT.MAIN
31Levels:
32 L2 - lifecycle events
33 L3 - semantic details
34 L4 - deep tracing (the rebinding)
35
36Contracts
37---------
38- Retirement rule (plan 271 P3, the plan-270 rule carried forward): this
39 path stays until an explicit retirement plan retargets its importers.
40 Nothing new should import it — new code names
41 ``oc_orchestrator.work_queue_file`` directly.
42- Adds no behaviour of its own, so it can never drift from the module
43 it names. :data:`DEFAULT_QUEUE_DIR` in particular is the package's,
44 not a second copy: a caller that monkeypatches it through this path
45 patches the one the backend reads.
46
47Dependencies
48------------
49- oc_diagnostics (structured debug logging via _dbg)
50- oc_orchestrator.work_queue_file (the moved module this path binds)
51"""
52
53from __future__ import annotations
54
55import sys
56
57from oc_diagnostics import _dbg
58
59from oc_orchestrator import work_queue_file as _moved
60
61_dbg(
62 "OC_CHAT.MAIN",
63 "module",
64 "work_queue_file shim -> oc_orchestrator.work_queue_file",
65 4,
66)
67
68sys.modules[__name__] = _moved