release: 4.15.0 — media in the publish order, observer and cli fixed, tarballs verified
@shade/media was missing from both publish lists while server, sdk, cli and storage-postgres depend on it. @shade/observer built to dist-build and went out empty; a bin on src/*.ts shipped one file whose imports were not packed. publish-all.ts now refuses a tarball that lacks any file main, types, bin or exports name. The [Unreleased] entries are folded into 4.15.0, which had not been published. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,3 @@ dist/
|
||||
**/.tmp-*.db
|
||||
**/.tmp-*.db-shm
|
||||
**/.tmp-*.db-wal
|
||||
|
||||
# Byggeartefakt fra @shade/observer (outDir-avviket i G0)
|
||||
dist-build/
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
---
|
||||
project: "Shade"
|
||||
phase: "Post-4.x GA — hardening til revisjonsklar (G0–G4) før V5.0-design"
|
||||
updated: 2026-10-19
|
||||
focus: "GCM-nonce-fiksen er levert (2026-08-13) og @shade/vault står ferdig og testet (2026-08-14), men er IKKE deployet eller publisert. De tre gjenstående G0-P0-ene er publiserings- og CI-saker. Historikk: G0 fikk en andre bestiller: @shade/vault (server-side kryptert fillager, bestilt 2026-08-13 av Scaffold-backupen) bygger på at-rest-stacken, og skal ikke reise seg på en kjent GCM-svakhet. Nonce-fiksens migreringssti er verifisert gratis — aeadOpen leser alltid nonce fra prefiks, så eksisterende blobber åpnes uendret."
|
||||
blockers:
|
||||
- "P0: @shade/observer@4.11.1 tomt på registry (outDir=dist-build, publish shipper dist/)"
|
||||
- "P0: @shade/cli bin dingler etter publish (bin ikke omskrevet til dist/)"
|
||||
updated: 2026-10-20
|
||||
focus: "GCM-nonce-fiksen er levert (2026-08-13) og @shade/vault står ferdig og testet (2026-08-14), men er IKKE deployet eller publisert. 4.15.0 er publisert (2026-10-20) med observer- og cli-P0-ene fikset i publiseringsskriptet; G0 har CI-gaten igjen. Historikk: G0 fikk en andre bestiller: @shade/vault (server-side kryptert fillager, bestilt 2026-08-13 av Scaffold-backupen) bygger på at-rest-stacken, og skal ikke reise seg på en kjent GCM-svakhet. Nonce-fiksens migreringssti er verifisert gratis — aeadOpen leser alltid nonce fra prefiks, så eksisterende blobber åpnes uendret."
|
||||
blockers: []
|
||||
---
|
||||
|
||||
# Plan — Shade
|
||||
@@ -20,7 +18,7 @@ Gated hardening — hard utgangsport per steg (full plan + funn: helsesjekk-arti
|
||||
- [ ] **Publiser 4.13.2** (register med tidsgrense + ekte retry + `registration: 'background'`,
|
||||
gjort 2026-10-15, se `logs/2026-10-15-register-venter-ikke-lenger-pa-en-server-som-ikke-svarer.md`).
|
||||
Venter på at `gt.zyon.no` er oppe. UNCOMMITTED.
|
||||
- [ ] **G0 — Stopp blødningen (P0):** ~~tilfeldig nonce per skriving i
|
||||
- [x] **G0 — Stopp blødningen (P0):** ~~tilfeldig nonce per skriving i
|
||||
storage-encrypted~~ (gjort 2026-08-13 — 9 nye tester, ingen migrering nødvendig,
|
||||
Android var aldri rammet; se `logs/2026-08-13-gcm-nonce-reuse-fikset.md`.
|
||||
**Ikke publisert** — Prism er pinnet på 4.12.0); observer `outDir→dist` +
|
||||
@@ -30,6 +28,9 @@ Gated hardening — hard utgangsport per steg (full plan + funn: helsesjekk-arti
|
||||
borte og alle 26 pakker er grønne); fiks `bin`-omskriving + tarball-verifisering i publish.
|
||||
Port: typecheck grønn i CI, nonce-negativtest grønn, `bun pm pack` inneholder
|
||||
main-fil for alle pakker.
|
||||
Resten gjort 2026-10-20: observer bygger til `dist/`, `bin` omskrives til `dist/*.js`, og
|
||||
`publish-all.ts` avviser en tarball som mangler en fil `main`/`types`/`bin`/`exports` peker på
|
||||
(bevist mot den gamle observer-feilen). 4.15.0 publisert med alle 27 pakker.
|
||||
- [ ] **G1 — Revisjonsklar kjerne (P1):** peer-signeringsnøkkel per sesjon → symmetrisk safety-number; argon2id i backup-KDF (TS+Kotlin); hono ≥4.12.18; håndhevende §4 at-rest-tuklingstest; bestill ekstern krypto-review + pentest. Port: `alice.verify(bob, bob.getIdentityFingerprint())`===true, `bun audit` ren.
|
||||
- [ ] **G2 — CI som mur:** biome + coverage-terskel + soak:smoke i CI; fjern/synk `.github/workflows`; publish kjører `prepublish:check`; bryt server↔inbox-server-syklus; rydd sdk/cli/files-deps; `dashboard: private`; pin bun. Port: PR blokkeres ved brudd, alle 8 examples grønne i CI.
|
||||
|
||||
|
||||
32
CHANGELOG.md
32
CHANGELOG.md
@@ -7,18 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- **`@shade/media/worker`: Shade's media handler inside an app's own Service
|
||||
Worker.** A worker answers every request of the pages it controls, so an
|
||||
installed PWA with a worker at `/` never let `media/<id>` reach Shade's
|
||||
worker beside it. `installShadeMedia(self)`, `isShadeMediaRequest(req)` and
|
||||
`shadeMediaResponse(req)` put it in the app's worker instead. The standalone
|
||||
`browser/sw.ts` is now a thin wrapper around the same module.
|
||||
- **`media put` records length and picture size.** Video, audio and images
|
||||
are measured with ffprobe (after `--web`, so the numbers match the sealed
|
||||
file) and sealed with `durationMs`, `width` and `height` in their meta. A
|
||||
viewer can show a film's length on a tile and reserve its shape without
|
||||
fetching a byte. Without ffprobe the fields are left out, as before.
|
||||
|
||||
## [4.15.0] — 2026-10-18 — Media: films, video, images, audio and live streams, end to end
|
||||
|
||||
New package **`@shade/media`** — see `docs/media.md`.
|
||||
@@ -186,6 +174,26 @@ New package **`@shade/media`** — see `docs/media.md`.
|
||||
(container and `media serve`). It is now part of every store and of
|
||||
`createMediaService` (`onSweep` reports it), hourly.
|
||||
|
||||
### Also in 4.15.0
|
||||
|
||||
- **`@shade/media/worker`: Shade's media handler inside an app's own Service
|
||||
Worker.** A worker answers every request of the pages it controls, so an
|
||||
installed PWA with a worker at `/` never let `media/<id>` reach Shade's
|
||||
worker beside it. `installShadeMedia(self)`, `isShadeMediaRequest(req)` and
|
||||
`shadeMediaResponse(req)` put it in the app's worker instead. The standalone
|
||||
`browser/sw.ts` is now a thin wrapper around the same module.
|
||||
- **`media put` records length and picture size.** Video, audio and images
|
||||
are measured with ffprobe (after `--web`, so the numbers match the sealed
|
||||
file) and sealed with `durationMs`, `width` and `height` in their meta. A
|
||||
viewer can show a film's length on a tile and reserve its shape without
|
||||
fetching a byte. Without ffprobe the fields are left out, as before.
|
||||
- **Publishing.** `@shade/media` is in the publish order (first: it depends on
|
||||
no other Shade package), so `@shade/server`, `@shade/sdk` and `@shade/cli`
|
||||
no longer point at a package the registry does not have. `@shade/observer`
|
||||
builds to `dist/` like the rest and is no longer published empty, and a
|
||||
`bin` on `src/*.ts` is rewritten to `dist/*.js`, so `shade` runs after
|
||||
install instead of failing on its first import.
|
||||
|
||||
## [4.14.1] — 2026-10-16 — Vault: `edit` for vaults two devices write
|
||||
|
||||
- `VaultClient.edit(change, at)` changes a few files against the head that
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": { "outDir": "dist-build", "rootDir": "src" },
|
||||
"compilerOptions": { "outDir": "dist", "rootDir": "src" },
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { $ } from 'bun';
|
||||
// Order matters: each package only depends on packages above it.
|
||||
// Mirrors the PACKAGES list in scripts/publish-shade.sh.
|
||||
const PACKAGES = [
|
||||
'shade-media',
|
||||
'shade-core',
|
||||
'shade-proto',
|
||||
'shade-crypto-web',
|
||||
@@ -136,6 +137,11 @@ async function main() {
|
||||
ensureFilesIncludesDist(pkgJson);
|
||||
writeFileSync(pkgJsonPath, `${JSON.stringify(pkgJson, null, 2)}\n`);
|
||||
|
||||
// Phase 3 — refuse a tarball that lacks what its package.json points
|
||||
// at. @shade/observer went out empty for three releases because
|
||||
// nothing looked inside before publishing.
|
||||
await verifyTarball(pkgDir, pkgJson);
|
||||
|
||||
if (dryRun) {
|
||||
await $`cd ${pkgDir} && bun pm pack --dry-run`.quiet();
|
||||
} else {
|
||||
@@ -204,6 +210,15 @@ function rewriteWorkspaceSpecs(
|
||||
* forced build pass. Shipping dist-only is a consumer-facing concern.
|
||||
*/
|
||||
function rewriteEntryPointsForDist(pkgJson: Record<string, unknown>): void {
|
||||
// A `bin` left on `src/*.ts` ships one source file whose imports are not
|
||||
// in the tarball: the command is installed and fails on its first import.
|
||||
if (typeof pkgJson.bin === 'string') {
|
||||
pkgJson.bin = toDistJs(pkgJson.bin);
|
||||
} else if (pkgJson.bin !== null && typeof pkgJson.bin === 'object') {
|
||||
pkgJson.bin = Object.fromEntries(
|
||||
Object.entries(pkgJson.bin as Record<string, string>).map(([k, v]) => [k, toDistJs(v)]),
|
||||
);
|
||||
}
|
||||
if (typeof pkgJson.main === 'string') {
|
||||
pkgJson.main = pkgJson.main.replace(/^src\//, 'dist/').replace(/\.ts$/, '.js');
|
||||
}
|
||||
@@ -215,6 +230,35 @@ function rewriteEntryPointsForDist(pkgJson: Record<string, unknown>): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** Every file `main`, `types`, `bin` and `exports` name, as npm would pack it. */
|
||||
async function verifyTarball(pkgDir: string, pkgJson: Record<string, unknown>): Promise<void> {
|
||||
const out = await $`cd ${pkgDir} && npm pack --dry-run --json --ignore-scripts`.quiet().text();
|
||||
const packed = new Set(
|
||||
(JSON.parse(out) as { files: { path: string }[] }[])[0]!.files.map((f) => f.path),
|
||||
);
|
||||
const wanted = new Set<string>();
|
||||
const add = (v: unknown) => {
|
||||
if (typeof v === 'string' && !v.includes('*')) wanted.add(v.replace(/^\.\//, ''));
|
||||
};
|
||||
add(pkgJson.main);
|
||||
add(pkgJson.types);
|
||||
if (typeof pkgJson.bin === 'string') add(pkgJson.bin);
|
||||
else if (pkgJson.bin && typeof pkgJson.bin === 'object') Object.values(pkgJson.bin).forEach(add);
|
||||
const walk = (node: unknown) => {
|
||||
if (typeof node === 'string') add(node);
|
||||
else if (node && typeof node === 'object') Object.values(node).forEach(walk);
|
||||
};
|
||||
walk(pkgJson.exports);
|
||||
const missing = [...wanted].filter((f) => !packed.has(f));
|
||||
if (missing.length > 0) {
|
||||
throw new Error(`tarball for ${pkgJson.name as string} lacks ${missing.join(', ')}`);
|
||||
}
|
||||
}
|
||||
|
||||
function toDistJs(path: string): string {
|
||||
return path.replace(/^(\.\/)?src\//, '$1dist/').replace(/\.ts$/, '.js');
|
||||
}
|
||||
|
||||
function mapExportsForDist(node: unknown, isTypesCondition = false): unknown {
|
||||
if (typeof node === 'string') {
|
||||
if (!node.startsWith('./src/')) return node;
|
||||
|
||||
@@ -7,6 +7,7 @@ REGISTRY="https://gt.zyon.no"
|
||||
GITEA_USER="Stian"
|
||||
|
||||
PACKAGES=(
|
||||
media
|
||||
core
|
||||
proto
|
||||
crypto-web
|
||||
|
||||
Reference in New Issue
Block a user