MK Trade Current-Lineage Reconciliation — 2026-08-10¶
- Task:
CTC-CDOC-001 - Status:
CURRENT SOURCE-LINEAGE RECONCILIATION / READ-ONLY EVIDENCE REQUIRED - Source baseline actually reviewed:
qa/master@44a8866954075787c3d3a696460a4b7c26484325 - Repository documentation head at review start:
master@8981a02f7b2a2fa256a7365d6921f3d7636f1fe2 - Historical packet baseline:
d96498360bb9c3541a1b5f862284596a7ed217b9 - Historical/current merge base:
4f6165bc4c53a7d98b0c246392dd9ed5bd75c21c - Phase Transformation:
USER HOLD - Runtime/DB/provider/service/file/Wiki publication effects:
NONE
1. Purpose And Boundary¶
This document replaces detached-candidate lineage as the basis for current MK Trade / Cost / Rate / Document statements. It does not delete the older packet. It classifies that packet as historical/source-reconciliation input and independently re-anchors current facts to the long-lived source at 44a886....
Current-source precedence for this packet is:
current source at 44a886...
> accepted current business policy
> current source-reconciled documentation
> historical packet/candidate
> old implementation prompt
No statement below proves deployed Runtime identity, current DB rows, target-role access, current T_WIKI_PAGE, physical completion, M3 or M4.
2. Git Lineage Result¶
The old packet baseline is not an ancestor that can simply be relabeled current.
historical packet ref: d96498360bb9c3541a1b5f862284596a7ed217b9
current source ref: 44a8866954075787c3d3a696460a4b7c26484325
merge base: 4f6165bc4c53a7d98b0c246392dd9ed5bd75c21c
relationship: DIVERGED
current side: 657 commits ahead of the historical ref comparison
historical side: 1 unique candidate-only commit
The unique d964983... commit belongs to the Loader candidate lineage rather than the MK Trade owner family. Therefore:
HISTORICAL SOURCE FACT:d964983...was the checkout referenced by the earlier Trade packet.CANDIDATE-ONLY FACT: any behavior observable only in the uniqued964983...Loader commit is candidate history, not current Trade authority.CURRENT SOURCE FACT: a Trade statement is current only when independently present in current owner source at44a886...or an accepted current policy owner.- No current Trade fact in this reconciliation depends solely on
d964983....
The repository head 8981a02... is one documentation-only commit after 44a886...; the only delta from 44a886... to 8981a02... is the Cloud documentation queue. It does not change Runtime owners, so 44a886... remains the source baseline for this task.
3. Classification Vocabulary¶
Every material statement in this packet is interpreted as one of:
CURRENT SOURCE FACT
CURRENT BUSINESS POLICY
HISTORICAL SOURCE FACT
CANDIDATE-ONLY FACT
TARGET DESIGN
OPEN / EVIDENCE REQUIRED
A CURRENT SOURCE FACT is still static source evidence only.
4. Current Owner Inventory¶
4.1 Trade Summary / Deal Ledger¶
CURRENT SOURCE FACT
app/systems/OMS/trade-summary/api_routes.phpGET /oms/trade-summaryGET /oms/trade-summary/{equipmentId}GET /oms/deal-ledgerGET /oms/deal-ledger/{equipmentId}- all use module key
oms.trade-summary. app/systems/OMS/trade-summary/trade_summary_query_helper.php- source joins, source-class totals, paging/filtering and derived Trade state.
config/page_routes.php- current page route registration/alias surface.
frontend/pages/system/BMS/reports/mk-trade-summary.php- current Trade Summary page surface.
app/addons/reports/query_helper.php- report/document projection helpers consumed by adjacent MK outputs.
Current authoritative inputs include V_EQUIPMENT_DEAL_LINK, T_EQUIPMENT, T_LOAD, T_LOAD_ITEM, T_BOOKING, T_TRANSACTION and T_TRANSACTION_LIST.
4.2 Export Brokerage¶
CURRENT SOURCE FACT
app/systems/OMS/export-brokerage/api_routes.phpGET /oms/export-brokerage/bookings/searchPOST /oms/export-brokerage/documents/ai-extractPOST /oms/export-brokerage/jobsPOST /oms/export-brokerage/jobs/cancelapp/systems/OMS/inbound-order/mk_post_helper.php- Purchase/inbound, lot, transload and allocation child operations consumed by orchestration.
app/systems/TMS/delivery/post_helper.php- equipment/container-related child operations consumed by orchestration.
frontend/pages/system/OMS/export-brokerage/mk-export-brokerage.php- current operator page/caller.
- tenant/config helper path consumed by the route for
EXPORT_BROKERAGE_WORKFLOW_ENABLED.
The current route defines [EB:generated] and [EB:generated-booking] compatibility markers. The create route returns child IDs; no dedicated persisted Export Brokerage Job ID is established by current source.
4.3 Outbound Order Cost¶
CURRENT SOURCE FACT
app/systems/OMS/outbound-order/cost_helper.php- outbound assertion, linked AP selection, mutable-state guard, header normalization, line replacement, create/update/delete behavior.
- current Outbound Order route/handler surface exposes the cost adapter under the Outbound Order API family; existing current API contract documents the
/api/oms/outbound-orders/{id}/costssurface. - Outbound Order detail UI is the current cost editor/caller.
T_TRANSACTIONandT_TRANSACTION_LISTare the local AP header/line authority; file linkage remains a separate file/document lifecycle.
4.4 Packing Rate¶
CURRENT SOURCE FACT
app/systems/TMS/booking/api_routes.php::tmsBookingApiUpdatePackingListRates()- Booking-linked Sales/Outbound item rate mutation.
frontend/pages/system/TMS/booking/mkPackingList.php- rate edit/autosave and document-render caller.
T_LOAD_ITEM.RATE- durable rate field.
Current source can accept multiple item IDs and skip ineligible IDs. A success/update count is not proof that every intended item changed.
4.5 Document Generation / Rendering¶
CURRENT SOURCE FACT
- Packing Document:
frontend/pages/system/TMS/booking/mkPackingList.phpapp/addons/reports/query_helper.php::packing_list()- Purchase Local Invoice:
frontend/pages/system/BMS/invoice/localInvoice.phpapp/addons/reports/query_helper.php::purchase_local_invoice()- Booking Confirmation:
frontend/pages/system/TMS/booking/bookingConfirmation.phpapp/addons/reports/query_helper.php::booking_confirmation()- Sales Weight Ticket:
frontend/pages/system/BMS/scale-ticket/scaleticket.phpapp/addons/reports/query_helper.php::sales_weight_ticket()
These pages render browser projections. Their render/print path is not, by itself, a durable file, email, approval, provider or business-completion effect.
5. Current Record / State Matrix¶
| Capability | Current record authority | Current source state | Persisted vs derived | Important non-implication |
|---|---|---|---|---|
| Trade Summary | Equipment, Order/Load, Booking, AP/AR and linked rows | OPEN / SHIPPED / CLOSED are derived by query |
derived | CLOSED != accounting settlement or process completion |
| Trade claimed filter | Trade projection totals/margin | negative margin plus amount presence | derived filter | CLAIMED != persisted claim lifecycle |
| Export Brokerage | created child records across owning families | child states owned by each family; compatibility markers exist | persisted children, no universal job state | create response != reconciled child set or safe replay |
| Outbound Cost | outbound-linked AP T_TRANSACTION + lines |
mutable source statuses include CREATED, OPEN, DRAFT; CONFIRMED/CLOSED blocked by current helper |
persisted | cost save != QBO/accounting/file completion |
| Packing Rate | T_LOAD_ITEM.RATE |
row eligibility derives from tenant/order/Booking/class/direction/active predicates | persisted rate | aggregate update count != every requested item updated |
| Packing/Invoice/Confirmation/Weight Ticket | current order/Booking/equipment/rate/report rows | render state is browser presentation | source persisted, render transient | render/print != saved snapshot/file/email/approval |
Directly verified current Trade derivation at 44a886...:
abs(TOTAL_AP) >= 0.005 or abs(TOTAL_AR) >= 0.005 -> CLOSED
else ETA present or ETD present or SWB_FLAG = 1 -> SHIPPED
else -> OPEN
CLAIMED filter -> MARGIN < 0 and material AP/AR amount exists
Equipment AP/AR totals are queried from T_TRANSACTION + T_TRANSACTION_LIST for RELATED_TABLE_NAME = 'T_EQUIPMENT' and selected statuses; outbound-order AP is added separately. This difference must remain visible in reconciliation evidence.
6. Caller / Query / Command / Effect Matrix¶
| Entry/caller | Query or command | Current owner | Local write | External/file effect | Required readback |
|---|---|---|---|---|---|
| Trade Summary / Deal Ledger page | list/detail GET | Trade Summary routes/query helper | no | browser CSV only when user exports | source-class totals and selected relations |
| Export Brokerage page | Booking search GET | Export Brokerage route | no | none | exact active Booking candidate |
| Export Brokerage document extraction | AI extraction POST | Export Brokerage + shared AI extraction owner | no business child write from extraction itself | AI/provider effect may exist | proposal only; never Create authority |
| Export Brokerage Create | POST jobs | Export Brokerage orchestration + child owners | yes, multi-child | no separate durable provider result implied | exact returned and discovered child manifest |
| Export Brokerage Cancel | POST jobs/cancel | orchestration + child owners | yes, compensation | no universal downstream reversal | per-child compensation/residual evidence |
| Outbound Cost UI/API | read/create/update/delete linked AP | Outbound Cost helper + transaction owner | yes for commands | file lifecycle separate | exact AP ID, status, lines, sibling candidates |
| Packing List | rate mutation | Booking route + load-item owner | yes | none | every intended item/rate server reread |
| Document pages | projection GET/render/print | report helper + page | no source write from render | browser print only | source fingerprint and branch/provenance |
7. Material Statement Classification¶
CURRENT SOURCE FACT¶
- Trade Summary and Deal Ledger APIs are read-only aliases under
oms.trade-summary. DEAL_STATUSandCLAIMEDare derived query concepts, not persisted Trade workflow states.- Export Brokerage is a multi-child local orchestration with generated equipment/Booking markers and no durable universal job identity.
- Export Brokerage AI extraction is proposal input; Create is a separate write command.
- Outbound Cost is represented by outbound-linked AP transaction rows and can be ambiguous when multiple active AP candidates exist.
- Packing Rate persists to
T_LOAD_ITEM.RATE; browser Amount edits are not the rate authority. - Packing, Local Invoice, Booking Confirmation and Sales Weight Ticket are current browser projections; print does not create a durable completion record by itself.
- Booking Confirmation has a direct page-role guard; older statements that its page-role behavior is wholly unverified are stale.
- The Sales Weight Ticket
ORDER_IDbranch is an order-derived projection and does not prove a physical Scale ticket.
CURRENT BUSINESS POLICY¶
- Distinct capability owners remain separate: Trade projection, Export Brokerage orchestration, Cost transaction, Rate correction and document projection do not become one universal Trade aggregate.
- Source corrections must be made through the owning record/process rather than by mutating report output.
- A browser render/print or report export does not represent accounting close, approval, email/file delivery or process completion unless a separately owned effect proves it.
HISTORICAL SOURCE FACT¶
- The earlier detailed packet was built around
d964983...and later reconciliations used intermediate refs including4f6165...,216305...anda71386e.... - Those refs remain useful to explain documentation history, not as the current source baseline for this task.
CANDIDATE-ONLY FACT¶
- The unique commit on the detached
d964983...side is Loader candidate history. It must not be used to infer Trade/Cost/Rate/Document behavior. - Any old statement that treats
d964983...itself as currentqa/masteris retired as current authority.
TARGET DESIGN¶
- React presentation + Next.js adapter + framework-independent TypeScript applications/repositories.
- Explicit
ExportBrokerageJobrequest/result identity, exact Outbound Cost ownership, per-item Rate result/versioning and separately approved durable document snapshot/file/delivery capability. - These remain design inputs only; Phase implementation is on hold.
OPEN / EVIDENCE REQUIRED¶
- current deployed Runtime source identity;
- actual current DB schema/indexes/constraints and row distributions;
- exact target-role page/API/record access;
- Outbound Cost ownership when multiple active AP candidates exist;
- accepted cost/rate range, UOM, rounding and correction policy;
- Export Brokerage duplicate/partial/response-loss populations and compensation residue;
- document template/date/branding/fallback policy and actual browser output;
- current
T_WIKI_PAGEcoverage/rendering/findability; - accounting acceptance and durable output custody.
8. Candidate Assumption Retirement Rule¶
Older Trade-family files are not deleted by this task. Read them as follows:
statement independently confirmed at 44a886... -> current source fact
accepted Process/Product statement -> current business policy
statement describing older source -> historical source fact
statement depending only on d964983 unique work -> candidate-only fact
future architecture -> target design
DB/role/browser/Wiki/provider assertion unproven -> open / evidence required
Shared indexes are intentionally not changed. CTC-CDOC-007 owns later navigation integration.
9. Read-Only Evidence Handoff¶
The exact future evidence package is defined in:
docs/operations/mk-trade/RBR-MK-TRADE-002-READONLY-PREFLIGHT.md
It is DEFINED / NOT RUN. It requires separate authorization before any environment access and permits only bounded read-only DB/GET/Wiki inspection. No package step was executed by CTC-CDOC-001.
10. Result¶
exact current source baseline: RECORDED — 44a8866954075787c3d3a696460a4b7c26484325
historical detached baseline: ISOLATED — d96498360bb9c3541a1b5f862284596a7ed217b9
candidate-only Trade authority: NONE ACCEPTED
active owner/caller map: RECORDED
current record/state/effect boundaries: RECORDED
read-only evidence package: DEFINED / NOT RUN
Runtime/environment effects: NONE
Phase progress: NONE
M3/M4: UNCHANGED
---¶
Source:
docs/reconstruction/MK_TRADE_CURRENT_LINEAGE_RECONCILIATION_2026-08-10.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.