Skip to content

feat: PRD §42 OperationTimeline read-model + boot wiring (default-FALSE) - #35182

Open
drussell23 wants to merge 1 commit into
mainfrom
ouroboros/prd-42-operation-timeline
Open

feat: PRD §42 OperationTimeline read-model + boot wiring (default-FALSE)#35182
drussell23 wants to merge 1 commit into
mainfrom
ouroboros/prd-42-operation-timeline

Conversation

@drussell23

@drussell23 drussell23 commented May 17, 2026

Copy link
Copy Markdown
Owner

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) under try/except (boot never fails).
  • serpent_flow.py / ide_observability*.py / session_recorder.py / orchestrator.py — read-only surfaces + telemetry.
  • PRD §42 slice; test_operation_timeline.py (NEW) + test_last_session_summary_v1_1a.py contract update.

Safety

Authority-free read-model. Master-flag-gated JARVIS_OPERATION_TIMELINE_ENABLED default-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's orchestrator.py/harness.py changes — 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 behind JARVIS_OPERATION_TIMELINE_ENABLED (default false). No behavior changes by default.

  • New Features

    • New operation_timeline.py with get_default_timeline() and disk replay_from_disk() for cross-session recovery.
    • Composite observer fan-out via add_ops_digest_observer; SessionRecorder remains and implements a no-op on_op_classified.
    • New on_op_classified callback; emitted from orchestrator at the INTENT seam to capture the signal → op edge.
    • Boot wiring in harness.py registers the timeline and replays the durable index; failures are contained.
    • IDE: GET /observability/timeline and SSE operation_timeline_row for live updates; serpent_flow supports timeline expand.
  • Migration

    • To enable, set JARVIS_OPERATION_TIMELINE_ENABLED=true.
    • No other changes required; the timeline joins the existing observer chain.
    • Access the data at /observability/timeline or via SSE operation_timeline_row.

Written for commit 9d455e4. Summary will update on new commits. Review in cubic

…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]

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown

📊 PR Size Analysis

Size: XL
Files Changed: 11
Lines Added: +2296
Lines Deleted: -1
Total Changes: 2297

⚠️ This PR is very large. Consider breaking it into smaller PRs for easier review.

Review Checklist

  • All tests passing
  • Code follows project style guidelines
  • Documentation updated if needed
  • No sensitive data exposed
  • Breaking changes documented

@github-actions

Copy link
Copy Markdown

💡 PR Description Suggestions

Consider improving your PR description:
- Add a summary section
  • Add a testing section

    Template:

    ## Summary
    Brief description of changes
    
    ## Changes Made
    - Change 1
    - Change 2
    
    ## Test Plan
    How to verify these changes
    
    ## Related Issues
    Closes #123
    

@github-actions

Copy link
Copy Markdown

💡 PR Description Suggestions

Consider improving your PR description:
- Add a testing section

**Template:**
```
## Summary
Brief description of changes

## Changes Made
- Change 1
- Change 2

## Test Plan
How to verify these changes

## Related Issues
Closes #123
```

@github-actions

Copy link
Copy Markdown

🚨 CI/CD Failure Detected

The Database Connection Validation workflow failed for this PR.

Action Required

A tracking PR has been automatically created to help resolve this issue:
🔗 #35188

Quick Links

Please review the analysis and implement the suggested fixes.


🤖 Auto-generated by JARVIS CI/CD Manager

@github-actions

Copy link
Copy Markdown

🚨 CI/CD Failure Detected

The Environment Variable Validation workflow failed for this PR.

Action Required

A tracking PR has been automatically created to help resolve this issue:
🔗 #35190

Quick Links

Please review the analysis and implement the suggested fixes.


🤖 Auto-generated by JARVIS CI/CD Manager

@github-actions

Copy link
Copy Markdown

🤖 CI/CD Pipeline Results

Status: success
Branch: 35182/merge
Commit: a1b793b4897ca2df989b3bd8756c34c36429a89e

Pipeline Stages

  • Code Quality: ❌
  • Build & Test: ❌
  • Architecture: ❌
  • Security Scan: ❌

View full workflow run

@github-actions

Copy link
Copy Markdown

🚨 CI/CD Failure Detected

The Validate Configuration workflow failed for this PR.

Action Required

A tracking PR has been automatically created to help resolve this issue:
🔗 #35194

Quick Links

Please review the analysis and implement the suggested fixes.


🤖 Auto-generated by JARVIS CI/CD Manager

@github-actions

Copy link
Copy Markdown

🚨 CI/CD Failure Detected

The 🎨 Advanced Auto-Diagram Generator workflow failed for this PR.

Action Required

A tracking PR has been automatically created to help resolve this issue:
🔗 #35195

Quick Links

Please review the analysis and implement the suggested fixes.


🤖 Auto-generated by JARVIS CI/CD Manager

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant