First-Cell Failures: Why Setup Ergonomics Matter in the Age of AI
Setting the Stage: Context for the Curious Book Reader
Every software project has a critical moment: the first five seconds after a stranger runs the installer. In this important installment within our ongoing tapestry of articles, we examine how minor code oversights—such as read-before-write race conditions or unraw escape sequences—compound into severe friction points during initial onboarding. Rather than treating these as isolated bugs, we explore how tooling can automatically surface systemic blind spots before they reach production.
TL;DR: Two consecutive defects in the same file were fixed and verified: a KeyError: 'active_job' raised by the first executable cell of a Jupyter onboarding notebook, and a Python 3.12 SyntaxWarning: invalid escape sequence raised at import time by an ASCII-art string literal in the module that cell imports. Both were trivial in substance and severe in placement: they fired on the first keypress of a first-time installation, before the user had any way to judge whether the output meant failure. The first was a read-before-write (a cell asked a database for a key whose only writer was the next cell down, invisible on any machine that had ever run the notebook once). The second was an unraw triple-quoted string whose backslash sequences rendered correctly only because Python currently tolerates unrecognized escapes. The fixes were a module-level DEFAULT_JOB_ID constant and a one-character r prefix. Both were proven by before/after probes that bracket the edit, and both required a manual file copy because the project’s environment manager stages helper modules only when the destination is missing.
Technical Journal Entry Begins
MikeLev.in: I’m testing the Onboarding path on the Mac and on the very first cell of
the Onboarding.ipynb we get this error:
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
File ~/pipulate/pipulate/core.py:118, in DictLikeDB.__getitem__(self, key)
117 try:
--> 118 record = self.store[key]
119 # 🎯 UNIFIED FIX: Handle both dicts (notebook) and objects (server)
File ~/pipulate/.venv/lib/python3.12/site-packages/fastlite/kw.py:84, in __getitem__(self, pk_values)
83 @patch
---> 84 def __getitem__(self:Table, pk_values): return self.get(pk_values)
File ~/pipulate/.venv/lib/python3.12/site-packages/fastlite/kw.py:76, in get(self, pk_values, as_cls, xtra, default)
75 if not item:
---> 76 if default is UNSET: raise NotFoundError()
77 return default
NotFoundError:
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
Cell In[3], line 4
1 from imports import onboard_sauce as sauce
2 from pipulate import wand
3
----> 4 JOB_ID = wand.db['active_job']
5 sauce.render_mode_selector(JOB_ID)
6 wand.imperio(side_quest=True)
## Diagnosing the Read-Before-Write Trap
File ~/pipulate/pipulate/core.py:90, in db_operation.<locals>.wrapper(*args, **kwargs)
87 @functools.wraps(func)
88 def wrapper(*args, **kwargs):
89 try:
---> 90 result = func(*args, **kwargs)
91 if func.__name__ == '__setitem__':
92 key, value = (args[1], args[2])
File ~/pipulate/pipulate/core.py:126, in DictLikeDB.__getitem__(self, key)
123 except NotFoundError:
124 # Don't log as error - this is expected behavior when checking for keys
125 logger.debug(f'Key not found: {key}')
--> 126 raise KeyError(key)
KeyError: 'active_job'
Opus 5 Max: Context verified.
Diagnosis
This is not a macOS problem. It is a read-before-write, and the Mac is simply the first machine whose database was genuinely empty.
The first executable cell of Onboarding.ipynb does:
JOB_ID = wand.db['active_job']
sauce.render_mode_selector(JOB_ID)
The only writer of that key is the next cell down (wand.db['active_job'] = JOB_ID in the greet-user block). So on a fresh install the very first cell asks the database for a key nothing has written yet, and DictLikeDB.__getitem__ correctly converts fastlite’s NotFoundError into KeyError: 'active_job'.
Why you never saw it. Any machine that has ever run the notebook past cell two has the key on disk permanently. The crash is structurally invisible to the maintainer and fires on the first keypress of a stranger’s first install — the worst possible placement.
How it got there. render_mode_selector is a recent addition (“the sovereign-agent escape hatch”), inserted at the top of the notebook. The wand.db['active_job'] idiom was copied from cells that legitimately sit below the writer — an idiom transplanted upward past its own precondition. Two other cells in this same notebook already read wand.db.get('active_job', 'onboarding_01') with a default, which means someone hit this exact class of failure before and patched the downstream instances while the upstream one was still being written.
The read is also pure ceremony. render_mode_selector writes wand.db['active_job'] = job_id as its first act. The cell was fetching a value it was about to hand to the function that overwrites it. The cure is to stop asking the database and establish the default from one named place.
Rejected fix, named so nobody reaches for it later: seeding active_job as an import-time side effect of onboard_sauce. That would have fixed the already-shipped notebook with zero cell edits — and it would make import mutate a database while leaving the read-before-write in place, silently working for the wrong reason.
The delivery trap (this matters more than the patch)
flake.nix’s copy_notebook_if_needed is copy-if-absent. Both Notebooks/imports/onboard_sauce.py and Notebooks/Onboarding.ipynb are gitignored working copies that are written once and never refreshed. Patching assets/nbs/... therefore fixes fresh installs only — the running notebook on either of your machines will not see it. That copy-down is a real car in the train below, not an afterthought.
The Hidden Cost of Syntax Warnings
(1) PROBES
grep -c DEFAULT_JOB_ID assets/nbs/imports/onboard_sauce.py; echo "asset_const_exit=$?"
diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
grep -cF "sauce.DEFAULT_JOB_ID" assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "nb_const_exit=$?"
.venv/bin/python -c "from pipulate import wand; g=getattr(wand.db,'get',None); print('db_get_exists=' + str(g is not None)); print('active_job=' + repr(g('active_job','ABSENT') if g else 'UNKNOWN'))"
Probe 1 is the module straddle: BEFORE 0 / exit 1, AFTER 3 / exit 0.
Probe 2 is the delivery witness, and it has three states rather than two: 0 in sync (now), 1 after the patch lands but before the copy-down, 0 again after the copy. If the BEFORE reading is already 1, the working copy has drifted from the asset and the cp car must not run until you have looked at why.
Probe 3 straddles the notebook half across both copies, same three-state shape.
Probe 4 is the cheapest falsifier for the whole fix direction. If db_get_exists=False, then the Persona and JavaScript-Gap cells are landmines too and this fix is incomplete. If active_job=ABSENT on this Linux box as well, then the notebook has never actually been run to completion here and the Mac was simply the first honest test.
(2) NEXT CONTEXT
! grep -c DEFAULT_JOB_ID assets/nbs/imports/onboard_sauce.py; echo "asset_const_exit=$?"
! diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
! grep -cF "sauce.DEFAULT_JOB_ID" assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "nb_const_exit=$?"
! .venv/bin/python -c "from pipulate import wand; g=getattr(wand.db,'get',None); print('db_get_exists=' + str(g is not None)); print('active_job=' + repr(g('active_job','ABSENT') if g else 'UNKNOWN'))"
flake.nix
assets/nbs/Onboarding.ipynb
assets/nbs/imports/onboard_sauce.py
assets/nbs/imports/core_sauce.py
(3) PATCHES
Car 1 — one home for the job id.
Target: assets/nbs/imports/onboard_sauce.py
[[[SEARCH]]]
from openpyxl.styles import Alignment, Font
from openpyxl.worksheet.table import Table, TableStyleInfo
[[[DIVIDER]]]
from openpyxl.styles import Alignment, Font
from openpyxl.worksheet.table import Table, TableStyleInfo
# THE JOB ID HAS ONE HOME (convicted 2026-09-01, macOS first contact). The
# mode-selector cell at the TOP of Onboarding.ipynb read
# wand.db['active_job'] -- an idiom copied from cells that sit BELOW the only
# writer, transplanted upward past its own precondition. On any machine that
# had ever run the notebook the key was already on disk, so the crash was
# STRUCTURALLY INVISIBLE to the maintainer and fired on the very first cell of
# a stranger's very first install: KeyError: 'active_job'.
# THE READ WAS ALSO CEREMONY: render_mode_selector WRITES this key as its
# first act, so the cell was fetching a value it was about to hand to the
# function that overwrites it. Establish the default here instead, and let the
# notebook NAME it rather than ask the database for it.
# TWO CELLS ALREADY KNEW. The Persona and JavaScript-Gap cells read
# wand.db.get('active_job', 'onboarding_01') with this same literal default,
# which means this failure class was hit and patched downstream while the
# upstream instance was still being written. Three copies of one string is
# what made that possible; this is the one copy.
# REJECTED: seeding the key as an import-time side effect of this module,
# which would have fixed the already-shipped notebook with no cell edit at
# all. An import that writes to a database is a hidden actuation, and it would
# have left the read-before-write in place -- still wrong, now silently
# working, and wrong again the next time somebody moves a cell.
DEFAULT_JOB_ID = "onboarding_01"
[[[REPLACE]]]
Car 2 — the establisher reads the constant.
Target: assets/nbs/imports/onboard_sauce.py
[[[SEARCH]]]
def render_mode_selector(job_id: str = "onboarding_01"):
[[[DIVIDER]]]
def render_mode_selector(job_id: str = DEFAULT_JOB_ID):
[[[REPLACE]]]
Car 3 — the predicate reads the same constant.
Target: assets/nbs/imports/onboard_sauce.py
[[[SEARCH]]]
def is_fast_track(job_id: str = "onboarding_01") -> bool:
[[[DIVIDER]]]
def is_fast_track(job_id: str = DEFAULT_JOB_ID) -> bool:
[[[REPLACE]]]
Car 4 — the copy-down actuator. Run this only if probe 2’s BEFORE reading was sauce_in_sync=0. This is a mutating shell command, not a probe.
cp assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py
Car 5 — the notebook cell, by hand. .ipynb is not an apply-safe target and no raw JSON is in this context, so this one is a cell replacement you make in Jupyter. Open Notebooks/Onboarding.ipynb, find the first code cell under 🏎️ Choose Your Path, and replace its body with:
from imports import onboard_sauce as sauce
from pipulate import wand
JOB_ID = sauce.DEFAULT_JOB_ID
sauce.render_mode_selector(JOB_ID)
wand.imperio(side_quest=True)
One line changed. JOB_ID stays visible as a teaching name; it just comes from the module instead of from a database nothing has written yet.
IGNITION. Three steps, in this order.
- Cars 1–3 are a plain Python module — no shell ignition, and probe 1 reads the file at call time.
- Car 4 is the delivery. Then restart the Jupyter kernel (
Esc,0,0);%autoreload 2should pick the constant up on its own, but the restart is the reading you can trust. - Car 5 edits the working copy. Push it back to the asset by running the notebook’s own last cell,
wand.nbup("Onboarding", modules=("onboard_sauce", "core_sauce")), then confirm with probe 3 that both files read1.
For the Mac in front of you right now: it is a fresh install, so it will pick this up cleanly from a rm -rf ~/pipulate and a reinstall once this is pushed. To unblock testing before then, hand-edit the same one line in the Mac’s Notebooks/Onboarding.ipynb and add DEFAULT_JOB_ID = "onboarding_01" to its Notebooks/imports/onboard_sauce.py.
(4) PROMPT
Applied the onboarding read-before-write car. Receipts below.
BEFORE (hand-run, pre-patch):
[paste the four probe outputs]
AFTER (post-patch, post-cp, post-notebook-edit, post-nbup):
[paste the four probe outputs again]
MAC RE-TEST:
[paste what the first cell does now on the Mac -- the mode selector should
render instead of raising, and Run All should reach the end]
Two follow-ups if the straddle is green:
1. Probe 4 may have reported db_get_exists=False, which would mean the
Persona and JavaScript-Gap cells carry the same landmine in .get form.
If so, include pipulate/core.py so DictLikeDB.get can be read, and decide
whether those two cells should also stop asking the database.
2. THE COPY-IF-ABSENT DELIVERY GAP, named by this ride and not yet solved:
flake.nix copies notebooks and sauce modules only when the destination is
missing, so every fix to assets/nbs/ is invisible to every existing
install forever. That is correct for a notebook the human has edited and
wrong for imports/*.py, which nobody is supposed to edit. Propose the
split -- notebooks stay copy-if-absent, imports/ get refreshed when the
asset is newer -- with a probe that proves a stale working copy is
actually replaced. Include flake.nix and assets/nbs/imports/core_sauce.py.
(5) EXTERNAL DELIVERABLES
None. Car 5 is manual but lives inside this repo.
MikeLev.in:
1: Probe:
Blast Radius Check to establish bisection Left-hand Causal Boundary. It is a Popper-thing. Science.
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
(nix) pipulate $ grep -c DEFAULT_JOB_ID assets/nbs/imports/onboard_sauce.py; echo "asset_const_exit=$?"
diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
grep -cF "sauce.DEFAULT_JOB_ID" assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "nb_const_exit=$?"
.venv/bin/python -c "from pipulate import wand; g=getattr(wand.db,'get',None); print('db_get_exists=' + str(g is not None)); print('active_job=' + repr(g('active_job','ABSENT') if g else 'UNKNOWN'))"
0
asset_const_exit=1
sauce_in_sync=0
assets/nbs/Onboarding.ipynb:0
Notebooks/Onboarding.ipynb:0
nb_const_exit=1
db_get_exists=True
active_job='onboarding_01'
(nix) pipulate $
2: Context:
# adhoc.txt _ _ _ to set context____ _ _ ___ ____ _ <F5> Simpson Couch Gag Here (explain anything to the audience you feel needs it explained)
# / \ __| | | | | | ___ ___ / ___| | | |/ _ \| _ \| |
# ahe/ _ \ / _` | | |_| |/ _ \ / __| | | | |_| | | | | |_) | | Gotta fix this fast
# ahc ___ \ (_| | | _ | (_) | (__ | |___| _ | |_| | __/|_|
# /_/ \_\__,_| |_| |_|\___/ \___| \____|_| |_|\___/|_| (_)
# Ad Hoc CHOP: The Not-Managed-by-Git Safe-for-Client-Data place
# THE ROLLING PIN BOOK ORE SPINE / FODDER FOR THE BOOK
# ! python scripts/articles/lsa.py -t 1 --reverse --fmt dated-slugs # <-- The "Rolling Pin" that gives the 40K foot book-spine view of book-ore.
# GLOSSARY.md # <-- I think this glossary goes well with the book-ore spine to do world building.
# scripts/articles/lsa.py # <-- Useful for refining commands like `posts`, critical to Second Brain concept.
# THE QUIRKY AMIGA-LOVING HUMAN
# ~/repos/nixos/autognome.py # <-- Letting the AIs really understand my environment (The Brave Little Tailor punches above Their Weight Class proving the dunning-kruger effect the gate-keeper's (lower-case) lament.)
# init.lua # <-- Daily driver hot-keys that overlap with aliases in flake.nix
# AGENTIC FRAMEWORK & FOREVER MACHINE BIG FILES
# prompt_foo.py # <-- Prompt Fu compiler, makes the very README for AGENTS-like payload you're reading right now, but it needs to be more like that
# foo_files.py # <-- This is the router, evolving book outline and the things you pin-up to produced the recursive self-improvement loops
flake.nix # <-- Solves world's WRITE ONCE RUN ANYWHERE problem like Java never could. Also resolves the bootstrap paradox.
# MAIN ACTUATORS, IaC & NEGATIVE SPACE
apply.py # <-- How can "Web UI" ChatBots edit your code? With this Aider-inspired Player Piano patch applier.
.gitattributes # <-- Model: understand that `nbstripout` and `jupytext` are both in play. Just talk the human through .ipynb patches.
.gitignore # <-- Creates "negative space" for sub-rep's to share parent environment and "snap" proprietary secret features into place.
requirements.in # <-- All known dependencies and (necessary) version pinning. WORA gotcha's exposed.
__init__.py # <-- Master versioning
pyproject.toml # <-- The PyPI Packaging details
# cli.py # <-- Catch-all actuator for PyPI envs, Python anchoring, MCP tool-call (plus alternatives) and **kwargs like wrapping for CLI
# scripts/xp.py # <-- Transforms host OS copy-paste buffer player-piano music into context-payload.
# scripts/ai.py # <-- How I constantly use local AI to write git commit messages with `m` alias.
# CONTEXT PORTABILITY SYSTEM
# scripts/foo_cartridge.py # Needs description
# scripts/foo_replay.py # Needs description
# FREQUENTLY USEFUL TO HAVE IN CONTEXT
# release.py # <-- How everything ends up where it does (GitHub, PyPI, etc.)
# scripts/weblogin.py # <-- Lets the user "warm up" the cache for their web logins at their leisure on a profile that persists.
# scripts/crawl.py # <-- Feel free to ask for something to be crawled and included in the next turn.
# imports/voice_synthesis.py # <-- The wand can talk to you
# scripts/release/version_sync.py # <-- Needs to be wrapped into release.py and eliminated, I think.
# --- Under this line is were you paste what the AI gives you ---
# --- We call it context but it's really just the right-hand ---
# --- blast-radius of the "probes" to make this all science. ---
# --- END `adhoc.txt` TEMPLATE ---
# STICKBUG & MOTHER CAT KATA
# assets/trails/botify_pageworkers.yaml
assets/installer/mck.sh
assets/installer/replay.sh
assets/trails/first_context.yaml
assets/trails/practice.yaml
assets/trails/public_walk.yaml
scripts/bookmark_import.py
scripts/boot_menu.py
scripts/connectors/README.md
scripts/connectors/botify.py
scripts/connectors/confluence.py
scripts/connectors/gmail.py
scripts/connectors/gsc.py
scripts/connectors/jira.py
scripts/connectors/mcp.py
scripts/connectors/mcp_warm.py
scripts/connectors/sheets.py
scripts/connectors/slack.py
scripts/connectors/wallet.py
scripts/mother_cat.py
scripts/sources_menu.py
scripts/walk.py
scripts/walk_cartridge.py
scripts/walk_compile.py
scripts/weblogin.py
tools/scraper_tools.py
# # # adhoc.txt -- Cleanup inert public_walk environment export block
# #
# # # --- BEFORE/AFTER STRADDLE ---
# # ! grep -n -C 2 'PIPULATE_TRAIL_WALK_ONE_URL' assets/installer/mck.sh || echo "export_block_removed"
# # ! bash -n assets/installer/mck.sh; echo "mck_syntax=$?"
# # ! bash assets/installer/mck.sh --where
# #
# # # --- TARGET SCRIPT ---
# # assets/installer/mck.sh
# #
# # ! rg -n -F 'TRAIL_NAME="${TRAIL_NAME:-public_walk}"' assets/installer/mck.sh
# # ! rg -n -e '^ *walk\(\)' -e '^ *alias walk=' flake.nix; echo "shell_walk_exit=$?"
# # ! test -e walk; echo "root_walk_exists=$?"
# # ! rg -n -e 'alias mothercat=' -e 'Three words to start from' flake.nix scripts/boot_menu.py
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! bash -n walk; echo "walk_syntax=$?"
# # ! bash walk --where
# # ! rg -n -e '^ *alias walk=' -e '^ *walk\(\)' -e 'writeShellScriptBin "walk"' flake.nix; echo "shell_walk_exit=$?"
# # ! .venv/bin/python -c 'import sys; sys.path.insert(0,"scripts"); import boot_menu as b; print("count=" + b._count_word(len(b.DOOR_TWO_WORDS))); print(" ".join(w for w, _ in b.DOOR_TWO_WORDS))'
# # walk
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! rg -in "three words|four words|door 2" flake.nix scripts/ assets/ README.md
# # ! walk --where
# # walk
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! python scripts/connectors/wallet.py check slack
# # ! python -c "import os, sys; from pathlib import Path; sys.path.insert(0, '.'); from scripts.connectors import wallet; pairs = wallet._dotenv_pairs(); print('env SLACK_USER_TOKEN:', bool(os.getenv('SLACK_USER_TOKEN')), 'env SLACK_BOT_TOKEN:', bool(os.getenv('SLACK_BOT_TOKEN')), 'vault SLACK_USER_TOKEN:', 'SLACK_USER_TOKEN' in pairs, 'vault SLACK_BOT_TOKEN:', 'SLACK_BOT_TOKEN' in pairs)"
# # ! python scripts/connectors/wallet.py warm slack --dry-run
#
# /home/mike/repos/trimnoir/_posts/2026-08-30-terminal-native-mcp-practice.md
# deleteme.txt
# Now that slack is working (on my workspace) we trim back things here to just the stick bug and Mother Cat Kata stuff
# assets/installer/install.sh # <-- Pipulate.com installer real home in github/pipulate repo
# ~/repos/Pipulate.com/CNAME
# ~/repos/Pipulate.com/_config.yml
# ~/repos/Pipulate.com/_layouts/default.html
# ~/repos/nixos/.gitignore
# ~/repos/Pipulate.com/install.md # <-- Gets copied into place here by pipulate/release.py
# assets/nbs/Onboarding.ipynb # <-- Where Workflows go to get born. Common `.venv` to FastHTML. Also to Cursor or VSCode too if you know how to set it up.
# assets/nbs/imports/core_sauce.py # <-- Make those workflows being born in Notebooks look clean by pushing the sausage factory back to code-behind Python secret sauce import modules.
# assets/nbs/imports/onboard_sauce.py # <-- Now you're cooking!
# apps/015_config.py # <-- Carrying onboarding values over to FastHTML-side, especially dotenv values. New home for Botify API key!
! grep -c DEFAULT_JOB_ID assets/nbs/imports/onboard_sauce.py; echo "asset_const_exit=$?"
! diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
! grep -cF "sauce.DEFAULT_JOB_ID" assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "nb_const_exit=$?"
! .venv/bin/python -c "from pipulate import wand; g=getattr(wand.db,'get',None); print('db_get_exists=' + str(g is not None)); print('active_job=' + repr(g('active_job','ABSENT') if g else 'UNKNOWN'))"
flake.nix
assets/nbs/Onboarding.ipynb
assets/nbs/imports/onboard_sauce.py
assets/nbs/imports/core_sauce.py
3: Patches:
Okay, first the normal patches.
Blast Radius Check to establish bisection Left-hand Causal Boundary. It is a Popper-thing. Science.
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
(nix) pipulate $ patch
(nix) pipulate $ app
<unknown>:985: SyntaxWarning: invalid escape sequence '\-'
✅ DETERMINISTIC PATCH APPLIED: Successfully mutated 'assets/nbs/imports/onboard_sauce.py'.
(nix) pipulate $ d
diff --git a/assets/nbs/imports/onboard_sauce.py b/assets/nbs/imports/onboard_sauce.py
index f9447735..3f680fef 100644
--- a/assets/nbs/imports/onboard_sauce.py
+++ b/assets/nbs/imports/onboard_sauce.py
@@ -20,6 +20,29 @@ from openpyxl.utils import get_column_letter
from openpyxl.styles import Alignment, Font
from openpyxl.worksheet.table import Table, TableStyleInfo
+# THE JOB ID HAS ONE HOME (convicted 2026-09-01, macOS first contact). The
+# mode-selector cell at the TOP of Onboarding.ipynb read
+# wand.db['active_job'] -- an idiom copied from cells that sit BELOW the only
+# writer, transplanted upward past its own precondition. On any machine that
+# had ever run the notebook the key was already on disk, so the crash was
+# STRUCTURALLY INVISIBLE to the maintainer and fired on the very first cell of
+# a stranger's very first install: KeyError: 'active_job'.
+# THE READ WAS ALSO CEREMONY: render_mode_selector WRITES this key as its
+# first act, so the cell was fetching a value it was about to hand to the
+# function that overwrites it. Establish the default here instead, and let the
+# notebook NAME it rather than ask the database for it.
+# TWO CELLS ALREADY KNEW. The Persona and JavaScript-Gap cells read
+# wand.db.get('active_job', 'onboarding_01') with this same literal default,
+# which means this failure class was hit and patched downstream while the
+# upstream instance was still being written. Three copies of one string is
+# what made that possible; this is the one copy.
+# REJECTED: seeding the key as an import-time side effect of this module,
+# which would have fixed the already-shipped notebook with no cell edit at
+# all. An import that writes to a database is a hidden actuation, and it would
+# have left the read-before-write in place -- still wrong, now silently
+# working, and wrong again the next time somebody moves a cell.
+DEFAULT_JOB_ID = "onboarding_01"
+
def check_ai_models(preferred_local=None, preferred_cloud=None):
"""
(nix) pipulate $ m
📝 Committing: chore: Simplify default job ID in onboarding_sauce.py
[main 0236f88e] chore: Simplify default job ID in onboarding_sauce.py
1 file changed, 23 insertions(+)
(nix) pipulate $ patch
(nix) pipulate $ app
<unknown>:985: SyntaxWarning: invalid escape sequence '\-'
✅ DETERMINISTIC PATCH APPLIED: Successfully mutated 'assets/nbs/imports/onboard_sauce.py'.
(nix) pipulate $ d
diff --git a/assets/nbs/imports/onboard_sauce.py b/assets/nbs/imports/onboard_sauce.py
index 3f680fef..f4b6d110 100644
--- a/assets/nbs/imports/onboard_sauce.py
+++ b/assets/nbs/imports/onboard_sauce.py
@@ -1352,7 +1352,7 @@ def execute_cloud_analysis(job_id: str, recovered_url: str, active_cloud_model:
print("⚠️ Technical Baseline Excel file not found. Did you run the Pandas cell?")
-def render_mode_selector(job_id: str = "onboarding_01"):
+def render_mode_selector(job_id: str = DEFAULT_JOB_ID):
"""
The sovereign-agent escape hatch, done as durable state instead of cell-run roulette.
(nix) pipulate $ m
📝 Committing: chore: Update default job ID in onboard_sauce.py
[main d8a72f86] chore: Update default job ID in onboard_sauce.py
1 file changed, 1 insertion(+), 1 deletion(-)
(nix) pipulate $ patch
(nix) pipulate $ app
<unknown>:985: SyntaxWarning: invalid escape sequence '\-'
✅ DETERMINISTIC PATCH APPLIED: Successfully mutated 'assets/nbs/imports/onboard_sauce.py'.
(nix) pipulate $ d
diff --git a/assets/nbs/imports/onboard_sauce.py b/assets/nbs/imports/onboard_sauce.py
index f4b6d110..3afc0d09 100644
--- a/assets/nbs/imports/onboard_sauce.py
+++ b/assets/nbs/imports/onboard_sauce.py
@@ -1406,7 +1406,7 @@ def render_mode_selector(job_id: str = DEFAULT_JOB_ID):
display(widgets.VBox([mode_widget, submit_btn, out]))
-def is_fast_track(job_id: str = "onboarding_01") -> bool:
+def is_fast_track(job_id: str = DEFAULT_JOB_ID) -> bool:
"""Cheap predicate so any downstream cell can glide instead of doing heavy work."""
from pipulate import wand
return bool(wand.get(job_id, "fast_track"))
(nix) pipulate $ m
📝 Committing: chore: Update job_id in onboarding_sauce.py
[main fd79e131] chore: Update job_id in onboarding_sauce.py
1 file changed, 1 insertion(+), 1 deletion(-)
(nix) pipulate $ git push
Enumerating objects: 23, done.
Counting objects: 100% (23/23), done.
Delta compression using up to 48 threads
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.31 KiB | 2.31 MiB/s, done.
Total 18 (delta 15), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (15/15), completed with 5 local objects.
To github.com:pipulate/pipulate.git
b50180ad..fd79e131 main -> main
(nix) pipulate $
And now the command and the Notebook edit:
(nix) pipulate $ cp assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py
(nix) pipulate $ gdiff
diff --git a/assets/nbs/Onboarding.ipynb b/assets/nbs/Onboarding.ipynb
index f93f1cad..c6ad5b0c 100644
--- a/assets/nbs/Onboarding.ipynb
+++ b/assets/nbs/Onboarding.ipynb
@@ -1,19 +1,8 @@
{
"cells": [
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "0",
- "metadata": {},
- "outputs": [],
- "source": [
- "%load_ext autoreload\n",
- "%autoreload 2"
- ]
- },
[A bunch of Notebook JSON metadata noise deleted]
(nix) pipulate $
4: Prompt: Applied the onboarding read-before-write car. Receipts below.
BEFORE (hand-run, pre-patch): [paste the four probe outputs]
AFTER (post-patch, post-cp, post-notebook-edit, post-nbup): [paste the four probe outputs again]
MAC RE-TEST: [paste what the first cell does now on the Mac – the mode selector should render instead of raising, and Run All should reach the end]
Two follow-ups if the straddle is green:
-
Probe 4 may have reported db_get_exists=False, which would mean the Persona and JavaScript-Gap cells carry the same landmine in .get form. If so, include pipulate/core.py so DictLikeDB.get can be read, and decide whether those two cells should also stop asking the database.
-
THE COPY-IF-ABSENT DELIVERY GAP, named by this ride and not yet solved: flake.nix copies notebooks and sauce modules only when the destination is missing, so every fix to assets/nbs/ is invisible to every existing install forever. That is correct for a notebook the human has edited and wrong for imports/*.py, which nobody is supposed to edit. Propose the split – notebooks stay copy-if-absent, imports/ get refreshed when the asset is newer – with a probe that proves a stale working copy is actually replaced. Include flake.nix and assets/nbs/imports/core_sauce.py.
5: Deliverables: A working Onboarding
Okay, that’s a very pretty prompt but I can just test. Okay, we got way further. I think it’s technically working but we have to fix this error:
/Users/michaellevin/pipulate/Notebooks/imports/onboard_sauce.py:985: SyntaxWarning: invalid escape sequence '\-'
--> / \-----> ,' `.------> ,--. ,-.
🚶 Guided walkthrough (recommended your first time)
🏎️ Fast-track (skip ahead and unlock the app right now)
🌀 You must complete the side-quest instructions above before running the next cell.
Opus 5 Extra: Context verified.
Diagnosis
The warning is not new and it is not a Mac thing. Python 3.12 flags invalid escape sequences in non-raw string literals, and reveal_system_architecture()’s ASCII art is full of them: \- in the funnel lines, \ in / \ -> \ (Nix), \ in /|\ (. Python currently treats "\-" as a literal backslash-dash, so the art renders correctly by accident. The escape sequence is scheduled to become a SyntaxError, which makes this a works-today, breaks-on-upgrade line sitting in the one module every onboarding cell imports.
The fix is one character: r""". A raw string preserves the exact bytes the art already produces, so the rendered panel is byte-identical.
Two things worth banking beyond the one-character fix.
First, placement. This fires at import time, in the first cell, before anything else prints. A stranger’s very first keypress produces a yellow warning naming a file path they have never heard of, at the exact moment they have no way to judge whether it matters. Same category as the KeyError you just fixed — cosmetic in substance, first-contact in position.
Second, and more useful: apply.py has been reporting this all along. Look at your own paste from the last ride. Every one of the three app invocations printed <unknown>:985: SyntaxWarning: invalid escape sequence '\-'. The AST airlock compiles the candidate content before writing, so it has been surfacing this on every patch to this file, with the correct line number, and it read as noise from the tool rather than as a finding about the file. The <unknown> filename is what made it look like the tool complaining about itself.
What the receipts say about the actual fix. BEFORE is clean: asset_const_exit=1, nb_const_exit=1, both notebook copies at 0. AFTER, this compile reads 3, sauce_in_sync=0, both notebooks at 1. The straddle is green in both halves and the delivery witness confirms the cp landed. db_get_exists=True, so the .get form in the Persona and JavaScript-Gap cells is real and follow-up 1 from the last caboose is discharged: those two cells are not landmines.
The delivery gap is now convicted twice in two rides. You have hand-run cp assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py for the last fix, and you will run it again for this one. That is the earmark asking to be paid, but it is not this car.
One observation I cannot yet call a receipt. The previous compile’s rendering of assets/nbs/Onboarding.ipynb opened with a %load_ext autoreload / %autoreload 2 code cell. This compile’s rendering does not. If that cell was dropped during the hand-edit and nbup, then module edits no longer hot-reload and a kernel restart is mandatory after every sauce change, including this one. Probe 5 below turns that inference into a reading rather than a guess.
(1) PROBES
grep -c 'lens_art = r"""' assets/nbs/imports/onboard_sauce.py; echo "asset_raw_exit=$?"
.venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('assets/nbs/imports/onboard_sauce.py').read_text(),'asset','exec'); print('asset_compiles_clean')"; echo "asset_exit=$?"
.venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('Notebooks/imports/onboard_sauce.py').read_text(),'working','exec'); print('working_compiles_clean')"; echo "working_exit=$?"
diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
Probe 1 straddles the literal edit: BEFORE 0 / exit 1, AFTER 1 / exit 0.
Probes 2 and 3 are the real falsifiers and they are deliberately not mirrors of the patch. They compile the source with SyntaxWarning promoted to an error, so they answer “does this file still carry any bad escape” rather than “did my one edit land.” If a second invalid escape exists elsewhere in the file, probe 2 stays at exit 1 after the patch and says which line. Predicted BEFORE: traceback, exit 1. AFTER: asset_compiles_clean, exit 0.
Probe 3 is the delivery witness in its sharpest form. It stays at exit 1 until car 2 runs, so it separates “the fix exists” from “the fix is where the notebook will read it.”
Probe 4 keeps the three-state sync reading from the last ride: 0 now, 1 after the patch, 0 after the cp.
Probe 5 tests the autoreload observation. If both files read 0, the hot-reload cell was lost and a kernel restart is now load-bearing after every module edit. If either reads nonzero, my reading of the two payload renderings was wrong and nothing was dropped.
(2) NEXT CONTEXT
! grep -c 'lens_art = r"""' assets/nbs/imports/onboard_sauce.py; echo "asset_raw_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('assets/nbs/imports/onboard_sauce.py').read_text(),'asset','exec'); print('asset_compiles_clean')"; echo "asset_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('Notebooks/imports/onboard_sauce.py').read_text(),'working','exec'); print('working_compiles_clean')"; echo "working_exit=$?"
! diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
! grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
flake.nix
assets/nbs/Onboarding.ipynb
assets/nbs/imports/onboard_sauce.py
assets/nbs/imports/core_sauce.py
(3) PATCHES
Car 1 — the raw prefix. One character of code, with the conviction banked beside it so nobody “tidies” the r away later.
Target: assets/nbs/imports/onboard_sauce.py
[[[SEARCH]]]
console = Console()
lens_art = """
[[[DIVIDER]]]
console = Console()
# RAW ON PURPOSE (convicted 2026-09-01, macOS first contact). This art
# carries \- and backslash-space sequences, which Python 3.12 reports as
# SyntaxWarning: invalid escape sequence. It RENDERS CORRECTLY TODAY only
# because an unrecognized escape currently falls through as a literal
# backslash plus the next character -- a behavior scheduled to become a
# SyntaxError. So the art was right by accident and the file was one
# Python release from refusing to import.
# THE r PREFIX CHANGES NO BYTES. Every sequence here is already being
# treated literally, so the panel below is byte-identical before and
# after; the only thing that changes is that Python stops objecting.
# PLACEMENT IS WHY IT MATTERED. This module is imported by the FIRST cell
# of Onboarding.ipynb, so the warning printed above everything else on a
# stranger's very first keypress, naming a file path they had never heard
# of, at the one moment they cannot tell noise from failure.
# THE INSTRUMENT WAS ALREADY REPORTING IT. apply.py's AST airlock compiles
# candidate content before writing, so every `app` against this file
# printed `<unknown>:985: SyntaxWarning` -- correct line number, three
# times in one ride -- and the `<unknown>` filename made it read as the
# TOOL complaining about itself rather than as a finding about this file.
lens_art = r"""
[[[REPLACE]]]
Car 2 — the copy-down actuator. Mutating shell, run after car 1 applies and only if probe 4’s BEFORE reading was sauce_in_sync=0.
cp assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py
IGNITION. The patched module is already loaded in the running kernel, so nothing about probes 1–4 requires it; those read files at call time. The notebook does require it: restart the kernel (Esc, 0, 0) after car 2, then re-run from the top. If probe 5 confirms the autoreload cell is gone, the restart is not optional hygiene, it is the only way the new module reaches the session.
For the Mac. git pull inside nix develop updates assets/nbs/imports/onboard_sauce.py, but copy_notebook_if_needed is copy-if-absent, so the working copy stays stale. Either run the same cp there, or rm Notebooks/imports/onboard_sauce.py and re-enter nix develop to let the flake stage a fresh one.
(4) PROMPT
Applied the raw-string car. Receipts below.
BEFORE (hand-run, pre-patch):
[paste the five probe outputs]
AFTER (post-patch, post-cp, post-kernel-restart):
[paste the five probe outputs again]
MAC RE-TEST:
[paste the first cell's output -- the mode selector should render with NO
SyntaxWarning above it, and Run All should reach the completion handoff]
Two items, in this order:
1. THE AUTORELOAD CELL. Probe 5 says whether assets/nbs/Onboarding.ipynb
still carries `%load_ext autoreload` / `%autoreload 2`. If both files read
0, that cell was lost during the hand-edit and nbup of the last ride, and
every sauce-module fix from here on needs a kernel restart that the
notebook never mentions. Decide whether to restore it as the first code
cell or to state the restart requirement in the markdown. If it was
removed deliberately, say so and I will stop raising it.
2. THE COPY-IF-ABSENT DELIVERY GAP, now convicted twice in two consecutive
rides -- one hand-run `cp` per fix, both to the same file. flake.nix
copies notebooks and sauce modules only when the destination is missing,
so every fix to assets/nbs/imports/ is invisible to every existing install
forever. That is correct for a notebook the human edits and wrong for
imports/*.py, which nobody is supposed to edit. Propose the split --
notebooks stay copy-if-absent, imports/ refresh when the asset is newer --
with a probe that proves a deliberately stale working copy is actually
replaced on shell entry, and an ignition (exit; nix develop) named in the
patch. Include flake.nix and assets/nbs/imports/core_sauce.py.
(5) EXTERNAL DELIVERABLES
None. Both cars are inside this repo.
MikeLev.in:
1: Probe:
Blast Radius Check to establish bisection Left-hand Causal Boundary. It is a Popper-thing. Science.
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
(nix) pipulate $ grep -c 'lens_art = r"""' assets/nbs/imports/onboard_sauce.py; echo "asset_raw_exit=$?"
.venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('assets/nbs/imports/onboard_sauce.py').read_text(),'asset','exec'); print('asset_compiles_clean')"; echo "asset_exit=$?"
.venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('Notebooks/imports/onboard_sauce.py').read_text(),'working','exec'); print('working_compiles_clean')"; echo "working_exit=$?"
diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
0
asset_raw_exit=1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "asset", line 985
--> / \-----> ,' `.------> ,--. ,-.
^^
SyntaxError: invalid escape sequence '\-'
asset_exit=1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "working", line 985
--> / \-----> ,' `.------> ,--. ,-.
^^
SyntaxError: invalid escape sequence '\-'
working_exit=1
sauce_in_sync=0
assets/nbs/Onboarding.ipynb:0
Notebooks/Onboarding.ipynb:0
autoreload_exit=1
(nix) pipulate $
2: Context:
# adhoc.txt _ _ _ to set context____ _ _ ___ ____ _ <F5> Simpson Couch Gag Here (explain anything to the audience you feel needs it explained)
# / \ __| | | | | | ___ ___ / ___| | | |/ _ \| _ \| |
# ahe/ _ \ / _` | | |_| |/ _ \ / __| | | | |_| | | | | |_) | | Onboarding nearly fixed
# ahc ___ \ (_| | | _ | (_) | (__ | |___| _ | |_| | __/|_|
# /_/ \_\__,_| |_| |_|\___/ \___| \____|_| |_|\___/|_| (_)
# Ad Hoc CHOP: The Not-Managed-by-Git Safe-for-Client-Data place
# THE ROLLING PIN BOOK ORE SPINE / FODDER FOR THE BOOK
# ! python scripts/articles/lsa.py -t 1 --reverse --fmt dated-slugs # <-- The "Rolling Pin" that gives the 40K foot book-spine view of book-ore.
# GLOSSARY.md # <-- I think this glossary goes well with the book-ore spine to do world building.
# scripts/articles/lsa.py # <-- Useful for refining commands like `posts`, critical to Second Brain concept.
# THE QUIRKY AMIGA-LOVING HUMAN
# ~/repos/nixos/autognome.py # <-- Letting the AIs really understand my environment (The Brave Little Tailor punches above Their Weight Class proving the dunning-kruger effect the gate-keeper's (lower-case) lament.)
# init.lua # <-- Daily driver hot-keys that overlap with aliases in flake.nix
# AGENTIC FRAMEWORK & FOREVER MACHINE BIG FILES
# prompt_foo.py # <-- Prompt Fu compiler, makes the very README for AGENTS-like payload you're reading right now, but it needs to be more like that
# foo_files.py # <-- This is the router, evolving book outline and the things you pin-up to produced the recursive self-improvement loops
flake.nix # <-- Solves world's WRITE ONCE RUN ANYWHERE problem like Java never could. Also resolves the bootstrap paradox.
# MAIN ACTUATORS, IaC & NEGATIVE SPACE
apply.py # <-- How can "Web UI" ChatBots edit your code? With this Aider-inspired Player Piano patch applier.
.gitattributes # <-- Model: understand that `nbstripout` and `jupytext` are both in play. Just talk the human through .ipynb patches.
.gitignore # <-- Creates "negative space" for sub-rep's to share parent environment and "snap" proprietary secret features into place.
requirements.in # <-- All known dependencies and (necessary) version pinning. WORA gotcha's exposed.
__init__.py # <-- Master versioning
pyproject.toml # <-- The PyPI Packaging details
# cli.py # <-- Catch-all actuator for PyPI envs, Python anchoring, MCP tool-call (plus alternatives) and **kwargs like wrapping for CLI
# scripts/xp.py # <-- Transforms host OS copy-paste buffer player-piano music into context-payload.
# scripts/ai.py # <-- How I constantly use local AI to write git commit messages with `m` alias.
# CONTEXT PORTABILITY SYSTEM
# scripts/foo_cartridge.py # Needs description
# scripts/foo_replay.py # Needs description
# FREQUENTLY USEFUL TO HAVE IN CONTEXT
# release.py # <-- How everything ends up where it does (GitHub, PyPI, etc.)
# scripts/weblogin.py # <-- Lets the user "warm up" the cache for their web logins at their leisure on a profile that persists.
# scripts/crawl.py # <-- Feel free to ask for something to be crawled and included in the next turn.
# imports/voice_synthesis.py # <-- The wand can talk to you
# scripts/release/version_sync.py # <-- Needs to be wrapped into release.py and eliminated, I think.
# --- Under this line is were you paste what the AI gives you ---
# --- We call it context but it's really just the right-hand ---
# --- blast-radius of the "probes" to make this all science. ---
# --- END `adhoc.txt` TEMPLATE ---
# STICKBUG & MOTHER CAT KATA
# assets/trails/botify_pageworkers.yaml
assets/installer/mck.sh
assets/installer/replay.sh
assets/trails/first_context.yaml
assets/trails/practice.yaml
assets/trails/public_walk.yaml
scripts/bookmark_import.py
scripts/boot_menu.py
scripts/connectors/README.md
scripts/connectors/botify.py
scripts/connectors/confluence.py
scripts/connectors/gmail.py
scripts/connectors/gsc.py
scripts/connectors/jira.py
scripts/connectors/mcp.py
scripts/connectors/mcp_warm.py
scripts/connectors/sheets.py
scripts/connectors/slack.py
scripts/connectors/wallet.py
scripts/mother_cat.py
scripts/sources_menu.py
scripts/walk.py
scripts/walk_cartridge.py
scripts/walk_compile.py
scripts/weblogin.py
tools/scraper_tools.py
# # # adhoc.txt -- Cleanup inert public_walk environment export block
# #
# # # --- BEFORE/AFTER STRADDLE ---
# # ! grep -n -C 2 'PIPULATE_TRAIL_WALK_ONE_URL' assets/installer/mck.sh || echo "export_block_removed"
# # ! bash -n assets/installer/mck.sh; echo "mck_syntax=$?"
# # ! bash assets/installer/mck.sh --where
# #
# # # --- TARGET SCRIPT ---
# # assets/installer/mck.sh
# #
# # ! rg -n -F 'TRAIL_NAME="${TRAIL_NAME:-public_walk}"' assets/installer/mck.sh
# # ! rg -n -e '^ *walk\(\)' -e '^ *alias walk=' flake.nix; echo "shell_walk_exit=$?"
# # ! test -e walk; echo "root_walk_exists=$?"
# # ! rg -n -e 'alias mothercat=' -e 'Three words to start from' flake.nix scripts/boot_menu.py
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! bash -n walk; echo "walk_syntax=$?"
# # ! bash walk --where
# # ! rg -n -e '^ *alias walk=' -e '^ *walk\(\)' -e 'writeShellScriptBin "walk"' flake.nix; echo "shell_walk_exit=$?"
# # ! .venv/bin/python -c 'import sys; sys.path.insert(0,"scripts"); import boot_menu as b; print("count=" + b._count_word(len(b.DOOR_TWO_WORDS))); print(" ".join(w for w, _ in b.DOOR_TWO_WORDS))'
# # walk
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! rg -in "three words|four words|door 2" flake.nix scripts/ assets/ README.md
# # ! walk --where
# # walk
# # flake.nix
# # scripts/boot_menu.py
# # assets/installer/mck.sh
#
# # ! python scripts/connectors/wallet.py check slack
# # ! python -c "import os, sys; from pathlib import Path; sys.path.insert(0, '.'); from scripts.connectors import wallet; pairs = wallet._dotenv_pairs(); print('env SLACK_USER_TOKEN:', bool(os.getenv('SLACK_USER_TOKEN')), 'env SLACK_BOT_TOKEN:', bool(os.getenv('SLACK_BOT_TOKEN')), 'vault SLACK_USER_TOKEN:', 'SLACK_USER_TOKEN' in pairs, 'vault SLACK_BOT_TOKEN:', 'SLACK_BOT_TOKEN' in pairs)"
# # ! python scripts/connectors/wallet.py warm slack --dry-run
#
# /home/mike/repos/trimnoir/_posts/2026-08-30-terminal-native-mcp-practice.md
# deleteme.txt
# Now that slack is working (on my workspace) we trim back things here to just the stick bug and Mother Cat Kata stuff
# assets/installer/install.sh # <-- Pipulate.com installer real home in github/pipulate repo
# ~/repos/Pipulate.com/CNAME
# ~/repos/Pipulate.com/_config.yml
# ~/repos/Pipulate.com/_layouts/default.html
# ~/repos/nixos/.gitignore
# ~/repos/Pipulate.com/install.md # <-- Gets copied into place here by pipulate/release.py
# assets/nbs/Onboarding.ipynb # <-- Where Workflows go to get born. Common `.venv` to FastHTML. Also to Cursor or VSCode too if you know how to set it up.
# assets/nbs/imports/core_sauce.py # <-- Make those workflows being born in Notebooks look clean by pushing the sausage factory back to code-behind Python secret sauce import modules.
# assets/nbs/imports/onboard_sauce.py # <-- Now you're cooking!
# apps/015_config.py # <-- Carrying onboarding values over to FastHTML-side, especially dotenv values. New home for Botify API key!
! grep -c 'lens_art = r"""' assets/nbs/imports/onboard_sauce.py; echo "asset_raw_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('assets/nbs/imports/onboard_sauce.py').read_text(),'asset','exec'); print('asset_compiles_clean')"; echo "asset_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('Notebooks/imports/onboard_sauce.py').read_text(),'working','exec'); print('working_compiles_clean')"; echo "working_exit=$?"
! diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
! grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
flake.nix
assets/nbs/Onboarding.ipynb
assets/nbs/imports/onboard_sauce.py
assets/nbs/imports/core_sauce.py
3: Patches:
Blast Radius Check to establish bisection Left-hand Causal Boundary. It is a Popper-thing. Science.
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
(nix) pipulate $ patch
(nix) pipulate $ app
✅ DETERMINISTIC PATCH APPLIED: Successfully mutated 'assets/nbs/imports/onboard_sauce.py'.
(nix) pipulate $ d
diff --git a/assets/nbs/imports/onboard_sauce.py b/assets/nbs/imports/onboard_sauce.py
index 3afc0d09..980867fd 100644
--- a/assets/nbs/imports/onboard_sauce.py
+++ b/assets/nbs/imports/onboard_sauce.py
@@ -977,7 +977,26 @@ def reveal_system_architecture():
from rich.text import Text
console = Console()
- lens_art = """
+ # RAW ON PURPOSE (convicted 2026-09-01, macOS first contact). This art
+ # carries \- and backslash-space sequences, which Python 3.12 reports as
+ # SyntaxWarning: invalid escape sequence. It RENDERS CORRECTLY TODAY only
+ # because an unrecognized escape currently falls through as a literal
+ # backslash plus the next character -- a behavior scheduled to become a
+ # SyntaxError. So the art was right by accident and the file was one
+ # Python release from refusing to import.
+ # THE r PREFIX CHANGES NO BYTES. Every sequence here is already being
+ # treated literally, so the panel below is byte-identical before and
+ # after; the only thing that changes is that Python stops objecting.
+ # PLACEMENT IS WHY IT MATTERED. This module is imported by the FIRST cell
+ # of Onboarding.ipynb, so the warning printed above everything else on a
+ # stranger's very first keypress, naming a file path they had never heard
+ # of, at the one moment they cannot tell noise from failure.
+ # THE INSTRUMENT WAS ALREADY REPORTING IT. apply.py's AST airlock compiles
+ # candidate content before writing, so every `app` against this file
+ # printed `<unknown>:985: SyntaxWarning` -- correct line number, three
+ # times in one ride -- and the `<unknown>` filename made it read as the
+ # TOOL complaining about itself rather than as a finding about this file.
+ lens_art = r"""
Idea --> Lens 1 --> Lens 2 --> Lens 3 -> Lens 4 -> Lens 5
-----> ,--.
(nix) pipulate $ m
📝 Committing: chore: Fix Python 3.12 SyntaxWarning in onboard_sauce.py
[main fbab4e27] chore: Fix Python 3.12 SyntaxWarning in onboard_sauce.py
1 file changed, 20 insertions(+), 1 deletion(-)
(nix) pipulate $ cp assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py
(nix) pipulate $ git push
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 48 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 1.29 KiB | 1.29 MiB/s, done.
Total 6 (delta 5), reused 3 (delta 2), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
To github.com:pipulate/pipulate.git
43090f1e..fbab4e27 main -> main
(nix) pipulate $
4: Prompt: Applied the raw-string car. Receipts below.
BEFORE (hand-run, pre-patch): [paste the five probe outputs]
AFTER (post-patch, post-cp, post-kernel-restart): [paste the five probe outputs again]
MAC RE-TEST: [paste the first cell’s output – the mode selector should render with NO SyntaxWarning above it, and Run All should reach the completion handoff]
Two items, in this order:
-
THE AUTORELOAD CELL. Probe 5 says whether assets/nbs/Onboarding.ipynb still carries
%load_ext autoreload/%autoreload 2. If both files read 0, that cell was lost during the hand-edit and nbup of the last ride, and every sauce-module fix from here on needs a kernel restart that the notebook never mentions. Decide whether to restore it as the first code cell or to state the restart requirement in the markdown. If it was removed deliberately, say so and I will stop raising it. -
THE COPY-IF-ABSENT DELIVERY GAP, now convicted twice in two consecutive rides – one hand-run
cpper fix, both to the same file. flake.nix copies notebooks and sauce modules only when the destination is missing, so every fix to assets/nbs/imports/ is invisible to every existing install forever. That is correct for a notebook the human edits and wrong for imports/*.py, which nobody is supposed to edit. Propose the split – notebooks stay copy-if-absent, imports/ refresh when the asset is newer – with a probe that proves a deliberately stale working copy is actually replaced on shell entry, and an ignition (exit; nix develop) named in the patch. Include flake.nix and assets/nbs/imports/core_sauce.py.
5: Deliverables: Working and clean Pipulate Onboarding again, I hope.
And again, that’s a pretty prompt but we just test it. And it works! Alright, we’ll let this 5-Car Train finish, but also let’s just wrap the article too insofar as you can carry out the above prompt instructions and also the below article-wrapping please and thank you.
Hop off the ride. This ride’s stated goal is reached — dismount. This is the NOTARY BEAT: the ride ends here, is witnessed here, and is sealed here. Answer all seven beats, briefly:
- TLDR: a short, dry, neutral abstract for the TOP of the published article — written for an unfamiliar reader or AI summarizer who has never seen this system. No hype, no insider handles unexplained.
- VERIFY: restate the goal from the top of this article and confirm (or deny) it was met, citing THIS compile’s receipts, not memory. Name any ignition this ride required that never fired – an AFTER tap taken without one is a stale BEFORE wearing the AFTER’s label.
- BANK: name everything that graduates — rule, earmark, todo, pin — as exact paste-ready lines, plus the exact lines to delete.
- DANGLING: what carries forward unbanked? One line each, no essays.
- SEED: the adhoc.txt lines (and TODO_SLUGS if narrative context is needed) for the next ride’s first compile.
- CLOSING: a closing summary for the BOTTOM of the article — the final take-away, tied to the book’s larger arc where it fits naturally, never forced. Storytelling over inventory.
- NOTARIZE: name the sealed artifact of record — the newest
hash-stamped cartridge (foo-
-NN.zip) — and state that its CRC-sealed, byte-reproducible archive is the witnessed receipt of this ride. The seal is the signature; the archive is the deed.
FINALITY: after beat 6, this discussion is CLOSED. Emit NO five-car train, NO probes, NO patches, NO next-turn prompt beyond the SEED lines in beat 4. Any reader or model encountering this article later should treat it as a finished, notarized document — an archive entry, not an open thread.
Opus 5 Extra:
1. VERIFY
The stated goal was: a working and clean Pipulate onboarding.
Met, on the Linux side, by this compile’s receipts.
asset_raw_exit=0with a count of1— the raw prefix is in the asset. BEFORE read0/ exit 1.asset_compiles_clean,asset_exit=0— compiling withSyntaxWarningpromoted to an error now succeeds. BEFORE was aSyntaxErrortraceback at line 985, exit 1. This is the strong probe: it proves the file carries no invalid escape, not merely that one edit landed.working_compiles_clean,working_exit=0— the same is true atNotebooks/imports/onboard_sauce.py, which is the path the notebook actually imports. BEFORE was the identical traceback. This exit flip is the delivery witness that actually fired.sauce_in_sync=0.
Bridging the Delivery Gap
One probe was degenerate and I am naming it rather than counting it. sauce_in_sync was designed as a three-state witness (0 in sync, 1 patched-not-copied, 0 after the copy). It printed 0 in both receipts, because the cp was run before this compile — both taps landed on the same side of the actuator, so the probe answered identically in the world where delivery happened and the world where it did not. It carried no information this ride. Probe 3 did its job instead.
Ignition, honestly bounded. The named ignition was a Jupyter kernel restart after the copy. No machine receipt of that restart exists in this compile, and no receipt from the Mac exists at all. The Mac result is operator-witnessed only (“we just test it. And it works!”). That is a real verification and not a fabricated one, but it is testimony, not a tap. The fresh-install path — rm -rf ~/pipulate, reinstall, run the notebook cold — remains untested end to end.
Version telemetry confirms the ride was released: 2.51 → 2.52, __version_description__ = "Onboarding Fixed Again".
2. BANK
Paste into foo_files.py’s constitution block:
# THE FIRST-CELL BLAST RADIUS RULE (banked 2026-09-01, two convictions in two
# consecutive rides). Anything the FIRST executable cell of Onboarding.ipynb
# touches -- including every module it imports at load time -- prints to a
# stranger at the one moment they cannot tell noise from failure. Both
# convictions were trivial in SUBSTANCE and severe in POSITION: a KeyError
# from a read-before-write, and a SyntaxWarning from an unraw ASCII-art
# literal. Judge a defect in that blast radius by WHERE it fires, never by how
# small it is, and hold first-cell code to the standard of a cold install
# rather than the standard of the maintainer's warm one.
# THE ACTUATOR'S OWN DIAGNOSTIC RULE (banked 2026-09-01). apply.py's AST
# airlock compiles candidate content before writing, so it printed
# `<unknown>:985: SyntaxWarning: invalid escape sequence` on THREE consecutive
# `app` runs -- correct message, correct line number -- and it read as noise
# FROM the tool rather than a finding ABOUT the file. The `<unknown>` filename
# is what disguised it: a diagnostic with no filename reads as the tool
# complaining about itself. A LINE NUMBER in an actuator's output is a finding
# about the FILE. Read it, or the instrument you built is reporting to nobody.
# THE PRE-COMPILE ACTUATOR RULE (banked 2026-09-01). A straddle probe answers
# honestly only when its two taps land on OPPOSITE sides of the actuator. The
# `diff -q` sync probe was designed as three states (0 in sync, 1 patched-not-
# copied, 0 after the cp) and printed 0 in BOTH receipts, because the cp ran
# before the compile -- the same printout in both worlds, which is the
# DISCRIMINATION QUESTION failing inside a probe written to answer it. Prefer
# a probe that reads the PROPERTY at the destination (does the working copy
# compile?) over one that COMPARES two files; the property probe cannot be
# defeated by running the actuator early.
Open earmark:
# THE COPY-IF-ABSENT DELIVERY EARMARK (opened 2026-09-01; two hand-run `cp`
# commands in two consecutive rides, both to the same file). flake.nix's
# copy_notebook_if_needed stages a file only when the destination is MISSING,
# so every fix to assets/nbs/imports/ is invisible to every existing install
# forever. Correct for a notebook the human edits; wrong for imports/*.py,
# which nobody is supposed to edit. OWED: split the loop -- notebooks stay
# copy-if-absent, imports/ refresh when the asset is newer -- with a probe
# proving a deliberately staled working copy is actually replaced, and
# `exit` then `nix develop` named as the ignition.
Delete from adhoc.txt:
! grep -c 'lens_art = r"""' assets/nbs/imports/onboard_sauce.py; echo "asset_raw_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('assets/nbs/imports/onboard_sauce.py').read_text(),'asset','exec'); print('asset_compiles_clean')"; echo "asset_exit=$?"
! .venv/bin/python -W error::SyntaxWarning -c "import pathlib; compile(pathlib.Path('Notebooks/imports/onboard_sauce.py').read_text(),'working','exec'); print('working_compiles_clean')"; echo "working_exit=$?"
! diff -q assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py >/dev/null 2>&1; echo "sauce_in_sync=$?"
! grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
3. DANGLING
- The autoreload cell is gone from both notebook copies (
0and0this compile), so a kernel restart is now load-bearing after every sauce edit and nothing in the notebook says so; whether the removal was deliberate is still unanswered. - The Mac is operator-witnessed only — no machine receipt from that host has ever entered a compile.
- The cold path (
rm -rf ~/pipulate→ reinstall → run cold) is still untested; every green so far is on a warm machine. sources_menu.py’s FOOTER namesbriefandtoolsbut notmenu, so the recall word is announced at the threshold and nowhere else.install.shtruncation safety, and the npvg.org DNS work blocked behind it, remain untouched from earlier sessions.
4. SEED
! rg -n 'copy_notebook_if_needed' flake.nix; echo "copy_fn_exit=$?"
! rg -n -F '[ ! -f "$dest" ]' flake.nix; echo "absent_gate_exit=$?"
! stat -c '%Y %n' assets/nbs/imports/onboard_sauce.py Notebooks/imports/onboard_sauce.py
! diff -q assets/nbs/imports/core_sauce.py Notebooks/imports/core_sauce.py >/dev/null 2>&1; echo "core_in_sync=$?"
! grep -c autoreload assets/nbs/Onboarding.ipynb Notebooks/Onboarding.ipynb 2>/dev/null; echo "autoreload_exit=$?"
flake.nix
assets/nbs/Onboarding.ipynb
assets/nbs/imports/core_sauce.py
assets/nbs/imports/onboard_sauce.py
5. CLOSING
Two bugs, one file, two rides, and neither bug was interesting. A key read before anything wrote it. A backslash in a picture of a funnel. Both would be beneath mention almost anywhere else in the codebase. They mattered because of where they sat: in the first cell a stranger runs, in the module that first cell imports, on the one screen where a person has no vocabulary yet for telling a warning apart from a wall.
That is the whole lesson, and it is the same lesson the flake keeps learning in its own comments — the alsa-utils platform gate that killed evaluation before the shell hook could report anything, the regex that silently truncated a version banner at an apostrophe, the copy loop that shouted twenty-four lines of INFO at the exact moment nobody could read them. Every one of those was correct-in-substance and wrong-in-position, and every one was invisible to the person who could fix it because his machine was already warm. The maintainer’s environment is the one environment the maintainer can never test in.
The sharper find this ride was not the fix at all. It was that apply.py had been reporting the escape sequence, with the right line number, on every single patch to that file — three times in one transcript — and it read as the tool clearing its throat. The instrument was working. Nobody was listening, because a diagnostic that says <unknown> sounds like a program talking about itself. An actuator that validates before it writes is a witness whether or not anyone treats it as one, and the cost of ignoring a witness you built is that you rediscover its finding on somebody else’s laptop.
And the delivery gap is now asking twice, in the operator’s own hands: two rides, two identical cp commands, same source, same destination. A fix that must be hand-carried is a fix that only reaches the person who wrote it. That is the next ride, and it is the one that decides whether any of this actually ships.
6. NOTARIZE
The sealed artifact of record is the newest rotated snapshot in the repository root, foo-<hash8>-NN.zip, alongside the canonical foo.zip this compile emitted. I will not state a digest I did not observe — the compiler prints the snapshot filename at seal time, and its hash is the identity, not a label attached to it.
That archive is verified against foo-cartridge-integrity-v1 by scripts/foo_cartridge.py: exact two-member roster, canonical ZIP metadata with no timestamps or permissions, canonical JSON, per-member SHA-256, and byte-for-byte archive reconstruction, with replay.sh pinning the verifier itself by CORE_SHA256 before that verifier is ever executed. No wall-clock value enters the hashed body, so identical inputs produce identical bytes forever, and the path is a pure function of the content.
The seal is the signature; the archive is the deed. This ride is closed.
Lessons from the First-Cell Blast Radius
Book Analysis
Ai Editorial Take
What is most fascinating here is the psychological toll of telemetry noise. When an automated tool prints warnings that look like self-diagnostic complaints, developers learn to ignore the very alarms designed to save them. True architectural resilience requires cleaning up those edge-case error channels so genuine signals stand out clearly.
🐦 X.com Promo Tweet
Why do minor code defects always strike during first-time onboarding? Read how we tackled read-before-write bugs and Python 3.12 warnings in our latest technical essay: https://mikelev.in/futureproof/first-cell-failures-setup-ergonomics-ai/ #Python #DeveloperExperience #CodeQuality
Title Brainstorm
- Title Option: First-Cell Failures: Why Setup Ergonomics Matter in the Age of AI
- Filename:
first-cell-failures-setup-ergonomics-ai - Rationale: Focuses on the core human and technical friction point: the very first execution step.
- Filename:
- Title Option: The First-Cell Blast Radius: Engineering Robust Initialization
- Filename:
first-cell-blast-radius-robust-initialization - Rationale: Emphasizes the cascading impact of early environment failures on user perception.
- Filename:
- Title Option: Eliminating Friction: Fixing Read-Before-Write Errors in Notebooks
- Filename:
eliminating-friction-read-before-write-notebooks - Rationale: Provides a direct, action-oriented title for developers troubleshooting similar database issues.
- Filename:
Content Potential And Polish
- Core Strengths:
- Clear diagnostic breakdown of hidden race conditions in fresh environment installs.
- Practical integration of AST-level compilation checks into automated patching workflows.
- Honest assessment of delivery gaps between asset definitions and active working copies.
- Suggestions For Polish:
- Standardize command-line receipt snippets to ensure uniform formatting across all documentation.
- Expand slightly on how automated test harnesses can prevent regression in initialization scripts.
Next Step Prompts
- Design an automated pre-flight hook that validates environment sync before any notebook execution begins.
- Explore strategies for unifying asset distribution so working copies never drift from their repository definitions.