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 And Document Outputs — Policy Decision Matrix¶
- Status:
CURRENT POLICY INPUT / NO IMPLEMENTATION OR MIGRATION AUTHORIZATION - Operating profile:
mk-order - Source baseline:
qa@d96498360bb9c3541a1b5f862284596a7ed217b9 - Reconciliation:
MK_TRADE_COST_RATE_DOCUMENT_OUTPUTS_RECONCILIATION.md - Rebuild packet:
MK_TRADE_COST_RATE_DOCUMENT_OUTPUTS_CAPABILITY_REBUILD_PACKET.md
Policy values:
RECOMMENDED
OPEN
BLOCKING
CURRENT COMPATIBILITY ONLY
DEFERRED
NOT APPLICABLE
A recommendation is not user or Process-owner acceptance.
1. Cross-Family Policies¶
| ID | Decision | Recommendation | Status | Blocks |
|---|---|---|---|---|
TCRD-POL-010 |
Family ownership | Keep Trade read, Export job, Cost, Rate and each output as separate capabilities. | RECOMMENDED | target module/application design |
TCRD-POL-020 |
Completion model | Never expose one family-wide completion status. Return independent child dispositions. | RECOMMENDED | UI and migration |
TCRD-POL-030 |
Profile selection | Resolve mk-order through profile/capability/configuration, not numeric Client ID. |
BLOCKING | P12 target implementation |
TCRD-POL-040 |
Role policy | Define semantic page/API/record/action capabilities for each family. | BLOCKING | M3/M4 |
TCRD-POL-050 |
Unknown result | Require authoritative reread before retry for every write and print/distribution ambiguity. | RECOMMENDED | command/UI design |
TCRD-POL-060 |
Durable output | Do not create durable snapshots/files/emails merely because the current page prints. | RECOMMENDED | document target scope |
TCRD-POL-070 |
Source fingerprint | Every derived read/document target returns source and policy/template fingerprint. | RECOMMENDED | parity/staleness |
TCRD-POL-080 |
PostgreSQL timing | MySQL parity and stabilization precede PostgreSQL. | RECOMMENDED | P11/P12 order |
2. Trade Summary Policies¶
| ID | Decision | Current fact | Recommendation | Status |
|---|---|---|---|---|
TCRD-POL-110 |
Trade root identity | Equipment is current projection root. | Keep equipment root but expose all linked orders and ambiguity. | RECOMMENDED |
TCRD-POL-120 |
CLOSED meaning |
Any AP/AR amount >= 0.005 currently derives CLOSED. | Rename to an explicitly derived label or adopt an accepted formula that does not imply accounting close. | BLOCKING |
TCRD-POL-130 |
CLAIMED meaning |
Negative margin + amount is a filter. | Keep as filter/warning, not state. | RECOMMENDED |
TCRD-POL-140 |
AP/AR source classes | Equipment AP/AR and Outbound AP use different rules. | Define one versioned source-class policy and return breakdown. | BLOCKING |
TCRD-POL-150 |
Transaction statuses | Equipment totals filter confirmed/closed; Outbound AP differs. | Accept explicit per-source status policy; do not hide differences. | BLOCKING |
TCRD-POL-160 |
Deleted source | Current predicates are inconsistent. | Exclude deleted rows by default and expose legacy contamination warnings in parity mode. | RECOMMENDED |
TCRD-POL-170 |
Multiple links | Current attribution can collapse to MAX. | Return conflict and require reconciliation; never silently select greatest ID. | RECOMMENDED |
TCRD-POL-180 |
Date source | ETA/ETD/logistics values drive filters. | Define precedence, timezone, null behavior and cutoff; return query time. | BLOCKING |
TCRD-POL-190 |
Header/detail parity | Current detail cannot explain header. | Target detail must expose every source class used by header. | RECOMMENDED |
TCRD-POL-200 |
CSV | Browser CSV is nondurable. | Preserve as read export; optional durable export is separate Product decision. | RECOMMENDED |
TCRD-POL-210 |
Module keys | Page/API metadata can differ. | One semantic capability with explicit page/API mappings and parity tests. | BLOCKING |
3. Export Brokerage Policies¶
| ID | Decision | Current fact | Recommendation | Status |
|---|---|---|---|---|
TCRD-POL-310 |
Durable Job identity | No dedicated Job row; markers and child IDs exist. | Add stable request/job/result identity before target writer activation. | BLOCKING |
TCRD-POL-320 |
Request idempotency | No durable request token. | Claim request token + payload fingerprint and return prior result on duplicate. | BLOCKING |
TCRD-POL-330 |
Supported shape | UI/source suggest multi-container/line; child invariants may constrain it. | Explicitly approve supported cardinality before migration. | BLOCKING |
TCRD-POL-340 |
Existing versus generated Booking | Current source can preserve/select or compatibility-mark generated Booking. | Manifest must state REUSED or CREATED and cancellation ownership. | RECOMMENDED |
TCRD-POL-350 |
Equipment provenance | Remark marker identifies generated shell. | Replace/augment with typed provenance in target; preserve marker during coexistence. | RECOMMENDED |
TCRD-POL-360 |
Child transaction model | Current create/cancel are local transactions but child owners are broad. | Retain one transaction only while all child repositories share MySQL and owner invariants; otherwise use durable workflow. | BLOCKING |
TCRD-POL-370 |
AI extraction | Proposal only. | Require human-reviewed source fields and explicit Booking selection. | RECOMMENDED |
TCRD-POL-380 |
Common time/Gross=Net transforms | Current orchestration applies transforms. | Expose as explicit reviewed transformations or remove by accepted policy. | OPEN |
TCRD-POL-390 |
Balance parity | Lot resync can disagree with allocation. | Job completion requires exact Lot/Allocation balance readback. | BLOCKING |
TCRD-POL-400 |
Cancel eligibility | Progressed child evidence blocks cancel. | Define child-specific blockers and compensation; no general delete. | BLOCKING |
TCRD-POL-410 |
Cancel residuals | Booking pointer/markers can remain. | Return residual manifest and require zero/accepted residual disposition. | RECOMMENDED |
TCRD-POL-420 |
Unknown Create/Cancel | Blind retry can duplicate/compensate twice. | Query by Job/request identity before any retry. | BLOCKING |
TCRD-POL-430 |
AI/provider worker | AI is proposal, not durable effect. | Keep outside business transaction; no worker needed for synchronous local child create. | RECOMMENDED |
4. Outbound Cost Policies¶
| ID | Decision | Current fact | Recommendation | Status |
|---|---|---|---|---|
TCRD-POL-510 |
Cost ownership discriminator | Any order-linked AP can match. | Add or derive a stable typed Outbound Cost discriminator before automatic selection. | BLOCKING |
TCRD-POL-520 |
Number of cost rows | Multiple AP rows can exist; UI shows/selects one. | Product/accounting decides one active cost versus multiple typed components. | BLOCKING |
TCRD-POL-530 |
No-ID save | Current latest AP fallback. | Target requires explicit new command or exact transaction ID; no latest fallback. | RECOMMENDED |
TCRD-POL-540 |
Mutable statuses | CREATED/OPEN/DRAFT currently mutable. | Confirm allowed statuses and correction path after CONFIRMED/CLOSED. | BLOCKING |
TCRD-POL-550 |
Update model | Current replace-all lines. | Preserve only if full line set/version is explicit; otherwise stable line commands. | OPEN |
TCRD-POL-560 |
Header preservation | UI can omit metadata that helper defaults. | Commands use patch semantics or complete typed DTO; omitted fields never clear implicitly. | RECOMMENDED |
TCRD-POL-570 |
Amount derivation | blank amount => quantity × rate; zero lines skipped. | Define decimal/rounding and explicit/derived amount source. | BLOCKING |
TCRD-POL-580 |
File dependency | Files are separate. | Cost delete never deletes shared file objects; return file-link warning. | RECOMMENDED |
TCRD-POL-590 |
Trade projection | Mutable AP can affect Trade. | Trade source policy must classify mutable cost separately. | BLOCKING |
TCRD-POL-600 |
Optimistic concurrency | none. | Expected version/status required for update/delete. | RECOMMENDED |
TCRD-POL-610 |
Correction history | no dedicated cost correction history. | Decide whether audit/transition evidence is sufficient or explicit correction entity is required. | OPEN |
5. Packing Rate Policies¶
| ID | Decision | Current fact | Recommendation | Status |
|---|---|---|---|---|
TCRD-POL-710 |
Rate authority | T_LOAD_ITEM.RATE. |
Keep source-item authority; output does not own rate. | RECOMMENDED |
TCRD-POL-720 |
Valid range | zero/negative currently possible. | Accounting/Product defines range and UOM/base semantics. | BLOCKING |
TCRD-POL-730 |
Batch semantics | valid IDs update; invalid IDs silently skip. | Use all-or-nothing or explicit per-item results; silent skip prohibited. | BLOCKING |
TCRD-POL-740 |
Expected value/version | none. | Require expected prior rate or row version. | RECOMMENDED |
TCRD-POL-750 |
Correction reason/history | none. | Define reason/audit requirement, especially after external use. | OPEN |
TCRD-POL-760 |
Autosave | blur triggers hidden write. | Target UI uses explicit Save or unmistakable pending/success/readback state. | RECOMMENDED |
TCRD-POL-770 |
Print while pending | current race possible. | Block/warn until exact server reread. | RECOMMENDED |
TCRD-POL-780 |
Amount field | transient only. | Label as calculated/transient; never imply persistence. | RECOMMENDED |
6. Document Projection Policies¶
| ID | Decision | Current fact | Recommendation | Status |
|---|---|---|---|---|
TCRD-POL-810 |
Document state | current outputs are transient. | Keep read-only in initial migration; do not invent durable state. | RECOMMENDED |
TCRD-POL-820 |
Durable snapshot | none. | Separate Product decision based on legal/operational need. | OPEN |
TCRD-POL-830 |
Print acknowledgement | none. | Keep human custody unless explicit printer/delivery integration is accepted. | RECOMMENDED |
TCRD-POL-840 |
Template version | not explicit. | Version target templates and return template version. | RECOMMENDED |
TCRD-POL-850 |
Source fingerprint | not persisted. | Return source fingerprint and rendered time. | RECOMMENDED |
TCRD-POL-860 |
Fixed Packing terms/ports/currency | current constants. | Move to accepted profile/config/template policy. | BLOCKING |
TCRD-POL-870 |
Packing fallback | whole output can fallback. | Define per-container/row source policy and display warnings. | BLOCKING |
TCRD-POL-880 |
Purchase invoice formulas | current UOM formulas and fallback. | Accounting approves UOM, decimal, rounding and unknown-UOM behavior. | BLOCKING |
TCRD-POL-890 |
Booking Confirmation title/content | menu/body/source semantics differ. | Approve title, source precedence, fixed text, ignored fields and branding. | BLOCKING |
TCRD-POL-900 |
Sales Weight Ticket authority | order-derived, not physical Scale. | Keep clearly labeled; define final weight/UOM authority. | BLOCKING |
TCRD-POL-910 |
Mixed UOM | current raw sums can occur. | Block or convert with accepted versioned conversion policy. | BLOCKING |
TCRD-POL-920 |
Direct-page access | guards differ by page/API. | Require auth + semantic capability + tenant + record + feature policy. | BLOCKING |
TCRD-POL-930 |
Files/email/provider | none in current MK output core. | Add only as separate accepted capability with independent state/idempotency. | DEFERRED |
TCRD-POL-940 |
Stable Wiki topic | current topics already exist. | Keep slugs stable while current routes become React/Next.js. | RECOMMENDED |
7. Current Compatibility Dispositions¶
| Compatibility | Disposition |
|---|---|
CLIENT_ID === 2 in report helper |
CURRENT COMPATIBILITY ONLY; replace with profile/config field contract |
| Export generated markers in remarks | preserve during coexistence, replace/augment with typed provenance |
| Trade page/API module-key split | characterize and converge to semantic capability |
| latest order-linked AP fallback | do not copy; require explicit target |
| rate silent skip | do not copy; explicit per-item or all-or-nothing |
| direct PHP output URLs | preserve with compatibility route until stable Wiki/replacement/caller-zero |
| browser print | preserve as nondurable presentation unless Product accepts more |
8. Activation Gates¶
Trade read migration¶
Requires:
TCRD-POL-120through210accepted or explicitly bounded;- source breakdown and deleted/ambiguous handling;
- page/API role parity;
- read and CSV parity scenarios.
Packing Rate write migration¶
Requires:
TCRD-POL-720through770;- per-item DTO/errors/readback;
- expected-value concurrency;
- print-pending behavior;
- one-writer/rollback.
Outbound Cost write migration¶
Requires:
TCRD-POL-510through610;- typed ownership;
- full header/line preservation;
- status/version policy;
- files/sibling AP readback;
- one-writer/rollback.
Export Brokerage write migration¶
Requires:
TCRD-POL-310through430;- durable Job/request/manifest;
- supported shape;
- child ownership and balance parity;
- cancellation/unknown recovery;
- one-writer/rollback.
Document read migration¶
Requires:
- access parity;
- source/template/fallback policy for selected document;
- explicit nondurable result;
- browser parity and stable Wiki link.
Durable snapshot/delivery remains separate.
9. Stop Conditions¶
Stop when:
- Trade derived labels are being treated as saved workflow state;
- a source class is omitted from explainability;
- Export provenance is inferred from reference alone;
- a Job/request identity is missing for a new writer;
- latest AP is chosen as Cost owner;
- omitted Cost header/lines can be destroyed;
- rate correction silently skips items;
- print can proceed while persisted rate is unknown;
- fixed document text or fallback is being accepted without owner decision;
- output render is being turned into durable completion implicitly;
- direct page/API access differs and no role evidence exists;
- target code introduces numeric Client/customer branching.
Record the exact policy ID, owner and required evidence.
---¶
Source:
docs/processes/MK_TRADE_COST_RATE_DOCUMENT_OUTPUTS_POLICY_DECISION_MATRIX.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.