Skip to content
C.W.K.
Stream
Lesson 04 of 04 · published

Quiet Mode and System Lines

~15 min · master-chief, ui, privacy, context-window, notifications, data-modeling

Level 0Visitor
0 XP0/33 lessons0/11 achievements
0/100 XP to next level100 XP to go0% complete

Noise Has More Than One Source

The first three lessons were about what enters the room and what leaves it for the phone. Three smaller mechanisms finish the job, and each came from a moment when the room said something it should not have, or said it in the wrong voice: a warning that repeated itself, a privacy mode that swallowed Dad's own reports, and notices that looked like Pippa talking.

A Warning the Room Cannot Take

Every brain route watches how full the model's context is and, past a threshold, tells Dad: "CTX warning: ... Consider starting a new session before long tool work." In an ordinary conversation that is good advice. In Master Chief it is advice the room cannot take, because there is no new session; the conversation is endless by design and compaction (Track 4) is what holds its pressure. Worse, a long tool turn in the Chief stacked about a dozen of those lines. Each route deduplicated warnings by their whole text, and the text embeds the live token count, so every tool call's usage event looked new. The same logic had been copied into all seven brain routes.

The fix (0a8c4484, 2026-10-10, todo #379) moves the decision into one function, turn_warning(), that every route calls. Master Chief never warns. Everywhere else a warning fires only when the conversation first crosses a threshold (warning, then emergency; 50% and 80% by default, set per brain), at most once per turn, and dropping back below re-arms it. The level map lives in memory, so a restart costs at most one repeat, and the UI gauge still shows the live number to anyone who looks.

Quiet Mode Hides the Room by Name

Quiet Mode is for a screen other people can see: it swaps the active viewer from Dad to a guest view, and every visibility-aware path hides what is not screen-safe. The Chief is Dad's whole working life with Pippa, so it hides too. The 2026-10-08 cold review (finding #12) found two ways that went wrong. A doorway such as Telegram got a refusal it could not explain, and Telegram answered it with "try again in a moment", which sent Dad straight back into the same wall. And Dad's own background deliveries, the cron outcomes, Coop notices and follow-ups, also resolved the Chief as "the viewer", raised a 403, and were silently dropped.

The fix (117bd51e) separates the two questions. A doorway still resolves the Chief as the viewer, and in Quiet Mode it gets a 403 that says what is happening: "Quiet Mode is on: Master Chief stays hidden until it is turned off." Telegram now shows any 403 or 409 reason exactly as written. A report resolves with as_owner=True, which checks ownership (Dad's live Pippa row) instead of visibility. The engine already kept those apart: the viewer is a transient display state, the owner is a permanent fact about who created a row. So a report lands whatever the screen shows, and the room is simply there when Quiet Mode is turned off.

A System Line Is Marked Where It Is Born

Even with all of that right, one thing still read wrong. Coop notices, follow-up alerts, scheduled-task outcomes (approval waits among them) and compaction summaries were stored as plain assistant rows, so every surface drew them as Pippa talking to Dad: a line saying a worker was blocked read as if she had said it. On 2026-10-12 Dad asked, in Master Chief, that every turn that is not real conversation stand out at a glance (todo #406). Commit 5a333570 shipped it the same day, and it is in the code now.

The decision is one column, messages.turn_kind, set on the server where the row is created: coop, followup or task for a report (the drainer reads it off the source key: coop-notify:, followup:, anything else a task), summary for a compaction summary, and null for a turn of the conversation. At every start, init_db classifies unmarked rows of a known source by the same rules, so the 335 Chief reports that already existed, and the old summaries, carried the mark without a separate migration. No surface ever guesses from the text. What the mark changes:

  • Drawing. The WebUI hands a marked row to SystemLineBubble, the phone to SystemLineView: a teal background, a badge (Coop, Follow-up, Scheduled task, Summary) where her avatar would stand, tighter spacing, no Listen, edit or branch controls, and a summary folded shut.
  • Voice. Nothing reads a system line aloud or takes one for her reply; voice playback looks for the last conversation row.
  • Answers. get_assistant_child skips system lines. A Coop notice that drained in while Dad's turn waited for the lock had been hanging off his user row, so turn status could hand it to the phone or the watch as her answer.
  • Telegram never mirrors one (the previous lesson). Coop notices, blockers and task outcomes already reach the phone on their own channels when they are meant to; a follow-up's success line deliberately waits quietly in the room for Dad's next turn.
Decide what a row is where it is born, and let every screen read that decision. A badge guessed from a text prefix drifts the first time someone rewords a notice. A column set by the code that created the row cannot.

Code

Engine excerpt (verbatim, from the system-line module): a report's kind comes from its source key, never from its text·python
def report_kind(source_key: str) -> str:
    """The kind of a Master Chief report row, from its source key (with or
    without the ``chief-report:`` prefix)."""
    source = source_key.removeprefix(CHIEF_REPORT_PREFIX)
    if source.startswith(_COOP_SOURCE):
        return COOP
    if source.startswith(_FOLLOWUP_SOURCE):
        return FOLLOWUP
    return TASK


def classify(role: str, content: str | None, external_request_id: str | None) -> str | None:
    """The kind a row's known source gives it; None for a conversation turn."""
    if role != "assistant":
        return None
    if external_request_id and external_request_id.startswith(CHIEF_REPORT_PREFIX):
        return report_kind(external_request_id)
    if (content or "").startswith(SUMMARY_PREFIXES):
        return SUMMARY
    return None
Engine excerpt (verbatim, the body of turn_warning() after its docstring): never in the Chief, once per threshold crossing, at most one per turn·python
    from services import master_chief

    if not conversation_id or not usage or master_chief.is_chief(conversation):
        return None
    level = _MODE_LEVEL.get(str(usage.get("contextMode") or ""), 0)
    if level == 0:
        _WARNED_LEVEL.pop(conversation_id, None)
        return None
    if level <= _WARNED_LEVEL.get(conversation_id, 0):
        return None
    if any(text.startswith("CTX ") for text in turn_warnings):
        return None
    text = warning_text(usage)
    if not text:
        return None
    _WARNED_LEVEL[conversation_id] = level
    turn_warnings.append(text)
    return text
Engine excerpt (verbatim, the head of resolve()): a doorway resolves as the viewer, a report as the owner·python
QUIET_MODE_REFUSAL = "Quiet Mode is on: Master Chief stays hidden until it is turned off."


async def resolve(store: ConversationStore | None = None, *, as_owner: bool = False) -> ConversationRow:
    """The Chief, created on first use.

    A doorway resolves as the viewer: Quiet Mode and other people must not
    gain Dad's room through a default, and Quiet Mode says so by name.
    ``as_owner`` is Dad's own background delivery (cron, Coop and follow-up
    reports): his whatever the screen shows, so Quiet Mode, a display state
    of his session, never drops one (the 2026-10-08 cold review, #12)."""
    if not as_owner and current_user_id() != "dad":
        if owning_user_id() == "dad" and _quiet_mode_on():
            raise HTTPException(403, QUIET_MODE_REFUSAL)
        raise HTTPException(403, "Master Chief belongs to Dad")
    check = _owned if as_owner else require_visible

External links

Exercise

Open the busiest shared timeline in a system you run (a team chat channel your bots post into, an activity feed, a ticket history). Scroll through fifty entries and mark which were written by a person and which were written by a machine on someone's behalf. Then check how your UI tells them apart today. If the answer is "by the wording" or "by the bot's name", add an explicit kind field where those entries are created, backfill old entries from their known sources, and render the machine entries in a distinct, quieter style.
Hint
Write the backfill as idempotent updates that touch only rows whose kind is still empty, and run them at startup. Then a restore from an older backup classifies itself again, and you never need a one-off migration you will forget to re-run.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign in — Please sign in to comment.

No comments yet — be the first.