Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(prompt): make uncertainty drive evidence-led judgment (#2054)

Call Whitee9648725eac2
diff --git a/core/prompts/agent-working-principles.md b/core/prompts/agent-working-principles.md
index c35531542..2d08ca6b6 100644
--- a/core/prompts/agent-working-principles.md
+++ b/core/prompts/agent-working-principles.md
@@ -5,6 +5,6 @@ You are a long-lived AGI that exercises independent judgment and takes responsib
- **Take initiative.** Do everything within your capabilities to help the other person, carrying entrusted work through its necessary steps without repeatedly seeking the same permission or expanding the mandate yourself. Weigh the costs of acting, not acting, and interrupting them. Resolve ordinary uncertainty independently; bring recommendations when discussing key matters that need their decision.
- **Reason and choose.** Understand problems through first principles. Choose solutions using Occam’s razor. Seek the smallest complete solution.
- **Follow through.** Maintain ongoing responsibility for entrusted work rather than forgetting it when a turn ends. When repeatedly blocked, revisit assumptions and root causes; when necessary, step back from local details and reconsider the approach from a higher-level perspective. When waiting, define the conditions for resuming; when unable to proceed, explain the blocker.
-- **Verify and communicate.** Confirm outcomes with evidence appropriate to the matter, and be honest about uncertainty. When reporting, lead with the conclusion and explain implications and matters that need the other person's decision.
+- **Verify and communicate.** Proactively seek evidence and deepen understanding. Ground judgments in facts and take responsibility for their reliability and practical value. Turn uncertainty into motivation for exploration and action, rather than an excuse to stop prematurely.
Weigh these principles against the actual context and the user’s preferences, without taking any one principle to an extreme.
diff --git a/tests/test_prompt_render_export.py b/tests/test_prompt_render_export.py
index e04948811..15e1a34ba 100644
--- a/tests/test_prompt_render_export.py
+++ b/tests/test_prompt_render_export.py
@@ -22,6 +22,18 @@ from modules.im import MessageContext
from vibe import cli
+_PREVIOUS_VERIFICATION_PRINCIPLE = (
+ "- **Verify and communicate.** Confirm outcomes with evidence appropriate to the matter, "
+ "and be honest about uncertainty. When reporting, lead with the conclusion and explain "
+ "implications and matters that need the other person's decision."
+)
+_EVIDENCE_LED_PRINCIPLE = (
+ "- **Verify and communicate.** Proactively seek evidence and deepen understanding. "
+ "Ground judgments in facts and take responsibility for their reliability and practical value. "
+ "Turn uncertainty into motivation for exploration and action, rather than an excuse to stop prematurely."
+)
+
+
def _inputs(backend="codex", memory=True, history="managed", skill_mode="pages"):
options = {
"context": {
@@ -141,6 +153,27 @@ def test_custom_instructions_only_change_the_final_content_block(monkeypatch, ba
]
[email protected]("backend", ["claude", "codex", "opencode"])
+def test_evidence_led_principle_is_shared_by_production_export_and_studio(monkeypatch, backend):
+ _environment(monkeypatch)
+ request = _inputs(backend)
+ rendered = render_prompt_context(request)
+ options = dict(request["options"])
+ options["context"] = MessageContext(**options["context"])
+ production = build_system_prompt_injection(agent_instructions=request["agent_instructions"], **options)
+ if backend == "codex":
+ production = CodexAgent._render_developer_prompt_snapshot(production)
+ studio = next(
+ block for block in export_prompt_studio_catalog()["documents"][0]["blocks"]
+ if block["id"] == "runtime-agent-working-principles"
+ )
+ assert rendered["text"] == production
+ assert studio["source_path"] == "core/prompts/agent-working-principles.md"
+ for text in (prompt_text("agent-working-principles"), production, studio["source"]):
+ assert text.count(_EVIDENCE_LED_PRINCIPLE) == 1
+ assert _PREVIOUS_VERIFICATION_PRINCIPLE not in text
+
+
def test_runtime_snapshot_has_only_tags_and_verbatim_content():
prompt = "User-authored 内容 {unchanged}\n"
assert prompt_text("runtime-snapshot-open") == "<avibe_runtime_instructions>\n\n"
@@ -439,7 +472,7 @@ def test_cli_localizes_invalid_context_files(monkeypatch, tmp_path, capsys, lang
assert output.err == cli.i18n_t("debug.cli.error.promptExport", language, error=error) + "\n"
-def test_skill_loading_guidance_preserves_all_other_injection_bytes(monkeypatch):
+def test_approved_guidance_changes_preserve_all_other_injection_bytes(monkeypatch):
outputs = []
changed = {"skills-prompt", "skills-manual-prompt"}
for backend, memory, history, skill_mode in itertools.product(
@@ -447,8 +480,11 @@ def test_skill_loading_guidance_preserves_all_other_injection_bytes(monkeypatch)
):
_environment(monkeypatch, history, skill_mode)
blocks = render_prompt_context(_inputs(backend, memory, history, skill_mode))["blocks"]
- outputs.append("".join(block["text"] for block in blocks if block["id"] not in changed))
+ text = "".join(block["text"] for block in blocks if block["id"] not in changed)
+ assert text.count(_EVIDENCE_LED_PRINCIPLE) == 1
+ outputs.append(text.replace(_EVIDENCE_LED_PRINCIPLE, _PREVIOUS_VERIFICATION_PRINCIPLE))
digest = hashlib.sha256(json.dumps(outputs, ensure_ascii=False).encode()).hexdigest()
# Captured before editing from 1e9ba96bc61b0e86027d4871553e68e8ed85c1ac,
- # omitting only the two approved Skill-loading guidance blocks.
+ # omitting only the two approved Skill-loading guidance blocks and restoring
+ # the previous verification principle. Every other byte/order stays pinned.
assert digest == "fd82657d51e3193f54f939a3f159e7c7034a40d0b44388399e34a4aa17b14ea6"