@ai-ecoverse/slicc-bios 1.44.2 → 1.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +2 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -637,10 +637,10 @@ The newest release is live at <https://seven.sliccy.ai/>, and every pull request
637
637
 
638
638
  The hosts are served by the [sliccy-ai](https://github.com/ai-ecoverse/sliccy-ai) worker from the R2 bucket `slicc-bios`. This repo only publishes into that bucket:
639
639
 
640
- - [`edge/publish.mjs`](edge/publish.mjs) `<branch>` uploads `src/` to `seven/` for `main` and to `branches/<label>/` for every other branch, and deletes what the previous upload had and this one doesn't. A manifest next to it (`seven.json`, `branches/<label>.json`) records which branch owns the label, so two branches that map to the same label can't overwrite each other.
640
+ - [`edge/publish.mjs`](edge/publish.mjs) `main` uploads `src/` to `seven/`, and `preview` to `branches/<label>/`, and each deletes what the previous upload had and this one doesn't. A manifest next to it (`seven.json`, `branches/<label>.json`) records which branch owns the label, so two branches that map to the same label can't overwrite each other.
641
641
  - The bucket expires everything under `branches/` 30 days after upload. Every push uploads all files again, so a branch stays up while it's active and disappears a month after its last push. Nothing needs to be cleaned up when a branch is deleted.
642
642
  - **seven** is published only by a release. On a push to `main`, the pipeline's release job runs semantic-release in the `production` environment, and when that tags a new `v<version>` its `after-release` command runs `edge/publish.mjs main`, which uploads `seven/`. A push that releases nothing (`chore:`, `ci:`, `docs:`, `test:` and the like) publishes nothing, so a change that only matters to seven needs a `fix:` or `feat:` commit to go live. A release job is never cancelled by a newer one.
643
- - The upload uses `SLICC_BIOS_DEPLOY_TOKEN`, an account token with Workers R2 Storage Write, handed to wrangler as `CLOUDFLARE_API_TOKEN`. That token could overwrite `seven/`, so it lives only in the `production` environment, whose deployment branch policy allows `main` alone, and `ci.yml` gives it only to the release job (`release-secrets`). The pipeline keeps its own `CLOUDFLARE_API_TOKEN`, the reviewers' screenshot token, out of `after-release`, hence the separate name.
643
+ - The upload goes over R2's S3-compatible API with `SLICC_BIOS_DEPLOY_TOKEN`, a Cloudflare API token with only Workers R2 Storage Bucket Item Read and Write on the `slicc-bios` bucket (Cloudflare honours bucket-scoped tokens on the S3 API only, not the REST API that `wrangler r2 object` uses). `edge/publish.mjs` derives the S3 credentials in the release job, in memory: it asks Cloudflare's token verify endpoint for the token's id (the access key id) and hashes the token with SHA-256 (the secret access key, as Cloudflare defines it), and signs each request with SigV4 through [aws4fetch](https://github.com/mhart/aws4fetch). Neither is printed or written anywhere. Files go up eight at a time, then deletions, then the manifest. That token could overwrite `seven/`, so it lives only in the `production` environment, whose deployment branch policy allows `main` alone, and `ci.yml` gives it only to the release job (`release-secrets`). The pipeline keeps its own `CLOUDFLARE_API_TOKEN`, the reviewers' screenshot token, out of `after-release`, hence the separate name.
644
644
  - **A preview** is published by the pipeline's `deploy` job on every pull request, in the `staging` environment, with `id-token: write`. It runs `edge/publish.mjs preview`, which publishes the pull request's merge commit when its branch (`GITHUB_HEAD_REF`) is a `bb/**` branch, writes the URL to the job's `url` output, and skips everything else: other branches, and a pull request from a fork, which gets no OIDC token. A publish that fails (the route refuses it or can't be reached) writes `preview failed: <reason>` to the job summary and sets no URL, so the tests and reviews still run; none of them needs `STAGING_URL`. A push to a branch without a pull request publishes nothing. A newer push cancels the running CI, its publish included.
645
645
  - **A preview** holds no secret: `ci.yml` sets no `deploy-secrets`, and the pipeline (from v2.12.0) passes the deploy job only the secrets that input names, so it gets none. `edge/publish.mjs` asks GitHub for the job's OIDC token (audience `https://sliccy.ai`) and publishes through the sliccy-ai worker's `/api/publish/*` route. The route checks the token's signature, issuer, audience, expiry, repository, the `staging` environment and the `refs/pull/<n>/merge` ref, then derives `branches/<label>/` from the token's `head_ref`. A branch can only ever write its own prefix, and never `seven/`. It first writes a manifest listing both the previous upload's files and this one's, so a publish cancelled midway leaves every file it uploaded on the list for the next publish to delete. Then files go up eight at a time, then deletions, then the final manifest.
646
646
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.44.2",
3
+ "version": "1.44.4",
4
4
  "description": "Slim loader that boots SLICC into OPFS and serves the UI from there",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -50,13 +50,13 @@
50
50
  "@ai-ecoverse/slicc-spectrum": "1.104.1",
51
51
  "@ai-ecoverse/slicc-vault": "1.16.4",
52
52
  "@biomejs/biome": "2.5.15",
53
+ "aws4fetch": "1.0.20",
53
54
  "es-module-lexer": "3.0.4",
54
55
  "fake-indexeddb": "6.2.6",
55
56
  "lefthook": "2.2.2",
56
57
  "modern-tar": "0.8.6",
57
58
  "monocart-coverage-reports": "2.13.2",
58
59
  "semantic-release": "25.0.9",
59
- "wrangler": "4.151.1",
60
60
  "ws": "8.22.0"
61
61
  }
62
62
  }