From c99acc13f2cba515ca62de197f54f1ed0a599a60 Mon Sep 17 00:00:00 2001 From: Zhan Rongrui <2742392377@qq.com> Date: Sat, 25 Apr 2026 23:15:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20align=20platform=20ma?= =?UTF-8?q?nifest=20terminology?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the legacy [platform].handles key to [platform].handled-effects in the platform manifest and related documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci-tests.yml | 39 ++++++++++++++++++++++++++++++++-- README.md | 4 ++-- spore.toml | 2 +- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 5384799..d44eca4 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -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. @@ -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. @@ -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. @@ -111,9 +143,11 @@ 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" @@ -121,6 +155,7 @@ jobs: 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." diff --git a/README.md b/README.md index 81f4655..61fbfd0 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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 diff --git a/spore.toml b/spore.toml index a234aa6..1476bc5 100644 --- a/spore.toml +++ b/spore.toml @@ -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"] From da38eae70a7312fcf82fea6228ad6dc856c5b6ba Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Wed, 29 Apr 2026 01:23:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=B7=20ci:=20simplify=20Spore=20wor?= =?UTF-8?q?kflow=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci-tests.yml | 32 -------------------------------- .gitignore | 2 ++ 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index d44eca4..b8026ca 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -42,51 +42,24 @@ jobs: 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: ${{ 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. @@ -105,7 +78,6 @@ 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. @@ -124,7 +96,6 @@ 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. @@ -143,11 +114,9 @@ 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" @@ -155,7 +124,6 @@ jobs: 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." diff --git a/.gitignore b/.gitignore index 14bb816..7d12d6c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ target/ host/target/ /.spore-store +/_spore_temp/ +test_output.log # OS .DS_Store