graflo.architecture.profile.world_model¶
The World Model Profile: six mechanically checkable assertions.
A named conformance level over a manifest. It introduces no semantics and touches no backend -- every assertion reads fields the contract already has -- so it is a profile rather than a feature, and it runs against manifests nobody here authored.
One distinction to keep straight. Assertion provenance is about the
data: does the model say where a fact came from. It is unrelated to
ManifestMetadata.provenance and schema/provenance.py::Provenance, which
are the artifact's content address and lineage. Conflating the two is the
mistake this docstring exists to prevent.
Attributes¶
PROFILE_VERSION = '0.1'
module-attribute
¶
WORLD_MODEL_PROFILE = Profile(name='world-model', version=PROFILE_VERSION, assertions=(Assertion(_A1, 'Types are grounded in an external vocabulary', True, check_grounded_types), Assertion(_A2, 'Every vertex declares an identity mode', True, check_declared_identity), Assertion(_A3, 'Every edge declares its directionality', True, check_declared_directionality), Assertion(_A4, 'Every measured property carries a unit', True, check_declared_units), Assertion(_A5, 'Temporal validity is declared or waived', True, check_temporal), Assertion(_A6, 'Provenance is expressible and attached', True, check_provenance)))
module-attribute
¶
__all__ = ['PROFILE_VERSION', 'WORLD_MODEL_PROFILE', 'check_declared_directionality', 'check_declared_identity', 'check_declared_units', 'check_grounded_types', 'check_provenance', 'check_temporal']
module-attribute
¶
Classes¶
Functions:¶
check_declared_directionality(context)
¶
Every edge states whether source-to-target order is meaningful.
Edge.directed defaults to True, so a declared direction and an
undeclared one are the same model. Only the authored document can tell them
apart.
Source code in graflo/architecture/profile/world_model.py
check_declared_identity(context)
¶
Every vertex states how it is identified, rather than falling back.
VertexConfig refuses a vertex with no identity unless
identity_from_all_properties is set, in which case it silently adopts
every property as the key. That fallback is the failure this looks for, and
it is only visible in the authored document.
Source code in graflo/architecture/profile/world_model.py
check_declared_units(context)
¶
Every measured property says what it is measured in.
Measured means a floating-point property that is not part of the key. It
passes either by carrying semantics.unit itself, or by its type
declaring a unit-valued companion property.
Source code in graflo/architecture/profile/world_model.py
check_grounded_types(context)
¶
Every vertex and edge names the concept it denotes, by IRI.
Source code in graflo/architecture/profile/world_model.py
check_provenance(context)
¶
The model says where a fact came from, and ingestion attaches it.
Two halves. The contract half asks whether the schema can express
provenance at all: an actor type, and an edge grounded in a
derivation or attribution property. The ingestion half asks whether a
resource that creates vertices actually writes one of those edges -- and is
reported not_applicable when the manifest declares no ingestion model,
rather than passing on a question it never asked.
Source code in graflo/architecture/profile/world_model.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
check_temporal(context)
¶
The model says when its facts were true, or an operator waives it.
Declared means at least one datetime property grounded in a validity or observation-time vocabulary -- time expressed as modelled state, which is what the contract can express today without a temporal primitive.
A waiver is applied by the runner, not here: this reports the finding, and an operator's sidecar decides whether it counts against the manifest.