This is an internal working record, not an everyday instruction. It was written while the system was being rebuilt, for whoever maintains it. If you are here to do today's work, use the everyday documents instead: Procedures · Processes · Runbooks · The working day, step by step
MK Trade / Cost / Rate / Document Outputs — Current Caller And Effect Matrix — 2026-08-08¶
- Status:
CURRENT STATIC CALLER MATRIX / ENVIRONMENT EVIDENCE REQUIRED - Current review ref:
qa/master@a71386e3baf176534939a42397249bcd2b535c49 - Source refresh:
MK_TRADE_CURRENT_LINEAGE_AND_SOURCE_REFRESH_2026-08-08.md - Existing Process family:
MK_TRADE_COST_RATE_DOCUMENT_OUTPUTS_RECONCILIATION.md - Phase implementation:
USER HOLD
1. Matrix Rule¶
Each row separates:
entry surface
route/module
actor decision
record predicate
state predicate
local transaction
durable result
external/output effect
unknown-result recovery
A successful outer request does not imply every listed child checkpoint completed.
2. Current Matrix¶
| Capability | Entry | Current command/query | Principal current authority | Durable result | Non-implication |
|---|---|---|---|---|---|
| Trade Summary list | Trade Summary / Deal Ledger page | GET /api/oms/trade-summary and alias |
tenant-scoped derived query | none beyond source rows | list loaded does not close a deal |
| Trade Summary detail | row/detail panel | GET /api/oms/trade-summary/{equipmentId} and alias |
equipment/deal source projection | none | detail displayed does not reconcile source discrepancy |
| Trade CSV | browser page | client CSV generation | displayed projection | browser download only | download is not retained evidence |
| Export Brokerage proposal | Export Brokerage page | lookup and AI extraction | source rows + human review | proposal only | AI proposal is not approval/create |
| Export Brokerage create | reviewed form | provider-free local create route | orchestration handler + child owners | child IDs/local rows | response missing does not prove no children exist |
| Export Brokerage cancel | existing result | guarded compensation route | child progression predicates | compensated child rows | cancel is not universal delete |
| Outbound Cost list | Outbound detail | GET .../{id}/costs |
active AP rows linked to order | none | latest row display is not subtype authority |
| Outbound Cost create | cost form | POST .../{id}/costs |
Outbound Cost helper | AP header + lines | file/QBO/Trade close remain separate |
| Outbound Cost update | cost form | PATCH .../{id}/costs/{transactionId} |
mutable-status guard + replace-all lines | updated AP header + lines | omitted fields are not preserved automatically |
| Outbound Cost delete | cost form | DELETE .../{id}/costs/{transactionId} |
mutable-status guard | soft-deleted AP rows | linked files are not deleted/restored |
| Packing Rate read | MK Packing page | Packing report query | current Sales items | current rate values | displayed amount may be transient |
| Packing Rate update | rate inputs | PATCH /api/tms/bookings/{id}/packing-list/rates |
Booking-linked Sales item predicate | T_LOAD_ITEM.RATE updates |
updated count does not prove all intended IDs matched |
| Packing output | browser page | report query + print | current Booking/Sales/Equipment source | none | print is not file/email/approval |
| Purchase invoice output | direct browser page | report query + print | Purchase order/item source | none | order number label is not invoice lifecycle |
| Booking confirmation output | direct browser page | report query + print | Booking/company/source reference | none | print is not Booking confirmation state |
| Sales weight output | scaleticket.php?ORDER_ID= |
report query + print | Sales order/equipment projection | none | output is not physical Scale evidence |
3. Trade Summary Query Contract¶
Query inputs¶
Tenant
filters/search
paging
source date/reference constraints
selected equipment ID for detail
Derived values¶
AP total
AR total
Margin
DEAL_STATUS
CLAIMED filter eligibility
shipping/reference presentation
Required explanation fields for a future typed query¶
source class
source row identity
amount/status/deleted-row rule
calculation timestamp
view/source fingerprint
conflict or missing-source reason
Current recovery¶
query error or inconsistent total
-> reread exact source rows
-> compare source classes
-> correct the owning Purchase/Sales/Booking/Transaction record
-> rerun projection
Do not edit Trade projection output directly.
4. Export Brokerage Command Contract¶
Create boundaries¶
reviewed inputs
-> one local transaction
-> Purchase/item/Transload/Lot/Outbound/Equipment/Booking/Allocation children
-> return created IDs
Current identity gap¶
No durable identity equivalent to:
jobId
requestToken
inputFingerprint
immutable child manifest
child disposition ledger
Unknown-result rule¶
create/cancel response missing
-> stop replay
-> search all expected child families
-> classify no child / complete child set / partial/conflict
-> retry only after absence is proven
Compensation boundary¶
Compensation can be blocked by:
- downstream Delivery/Transload evidence;
- allocated/consumed Inventory;
- changed child state;
- missing or ambiguous generated provenance;
- child ownership outside the orchestrator.
5. Outbound Cost Command Contract¶
Record selection¶
Preferred:
explicit Outbound Order ID
+ explicit Transaction ID
Current compatibility risk:
Transaction ID omitted
-> latest matching active AP may become target
Mutable states¶
CREATED
OPEN
DRAFT
Blocked states¶
CONFIRMED
CLOSED
other nonmutable state
Update semantics¶
normalize header
-> replace complete active line set
-> commit once
Recovery¶
response missing
-> reread exact transaction and lines
-> compare expected header/line set
-> do not submit a second create while first result is unknown
6. Packing Rate Contract¶
Current request¶
Booking ID
ITEMS[]
RATE
ORDER_ITEM_ID or ORDER_ITEM_IDS
Current per-ID behavior¶
valid active Sales/Outbound item linked to Booking
-> update RATE
invalid/foreign/deleted/wrong Booking
-> skip
Current aggregate result¶
updated > 0
-> request success
This can hide partial intent.
Required future per-item disposition¶
UPDATED
UNCHANGED
STALE
DENIED
NOT_FOUND
INVALID
Print readiness¶
all intended IDs reread with expected rate
-> print ready
Blur/autosave initiation alone is not print readiness.
7. Output Contract¶
Every browser output must preserve:
source query timestamp
source record identities
source fallback used
current template/version label
transient fields
persisted fields
print-only boundary
Required labels:
CURRENT SOURCE PROJECTION
NOT SAVED AS A DURABLE DOCUMENT
NOT AN APPROVAL OR COMPLETION EVENT
A future durable file/email/provider result must be a separately approved capability with its own identity, retention and recovery.
8. Role And Access Questions¶
Current evidence still must establish:
| Surface | Question |
|---|---|
| Trade Summary | which roles can see list/detail/export and underlying amount detail? |
| Export Brokerage | which roles may propose, create and compensate? |
| Outbound Cost | which Finance/Office roles may create/update/delete? |
| Packing Rate | whether current route roles 1..6 are accepted policy? |
| Direct outputs | direct URL, page-role and module/config parity |
| Sales Weight Ticket | separation of ORDER_ID projection and physical IDS[] ticket |
Do not infer accepted action authority from module visibility alone.
9. State And Evidence Matrix¶
| Capability | Current source state | Required authoritative reread |
|---|---|---|
| Trade | source rows and derived query | source-class totals and detail |
| Export Brokerage | created child set | each child owner and progression |
| Outbound Cost | AP transaction/lines | exact transaction ID and active lines |
| Packing Rate | Sales item rate | every intended item ID/rate |
| Output | current source projection | source rows plus rendered page |
10. Current Disposition¶
Static caller matrix:
COMPLETE FOR NAMED SURFACES
Current deployed callers:
NOT VERIFIED
Current role/menu/module evidence:
NOT RUN
Current DB/source-class evidence:
NOT RUN
Current Wiki content:
NOT READ
M3:
NO
M4:
NO
---¶
Source:
docs/processes/MK_TRADE_CURRENT_CALLER_AND_EFFECT_MATRIX_2026-08-08.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.