Skip to content

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 Order-First Core Policy Decision Matrix

  • Status: CURRENT POLICY DECISION INPUT / NOT AUTOMATICALLY APPROVED
  • Scope: Commercial Agreement, Inbound Purchase, Outbound Sales and Booking
  • Process assembly: MK_ORDER_FIRST_CORE_RECONCILIATION.md
  • Rebuild packet: MK_ORDER_FIRST_CORE_CAPABILITY_REBUILD_PACKET.md
  • Purpose: prevent implementation and migration writers from converting source gaps into arbitrary Product policy

Decision vocabulary

CURRENT_BEHAVIOR
RECOMMENDED_TARGET
ACCEPTED
DEFERRED
REJECTED
RUNTIME_EVIDENCE_REQUIRED

A recommendation is not authorization for Runtime or schema change.


1. Operating Profile And Access

ID Decision Current behavior Recommended target Status / owner Blocks
MKPOL-001 MK applicability selector deployment-local Client 2/profile compatibility semantic mk-order profile plus capability/config contract; no numeric ID branching RECOMMENDED_TARGET — P2/P4/P5 shared React/Next.js behavior
MKPOL-002 Role-to-command mapping module/menu plus mixed legacy context and numeric role lists explicit capability × command × record scope matrix RUNTIME_EVIDENCE_REQUIRED — P2-007 M3/M4 and safe writes
MKPOL-003 Direct-ID access selected routes validate tenant strongly; coverage is inconsistent every query/command validates same-tenant active class and returns no foreign detail RECOMMENDED_TARGET — P5 tenant isolation
MKPOL-004 Basic versus advanced operations context flag changes accepted fields/actions explicit named capabilities and visible disabled reason RECOMMENDED_TARGET — Product/P5 UI/API parity
MKPOL-005 Destructive actions selected DELETE/clone/cost routes use role IDs 1..6 capability-based command policy with per-record blockers RECOMMENDED_TARGET — P2/P5 target authorization

2. Commercial Agreement

ID Decision Current behavior Recommended target Status / owner Blocks
MKPOL-CO-010 Agreement status meaning manual DRAFT/OPEN/PARTIAL/FULFILLED/CANCELLED; no automatic criteria define explicit manual lifecycle and separate derived execution utilization OPEN — Product/Operations/P6 status command and Wiki
MKPOL-CO-020 Status actor any currently authorized edit path can submit allowed value separate set-status capability and audit/reason where consequential RECOMMENDED_TARGET — Product/P2 role matrix
MKPOL-CO-030 Purchase/Sales relation direction one stored pointer; UI primarily Purchase→Sales; reverse projection on Sales choose canonical Purchase→Sales relation or normalized relation entity; expose both sides OPEN — Product/P5/P6 target data model
MKPOL-CO-040 Relation cardinality current source does not enforce one-to-one or status eligibility recommend one accepted Sales link per Purchase unless business proves many-to-many; prevent cycles OPEN — Product/Operations relation command
MKPOL-CO-050 Relation after execution same-tenant/opposite-type/non-self only block or require controlled correction once either side has execution RECOMMENDED_TARGET — Operations/P6 correction policy
MKPOL-CO-060 Line identity pre-execution update can replace lines and change IDs prefer stable line IDs with explicit add/update/delete; retain replacement only as compatibility command RECOMMENDED_TARGET — P5/P6/DB source references/migration
MKPOL-CO-070 Post-execution header edits type/items/delete limited; other fields may change approve exact mutable field allowlist and reason/audit for material terms OPEN — Product/Operations safe update command
MKPOL-CO-080 Post-execution line edits current items preserved once header-linked execution found block normal edits; use explicit amendment/correction if required RECOMMENDED_TARGET — Product target command
MKPOL-CO-090 Execution detection primarily header-level T_LOAD.COMMERCIAL_ORDER_ID include header and item references plus accepted archived/reference relations RECOMMENDED_TARGET — P5/DB delete/update safety
MKPOL-CO-100 Free-text case normalization shared body handling uppercases many scalar/nested values preserve user case for names, addresses, memo and terms; normalize only defined codes RECOMMENDED_TARGET — Product/P5 field parity
MKPOL-CO-110 Rate validation rate can be zero/non-positive under current helper define zero/negative eligibility by agreement type/commodity; default positive when commercial value required OPEN — Product/Finance validation
MKPOL-CO-120 Container quantity normalization rounded/clamped to 0..32767 reject invalid/out-of-range input or show normalized result explicitly RECOMMENDED_TARGET — Product/P7 UI/readback
MKPOL-CO-130 Print completion browser render/print only retain as nondurable output unless a document-generation/ack process is separately approved RECOMMENDED_TARGET — P6/P8 output semantics
MKPOL-CO-140 Delete/restore soft delete; no proven restore UI retain soft-delete audit; define manager restore or explicit no-restore policy OPEN — Operations recovery/Wiki

3. Inbound Purchase And Receipt

ID Decision Current behavior Recommended target Status / owner Blocks
MKPOL-IN-010 Header close label manual OPEN/IN_PROGRESS/COMPLETED/CANCELLED keep independent from receipt; define actor and criteria or rename as administrative label OPEN — Product/Operations status UI
MKPOL-IN-020 Item operational states compatibility map between raw and SCHEDULED/UNLOADED/TRANSLOADED expose semantic item state directly in application contract; preserve current DB mapping in repository RECOMMENDED_TARGET — P5/P12 migration DTO
MKPOL-IN-030 Receipt command authority Scale checkout and finalize separate; direct status/time path can materialize lot make FinalizeInboundReceipt and accepted no-scale command the normal owner; classify direct path as compatibility RECOMMENDED_TARGET — P6/Product receipt migration
MKPOL-IN-040 Direct operational update receipt current status/OUT_TIME update may synchronize transload/lot retire after callers are migrated, unless Operations proves a required manual recovery use OPEN — Operations/P5 caller-zero
MKPOL-IN-050 Multi-line physical receipt scale distribution exists; exact lot sync may require one item define one lot per item or accepted aggregation with deterministic weight/quantity distribution OPEN — Product/WMS/OMS multi-line finalize
MKPOL-IN-060 No-scale eligibility current Brokerage/OCEAN_FREIGHT and no-progress rules convert to profile/config policy, document required fields and exact source evidence OPEN — Operations/Product no-scale command
MKPOL-IN-070 No-scale multi-line validation can accept submitted items while later lot sync conflicts block until multi-line policy accepted or implement exact per-line lot contract RECOMMENDED_TARGET — P6/WMS integrity
MKPOL-IN-080 Next-work branch WAREHOUSE_ONLY/DIRECT_OUTBOUND/MIXED changes returned URL only persist an intent/event only if operational recovery requires it; otherwise label as navigation choice OPEN — Operations/Product recovery/Wiki
MKPOL-IN-090 Post-receipt header edits only selected Scale-owned times are blocked define exact mutable metadata and correction command OPEN — Operations/P6 safe update
MKPOL-IN-100 Post-receipt item quantity/weight current update can reset lot remaining values prohibit generic source overwrite; use inventory-aware correction preserving allocated/consumed lower bound RECOMMENDED_TARGET — WMS/P6 data integrity
MKPOL-IN-110 Post-receipt item delete incomplete direct guards; later sync may rollback explicit correction/void command with lot/allocation/ledger/placement/Scale checks RECOMMENDED_TARGET — WMS/P6 delete safety
MKPOL-IN-120 Lot identity exact source transload/item expected; cardinality conflicts exist one deterministic source identity and idempotent materialization per accepted policy RECOMMENDED_TARGET — WMS/DB receipt idempotency
MKPOL-IN-130 Scale checkout/finalize recovery ticket can be complete while receipt absent preserve ticket; expose finalize-pending and resume only finalize RECOMMENDED_TARGET — P6/YMS/OMS operator recovery
MKPOL-IN-140 AI packing-list extraction provider returns proposed rows; no save keep as suggestion only; require human compare and separate Save RECOMMENDED_TARGET — Product/P8 AI boundary
MKPOL-IN-150 Delete order current order guard stronger than item guards centralize blocker query and return exact child IDs/reasons RECOMMENDED_TARGET — P5/P6 deletion command

4. Outbound Sales

ID Decision Current behavior Recommended target Status / owner Blocks
MKPOL-OUT-010 Ocean required fields Booking/container/size may be missing define minimum Ocean create versus draft requirements and visible incomplete state OPEN — Product/Operations validation/UI
MKPOL-OUT-020 Local required fields current Local requires container confirm container/equipment requirement and whether Booking is not applicable OPEN — Operations target form
MKPOL-OUT-030 Header close label manual independent label define actor/criteria or treat as administrative label separate from readiness OPEN — Product/Operations status command
MKPOL-OUT-040 Direct line allocation direct Save creates UNMAPPED and does not allocate preserve separation; require Allocation owner command RECOMMENDED_TARGET — P6 data integrity
MKPOL-OUT-050 Allocated-item edit current update may diverge from allocation/lot prohibit normal edit or perform allocation-aware correction in one accepted command RECOMMENDED_TARGET — WMS/OMS correction
MKPOL-OUT-060 Unallocate/reversal no complete source-confirmed operator path define explicit unallocate/reallocation command and audit OPEN — Product/WMS/P6 allocation recovery
MKPOL-OUT-070 Booking link direction Outbound and Booking can carry forward/reverse pointers define canonical relation and two-sided transaction/reconciliation OPEN — P5/P6 link command
MKPOL-OUT-080 Bridge remap after progress selected Scale/Delivery/Transload progress locks mapping define exact lock matrix and controlled correction OPEN — Operations/P6 update UI
MKPOL-OUT-090 Readiness meaning informational derived comparison label informational; never expose as approval/complete action RECOMMENDED_TARGET — P7/P8 operator misunderstanding
MKPOL-OUT-100 Delete cleanup current delete may leave Booking reverse pointer delete command must return/repair accepted link disposition or block RECOMMENDED_TARGET — P5/P6 orphan prevention
MKPOL-OUT-110 Equipment bridge identity current same-container selection can be ambiguous define active bridge uniqueness/selection policy OPEN — YMS/OMS/DB bridge migration
MKPOL-OUT-120 Actual weight authority Scale owns physical evidence; item fields can mirror/request clearly distinguish requested, allocated and actual weight in DTO/UI RECOMMENDED_TARGET — P6/P7 field contract
MKPOL-OUT-130 Cost relation Outbound Cost is separate child and delete blocker preserve separate cost command; expose child disposition RECOMMENDED_TARGET — BMS/P6 composite close
MKPOL-OUT-140 Post-progress metadata edits complete safe subset not approved define allowlist and reason/audit; block other fields OPEN — Operations update command

5. Booking

ID Decision Current behavior Recommended target Status / owner Blocks
MKPOL-BK-010 Booking lifecycle independent flags and NOT_IN_USE; no unified state retain independent fields; add only a derived operational projection if needed RECOMMENDED_TARGET — Product/P6 UI model
MKPOL-BK-020 Required fields number, shipping line, type, shipper; clone differs define create/update/clone validation separately and visibly OPEN — Operations/Product command schema
MKPOL-BK-030 Sales link validation invalid create may clear; invalid update may retain reject invalid link consistently and return exact prior/current relation RECOMMENDED_TARGET — P5/P6 safe link
MKPOL-BK-040 Sales link cardinality optional pointer and reverse synchronization one accepted relation contract with explicit two-sided readback OPEN — Product/P5 data model
MKPOL-BK-050 Invoice number uniqueness create generates/corrects; update differs one uniqueness/idempotency policy across create/update/clone OPEN — Product/DB number contract
MKPOL-BK-060 Clone carry policy may carry invoice/flags/inactive/Sales link; omits children explicit allowlist; default reset operational flags/link/inactive unless business approves carry RECOMMENDED_TARGET — Operations/Product clone command
MKPOL-BK-070 Clone result identity response may lack created IDs; suffix search used return created IDs/numbers and use request-token idempotency RECOMMENDED_TARGET — P5 response-loss recovery
MKPOL-BK-080 Inactive meaning manual marker; no child cleanup or automatic block define list visibility, edit/clone/output/link eligibility and child warning OPEN — Operations/Product Wiki/UI
MKPOL-BK-090 Independent flags no transition owner/unified state keep separate; define actor and evidence for each consequential flag OPEN — Operations role/UI
MKPOL-BK-100 Booking Save side effects compatibility sync can mutate order/item/lot/allocation target Booking command owns Booking only; explicit child commands/results RECOMMENDED_TARGET — P5/P6/P12 migration architecture
MKPOL-BK-110 BOOKING_RATE compatibility name understates broad behavior; exceptions may be swallowed characterize, rename as compatibility, expose result, then retire/replace RECOMMENDED_TARGET — P5/P6 caller-zero
MKPOL-BK-120 Compatibility error handling partial child writes may commit without visible failure no swallowed child error; return per-child disposition and stop dependent work RECOMMENDED_TARGET — P5 integrity/recovery
MKPOL-BK-130 Generic form mutation current Booking/Delivery/Equipment form uses table mutation with blacklists replace target with semantic Booking/equipment commands RECOMMENDED_TARGET — P5/P12 target API
MKPOL-BK-140 Party/direct reference validation not all same-tenant active checks complete consistent record-scope validation for every reference RECOMMENDED_TARGET — P5/P2 tenant safety
MKPOL-BK-150 Delete no Booking delete API retain no-delete unless Product approves archival/cancel command; do not infer from inactive OPEN — Product/Operations lifecycle

6. Cross-Child And Migration Decisions

ID Decision Recommendation Status / owner Blocks
MKPOL-X-010 Composite completion manual reconciliation over applicable children; no universal stored state RECOMMENDED_TARGET — P6 dashboard/Wiki
MKPOL-X-020 Stable identity UUID-based application identities; numeric IDs remain repository-local compatibility RECOMMENDED_TARGET — P5/P11/P12 APIs/PostgreSQL
MKPOL-X-030 Optimistic concurrency version/freshness token for mutable headers and line sets RECOMMENDED_TARGET — P5 stale-edit safety
MKPOL-X-040 Create idempotency request token plus tenant/capability identity RECOMMENDED_TARGET — P5/P12 response-loss recovery
MKPOL-X-050 Cross-owner transaction only when one accepted application command legitimately owns all local writes; otherwise explicit handoff RECOMMENDED_TARGET — P5/P6 architecture
MKPOL-X-060 Booking compatibility retirement explicit owner commands then caller-zero; no target hidden sync RECOMMENDED_TARGET — P5/P12 Booking migration
MKPOL-X-070 Wiki topic stability preserve mk-operations, mk-commercial-orders, mk-inbound-orders, mk-outbound-orders, mk-booking across route migration RECOMMENDED_TARGET — P8/P12 user knowledge
MKPOL-X-080 First read migration all four core queries and cross-child reconciliation before first writer RECOMMENDED_TARGET — P12 parity
MKPOL-X-090 First write migration Commercial Agreement recommended before receipt/Booking side-effect waves RECOMMENDED_TARGET — P12 implementation order
MKPOL-X-100 PostgreSQL timing after accepted React/Next.js/TypeScript/MySQL stabilization ACCEPTED DIRECTION — P11/P12 DB cutover
MKPOL-X-110 One writer exactly one writer per capability/cohort; read shadow allowed ACCEPTED DIRECTION — P12 data integrity
MKPOL-X-120 Rollback switch writer, preserve current records/physical effects, reconcile in-flight commands RECOMMENDED_TARGET — P12/P9 release readiness

Resolve in this order because later decisions depend on earlier ones:

  1. profile/capability and target-role matrix;
  2. Commercial status/relation/line identity;
  3. Inbound receipt and multi-line lot policy;
  4. post-receipt correction/void/delete;
  5. Outbound allocation-aware correction and required-field policy;
  6. Booking/Sales relation and clone/inactive semantics;
  7. Booking compatibility retirement/replacement;
  8. concurrency/idempotency/version strategy;
  9. migration cohort, rollback and Wiki activation;
  10. PostgreSQL physical representation.

8. Acceptance Record Template

For every accepted decision record:

decision ID
accepted value
business rationale
profiles/roles/capabilities
normal and negative examples
current compatibility effect
data/state/API/UI/Wiki impact
migration and rollback impact
approver/date/work item
required verification scenarios

Do not mark a decision accepted from source presence or implementation convenience.

---

Source: docs/processes/MK_ORDER_FIRST_CORE_POLICY_DECISION_MATRIX.md — ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.