Skip to content

Commit 857dec5

Browse files
committed
Document event store and identity audit commands
1 parent 9a445bb commit 857dec5

1 file changed

Lines changed: 38 additions & 4 deletions

File tree

README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ State integrity:
3939

4040
Control plane:
4141

42+
- [`schemas/sourceos.event.v0.1.schema.json`](schemas/sourceos.event.v0.1.schema.json)
4243
- [`schemas/sourceos-event.schema.json`](schemas/sourceos-event.schema.json)
4344
- [`schemas/sourceos-service.schema.json`](schemas/sourceos-service.schema.json)
4445
- [`schemas/sourceos-capability.schema.json`](schemas/sourceos-capability.schema.json)
4546
- [`schemas/sourceos-launch-manifest.schema.json`](schemas/sourceos-launch-manifest.schema.json)
4647
- [`schemas/sourceos-incident.schema.json`](schemas/sourceos-incident.schema.json)
4748

48-
The runtime validator is standard-library-only today; the schemas are the canonical external contract for downstream validators, SDKs, dashboards, and cross-repo integrations.
49+
The runtime validator uses the stricter `sourceos.event.v0.1.schema.json` event schema. The legacy-compatible `sourceos-event.schema.json` remains present for broader downstream schema experiments until the v0.1 schema is fully promoted everywhere.
4950

5051
## Golden examples
5152

@@ -59,6 +60,7 @@ Control plane:
5960

6061
- [`examples/events/apple-mdm-entitlement-denial.coalesced.json`](examples/events/apple-mdm-entitlement-denial.coalesced.json)
6162
- [`examples/events/apple-darkwake-network-receipt.json`](examples/events/apple-darkwake-network-receipt.json)
63+
- [`examples/events/invalid/missing-operator-narrative.json`](examples/events/invalid/missing-operator-narrative.json)
6264
- [`examples/services/bearbrowser.service.json`](examples/services/bearbrowser.service.json)
6365
- [`examples/capabilities/browser-gpu-spawn.capability.json`](examples/capabilities/browser-gpu-spawn.capability.json)
6466
- [`examples/launch/bearbrowser.launch-manifest.json`](examples/launch/bearbrowser.launch-manifest.json)
@@ -73,7 +75,7 @@ make install-dev
7375
make validate
7476
```
7577

76-
`make validate` runs JSON syntax checks, full Draft 2020-12 schema validation, semantic control-plane invariants, and `sourceos_eventctl` smoke checks.
78+
`make validate` runs JSON syntax checks, full Draft 2020-12 schema validation, semantic control-plane invariants, event CLI smoke checks, append-only event-store smoke checks, and strict positive/negative event-fixture tests.
7779

7880
The bootstrap validator remains standard-library-only:
7981

@@ -83,7 +85,7 @@ python3 tools/validate_control_plane_examples.py
8385

8486
## Event control CLI seed
8587

86-
`tools/sourceos_eventctl.py` is the first runtime-facing CLI surface for canonical events. It can validate event JSON, print an operator narrative, and emit a minimal policy-decision event.
88+
`tools/sourceos_eventctl.py` is the first runtime-facing CLI surface for canonical events. It validates event JSON against the strict v0.1 event schema, prints an operator narrative, emits a minimal policy-decision event, and maintains a local append-only JSONL event store.
8789

8890
```bash
8991
python3 tools/sourceos_eventctl.py validate examples/events/apple-mdm-entitlement-denial.coalesced.json
@@ -100,7 +102,39 @@ python3 tools/sourceos_eventctl.py emit-policy-decision \
100102
--next-action 'No action required.'
101103
```
102104

103-
The CLI is intentionally small. It is a seed for the eventual `sourceos events validate`, `sourceos events explain`, and `sourceos events emit` commands.
105+
Append-only local event store commands:
106+
107+
```bash
108+
python3 tools/sourceos_eventctl.py write examples/events/apple-mdm-entitlement-denial.coalesced.json --store .sourceos/events.jsonl
109+
python3 tools/sourceos_eventctl.py emit-policy-decision \
110+
--actor sourceos-policy-engine \
111+
--subject com.example.target \
112+
--policy-rule sourceos.example.deny \
113+
--operation ipc.lookup.example \
114+
--target-class example_ipc_service \
115+
--explanation-code POLICY_EXPECTED_TEST_BOUNDARY \
116+
--summary 'Example expected policy boundary was enforced.' \
117+
--why 'Generated policy-decision events validate against the canonical schema.' \
118+
--next-action 'No action required.' \
119+
--store .sourceos/events.jsonl
120+
python3 tools/sourceos_eventctl.py list --store .sourceos/events.jsonl
121+
python3 tools/sourceos_eventctl.py show evt_apple_mdm_entitlement_denial_coalesced --store .sourceos/events.jsonl
122+
python3 tools/sourceos_eventctl.py verify-store --store .sourceos/events.jsonl --fail-empty
123+
```
124+
125+
The CLI is intentionally small. It is a seed for the eventual `sourceos events validate`, `sourceos events explain`, `sourceos events emit`, and `sourceos events store` commands.
126+
127+
## Product identity audit seed
128+
129+
`tools/sourceos_identity_audit.py` compares a service manifest with a hermetic launch manifest and checks product identity invariants. It is designed to catch BearBrowser-style upstream identity leakage before release.
130+
131+
```bash
132+
python3 tools/sourceos_identity_audit.py \
133+
--service examples/services/bearbrowser.service.json \
134+
--launch examples/launch/bearbrowser.launch-manifest.json
135+
```
136+
137+
The audit checks display name alignment, bundle identity, process identity, dock/menu/crash/helper naming, duplicate PATH entries, shell environment inheritance, denied pollution variables, and `identity.product.upstream_leak` denial.
104138

105139
## Intended CLI contract
106140

0 commit comments

Comments
 (0)