# Contract reference

## Recover saved work

Open **Settings → Storage** to download a verified backup of saved projects, source files, installed machines/posts and retained revisions. Unsaved edits are excluded. Backup remains available while an editor is open. Restore, cleanup and location switching require finishing the current operation and returning to the dashboard; disabled controls explain the exact reason.

If a verified backup fails, choose **Capture and download recovery export** below. It captures readable originals with explicit omissions without requiring folder access. Keep the download. Do not clear site data or remove referenced/retained files to make an export work. Browsers without a directory picker can continue using browser storage and these download paths.

Use these downloadable contracts when preparing JSON for the [Package workbench](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/tools/index.md). The files describe the exact structures and behavior accepted by the hosted app.

## Authoring

- [Normative package specification](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/SPEC.md)
- [Agent instructions](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/AGENTS.md)
- [Input and completion checklist](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/AUTHORING_TASK.md)
- [Readable contract versions and fixture IDs](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/compatibility.json)
- [Minimal post example](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/examples/minimal.wireedm-post.json)

## Schemas

- [Built machine-package document](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/schema/machine-package.schema.json)
- [Physical machine and exact setups](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/schema/machine-definition.schema.json)
- [Post manifest, dialect, evidence and fixtures](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/schema/post-package.schema.json)

## Runtime and verification

- [Guest SDK and all event payloads](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/sdk/wire-edm-post-sdk.d.ts)
- [Diagnostic codes and resource limits](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/sdk/event-diagnostic-catalog.json)
- [Canonical execution-plan fixtures](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/post-authoring/v1/sdk/canonical-plan-fixtures.json)

## UPID

- [UPID v2 intent additions](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/upid/v2/README.md)
- [Base geometry and portable document contract](https://insignifi4nt.github.io/wireedm-gcode-parser/documentation/reference/docs/upid/v1/README.md)

UPID is this project's published controller-neutral format. Posts consume the compiled execution plan, not raw drawing entities. Read only the geometry details needed to understand event payloads; the application owns planning.

## Inspect controller output

Use **Start Work → Inspect G-code** for a standalone file or pasted program. It reads UTF-8/ASCII text without creating a project or requesting folder access. Source lines keep their order, block numbers, comments, wrappers and line endings. Search text, filter command occurrences, jump to a source line, or select a path in the XY preview to locate its source. Line details show the supported modal state before and after the block; **Issues** and **Commands** explain what is recognized and what is omitted.

**Preview**, **Line**, **Commands**, **Issues**, and **Context** each use the full companion pane beside the source. On small screens, choose **Code** to return to the source. Selecting a command or issue reveals its source line. Each active pane scrolls independently; the view controls and source paging stay visible.

For an unrelated program, open **Context > Preview settings** and choose its initial units and coordinate/arc-center assumptions explicitly when the source does not declare them. A generic command label is not a controller-specific guarantee. Unknown commands, macros, non-XY behavior and compensation may limit the preview. Inspection accepts up to 2 MiB / 50,000 lines; large previews explicitly report their display limit. It does not evaluate controller execution or approve a program for machining.

**Open Machine Program** remains the editable import workflow, including its existing cleanup. Its **Lines**, **Text**, **Summary**, and **Points** tabs give grouped operations, full-program editing, statistics/issues, and construction points a full-height workspace. Resize the divider beside the preview on desktop; use **Code / Preview** on small screens. Switching views preserves the current draft. From that editor, **Inspect** reviews the current draft without saving or normalizing it. Use the UPID editor for geometry and machining-intent changes.

After generating a controller artifact, choose **Inspect G-code** to review its original source lines, nominal XY preview, command coverage and modal state. **Context** shows the saved revision, exact post/version/hash, physical machine and setup identity. The inspector uses the matching saved post's declared command semantics and arc-center properties; controller compensation is shown as an annotation and does not offset the preview. Unsupported dialect geometry reports limited coverage.

From a project's **Saved revisions**, choose **Inspect controller file** to reproduce and inspect that revision with its own post and machine snapshots. Changing the currently installed setup does not change the saved revision's inspection context. Inspection does not save a new revision, import a machine program, normalize output or alter the UPID draft. **Download exact file** retains the original artifact's line endings, numbering and wrappers. Close inspection to return to the export or revisions dialog.
