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
2 changes: 1 addition & 1 deletion akashic.plugin.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
schema_version = 1
name = "emotion"
version = "3.0.1"
version = "3.0.2"
api_version = 3
entrypoint = "plugin.py"
4 changes: 2 additions & 2 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

api_version = 3
name = "emotion"
version = "3.0.1"
version = "3.0.2"
desc = "Timer-refreshed Emotion context and ordinary Drift preference projection."
DRIFT_PROPOSALS = ServiceKey[DriftProposalServices]("drift.proposals.v1")
DRIFT_WAKE = ServiceKey[DriftWakeServices]("drift.wake.v1")
Expand Down Expand Up @@ -77,7 +77,7 @@ async def apply(ctx: Context, config: object) -> None:
risk="read-write",
search_hint="emotion drift preference feedback",
),
handler=runtime.commit_preference_context,
handler=emotion_commit_preference_context,
)

# 3. Timer/lifecycle/Turn observer 都属于同一个 generation Fiber。
Expand Down
21 changes: 15 additions & 6 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
RuntimeStarted,
RuntimeStopping,
)
from agent.plugin_composition.tool_catalog import PluginTools, _freeze_plugin_tools
from agent.plugin_composition.tool_catalog import (
PluginToolCatalog,
PluginTools,
_freeze_plugin_tools,
)
from agent.plugin_composition.ui_slots import PluginUiSlots
from bus.events_lifecycle import TurnCommitted
from plugins.drift.store import DriftStore
Expand Down Expand Up @@ -104,7 +108,9 @@ def selection(self, accepted_turn: object) -> None:
return None


async def _mount_candidate(tmp_path: Path) -> tuple[CompositionRoot, Path]:
async def _mount_candidate(
tmp_path: Path,
) -> tuple[CompositionRoot, Path, PluginToolCatalog]:
"""Mount the real plugin with candidate Timer and ordinary service atoms."""

root = CompositionRoot("emotion-candidate")
Expand All @@ -131,12 +137,12 @@ async def _mount_candidate(tmp_path: Path) -> tuple[CompositionRoot, Path]:
data_access="read_only",
),
)
_ = _freeze_plugin_tools(
catalog = _freeze_plugin_tools(
tools,
root.instance_token,
{"emotion": root.generation_id},
)
return root, emotion_root
return root, emotion_root, catalog


def _feedback_turn(turn_id: str = "turn-feedback-1") -> TurnCommitted:
Expand Down Expand Up @@ -206,7 +212,10 @@ def test_module_uses_only_ordinary_v3_atoms() -> None:

@pytest.mark.asyncio
async def test_candidate_mount_has_zero_timer_and_zero_workspace_write(tmp_path: Path) -> None:
root, emotion_root = await _mount_candidate(tmp_path)
root, emotion_root, catalog = await _mount_candidate(tmp_path)
binding = catalog.get("emotion_commit_preference_context")
assert binding is not None
assert binding.handler is module.emotion_commit_preference_context
assert not emotion_root.exists()
assert not list(tmp_path.rglob("*.db"))
await root.dispose()
Expand Down Expand Up @@ -1212,7 +1221,7 @@ async def test_feedback_history_composes_in_both_mount_orders_and_uses_timer(
async def test_feedback_history_candidate_handshake_has_zero_timer_and_db(
tmp_path: Path,
) -> None:
root, emotion_root = await _mount_candidate(tmp_path)
root, emotion_root, _ = await _mount_candidate(tmp_path)
history = RecordingHistory([_history_record(1)])
try:
async def provider(ctx: Any) -> None:
Expand Down
Loading