Conversation
…oints, telegram Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ery API Add event_id/trace_id/caused_by fields to Event dataclass and ORM model, enabling causal chain reconstruction across the event bus. Root events (turn_completed, session_ended, heartbeat_tick, sleep_started) set trace_id=event_id; child handlers propagate trace_id and set caused_by to parent event_id. Three new REST endpoints for trace queries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ore, endpoints Adds structured logging of what the LLM actually sees on each API call: - ContextLogger with section parsing, token estimation, ring buffer payload store - 5 REST endpoints (/context/log, detail, payload, sections, diff) - Runner integration storing context metadata per turn - Telegram formatting for context summaries - Config settings for enable/disable, full payload capture, retention Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r, heartbeat check Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review fixes: - P1-A: Add agent_id filter to all behavior_snapshots queries - P2-A: Persist anomalies to DB (reorder detect before store) - P2-B: Wire update_response in runner tool loop - Clean exports in observability/__init__.py Docs: - Mark all F035 sub-specs as SHIPPED - Add implementation plan Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ces, drift, context Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements F035 Observability with all 4 sub-features, giving Nous full visibility into what its autonomous systems are doing and what the LLM actually sees.
F035.1 — Event Bus Observability
EventBusStatswith in-memory counters, per-handler success/error/timing, ring buffer of recent eventsEventBus._dispatchand_safe_handle(zero-allocation hot path)get_stats()on SessionTimeoutMonitor, SleepHandler, HeartbeatRunnerGET /events/stats,GET /events/recentendpointsformat_event_bus_status()for Telegram/statusF035.2 — Causal Chain Tracing
event_id(12-char hex),trace_id,caused_byon Event dataclass + ORM modelmodifiesin dataGET /events/trace/{id},GET /events/recent-traces(CTE query),GET /events/modificationsF035.3 — Behavioral Drift Detection
BehaviorSnapshot(27 metrics),DriftDetector(z-score analysis, per-metric thresholds)BehaviorDriftCheckas heartbeat check — captures snapshots, stores to DB, detects anomaliesGET /behavior/snapshot/latest,/behavior/trends,/behavior/anomalies,/behavior/drift-reportF035.4 — Context Visibility
ContextLoggerwith section parser, token estimation, ring buffer for full payloads_build_api_payload()— logs every API call with token breakdown by sectionupdate_response()wired to capture actual vs estimated tokens after API returns_sync_entries_index)GET /context/log,/context/log/{id},/context/log/{id}/payload,/context/log/{id}/sections,/context/diffReview Process
New Files
nous/observability/__init__.py,context_logger.py,snapshots.py,drift.pysql/migrations/026_observability.sqltests/test_event_bus_observability.py,test_causal_tracing.py,test_context_logger.py,test_drift_detection.pyModified Files (15)
nous/events.py— EventBusStats + Event causal fieldsnous/storage/models.py— ORM Event columnsnous/brain/brain.py— emit_event passthroughnous/api/rest.py— 15 new endpointsnous/api/runner.py— context logger hook + update_responsenous/config.py— 7 new settingsnous/main.py— wiring for all componentsnous/telegram_bot.py— 3 formatting functionsnous/heartbeat/runner.py,checks.py— stats + drift checknous/handlers/*— trace propagationnous/cognitive/layer.py— root event trace IDsTest plan
🤖 Generated with Claude Code