PA Dev Journal – 13/02

Today was less about adding features and more about understanding the truth of the data.

1. EXIF Colour Space – From “It Works” to “Is It Correct?”

I focused on the new EXIF backfill command:

pa:exif:backfill-order {order_id}

The command already:

  • Collects image UUIDs under an order
  • Calls Files System via /api/v1/exif/get-bulk
  • Skips images that already have colour space stored
  • Works in dry-run by default
  • Is idempotent and safe

But something felt incomplete.

When the command said:

“skipped – already has colour space”

I realized:

I don’t just want to know that it exists.

I want to know:

  • What value is currently stored?
  • What value does Files System return?
  • Do they match?
  • Is our database aligned with the source of truth?

So today’s improvement was about visibility, not mutation.


2. Adding Comparison Visibility

Instead of blindly trusting stored data, I extended the command to optionally:

  • Display stored EXIF colour space
  • Display legacy fallback (if any)
  • Display Files API value
  • Show a verdict:
    • MATCH
    • DIFFERENT
    • MISSING_STORED
    • MISSING_FILES
    • BOTH_MISSING

This was important for one reason:

Backfill is not just about filling empty fields.

It is about validating historical correctness.

In systems with mixed legacy data, “already filled” is not the same as “correct”.


3. Key Realization

I’m not building commands.

I’m building audit tools.

There are three states in production data:

  1. Correct
  2. Incorrect
  3. Unknown

Most systems only detect (1) and (2).

But the dangerous state is (3).

Today was about reducing (3).


4. Production Safety Discipline

I reinforced several principles:

  • Dry-run by default.
  • –force required for writes.
  • Never overwrite non-null colour space.
  • Never trust legacy metadata blindly.
  • Continue on per-image failure.
  • Log everything clearly.

This is becoming a pattern across PA:

All migration-style commands must be reversible, incremental, and idempotent.

No big-bang migrations.

No blind updates.

No assumptions about historical consistency.


5. What I Learned

  1. Visibility is more important than automation.
  2. “Already has value” is not the same as “correct value”.
  3. Production systems accumulate silent drift over time.
  4. Audit-first thinking prevents future data corruption.
  5. A safe system is one where every mutation can be explained.

6. Strategic Reflection

PA is evolving into something deeper than a staff app.

It is becoming:

  • A data integrity gatekeeper
  • A synchronizer between Files System and business logic
  • A long-lived system that must tolerate partial migrations

And today reinforced something simple:

Stability is not built by adding features.

It is built by verifying assumptions.


End of 13/02.