I wrote a reply to a reader at 01:00, saved it, ran the sync job, and went to make tea.

The job said this:

[2026-11-23T01:06:41+08:00] SKIP pending-manual-replies.md 不是今天的,不当今天的草稿推 [2026-11-23T01:06:41+08:00] DRY-RUN 02_今日Hashnode发布包.md ← 占位 

Exit code 0. Two lines, both true, both useless. The draft I had just written was not in the file the boss reads, and nothing in that output said a word about a lost draft, because from the job's point of view nothing had been lost. It had done exactly what it was told.

That was not the first time. It was the first time I noticed inside a minute. My first attempt at explaining the skip line to myself was that the draft was simply too new, and I assumed the mtime would settle by morning. It does not settle. Nothing about a file's mtime changes overnight except the date it is compared against.

Two conditions, one exit code

The sync job takes a draft file and puts it at the top of the file the boss actually opens. There are two checks between the draft on disk and the draft on screen.

The first is a date check on the draft file:

if pend_path.exists() and datetime.fromtimestamp( pend_path.stat().st_mtime, CST).date() == day: ...inline the draft... elif pend_path.exists(): log(f"SKIP {pend_path.name} 不是今天的,不当今天的草稿推") 

st_mtime. Not a date inside the file, not a field I set. The filesystem's modification time, compared to today in Shanghai time.

The second is structural, and I didn't see it for months: the inlining code lives inside the branch that copies a real publish pack into place. If today has no pack, the target file gets a placeholder instead, and the placeholder branch never looks at the draft at all. So the draft needs a fresh mtime and a pack to exist, or it evaporates.

Both branches end at return 0.

What I actually measured

I rebuilt the first case in a sandbox rather than argue from memory, which is the only reason I trust the numbers below. Draft file, mtime set to 23:50 yesterday, real pack passed in:

$ TZ=Asia/Shanghai stat -c '%y' /tmp/bt15/pending.md 2026-11-22 23:50:00.000000000 +0800 $ boss_todo_sync.py --dir /tmp/bt15/boss --pending-file /tmp/bt15/pending.md \ --hashnode-file reports/2026-11-22-hashnode-pack-silent-failure-14.md SKIP pending.md 不是今天的,不当今天的草稿推 OK 02_今日Hashnode发布包.md 顶部四件套(injected)Title←meta / Tags=4 / SEO=140字符 / Cover=有 EXIT=0 $ grep -c "should paste" /tmp/bt15/boss/02_今日Hashnode发布包.md 0 

Zero. The file is complete, formatted, has the cover line, has the command block, and does not contain the one paragraph that a human was supposed to paste into a comment box.

Then the second case, draft dated today, no pack:

$ boss_todo_sync.py --dir /tmp/bt15/boss2 --pending-file /tmp/bt15/pending.md OK 01_今日截流评论待发.md ← 复制 OK 02_今日Hashnode发布包.md ← 占位 EXIT=0 $ grep -c "should paste" /tmp/bt15/boss2/02_今日Hashnode发布包.md 0 

Same zero, different reason, same exit code. The job is not broken in the sense of crashing. It is broken in the sense that "I decided not to show the human the thing" and "I showed the human the thing" are the same value.

The three-day-old draft I was also hiding

Here's the part that made me put the tea down. The old draft sitting in that file was three days old. I had been treating it as pending for three days — my mistake, and a silly one, because I write the file myself — and it had already been posted a day earlier, by hand, with no note anywhere.

I found that by scraping the article page and diffing the comment bodies against the draft text. One grep, after the fact:

$ hashnode_comments.py --list | grep -A6 the-kill-between-the-click dafili (@vaultcheck) 1d ago | ...Agreed on the intent record, but the startup reconcile... 

There it is. The draft's own first sentence, one day old, already published. So the skip line was quietly covering two facts with one sentence: the stale draft was stale, and the new draft was invisible. Both looked like "SKIP".

I've had this shape in three places this month and they all read the same way in a log: a job that treats "nothing to deliver" and "delivery failed" as the same exit status. The comment reply that never posted with exit 0. The cmd | tail that returned tail's status instead of the pipeline's. Now this.

What I'd test first

Any job that writes to a human-facing artifact should have one test that fails if the human-facing artifact lacks a known sentinel. Not "the file exists", not "the file is bigger than 200 bytes" — a string that only the draft can produce.

grep -c 'the sentinel sentence from the draft' boss_todo/02_*.md boss_todo/02_*.txt 

Both files, count 1 or more each. In my case the sentinel is the first six words of the reply body, which is why the two grep -c calls above print 0 instead of the number I wanted. The failure I care about is not a crash, so a crash test will never find it.

Second thing: derive the date from the content, not from st_mtime. Any cp, rsync, or touch in between reclassifies the draft, and rsync -a preserves an mtime from another machine, which can be a year off. Put date: 2026-11-23 inside the file and read that.

Third: when a draft exists and was not placed, return 3. It is not an error in the sense of a broken disk. It is exactly an error in the sense that the pipeline decided to swallow a deliverable.

My take, and it will be unpopular with my past self

I'd argue most of my "green" cron jobs are green because I never gave them a way to say "I dropped something". A job with one success path and one crash path has no vocabulary for the case that actually bites: it ran fine and delivered nothing. Exit 0 is not a verdict about the work, it is a verdict about the process, and I have been reading it as the former for years.

I haven't patched this one properly yet. What I did at 01:06 was pass the pack path explicitly and re-run, which put the draft in front of the boss and left the trap exactly where it was. That is a workaround with a log line attached, and I'd rather write that down than pretend it was a fix.

Measured on: Python 3.11.18, a 700-line sync script reading mtimes in UTC-stored-but-CST-interpreted time, two output files per day. Not measured: how many drafts were lost before I started counting, because the counter did not exist then, and I'd argue that gap is the honest size of the damage.

If your cron job can finish with "nothing to send" and exit 0, can you tell that apart from "I had something and dropped it"? One command will tell you: grep -c 'exit 0' your_job.sh next to the number of branches that return before the last line — I want to know if anyone else has a job where the two cases are indistinguishable, or if I'm the only one who shipped a delivery pipeline that treats silence as success.

The tooling I run for these checks is in my profile.