Finish in-progress pipeline_runner.py digitize implementation (work-tree has uncommitted 229-line diff) #94

Closed
opened 2026-06-27 13:33:04 +00:00 by Mark · 0 comments
Owner

Status: Uncommitted work in /home/b/Projects/easystitch-service working tree. git diff pipeline_runner.py shows +229/-9 lines sitting dirty since at least 2026-06-27 04:11. Not on any branch tip, not pushed.

What was started:

  • New error classes: ImageDecodeError, ImageTooLargeError (carries actual_bytes/max_bytes).
  • _ensure_easystitch_importable() - lazy import check for src.main_pipeline with a clear ImportError pointing at the editable install.
  • _decode_image_b64(image_b64, max_bytes) - strict base64 decode (validate=True) with size cap.
  • New model imports from models: DigitizeStats, Point, Region as ServiceRegion, StitchObject as ServiceStitchObject.
  • logger = logging.getLogger(__name__) module-level logger.

What is missing:

  • No tests added (tests/unit/test_pipeline_runner.py last modified 2026-06-23, predates this work).
  • app.py still serves /v1/digitize as a stub (digitize_stub) at line 112 - the new pipeline is not wired in.
  • No commit, no docs update, no config for the size cap (max_bytes source TBD).

Why file instead of just committing:

  1. The work appears to overlap with Mark/Kimi_Agent_Brother_10_Digitizing_App#16 (Spec image upload + pipeline trigger flow). The pipeline_runner changes need to be read alongside #16's spec before being committed, otherwise we may encode the wrong contract.
  2. kilo-gsd's run_push will scoop this up as Apply changes from kilo-gsd.py run for ... #NN on the next easystitch dispatch, with a misleading commit message tying unrelated cleanup to whatever issue happens to dispatch next. That's exactly the failure mode this issue is meant to prevent.
  3. No tests = no verification. Whatever intent the author had for _decode_image_b64 (size cap, validate=True, error types) is currently unenforced and will rot.

Suggested scope (proposed, not decided - confirm before dispatch):

  1. Read the diff, decide whether to keep _decode_image_b64 + the typed errors as-is or simplify.
  2. Add tests/unit/test_pipeline_runner.py cases for: valid b64 round-trip, invalid b64 -> ImageDecodeError, oversize payload -> ImageTooLargeError, missing easystitch -> clear ImportError.
  3. Wire pipeline_runner.PipelineRunner into app.py digitize_stub (or replace the stub) once #16 lands its endpoint contract.
  4. Source for max_bytes - likely a new settings.max_image_bytes in config.py.
  5. Commit + push on a topic branch (e.g. feat/pipeline-runner-digitize), not directly on main.

Repro:

cd /home/b/Projects/easystitch-service
git status        # M pipeline_runner.py
git diff --stat   # pipeline_runner.py | 238 ++++++++++++++++++++--
**Status:** Uncommitted work in `/home/b/Projects/easystitch-service` working tree. `git diff pipeline_runner.py` shows +229/-9 lines sitting dirty since at least 2026-06-27 04:11. Not on any branch tip, not pushed. **What was started:** - New error classes: `ImageDecodeError`, `ImageTooLargeError` (carries `actual_bytes`/`max_bytes`). - `_ensure_easystitch_importable()` - lazy import check for `src.main_pipeline` with a clear `ImportError` pointing at the editable install. - `_decode_image_b64(image_b64, max_bytes)` - strict base64 decode (`validate=True`) with size cap. - New model imports from `models`: `DigitizeStats`, `Point`, `Region as ServiceRegion`, `StitchObject as ServiceStitchObject`. - `logger = logging.getLogger(__name__)` module-level logger. **What is missing:** - No tests added (`tests/unit/test_pipeline_runner.py` last modified 2026-06-23, predates this work). - `app.py` still serves `/v1/digitize` as a stub (`digitize_stub`) at line 112 - the new pipeline is not wired in. - No commit, no docs update, no config for the size cap (`max_bytes` source TBD). **Why file instead of just committing:** 1. The work appears to overlap with **Mark/Kimi_Agent_Brother_10_Digitizing_App#16** (Spec image upload + pipeline trigger flow). The pipeline_runner changes need to be read alongside #16's spec before being committed, otherwise we may encode the wrong contract. 2. kilo-gsd's `run_push` will scoop this up as `Apply changes from kilo-gsd.py run for ... #NN` on the next easystitch dispatch, with a misleading commit message tying unrelated cleanup to whatever issue happens to dispatch next. That's exactly the failure mode this issue is meant to prevent. 3. No tests = no verification. Whatever intent the author had for `_decode_image_b64` (size cap, `validate=True`, error types) is currently unenforced and will rot. **Suggested scope (proposed, not decided - confirm before dispatch):** 1. Read the diff, decide whether to keep `_decode_image_b64` + the typed errors as-is or simplify. 2. Add `tests/unit/test_pipeline_runner.py` cases for: valid b64 round-trip, invalid b64 -> `ImageDecodeError`, oversize payload -> `ImageTooLargeError`, missing easystitch -> clear `ImportError`. 3. Wire `pipeline_runner.PipelineRunner` into `app.py` `digitize_stub` (or replace the stub) once #16 lands its endpoint contract. 4. Source for `max_bytes` - likely a new `settings.max_image_bytes` in `config.py`. 5. Commit + push on a topic branch (e.g. `feat/pipeline-runner-digitize`), not directly on main. **Repro:** ``` cd /home/b/Projects/easystitch-service git status # M pipeline_runner.py git diff --stat # pipeline_runner.py | 238 ++++++++++++++++++++-- ```
Mark closed this issue 2026-06-27 13:33:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#94
No description provided.