Repository navigation
Expand file tree
/
Copy pathes_governance.pi
More file actions
71 lines (58 loc) · 2.5 KB
/
Copy pathes_governance.pi
File metadata and controls
71 lines (58 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Pi Script v0.1 — Elasticsearch Governance Policy
// Domain: Elasticsearch index schema and cluster health
// Entity state populated by es/es_adapter.py before each resolver run.
domain es_governance {
audit_interval: 1 hour
tiebreaker: timestamp_asc
}
entity ElasticsearchIndex {
schema_intact: boolean
replica_health: text
shards_synced: boolean
index_name: identifier
}
// ─── Maps ─────────────────────────────────────────────────────────────────────
map HealthGreen {
target: ElasticsearchIndex.replica_health
maps_to: "healthy"
triggers: ["green"]
}
map HealthDegraded {
target: ElasticsearchIndex.replica_health
maps_to: "degraded"
triggers: ["yellow", "red"]
}
// ─── Constraints ──────────────────────────────────────────────────────────────
constraint SchemaIntegrity {
priority: critical
rule: ElasticsearchIndex.schema_intact must equal true
on_violation: freeze + escalate
decay_check:1 hour
}
constraint ReplicaHealth {
priority: high
rule: ElasticsearchIndex.replica_health must match mapped_values
on_violation: escalate
decay_check:30 minutes
}
constraint ShardSync {
priority: high
rule: ElasticsearchIndex.shards_synced must equal true
on_violation: flag + escalate
decay_check:15 minutes
}
// ─── Enforcement ──────────────────────────────────────────────────────────────
enforce {
entity: ElasticsearchIndex
constraints: [SchemaIntegrity, ReplicaHealth, ShardSync]
}
// ─── Arbiter ──────────────────────────────────────────────────────────────────
arbiter ESArbiter {
acceptable_evolution: ["index_alias_change", "replica_count_tuning"]
never_acceptable: ["mapping_field_removal", "field_type_change", "constraint_removal"]
requires_human_review: ["new_field_addition", "analyzer_change", "index_settings_change"]
acceptance_monitor: {
threshold: 0.9
window: 30 days
}
}