|
| 1 | +# SourceOS State Integrity Contracts |
| 2 | + |
| 3 | +Canonical architecture: `SourceOS-Linux/sourceos-spec/docs/architecture/sourceos-state-integrity-layer.md` |
| 4 | + |
| 5 | +This repository implements the daemon and CLI contracts for SourceOS State Integrity. The first cut is intentionally contract-first: downstream repos can integrate against stable response shapes before persistence, transports, and repair engines are complete. |
| 6 | + |
| 7 | +## Contract Principles |
| 8 | + |
| 9 | +- Structured JSON is the stable integration boundary. |
| 10 | +- Logs are not API contracts. |
| 11 | +- Destructive operations must have dry-run and explicit target scope. |
| 12 | +- Durable state, rebuildable state, and disposable state must be classified separately. |
| 13 | +- Policy denials, conflicts, transport failures, and repair-needed states must not collapse into generic errors. |
| 14 | +- Agent writes must be attributable to registered actors. |
| 15 | + |
| 16 | +## Current CLI Commands |
| 17 | + |
| 18 | +```bash |
| 19 | +sourceos-syncd status --json |
| 20 | +sourceos-syncd doctor --json |
| 21 | +sourceos-syncd explain <object> --json |
| 22 | +sourceos-syncd plans --json |
| 23 | +sourceos-syncd actors --json |
| 24 | +sourceos-syncd schemas --json |
| 25 | +sourceos-syncd conflicts --json |
| 26 | +sourceos-syncd repair --dry-run --json |
| 27 | +sourceos-syncd repair --apply --json |
| 28 | +sourceos-syncd profiles --json |
| 29 | +sourceos-syncd devices --json |
| 30 | +sourceos-syncd export <workspace|profile|object> --json |
| 31 | +sourceos-syncd import <bundle> --json |
| 32 | +``` |
| 33 | + |
| 34 | +## Expected Wrapper |
| 35 | + |
| 36 | +`sourceos-devtools` should expose these as: |
| 37 | + |
| 38 | +```bash |
| 39 | +sourceos sync status |
| 40 | +sourceos sync doctor |
| 41 | +sourceos sync explain <object> |
| 42 | +sourceos sync plans |
| 43 | +sourceos sync actors |
| 44 | +sourceos sync schemas |
| 45 | +sourceos sync conflicts |
| 46 | +sourceos sync repair --dry-run |
| 47 | +sourceos sync repair --apply |
| 48 | +sourceos sync profiles |
| 49 | +sourceos sync devices |
| 50 | +sourceos sync export <workspace|profile|object> |
| 51 | +sourceos sync import <bundle> |
| 52 | +``` |
| 53 | + |
| 54 | +## Model Families |
| 55 | + |
| 56 | +The initial Rust models define: |
| 57 | + |
| 58 | +- health states |
| 59 | +- durability classes |
| 60 | +- actor records |
| 61 | +- source objects |
| 62 | +- schema contracts |
| 63 | +- sync plans |
| 64 | +- conflicts |
| 65 | +- policy decisions |
| 66 | +- integrity events |
| 67 | +- state status |
| 68 | +- repair reports |
| 69 | + |
| 70 | +## MVP Persistence Boundary |
| 71 | + |
| 72 | +The next implementation phase should add persistence in this order: |
| 73 | + |
| 74 | +1. local config/profile/device discovery |
| 75 | +2. local append-only event log |
| 76 | +3. actor registry |
| 77 | +4. schema registry |
| 78 | +5. object registry |
| 79 | +6. derived index classification |
| 80 | +7. dry-run repair of a derived index |
| 81 | +8. policy decision adapter |
| 82 | +9. workspace/file object adapter |
| 83 | +10. agent transaction path |
| 84 | + |
| 85 | +## Non-Goals for First Cut |
| 86 | + |
| 87 | +- no cloud replication |
| 88 | +- no hidden repair |
| 89 | +- no destructive import/export |
| 90 | +- no anonymous agent writes |
| 91 | +- no log-scraping integrations |
| 92 | +- no silent schema drift |
0 commit comments