Module: Causalontology
- Defined in:
- lib/causalontology/jcs.rb,
lib/causalontology.rb,
lib/causalontology/store.rb,
lib/causalontology/schema.rb,
lib/causalontology/ed25519.rb,
lib/causalontology/signing.rb,
lib/causalontology/canonical.rb,
lib/causalontology/semantics.rb
Overview
RFC 8785 (JSON Canonicalization Scheme) serialization.
Sorted keys (code-point order), minimal string escaping, ECMAScript-style
canonical numbers (1.0 -> "1", 0.7 stays "0.7", exponent "1e-7" not
"1e-07"). The number serialization implements the RFC 8785 rules for the
value ranges Causalontology uses (integers, integer-valued floats, and
short decimals); full ECMAScript exponent formatting for extreme
magnitudes is pinned at the 1.0.0 conformance freeze.
Ruby specifics relied on here: JSON.parse keeps the integer-versus-decimal
source distinction ("1" -> Integer, "1.0" -> Float), and Float#to_s prints
the shortest round-trip decimal with the same decimal/exponent thresholds
as Python's repr (1e16 and 1e-4), so only the exponent spelling needs
normalizing ("1.0e-07" -> "1e-7").
Defined Under Namespace
Modules: Canonical, Ed25519, Jcs, Schema, Semantics, Signing
Classes: InMemoryStore, RejectedWrite
Constant Summary
collapse
- VERSION =
specification 4.0.0 (attitude, predicted_occurrence, prediction_error)
"4.0.0"
- UNIT_SECONDS =
Rule 4's fixed unit-conversion constants, re-exported at the top level.
Semantics::UNIT_SECONDS
- CONTENT_KINDS =
Set.new(["occurrent", "causal_relation_object", "continuant",
"realizable", "stratum", "bridge",
"cross_stratal_seam", "port", "conduit",
"quality", "token_individual", "token_occurrence",
"state_assertion", "token_causal_claim",
"attitude", "predicted_occurrence",
"prediction_error"]).freeze
- RECORD_KINDS =
Set.new(["assertion", "enrichment", "retraction", "succession"]).freeze
Class Method Summary
collapse
-
.admissible(cro, elapsed_seconds) ⇒ Object
-
.bridge_closure(occurrent_id, bridges) ⇒ Object
-- 2.0.0 normative algorithms and rules (spec/semantics.md, Section 12) --.
-
.bridge_wellformed(bridge, occ_map, stratum_map) ⇒ Object
-
.canonicalize(obj, kind = nil) ⇒ Object
-- canonicalization and identity (spec/identity.md) ---------------------.
-
.classify_cro(cro, occ_map, stratum_map) ⇒ Object
-
.conduit_wellformed(conduit, port_map, cro_map = nil) ⇒ Object
-
.conflicts(a, b) ⇒ Object
-
.covering_law_mismatch(tcc, token_map, law) ⇒ Object
-
.delay_within_window(actual_delay, temporal) ⇒ Object
-
.endpoints_mixed(cro, occ_map) ⇒ Object
-
.has_cycle(edges) ⇒ Object
-
.hierarchy_consistent(parent, members, bridges = []) ⇒ Object
-
.identify(obj, kind = nil) ⇒ Object
-
.identity_bearing(obj, kind = nil) ⇒ Object
-
.infer_kind(obj) ⇒ Object
-
.is_partial(cro) ⇒ Object
-
.keypair_from_seed(seed32) ⇒ Object
-- provenance (spec/provenance.md) ---------------------------------------.
-
.prediction_pairing_mismatch(error, predicted, observed) ⇒ Object
-- 4.0.0 prediction-to-observation pairing (Rule 24) ---------------------.
-
.refinement_valid(child, parent) ⇒ Object
-
.retrocausal(tcc, token_map) ⇒ Object
-
.seam_home(seam, occ_map, stratum_map) ⇒ Object
-
.seam_wellformed(seam, occ_map, stratum_map) ⇒ Object
-- 3.0.0 cross-stratal seam (spec/semantics.md, Rule 22 / Algorithm F) ----.
-
.sign_record(record, secret, kind = nil) ⇒ Object
-
.skip_gaps(cro, classification) ⇒ Object
-
.state_gaps(state, quality) ⇒ Object
-
.to_seconds(duration, unit) ⇒ Object
-
.validate_schema(obj, kind = nil) ⇒ Object
-- validation (spec/schema/, spec/semantics.md) --------------------------.
-
.validate_semantics(obj, kind = nil) ⇒ Object
-
.verify_record(record, kind = nil) ⇒ Object
Class Method Details
.admissible(cro, elapsed_seconds) ⇒ Object
64
65
66
|
# File 'lib/causalontology.rb', line 64
def admissible(cro, elapsed_seconds)
Semantics.admissible(cro, elapsed_seconds)
end
|
.bridge_closure(occurrent_id, bridges) ⇒ Object
-- 2.0.0 normative algorithms and rules (spec/semantics.md, Section 12) --
82
83
84
|
# File 'lib/causalontology.rb', line 82
def bridge_closure(occurrent_id, bridges)
Semantics.bridge_closure(occurrent_id, bridges)
end
|
106
107
108
|
# File 'lib/causalontology.rb', line 106
def bridge_wellformed(bridge, occ_map, stratum_map)
Semantics.bridge_wellformed(bridge, occ_map, stratum_map)
end
|
.canonicalize(obj, kind = nil) ⇒ Object
-- canonicalization and identity (spec/identity.md) ---------------------
34
35
36
|
# File 'lib/causalontology.rb', line 34
def canonicalize(obj, kind = nil)
Canonical.canonicalize(obj, kind)
end
|
.classify_cro(cro, occ_map, stratum_map) ⇒ Object
86
87
88
|
# File 'lib/causalontology.rb', line 86
def classify_cro(cro, occ_map, stratum_map)
Semantics.classify_cro(cro, occ_map, stratum_map)
end
|
120
121
122
|
# File 'lib/causalontology.rb', line 120
def conduit_wellformed(conduit, port_map, cro_map = nil)
Semantics.conduit_wellformed(conduit, port_map, cro_map)
end
|
.conflicts(a, b) ⇒ Object
68
69
70
|
# File 'lib/causalontology.rb', line 68
def conflicts(a, b)
Semantics.conflicts(a, b)
end
|
.covering_law_mismatch(tcc, token_map, law) ⇒ Object
128
129
130
|
# File 'lib/causalontology.rb', line 128
def covering_law_mismatch(tcc, token_map, law)
Semantics.covering_law_mismatch(tcc, token_map, law)
end
|
.delay_within_window(actual_delay, temporal) ⇒ Object
102
103
104
|
# File 'lib/causalontology.rb', line 102
def delay_within_window(actual_delay, temporal)
Semantics.delay_within_window(actual_delay, temporal)
end
|
.endpoints_mixed(cro, occ_map) ⇒ Object
90
91
92
|
# File 'lib/causalontology.rb', line 90
def endpoints_mixed(cro, occ_map)
Semantics.endpoints_mixed(cro, occ_map)
end
|
.has_cycle(edges) ⇒ Object
142
143
144
|
# File 'lib/causalontology.rb', line 142
def has_cycle(edges)
Semantics.has_cycle(edges)
end
|
.hierarchy_consistent(parent, members, bridges = []) ⇒ Object
76
77
78
|
# File 'lib/causalontology.rb', line 76
def hierarchy_consistent(parent, members, bridges = [])
Semantics.hierarchy_consistent(parent, members, bridges)
end
|
.identify(obj, kind = nil) ⇒ Object
38
39
40
|
# File 'lib/causalontology.rb', line 38
def identify(obj, kind = nil)
Canonical.identify(obj, kind)
end
|
.identity_bearing(obj, kind = nil) ⇒ Object
42
43
44
|
# File 'lib/causalontology.rb', line 42
def identity_bearing(obj, kind = nil)
Canonical.identity_bearing(obj, kind)
end
|
.infer_kind(obj) ⇒ Object
46
47
48
|
# File 'lib/causalontology.rb', line 46
def infer_kind(obj)
Canonical.infer_kind(obj)
end
|
.is_partial(cro) ⇒ Object
60
61
62
|
# File 'lib/causalontology.rb', line 60
def is_partial(cro)
Semantics.is_partial(cro)
end
|
.keypair_from_seed(seed32) ⇒ Object
-- provenance (spec/provenance.md) ---------------------------------------
148
149
150
|
# File 'lib/causalontology.rb', line 148
def keypair_from_seed(seed32)
Signing.keypair_from_seed(seed32)
end
|
.prediction_pairing_mismatch(error, predicted, observed) ⇒ Object
-- 4.0.0 prediction-to-observation pairing (Rule 24) ---------------------
134
135
136
|
# File 'lib/causalontology.rb', line 134
def prediction_pairing_mismatch(error, predicted, observed)
Semantics.prediction_pairing_mismatch(error, predicted, observed)
end
|
.refinement_valid(child, parent) ⇒ Object
72
73
74
|
# File 'lib/causalontology.rb', line 72
def refinement_valid(child, parent)
Semantics.refinement_valid(child, parent)
end
|
.retrocausal(tcc, token_map) ⇒ Object
138
139
140
|
# File 'lib/causalontology.rb', line 138
def retrocausal(tcc, token_map)
Semantics.retrocausal(tcc, token_map)
end
|
.seam_home(seam, occ_map, stratum_map) ⇒ Object
116
117
118
|
# File 'lib/causalontology.rb', line 116
def seam_home(seam, occ_map, stratum_map)
Semantics.seam_home(seam, occ_map, stratum_map)
end
|
-- 3.0.0 cross-stratal seam (spec/semantics.md, Rule 22 / Algorithm F) ----
112
113
114
|
# File 'lib/causalontology.rb', line 112
def seam_wellformed(seam, occ_map, stratum_map)
Semantics.seam_wellformed(seam, occ_map, stratum_map)
end
|
.sign_record(record, secret, kind = nil) ⇒ Object
152
153
154
|
# File 'lib/causalontology.rb', line 152
def sign_record(record, secret, kind = nil)
Signing.sign_record(record, secret, kind)
end
|
.skip_gaps(cro, classification) ⇒ Object
94
95
96
|
# File 'lib/causalontology.rb', line 94
def skip_gaps(cro, classification)
Semantics.skip_gaps(cro, classification)
end
|
.state_gaps(state, quality) ⇒ Object
124
125
126
|
# File 'lib/causalontology.rb', line 124
def state_gaps(state, quality)
Semantics.state_gaps(state, quality)
end
|
.to_seconds(duration, unit) ⇒ Object
98
99
100
|
# File 'lib/causalontology.rb', line 98
def to_seconds(duration, unit)
Semantics.to_seconds(duration, unit)
end
|
.validate_schema(obj, kind = nil) ⇒ Object
-- validation (spec/schema/, spec/semantics.md) --------------------------
52
53
54
|
# File 'lib/causalontology.rb', line 52
def validate_schema(obj, kind = nil)
Schema.validate_schema(obj, kind)
end
|
.validate_semantics(obj, kind = nil) ⇒ Object
.verify_record(record, kind = nil) ⇒ Object
156
157
158
|
# File 'lib/causalontology.rb', line 156
def verify_record(record, kind = nil)
Signing.verify_record(record, kind)
end
|