Skip to content

Commit cc8bd2f

Browse files
loopx-agenthuangruiteng
authored andcommitted
test(prompts): align consumer checks with retained input contracts
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
1 parent 3344f54 commit cc8bd2f

4 files changed

Lines changed: 45 additions & 26 deletions

File tree

‎docs/development/testing-and-quality.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,24 @@ fields; this does not introduce a new telemetry system or receipt gate.
13131313

13141314
### Budget Failure Decisions
13151315

1316+
The fixed visible-Goal host fixture's 3,200-character regression guard predates
1317+
`1d5d2d0f6`, which adds the known Todo choice to the first current guard. On the
1318+
same four host inputs at `b201da8ba`, substituting only the pre-change dispatch
1319+
rule gives 3,199 / 3,177 / 2,966 / 2,895 normalized body characters; the complete
1320+
current rule gives 3,262 / 3,240 / 3,029 / 2,958. The 63-character increase teaches
1321+
an already-known choice before admission, while retaining selection/reentry,
1322+
ordered settlement, exact identities, actual outcomes and ambiguous-effect
1323+
recovery. Preserve the original 3,200-ceiling failure; calibrate only this test's
1324+
regression allowance to 3,300, leaving 38 characters above the largest fixed
1325+
input. Production prompt bytes, the 4,000-character host limit, longer-route
1326+
checks, execution authority and frozen qualification results remain unchanged.
1327+
This is no output reduction or model-compliance qualification.
1328+
1329+
相同四个宿主输入中,首次 guard 的已知 Todo 选择指引增加 63 个归一化字符,
1330+
最大值从 3,199 变为 3,262。保留原 3,200 超限失败,仅将该固定测试的回归预算
1331+
校准为 3,300,留 38 字符余量;不删指令,不改生产正文、4,000 宿主硬边界、
1332+
长路径检查、执行权限或冻结资格结果,也不据此声称输出节省或模型遵从。
1333+
13161334
The actual-default model portfolio retains the complete capability candidate
13171335
context required by the shared diagnostic projection. On the unchanged three
13181336
noisy fixtures, `74b3d526ab1c1fd3d5f96308bef2482fcad7e636` emitted 4,944 /

‎tests/control_plane/test_heartbeat_brief_budget.py‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import annotations
33

44
import contextlib
5-
import hashlib
65
import io
76
import json
87
import shlex
@@ -93,26 +92,27 @@ def test_brief_keeps_complete_routes_with_128_character_windows_root() -> None:
9392
assert json.loads(encoded) == payload
9493
root, _, _, _ = _windows_routes()
9594
assert encoded.count(json.dumps(root)[1:-1]) == 20
96-
# The unchanged fixture on main b5a1a816a measures 10,522 JSON chars and
97-
# 8,579 Markdown. The complete outcome paragraph adds 523 body/Markdown
98-
# chars; omitting absent brief metadata saves 35 JSON chars: 11,010/9,102.
99-
# The later diagnostic-only renderer change retains that full body and JSON,
100-
# prints an identical active/resolved path once and omits absent pre-quota
101-
# metadata: Markdown is 8,867 chars. The expected output was derived from
102-
# b16aeb3's frozen 9,102-char rendering using only those two substitutions.
103-
# These hashes retain every prior clause and route, plus the reviewed
104-
# instruction transition. This is a synthetic spelling, not a Windows run.
105-
assert hashlib.sha256(payload["task_body"].encode()).hexdigest() == (
106-
"cfc65091d2710ef298174e6a5280edf55f6cc7acdce8e5688a2ae213b5f4b4ac"
107-
)
108-
assert hashlib.sha256(markdown.encode()).hexdigest() == (
109-
"e5c10d37ed7cef08e8fa56a450f3c119de92d1ef99e3516ff6b106a8853c8186"
110-
)
111-
# fd1b23b59 raised the existing body allowance, preserving every clause.
112-
# Only that diagnostic number differs from the earlier frozen rendering.
113-
assert hashlib.sha256(markdown.replace("max_chars=`5400`", "max_chars=`4800`").encode()).hexdigest() == (
114-
"29604e41d97963976ab8911e69c6328421aeaf63053cdb12c197dbe9b5291b9b"
115-
)
95+
# Assert the decision obligations rather than a hash of dated prose.
96+
# The full body must reach Markdown, with its executable guard only once.
97+
body = payload["task_body"]
98+
assert body in markdown
99+
assert markdown.count(payload["quota_guard_command"]) == 1
100+
for obligation in (
101+
"true=work+writeback; only false permits no-op",
102+
"Read agent_channel.work_context and required_reads (or envelope) before work",
103+
"retain original and cumulative outcome requirements",
104+
"reuse inline goal_acceptance, inspect only if absent, then refine",
105+
"Known new-Turn choice: add `--todo-id <id>` to first guard; otherwise",
106+
"use selection_command when required; re-enter as instructed, do/verify authorized work",
107+
"Settle with current settlement_plan.ordered_steps, else next_cli_actions",
108+
"preserve exact identities/effect ids and actual outcomes",
109+
"Never reconstruct static refresh/spend; ambiguous effects need readback/recovery, not blind retry",
110+
"Todo done≠Turn settled; no invented successor/--no-follow-up",
111+
"No wait spend",
112+
"Finish Goal only on terminal no-follow-up",
113+
"Destructive Git/production requires explicit authorization",
114+
):
115+
assert obligation in body, obligation
116116
spec = CLI_OUTPUT_MODE_VARIANT_BY_ID["heartbeat_prompt_brief"]
117117
assert spec.max_chars == {"json": 11_400, "markdown": 9_600}
118118
for output_format, text in (("json", encoded), ("markdown", markdown)):

‎tests/test_chat_turn_steering.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def record_write(self, payload):
397397
initial_text = starts[0]["input"][0]["text"]
398398
assert "LoopX context (supporting context only):" in initial_text
399399
assert "Inspect a bounded task." in initial_text
400-
assert initial_text.endswith("Current user message: wait for steer")
400+
assert initial_text.endswith("Current user message:\nwait for steer")
401401
updates = [row["params"] for row in writes if row.get("method") == "turn/steer"]
402402
assert updates == [{
403403
"threadId": session.thread_id,

‎tests/test_host_loop_activation.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,11 @@ def test_goal_hosts_reuse_thin_dispatch_and_stay_compact() -> None:
450450
"preserve exact identities/effect ids",
451451
):
452452
assert obligation in payload["task_body"]
453-
# Current authority/continuation clauses fit 3,200 normalized
454-
# chars on this fixed fixture. Keep a tight regression guard and the
455-
# native host's separate hard cap, without shortening those obligations.
456-
assert payload["interface_budget"]["budget_char_count"] <= 3_200
453+
# The known first-guard choice adds 63 useful normalized characters:
454+
# the largest fixed host fixture is 3,262, leaving 38 under this
455+
# regression allowance. Keep the native host's hard cap separate.
456+
assert "Known new-Turn choice: add `--todo-id <id>` to first guard" in payload["task_body"]
457+
assert payload["interface_budget"]["budget_char_count"] <= 3_300
457458
assert payload["interface_budget"]["max_chars"] == 4_000
458459
assert payload["interface_budget"]["within_budget"] is True
459460

0 commit comments

Comments
 (0)