You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository implements the first executable contract for SourceOS State Integrity. The current implementation lane is Python and standard-library-first. It provides State Integrity Report generation, diagnosis, verification, and non-destructive repair planning.
5
+
This repository implements the first executable contract for SourceOS State Integrity. The current implementation lane is Python and standard-library-first. It provides State Integrity Report generation, diagnosis, verification, non-destructive repair planning, a filesystem-backed local store prototype, an append-only JSONL event log, and registry persistence for early actor/schema/object/profile/device state.
6
6
7
-
The next daemon phases should extend this baseline into actor, schema, object, event-log, policy, profile, and repair subsystems without breaking the current JSON report contracts.
7
+
The next daemon phases should extend this baseline into full actor, schema, object, event-log, policy, profile, and repair subsystems without breaking the current JSON report contracts.
8
8
9
9
## Contract Principles
10
10
@@ -15,6 +15,7 @@ The next daemon phases should extend this baseline into actor, schema, object, e
15
15
- Policy denials, conflicts, transport failures, degraded indexes, and repair-needed states must not collapse into generic errors.
16
16
- Agent writes must eventually be attributable to registered actors.
17
17
- Downstream surfaces should consume reports/events, not scrape raw daemon logs.
18
+
- Read paths must not silently initialize, reset, or repair local state.
18
19
19
20
## Current CLI Commands
20
21
@@ -23,13 +24,91 @@ The current repo implementation exposes:
23
24
```bash
24
25
sourceos-syncd health snapshot
25
26
sourceos-syncd health snapshot --compact
27
+
sourceos-syncd health snapshot --store-root ./state --compact
26
28
sourceos-syncd health explain --file examples/health/healthy.snapshot.json
27
29
sourceos-syncd health verify --file examples/health/healthy.snapshot.json
28
30
sourceos-syncd repair plan --file examples/health/degraded.snapshot.json
29
31
```
30
32
31
33
The current commands are intentionally read-only or preview-only. `repair plan` emits a plan; it does not mutate state.
32
34
35
+
## Local Store CLI Commands
36
+
37
+
The filesystem-backed prototype adds explicit store commands:
38
+
39
+
```bash
40
+
sourceos-syncd store init --root ./state
41
+
sourceos-syncd store record --root ./state --event-type add --lane normal --object-id object:alpha --producer manual --payload-json '{}'
sourceos-syncd store get-record --root ./state --kind actors --record-id actor:agent-one
44
+
sourceos-syncd store list-records --root ./state --kind actors
45
+
```
46
+
47
+
Supported registry kinds:
48
+
49
+
-`profiles`
50
+
-`devices`
51
+
-`actors`
52
+
-`schemas`
53
+
-`objects`
54
+
-`indexes`
55
+
-`repair-reports`
56
+
57
+
## Local Store Layout
58
+
59
+
The MVP filesystem store uses this layout:
60
+
61
+
```text
62
+
<store-root>/
63
+
manifest.json
64
+
journal.jsonl
65
+
profiles/
66
+
devices/
67
+
actors/
68
+
schemas/
69
+
objects/
70
+
events/
71
+
repair-reports/
72
+
indexes/
73
+
checkpoints/
74
+
tmp/
75
+
```
76
+
77
+
Durable directories:
78
+
79
+
-`profiles`
80
+
-`devices`
81
+
-`actors`
82
+
-`schemas`
83
+
-`objects`
84
+
-`events`
85
+
-`repair-reports`
86
+
87
+
Rebuildable directories:
88
+
89
+
-`indexes`
90
+
-`checkpoints`
91
+
92
+
Disposable directories:
93
+
94
+
-`tmp`
95
+
96
+
## Current Registry Record Schemas
97
+
98
+
Registry writes assign default schemas when a record does not already provide one:
99
+
100
+
```text
101
+
profiles -> sourceos.profile-record/v1alpha1
102
+
devices -> sourceos.device-record/v1alpha1
103
+
actors -> sourceos.actor-record/v1alpha1
104
+
schemas -> sourceos.schema-record/v1alpha1
105
+
objects -> sourceos.object-record/v1alpha1
106
+
indexes -> sourceos.index-record/v1alpha1
107
+
repair-reports -> sourceos.repair-report/v1alpha1
108
+
```
109
+
110
+
Registry records are JSON objects written atomically as individual files. The MVP intentionally avoids opaque database behavior until the contract is stable.
111
+
33
112
## Intended CLI Commands
34
113
35
114
The README tracks the intended larger CLI surface:
@@ -83,16 +162,19 @@ The current Python implementation defines these contract families:
83
162
- diagnosis
84
163
- controls
85
164
- attestation
165
+
- local store metadata
166
+
- append-only journal events
167
+
- registry records
86
168
87
169
## Next Model Families
88
170
89
171
The next implementation phase should add first-class contracts for:
90
172
91
-
- actor records
173
+
-richer actor records
92
174
- source objects
93
175
- schema contracts
94
176
- sync plans
95
-
-conflicts
177
+
-conflict records
96
178
- policy decisions
97
179
- canonical integrity events
98
180
- repair reports tied to durable/rebuildable/disposable state
@@ -101,14 +183,14 @@ The next implementation phase should add first-class contracts for:
101
183
102
184
## MVP Persistence Boundary
103
185
104
-
The next implementation phase should add persistence in this order:
186
+
The next implementation phase should deepen persistence in this order:
105
187
106
-
1. local config/profile/device discovery
107
-
2.local append-only event log
108
-
3. actor registry
109
-
4. schema registry
110
-
5. object registry
111
-
6. derived index classification
188
+
1.formal local config/profile/device discovery
189
+
2.stronger append-only event log checksums
190
+
3. actor registry validation
191
+
4. schema registry validation and migrations
192
+
5. object registry validation
193
+
6. derived index classification and rebuild reports
0 commit comments