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
title: "Spore CI should target project-mode files explicitly"
3
+
category: gotchas
4
+
tags: [spore, ci, project-mode, basic-cli]
5
+
created: 2026-04-28
6
+
context: "basic-cli CI needed to validate a package-backed example with the shipped compiler"
7
+
---
8
+
9
+
## Problem
10
+
11
+
The current `spore` CLI validates package-backed examples reliably when given the explicit entry file, but bare directory invocations and standalone file assumptions can fail depending on current compiler surface and imports.
12
+
13
+
## Solution
14
+
15
+
Use explicit file targets for project-mode checks:
16
+
17
+
```bash
18
+
spore check examples/hello-app/src/main.sp
19
+
spore build examples/hello-app/src/main.sp
20
+
cd examples/hello-app && spore run src/main.sp
21
+
```
22
+
23
+
## Key points
24
+
25
+
- Keep CI focused on the canonical package-backed entry file.
26
+
- Treat standalone `.sp` examples as separate from project-mode validation.
27
+
- Re-run `spore format --check`, `spore check`, and `spore build` against explicit files when compiler behavior is in flux.
Copy file name to clipboardExpand all lines: README.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# basic-cli
2
2
3
-
Basic CLI platform for [Spore](https://github.com/spore-lang/spore) — provides file I/O, process execution, environment variables, and standard I/O capabilities.
3
+
Basic CLI platform for [Spore](https://github.com/spore-lang/spore) — provides file I/O, process execution, environment variables, and standard I/O effects.
4
4
5
5
## Overview
6
6
7
-
In Spore, a **platform** bridges the pure, capability-tracked language with real-world side effects. `basic-cli` is the standard platform for command-line applications.
7
+
In Spore, a **platform** bridges the pure, effect-tracked language with real-world side effects. `basic-cli` is the standard platform for command-line applications.
8
8
9
9
```
10
-
Your Spore App (pure, capability-checked)
10
+
Your Spore App (pure, effect-checked)
11
11
↕ (effect dispatch)
12
12
basic-cli Platform API (.sp modules)
13
13
↕ (foreign fn)
@@ -18,7 +18,7 @@ Operating System
18
18
19
19
## Modules
20
20
21
-
| Module |Capabilities| Description |
21
+
| Module |Effects| Description |
22
22
|--------|-------------|-------------|
23
23
|`basic_cli.stdout`|`uses [Console]`| Standard output |
24
24
|`basic_cli.stdin`|`uses [Console]`| Standard input |
@@ -46,9 +46,6 @@ default-entry = "app"
46
46
[entries.app]
47
47
path = "main.sp"
48
48
49
-
[capabilities]
50
-
allow = ["Compute"]
51
-
52
49
[dependencies]
53
50
basic-cli = { path = "../.." }
54
51
```
@@ -100,19 +97,19 @@ basic-cli/
100
97
101
98
The current Platform contract MVP is intentionally split across two artifacts:
102
99
103
-
1.`spore.toml``[platform]` metadata names the contract module, the startup contract symbol, the adapter function, and the handled capabilities.
100
+
1.`spore.toml``[platform]` metadata names the contract module, the startup contract symbol, the adapter function, and the handled effects.
104
101
2.`src/platform_contract.sp` owns the startup contract itself:
105
102
- a hole-backed `main` function carries the authoritative startup signature
106
103
-`main_for_host` is the Platform-owned adapter that receives the application startup function
107
104
108
-
Applications targeting `basic-cli` must implement the same startup function name/signature in their entry module. The current compiler already resolves the package's `[platform]` metadata and `src/platform_contract.sp` to validate that startup shape. Runtime support is currently specialized to package-backed `basic-cli`: imported `basic_cli.*` foreign functions route through the built-in basic-cli host profile, while generic `[platform].handled-effects` enforcement and startup `spec` stacking are still follow-up work.
105
+
Applications targeting `basic-cli` must implement the same startup function name/signature in their entry module. The current compiler already resolves the package's `[platform]` metadata and `src/platform_contract.sp` to validate that startup shape. Runtime support is currently specialized to package-backed `basic-cli`: imported `basic_cli.*` foreign functions route through the built-in basic-cli host profile, while generic handled-effects enforcement and startup `spec` stacking are still follow-up work.
109
106
110
107
`src/host.sp` remains as a compatibility copy of the adapter for older references; current manifest-backed projects use `src/platform_contract.sp`.
111
108
112
109
## Tutorial Contract
113
110
114
111
-`examples/hello-app/` is the **canonical project-mode example** — it is formatted, checked, built, and run in CI.
115
-
-`examples/hello.sp` is a minimal standalone file for quick experiments (also validated in CI).
112
+
-`examples/hello.sp` is a minimal standalone file for quick experiments.
116
113
-`src/basic_cli/` is the API surface for the platform modules themselves.
117
114
-`src/platform_contract.sp` is the package-owned startup contract surface.
118
115
- Only add `tests/` when the repo has real Spore-side regression coverage worth running with `spore test`.
@@ -125,9 +122,9 @@ If you want to add a new tutorial/example, treat this as the bar:
125
122
126
123
## Design Philosophy
127
124
128
-
Following Spore's [SEP-0003 (Effect Capability System)](https://github.com/spore-lang/spore-evolution/blob/main/seps/SEP-0003-effect-capability-system.md):
125
+
Following Spore's [SEP-0003 (Effect System)](https://github.com/spore-lang/spore-evolution/blob/main/seps/SEP-0003-effect-system.md):
129
126
130
-
-**Capability-gated**: Every I/O function declares its required capabilities via `uses [Cap]`
127
+
-**Effect-gated**: Every I/O function declares its required effects via `uses [Effect]`
131
128
-**Cost-annotated**: Platform functions can carry `cost [c, a, i, p]` budgets where meaningful
132
129
-**Error-typed**: Functions declare error sets via `! ErrorType`
133
130
-**Pure by default**: The platform boundary is the only place side effects occur
@@ -138,7 +135,7 @@ Following Spore's [SEP-0003 (Effect Capability System)](https://github.com/spore
138
135
139
136
The canonical example is the **package-backed project-mode**`examples/hello-app/` application. It already validates and runs with `[project].platform = "basic-cli"`, an in-repo path dependency, and `import basic_cli.stdout`.
140
137
141
-
The standalone file example (`examples/hello.sp`) stays around for quick experiments. The main remaining platform gaps are generic `[platform].handled-effects` enforcement, startup `spec` stacking, and lifting the runtime from its current explicit `basic-cli` host profile to a more general package-backed mechanism.
138
+
The standalone file example (`examples/hello.sp`) stays around for quick experiments. The main remaining platform gaps are generic handled-effects enforcement, startup `spec` stacking, and lifting the runtime from its current explicit `basic-cli` host profile to a more general package-backed mechanism.
0 commit comments