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
Copy file name to clipboardExpand all lines: README.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,8 @@ This repository currently keeps `examples/` limited to files that PR CI validate
50
50
basic-cli/
51
51
├── spore.toml # Platform manifest
52
52
├── src/
53
-
│ ├── host.sp # Default platform entry point
53
+
│ ├── host.sp # Compatibility runtime entry point
54
+
│ ├── platform_contract.sp
54
55
│ └── basic_cli/ # Spore API modules, checked and built in CI
55
56
│ ├── stdout.sp # Standard output operations
56
57
│ ├── stdin.sp # Standard input operations
@@ -65,10 +66,24 @@ basic-cli/
65
66
└── examples/ # Canonical examples that format/check/build in CI
66
67
```
67
68
69
+
## Contract Surface (MVP)
70
+
71
+
The current Platform contract MVP is intentionally split across two artifacts:
72
+
73
+
1.`spore.toml``[platform]` metadata names the contract module, the startup contract symbol, the adapter function, and the handled capabilities.
74
+
2.`src/platform_contract.sp` owns the startup contract itself:
75
+
- a hole-backed `main` function carries the authoritative startup signature
76
+
-`main_for_host` is the Platform-owned adapter that receives the application startup function
77
+
78
+
Applications targeting `basic-cli` must implement the same startup function name/signature in their entry module. When the compiler starts reading Platform contracts from packages, `spec` items attached to the Platform contract and the application implementation will both have to hold.
79
+
80
+
`src/host.sp` remains as a compatibility copy of the adapter while the compiler still hardcodes platform startup behavior.
81
+
68
82
## Tutorial Contract
69
83
70
84
-`examples/` is for truthful, CI-validated examples only.
71
85
-`src/basic_cli/` is the API surface for the platform modules themselves.
86
+
-`src/platform_contract.sp` is the package-owned startup contract surface.
72
87
- Only add `tests/` when the repo has real Spore-side regression coverage worth running with `spore test`.
73
88
74
89
If you want to add a new tutorial/example, treat this as the bar:
0 commit comments