Reference

Windows Runtime

Windows exposes important configuration through system APIs and utilities: display modes, audio endpoints, power settings, devices, and other system state. Pinman organizes this state under the winrt: realm so it can be tracked, captured, compared, and—where a safe write path exists—changed through a Profile.

The winrt: realm covers this whole Windows settings model. Pinman uses the appropriate Windows or vendor interface for each setting and presents the result through one consistent tree.

The winrt: tree#

A Windows Runtime location begins with a functional category:

winrt:/Sound/Master/Volume
winrt:/Display/Monitors/~DEL40A9.1/RefreshRate
winrt:/Power/USB/SelectiveSuspend

The first path level is one of Pinman's Windows categories:

CategoryExamples of the state it contains
AboutWindows and hardware information
AccessibilityAccessibility preferences
DisplayDisplay configuration and monitors
GamingWindows gaming settings
GPUGraphics adapters and driver settings
InputKeyboard, mouse, and input preferences
MonitoringCurrent resource and performance readings
NetworkNetwork adapters and connection state
PersonalizationDesktop and appearance settings
PowerPower plans and device power management
SecurityWindows security settings
ServicesWindows service configuration and status
SoundMaster audio and audio devices
StartupWindows startup configuration

The settings available on a particular machine depend on its version of Windows, installed devices, drivers, and vendor software.

Itemtypes#

The winrt: tree uses five itemtypes:

ItemtypeRepresentsMay contain
winrt_rootThe root of the Windows Runtime realmSections and tables
winrt_sectionA named category or groupSections, tables, and properties
winrt_tableA dynamic collection, such as monitors or audio devicesRows
winrt_rowOne member of a tableProperties
winrt_propertyOne Windows valueNothing; it is a leaf Item

This Schema fragment tracks the master volume and the volume of every audio device Pinman discovers:

items:
  - itemtype: winrt_root
    items:
      - selector: Sound
        itemtype: winrt_section
        items:
          - selector: Master
            itemtype: winrt_section
            items:
              - selector: Volume
                itemtype: winrt_property
          - selector: Devices
            itemtype: winrt_table
            items:
              - selector: "{{DeviceId}}"
                itemtype: winrt_row
                items:
                  - selector: Volume
                    itemtype: winrt_property

The exact device IDs are filled in during a scan. Each resulting property has a stable location below winrt:/Sound/Devices/.

See Schema Items for the Item model and the general rules for locations, selectors, and dynamic children.

Reading Windows state#

When you Refresh or create a Capture, Pinman reads Windows through several system interfaces and normalizes the result into the winrt: tree. A single read can include ordinary scalar properties, nested sections, and rows found in dynamic tables.

Scope determines how much of that tree Pinman reads:

ScopeWindows Runtime work
Tracked-onlyReads the categories needed by the Schema, then keeps the tracked paths within them.
Discover untrackedReads all Windows Runtime categories and makes the broader tree available to explore.

Tracked-only is usually faster. Discovery does more work and may take longer, especially for categories that enumerate devices, services, or vendor data.

Each category carries the time it was read. This lets Pinman report the freshness of one part of the Machine independently from another. Pinman also preserves a read failure from Windows, a driver, or a vendor API as its own result, distinct from an absent Item.

For the relationship between Scope, Capture coverage, and comparison detail, see Captures.

The property catalog#

The extracted Windows data supplies the values. The Windows Runtime property catalog supplies the metadata that gives those values their meaning in Pinman. It describes known properties and dynamic tables, including:

  • data type, units, label, and description;
  • read and write behavior;
  • presentation metadata for controls and values;
  • the source or write mechanism used by the Windows adapter;
  • stable row identities and reader-facing labels for tables; and
  • related software and optional guidance metadata.

When a winrt_property is imported or discovered, catalog metadata supplies each field left open by the Schema. Explicit Schema fields take precedence.

Catalog fields#

These are the principal fields used by a property entry in winrt_catalog.json:

FieldMeaning
categoryTop-level functional group, such as Display or Power
subcategoryNested path below the category, when needed
propertyProperty name within that category and subcategory
data_typeType used while extracting the Windows value
io_modeWhether the property is read-write, read-only, or ephemeral
persistentWhether the setting normally survives a restart
unitsUnits such as %, Hz, pixels, or ms
label, descriptionReader-facing name and explanation
display_formatPresentation rule for the value
sourceWindows interface used to read the value
writable_viaDirect-write mechanism, when one is available
software_refsSoftware associated with the property
instructions_templateOptional source material for an authored guided action
widget, min, max, step, choicesUI control metadata

The catalog may use extraction-specific data_type values. When Pinman adds the property to the Schema, it maps that type to the Schema's datatype: string, int, float, or bool.

Catalog priority#

Pinman searches for winrt_catalog.json in this order:

  1. the active Project's reference/ directory;
  2. the reference/ directories of adopted Kits, in Project order; and
  3. the Windows platform baseline shipped with Pinman.

The first file found supplies the entire catalog. Project and Kit files are complete alternatives to the platform file, so an override needs to contain every baseline entry it still requires.

Most Kits should declare Windows Runtime Items and their authoring metadata in Schema YAML. Replacing the platform catalog is intended for a complete catalog override.

Property behavior#

Reading, comparing, and writing are separate capabilities. The catalog's io_mode gives each property one of these behaviors:

io_modeCompare in CapturesChange directlyPersists as configuration
read-writeYesYesYes
read-onlyYesNoYes
ephemeralNoNoNo

A read-write property has a supported write route, such as a Windows system API, audio interface, display interface, or vendor API. Profile Preview and Apply use the same write gates and verification flow as other Pinman realms.

A read-only property records persistent state for tracking and comparison. Pinman leaves changes to that property outside direct Profile Apply.

An ephemeral property is a live reading rather than saved configuration—for example, a current utilization or status value. A Profile Script can inspect it with p.read(); Captures leave it out of persistent comparisons.

Guided changes are authored explicitly in a Profile Script with p.guided(). Catalog fields such as software_refs and instructions_template can supply context for that action. The p.guided() declaration creates the guided workflow.

Dynamic tables#

Windows frequently reports a collection rather than one fixed setting: monitors, audio endpoints, graphics adapters, services, or USB devices. Pinman represents each collection as a winrt_table containing winrt_row Items.

The catalog defines how a table derives its row ID and which property supplies its display label. For example, a monitor may have a location based on its device identity while the UI shows its familiar monitor name.

Stable IDs keep a row's Pinman location consistent when a friendly name changes or two devices share the same label. Schema and Profile declarations should use the location shown by Pinman rather than constructing one from a display label.

Registry-backed Windows settings#

Some Windows settings are ultimately read from or written to the Registry. They still belong under winrt: when Pinman presents them as part of a functional Windows model, such as Display, Input, or Personalization. This keeps the setting's location stable and lets its adapter supply the right type, behavior, and UI metadata.

Use winreg: when the Registry key or value is itself the thing you need to track, particularly for application-specific configuration. See Windows Registry for that realm.

Authoring Windows Runtime Items#

When adding winrt: Items to a Schema:

  1. Start with a winrt_root and the canonical category name.
  2. Follow the extracted tree with winrt_section, winrt_table, and winrt_row Items as needed.
  3. End each tracked value with a winrt_property.
  4. Use the table's stable row binding for dynamic devices or services.
  5. Declare property metadata only when the Schema should override or supplement the platform catalog.

Validate the YAML before importing it:

pinman schema validate schema.yaml

Then import the Schema and scan the affected branch to confirm that the locations and dynamic rows match the target machine. Schema format and Schema property fields document the shared authoring syntax.

Diagnostic commands#

Capture and Refresh perform Windows Runtime extraction as part of their normal work. The pinman winrt commands expose the same lower-level data for catalog development and troubleshooting.

Extract every category:

pinman winrt extract

Limit the extraction to Schema-tracked paths or to one category:

pinman winrt extract --tracked-only
pinman winrt extract --category Display

Compare two extracted JSON files, or compare one with a fresh read of the Machine:

pinman winrt diff older.json newer.json
pinman winrt diff saved.json --live

These commands work with the extraction files directly. Use Captures and the Explore page for Pinman's normal Source-and-Reference comparison workflow.