Decompose: GET /v1/threads/catalog missing from backend #24
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The frontend
easystitch-client.tscallsGET /v1/threads/catalog(
getThreadCatalogat line 446) to load the Brother PR10 thread catalogfor the thread-color picker. The backend
easystitch-servicedoes notexpose that endpoint — the route is missing from
app.pyand from theauto-generated OpenAPI schema. The frontend has to fall back to the
hard-coded
BROTHER_PR10_COLORSconstant.Because there's no path from catalog → frontend,
paletteIndex: nullkeeps coming out of the engine (see #27) and the catalog-aware thread
matching feature is dead in the water.
Goal
Add
GET /v1/threads/catalogto the easystitch-service, returning theBrother PR10 thread catalog with code/name/hex per entry, in the shape
the frontend's
ThreadCatalogEntryinterface already expects:Response shape:
Data source:
/data/brother_pr10.json(already referenced viaTHREAD_PALETTE_PATHin.env.example).Non-goals
issue #27 which handles the frontend's null
paletteIndextolerancefor now).
POST /v1/threads/resolveimprovements (separate concern; backendcurrently returns
{"error": "not_implemented"}and that stub istracked by #25).
Pipeline stages
P1: Wire catalog loader + route
Goal: Stand up the route that loads the catalog JSON file and returns
it under the
catalogkey.Approach candidates:
lru_cacheorfunctools.lru_cachekeyed on filemtime so the JSON is only re-read if it changes on disk.
app.state(FastAPI app.state).json.load(no caching).Recommend A — avoids stale-data risk of B, avoids the per-request
disk-hit cost of C.
Outputs: new route handler in
easystitch-service/app.py; thecatalog JSON is loaded from the path resolved by
settings.thread_palette_path.Acceptance:
GET http://localhost:8080/v1/threads/catalogreturns HTTP 200{"catalog": [{code, name, hex}, ...]}with atleast 50 entries (full BROTHER PR10 palette has 100 threads)
envelope, not a Python traceback
Files touched:
/home/b/Projects/easystitch-service/app.py(add the route)/home/b/Projects/easystitch-service/config.py(confirmthread_palette_pathsetting is exposed)P2: Add tests
Goal: Lock down P1 with backend tests so a future change can't
silently break the catalog format.
Approach candidates:
mock catalog file.
data/brother_pr10.json.Recommend A. The catalog file in
data/is committed to the repoand reading it from disk via the real path adds noise to the test
suite (and CI may not have the file at the expected path).
Outputs: new test file
/home/b/Projects/easystitch-service/tests/unit/test_threads_catalog.pycovering: happy path returns the catalog shape, missing file is
handled, malformed JSON is handled.
Acceptance:
python -m pytest tests/unit/test_threads_catalog.py -vexits 0Files touched:
/home/b/Projects/easystitch-service/tests/unit/test_threads_catalog.py(new)Dependencies
downstream feature that wants to map emitted thread hex codes to
Brother PR10 catalog entries.
(
/home/b/Projects/easystitch-service/data/brother_pr10.json) mustexist with all 100 entries. Verify this exists before kicking
off; if it's a stub with only a few entries, this phase is blocked
on completing the catalog content first.
Research required
data/brother_pr10.jsonshape and confirm it matches theThreadCatalogEntryinterface. If not, P1 needs a transform layer.Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.GET /v1/threads/catalog missing from backend — frontend ThreadPalette query is permanently 404to Decompose: GET /v1/threads/catalog missing from backendThis issue has been decomposed into the following sub-issues:
Each sub-issue has been labeled with
triage-approvedand is ready for queue routing.Mark referenced this issue2026-07-13 01:54:50 +00:00
Mark referenced this issue2026-07-13 01:54:54 +00:00
autoThreadMatchknob defined but never consumed #68computeThreadStopsaggregates bypaletteIndex;paletteIndex: nullfrom the engine collapses to one fake stop at index 0 #77autoThreadMatchknob defined but never consumed #68