Skip to content

packages data layer: TypeScript datascript authoring (generated typings + packages build) #98

Closed
3 of 3 issues completed

Description

@Mathih13

Spec: the packages-devx design, §Datascripts (public proposal: #1; the full design doc lives in the private working origin).

The TypeScript authoring layer on top of the delta pipeline (#95):

  • Typings come from the platform, not from us: spacetime generate --lang typescript output (already riding preflight's generate step) is the schema source — field names/types can't drift from the module. We ship only a thin authoring library that IMPORTS those types: data.spell(133), .clone(id), proxy objects recording which fields the script assigned (that record IS the partial-column claim packages data layer: datascript delta pipeline (replay, conflicts, validation) #95 applies).
  • lyracore packages build shells out to bun or deno (doctor-checked; needed by package AUTHORS only — operators consume shipped deltas and never need a JS toolchain), runs data/*.ts, writes data/.generated/ with a hash of the sources; the CLI warns loudly when generated output is stale against the .ts.
  • Determinism is by construction: the delta file is the artifact; script-side randomness is the author's reproducibility problem, not a sandbox we build.
  • Cross-package composition is author-time-frozen: scripts read BASE data (CLI exports a snapshot from the dev DB), not other packages' generated output — deltas compose row-wise at apply. Operator-side rebuild for full composition is a later flag, not a redesign.
  • Monorepo CI hook: spacetime generate && tsc per package = the data-layer compat gate against core tip.

Blocked by #95

Done when: the Fire Nova example (clone spell 133, set fields, loop 5 ranks) typechecks with schema autocomplete, builds to a delta via lyracore packages build, and applies through the #95 pipeline onto a dev stack; renaming a schema field makes the same script FAIL typecheck; editing the .ts without rebuilding produces the staleness warning.


Migrated 2026-08-11 from the private tracker (spacetime-core#510).

Activity

  1. Mathih13 commented on Aug 24, 2026

    @Mathih13
    ContributorAuthor

    This was generated by AI during triage.

    Human Brief

    Category: enhancement
    Summary: Coordinate the Bun toolchain, typed spell authoring, and stale-artifact CI.

    Why this needs a human:
    This issue is now a coordination parent. Its agent-ready children establish separate contracts for toolchain ownership, authoring behavior, and committed generated output.

    Current behavior:
    There is no TypeScript Datascript project, generated schema typing path, authoring library, or staleness gate.

    Desired behavior:
    Use pinned Bun with bun.lock and tsc --noEmit through #314. Build the first spell and child-effect API through #315. Make every generated input part of a reproducible build identity and reject drift through #316. Datascripts are trusted author-time code. Operators consume generated Package Deltas and do not install Bun.

    Acceptance criteria:

    • The Fire Nova example typechecks and emits the canonical spell Package Delta.
    • Datascripts read only the base snapshot, never another Package's generated output.
    • Schema field changes fail typecheck.
    • Changed sources, schema, snapshot, or tools make committed output stale.
    • Official Package CI rebuilds and rejects drift instead of committing it.

    Out of scope:

    • Runtime Script execution
    • Operator-side cross-Package Datascript builds
    • Sandboxing trusted author code
  2. added
    ready-for-humanNeeds a maintainer: a decision, a maintainer's Realm, or coordination
    on Aug 24, 2026
  3. Mathih13 commented on Aug 28, 2026

    @Mathih13
    ContributorAuthor

    Closing. The full scope shipped across #314 (Bun toolchain, generated typings), #315 (spell and effect authoring API, Fire Nova example), and #316 (stale-artifact detection, core-tip CI). All three are closed. One follow-up landed today: #364 added the Bun and Node type definitions the typecheck needs under TypeScript 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2normalenhancementNew feature or requestready-for-humanNeeds a maintainer: a decision, a maintainer's Realm, or coordination

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions