Phase 2: core domain, policy engine, packet API, Clerical screen

Migration 0003: projects, aliases, renumbers, units, packets and every child table,
change orders, assets, documents, ITPs, station limits, department weld flag.
Policy package: Principal, PacketState, Action rules, custody, preconditions,
CO hold, order of checks, can/blocked/holder on reads. docs/POLICY.md with the
tightenings table for Seth. Write pipeline: FOR UPDATE, CAS on status and dept,
If-Match row versions, server-assigned numbers, field CAS, version bump, packet
log, audit, NOTIFY, signatures, IT reasons, filed lock and HMAC seal.
API: /api/packets (header, transitions, work orders, pages, docs, move, remove,
BOM, shorts, welds, heat tags, heat table, stage, checklist, clock, warehouse
stage, Q.C., change orders, log, seal), /api/projects, /api/units, /api/assets,
/_blob. Frontend: Clerical home, projects and units, packet page with pdf.js
and QR codes, hand draft, heat map, send to warehouse, department or Q.C.
Tests: policy matrix, API, concurrency, schema, projects; Playwright Clerical
draft scenario. Verified on docker-1 with the CI stack and the Samba DC.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
2026-10-16 09:31:45 -06:00
co-authored by Claude Fable 5.1
parent 97b0973130
commit 37d9a0cb50
83 changed files with 16490 additions and 55 deletions
+87
View File
@@ -263,3 +263,90 @@ tr.rowlink.on td { background: var(--sel); }
tr.rowlink:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
td .pill + .pill { margin-left: 4px; }
.lock .auth-card { max-height: calc(100dvh - 32px); overflow: auto; }
/* ===== New in the rebuild (phase 2) ===== */
/* Clerical home, projects and units, the packet page. Ported from the old .dhead, .facts, .projgrid, .pcard,
.stg, .pbar, .unitbar, .projhits, .crumbs, .due, .fltbar, .qrs, .balloon blocks, plus a few new helpers. */
.sheet.narrow { width: min(560px, 100%); }
.sec-h.flush { margin: 0; }
.chip.sm { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.grow0 { min-width: 0; flex: 1 1 420px; }
.pre { white-space: pre-wrap; margin-top: 6px; }
.dhead { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding-block: 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.dhead .facts { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; }
.dhead .facts span { color: var(--muted); }
.dhead .facts b { color: var(--near); font-weight: 600; font-family: var(--f-mono); font-size: 13px; }
.dhead .pacts { align-items: center; }
.dtitle { color: var(--near); font-weight: 500; font-size: 17px; margin-top: 2px; }
.crumbs2 { margin: 4px 0 6px; }
.crumbs2 b { color: var(--near); }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.crumbs span { color: var(--muted); }
.crumbs b { color: var(--near); }
.due { font-weight: 600; }
.due.over { color: var(--pink); font-weight: 700; }
.due.soon { color: var(--amber); font-weight: 700; }
.due.muted { opacity: .7; }
.flagline { margin: 4px 0 8px; }
.card .dept { color: var(--cyan); font-weight: 600; }
.attn { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fltbar { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.fltrow { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: flex-end; }
.fltrow .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fltrow .f > span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fltrow .fltq { flex: 3 1 320px; }
.fltrow .fltp { flex: 1.4 1 260px; }
.fltbtns { display: flex; gap: 8px; align-items: flex-end; flex: none; }
.fltrow2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pick { display: flex; flex-direction: column; gap: 6px; }
.pickp { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; color: var(--near); }
.pickp .small { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; }
.projhits { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; }
.projhit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--near); cursor: pointer; font: inherit; }
.projhit:hover, .projhit:focus-visible { border-color: var(--cyan); }
.projhit .pill { margin-left: auto; }
.projgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard .job { font-size: 20px; }
.stg { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 6px; }
.stg span { color: var(--near); }
.stg span.z { color: var(--muted); opacity: .6; }
.pbar { height: 8px; border-radius: 5px; background: var(--line2); overflow: hidden; display: flex; margin: 6px 0 2px; }
.pbar i { display: block; height: 100%; }
.pbar i.f { background: var(--cyan); }
.pbar i.c { background: var(--green); }
.unitbar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.unitlist .pbar { margin: 0; }
th.wide { min-width: 160px; }
table.edit td { padding: 6px; }
input.in.sm { min-height: 36px; padding: 6px 8px; font-size: 14px; }
input.in.num { text-align: right; font-family: var(--f-mono); }
.sheet-acts.start { justify-content: flex-start; align-items: center; }
.sigmean { border-left: 3px solid var(--amber); background: var(--panel); border-radius: 0 10px 10px 0; padding: 8px 12px; }
.sigmean .tt { color: var(--near); font-weight: 600; font-size: 16px; margin-top: 2px; }
.actbox { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.hmq { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hmq b { color: var(--near); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.act { display: flex; flex-direction: column; gap: 4px; max-width: 280px; }
.act .why { color: var(--amber); }
label.btn input.sr { pointer-events: none; }
.balloon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--cyan); color: var(--cyan); font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; }
.qrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.qr { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 16px; align-items: center; }
.qr .code { background: var(--white); padding: 10px; border-radius: 8px; flex: none; width: 148px; height: 148px; display: grid; place-items: center; color: var(--bg); }
.qr .code canvas { width: 128px !important; height: 128px !important; }
.qr .wo { font-family: var(--f-disp); font-weight: 700; font-size: 26px; color: var(--white); letter-spacing: .03em; }
.pdfv { display: flex; flex-direction: column; gap: 10px; }
.pdfv-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pdfv-bar .seg button { min-width: 44px; font-weight: 700; }
.pdfv-body { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.pdfv-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pdfv-pages button { width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--near); cursor: pointer; font: inherit; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pdfv-pages button[aria-current="page"] { border-color: var(--cyan); background: var(--sel); }
.pdfv-frame { overflow: auto; background: var(--col); border: 1px solid var(--line); border-radius: 10px; padding: 1px; min-height: 240px; max-height: calc(100dvh - 160px); }
.pdfv-canvas { display: block; background: var(--white); }
@media (max-width: 700px) {
.pdfv-body { grid-template-columns: 1fr; }
.pdfv-pages { flex-direction: row; flex-wrap: wrap; }
.pdfv-pages button { width: auto; }
}