feat: PRD §42 OperationTimeline read-model + boot wiring (default-FALSE) - #35182
feat: PRD §42 OperationTimeline read-model + boot wiring (default-FALSE)#35182drussell23 wants to merge 1 commit into
Conversation
…wiring OperationTimeline causal read-model (Gap #1): a durable cross-session "what did O+V do while I was away" scrub built as a read-only observer on the existing ops-digest fan-out -- coexists with SessionRecorder via the composite seam, does NOT evict it. * operation_timeline.py: get_default_timeline() + replay_from_disk() durable causal index. * ops_digest_observer.py: composite observer seam (add_ops_digest_ observer) so the timeline joins the fan-out without displacing existing consumers. * harness.py: boot-time wiring (section 707) -- add the timeline to the fan-out and replay the durable index on boot. Internally master-flag- gated (default-FALSE): a no-op until JARVIS_OPERATION_TIMELINE_ENABLED =true. try/except so boot never fails on wiring. * serpent_flow.py / ide_observability*.py / session_recorder.py / orchestrator.py: read-only surfaces + telemetry plumbing. * PRD section 42 slice; test_operation_timeline.py (38) + test_last_session_summary_v1_1a.py contract update. Authority-free read-model; zero behavior change at default. Spine: 59/59 green on the isolated branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> [integrity-verified: fc74e074a3eb]
There was a problem hiding this comment.
2 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/core/ouroboros/governance/operation_timeline.py">
<violation number="1" location="backend/core/ouroboros/governance/operation_timeline.py:623">
P2: `replay_from_disk()` reads the full JSONL file before applying `max_rows`, defeating the bounded tail-scan and risking high memory usage on large files.</violation>
</file>
<file name="backend/core/ouroboros/battle_test/harness.py">
<violation number="1" location="backend/core/ouroboros/battle_test/harness.py:725">
P2: Guard timeline wiring/replay behind `is_enabled()`; it currently does disk replay even when the master flag is off.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
| if not path.exists(): | ||
| return 0 | ||
| try: | ||
| text = path.read_text(encoding="utf-8") |
There was a problem hiding this comment.
P2: replay_from_disk() reads the full JSONL file before applying max_rows, defeating the bounded tail-scan and risking high memory usage on large files.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/core/ouroboros/governance/operation_timeline.py, line 623:
<comment>`replay_from_disk()` reads the full JSONL file before applying `max_rows`, defeating the bounded tail-scan and risking high memory usage on large files.</comment>
<file context>
@@ -0,0 +1,815 @@
+ if not path.exists():
+ return 0
+ try:
+ text = path.read_text(encoding="utf-8")
+ except OSError:
+ return 0
</file context>
| ) | ||
| _timeline = get_default_timeline() | ||
| add_ops_digest_observer(_timeline) | ||
| _replayed = _timeline.replay_from_disk() |
There was a problem hiding this comment.
P2: Guard timeline wiring/replay behind is_enabled(); it currently does disk replay even when the master flag is off.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/core/ouroboros/battle_test/harness.py, line 725:
<comment>Guard timeline wiring/replay behind `is_enabled()`; it currently does disk replay even when the master flag is off.</comment>
<file context>
@@ -707,6 +707,28 @@ def _harness_loop_exception_handler(loop_, ctx_):
+ )
+ _timeline = get_default_timeline()
+ add_ops_digest_observer(_timeline)
+ _replayed = _timeline.replay_from_disk()
+ logger.debug(
+ "operation_timeline wired (replayed %d rows)", _replayed,
</file context>
📊 PR Size AnalysisSize: Review Checklist
|
💡 PR Description Suggestions
|
💡 PR Description Suggestions |
🚨 CI/CD Failure DetectedThe Database Connection Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🚨 CI/CD Failure DetectedThe Environment Variable Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🤖 CI/CD Pipeline ResultsStatus: success Pipeline Stages
|
🚨 CI/CD Failure DetectedThe Validate Configuration workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🚨 CI/CD Failure DetectedThe 🎨 Advanced Auto-Diagram Generator workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
PRD §42 — OperationTimeline read-model + boot wiring
Single commit on top of
main(post-integration, post-Phase-D-PR). Causal cross-session "what did O+V do while I was away" read-model.What
operation_timeline.py(NEW) —get_default_timeline()+replay_from_disk()durable causal index.ops_digest_observer.py— composite observer seam (add_ops_digest_observer); timeline joins the fan-out without evicting SessionRecorder.harness.py— boot wiring (~§707) undertry/except(boot never fails).serpent_flow.py/ide_observability*.py/session_recorder.py/orchestrator.py— read-only surfaces + telemetry.test_operation_timeline.py(NEW) +test_last_session_summary_v1_1a.pycontract update.Safety
Authority-free read-model. Master-flag-gated
JARVIS_OPERATION_TIMELINE_ENABLEDdefault-FALSE → byte-identical no-op when off. Zero behavior change at default; no authority coupling.Spine
59/59 green on the post-integration base. Import coexistence with the merged integration verified.
Merge order
Last — after integration (#35154 ✅) and Phase D (#35180). Rebased clean onto current
main(no conflicts with the integration'sorchestrator.py/harness.pychanges — parallel regions).🤖 Generated with Claude Code
Summary by cubic
Adds the OperationTimeline read-model for a durable, causal index of
signal → op → apply/verify/commit, wired into the ops-digest fan-out and IDE observability behindJARVIS_OPERATION_TIMELINE_ENABLED(default false). No behavior changes by default.New Features
operation_timeline.pywithget_default_timeline()and diskreplay_from_disk()for cross-session recovery.add_ops_digest_observer;SessionRecorderremains and implements a no-opon_op_classified.on_op_classifiedcallback; emitted fromorchestratorat the INTENT seam to capture thesignal → opedge.harness.pyregisters the timeline and replays the durable index; failures are contained./observability/timelineand SSEoperation_timeline_rowfor live updates;serpent_flowsupports timeline expand.Migration
JARVIS_OPERATION_TIMELINE_ENABLED=true./observability/timelineor via SSEoperation_timeline_row.Written for commit 9d455e4. Summary will update on new commits. Review in cubic