drawings: on a rev mismatch, Clerical can keep the retired rev VISUAL calls (#41) #46

Merged
spencerm merged 2 commits from issue-41-retired-rev into main 2026-10-19 21:05:14 +00:00
Owner

Closes #41.

Why

Packet 168 (L073-61-2, unit L073058) had its full BOM but stayed in draft, so it never reached the warehouse board. VISUAL calls rev 9. In M-Files, r9 is Retired / Superseded and r10 is the only Effective rev. The rev_mismatch flag held the draft. The only way out was approving r10, or uploading a drawing by hand.

What changes

The packet is still flagged. A Clerical Supervisor can now choose either rev on the packet, and open both PDFs first:

  • Use latest rev N: M-Files' Effective rev, as before.
  • Use rev V as VISUAL calls it: the retired rev, via rev-approve with use: "called". It needs a reason and a signature, the signed content carries use, and the log says "Rev VISUAL calls kept by hand".

The kept rev holds while M-Files' Effective rev stays the one Clerical chose against. That means no flag and no change order, also after release. A newer Effective rev flags the packet again, and a new VISUAL rev clears the choice.

How

  • MFilesKit 0.1.3 (published to the Gitea index): DrawingLookup.revision(dwg, rev) finds one rev's PDF whatever its Controlled Status. status() is unchanged.
  • Drawing job: on a draft flagged rev_mismatch, it looks up the rev VISUAL calls. When M-Files still holds that rev, the job copies it into assets, records it in drawing_revisions, and keeps it on the packet as visual.called. The log note says "rev V is Retired in M-Files" or "rev V is not in M-Files".
  • Decision table: a new row. A kept rev stays unchanged while the Effective rev is the same one. rev_confirmed counts it, so auto-release works.
  • Migration 0009: adds drawing_revisions.
  • Packet page: both choices with View links, and a callout once the retired rev is kept.
  • Docs: FEED.md, POLICY.md, SCHEMA.md and CHANGELOG are updated.

Tests

  • Server: 5962 passed against PostgreSQL 16 (6 skipped: these need the test domain controller). New tests cover the decision rows, the fixture lookup, the job copying the retired rev, and the API.
  • Frontend: 303 passed, with tsc and eslint clean. A new test covers both buttons and the use=called call.
  • MFilesKit: 84 passed.
  • Not tested against the live vault yet. Once deployed to the test stack, packet 168 should show both choices after its next drawing recheck (within 4 hours).

Deploy notes

The pin is mfileskit==0.1.3. Migration 0009 runs with packetstation migrate.

🤖 Generated with Claude Code

Closes #41. ## Why Packet 168 (L073-61-2, unit L073058) had its full BOM but stayed in draft, so it never reached the warehouse board. VISUAL calls rev 9. In M-Files, r9 is Retired / Superseded and r10 is the only Effective rev. The `rev_mismatch` flag held the draft. The only way out was approving r10, or uploading a drawing by hand. ## What changes The packet is still flagged. A Clerical Supervisor can now choose either rev on the packet, and open both PDFs first: - **Use latest rev N:** M-Files' Effective rev, as before. - **Use rev V as VISUAL calls it:** the retired rev, via `rev-approve` with `use: "called"`. It needs a reason and a signature, the signed content carries `use`, and the log says "Rev VISUAL calls kept by hand". The kept rev holds while M-Files' Effective rev stays the one Clerical chose against. That means no flag and no change order, also after release. A newer Effective rev flags the packet again, and a new VISUAL rev clears the choice. ## How - **MFilesKit 0.1.3** (published to the Gitea index): `DrawingLookup.revision(dwg, rev)` finds one rev's PDF whatever its Controlled Status. `status()` is unchanged. - **Drawing job:** on a draft flagged `rev_mismatch`, it looks up the rev VISUAL calls. When M-Files still holds that rev, the job copies it into assets, records it in `drawing_revisions`, and keeps it on the packet as `visual.called`. The log note says "rev V is Retired in M-Files" or "rev V is not in M-Files". - **Decision table:** a new row. A kept rev stays unchanged while the Effective rev is the same one. `rev_confirmed` counts it, so auto-release works. - **Migration 0009:** adds `drawing_revisions`. - **Packet page:** both choices with View links, and a callout once the retired rev is kept. - **Docs:** FEED.md, POLICY.md, SCHEMA.md and CHANGELOG are updated. ## Tests - Server: 5962 passed against PostgreSQL 16 (6 skipped: these need the test domain controller). New tests cover the decision rows, the fixture lookup, the job copying the retired rev, and the API. - Frontend: 303 passed, with tsc and eslint clean. A new test covers both buttons and the `use=called` call. - MFilesKit: 84 passed. - Not tested against the live vault yet. Once deployed to the test stack, packet 168 should show both choices after its next drawing recheck (within 4 hours). ## Deploy notes The pin is `mfileskit==0.1.3`. Migration 0009 runs with `packetstation migrate`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
spencerm added 1 commit 2026-10-19 19:48:54 +00:00
drawings: on a rev mismatch, Clerical can keep the retired rev VISUAL calls (#41)
ci / server (pull_request) Failing after 17s
ci / frontend (pull_request) Successful in 42s
ci / image (pull_request) Skipped
ci / e2e (pull_request) Skipped
bb8eb17748
When VISUAL calls a rev that M-Files has retired, the draft is still
flagged rev_mismatch, but the drawing job now also copies the rev VISUAL
calls (MFilesKit 0.1.3 DrawingLookup.revision) into drawing_revisions and
visual.called. A Clerical Supervisor picks either rev on the packet:
"Use latest rev N" as before, or "Use rev V as VISUAL calls it"
(rev-approve with use=called), with a reason and a signature.

The kept rev holds while M-Files' Effective rev stays the one chosen
against: no flag, no change order. A newer Effective rev flags the
packet again; a new VISUAL rev clears the choice.

Migration 0009 adds drawing_revisions. Needs mfileskit 0.1.3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
spencerm added 1 commit 2026-10-19 19:54:25 +00:00
deps: pin mfileskit 0.1.3 in requirements-pesco.txt too
ci / frontend (pull_request) Successful in 42s
ci / server (pull_request) Successful in 11m31s
ci / image (pull_request) Skipped
ci / e2e (pull_request) Successful in 4m8s
f2f66db6ed
CI and the image install from server/requirements-pesco.txt, which still
pinned 0.1.2 while pyproject asked for 0.1.3, so pip check failed. Its
runtime dependencies are unchanged from 0.1.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
spencerm merged commit c5bf48ac50 into main 2026-10-19 21:05:14 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: spencerm/PacketStation#46