Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions emrg/server/feishu_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ in the usual install locations before calling it blocked.
start a fresh authorisation on one `missing` answer: it changes the host's account state,
and the wrong `HOME` reproduces the symptom whatever the token says.
- A round that reads nothing must say so.
- **An empty answer is a reading only once the interface has been shown to work.** A listing
that comes back with nothing proves nothing by itself: a quiet conversation, a token valid
under one `HOME` and missing under another, and a lagging index all answer the same way.
Before reporting that nothing arrived, read one conversation known to hold messages — a call
that returns them is what makes "nothing new" mean nothing arrived rather than nothing was
readable. Do it when a listing comes back empty, or when the index or the account is in
doubt; it checks the instrument, and is never instead of the round's own reading.

### 2. Judge

Expand Down
35 changes: 35 additions & 0 deletions tests/test_feishu_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,41 @@ def test_both_templates_that_forbid_a_slowdown_give_the_same_answer():
)


#: The rule that tells a round how to read an empty answer: one conversation known to hold
#: messages, read before "nothing arrived" is reported.
POSITIVE_CONTROL_MARK = "known to hold messages"


def test_the_template_says_an_empty_answer_needs_a_positive_control():
"""§1 says a round that reads nothing must say so — and said nothing about how to know.

A zero from a listing is the same answer a genuinely quiet conversation, a token valid
under another `HOME` and a lagging index all give. Without this sentence a round reports
"nothing arrived" on an instrument it never checked, and this task's whole product is the
difference between a quiet inbox and an unread one.
"""
text = PROMPT.read_text(encoding="utf-8")
section = text[text.index(FIRST_STEP) :]
assert "reads nothing must say so" in section, (
"§1 lost the sentence this rule qualifies — the positive control is owed precisely "
"because an empty round has to be reported, and an unchecked empty report is not a "
"reading"
)
assert POSITIVE_CONTROL_MARK in section, (
"§1 no longer says how to tell an empty answer from an unreadable one — read one "
"conversation known to hold messages before reporting that nothing arrived"
)


def test_the_positive_control_reaches_the_round_and_not_merely_the_file(rendered):
"""The same requirement on the prompt a round is sent: a Jinja construct hides it in the file."""
assert POSITIVE_CONTROL_MARK in rendered, (
"the rendered Feishu prompt lost the positive-control sentence — a round is told an "
"empty round is a correct round and given no way to know the round was empty rather "
"than blind"
)


def test_the_cadence_scanner_answers_both_ways():
"""The device earns its verdict: a block is found, and its absence is not silence.

Expand Down
Loading