Files
spencermandClaude Fable 5.1 591fe90076
ci / frontend (push) Successful in 30s
ci / server (push) Successful in 4m12s
ci / image (push) Successful in 46s
ci / e2e (push) Successful in 1m24s
Phase 3: VISUAL feed and M-Files drawings in the worker
Migration 0004 (VISUAL and drawing caches, go-live ignored list, resource
map, job tables, order-derived columns with provenance; work order key
includes the operation sequence). The real worker on APScheduler with
settings re-read each fire, pause, run now, advisory locks, job_runs and a
heartbeat. The visual-feed job (five VisualKit reads, COPY and MERGE cache,
suspect-batch guard, the apply in one transaction: drafts, change orders,
retire-moved, work order gone, closed and cancelled observed, projects and
units from order links, auto-release) and the fingerprint. The drawing-lookup
job (queue, budget, download on version change, sha256 into assets, decision
table, staging for rev approval, drawing-origin change orders). Clerical From
VISUAL panel, flags, rev approval, hand uploads, change-order review; Admin
Feed settings and resource map. Synthetic fixture generator and a
fixture-driven worker in CI with a Playwright scenario. Docs updated.

Verified: 3249 server tests and 13 Playwright scenarios on the docker-1 CI
stack, 76 frontend tests, doctor at 0004; one feed and one drawing run
against VISUAL DEV and the vault from the developer machine (counts in the
changelog).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-16 14:45:38 -06:00

3.6 KiB

Synthetic VISUAL and M-Files fixtures

Everything here is made up. Real job data never goes in git: recordings from DEV stay in tests/fixtures/local/ (ignored).

python -m tests.fixtures.generator --out tests/fixtures/generated

writes feed.1.json, feed.2.json, drawings.1.json, drawings.2.json, the one-page PDFs the drawing files name, and state (1). tests/fixtures/generated/ is ignored by git. CI runs the command before compose up and mounts the folder at /fixtures in the worker (read-only) and Playwright (read-write). With FEED_SOURCE=fixture and DRAWING_SOURCE=fixture the worker reads FIXTURE_DIR/state and the matching files instead of VISUAL and M-Files. Write 2 to state to switch.

The feed files have the shape of VisualKit's examples/packet_station_feed.py: rows carry the status as a word (Firmed, Released, Unreleased, Closed, Cancelled), materials carry the status code, numbers are JSON numbers, dates are ISO, lot, split and sub are text, seq and piece are integers. An extra labor list holds hours per operation.

Dates are offsets from the day the generator runs (--today overrides), so the window rows sit inside the default window. The output is the same for the same day.

State 1

Project L900, units L900001 and L900002, plus L901001 under project L901.

Work order Lot What it covers
L900-01 1 LAYOUT and WELD-PART on drawing L900-0101 rev 1 (two packets), MFG and MAT_PIPE fold, FORKLIFT ignored; split-item header (piece 10 with 11 and 12), MAIN warehouse line, WIP sub-assembly, a line on another drawing (dropped)
L900-01 split 1 1 Unreleased (only on a packet when tracked)
L900-02 1 two WELD-CODE operations on one drawing: two legs on one packet; VISUAL rev 2, M-Files rev 3 (rev mismatch)
L900-03 1 no drawing ((no drawing) key)
L900-04, L900-08-1 2 one packet, rev A (bad rev), piece 1 on both legs (items 1 and 1-1), a base linked to order C24-0901
L900-05 2 drawing in drafting (not released)
L900-06 2 Released, with materials: only a packet when tracked
L900-07 2 drawing not in M-Files
L900-09, L900-10 1 close and cancel in state 2
L900-11, L900-12 1 Closed and Cancelled, only when tracked
L900-13 2 released 10 days back: ignored when the tests set go-live 5 days back
L900-14 7A a lettered lot: no unit, no packet
L900-15 2 resource NEWRES, not in the map
L900-16 2 moves to drawing L900-1602 in state 2
L901-01 1 project L901, only a closed order

Orders: L900 has two open orders. C24-0901 (Acme Refining) names top job L900002 and is linked to base L900-04. C24-0902 (Bayou Chemical) names L900001, so the unit rule picks it for L900001. L901 has one closed order (Delta Gas).

State 2

  • L900-01 rev 1 to 2 (a change order on an in-shop packet; the LAYOUT draft updates in place).
  • L900-02 qty 2 to 3 (a draft updated in place).
  • L900-07 target hours only (a minor change order once past draft).
  • L900-05 gone from VISUAL (flagged after two runs).
  • L900-16 on drawing L900-1602 (the old draft retires, a new one is made).
  • L900-09 Closed, L900-10 Cancelled.
  • NEWRES still unmapped.

Drawings

drawings.1.json: L900-0101 rev 1 (attach), L900-0201 rev 3 (VISUAL calls 2), L900-0401 rev 1 (VISUAL calls A), L900-0501 in drafting, L900-0701 and L900-1601 missing (not found), the rest at rev 1. drawings.2.json: the same with L900-0101 at rev 2 (a new file, so the change order gets staged) and L900-1602.

generate(out_dir), feed_state(n) and drawings_state(n) are importable; tests/server/feedhelpers.py uses them.