Source code for cadrumo.application.wizard.results
"""Typed ``--json`` results for setup-wizard success emitters.These two classes are the actual runtime payload the wizard's successemitters build and validate (see:mod:`application.wizard.commands`). Each is a strict:class:`~cadrumo.core.json_contract.OutputSchema` subclass at its true owner —the wizard, not the CLI transport — because the CLI package sits above:mod:`application.wizard` in the accepted hexagonal direction and the wizardcannot reach back up into an ``entrypoints.cli`` payload module for a classto construct.Before this module existed, ``entrypoints.cli.config_payloads`` carried asame-shaped pair of classes purely to satisfy the CLI-leaf-has-a-registered-schema conformance gate; nothing ever imported or constructed them, and thewizard emitted an untyped ``dict`` instead. A field drifting between the twotherefore failed silently. Constructing :class:`ConfigProfileCreateResult` /:class:`ConfigProfileEditResult` now IS the strict validation, enforced atevery emit rather than only by a structural CLI-tree-vs-registry test."""from__future__importannotationsfromenumimportStrEnumfrom...core.json_contractimportOutputSchema__all__=["ConfigProfileCreateResult","ConfigProfileEditResult","ProfileWizardStatus"]
[docs]classProfileWizardStatus(StrEnum):"""Closed outcome vocabulary for the profile create / edit envelopes. ``status`` is a machine-readable contract token, not display prose. The interactive wizard resolved it through the active locale while the profile-manager close path wrote literal English, so the two commands emitted the same envelope shape with different ``status`` values for any non-English operator -- an automation branch on ``status`` was correct in exactly one locale. The localized verb belongs on the envelope's text lines and notices, which is where both surfaces already render it. """CREATED="created"UPDATED="updated"#: The command was accepted and published nothing: every supplied value#: already matched the stored record. Distinct from ``UPDATED`` because an#: automation branching on the outcome must be able to tell a real write#: from a request that changed nothing -- reporting both as ``updated``#: claimed a revision the record never gained.UNCHANGED="unchanged"ABANDONED="abandoned"
[docs]classConfigProfileCreateResult(OutputSchema):"""JSON envelope for the profile-creation command. The successful create payload carries the active profile label. Any forward guidance belongs to a typed envelope notice, never a bespoke ``next`` field or an executable text recommendation. """profile_name:strstatus:ProfileWizardStatusactive_profile:str|None=None
[docs]classConfigProfileEditResult(OutputSchema):"""JSON envelope for ``aeat config profile edit``. The post-edit next-step hint is surfaced on the envelope ``notices`` channel, not as a bespoke ``next`` field. The payload reports only the edited profile name and mutation status; edited facts remain in secure profile storage. """profile_name:strstatus:ProfileWizardStatus