DEV Community

Sungsoo Youn
Sungsoo Youn

Posted on

My EPUB Passed My Own Checks. The Store's Validator Found 17 Errors.

A field note from the autonomous Claude Code agent I run every day on one Windows PC. The numbers come from its own ledgers, not from memory.

My agent builds the ebook file for a Korean ebook distributor. For a month its verify step printed that the file was in a format the store would accept. When the store's upload check ran on a resubmission, it rejected the file with 17 errors.

What "verified" meant

The verify step checked what I had thought to check: the file is a valid zip, each XHTML page parses, the copyright page contains the right text. All true.

What it never did was run the checker the store actually uses, the W3C validator epubcheck. A month earlier only the package file had been converted to EPUB 2. The pages inside were still shaped like EPUB 3: an epub: namespace prefix, no DOCTYPE, a bare cover image. And the cover was a PNG stored under the name cover.jpg.

Our checks passed because our checks had no opinion on any of that.

The failure nobody read

The resubmission tool had a second problem. After uploading the file, it decided the upload had worked by watching a hidden form field change value. The page also showed an alert: "File upload failed". The tool didn't read alerts. It moved on and clicked the next button.

A failed upload was counted as a success, and the next step ran on top of it.

The date nobody touched

Once the file passed and the resubmission went through, the agent re-read the listing. The price and the author were right. The registered publication date was not: pressing the final "submit for sale" button had quietly reset it to the date of the very first submission, weeks earlier. The copyright page inside the book says a different date, and the store's notice asks for the two to match.

The tool had checked the fields it changed. It never re-read the field it didn't touch.

What changed

  • The verify step now runs epubcheck 5.1.0 itself. Any error is a problem, and the resubmission tool won't open the browser until the count is zero.
  • The conversion now rewrites the pages too (XHTML 1.1 with a DOCTYPE, no epub: attributes, the cover image wrapped in a block), and the cover is converted to a real JPEG, not just renamed.
  • After uploading, the tool reads the alert text. If it says the upload failed, it stops.
  • After submitting, the tool re-reads the publication date and the listed price. If the date has moved, it saves it back and reads it again. (Author and publisher are checked before the button is pressed.)

The rules

  • "Verified" means verified by the receiver's checker. Your own checks measure what you thought of. The store measures what it requires. If the receiver publishes its validator, run that one before you upload.
  • Read what the other side tells you. A changed field value is your guess about success. An alert on the page is their answer.
  • After pressing a button in someone else's system, re-read the fields you didn't touch. That system has its own rules about what a button changes.

Where this comes from. Every post here comes from one setup I run daily: a CLAUDE.md, memory files the agent reads before it touches anything, and a separate auditor agent that returns PASS or FAIL. The first 3 chapters of the book that walks through it are free as a PDF: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code-free-sample

The full edition is 11 chapters plus 4 ready-to-use templates (CLAUDE.md starter, memory files, auditor checklist, measurement guide) and a hands-on section for every chapter, $19 as a PDF: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code

Questions about the setup are welcome in the comments — I'll answer with what actually happened, not theory.

Top comments (0)