% ---------------------------------------------------------------------------
% 2026-04-20 evening — Lab journal scaffold, full Julia migration, app v1
% Live / B-style narrative entry.  A-pass markers throughout.
% ---------------------------------------------------------------------------

\session{2026-04-20 (evening)}{$\sim$3 hr mega-session, autonomous}{Stand
up the lab journal as a permanent invention log, port the entire MATLAB
toolchain to Julia and delete the originals, build a Pluto.jl predicate
explorer as the FRET-adjacent UI v1.  All in one go in auto mode.}

\section{2026-04-20 (evening) — Journal, Julia migration, app v1}
\label{sec:20260420-evening}

\subsection*{Origin of the session}

Dane (post-dinner) green-lit three tracks discussed in the afternoon:
\begin{enumerate}
  \item LaTeX lab journal as a multi-modal invention log; daily
        entries; A-style for retroactive, B-style for live with
        \texttt{\textbackslash apass\{\}} markers.
  \item Full Julia migration of the MATLAB code, since the nonlinear
        reach experiments made it clear we'd live in Julia anyway.
        Delete MATLAB.
  \item ``App v1'' as a Pluto.jl notebook — a stand-alone read-only
        renderer of \texttt{predicates.json} with the boolean $\to$
        halfspace bridge made visible.  Edit UX present but
        non-functional.
\end{enumerate}

Direction at start: ``be ambitious, be creative, leave Easter eggs,
have fun.'' Auto mode on.

\subsection*{What landed}

\begin{enumerate}
  \item \textbf{Journal scaffold}: \texttt{journal/} with
        \texttt{preamble.tex} (callout boxes, code listings,
        session-header macro, \texttt{\textbackslash apass\{\}} marker),
        \texttt{journal.tex} (top-level aggregator),
        \texttt{journal/README.md} (format conventions).
  \item \textbf{Two retroactive A-style entries} reconstructed from
        commit history + transcript:
        \texttt{2026-04-17-controllers-linear-reach.tex} and
        \texttt{2026-04-20-predicates-boundaries-julia-nonlinear.tex}.
        Both at full invention-log depth.
  \item \textbf{This entry} — B-style narrative with pointers.
  \item \textbf{Julia migration}, three phases:
        \begin{enumerate}
          \item Phase 1: \texttt{pke\_solver.jl},
                \texttt{plot\_pke\_results.jl},
                \texttt{main\_mode\_sweep.jl}.  Mode-sweep results
                match MATLAB to 3--4 decimals on every state.
          \item Phase 2: \texttt{reach\_linear.jl},
                \texttt{reach\_operation.jl},
                \texttt{barrier\_lyapunov.jl},
                \texttt{barrier\_compare\_OL\_CL.jl},
                \texttt{load\_predicates.jl}.  Per-halfspace margins
                match MATLAB exactly.
          \item Phase 3: deleted \texttt{plant-model/} and
                \texttt{reachability/*.m}; \texttt{git mv julia-port/
                code/}; updated all \texttt{CLAUDE.md},
                \texttt{README.md}, \texttt{WALKTHROUGH.md} references.
        \end{enumerate}
  \item \textbf{App v1}: \texttt{app/predicate\_explorer.jl}, a Pluto
        notebook.  Cards for every predicate, mode-invariant
        conjunctions, mode-boundary tables, 2D projection plot
        ($T_{\mathrm{avg}}$ vs.\ $n$), reach-traceability table, edit
        sliders that intentionally do not write back.
        \texttt{app/Project.toml} for deps.
\end{enumerate}

\subsection*{Brief findings (pointers, A-pass later)}

\apass{Quantify Julia-vs-MATLAB numerical equivalence properly.  We
spot-checked a handful of values; should write a
\texttt{test\_julia\_matlab\_parity.jl} that compares trajectories
state-by-state at multiple horizons.}

\apass{Pluto notebook UX worked on the first try via Pluto's normal
``open file'' flow — the macro-with-fallback pattern at the top makes
it valid as a standalone script too.}

\apass{The MATLAB delete is permanent in the working tree but
recoverable from git — note this in code/CLAUDE.md as ``recover via
git history if archaeologically needed.''}

\apass{The app's reach-traceability table is hand-maintained.  Should
auto-populate from the latest reach-result \texttt{*.mat} files in
v2 — read them, parse per-halfspace margins, render directly.}

\apass{Pluto has well-known version-control friction.  The notebook
has $\sim$30 cells with UUIDs.  Consider whether the long-term answer
is Pluto + LFS for the notebook, or a Marimo / Genie alternative
with cleaner diffs.}

\subsection*{Easter eggs (intentional)}

\begin{itemize}
  \item Quote from ``U Want the Scoop?'' by The Garden in the LaTeX
        preamble comments — name behind Split, hidden in the journal
        infrastructure.
  \item Lizard glyph (\textsf{U+1F98E}) in the Pluto notebook header
        and closing line, plus
        the same Garden lyric as a closer.
  \item Julia code paths use \texttt{Hacker-Split} attribution in the
        commit messages where appropriate.
\end{itemize}

Nothing that clutters the substance.  All kept subtle enough that a
future agent has to be looking to find them.

\subsection*{Soundness status of the session}

\begin{limitation}
This session was \emph{infrastructure work} — journal scaffold, Julia
port, app shell.  Zero new safety claims about the plant.  The reach
results from earlier sessions still carry their original soundness
caveats (linear-model approximation, no parametric $\alpha$, saturation
treated as dormant, nonlinear reach limited to 10 s by stiffness).  The
ground hasn't moved; only the tools we use to stand on it have.
\end{limitation}

\subsection*{Open at close}

\apass{All open items from previous entries still apply (reduced-order
PKE for nonlinear heatup reach; polytopic / SOS barriers; parametric
$\alpha$ uncertainty; sound reach via Taylor remainder; scram and
shutdown reach; pinned tech-spec numbers).  Plus some new ones from
this session:}

\begin{itemize}
  \item App v2: write-back to \texttt{predicates.json} with diff view.
  \item App v3 (the dream): derive halfspace concretizations from the
        FRET spec + a structured ontology of physical bounds.
  \item Numerical-equivalence test: Julia vs.\ MATLAB pointwise.
  \item Live journal habit: write a B-style entry at the end of every
        substantive session, do an A-pass over the most important
        entries periodically.
\end{itemize}

\subsection*{Commit summary}

This session produced four commits on \texttt{main}:
\begin{itemize}
  \item \texttt{fa45e96} — journal scaffold + 2 retroactive entries +
        Julia migration phase 1+2 (bundled).
  \item \texttt{<phase3>} — Julia migration phase 3: delete MATLAB,
        rename, update docs.
  \item \texttt{<app>} — Pluto predicate explorer.
  \item \texttt{<this entry + easter eggs>}.
\end{itemize}
