fix(deriver): reduce ephemeral explicit observations#445
fix(deriver): reduce ephemeral explicit observations#445Vein05 wants to merge 2 commits intoplastic-labs:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughModified the minimal deriver prompt to extract only durable, long-lived observations (standing instructions, long-lived preferences, relationships, commitments, ongoing situations) and to exclude one-off tasks, temporary workflow steps, and ephemeral session updates unless explicitly stated as enduring. Added corresponding test validating the prompt text. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/deriver/test_prompts.py (1)
1-12: Replace dynamic module loading with standard imports for simplicity.The
importlibpattern here adds unnecessary complexity. Since the project already imports fromsrc.*throughout the test suite, a standard import would be simpler and more maintainable:from src.deriver.prompts import minimal_deriver_promptAdditionally, the bare
asserton line 8 will produce a crypticImportErrororAssertionErrorat test collection time rather than a clear test failure if something goes wrong.♻️ Proposed simplification
-import importlib.util -from pathlib import Path - -_PROMPTS_PATH = Path(__file__).resolve().parents[2] / "src" / "deriver" / "prompts.py" -_PROMPTS_SPEC = importlib.util.spec_from_file_location( - "deriver_prompts", _PROMPTS_PATH -) -assert _PROMPTS_SPEC is not None and _PROMPTS_SPEC.loader is not None -_PROMPTS_MODULE = importlib.util.module_from_spec(_PROMPTS_SPEC) -_PROMPTS_SPEC.loader.exec_module(_PROMPTS_MODULE) - -minimal_deriver_prompt = _PROMPTS_MODULE.minimal_deriver_prompt +from src.deriver.prompts import minimal_deriver_prompt🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/deriver/test_prompts.py` around lines 1 - 12, Replace the dynamic import block (_PROMPTS_PATH, _PROMPTS_SPEC, _PROMPTS_MODULE and the assert + exec_module calls) with a normal import statement that directly imports minimal_deriver_prompt from src.deriver.prompts (e.g. from src.deriver.prompts import minimal_deriver_prompt); remove the manual spec/loader assertions and exec_module usage so import errors surface as normal ImportError during test collection instead of relying on the bare assert.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/deriver/test_prompts.py`:
- Around line 1-12: Replace the dynamic import block (_PROMPTS_PATH,
_PROMPTS_SPEC, _PROMPTS_MODULE and the assert + exec_module calls) with a normal
import statement that directly imports minimal_deriver_prompt from
src.deriver.prompts (e.g. from src.deriver.prompts import
minimal_deriver_prompt); remove the manual spec/loader assertions and
exec_module usage so import errors surface as normal ImportError during test
collection instead of relying on the bare assert.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 46b7290d-f7c0-499e-90d7-586dbd0271b8
📒 Files selected for processing (2)
src/deriver/prompts.pytests/deriver/test_prompts.py
|
@VVoruganti what would you suggest here? I'm getting a when i try to import from src it through Thanks! |
Summary
Closes #444
Validation
uv run ruff check src/deriver/prompts.py tests/deriver/test_prompts.py tests/deriver/test_representation_crud.pyuv run pytest --noconftest -n0 tests/deriver/test_prompts.py tests/deriver/test_representation_crud.py -quv run pytest -n0 tests/deriver -qAll tests passed.
Notes
Summary by CodeRabbit
Bug Fixes
Tests