Skip to content

feat(core): loop suite, observability and memory P1 modules (split from #181) - #190

Open
raymondginger2018-sudo wants to merge 4 commits into
HKUDS:mainfrom
raymondginger2018-sudo:pr181/loop
Open

feat(core): loop suite, observability and memory P1 modules (split from #181)#190
raymondginger2018-sudo wants to merge 4 commits into
HKUDS:mainfrom
raymondginger2018-sudo:pr181/loop

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Summary

The wiring part of #181, split per maintainer review so the two independent modules (keyring, classifier) can merge first. Contains the P1 course modules that touch existing behavior, kept together because they share the compaction/observability path:

  • P1-5 compaction-as-memory: runner.py gains AgentRunSpec.compaction_summary_sink + _notify_compaction_summary; session.py builds the sink that appends summaries to the memory vault (memory_distill.py) and fires the memory.compaction.deposited event via observability/events.py.
  • P1-4 tool-loop temperature: _DEFAULT_TOOL_LOOP_TEMPERATURE = 0.1 used only when the execution profile does not set one.
  • P1-3 memory data boundary: memory.py wraps memory notes in a framed, explicitly-untrusted data block (injection_regression.render_data_block); the upstream framing assertion test_every_injected_instruction_source_is_framed stays green.
  • P1-6/7/8 loop suite: loop/goal_file.py, optimizer.py, evaluation.py, retrieval_evaluation.py, cerebellum_optimizer.py, injection_regression.py, memory_retrieval.py.
  • P1-2/9 MCP: server allowlist (mcp/naming.py + runtime.py) and tool description quality (tools/base.py + mcp/tools.py).
  • agent_setup.py: system-prompt integrity clause.

Tests

  • 132 module tests pass locally (observability, compaction-memory, memory_distill ×2, optimizer, evaluation, retrieval_evaluation, cerebellum_optimizer, goal_file, injection_regression, memory_retrieval, mcp allowlist, tool description quality)
  • 17 memory regression tests pass, incl. test_every_injected_instruction_source_is_framed
  • 78 harness/compaction regression tests pass (1 pre-existing env failure on clean base)

Dependency note

session.py imports core.observability.events (this PR); it already contains an explicit no-op fallback so merge order vs. #183 is irrelevant.

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor Author

CI status note for the wiring split of #181:

As noted in the description, this PR keeps the explicit no-op fallback for the core.observability.events import, so merge order vs #183/#188/#189 remains safe. @Zongwei9888 happy to take this one last, after the two independent modules.

HKUDS#181)

P1 course modules that wire into existing behavior, kept together so the
smaller independent PRs (#keyring, #classifier) can merge first:
- observability/events.py: emit_event bus (used by P1-5 deposit event)
- memory_distill.py: compaction summaries -> memory vault (P1-5)
- loop/: optimizer/evaluation/retrieval_evaluation/cerebellum_optimizer/
  goal_file/injection_regression/memory_retrieval (P1-6/7/8)
- runner.py/session.py: compaction_summary_sink + tool-loop temperature
  default (P1-4/5)
- memory.py: P1-3 data boundary around memory notes (framed + untrusted)
- mcp/: server allowlist + description quality (P1-2/9)
- agent_setup.py: system-prompt integrity clause

132 module tests + 17 memory regression tests pass; framing assertion
test_every_injected_instruction_source_is_framed stays green.
@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor Author

Hi Zongwei, this is the loop suite + observability + memory P1 modules split from #181. Wires into existing behavior but keeps an explicit no-op fallback for the observability import so it is safe regardless of merge order. Rebased onto latest main (e0767d0), all tests green (3.12/3.13/3.14). The lint failure is a pre-existing N999 issue on upstream main, not caused by this PR. Ready for review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant