Skip to content

"What changed since last note" delta blocks — versioned thesis, target, estimate, and risk diffs #26

@DogInfantry

Description

@DogInfantry

Summary

Add delta blocks to each generated note that show what changed since the previous run: target price movement, thesis changes, estimate revisions, and risk flag additions/removals.

Motivation

A research engine that tracks its own thesis drift is objectively more useful than one that produces isolated snapshots. The repo's active release history and versioned outputs already imply this capability — this issue formalises it. It also signals to reviewers that the system is designed for ongoing coverage, not one-shot generation.

Proposed Architecture

trg_workbench/versioning/
├── note_store.py           # Save/load note metadata snapshots to data/history/{ticker}/
├── delta_engine.py         # Diff current note vs prior snapshot
└── delta_renderer.py       # Render delta blocks in HTML note

Delta Block Format (HTML note)

┌─ WHAT CHANGED SINCE 2026-04-01 NOTE ──────────────────────────┐
│ Target Price:    $215 → $208  (−7.00)  [Valuation compression]
│ Rating:          BUY → BUY    (no change)
│ FY26E EPS:       $6.82 → $6.71 (−1.6%)  [Estimate cut post Q1]
│ Risk flags:      + Added: "China tariff exposure"
│                  - Removed: "Supply chain disruption"
│ Thesis:          No material change
└──────────────────────────────────────────────────────────┘

Acceptance Criteria

  • note_store.py saves a metadata snapshot (target, rating, key estimates, risk flags) per ticker per run
  • delta_engine.py diffs current snapshot vs most recent prior snapshot
  • Delta block rendered at top of HTML note (below exec summary, above main body)
  • First run for a ticker shows "No prior note found — establishing baseline"
  • Delta also exported to outputs/{ticker}_delta.json
  • Unit tests covering diff logic for all delta types (target, rating, estimates, risk flags)
  • Snapshots stored in data/history/{ticker}/YYYY-MM-DD.json format

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions