Views
No views yet
Qwen2.5-Coder-7B-Instruct that converts natural language table descriptions into structured MagentoSchemaSpec JSON — which is then deterministically compiled into a complete Magento 2 module (40+ files).db_schema.xml + db_schema_whitelist.jsonwebapi.xml)registration.php, module.xml, composer.json, di.xmlNL: "Create a warranty table with serial number, dates, status, FK to products and customers"
↓ LLM (this adapter, per-entity)
Table spec JSON (columns, types, FKs, indexes, constraints)
↓ Spec Compiler (validates, <1ms)
↓ Module Generator (deterministic, no LLM)
40 files → 23/23 PHP valid, 0 hallucinationsCreate a Magento 2 table 'acme_warranty_warranty' for Product Warranty Registration.
Fields: product_id (unsigned int, required) references catalog_product_entity.entity_id
with CASCADE delete; customer_id (unsigned int, nullable) references customer_entity.entity_id
with SET NULL delete; purchase_date (date, required); warranty_start (date, required);
warranty_end (date, required); serial_number (varchar 64, required, unique);
status (varchar 32, default 'active'). Track creation and update timestamps.
Index on product_id, customer_id, and status.1{
2 "name": "acme_warranty_warranty",
3 "comment": "Product Warranty Registration",
4 "columns": [
5 {"name": "warranty_id", "type": "int", "unsigned": true, "identity": true, "nullable": false, "comment": "Warranty ID"},
6 {"name": "product_id", "type": "int", "unsigned": true, "nullable": false, "comment": "Product ID"},
7 {"name": "customer_id", "type": "int", "unsigned": true, "nullable": true, "comment": "Customer ID"},
8 {"name": "purchase_date", "type": "date", "nullable": false, "comment": "Purchase Date"},
9 {"name": "warranty_start", "type": "date", "nullable": false, "comment": "Warranty Start Date"},
10 {"name": "warranty_end", "type": "date", "nullable": false, "comment": "Warranty End Date"},
11 {"name": "serial_number", "type": "varchar", "length": 64, "nullable": false, "comment": "Serial Number"},
12 {"name": "status", "type": "varchar", "length": 32, "default": "active", "comment": "Status"},
13 {"name": "created_at", "type": "timestamp", "nullable": false, "comment": "Created At"},
14 {"name": "updated_at", "type": "timestamp", "nullable": false, "on_update": true, "comment": "Updated At"}
15 ],
16 "primary_key": ["warranty_id"],
17 "unique_keys": [{"name": "ACME_WARRANTY_SERIAL_NUMBER", "columns": ["serial_number"]}],
18 "foreign_keys": [
19 {"column": "product_id", "reference_table": "catalog_product_entity", "reference_column": "entity_id", "on_delete": "CASCADE"},
20 {"column": "customer_id", "reference_table": "customer_entity", "reference_column": "entity_id", "on_delete": "SET NULL"}
21 ],
22 "indexes": [
23 {"name": "ACME_WARRANTY_WARRANTY_PRODUCT_ID", "columns": ["product_id"], "type": "btree"},
24 {"name": "ACME_WARRANTY_WARRANTY_STATUS", "columns": ["status"], "type": "btree"}
25 ]
26}| Source | Tables | Method |
|---|---|---|
| Magento 2.4.8 core modules | 142 | Reverse-engineered from real db_schema.xml |
| Hand-crafted custom modules | 35 | Blog, FAQ, Q&A, Events, Loyalty, Store Locator, etc. |
| Total | 177 (164 after token filtering) |
| Metric | Result |
|---|---|
| Tables generated | 2 (warranty + claims) |
| Columns | 17 (all requested fields present) |
| Foreign keys | 3 (product, customer, warranty→claim) |
| Unique constraints | 1 (serial_number) |
| Indexes | 5 |
| Full module files | 40 |
| PHP syntax valid | 23/23 (100%) |
| Manual fixes | 0 |
Acme_Warranty/
├── registration.php
├── composer.json
├── etc/
│ ├── module.xml
│ ├── db_schema.xml
│ ├── db_schema_whitelist.json
│ ├── di.xml
│ ├── webapi.xml
│ ├── acl.xml
│ └── adminhtml/
│ ├── routes.xml
│ └── menu.xml
├── Api/
│ ├── Data/
│ │ ├── WarrantyInterface.php
│ │ └── ClaimInterface.php
│ ├── WarrantyRepositoryInterface.php
│ └── ClaimRepositoryInterface.php
├── Model/
│ ├── Warranty.php
│ ├── WarrantyRepository.php
│ ├── Claim.php
│ ├── ClaimRepository.php
│ └── ResourceModel/
│ ├── Warranty.php
│ ├── Warranty/Collection.php
│ ├── Claim.php
│ └── Claim/Collection.php
├── Controller/Adminhtml/
│ ├── Warranty/ (Index, Edit, Save, Delete, NewAction)
│ └── Claim/ (Index, Edit, Save, Delete, NewAction)
└── view/adminhtml/
├── layout/ (4 files)
└── ui_component/ (4 files: grid + form per entity)