graflo.architecture.profile.model¶
The conformance report, and the waiver document that can excuse part of it.
One report model serves all three surfaces a profile check is reachable from --
the graflo check CLI, a pack pre-flight check, and an HTTP route. Keeping
them on one model is what stops the three drifting into three vocabularies for
the same finding; :meth:ProfileReport.to_lines is the single text renderer,
and a caller wanting only the failures asks for :meth:ProfileReport.errors.
Waivers live in their own document rather than on the manifest. A waiver is a statement by an operator about a deployment ("this model has no time axis and that is deliberate"), not a property of the world model, and putting it on the contract would make two manifests that describe the same world compare unequal. The cost is stated plainly and is real: a waiver travels out of band, so a registry cannot see one, and it is not covered by the manifest's content address.
Attributes¶
Severity = Literal['error', 'warning', 'info']
module-attribute
¶
Status = Literal['pass', 'fail', 'warn', 'waived', 'not_applicable']
module-attribute
¶
__all__ = ['AssertionResult', 'Finding', 'ProfileReport', 'ProfileWaivers', 'Severity', 'Status', 'Waiver', 'roll_up']
module-attribute
¶
Classes¶
AssertionResult
¶
Bases: ConfigBaseModel
One assertion's outcome over the whole manifest.
Source code in graflo/architecture/profile/model.py
Attributes¶
checked = PydanticField(default=0, description='Elements examined. Zero means the assertion had nothing to say about this manifest, which is reported as ``not_applicable`` rather than as a pass.')
class-attribute
instance-attribute
¶
findings = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
id = PydanticField(...)
class-attribute
instance-attribute
¶
required = PydanticField(default=True)
class-attribute
instance-attribute
¶
status = PydanticField(...)
class-attribute
instance-attribute
¶
title = PydanticField(...)
class-attribute
instance-attribute
¶
waiver = PydanticField(default=None)
class-attribute
instance-attribute
¶
Finding
¶
Bases: ConfigBaseModel
One assertion's verdict about one element.
Source code in graflo/architecture/profile/model.py
Attributes¶
assertion = PydanticField(...)
class-attribute
instance-attribute
¶
detail = PydanticField(default_factory=dict, description='Machine payload -- the IRI, the unit token, the identity mode.')
class-attribute
instance-attribute
¶
message = PydanticField(..., description='One line, already readable without the detail payload.')
class-attribute
instance-attribute
¶
severity = PydanticField(...)
class-attribute
instance-attribute
¶
status = PydanticField(...)
class-attribute
instance-attribute
¶
target = PydanticField(default=None, description='The element this is about, in a stable address form: ``vertex:Observation``, ``vertex:Observation.result_value``, ``edge:Observation-hasFeatureOfInterest->Asset``, or ``manifest``.')
class-attribute
instance-attribute
¶
ProfileReport
¶
Bases: ConfigBaseModel
The result of checking one manifest against one named profile.
Source code in graflo/architecture/profile/model.py
Attributes¶
assertions = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
graflo_version = PydanticField(default=None)
class-attribute
instance-attribute
¶
manifest_hash = PydanticField(default=None, description='Content address of the manifest checked, so a stored report can be matched back to the artifact that produced it.')
class-attribute
instance-attribute
¶
ok
property
¶
No error-severity finding survived waivers.
profile = PydanticField(...)
class-attribute
instance-attribute
¶
profile_version = PydanticField(...)
class-attribute
instance-attribute
¶
status = PydanticField(...)
class-attribute
instance-attribute
¶
subject = PydanticField(default=None, description='What was checked -- a path, or ``uuid@version``. Set by the caller.')
class-attribute
instance-attribute
¶
Methods:¶
errors()
¶
Every finding that makes the manifest non-conformant.
Source code in graflo/architecture/profile/model.py
to_lines()
¶
The report as text. The one renderer -- every surface calls this.
Source code in graflo/architecture/profile/model.py
warnings()
¶
Every advisory finding, waived assertions included.
ProfileWaivers
¶
Bases: ConfigBaseModel
A sidecar document of waivers granted against one profile.
Source code in graflo/architecture/profile/model.py
Attributes¶
profile = PydanticField(default='world-model')
class-attribute
instance-attribute
¶
subject = PydanticField(default=None, description='What these waivers were granted against -- a manifest name or content hash. Advisory: nothing enforces the match.')
class-attribute
instance-attribute
¶
waivers = PydanticField(default_factory=list)
class-attribute
instance-attribute
¶
Methods:¶
for_assertion(assertion_id)
¶
The waiver covering assertion_id, or None.
Waiver
¶
Bases: ConfigBaseModel
An operator's decision to excuse one assertion, with its reason.
Source code in graflo/architecture/profile/model.py
Attributes¶
assertion = PydanticField(..., description='Identifier of the assertion this waiver excuses, e.g. ``temporal``.')
class-attribute
instance-attribute
¶
expires = PydanticField(default=None)
class-attribute
instance-attribute
¶
granted_at = PydanticField(default=None)
class-attribute
instance-attribute
¶
granted_by = PydanticField(default=None)
class-attribute
instance-attribute
¶
reason = PydanticField(..., description='Why the assertion does not apply to this deployment. Required: a waiver without a reason is a silent pass with extra steps.')
class-attribute
instance-attribute
¶
Functions:¶
roll_up(statuses)
¶
The worst status in statuses; not_applicable when there are none.
Ordered fail > warn > waived > pass > not_applicable, so an assertion that
passed on nine elements and failed on one reports fail, and a report
with one waived assertion and the rest passing reports warn -- visible,
but not a failure.