Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,57 @@ jobs:
spore:
name: spore
runs-on: ubuntu-latest
env:
SPORE_REPOSITORY: spore-lang/spore
SPORE_REF: d96212aa5a4cfe24759c21d8690642adfd357018
steps:
- uses: actions/checkout@v6

- name: Probe spore compiler access
id: spore-source
run: |
api_url="https://api.github.com/repos/${SPORE_REPOSITORY}/git/commits/${SPORE_REF}"
status="$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
-H 'Accept: application/vnd.github+json' \
"${api_url}")"

if [ "${status}" = "200" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
exit 0
fi

echo "available=false" >> "$GITHUB_OUTPUT"

if [ "${status}" != "404" ]; then
echo "::error::Unexpected response probing ${SPORE_REPOSITORY}@${SPORE_REF} (HTTP ${status})."
exit 1
fi

echo "::warning::Skipping compiler-backed Spore checks because the Spore compiler repository is not accessible. This can be resolved by configuring repository access credentials."

- uses: actions/checkout@v6
if: steps.spore-source.outputs.available == 'true'
with:
repository: spore-lang/spore
ref: d96212aa5a4cfe24759c21d8690642adfd357018
repository: ${{ env.SPORE_REPOSITORY }}
ref: ${{ env.SPORE_REF }}
path: _spore

- uses: dtolnay/rust-toolchain@stable
if: steps.spore-source.outputs.available == 'true'
with:
toolchain: stable

- uses: Swatinem/rust-cache@v2
if: steps.spore-source.outputs.available == 'true'
with:
workspaces: _spore

- name: Build spore compiler
if: steps.spore-source.outputs.available == 'true'
run: cargo build --release --manifest-path _spore/Cargo.toml --bin spore

- name: Format Spore files
if: steps.spore-source.outputs.available == 'true'
run: |
# `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
# via the example and platform modules rather than standalone file-mode checks.
Expand All @@ -75,6 +105,7 @@ jobs:
git diff --exit-code

- name: Check Spore files
if: steps.spore-source.outputs.available == 'true'
run: |
# `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
# via the example and platform modules rather than standalone file-mode checks.
Expand All @@ -93,6 +124,7 @@ jobs:
fi

- name: Build Spore files
if: steps.spore-source.outputs.available == 'true'
run: |
# `src/host.sp` is a legacy compatibility shim; validate package-backed behavior
# via the example and platform modules rather than standalone file-mode builds.
Expand All @@ -111,16 +143,19 @@ jobs:
fi

- name: Run standalone hello example
if: steps.spore-source.outputs.available == 'true'
run: _spore/target/release/spore run examples/hello.sp

- name: Run project-mode hello-app example
if: steps.spore-source.outputs.available == 'true'
run: |
if [ -d examples/hello-app ]; then
echo "✓ Running project-mode example examples/hello-app/src/main.sp"
_spore/target/release/spore run examples/hello-app/src/main.sp
fi

- name: Run Spore spec tests
if: steps.spore-source.outputs.available == 'true'
run: |
if [ ! -d tests ]; then
echo "No Spore spec tests yet; skipping spore test."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The current Platform contract MVP is intentionally split across two artifacts:
- a hole-backed `main` function carries the authoritative startup signature
- `main_for_host` is the Platform-owned adapter that receives the application startup function

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 `handles` enforcement and startup `spec` stacking are still follow-up work.
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.

`src/host.sp` remains as a compatibility copy of the adapter for older references; current manifest-backed projects use `src/platform_contract.sp`.

Expand Down Expand Up @@ -138,7 +138,7 @@ Following Spore's [SEP-0003 (Effect Capability System)](https://github.com/spore

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`.

The standalone file example (`examples/hello.sp`) stays around for quick experiments. The main remaining platform gaps are generic `handles` enforcement, startup `spec` stacking, and lifting the runtime from its current explicit `basic-cli` host profile to a more general package-backed mechanism.
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.

## License

Expand Down
2 changes: 1 addition & 1 deletion spore.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spore-version = ">=0.1.0"
contract-module = "platform_contract"
startup-contract = "main"
adapter-function = "main_for_host"
handles = ["Console", "FileRead", "FileWrite", "Env", "Spawn", "Exit"]
handled-effects = ["Console", "FileRead", "FileWrite", "Env", "Spawn", "Exit"]

[capabilities]
allow = ["Compute"]
Expand Down
Loading