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
{{ message }}
Repository navigation
Datascripts: detect stale artifacts and enforce core-tip CI #316
Category: enhancement Summary: Make generated Package Deltas reproducible and reject stale output.
Current behavior:
There is no complete build identity for a generated Package Delta and no CI check against current core schema.
Desired behavior:
The generated artifact records hashes for every Datascript source, generated typings and schema identity, the base snapshot, authoring library, Bun version, and relevant build configuration. packages build updates the artifact. Check, publish, and CI reject stale output with a message naming the changed input.
Official Package CI generates current schema types, installs locked dependencies, runs tsc --noEmit, rebuilds Datascripts, and rejects a diff from the committed generated artifact. It does not silently commit regenerated output.
Key interfaces:
Datascript build identity
Staleness checker
Official Package core-tip CI
Acceptance criteria:
Changing any Datascript source makes the existing artifact stale.
Schema, generated-type, tool-version, base-snapshot, and authoring-library changes also make it stale.
The refusal names the input that changed and the rebuild command.
CI fails when regeneration differs from committed Package output.
Two clean builds from the same inputs produce byte-identical artifacts.
Scoping ahead of implementation. Two acceptance criteria need maintainer decisions; the rest is settled by the codebase.
Settled by evidence:
Build identity goes in a sibling file (packages/<name>/data/.generated/spell.identity.json), not inside the artifact. PackageDelta::parse refuses unknown members (closed member list), and artifact_hash is BLAKE3 over exactly the canonical four fields — identity inside the artifact would change artifact_hash on every Bun/tsconfig bump and force packages replay to reapply byte-identical claims on every Shard.
Staleness surfaces: packages build writes the identity; a new packages check verb recomputes and refuses naming the changed input; publish refuses via the existing preflight seam.
One found bug: check-core-tip.sh refuses a Package with only a data/ half, but module/build.rs (via feat(datascripts): author spell and effect Package Deltas #350) already treats data/ as a valid third half. Datascripts-only Packages like fire_nova would fail the structural check.
Needs your call:
"CI fails when regeneration differs from committed Package output" read literally requires CI to re-emit Datascripts, which requires the Base Snapshot, which derives from client data CI cannot hold. The licensing-safe substitute: CI regenerates what it can (types, locked install, tsc --noEmit) and verifies the recorded identity against the current tree — a source/schema/lib/toolchain change still fails CI, but a snapshot-only drift (client data changed under an unmodified Datascript) is only catchable author-side. Is that weakened guarantee acceptable?
Closing as implemented; the maintainer opted to test everything at once rather than hold this open.
Shipped:
lyracore-cli Deleting a character leaves a ghost row in its realm-core party, and the next mirror push restores it #46: Build Identity sidecar (spell.identity, written by packages build after validation; records hashes of the Datascript source tree, generated typings, Base Snapshot, authoring library, toolchain files, the Bun pin, and the artifact itself), the lyracore packages check verb (recomputes against the tree, refuses naming the exact changed input and the rebuild command), and the same check wired into preflight so publish refuses stale artifacts. 565 tests (32 new).
packages#3: data/-half fix in check-core-tip.sh plus the datascripts core-tip CI job — regenerates typings twice and byte-compares (proving the reproducibility assumption), locked install, tsc --noEmit, then packages check. No re-emission in CI and no auto-committing, by design.
Reproducibility AC: the Bun suite's two-run byte-compare covers the emitter; identity determinism covered in CLI tests; typegen byte-stability proven in CI itself.
The three decisions that gate the CI job doing real diff work moved to #352 so they don't evaporate: scoping #342's gitignore, the committed-artifact licensing call, and confirming the weakened (licensing-safe) CI guarantee.
Activity
Mathih13 commentedon Aug 27, 2026
Scoping ahead of implementation. Two acceptance criteria need maintainer decisions; the rest is settled by the codebase.
Settled by evidence:
packages/<name>/data/.generated/spell.identity.json), not inside the artifact.PackageDelta::parserefuses unknown members (closed member list), andartifact_hashis BLAKE3 over exactly the canonical four fields — identity inside the artifact would changeartifact_hashon every Bun/tsconfig bump and forcepackages replayto reapply byte-identical claims on every Shard.packages buildwrites the identity; a newpackages checkverb recomputes and refuses naming the changed input; publish refuses via the existing preflight seam.check-core-tip.shrefuses a Package with only adata/half, butmodule/build.rs(via feat(datascripts): author spell and effect Package Deltas #350) already treatsdata/as a valid third half. Datascripts-only Packages likefire_novawould fail the structural check.Needs your call:
tsc --noEmit) and verifies the recorded identity against the current tree — a source/schema/lib/toolchain change still fails CI, but a snapshot-only drift (client data changed under an unmodified Datascript) is only catchable author-side. Is that weakened guarantee acceptable?/packages/ignore must be scoped (an ignored artifact is invisible to a diff check), and the open question from feat(datascripts): author spell and effect Package Deltas #350 — whether official Packages may commit spell Delta artifacts embedding client-derived field values — needs an answer. If the answer is no, the CI diff job has nothing to check.Mathih13 commentedon Aug 27, 2026
Closing as implemented; the maintainer opted to test everything at once rather than hold this open.
Shipped:
spell.identity, written bypackages buildafter validation; records hashes of the Datascript source tree, generated typings, Base Snapshot, authoring library, toolchain files, the Bun pin, and the artifact itself), thelyracore packages checkverb (recomputes against the tree, refuses naming the exact changed input and the rebuild command), and the same check wired into preflight so publish refuses stale artifacts. 565 tests (32 new).data/-half fix incheck-core-tip.shplus thedatascriptscore-tip CI job — regenerates typings twice and byte-compares (proving the reproducibility assumption), locked install,tsc --noEmit, thenpackages check. No re-emission in CI and no auto-committing, by design.The three decisions that gate the CI job doing real diff work moved to #352 so they don't evaporate: scoping #342's gitignore, the committed-artifact licensing call, and confirming the weakened (licensing-safe) CI guarantee.