iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Build a small Python journal that records a prompt request and blocks a repeat when none of its compared fields changed. It does not call a model or decide whether two prompts mean the same thing: it compares parsed request data after stable JSON serialization, then reports which top-level fields differ.
What an empty diff means
An empty diff means the new request has the same compared top-level field values as the request currently in the journal. In the tutorial’s example, the first request is sent because there is no previous receipt; an identical request on the next run is blocked; adding a tie-break sentence to the instruction field sends the request and reports only instruction as changed. Those are the tutorial’s expected outcomes, not independently reproduced test results. Alex Chen’s tutorial on DEV Community was published September 24, 2026.
The practical question is: “If the canonical request did not change, what new evidence do I think a model is going to hand me?” The journal helps catch accidental retries. It does not prove that prompts are semantically identical, that a model would respond deterministically, or that a changed request is a scientifically meaningful new trial.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What you need
- Python 3.9 or newer, the minimum version stated by the tutorial author.
- No third-party packages: the sample uses Python’s built-in
json,hashlib,sys, andpathlibmodules. - A JSON request object and a local journal file where the last request and its digest can be stored.
The journal is a receipt mechanism only. As Chen puts it, “The journal never calls a model.”
#1 Best Overall
- Guided Daily Journal: 365 thoughtful prompts designed for self-love, reflection, and growth. Get to know yourself on a deeper level and make a meaningful addition to your daily routine
- Pre-Dated Pages: Start your new journaling routine on any day and/or year and develop a consistent journal practice. This guided journal will help you with personal growth, mindfulness, self discovery, and healing
- 10 Journaling Themes: Including self-awareness, understanding your past, love, relationships, self-care, happiness, passion, personal growth, and goals. Reach the end of each page feeling uncluttered and more aligned with yourself
- A Thoughtful Self-Care Gift: Treat yourself and your loved ones with this wellness gift idea. Learn more about each other and grow closer in your relationship
- Hardcover Journal: Features textured, vegan leather with gold detailing and a ribbon bookmark. The Better Every Day Journal is your companion for journaling
How canonical request comparison works
Parse the request before comparing it
The script parses JSON and requires the top-level value to be a Python dictionary. JSON itself also permits arrays and scalar values, so the explicit dictionary check defines what this particular utility accepts. Malformed JSON and non-dictionary top-level values are rejected before the journal is touched.
Serialize consistently, then hash
The tutorial’s canonicalize function serializes the request with json.dumps(request, sort_keys=True, ensure_ascii=False, separators=(",", ":")). Sorted keys make object key order stable; compact separators remove formatting whitespace. The Python 3.14.8 documentation describes these JSON encoder options in its json module documentation.
Rank #2
- Guided Daily Journal: 180 thoughtful prompts for intention, healing, and growth. Get to know yourself on a deeper level with a meaningful addition to your daily routine.
- Undated Pages: Start your journal on any day and go at your own pace. This self care journal for women and men will help you with personal growth and wellness.
- 6 Journaling Themes: Including intention, healing, gratitude, presence, purpose, and growth. Easily prioritize self-care daily. Reach the end of each chapter with more clarity
- A Thoughtful Self-Care Gift: Treat yourself and your loved ones with this wellness gift idea. Learn more about each other and grow closer in your relationship.
- Hardcover Journal: Features textured, vegan leather with gold detailing and a ribbon bookmark. The Dig Deeper Journal is your companion for journaling.
The resulting string is encoded as UTF-8 and passed to hashlib.sha256 to produce the digest. Python documents SHA-256 in its hashlib module documentation. The journal stores both the request and digest, allowing it to compare field values and retain a receipt of the previous request.
Why raw text is the wrong comparison
Two JSON documents can represent the same request while differing in object-key order or insignificant formatting whitespace. Once both are parsed and serialized with sorted keys and compact separators, those textual differences do not masquerade as request changes. This is structural normalization, not a license to normalize away model-facing content: compare the actual request, not a separate note or an approximation of what was sent.
Rank #3
- Boost your happiness with gratitude: Scientific studies have shown that practicing gratitude can lead to greater optimism and positivity. This gratitude journal was created using proven positive psychological research which provides a very powerful and effective way to help you practice gratitude. The daily journal allows users to feel a higher level of positive emotions, more happiness, optimism, improved confidence, less anxiety, and loneliness.
- Become happier in a few minutes a day: The daily gratitude journal will help you stay positive and happy for the life you're living by just writing a few minutes a day! Shift your mindset to see the good in each day, be thankful for what you have, and have a more positive outlook on your life.
- Scientific layout: The undated gratitude journal has six months of pages for daily journaling, and it is clearly divided into a morning and an evening section. The morning prompts are inspirational quotes, gratitude, and daily positive affirmation. The evening prompts are: Good things happened today and end-of-day self-reflection.
- Luxurious hardcover & strong bindings: Thoughtfully designed, this gratitude journal comes with strong bindings, thick pages, a black ribbon bookmark, and a back pocket to store bills, tickets, etc. The hardcover is made of natural linen fabric, it feels luxurious to write!
- Best gift idea: This GOSSIP FOX gratitude journal is a perfect gift for anyone who struggles with taking a moment to plan, evaluate & be grateful. It's also a great tool if you're a writer or communicator and need to be writing every day. Buy this daily planner today and build a better mindset!
What happens on each run
- No previous journal entry: the sample returns
action: sendbecause there is nothing to compare against. - No changed top-level values: it returns
action: block,reason: empty diff, and an empty changed-key list, then exits with code2. - At least one changed value: it records the new request and digest, saves the prior digest as
changed_from, and returnsaction: sendwith changed top-level keys.
The sample finds changed keys by comparing old and new values over the union of their top-level keys. That means adding or removing a field counts as a change. A nested object is compared as a whole value; the report does not identify nested paths.
Walk through the three useful fixtures
First contact
Run a request when the journal does not yet exist. With no prior receipt, the expected result is a send.
Rank #4
- PERSONAL GROWTH: All positive changes begin in the mind - and with the Realizations Self-Mastery Journal for Men & Women, you can live life to the fullest potential, Use this journals for men one page at a time.
- INSPIRATIONAL: Enhance your confidence and happiness with this 13-week guided gratitude journal - improve productivity, create a vision and thrive in the moment. This daily planner is undated and is a journal with prompts so you can easily accomplish your goals.
- GOAL SETTING: This productivity journal set includes a 13-week guided productivity and mindfulness journal, which offers direction to set positive goals, be more present, and become the best version of yourself you can be. Become more disciplined, find purpose and become your best self
- PREMIUM QUALITY: Made to help you create the life you envision, these gratitude journal for men and women feature a linen hardcover to last through your self-growth. Designed with a simple layout to be easily incorporated into your life.
- PERSONAL PROGRESS: This affirmation journal is easy to use to keep you focused and motivated.
Accidental repeat
Run the same parsed request again. The expected result is an empty diff and a block, because no top-level value changed.
Instruction edit
Add a tie-break sentence to instruction and run again. The expected result is a send, with instruction as the changed field. These are the tutorial’s fixture outcomes rather than claims of an independent test run.
Best Value
- COMPLETE SELF-CARE SYSTEM: Discover your path to well-being with 91 days of thoughtfully curated prompts and bonus video content. Our guided self care journal for women combines structured exercises, daily reflection practices, and mindfulness activities for personal growth and emotional balance
- RESEARCH-INSPIRED APPROACH: The Self Love Journal transforms your daily routine with evidence-based and mindful prompts. Each page features carefully designed to promote emotional growth, stress management, and positive self-reflection - perfect for building lasting self-care habits
- SUPPORTIVE COMMUNITY: Your self-love journey includes access to our private community of like-minded women focused on personal growth. Share your experiences, find daily motivation, and receive encouraging feedback while working through your self-love journal prompts and exercises.
- WEEKLY STRUCTURED JOURNEY: Progress through 13 weeks of intentional growth with our guided writing notebook. Each week introduces new themes combining gratitude practice, self-reflection exercises, and mindfulness prompts - all thoughtfully organized to build your confidence and inner strength.
- COMPREHENSIVE PERSONAL GROWTH SYSTEM: This is more than just a writing journal. You get a complete self-improvement toolkit with our guided journal prompts, instructional videos, and supportive community. Features premium paper quality and beautiful design for a satisfying journaling experience.
Reordering keys in otherwise identical JSON should still block after parsing: the object values remain the same, and canonical serialization produces a stable representation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Where the guard stops
- It does not judge meaning. A paraphrased instruction is a difference even if a person considers the wording equivalent. Conversely, a changed field does not establish a better experiment.
- It does not grade model behavior. The digest says nothing about response quality, reproducibility, or whether the output is evidence for a hypothesis.
- It reports shallow changes. Changed-key reporting is at the top level; nested objects are treated as whole values.
- It only helps if the compared object is the request actually sent. Hashing notes instead of model-facing request content can produce a misleading receipt.
- It is not a broader evaluation harness. The tutorial’s scope is unchanged-request detection, not semantic equivalence, streaming timers, tool-call schemas, or gold-span grading.
Before sending a changed request, ask: “Have you graded a comment and called it a code change?” A syntactic difference can be real while remaining irrelevant to the question an experiment is meant to answer.
Implementation choices this pattern makes
- Parsed and sorted JSON instead of raw-input hashing: ignores object-key order and formatting whitespace while preserving request values.
- Changed-field reporting instead of a single changed/unchanged flag: points to the top-level values that differ, without claiming to explain their significance.
- Blocking unchanged retries instead of allowing every retry: makes accidental resends harder, while leaving intentional retry policy to the caller.
The journal is useful when a repeated request would be an accidental duplicate. It should not prevent a deliberate retry when the surrounding workflow gives that retry a reason; the caller must decide whether to override or otherwise handle a block.
Recommended Free Tools
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

