Skip to content

Commit af893e5

Browse files
authored
Add SourceOS projection fixtures for Agent Machine receipts
Add SourceOS/SociOS projection fixtures for the Agent Machine typed-contract integration path, plus a local fixture validator wired into make validate. Fixtures cover SourceOSModelCarryRef, InferenceProvider, ModelResidency, PlacementFact, and AgentMachineReceipt. Validation: - Added validate-sourceos-projections target. - Confirmed PR mergeable with no status checks returned by connector. - Kept projection fixtures under fixtures/sourceos-spec to avoid conflicting with repo-local kind-based examples.
1 parent e8429e8 commit af893e5

8 files changed

Lines changed: 190 additions & 2 deletions

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: validate validate-json validate-yaml validate-quadlet validate-render validate-evidence validate-governance validate-activation validate-supply-chain validate-release-bundle validate-package validate-cli validate-formula doctor probe
1+
.PHONY: validate validate-json validate-yaml validate-quadlet validate-render validate-evidence validate-governance validate-activation validate-supply-chain validate-release-bundle validate-sourceos-projections validate-package validate-cli validate-formula doctor probe
22

33
PYTHON ?= python3
44
RUBY ?= ruby
@@ -20,7 +20,7 @@ DECIDED_AT := 2026-05-04T12:51:00Z
2020
PYCLI := PYTHONPATH=src $(PYTHON) -m agent_machine.cli
2121
PYMOD := PYTHONPATH=src $(PYTHON) -m
2222

23-
validate: validate-json validate-yaml validate-quadlet validate-render validate-evidence validate-governance validate-activation validate-supply-chain validate-release-bundle validate-package validate-cli validate-formula
23+
validate: validate-json validate-yaml validate-quadlet validate-render validate-evidence validate-governance validate-activation validate-supply-chain validate-release-bundle validate-sourceos-projections validate-package validate-cli validate-formula
2424

2525
validate-json:
2626
$(PYTHON) scripts/validate-json.py
@@ -66,6 +66,9 @@ validate-release-bundle:
6666
$(PYTHON) scripts/validate-release-bundle.py
6767
$(PYTHON) scripts/generate-release-evidence.py --pretty >/tmp/agent-machine-release-evidence-bundle.json
6868

69+
validate-sourceos-projections:
70+
$(PYTHON) scripts/validate-sourceos-projection-fixtures.py
71+
6972
validate-package:
7073
$(PYTHON) scripts/validate-package.py
7174

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SourceOS Spec Projection Fixtures
2+
3+
Status: integration fixtures for pending SourceOS typed-contract projections
4+
5+
## Purpose
6+
7+
This directory records Agent Machine examples that conform to the SourceOS/SociOS projection contracts proposed in `SourceOS-Linux/sourceos-spec` PR #89 and its successor PRs.
8+
9+
The fixtures intentionally live under `fixtures/sourceos-spec/` rather than `examples/` because Agent Machine's canonical `examples/` directory is validated through repo-local `kind`-based contracts. The SourceOS projection contracts use the broader SourceOS `type` discriminator and must not be forced into the repo-local example validator until the projection schemas are promoted and synchronized.
10+
11+
## Fixtures
12+
13+
| Fixture | SourceOS projection type | Purpose |
14+
| --- | --- | --- |
15+
| `fixtures/sourceos-spec/sourceosmodelcarryref.json` | `SourceOSModelCarryRef` | Approved on-device reference to a governed model/service profile carried by SourceOS without mutable model state. |
16+
| `fixtures/sourceos-spec/inferenceprovider.json` | `InferenceProvider` | Backend-neutral provider capability shape for local/cluster/remote governed inference. |
17+
| `fixtures/sourceos-spec/modelresidency.json` | `ModelResidency` | Observed model availability and cache/load state on an Agent Machine. |
18+
| `fixtures/sourceos-spec/placementfact.json` | `PlacementFact` | Machine-local scheduling and policy fact for runtime placement. |
19+
| `fixtures/sourceos-spec/agentmachinereceipt.json` | `AgentMachineReceipt` | Runtime evidence emitted after probe, placement, execution, cache reuse, model load/unload, or policy-mediated side effects. |
20+
21+
## Validation
22+
23+
Run:
24+
25+
```bash
26+
make validate-sourceos-projections
27+
```
28+
29+
or as part of the full gate:
30+
31+
```bash
32+
make validate
33+
```
34+
35+
The local validator checks structural fixture shape, expected `type` discriminators, required projection fields, and `urn:srcos:` identity posture. Full JSON Schema validation belongs in `SourceOS-Linux/sourceos-spec` once the projection schemas merge.
36+
37+
## Boundary rules
38+
39+
1. These fixtures are not runtime activation authority.
40+
2. These fixtures do not start providers, download models, mutate caches, or grant tool use.
41+
3. Agent Machine's repo-local contracts remain authoritative for bootstrap runtime validation until the SourceOS projection schemas are promoted.
42+
4. SourceOS projection fixtures are compatibility artifacts for the cross-repo Foundry path: `functional-model-surfaces → sourceos-spec → sourceos-model-carry → agent-machine → agentplane`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "urn:srcos:agent-machine-receipt:m2-asahi-observation-20260504t170000z",
3+
"type": "AgentMachineReceipt",
4+
"specVersion": "2.1.0",
5+
"machineRef": "urn:srcos:agent-machine:m2-asahi-local",
6+
"receiptClass": "probe",
7+
"issuedAt": "2026-05-04T17:00:10Z",
8+
"taskRef": "urn:prophet:run-capsule:local-observation-20260504",
9+
"agentPodRef": "urn:srcos:agent-pod:local-observation-0001",
10+
"placementFactRefs": ["urn:srcos:placement-fact:m2-asahi-local-20260504t170000z"],
11+
"modelResidencyRefs": ["urn:srcos:model-residency:m2-local-llama32-3b-20260504t170000z"],
12+
"inferenceProviderRefs": ["urn:srcos:inference-provider:llama-cpp-cpu-arm64-local"],
13+
"policyDecisionRef": "urn:srcos:decision:runtime-observation-20260504",
14+
"verdict": "observed",
15+
"metrics": {
16+
"durationMs": 142.0,
17+
"providerCount": 1,
18+
"residentModelCount": 1
19+
},
20+
"evidenceHash": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
21+
"evidenceRefs": ["sha256:5555555555555555555555555555555555555555555555555555555555555555"]
22+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"id": "urn:srcos:inference-provider:llama-cpp-cpu-arm64-local",
3+
"type": "InferenceProvider",
4+
"specVersion": "2.1.0",
5+
"providerClass": "llama.cpp",
6+
"endpointMode": "local-http",
7+
"executionProfile": "cpu-arm64",
8+
"trustPosture": "local-sandboxed",
9+
"supportedModalities": ["text", "code", "embedding"],
10+
"openAICompatible": true,
11+
"requiresNetwork": false,
12+
"evidenceRefs": ["sha256:1111111111111111111111111111111111111111111111111111111111111111"]
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"id": "urn:srcos:model-residency:m2-local-llama32-3b-20260504t170000z",
3+
"type": "ModelResidency",
4+
"specVersion": "2.1.0",
5+
"machineRef": "urn:srcos:agent-machine:m2-asahi-local",
6+
"modelCarryRef": "urn:srcos:model-carry-ref:local-llama32-3b-office-assist",
7+
"providerRef": "urn:srcos:inference-provider:llama-cpp-cpu-arm64-local",
8+
"residencyState": "cached",
9+
"quantization": "q4_k_m",
10+
"bytesOnDisk": 2147483648,
11+
"cacheTier": "nvme",
12+
"observedAt": "2026-05-04T17:00:00Z",
13+
"evidenceRefs": ["sha256:2222222222222222222222222222222222222222222222222222222222222222"]
14+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "urn:srcos:placement-fact:m2-asahi-local-20260504t170000z",
3+
"type": "PlacementFact",
4+
"specVersion": "2.1.0",
5+
"machineRef": "urn:srcos:agent-machine:m2-asahi-local",
6+
"observedAt": "2026-05-04T17:00:00Z",
7+
"hardware": {
8+
"arch": "aarch64",
9+
"accelerators": ["cpu", "vulkan-probe"],
10+
"memoryBytes": 25769803776,
11+
"storageBytesAvailable": 107374182400
12+
},
13+
"isolation": {
14+
"runtime": "rootless-podman",
15+
"networkDefault": "policy-gated",
16+
"filesystemDefault": "workspace-scoped-rw"
17+
},
18+
"trustPosture": "sandboxed-local",
19+
"modelResidencyRefs": ["urn:srcos:model-residency:m2-local-llama32-3b-20260504t170000z"],
20+
"providerRefs": ["urn:srcos:inference-provider:llama-cpp-cpu-arm64-local"],
21+
"cacheNotes": ["NVMe model cache available; KV cache reuse requires identity and policy match."],
22+
"evidenceRefs": ["sha256:3333333333333333333333333333333333333333333333333333333333333333"]
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"id": "urn:srcos:model-carry-ref:local-llama32-3b-office-assist",
3+
"type": "SourceOSModelCarryRef",
4+
"specVersion": "2.1.0",
5+
"modelRef": "urn:prophet:model:llama32-3b-local-office-assist",
6+
"governanceRef": "urn:prophet:model-release-decision:local-llama32-3b-office-assist-20260504",
7+
"routerProfileRef": "urn:srcos:model-router-profile:local-first-office-assist",
8+
"releaseSetRefs": ["urn:srcos:release-set:sourceos-workstation-m2-20260504"],
9+
"launchProfileRefs": ["urn:srcos:model-launch-profile:llama-cpp-local-office-assist"],
10+
"fallbackRefs": [],
11+
"carryPolicy": "download-on-demand",
12+
"cachePolicy": "weights-cache-allowed",
13+
"mutableModelState": false,
14+
"evidenceRefs": ["sha256:2e7f1c7f0a6a4bbd9ef000000000000000000000000000000000000000000"]
15+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env python3
2+
"""Validate SourceOS projection fixture shape without depending on sourceos-spec checkout."""
3+
4+
from __future__ import annotations
5+
6+
import json
7+
from pathlib import Path
8+
9+
ROOT = Path(__file__).resolve().parents[1]
10+
FIXTURE_DIR = ROOT / "fixtures" / "sourceos-spec"
11+
12+
EXPECTED = {
13+
"sourceosmodelcarryref.json": "SourceOSModelCarryRef",
14+
"inferenceprovider.json": "InferenceProvider",
15+
"modelresidency.json": "ModelResidency",
16+
"placementfact.json": "PlacementFact",
17+
"agentmachinereceipt.json": "AgentMachineReceipt",
18+
}
19+
20+
REQUIRED = {
21+
"SourceOSModelCarryRef": ["id", "type", "specVersion", "modelRef", "governanceRef", "routerProfileRef", "mutableModelState"],
22+
"InferenceProvider": ["id", "type", "specVersion", "providerClass", "endpointMode", "executionProfile", "trustPosture"],
23+
"ModelResidency": ["id", "type", "specVersion", "machineRef", "modelCarryRef", "providerRef", "residencyState", "observedAt"],
24+
"PlacementFact": ["id", "type", "specVersion", "machineRef", "observedAt", "hardware", "isolation", "trustPosture"],
25+
"AgentMachineReceipt": ["id", "type", "specVersion", "machineRef", "receiptClass", "issuedAt", "placementFactRefs", "policyDecisionRef", "verdict"],
26+
}
27+
28+
29+
def load(path: Path) -> dict:
30+
with path.open("r", encoding="utf-8") as handle:
31+
data = json.load(handle)
32+
if not isinstance(data, dict):
33+
raise AssertionError(f"{path}: root must be a JSON object")
34+
return data
35+
36+
37+
def main() -> int:
38+
for filename, expected_type in EXPECTED.items():
39+
path = FIXTURE_DIR / filename
40+
if not path.exists():
41+
raise AssertionError(f"missing fixture: {path.relative_to(ROOT)}")
42+
data = load(path)
43+
actual_type = data.get("type")
44+
if actual_type != expected_type:
45+
raise AssertionError(f"{path}: expected type {expected_type!r}, got {actual_type!r}")
46+
for field in REQUIRED[expected_type]:
47+
if field not in data:
48+
raise AssertionError(f"{path}: missing required projection field {field!r}")
49+
if not str(data.get("id", "")).startswith("urn:srcos:"):
50+
raise AssertionError(f"{path}: id must use urn:srcos prefix")
51+
print(f"VALID SourceOS projection fixture {path.relative_to(ROOT)}")
52+
return 0
53+
54+
55+
if __name__ == "__main__":
56+
raise SystemExit(main())

0 commit comments

Comments
 (0)