fix(memory): clarify Dream prompt write permissions (#5734)
* fix(memory): clarify Dream prompt write permissions * refactor(memory): consolidate Dream prompt rules * fix(memory): keep agent prompts focused on executable guidance * fix(memory): limit cleanup to skill instructions
This commit is contained in:
1 parent
3a5b84ce0d
commit
4e865b91ee
5 files changed
+53
-129
No files matched your search
@@ -7,6 +7,8 @@ from datetime import datetime as real_datetime
|
||||
from importlib.resources import files as pkg_files
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from nanobot.agent.context import ContextBuilder
|
||||
from nanobot.runtime_context import RuntimeContextBlock
|
||||
|
||||
@@ -71,15 +73,20 @@ def test_selected_project_path_follows_shared_cache_prefix(tmp_path) -> None:
|
||||
assert prompt_a == builder.build_system_prompt(workspace=project_a)
|
||||
|
||||
|
||||
def test_system_prompt_reflects_current_dream_memory_contract(tmp_path) -> None:
|
||||
@pytest.mark.parametrize("selected_project", [False, True])
|
||||
def test_system_prompt_reflects_current_dream_memory_contract(tmp_path, selected_project) -> None:
|
||||
workspace = _make_workspace(tmp_path)
|
||||
builder = ContextBuilder(workspace)
|
||||
project = tmp_path / "project" if selected_project else workspace
|
||||
project.mkdir(exist_ok=True)
|
||||
|
||||
prompt = builder.build_system_prompt()
|
||||
prompt = builder.build_system_prompt(workspace=project)
|
||||
|
||||
assert "memory/history.jsonl" in prompt
|
||||
assert "automatically managed by Dream" in prompt
|
||||
assert "do not edit directly" in prompt
|
||||
assert (
|
||||
"Only Dream memory-consolidation tasks may edit the profile and long-term memory files "
|
||||
"listed above."
|
||||
) in prompt
|
||||
|
||||
|
||||
def test_provider_context_appended_after_user_content(tmp_path) -> None:
|
||||
|
||||
Reference in new issue
Block a user