2.4 KiB
Contract Alignment Gate
This file records the boundary between the parser task contract and the ERP-ready form contract. It is part of the design specification so the cloud prompt, Skill, business-system parser, and ERP preflight do not silently drift.
Current facts
standard_system_operation.schema.jsonusesadditionalProperties: falsefordataand now declaresdata.resolution.- The raw-instruction flow can create a task with product/date/passenger/room/price/user facts while leaving ERP-derived fields deferred.
tools/browser_order_add_raw_instruction_test.mjsconfirms the real ERP sequence: select a unique product, runFind_product/GetProduct, then validate derived trip, route, customer, currency, and route prefix.tools/browser_order_add_preflight.mjsstill requires the resolved ERP target fields before any submit path.chrome-extension/ltjt-order-assistant/operation-plans.jsreadsdata.order_modefor task summaries anddata.test_markerfor test-only create/batch safety gates.- The current local adapter adds
task_idandparser_prompt_versioninsideoperation.source, while the bundled schema only declaresinstruction_id,operator,received_at, andnotesthere. session_idis transport/session metadata and should remain outside the canonical operation.
Design decision
agent_parse_passed is a task-creation result, not an ERP-readiness result. For team create/batch, customer, route, trip, and order_number are optional Agent facts when data.resolution.deferred_fields records them. The ERP layer owns deterministic product-template resolution and exact lookup; it must not guess or use a closest match.
The current business-system runtime contract retains data.order_mode and data.test_marker, because dropping either can make a valid task unplannable or remove the test-save guard. The Agent/Skill must not invent any other compatibility fields.
Transport metadata such as task ID, session ID, and parser/Profile version belongs in the business task wrapper or parse-result metadata, not in the canonical operation data.
Remaining adapter note
The bundled parser schema now accepts task-ready team create/batch operations with deferred ERP fields. The ERP form mapping and browser preflight remain stricter and must resolve customer, route, trip, and order_number before any write. Do not weaken that execution gate or resolve unknown fields with arbitrary additional properties.