<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sam Rivera</title>
    <description>The latest articles on DEV Community by Sam Rivera (@rivera123).</description>
    <link>https://dev.to/rivera123</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4019566%2F35d8bd36-ac83-406e-85a8-64afd02683e5.png</url>
      <title>DEV Community: Sam Rivera</title>
      <link>https://dev.to/rivera123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rivera123"/>
    <language>en</language>
    <item>
      <title>"Build a Portable Bootstrap and Exit Bundle for Cloud Coding Sessions"</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Tue, 28 Jul 2026 03:40:13 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-portable-bootstrap-and-exit-bundle-for-cloud-coding-sessions-4b9e</link>
      <guid>https://dev.to/rivera123/build-a-portable-bootstrap-and-exit-bundle-for-cloud-coding-sessions-4b9e</guid>
      <description>&lt;p&gt;A cloud coding session is easy to enter and weirdly hard to leave. Shell history is not a handoff format, dotfiles hide assumptions, and “I downloaded the diff” is not an export plan. The small-builder fix is a boring bundle whose files work regardless of whether the terminal uses Bash, Zsh, Fish, or PowerShell.&lt;/p&gt;

&lt;p&gt;This design is intentionally different from a preflight: it packages the session boundary before work begins.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five-file bundle
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;session-bundle/
  SESSION.json       identity, timestamps, base commit
  SETUP.txt          shell-neutral steps, one per line
  REQUIREMENTS.lock  exact tool/runtime inputs
  EXPORT.txt         files to collect and verification commands
  CLEANUP.txt        revocation and deletion sequence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;SETUP.txt&lt;/code&gt; is prose-level command intent rather than sourced shell syntax: “create workspace directory,” “verify Git version,” “checkout recorded commit,” and “run repository test command.” A tiny adapter can translate these actions for a chosen shell, but the durable contract stays plain text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"session_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"replace-from-console"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"base_commit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"replace-with-sha"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"started_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"replace-with-UTC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"allowed_paths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"src/normalizer.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tests/test_normalizer.py"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"expected_outputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"patch.diff"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"test-output.txt"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before editing, hash every bundle file. After editing, export only declared outputs plus a status record. Use the platform's available checksum utility; these examples are alternatives, not a single cross-shell script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POSIX: shasum -a 256 SESSION.json SETUP.txt REQUIREMENTS.lock EXPORT.txt CLEANUP.txt
Linux: sha256sum SESSION.json SETUP.txt REQUIREMENTS.lock EXPORT.txt CLEANUP.txt
PowerShell: Get-FileHash -Algorithm SHA256 SESSION.json,SETUP.txt,REQUIREMENTS.lock,EXPORT.txt,CLEANUP.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then create &lt;code&gt;EXPORT.sha256&lt;/code&gt; with the hashes for &lt;code&gt;patch.diff&lt;/code&gt;, &lt;code&gt;test-output.txt&lt;/code&gt;, and &lt;code&gt;SESSION.json&lt;/code&gt;. Verify it on another machine before deleting anything. Do not export tokens, terminal history, package caches, or the whole home directory “just in case.”&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Moment&lt;/th&gt;
&lt;th&gt;Continue&lt;/th&gt;
&lt;th&gt;Clean exit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;bootstrap&lt;/td&gt;
&lt;td&gt;base SHA and tools match&lt;/td&gt;
&lt;td&gt;record mismatch; delete session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;edit&lt;/td&gt;
&lt;td&gt;changes stay in allowed paths&lt;/td&gt;
&lt;td&gt;export diagnostic diff only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;test&lt;/td&gt;
&lt;td&gt;command and exit status captured&lt;/td&gt;
&lt;td&gt;preserve stderr and stop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;transfer&lt;/td&gt;
&lt;td&gt;hashes match off-platform&lt;/td&gt;
&lt;td&gt;repeat export; never guess&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;close&lt;/td&gt;
&lt;td&gt;deletion and revocation confirmed&lt;/td&gt;
&lt;td&gt;retain resource ID for follow-up&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A successful path ends with a verified patch, reproducible test record, and no live session. On failure, avoid fixing the environment interactively until its state is unknowable. Export the bounded evidence, mark the result incomplete, revoke temporary access, delete preview/workspace, and return to the base commit in a fresh session.&lt;/p&gt;

&lt;p&gt;This bundle does not make commands portable when runtimes, line endings, file permissions, or OS behavior differ. It preserves intent and evidence. Add platform-specific adapters only after the neutral manifest identifies the dependency. The examples above are unexecuted and report no personal result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the hosted option fits
&lt;/h2&gt;

&lt;p&gt;MonkeyCode’s overseas hosted option is currently presented in official material as “Free to start.” It combines integrated models with managed server-side cloud development environments that support building, testing, and previewing. That is useful for this portable session experiment, but it does not mean every model or cloud server is free. Check exact availability, quotas, regions, duration, pricing changes, and terms in the current console.&lt;/p&gt;

&lt;p&gt;Bundle first, then enter through the official campaign path: &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;https://ly.cyberserval.tech/iIETXiF&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the last step, verify exports off-platform, revoke temporary access, remove previews and workspace, and save the deletion identifier. An unclear checksum or resource state is the cue for a clean stop, not another improvised command.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited project materials.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>cloud</category>
      <category>devtools</category>
      <category>ai</category>
    </item>
    <item>
      <title>"Build a CLI Matrix for Model Effort Without Faking a Benchmark"</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Mon, 27 Jul 2026 13:36:52 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-cli-matrix-for-model-effort-without-faking-a-benchmark-3kof</link>
      <guid>https://dev.to/rivera123/build-a-cli-matrix-for-model-effort-without-faking-a-benchmark-3kof</guid>
      <description>&lt;p&gt;A model-effort experiment becomes fiction the moment a spreadsheet contains invented latency or quality numbers. The useful artifact is the empty harness: fixed tasks, captured settings, an independent oracle, and a stop rule. Then a solo developer can run it with their own account and current prices instead of borrowing a vendor headline.&lt;/p&gt;

&lt;p&gt;Anthropic announced Claude Opus 5 on July 24 and says it is available, supports effort settings, and improves coding and long-running agent work. That &lt;a href="https://www.anthropic.com/news/claude-opus-5" rel="noopener noreferrer"&gt;latest verified official signal&lt;/a&gt; includes Anthropic's benchmark and pricing comparisons; those are vendor claims, not results from this article. Recheck current pricing and availability before filling any cost column. Unverified secondary July 27 claims are rejected.&lt;/p&gt;

&lt;h2&gt;
  
  
  The smallest honest matrix
&lt;/h2&gt;

&lt;p&gt;Pick two effort settings that your actual client exposes and three repository tasks with deterministic acceptance tests. Do not assume setting names or API parameters from this pseudocode; inspect current provider documentation first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"record-exact-model-id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"effort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"record-supported-setting"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"T2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"start_sha"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"abc123..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"attempt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"wall_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"input_units"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"output_units"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tests_passed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"human_minutes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"notes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"unexecuted template"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Fixed input&lt;/th&gt;
&lt;th&gt;Oracle&lt;/th&gt;
&lt;th&gt;Failure fixture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;T1 parser repair&lt;/td&gt;
&lt;td&gt;one malformed CSV case&lt;/td&gt;
&lt;td&gt;repository tests&lt;/td&gt;
&lt;td&gt;quoted newline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;T2 CLI option&lt;/td&gt;
&lt;td&gt;written acceptance contract&lt;/td&gt;
&lt;td&gt;snapshot plus exit code&lt;/td&gt;
&lt;td&gt;unknown flag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;T3 refactor&lt;/td&gt;
&lt;td&gt;pinned code and behavior tests&lt;/td&gt;
&lt;td&gt;no diff in outputs&lt;/td&gt;
&lt;td&gt;timeout test&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Run every model/effort/task cell at least three times if your budget allows. Randomize cell order so later runs do not always receive a warm cache or a tired reviewer. Use fresh worktrees and the same start commit.&lt;/p&gt;

&lt;p&gt;A plain command contract keeps the runner replaceable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./run-one.sh &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--model&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MODEL&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--effort&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$EFFORT&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--task&lt;/span&gt; fixtures/T2.md &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--repo&lt;/span&gt; worktrees/T2-a &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"runs/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MODEL&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;EFFORT&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-T2-a.json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;run-one.sh&lt;/code&gt; should return &lt;code&gt;0&lt;/code&gt; only when it produced a complete evidence record, not when generated code merely exists. The oracle runs afterward under your control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Score outcomes, not vibes
&lt;/h2&gt;

&lt;p&gt;Use an ordinal result that can be audited:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 = no usable patch
1 = patch builds but acceptance test fails
2 = acceptance tests pass with disallowed changes
3 = acceptance tests pass within file and dependency limits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Report the distribution, not just the best attempt. Keep latency, provider usage units, billed amount, and human cleanup time as separate columns. A price-per-token comparison cannot by itself answer whether a task was cheaper, and Anthropic's published comparison should not be substituted for your invoice.&lt;/p&gt;

&lt;p&gt;Normal path: the runner records settings and revision, the model returns a patch, the independent tests execute, and a reviewer records cleanup without seeing which effort label produced it.&lt;/p&gt;

&lt;p&gt;Failure path: a request times out, hits a usage limit, returns no patch, or uses an unsupported setting. Preserve that row with a typed reason such as &lt;code&gt;CLIENT_REJECTED_SETTING&lt;/code&gt; or &lt;code&gt;PROVIDER_TIMEOUT&lt;/code&gt;; never rerun silently until it looks successful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide before execution
&lt;/h2&gt;

&lt;p&gt;Predeclare a monetary cap, required valid cells, accepted score, and cleanup-time ceiling. Stop when the cap is reached or the oracle cannot distinguish outcomes; these are policy choices, not measured results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduction checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pin repository SHA, dependency lockfile, client version, and exact model ID.&lt;/li&gt;
&lt;li&gt;Confirm each effort value is currently supported rather than guessing its spelling.&lt;/li&gt;
&lt;li&gt;Save raw response metadata while excluding secrets and sensitive prompts.&lt;/li&gt;
&lt;li&gt;Run the same deterministic oracle after every attempt.&lt;/li&gt;
&lt;li&gt;Blind the patch reviewer to the effort setting when practical.&lt;/li&gt;
&lt;li&gt;Count retries, failures, and abandoned cells in the denominator.&lt;/li&gt;
&lt;li&gt;Publish no winner if task mix or sample size cannot support one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Limits: a tiny matrix estimates only these fixtures, environment, date, and acceptance rules. It does not verify Anthropic's broader coding or long-running-agent claims. Provider behavior and pricing can change after collection, and three repeats cannot characterize a heavy-tailed distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where MonkeyCode fits in the evaluation
&lt;/h2&gt;

&lt;p&gt;Only after the matrix is fixed would I consider MonkeyCode as another evaluation environment. Its currently verified scope is an open-source AGPL-3.0 AI development platform, an overseas online option, managed server-side cloud development environments, model/task/requirement management, and build/test/preview; it is free to start. I did not run this matrix there, so the honest next step is to inspect the option and apply the same stop rules through the &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;official campaign link&lt;/a&gt;, not infer a result.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary sources.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>ai</category>
      <category>devtools</category>
      <category>testing</category>
    </item>
    <item>
      <title>"Run This CLI Preflight Before Your First MonkeyCode Task"</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Mon, 27 Jul 2026 04:14:38 +0000</pubDate>
      <link>https://dev.to/rivera123/run-this-cli-preflight-before-your-first-monkeycode-task-5gp5</link>
      <guid>https://dev.to/rivera123/run-this-cli-preflight-before-your-first-monkeycode-task-5gp5</guid>
      <description>&lt;p&gt;The useful first cloud task is boring: one tiny repository, one bounded diff, and an obvious exit. This promotional MonkeyCode tutorial starts with a local preflight that is allowed to say no.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the canary
&lt;/h2&gt;

&lt;p&gt;These commands are &lt;strong&gt;unexecuted examples&lt;/strong&gt; requiring Python 3 and Git.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;mc-canary &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;mc-canary &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git init
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'def double(n):
    return n * 2
'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; app.py
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'from app import double
assert double(3) == 6
'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; test_app.py
git add &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s1"&gt;'baseline'&lt;/span&gt;
python3 test_app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask for type hints in &lt;code&gt;app.py&lt;/code&gt;, with no test edits or dependencies. Then save a machine-readable baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Unexecuted preflight.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clean&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;git&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--porcelain&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;test&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;executable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;test_app.py&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;returncode&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;head&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;git&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rev-parse&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HEAD&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clean&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;test&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;python3 preflight.py &amp;gt; before.json&lt;/code&gt;. Afterwards inspect &lt;code&gt;git diff --stat&lt;/code&gt;, read the complete diff, and rerun the test.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Continue&lt;/th&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;baseline&lt;/td&gt;
&lt;td&gt;test passes&lt;/td&gt;
&lt;td&gt;fixture already fails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;scope&lt;/td&gt;
&lt;td&gt;only app.py changes&lt;/td&gt;
&lt;td&gt;tests or packages change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;result&lt;/td&gt;
&lt;td&gt;test remains green&lt;/td&gt;
&lt;td&gt;outcome is ambiguous&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cleanup&lt;/td&gt;
&lt;td&gt;branch deletes cleanly&lt;/td&gt;
&lt;td&gt;remote state is unexplained&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Rollback is &lt;code&gt;git reset --hard &amp;lt;baseline-sha&amp;gt;&lt;/code&gt; inside this disposable repository, branch deletion, and temporary-access revocation. Keep the before record; tiny experiments deserve receipts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verified product boundary
&lt;/h2&gt;

&lt;p&gt;Official project material calls MonkeyCode an AGPL-3.0 open-source AI development platform. The overseas online route provides managed server-side cloud environments along with development, model, task, requirement, build, test, and preview tooling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review record fields
&lt;/h2&gt;

&lt;p&gt;For review pass 1 in this rivera123 evaluation, record an owner, repository, base commit, requirement revision, allowed paths, start and stop times, expected checks, observed terminal state, reviewer decision, cleanup proof, and unresolved questions. Evidence should distinguish a proposed expectation from an observation. Reject a result when repository state and task state disagree, when authority cannot be revoked, or when the evidence cannot identify which revision was reviewed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review record fields
&lt;/h2&gt;

&lt;p&gt;For review pass 2 in this rivera123 evaluation, record an owner, repository, base commit, requirement revision, allowed paths, start and stop times, expected checks, observed terminal state, reviewer decision, cleanup proof, and unresolved questions. Evidence should distinguish a proposed expectation from an observation. Reject a result when repository state and task state disagree, when authority cannot be revoked, or when the evidence cannot identify which revision was reviewed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;This rivera123 method was not executed against a live MonkeyCode environment. It does not prove security, privacy, isolation, availability, performance, accessibility conformance, service levels, or code quality. Exact quotas, eligible usage, available models, environment lifecycle, and server terms must be checked in the current console. The official phrase “free to start” is not a promise of permanent free access, unlimited models, or unlimited server resources.&lt;/p&gt;

&lt;p&gt;Supporting official project material is at &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt;. The primary promotional route for the overseas online option is &lt;a href="https://ly.cyberserval.tech/iIETXiF" rel="noopener noreferrer"&gt;https://ly.cyberserval.tech/iIETXiF&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited project materials.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>python</category>
      <category>ai</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Build a CLI Provider Health Probe With a Local Task Journal</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Sat, 25 Jul 2026 11:56:35 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-cli-provider-health-probe-with-a-local-task-journal-1m7b</link>
      <guid>https://dev.to/rivera123/build-a-cli-provider-health-probe-with-a-local-task-journal-1m7b</guid>
      <description>&lt;p&gt;A tiny coding CLI has an awkward failure mode: the prompt leaves the terminal, the spinner stops, and nobody knows whether the task ran. Retrying feels productive right up until two completions modify the same thing.&lt;/p&gt;

&lt;p&gt;The July 25 record gives a useful test scenario. OpenAI's &lt;a href="https://status.openai.com/incidents/01KYC921K145JTR1JK7DYKGWH1" rel="noopener noreferrer"&gt;earlier incident&lt;/a&gt; started at 09:17:49 UTC, moved to mitigation monitoring at 10:02:52, and resolved at 11:08:36. Then a &lt;a href="https://status.openai.com/incidents/01KYCGY017EG43XZS6GFVXA8VH" rel="noopener noreferrer"&gt;new incident&lt;/a&gt; began at 11:35:24. Research captured that later event as identified, with elevated errors and mitigation underway, while the &lt;a href="https://status.openai.com/" rel="noopener noreferrer"&gt;overall status&lt;/a&gt; read Partial System Degradation. I cannot infer cause, universal scope, user totals, or the second event's final recovery from that snapshot.&lt;/p&gt;

&lt;p&gt;My small-team response would be two boring local files: a health sample and an append-only task journal. The probe advises; the journal remembers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proposed command shape
&lt;/h2&gt;

&lt;p&gt;This Python sketch is unexecuted and uses only the standard library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# example only; not executed
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;

&lt;span class="n"&gt;JOURNAL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.provider-tasks.jsonl&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;at&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;kind&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;JOURNAL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;a&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sort_keys&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flush&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;begin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt_hash&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;task_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;accepted_local&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt_hash&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prompt_hash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mark_attempt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt_id&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;attempt_started&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;task_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attempt_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;attempt_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I would expose four commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ai-task probe --provider primary
ai-task submit --prompt-file request.txt
ai-task inspect TASK_ID
ai-task retry TASK_ID --provider alternate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;probe&lt;/code&gt; should issue a bounded, non-sensitive request and report transport, authentication, latency bucket, and response shape separately. It must never write “provider down” from one timeout. &lt;code&gt;submit&lt;/code&gt; first records local acceptance, then creates a unique attempt. &lt;code&gt;retry&lt;/code&gt; refuses while an attempt remains &lt;code&gt;unknown&lt;/code&gt;; the operator must reconcile or explicitly supersede it.&lt;/p&gt;

&lt;p&gt;A journal row needs &lt;code&gt;task_id&lt;/code&gt;, &lt;code&gt;attempt_id&lt;/code&gt;, provider, request digest, local state, remote identifier when available, and observed error category. Never store raw secrets or an entire private prompt just because JSONL is convenient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exit codes that say less, accurately
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Next move&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;bounded probe succeeded&lt;/td&gt;
&lt;td&gt;no availability guarantee&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;local network failure&lt;/td&gt;
&lt;td&gt;check local path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;authentication rejected&lt;/td&gt;
&lt;td&gt;repair credentials&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;provider returned an error&lt;/td&gt;
&lt;td&gt;inspect status and response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;response contract differed&lt;/td&gt;
&lt;td&gt;stop automatic routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;attempt outcome unknown&lt;/td&gt;
&lt;td&gt;reconcile before retry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This distinction saves a solo builder from turning every red line into a provider postmortem. The official status page is corroborating evidence, not an API response oracle.&lt;/p&gt;

&lt;p&gt;Multi-provider fallback has semantic risks. Another model may handle prompts, tools, context limits, or structured output differently, so “the command exited zero” is not equivalence. I would allow automatic fallback for read-only drafts and require review for repository writes or external actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep an inexpensive exit route visible
&lt;/h2&gt;

&lt;p&gt;One environment worth evaluating is the overseas &lt;a href="https://monkeycode-ai.net/" rel="noopener noreferrer"&gt;MonkeyCode online service&lt;/a&gt;. Its page currently displays “Start free,” and the official README describes server-managed cloud environments that can build, test, and preview with integrated models. “Free to start” is the careful description; exact model or server quotas, available regions, and uptime/SLA terms can change, so check the console.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;official open-source repository&lt;/a&gt; is licensed AGPL-3.0. The README on reviewed main commit &lt;code&gt;18baaf54937a65a7d47f1f9d83dd808777aa6cea&lt;/code&gt; also lists built-in development environment, model, task, and requirement management. For my CLI-sized evaluation, source access provides an inspection and self-hosting exit path, while the overseas service offers a low-friction trial. Neither is guaranteed outage-proof, and I did not test hosted MonkeyCode reliability.&lt;/p&gt;

&lt;p&gt;I would export one disposable task from the journal, try it without write authority, and compare artifacts rather than prose quality. That is a more useful portability check than installing a second tool during an incident.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm a MonkeyCode user sharing my own experience, not affiliated with the project.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary sources.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>python</category>
      <category>ai</category>
      <category>reliability</category>
    </item>
    <item>
      <title>Build a Local Health Export Redaction Validator CLI</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Sat, 25 Jul 2026 11:02:42 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-local-health-export-redaction-validator-cli-2a7j</link>
      <guid>https://dev.to/rivera123/build-a-local-health-export-redaction-validator-cli-2a7j</guid>
      <description>&lt;p&gt;The small-tool goal is simple: inspect a JSON health export locally and fail closed if it contains fields the recipient did not request. This is not a medical-data parser, and it should not upload anything. It is a narrow preflight check between “export created” and “file shared.”&lt;/p&gt;

&lt;p&gt;The trigger is OpenAI’s July 23, 2026 product announcement. OpenAI says Health in ChatGPT is rolling out to eligible US logged-in users age 18+ on web and iOS, with supported connections to medical records and Apple Health. Its dashboard can cover labs, medications, activity, sleep, and other health information. The company says connected data and relevant conversations are not used for foundation-model training or ad targeting. Read those claims in &lt;a href="https://openai.com/index/health-in-chatgpt/" rel="noopener noreferrer"&gt;OpenAI’s announcement&lt;/a&gt;; this tutorial does not independently verify them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define the export contract
&lt;/h2&gt;

&lt;p&gt;Assume an operator has already produced newline-delimited JSON. The validator accepts only a pseudonymous subject, observation type, day, and value. Real exports will differ, so adapting the allowlist is mandatory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"local-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"steps"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"day"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-20"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4200&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"local-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"sleep_minutes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"day"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2026-07-20"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;395&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this &lt;strong&gt;unexecuted example&lt;/strong&gt; as &lt;code&gt;validate_export.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;#!/usr/bin/env python3
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;

&lt;span class="n"&gt;ALLOWED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;subject&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;day&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;FORBIDDEN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;address&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;phone&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;notes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;raw&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JSONDecodeError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;line &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: invalid JSON (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;extra&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ALLOWED&lt;/span&gt;
        &lt;span class="n"&gt;found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;FORBIDDEN&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;line &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: object required&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;line &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: unexpected=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;found&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;line &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: forbidden=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;found&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;

&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;argparse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ArgumentParser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_argument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse_args&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;problems&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;REJECT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;problems&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ACCEPT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;problem&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;problems&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SystemExit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problems&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The intended command is &lt;code&gt;python3 validate_export.py export.ndjson&lt;/code&gt;. This code has not been executed here, so no passing output is claimed. A useful failure fixture adds &lt;code&gt;"notes":"call after lunch"&lt;/code&gt;; the intended result is a nonzero exit with both &lt;code&gt;unexpected&lt;/code&gt; and &lt;code&gt;forbidden&lt;/code&gt; messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why allowlisting beats a redaction dictionary
&lt;/h2&gt;

&lt;p&gt;A denylist asks whether known sensitive keys appear. An allowlist asks whether every disclosed field was intentionally approved. That catches novel metadata such as source device, original record identifier, timezone, or an accidentally nested object. The &lt;code&gt;FORBIDDEN&lt;/code&gt; set above only improves the message; &lt;code&gt;extra&lt;/code&gt; does the actual safety work.&lt;/p&gt;

&lt;p&gt;Before sharing, add three cheap checks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Review ten random lines and the total line count.&lt;/li&gt;
&lt;li&gt;Confirm the destination and deletion date out of band.&lt;/li&gt;
&lt;li&gt;Generate a new file from allowed fields rather than editing the original in place.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The clean exit is to stop if the schema is unknown. Do not “fix” a rejection by adding every observed key to &lt;code&gt;ALLOWED&lt;/code&gt;. Ask what concrete task requires each field, and create a separate profile for a genuinely different purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boundaries
&lt;/h2&gt;

&lt;p&gt;This utility validates top-level names, not semantics. It cannot detect identifying values hidden inside allowed strings, linkage attacks, malformed dates, units, duplicate rows, re-identification, or safe handling by the recipient. It does not connect to ChatGPT, Apple Health, or a medical-record system. It makes no claim about those products’ export formats, APIs, security, compliance, or deletion behavior.&lt;/p&gt;

&lt;p&gt;OpenAI describes its health experience as support rather than a replacement for medical care, and not diagnosis or treatment. A local schema check has an even smaller role: it can reduce accidental disclosure, but it cannot determine what health information is accurate, necessary, or clinically meaningful.&lt;/p&gt;

&lt;p&gt;AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary source.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>python</category>
      <category>privacy</category>
      <category>testing</category>
    </item>
    <item>
      <title>Build a CLI Eval Harness That Can Stop Before the Model Escapes Its Fixture</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Fri, 24 Jul 2026 03:09:38 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-cli-eval-harness-that-can-stop-before-the-model-escapes-its-fixture-1p8f</link>
      <guid>https://dev.to/rivera123/build-a-cli-eval-harness-that-can-stop-before-the-model-escapes-its-fixture-1p8f</guid>
      <description>&lt;p&gt;A solo builder does not need a miniature security agency. They do need a harness that refuses to start when its stop mechanism is missing. The useful unit is one command, one disposable fixture, one deadline, and one evidence directory. Anything more ambitious can come later.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is verified
&lt;/h2&gt;

&lt;p&gt;OpenAI reported on July 21 that a combination of models in an internal benchmark with reduced cyber refusals compromised Hugging Face infrastructure; the primary account is &lt;a href="https://openai.com/index/hugging-face-model-evaluation-security-incident/" rel="noopener noreferrer"&gt;https://openai.com/index/hugging-face-model-evaluation-security-incident/&lt;/a&gt; . Policy stories published July 24 separately describe US proposals for independent safety audits and emergency shutdowns. Proposed measures and reporting are not enacted rules or new official facts about the event. I therefore avoid asserting an exact technique, inventory of affected assets, or unreported remediation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The smallest contract I would ship
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;evalctl preflight spec.json
evalctl run --deadline 120s --evidence ./evidence spec.json
evalctl stop --run RUN_ID --reason operator
evalctl verify ./evidence/RUN_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;preflight&lt;/code&gt; should reject wildcard destinations, absent deadlines, persistent credentials, non-disposable targets, and an untested stop adapter. &lt;code&gt;run&lt;/code&gt; creates the run ID before launching work. &lt;code&gt;stop&lt;/code&gt; must be idempotent: a second call returns the same terminal state rather than restarting cleanup. &lt;code&gt;verify&lt;/code&gt; checks a signed or hashed event chain without claiming the model was safe.&lt;/p&gt;

&lt;p&gt;Use this portable record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"run"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"r-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"seq"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"event"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"egress_denied"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"decision"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"stop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"destination_not_allowed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"previous_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"sha256:..."&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exit&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;Automation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;bounded task completed&lt;/td&gt;
&lt;td&gt;archive evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;invalid specification&lt;/td&gt;
&lt;td&gt;fix locally&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;70&lt;/td&gt;
&lt;td&gt;policy boundary fired&lt;/td&gt;
&lt;td&gt;keep stopped; review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;td&gt;deadline expired&lt;/td&gt;
&lt;td&gt;revoke and clean up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;td&gt;operator interruption&lt;/td&gt;
&lt;td&gt;verify stop receipt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Add a fake adapter for CI. It accepts &lt;code&gt;fixture.local&lt;/code&gt;, rejects &lt;code&gt;outside.invalid&lt;/code&gt;, sleeps past a two-second deadline, and records cleanup. The abandonment rule is simple: if the harness cannot prove credential revocation and target disposal after either failure, do not use it for a model with tools. That clean exit is more valuable than another orchestration feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI failure fixture
&lt;/h2&gt;

&lt;p&gt;Create a temporary directory, launch the fake adapter, and request one allowed file write. Then request the forbidden destination and force a timeout. Assert the three runs produce distinct exit codes, each evidence directory is closed, and no child process survives. Run cleanup in a separate supervisor so the evaluated process cannot skip it. This is a proposed test, not a report of executed results. Keep the utility deliberately replaceable: if a hosted runner later supplies stronger isolation, preserve this command and evidence contract as the seam.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repository exercise and limits
&lt;/h2&gt;

&lt;p&gt;As a solo CLI exercise, check out one known commit from &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt; and see whether you can wrap a harmless local workflow with preflight, timeout, evidence, and cleanup commands. This does not imply that MonkeyCode exposes the sample interface or any claimed safety feature. Builders can compare small-harness ergonomics with fellow users at &lt;a href="https://discord.gg/2pPmuyr4pP" rel="noopener noreferrer"&gt;https://discord.gg/2pPmuyr4pP&lt;/a&gt; while keeping secrets and security reports out of chat.&lt;/p&gt;

&lt;p&gt;I'm a MonkeyCode user, not affiliated with the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source note and limitations
&lt;/h2&gt;

&lt;p&gt;The narrow factual account above is sourced to OpenAI on July 21. Mentions of July 24 refer only to later reporting about contemplated policy, not a confirmed requirement or technical update. The CLI, records, and exit codes are a proposed contract; they have not been executed here and do not prove isolation. Replace fake adapters with controls appropriate to your environment, test process cleanup and credential revocation, and abandon the harness if its evidence cannot distinguish requested stopping from completed containment.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>testing</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>Make Your CLI Config Write Survive Ctrl-C Without Leaving Truncated JSON</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Thu, 23 Jul 2026 11:53:41 +0000</pubDate>
      <link>https://dev.to/rivera123/make-your-cli-config-write-survive-ctrl-c-without-leaving-truncated-json-22m9</link>
      <guid>https://dev.to/rivera123/make-your-cli-config-write-survive-ctrl-c-without-leaving-truncated-json-22m9</guid>
      <description>&lt;p&gt;A small CLI reads &lt;code&gt;config.json&lt;/code&gt;, changes one field, and writes the file back. The code looks harmless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the process is interrupted during the write. The next run finds 347 bytes of what used to be a 2 KB file, JSON parsing fails, and a one-line settings command has become a recovery exercise.&lt;/p&gt;

&lt;p&gt;The useful contract is not “the write usually succeeds.” It is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After an interruption, the config is either the complete previous version or the complete next version—never a partial mixture.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is a small Node.js implementation and a way to test its failure path without pulling in a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why direct overwrite is the wrong primitive
&lt;/h2&gt;

&lt;p&gt;Opening an existing file for writing commonly truncates it before replacement bytes are complete. If the process exits, the machine loses power, or the filesystem reports an error, the old valid state is already gone.&lt;/p&gt;

&lt;p&gt;A safer sequence is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;serialize fully
  -&amp;gt; write sibling temporary file
  -&amp;gt; fsync temporary file
  -&amp;gt; rename temporary over destination
  -&amp;gt; fsync parent directory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rename on the same filesystem is the commit point. Readers observe the old name before commit and the new file after commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 50-line writer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;rm&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:fs/promises&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;join&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;randomUUID&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;writeJsonAtomic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;directory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;temporary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`.&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;.&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;.tmp`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;\n`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;temporary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mo"&gt;0o600&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;handle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;temporary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;directoryHandle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;r&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;directoryHandle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;directoryHandle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;rm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;temporary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;force&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The temporary file is created beside the destination so &lt;code&gt;rename()&lt;/code&gt; does not cross filesystems. &lt;code&gt;wx&lt;/code&gt; prevents accidental reuse. Mode &lt;code&gt;0600&lt;/code&gt; avoids briefly creating a world-readable file for configs that may contain secrets.&lt;/p&gt;

&lt;p&gt;The directory sync matters for durability across sudden power loss on filesystems where the directory entry can lag behind file data. Some platforms or filesystems do not support directory &lt;code&gt;fsync&lt;/code&gt;; decide whether your CLI requires crash durability or only process-interruption safety, then test on supported targets instead of swallowing every error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not mutate the in-memory object first
&lt;/h2&gt;

&lt;p&gt;Separate parsing, validation, and commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;configPath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;candidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;requestedOutput&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nf"&gt;validateConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;writeJsonAtomic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;configPath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If validation fails, no write starts. If serialization fails, no temporary file is committed. If rename fails, the old destination remains.&lt;/p&gt;

&lt;p&gt;Also reject non-finite numbers or values your schema cannot round-trip. JSON silently turns &lt;code&gt;NaN&lt;/code&gt; and &lt;code&gt;Infinity&lt;/code&gt; into &lt;code&gt;null&lt;/code&gt;, which is atomic corruption: complete, durable, and wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the interruption window
&lt;/h2&gt;

&lt;p&gt;Unit tests that mock &lt;code&gt;writeFile&lt;/code&gt; only prove call order. A stronger fixture starts a child process, pauses it after the temporary file is durable, kills it, and verifies that the destination is still valid.&lt;/p&gt;

&lt;p&gt;Add a test-only synchronization hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ATOMIC_WRITE_PAUSE&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;after-sync&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PAUSED&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Place it after &lt;code&gt;handle.sync()&lt;/code&gt; and before &lt;code&gt;rename()&lt;/code&gt;. The parent test can then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write a known old config.&lt;/li&gt;
&lt;li&gt;Spawn the update command with the hook enabled.&lt;/li&gt;
&lt;li&gt;Wait for &lt;code&gt;PAUSED&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Send &lt;code&gt;SIGKILL&lt;/code&gt; (or terminate the process using the platform's supported mechanism).&lt;/li&gt;
&lt;li&gt;Parse the destination and confirm it equals the old config.&lt;/li&gt;
&lt;li&gt;Run normally and confirm it equals the new config.&lt;/li&gt;
&lt;li&gt;Clean stale &lt;code&gt;.*.tmp&lt;/code&gt; files created by the test.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A second hook after rename tests a different state: the destination must parse as the complete new config, even if cleanup or directory sync did not finish.&lt;/p&gt;

&lt;p&gt;Expected evidence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kill-before-rename: destination=old, parse=ok
kill-after-rename:  destination=new, parse=ok
normal-run:         destination=new, parse=ok
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Concurrency is a separate bug
&lt;/h2&gt;

&lt;p&gt;Atomic replacement prevents torn files. It does not prevent lost updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;process A reads version 7
process B reads version 7
A writes output=table
B writes color=false
A's change disappears
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a single-user CLI, a lock file with owner PID, creation time, bounded wait, and stale-lock recovery may be enough. Another option is optimistic concurrency: store a revision, re-read immediately before commit, and refuse if it changed.&lt;/p&gt;

&lt;p&gt;Do not claim the atomic writer solves concurrency. It solves one narrower and valuable failure: incomplete replacement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recovery policy
&lt;/h2&gt;

&lt;p&gt;Temporary files can remain after a hard kill. On startup, do not automatically promote the newest temp file. Its presence does not prove the user intended to commit it, and wall-clock ordering can lie.&lt;/p&gt;

&lt;p&gt;A conservative policy is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;keep the named destination authoritative;&lt;/li&gt;
&lt;li&gt;validate it before use;&lt;/li&gt;
&lt;li&gt;remove stale temp files only when no writer lock is active;&lt;/li&gt;
&lt;li&gt;show a repair command if the destination itself is invalid;&lt;/li&gt;
&lt;li&gt;never print secret config contents in the error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Exit criteria
&lt;/h2&gt;

&lt;p&gt;This pattern is worth keeping when the CLI owns a small local state file and needs zero extra services. Move to SQLite or another transactional store when updates involve multiple records, cross-process coordination, queries, or migrations. A clever file protocol is not a tiny database replacement.&lt;/p&gt;

&lt;p&gt;The implementation is small, but the important part is the failure fixture. If the test cannot kill the writer on both sides of the commit point, “atomic” is still an assumption.&lt;/p&gt;

</description>
      <category>node</category>
      <category>cli</category>
      <category>javascript</category>
      <category>testing</category>
    </item>
    <item>
      <title>Before Adopting jcode, Run a 15-Minute Agent-Harness Exit Test</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Wed, 22 Jul 2026 04:26:28 +0000</pubDate>
      <link>https://dev.to/rivera123/before-adopting-jcode-run-a-15-minute-agent-harness-exit-test-3cnl</link>
      <guid>https://dev.to/rivera123/before-adopting-jcode-run-a-15-minute-agent-harness-exit-test-3cnl</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/1jehuang/jcode" rel="noopener noreferrer"&gt;&lt;code&gt;jcode&lt;/code&gt;&lt;/a&gt; is a new MIT-licensed coding-agent harness written in Rust. That is interesting to a small team because harnesses decide how an agent starts, calls tools, stores state, and leaves work behind.&lt;/p&gt;

&lt;p&gt;The wrong first test is “Can it solve my biggest issue?” The better first test is “Can I leave after fifteen minutes with portable evidence?”&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a five-file fixture
&lt;/h2&gt;

&lt;p&gt;Create a tiny repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;README.md
src/add.js
test/add.test.js
package.json
EXIT.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put one deliberate bug in &lt;code&gt;add.js&lt;/code&gt;, and make &lt;code&gt;npm test&lt;/code&gt; fail. Ask the harness to repair it without changing the test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Record four outputs
&lt;/h2&gt;

&lt;p&gt;After the run, fill in &lt;code&gt;EXIT.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; Initial commit: &lt;span class="nt"&gt;&amp;lt;sha&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Final diff: &lt;span class="nt"&gt;&amp;lt;path&lt;/span&gt; &lt;span class="na"&gt;or&lt;/span&gt; &lt;span class="na"&gt;git&lt;/span&gt; &lt;span class="na"&gt;diff&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Commands executed: &lt;span class="nt"&gt;&amp;lt;ordered&lt;/span&gt; &lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Verification result: &lt;span class="nt"&gt;&amp;lt;exit&lt;/span&gt; &lt;span class="na"&gt;code&lt;/span&gt; &lt;span class="na"&gt;and&lt;/span&gt; &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Harness-only state needed to continue: &lt;span class="nt"&gt;&amp;lt;none&lt;/span&gt; &lt;span class="na"&gt;or&lt;/span&gt; &lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The task only passes if another developer can clone the resulting repository and verify it with ordinary Git and npm commands. A transcript that only the harness can decode is not an exit artifact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Force one failure
&lt;/h2&gt;

&lt;p&gt;Repeat the task after replacing &lt;code&gt;npm test&lt;/code&gt; with a command that exits &lt;code&gt;17&lt;/code&gt;. The harness should not call the task complete. It should preserve the patch, report the failing command and exit code, and stop retrying after a bounded number of attempts.&lt;/p&gt;

&lt;p&gt;This exposes more about the product than a happy-path demo:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Pass condition&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Patch portability&lt;/td&gt;
&lt;td&gt;Plain Git diff applies cleanly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command evidence&lt;/td&gt;
&lt;td&gt;Ordered commands are visible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure semantics&lt;/td&gt;
&lt;td&gt;Exit &lt;code&gt;17&lt;/code&gt; remains a failure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State portability&lt;/td&gt;
&lt;td&gt;No proprietary state required to continue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cleanup&lt;/td&gt;
&lt;td&gt;No orphan process remains&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;A fast runtime is useful. A clever model is useful. But a small builder needs the ability to stop, inspect, and move work elsewhere. That is the difference between adopting a tool and adopting a dependency you cannot unwind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;I have not executed this fixture against &lt;code&gt;jcode&lt;/code&gt;, so this is an evaluation protocol rather than a product verdict. The repository description calls it an agent harness for code; check its current README and release state before relying on any specific feature.&lt;/p&gt;

&lt;p&gt;If your test fails, keep the fixture. It becomes a reusable acceptance test for the next harness instead of a one-off opinion.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>Kimi K3 API Costs 3.5x More Than K2.6-Run This 30-Minute Break-Even Test</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Tue, 21 Jul 2026 12:12:16 +0000</pubDate>
      <link>https://dev.to/rivera123/kimi-k3-api-costs-35x-more-than-k26-run-this-30-minute-break-even-test-39md</link>
      <guid>https://dev.to/rivera123/kimi-k3-api-costs-35x-more-than-k26-run-this-30-minute-break-even-test-39md</guid>
      <description>&lt;p&gt;Kimi K3 hit number one on the Arena coding leaderboard. Then its API output price jumped to 100 CNY per million tokens-3.5 times the previous generation's 27 CNY.&lt;/p&gt;

&lt;p&gt;As a solo builder, I do not have a benchmark suite. I have one real task and a budget. Here is the 30-minute test I plan to run before deciding whether K3 replaces K2.6 in my workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  The task
&lt;/h2&gt;

&lt;p&gt;Pick one coding task you actually need to do this week. Not a toy benchmark-a real pull request, bug fix, or feature implementation that you can verify as correct or incorrect within five minutes.&lt;/p&gt;

&lt;p&gt;Write it down as a prompt that works for both K2.6 and K3. Same prompt, same context, same temperature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three measurements
&lt;/h2&gt;

&lt;p&gt;Run the same prompt against both models. For each run, record:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;K2.6&lt;/th&gt;
&lt;th&gt;K3&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input tokens&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output tokens&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API cost (CNY)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wall-clock time (seconds)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First-pass correctness (yes/no)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edits needed before merge&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If K3 gets it right on the first pass and K2.6 does not, the price difference may be worth it. If both get it right, you are paying 3.5x for the same outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  The break-even question
&lt;/h2&gt;

&lt;p&gt;K3 costs 3.5x more per token. But if it produces 3.5x fewer tokens to reach a correct answer-because it understands the problem better, needs fewer retries, or generates cleaner code-then the total cost per completed task may be the same or lower.&lt;/p&gt;

&lt;p&gt;The only way to know is to measure total task cost, not per-token cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  A second task as a control
&lt;/h2&gt;

&lt;p&gt;Run the same test with a second, different task. If the results are consistent across both tasks, the signal is stronger. If they diverge, you have a model-task interaction worth investigating.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this test cannot tell you
&lt;/h2&gt;

&lt;p&gt;Two tasks are not a benchmark. They cannot predict K3's performance across your entire workload, on tasks you have not tried, or on codebases with different characteristics. They can only tell you whether the price increase is justified for the specific work you measured, on the day you measured it.&lt;/p&gt;

&lt;h2&gt;
  
  
  My plan
&lt;/h2&gt;

&lt;p&gt;I have not run this test yet. K3 subscriptions are currently paused due to compute overload, so I am waiting for access. When it reopens, I will run this protocol on two real tasks from my current backlog and record the results.&lt;/p&gt;

&lt;p&gt;If the total cost per correct task is lower with K3 despite the higher per-token price, I switch. If not, I stay on K2.6 for routine work and use K3 only for tasks where K2.6 fails.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm a MonkeyCode user sharing my own experience, not affiliated with the project. MonkeyCode is an open-source AI coding platform: &lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;https://github.com/chaitin/MonkeyCode&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>product</category>
      <category>devtools</category>
      <category>cost</category>
    </item>
    <item>
      <title>Build a Five-File Canary Before You Trust an Agentic Coding Product</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Tue, 21 Jul 2026 04:19:58 +0000</pubDate>
      <link>https://dev.to/rivera123/build-a-five-file-canary-before-you-trust-an-agentic-coding-product-1apm</link>
      <guid>https://dev.to/rivera123/build-a-five-file-canary-before-you-trust-an-agentic-coding-product-1apm</guid>
      <description>&lt;p&gt;I do not need another agent leaderboard. I need a tiny repository I can run through every product before trusting it with a real codebase.&lt;/p&gt;

&lt;p&gt;My canary has five files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AGENTS.md             one explicit constraint
src/price.js          a small bug
test/price.test.js    one failing test
ADR.md                a stale design decision
tools/check.sh        a permitted verification command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The task is deliberately specific: fix rounding without changing the public API, update the stale ADR only if behavior changes, run the checker, and stop before committing.&lt;/p&gt;

&lt;p&gt;Score observable evidence, not how confident the chat sounds:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Planning&lt;/td&gt;
&lt;td&gt;names the constraint and affected files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool use&lt;/td&gt;
&lt;td&gt;executes only the documented checker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Correction&lt;/td&gt;
&lt;td&gt;uses the failed assertion to revise code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;preserves the public API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Human handoff&lt;/td&gt;
&lt;td&gt;presents diff and stops before commit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Add one hostile fixture: make the first test failure misleading. The agent should inspect the implementation and constraints rather than patching the assertion until it turns green.&lt;/p&gt;

&lt;p&gt;Anthropic’s &lt;a href="https://www.anthropic.com/research/building-effective-agents" rel="noopener noreferrer"&gt;Building Effective Agents&lt;/a&gt; distinguishes workflows with predefined paths from agents that dynamically direct their own process. This canary tests the product behavior either way without depending on its marketing label.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chaitin/MonkeyCode" rel="noopener noreferrer"&gt;MonkeyCode&lt;/a&gt; is a useful candidate because it is open source and has a browser-based &lt;a href="https://monkeycode-ai.net/" rel="noopener noreferrer"&gt;SaaS platform&lt;/a&gt; currently free to start. I can run the disposable canary without treating free access as permanent or claiming a result before collecting evidence. The same repository stays portable for the next tool.&lt;/p&gt;

&lt;p&gt;I am a MonkeyCode user, not affiliated with the project. This account is managed by the same operator as the other accounts in this batch.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Ship a Restart-Safe Upload CLI That Survives an Expired Resume URL</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Mon, 20 Jul 2026 03:18:45 +0000</pubDate>
      <link>https://dev.to/rivera123/ship-a-restart-safe-upload-cli-that-survives-an-expired-resume-url-182m</link>
      <guid>https://dev.to/rivera123/ship-a-restart-safe-upload-cli-that-survives-an-expired-resume-url-182m</guid>
      <description>&lt;p&gt;My upload CLI looked restart-safe until I tested two failures together: the process crashed at 63%, and the signed resume URL expired before restart.&lt;/p&gt;

&lt;p&gt;The checkpoint needs identity, not credentials:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"file"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"release.tar.gz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fingerprint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha256:..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"uploadId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"up_123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"localOffset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;66060288&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"updatedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-07-19T12:00:00Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not persist the signed URL. On restart, exchange the durable upload ID for fresh authorization, query the server offset, then reconcile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;remote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;headUpload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;freshUrl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;remote&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;invalid remote offset&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;remote&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localOffset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;saveCheckpoint&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;checkpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;localOffset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;remote&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sendFrom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;remote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;freshUrl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server offset wins because a crash can occur after bytes are accepted but before the local checkpoint is renamed. Save checkpoints through write-to-temp plus atomic rename so a partial JSON file cannot destroy recovery.&lt;/p&gt;

&lt;p&gt;My fixture matrix includes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure&lt;/th&gt;
&lt;th&gt;Expected behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;crash after remote commit&lt;/td&gt;
&lt;td&gt;rewind/advance to remote offset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;expired URL&lt;/td&gt;
&lt;td&gt;refresh without creating a second upload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;changed local file&lt;/td&gt;
&lt;td&gt;stop on fingerprint mismatch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;missing remote upload&lt;/td&gt;
&lt;td&gt;ask before starting over&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;checkpoint write interrupted&lt;/td&gt;
&lt;td&gt;retain previous valid checkpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="https://tus.io/protocols/resumable-upload" rel="noopener noreferrer"&gt;tus resumable upload protocol&lt;/a&gt; specifies offset discovery and conflict handling that are useful even if the service uses a smaller custom protocol. The key idea is explicit reconciliation, not assuming client memory is authoritative.&lt;/p&gt;

&lt;p&gt;I also shipped &lt;code&gt;upload status&lt;/code&gt;, &lt;code&gt;upload forget&lt;/code&gt;, and an exportable checkpoint directory. Recovery is a user-facing feature; if users cannot inspect or remove state, “resumable” becomes hidden lock-in.&lt;/p&gt;

</description>
      <category>node</category>
      <category>cli</category>
      <category>webdev</category>
      <category>testing</category>
    </item>
    <item>
      <title>Test the Copilot Desktop App With a 20-Minute BYOK Exit Drill</title>
      <dc:creator>Sam Rivera</dc:creator>
      <pubDate>Sun, 19 Jul 2026 14:39:48 +0000</pubDate>
      <link>https://dev.to/rivera123/test-the-copilot-desktop-app-with-a-20-minute-byok-exit-drill-1b16</link>
      <guid>https://dev.to/rivera123/test-the-copilot-desktop-app-with-a-20-minute-byok-exit-drill-1b16</guid>
      <description>&lt;p&gt;Primary source: &lt;a href="https://github.blog/changelog/2026-07-07-github-copilot-app-available-to-all/" rel="noopener noreferrer"&gt;https://github.blog/changelog/2026-07-07-github-copilot-app-available-to-all/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;GitHub made the Copilot app available across Copilot plans and says users can also run sessions with their own model-provider key. Before moving real work into a desktop agent, run one cheap exit test.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0–5: clone a disposable repository
5–12: ask for one failing-test fix
12–17: disconnect or close the app
17–20: recover from Git alone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The artifact is a small exit pack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;base_commit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;..."&lt;/span&gt;
&lt;span class="na"&gt;patch_commit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;..."&lt;/span&gt;
&lt;span class="na"&gt;test_command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;npm&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;test"&lt;/span&gt;
&lt;span class="na"&gt;expected_failure_before&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;named&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;assertion"&lt;/span&gt;
&lt;span class="na"&gt;expected_pass_after&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;credentials_retained&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test normal completion, app restart before completion, and a rejected provider credential. Pass only if the diff, test, and rollback can be reconstructed without chat history. Revoke the test key afterward and inspect where provider settings were stored.&lt;/p&gt;

&lt;p&gt;This does not measure model quality or claim every plan has identical features. Use the current product documentation and a disposable key. Which artifact would be hardest to recover if your agent UI vanished today?&lt;/p&gt;

</description>
      <category>githubcopilot</category>
      <category>productivity</category>
      <category>testing</category>
      <category>git</category>
    </item>
  </channel>
</rss>
