AI Anonymous / Practical field guide / November 11, 2026

Who flipped the switch?

A report setting says to skip the draft. A one-line jq fallback turns that explicit false into true. Follow the value through the handoff before you rewrite the prompt.

In this field note · 6 sections
  1. Reproduce the switch
  2. Check whether the key exists
  3. Make it your own
  4. Apply the policy at the handoff
  5. Read the jq references
  6. Run the lab or share the field note

Imagine an AI assistant that prepares a report preview. A small JSON object controls whether the preview includes a draft. In this fictional workflow, an omitted setting means use the preview’s default of true. An explicit false means leave the draft out. The difference disappears if the handoff uses .include_draft // true.

What we ran. Two jq filters against five authored records using jq 1.8.2 on Windows. The practice kit compares both complete outputs with their expected records.
AI Anonymous poster reading “Who flipped the switch?” A brass toggle points toward OFF while its amber pilot lamp glows. Scratched black enamel, cloth-wrapped wires, and ceramic terminals sit on a worn wooden board. The footer reads JABSYSTEMS.IO.
Original AI-generated illustration of an off switch with its pilot lamp still glowing.

01 / Reproduce

Reproduce the switch

Install jq from the release linked below and confirm jq --version runs. Extract the practice ZIP, open PowerShell in that folder, and run the first filter. The ZIP uses filter files so the shell can pass the jq expressions through without inline quoting.

jq -f fallback.jq cases.json

The filter in fallback.jq applies one expression to each object.

map({id, include_draft: (.include_draft // true)})

For a single field value, jq’s // uses the right side when the left side yields false or null. An omitted field reads as null here. The unguarded filter prints true for the explicit off, omitted, and explicit null cases. It also passes the string "false" through as a string.

02 / Inspect

Check whether the key exists

Use has("include_draft") to detect omission. When the key is present, use type to accept JSON Booleans. Mark other present values invalid so the caller has a state it can handle explicitly.

map(
  if has("include_draft") | not then
    {id, state: "defaulted", include_draft: true}
  elif (.include_draft | type) == "boolean" then
    {id, state: "explicit", include_draft}
  else
    {id, state: "invalid", include_draft: null}
  end
)

Run the guarded filter and then check both full outputs. The final command prints true and exits successfully when both match the expected records. The ASCII encoding here is for these ASCII-only fixtures.

jq -f fallback.jq cases.json | Set-Content -Encoding ascii fallback-result.json
jq -f preserve.jq cases.json | Set-Content -Encoding ascii preserved-result.json
jq -ne --slurpfile fallback fallback-result.json --slurpfile preserved preserved-result.json -f check.jq

The guarded result preserves explicit false and true. It supplies the default for the omitted key and marks both null and "false" invalid. An invalid row carries include_draft: null to indicate that it has no Boolean decision.

03 / Make it your own

Write down what omission means

  1. Copy cases.json to my-cases.json. Add {"id": "number-zero", "include_draft": 0} to the array.
  2. Run both filters. The fallback should keep the number 0. The guarded filter should mark it invalid.
  3. Pick an optional Boolean from a preview or report workflow you maintain. Write down the expected behavior for omission, explicit false, explicit true, and invalid values. Update the practice filter and its expected records together.
jq -f fallback.jq my-cases.json
jq -f preserve.jq my-cases.json

Boundaries

Apply the policy at the handoff

The lab expects an array of objects with IDs and checks one field. In a real preview pipeline, validate the surrounding structure and decide how the caller handles an invalid state before using the result. Choose the default based on what the preview can expose. The sample exercises a local jq transformation. Model behavior, report rendering, downstream actions, and performance remain untested.

Primary sources / Checked November 11, 2026

Read the jq references

Downloads / Practice and social files

Run the lab or share the field note

Explore more AI Anonymous field notes →

Share this post.

Found this useful? Pass it along. Download the artwork, add your own take, and tag @jabsystems.io so I can see your post.