Plan: Merge learning-finance into PKM

Context

Two separate Quartz-rendered vaults exist:

  • PKM (code/pkm) — Obsidian vault published to vault.edmondo.lol. Has 2 - Areas/ (Tech, Math, Cooking, etc.), 3 - References/, interactive Marimo notebooks under code/, and a Quartz build at quartz-publisher/source/.
  • learning-finance (code/learning-finance) — Quartz site with markdown articles under content/, Marimo notebooks under notebooks/, Manim animations under animations/. Has its own pyproject.toml and Dagger pipelines.

The problem: probability theory, statistics, and stochastic processes live in learning-finance but are math — not finance. Content belongs in one vault with one Quartz build and one graph.

Design Decisions (agreed)

  • Option B: probability, statistics, stochastic processes → Math area.
  • Everything else from learning-finance → new Finance area.
  • Notebooks follow the PKM code/ pattern (self-contained notebook.py with inline uv script metadata, hide_code=True, mise.toml run targets).
  • Animations move under the PKM tree alongside notebooks.
  • One Quartz build, one site, one graph.
  • ocw and learnos repos stay separate (they are tools, not content).
  • learning-finance repo archived after merge (keep as read-only reference).

Task 1: Create the new directory structure in PKM

What: Create destination directories for finance content and the math content that’s being pulled out of learning-finance.

Files to create (empty dirs):

2 - Areas/Finance/
2 - Areas/Finance/market-microstructure/
2 - Areas/Finance/derivatives-pricing/
2 - Areas/Finance/fixed-income/
2 - Areas/Finance/credit-risk/
2 - Areas/Finance/structured-products/
2 - Areas/Finance/debt-capital-markets/
2 - Areas/Finance/portfolio-theory/
2 - Areas/Finance/macro-economics/
2 - Areas/Finance/defi-markets/
2 - Areas/Finance/mev/
2 - Areas/Finance/case-studies/
2 - Areas/Math, Geometry, Engineering, Physics/Math/Probability/
2 - Areas/Math, Geometry, Engineering, Physics/Math/Statistics/
2 - Areas/Math, Geometry, Engineering, Physics/Math/Stochastic Processes/

Verification: ls -R "2 - Areas/Finance/" and ls "2 - Areas/Math, Geometry, Engineering, Physics/Math/" show all dirs.


Task 2: Move finance content into PKM

What: Copy all markdown files from learning-finance/content/<topic>/ to the corresponding 2 - Areas/Finance/<topic>/ directory. Excludes the three math topics (probability-theory, statistics, stochastic-processes) which go to Task 3.

For each of these directories in learning-finance/content/:

  • market-microstructure/2 - Areas/Finance/market-microstructure/
  • derivatives-pricing/2 - Areas/Finance/derivatives-pricing/
  • fixed-income/2 - Areas/Finance/fixed-income/
  • credit-risk/2 - Areas/Finance/credit-risk/
  • structured-products/2 - Areas/Finance/structured-products/
  • debt-capital-markets/2 - Areas/Finance/debt-capital-markets/
  • portfolio-theory/2 - Areas/Finance/portfolio-theory/
  • macro-economics/2 - Areas/Finance/macro-economics/
  • defi-markets/2 - Areas/Finance/defi-markets/
  • mev/2 - Areas/Finance/mev/
  • case-studies/2 - Areas/Finance/case-studies/

Command pattern:

cp -r /Users/eporcu/code/learning-finance/content/market-microstructure/* \
  "/Users/eporcu/code/pkm/2 - Areas/Finance/market-microstructure/"
# repeat for each topic

Also move: learning-finance/content/index.md2 - Areas/Finance/index.md (this becomes the Finance area landing page).

Verification: find "2 - Areas/Finance" -name "*.md" | wc -l should match the count from learning-finance minus the 3 math topics.


Task 3: Move math content into PKM Math area

What: Copy the three math topics from learning-finance into the PKM Math area.

  • learning-finance/content/probability-theory/2 - Areas/Math, Geometry, Engineering, Physics/Math/Probability/
  • learning-finance/content/statistics/2 - Areas/Math, Geometry, Engineering, Physics/Math/Statistics/
  • learning-finance/content/stochastic-processes/2 - Areas/Math, Geometry, Engineering, Physics/Math/Stochastic Processes/

Command pattern:

cp -r /Users/eporcu/code/learning-finance/content/probability-theory/* \
  "/Users/eporcu/code/pkm/2 - Areas/Math, Geometry, Engineering, Physics/Math/Probability/"

Verification: Files like sample-spaces-and-sigma-algebras.md, conditional-expectation.md etc. exist under the new Probability dir.


What: Update wikilinks that used relative paths within learning-finance. Quartz uses markdownLinkResolution: "shortest", so bare wikilinks like [[glosten-milgrom-model]] will still resolve as long as filenames are unique across the vault. But folder-relative links like [[probability-theory/]] and [[derivatives-pricing/]] need updating.

Specific changes needed:

  1. In 2 - Areas/Finance/index.md — update all [[topic/]] links to use the new paths or bare wikilinks:

    • [[probability-theory/]][[Probability/]] (now under Math)
    • [[statistics/]][[Statistics/]] (now under Math)
    • [[stochastic-processes/]][[Stochastic Processes/]] (now under Math)
    • Other [[topic/]] links should resolve since they’re still within Finance
  2. In probability _index.md — update any links that reference finance topics (e.g., [[derivatives-pricing/]]) to work from the new Math location.

  3. Grep the entire vault for broken wikilinks:

    # Find all wikilink targets
    grep -roh '\[\[[^]]*\]\]' "2 - Areas/Finance/" "2 - Areas/Math, Geometry, Engineering, Physics/Math/Probability/" | sort -u
    # Verify each resolves to an existing file

Verification: No broken wikilinks after running Quartz build (Task 8).


Task 5: Move learner profile and teaching instructions into PKM CLAUDE.md

What: The learning-finance/learner_profile.md contains teaching persona instructions (Patient Professor / Sharp Colleague / Socratic Tutor), math style preferences, code style, and the detailed “what he knows / doesn’t know” calibration. This should be folded into the PKM CLAUDE.md so that any Claude session working on PKM content follows the same teaching approach.

Specifically, add to /Users/eporcu/code/pkm/CLAUDE.md:

  • A new section ## Finance content standards that includes:
    • The three teaching personas (from learner_profile.md lines 62-69)
    • “Use math generously” instructions (lines 72-76)
    • “Use code and pseudocode” (lines 79-80)
    • “Use analogies to engineering concepts” (lines 83-90)
    • “Rich historical context” (lines 93-99)
    • “Flag debates and controversies” (lines 102-108)
    • “Connect to his experience” (lines 111-118)
    • The “what he knows / doesn’t know” calibration (lines 22-56) — summarized, not verbatim
    • Reference textbook list (lines 123-133)
  • A new section ## Math content standards for the probability/statistics notes, with similar instructions about rigor and derivation expectations.

Do NOT copy verbatim. Adapt to CLAUDE.md’s terse style and merge with existing quality standards.

Verification: Read the updated CLAUDE.md. It should be coherent with the existing note quality standards.


Task 6: Move the About Me learner profile reference

What: Update 2 - Areas/About Me/Learning Goals.md to reflect that learning-finance is now merged into PKM. Remove references to it as a separate repo. Add a reference to the Finance area and the Math/Probability area.

Verification: No references to code/learning-finance as a separate project remain in the About Me notes.


Task 7: Move Marimo notebooks into PKM code/ pattern

What: Learning-finance has no notebooks yet (the notebooks/ dirs are empty). But the infrastructure for future notebooks should follow the PKM pattern established by the vector-search notebooks:

  • Each notebook is a single notebook.py with inline uv script metadata (no per-project pyproject.toml)
  • Lives under code/<topic-name>/notebook.py
  • Uses matplotlib for 2D annotated diagrams, Plotly for interactive 3D
  • All cells have hide_code=True
  • mise.toml at code/ root defines run targets

Changes:

  1. Update code/CLAUDE.md to add a section about finance notebooks:

    • Finance notebooks may also use altair and sympy (from the learning-finance conventions)
    • Finance notebooks should follow the same “draw first, label everything” philosophy
    • Note that WASM export uses scripts/export-notebooks.sh
  2. Update code/mise.toml — no immediate changes needed, but document that new finance notebooks should add their own run targets here.

  3. The animations/ directory from learning-finance (currently empty) — create animations/ at PKM root for future Manim scripts. Add a brief README or CLAUDE.md noting conventions.

Verification: code/CLAUDE.md updated. Future notebook creation has clear instructions.


Task 8: Update the Quartz build

What: The existing build.sh already builds Quartz from the repo root and exports notebooks. The new Finance and Math content will be picked up automatically since Quartz scans the whole tree. But verify:

  1. The ignorePatterns in quartz.config.ts (["private", "templates", ".obsidian"]) do not accidentally exclude the new directories.

    • 2 - Areas/Finance/ — no conflict
    • 2 - Areas/Math, Geometry, Engineering, Physics/Math/Probability/ — no conflict
    • Good, no changes needed.
  2. The build.sh notebook export glob code/*/notebook.py will pick up any future finance notebooks. No changes needed.

  3. Learning-finance had its own pyproject.toml with marimo, sympy, numpy, scipy, altair, vegafusion as deps. The PKM build.sh does pip install marimo numpy matplotlib scipy. Add altair and sympy to the build.sh install line for future finance notebook support.

File: build.sh line 7:

# Before:
pip install --quiet marimo numpy matplotlib scipy
# After:
pip install --quiet marimo numpy matplotlib scipy altair sympy vegafusion

Verification: Run cd quartz-publisher/source && npx quartz build -d ../.. and confirm no errors. The Finance and Math/Probability pages should appear in the built site.


Task 9: Update the Finance area landing page

What: Rewrite 2 - Areas/Finance/index.md to work as a PKM area page rather than a standalone site landing page.

Key changes:

  • Remove the “A structured journey…” standalone-site framing
  • Update Module 0 (Foundations) links to point to the Math area:
    • [[probability-theory/]][[Probability]] (link to Math area)
    • [[statistics/]][[Statistics]]
    • [[stochastic-processes/]][[Stochastic Processes]]
  • Keep Module 1-3 structure and wikilinks (they resolve within Finance)
  • Add a See also section linking to [[About Me]] and [[Learning Goals]]
  • Keep the source_conversations frontmatter (provenance tracking is useful)

Verification: All wikilinks in the page resolve.


Task 10: Update PKM vault index

What: Add Finance to the vault index.

File: index.md

Add under Areas:

## Areas
 
- [[2 - Areas]]
- [[Finance]] -- markets, derivatives, credit risk, macro

Verification: Wikilink resolves to the Finance index page.


Task 11: Clean up learning-finance repo

What: After merge is verified:

  1. Add a DEPRECATED.md to learning-finance explaining content moved to PKM
  2. Do NOT delete the repo yet — keep as read-only archive
  3. Remove any git remotes or CI that would deploy the old standalone site

Verification: learning-finance repo has deprecation notice. No active deploys.


Execution Order

Tasks 1-3 are file moves (independent, can be parallelized). Task 4 (wikilinks) depends on 1-3. Task 5 (CLAUDE.md) is independent. Task 6 (About Me update) depends on the merge being conceptually done. Task 7 (notebook infra) is independent. Task 8 (Quartz build) depends on 1-3. Task 9 (Finance landing page) depends on 1-4. Task 10 (index) depends on 2. Task 11 (cleanup) depends on everything else.

Suggested batches:

  • Batch 1: Tasks 1, 2, 3, 5, 7 (parallel — dir creation, file moves, CLAUDE.md, notebook docs)
  • Batch 2: Tasks 4, 8, 9, 10 (wikilinks, build, landing page, index)
  • Batch 3: Task 6, 11 (About Me update, cleanup)
  • Review checkpoint after each batch.