Rebuild Plan
Immediate goals
- Keep a clean, canonical inventory of the replication server
- Map which schemas and tables drive reports, menus, and selectors
- Surface that map in a local UI so we can browse it quickly
- Capture enough logic to rebuild menus and report flows in a modern frontend
- Move from report preview to a usable report runner
Current approach
1. Snapshot first
Use a read-only snapshot step to pull current metadata into data/snapshot.json.
This gives us:
- a stable review artifact
- something we can diff over time
- a source for the local UI when live credentials are not set
2. Drill into representative screens
Good starting programs:
ZZMENU_MANZZENQDEBTOR_MANABSA_BUYER_MANACTIVE_CS_BUYERS
Why these:
- they cover menus, reports, maintenance screens, selectors, and embedded runtime logic
3. Trace menu execution paths
For each sample menu row in ZM_MENU, we need to determine:
- what
ZM_TYPEmeans - whether
ZM_PGMmaps directly to a report key, a screen key, or a wrapper action - how
ZM_PGMBEFOREandZM_PGMAFTERare used - how
ZM_ZCintersects withZC_SEC_GROUP
4. Trace report execution paths
For each sample report definition in ZE_ENQ, we need to determine:
- how the frontend selects a report
- where runtime parameters are gathered
- how selector definitions in
ZS_SELare injected into the flow - which
ZP_PGMSor menu items launch the report
5. Build the report-runner phase
The simulator now proves that we can:
- resolve a menu row to a report key
- load
ZE_ENQ - build preview SQL
- query the replicated data schema
The next step is to turn that into a structured report runner with prompt handling, query planning, and better execution fidelity.
See report-runner-phase for the detailed roadmap and Mermaid diagrams.
Concrete next tasks
- Extend the UI with search by menu group and security code
- Add a route that compares
ZM_MENU.ZM_PGMagainstZP_PGMS.ZP_PROGRAMandZE_ENQ.ZE_KEY - Decode a few
ZX_CODEtoken families: -$SELECT-$CALCULATE-$VALIDATE-F:-S:-O: - Build a cross-reference document for: - menu item -> program - menu item -> report - program -> selectors - report -> base tables
- Add a query-plan layer between
ZE_ENQmetadata and live SQL execution - Support
ZE_ORDERin the preview and runner compiler - Document three representative report-launch chains end to end