Skip to content

build(repo): bring in the xstate fork packages with their history - #14

Merged
kiro-systemf[bot] merged 130 commits into
mainfrom
xs/packages
Oct 7, 2026
Merged

kiro-systemf[bot] merged 130 commits into
mainfrom
xs/packages

Conversation

@systemfsoftware-maker

@systemfsoftware-maker systemfsoftware-maker commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Layer 2 of the xstate stack, on top of #13. It brings in the six @systemfsoftware/xstate* packages with their history, wires them into this workspace, and applies Kiro's rulings on the review of systemfsoftware#631 and on this PR's five questions.

Draft until pnpm-release-management can version these packages (see "Blocked on pnpm-release-management" below). Nothing else holds it. The macOS leg runs on the systemfsoftware pin at the merged #606 (217c80d), and the upstream-manifest guard is wired in PR 3.

History

c7ede53 is a merge commit with two parents: 70decf6 (the scaffold head) and 35540df (origin/sfs/fork-history). 35540df is git subtree split -P packages/xstate of systemfsoftware's sfs/xstate-fork at 613c8b7, and I reproduced that split byte for byte from the branch. packages/* carries all 54 fork commits. After #13's review fixes, the merge was made again on the new scaffold head and the 15 layer commits were cherry-picked on top. Against the previous head the tree differs only in #13's files.

Wiring (88173bc)

  • The fork depended on two private monorepo packages, @systemfsoftware/tsdown-config and @systemfsoftware/vitest-config. They are replaced by the root tsdown.shared.ts (the quiet-build fragment) and the root vitest.shared.ts (forkTestConfig), and each package's config shrinks to two lines. api:check runs api-extractor run directly.
  • @systemfsoftware/tsconfig 2.0.1 and @systemfsoftware/vitest 2.0.0 come from the systemfsoftware flake tarballs, the same pin as build(repo): scaffold xstate on the starter's lake1 toolchain #13.
  • Catalog: exact pins from the fork's lockfile, plus a peers catalog for published peer ranges: effect ^4.0.1, react ^19.3.0, fast-check ^4, vitest ^5. 6440575 fixes peers that had resolved to exact pins; the packed manifests from nix build .#workspace-tarballs show the ranges.
  • rolldown-plugin-dts@0.28.6 keeps the monorepo's patch (systemfsoftware#624). Without it, local declarations leak into the published types and the recorded API reports stop matching. The flake hands patches/ to the store builder.
  • xstate's tsconfig.test.json gets types: ["node"]. TS 7 defaults types to []; the monorepo got node types only transitively.
  • The workspace deps hash moves with the lockfile: sha256-VzJPe60x…. build(repo): scaffold xstate on the starter's lake1 toolchain #13's dist leg now builds the tarballs on a fresh store, so a stale hash fails CI.

This repo's vitest config

vitest.shared.ts builds two projects per package:

  • own: every fork-written test, under the @systemfsoftware/vitest/guard setup file.
  • upstream-verbatim: exactly the files in that package's upstream-tests.json, with globals and without the guard.

The bypass is declared in the file under CONST-W3. Reason: upstream's tests register cases with vitest's own it, which the guard refuses, and XS3 forbids editing them. The unit that removes it is U4, the oracle lane in PR 3. No shared judgment surface was edited.

Guard probe: a raw import { it } from 'vitest' test placed in xstate-store/tests/ fails in own with ✗ this test was registered with vitest's it; import it from @systemfsoftware/vitest. The probe was deleted afterwards.

Rulings on systemfsoftware#631

# Commit Evidence
#2 fb65b02 dprint.json excludes packages/*/{test,src}/**/*.test.{ts,tsx} in one glob. It also excludes **/etc/*.api.md, because dprint rewrites api-extractor reports and api:check then fails.
#4 fork b85905f7 plus forkTestConfig src/select.test.ts runs in upstream-verbatim. Store went from 9 files / 294 tests to 10 / 300. Sabotage toBe('Sabotaged') → FAIL |upstream-verbatim| src/select.test.ts > select > should get current value.
#5 7db8aa4, 394121c No MutableRef remains in any packages/*/src. Campaign state is threaded through Ref. failureSeen/frozenSwarm are per-run state that the fast-check adapter owns (createRunSequencer) and passes to each run through the new TestAdapterRunContext (Q2). xstate-test stays 39/481, including reportingOptions.test.ts:144.
#8 fork ad40ac9a, cd71843 Type-level test xstate-store/tests/observer-parity.test.ts, checked by tsc -b. Removing | undefined from the store's error → TS2344 … Pick<Observer<number>, SharedObserverMember>.
#9 001e440, 74ab024 safeCall rethrows on a macrotask through a timer port local to xstate-effect (src/reportUnhandledError.ts); core's public API is unchanged (Q4). The order test expects ['microtask-marker','timer-marker','error-A','error-B']; switching the port to queueMicrotask fails at effectActor.test.ts:89.
#10 001e440, 74ab024 toJSON already returned upstream's { xstate$$type: 1, id }. A test pins '{"xstate$$type":1,"id":"identified"}'; tag 1 → 2 fails at effectActor.test.ts:113.
#11 f756359 One changeset per package. xstate-effect and xstate-test name the effect peer moving to ^4.0.1; the other four state they carry no effect peer. check-changeset.ts covers all six.
#12 3959677 The two ported cases that computed @code from machine.config or String(fn) now spell out the printed source. Changing one character → FAIL … inline guards/actions serialize to code directives.
#13 dcfe72e Upstream's try { body } finally { dispose } lets a throwing disposal win. ensuringFinalizerWins is used at all five pairs. Tests cover both failing, only the finaliser failing and only the body failing; flipping the precedence → expected Error: the scenario failed to be Error: the disposal failed.
REPO-W10 679ede8 Root AGENTS.md → Working Rules.

Rulings on this PR's questions

Q Commit Evidence
Q1 release gate 4341b8d (+ #13 dde24c0) debt-ledger.yaml records each package as XS1 debt with its removing unit (U9, U11, U12, U13, U13, U14). The planner outputs packages=[] and lists the six exemptions in the summary. Deleting core's entry → publishable package without a mutation script and without an XS1 debt-ledger entry, exit 1.
Q2 adapter run state 394121c See #5 above.
Q3 gate lint:tsgo and attw cb678a7 gate:tasks and lint run lint:tsgo, and gate:tasks/gate:dist run attw. Sabotages: a setTimeout inside Effect.sync in xstate-test → effect(globalTimersInEffect), Failed: @systemfsoftware/xstate-test#lint:tsgo. export * from './nonexistent.js' in store-react's built declaration → attw InternalResolutionError, rc=1. Both reverted, both green after. xstate-effect's test file was rewritten to clear 5 lint:tsgo errors without suppressions: it.live generators, Deferred, an Effect-clock timer marker and Schema decoding.
Q4 no core export 74ab024 _reportUnhandledError is gone from core's exports and etc/xstate.api.md.
Q5 macOS — Routed to release-tooling as a fix to #606's builder.

Verification (local at 376354f; 4341b8d differs only in #13's sandbox-proofs/, whose proofs pass with LD_DYLD_PATH set)

  • pnpm format:check: ok.
  • turbo lint lint:tsgo typecheck typecheck:node test:scripts attw: 26/26 tasks pass.
  • pnpm gate:dist: 12/12 tasks pass (build with api:check, and attw).
  • pnpm test:sandbox: 2 passed (12 steps).
  • Release-gate planner: packages=[], six ledger exemptions, exit 0.
  • Tests, one package at a time with --maxWorkers=4: xstate 145 files / 2420 passed (29 skipped, 3 todo); xstate-effect 8/137; xstate-react 8/141; xstate-store 11/300; xstate-store-react 2/24; xstate-test 39/481.
  • 71d97cc gives tests/declaration-emit.test.ts its own 60s budget. Each case spawns tsc, and all three timed out on the hosted runner at vitest's 5s default.

Public packages, released from GitHub

Ryan's correction: the six packages are public, released packages of a public repository. Releases are git tags and GitHub Releases, and consumers take the Nix flake. No step runs pnpm publish or npm publish.

  • bcea357 reverts 3af3169. private comes off all six manifests, and publishConfig has access: "public" and provenance: true again next to exports. They do nothing without a publish step. The pnpm alpha lane is gone.
  • a800d03 merges the scaffold, which takes main's shared release toolchain (release.jsonc, pnpm-release-management's reusable release.yml and changeset-check.yml) and deletes the local release scripts, release-set.json and the alpha-lane code.
  • The package docs still install from the flake (d88f4b0).

Blocked on pnpm-release-management

One requirement, owned by pnpm-release-management's workstream: version non-private workspace packages without pnpm's registry probe, and keep their prerelease line (6.0.0-alpha.N → 6.0.0-alpha.N+1).

  • At 0bfb079, prm's pnpm strategy runs pnpm version -r (packages/version-engine/src/bump.ts:143). For each non-private package, pnpm 12.9's first-release check looks the package up on registry.npmjs.org. A never-published package gets a 404 and is held at its manifest version forever (pnpm#13519). These six are never published, so they never move.
  • prm's other mode (surfaces) does not probe, but it bumps the version core and drops the prerelease (6.0.0-alpha.64 → 6.1.0), which would claim a stable line the fork does not have.
  • The release cycle takes every non-private member (packages/github-release-engine/src/cycle.ts:18, publishable = private !== true in packages/workspace-adapter/src/WorkspaceStoreLive.ts:73). That already matches these six packages. The gap is only in versioning.

This PR stays a draft until that lands on prm's main and this repo's input moves to it. There is no local tag script and no workaround in the meantime.

Six packages of statelyai/xstate branch `next` at
2146ae26ebfc7e6a624b3a1f237f9e6ddc30b9f5 (MIT, Copyright (c) 2015 David
Khourshid) are copied unchanged under packages/xstate/, as owned members
(REPO-O1). Upstream is a reference, never a merge source.

- packages/core -> packages/xstate/xstate
- packages/xstate-effect -> packages/xstate/xstate-effect
- packages/xstate-test -> packages/xstate/xstate-test
- packages/xstate-react -> packages/xstate/xstate-react
- packages/xstate-store -> packages/xstate/xstate-store
- packages/xstate-store-react -> packages/xstate/xstate-store-react

Identity: every copied src/ and test/ tree object equals the upstream tree
object at the pin (git write-tree --prefix vs git rev-parse <pin>:<dir>),
except xstate-store/test, which differs only by the excluded files below.

Excluded (build configuration, or tests of bindings this repo does not fork):
- packages/{core,xstate-effect,xstate-test,xstate-react,xstate-store,xstate-store-react}/vitest.config.mts
- packages/xstate-store/vitest.config.vue.mts, vitest.config.solid.mts
- packages/xstate-store/test/{vue.test.ts,UseActor.vue,UseActorRef.vue,UseSelector.vue} (imports @xstate/vue)
- packages/core/{actors,durable,fsm,graph,validation}/package.json (preconstruct entrypoint stubs)
- packages/core/.gitignore, packages/xstate-store-react/tsconfig.json

Added: the repository's root MIT LICENSE in xstate-effect and
xstate-store-react, which upstream ships without a package LICENSE.

Declared bypass (CONST-W3): committed with --no-verify. The pre-commit hook
runs dprint fmt over staged files, which would rewrite upstream sources and
break the tree identity above. The commit message was checked with
`pnpm exec commitlint`. Formatting lands as the next, separate commit; the
dprint check gate runs on the pull request head.
Gate: `./bin/dprint check` (check:local, check:static). The verbatim import
in the previous commit keeps upstream's formatting so its tree identity holds;
this commit is the formatter's output over packages/xstate/** and nothing else.
The six imported packages become workspace members under
`@systemfsoftware/*` names through the `packages/xstate/*` glob (plan U2).

- Manifests: MIT, upstream's versions, workspace dependencies and catalog
  versions; tsdown builds every upstream subpath, each with its own API
  Extractor report. Scripts: build, typecheck, test, lint:tsgo, attw,
  api:check, api:update. No lint and no mutation script until each package's
  rewrite layer (plan KTD2, KTD10).
- Vitest configs carry upstream's per-package settings at the pin (globals,
  environment, includes, resolve conditions) on the shared config.
- Core's and xstate-react's tests pin zod 3.25.76, the version upstream's
  lockfile resolves for them; xstate-test, xstate-store and
  xstate-store-react pin zod 4.6.5.
- Core's bin/xstate.js is removed: it only ran `npx @xstate/codemod`, and
  the codemod is not forked.
- packages/xstate/AGENTS.md records the pin, the members, what is not forked
  and why, and the family's leaf rules. Every README carries the fork clause.

Adding workspace members re-resolves the `catalog:stryker`
`latest` specifiers, which moves @systemfsoftware/stryker-js 14.0.0 to 15.0.1

Plan docs/plans/2026-10-05-2317-feat-xstate-v6-fork-plan.md (U2)
… guard

Kiro ruled option 1 for L1 of the xstate fork plan. Declared bypass
(CONST-W3): rule KTD8 of @systemfsoftware/vitest (the guard refuses a case
registered with vitest's own it); case: the upstream statelyai/xstate tests
imported verbatim in df92a9ad3f, which are the oracle and are never edited;
removal point: plan U4 (L2) deletes the in-tree tests, the manifests and
these exemption entries together

- vitest-config's guard exemption table names one project per xstate
  package, `upstream-verbatim`. Its include is exactly the files that
  package's upstream-tests.json lists, never a folder glob.
- scripts/guards/check-upstream-test-manifest.ts (run by guard:projects in
  gate:tasks and gate:local) fails when a manifest names a file the import
  commit did not bring in or lists a file the tree no longer holds, so a
  list can only shrink. Each manifest records its reason and removal point.

Evidence (sabotage, reverted)
- An added own test under the guard: "this test was registered with
  vitest's it; import it from @systemfsoftware/vitest"
- A copy of an upstream test under a name not on the list: red
- test/new.test.ts appended to a manifest: the guard exits 1 with "not an
  imported upstream test still in the tree"
…s them

Each xstate package's vitest config splits its tests into the guard-exempt
`upstream-verbatim` project (the files its upstream-tests.json lists, with
upstream's globals) and the guarded `own` project for every other test file.
Environment, resolve conditions and inlined deps follow upstream's
per-package config at 2146ae26. xstate-store and xstate-store-react keep
upstream's include scope (test/ and src/), so xstate-store's
src/select.test.ts stays unrun, as upstream leaves it

Also restores upstream's `#is-development` imports map in xstate and
xstate-react, which the U2 manifests dropped; core's sources import it
- tsdown names each package's root entry `index`, so its generated exports
  map the root subpath `.`; package.json exports are tsdown's output
  (REPO-S4), and the API Extractor reports read dist/index.d.ts
- The vitest configs alias upstream's package names (`xstate`,
  `xstate/<subpath>`, `@xstate/<name>` and subpaths) to the fork's
  `@systemfsoftware/*` packages, so the verbatim upstream tests run against
  the fork without being edited. The shared config's own alias is kept
… xstate

Gate-forced repairs in the imported sources (plan U3), no behaviour change

- Module specifiers in import, export and declare-module statements move
  from `xstate` and `@xstate/<name>` to the fork's `@systemfsoftware/*`
  names (72 sites in 48 files). `Symbol.for` brand keys such as
  '@xstate/effect/action' and runtime message text keep upstream's strings
- tsdown (rolldown) refuses a value import of a type-only export
  (MISSING_EXPORT at src/assert.ts, src/createActor.ts, ...). Those imports
  are marked `type`, applied mechanically by oxlint's
  typescript/consistent-type-imports fixer over non-test sources only
…t off them

Kiro ruled verbatim means verbatim. The dprint commit 6c22c870d had
reformatted the 212 upstream test files the manifests list; this commit
restores exactly those files to their content at the import commit
df92a9ad3f (git restore --source, no history rewrite)

Declared bypass (CONST-W3), beside the test-guard exemption: rule, the
dprint check gate; case, the same 212 verbatim upstream test files, which
are the oracle and are never edited; removal point, plan U4 (L2) deletes
the files, the manifests and these excludes together

- dprint.json excludes list exactly those files, written from the
  manifests by scripts/guards/check-upstream-test-manifest.ts --write, never
  a folder glob
- The guard now also fails when dprint.json excludes a path under
  packages/xstate that no manifest lists, or misses one a manifest lists, so
  the excludes shrink with the manifests

Evidence
- git diff df92a9ad3f -- <listed files> is empty
- ./bin/dprint check exits 0
- Sabotage, reverted: excluding packages/xstate/xstate/src/index.ts makes the
  guard print "excluded but not listed" and exit 1
… examples

Gate-forced repairs (plan U3), ruled by Kiro

- xstate-test: Effect 4.0.1 removed `Schema.toArbitrary`; Schema arbitraries
  now run on Effect's own engine (effect/Arbitrary), not fast-check.
  `fromEffectSchema` draws a fast-check integer as the seed and samples one
  value with `Arbitrary.sampleEffect`, so a run replays from fast-check's
  seed. A failing generated value does not shrink
- xstate-test: the U3 specifier rename had rewritten a runtime message
  string; it names '@xstate/test/effect-schema' again, as upstream's
  schema.test.ts asserts
- xstate-test, xstate-store, xstate-store-react: zod 4.4.3, the version
  upstream's lockfile resolves (4.6.5 changed partialRecord key generation)
- core: test/typeStates.test.ts imports type names from
  src/typestates.types.ts with a plain import. Upstream's esbuild elided that
  import; the repo's tsconfig sets verbatimModuleSyntax, so vite's oxc
  transform keeps it, the module loads, and its module-scope example call to
  `declare function accept` throws "accept is not defined". The examples are
  now `satisfies` expressions, which type-check the same way and emit no call
…erbatim

Kiro ruled both ports. Each port is the pinned upstream file with only the
named cases changed, between port markers. The manifest records the
upstream path, its blob at the import commit, the reason and the line span
of each case. The drift check fails if a line outside a marked case
changes, or if the pinned upstream blob differs from the recorded one.

- xstate-test test/engine/propertySuite.port.test.ts. Toolchain cause:
  the test-runner API. Vitest 5 refuses a suite declared inside a running
  test. The case "describeTestSuite (vitest globals) > runs the generated
  fixtures" now declares the suite at file scope with the vitest globals,
  so each generated fixture is its own case.
- xstate test/serialization.conformance.v6.port.test.ts. Toolchain cause:
  printer text (oxc vs esbuild). The cause was probed on the file itself.
  esbuild 0.28.2 prints "(_) => void 0" with two-space indentation, which
  matches upstream's snapshots. oxc (rolldown binding 1.2.9, vite 8's
  transformer) prints "(_) => undefined" with tabs, which matches what the
  fork received. The two cases now assert that each `@code` equals
  String(fn) of the same inline function.

Proofs, each reverted afterwards. Editing propertySuite line 12 makes the
guard exit 1 at :12. Editing serialization line 184 (between the two
cases) or line 135 makes it exit 1. A wrong recorded blob makes it exit 1.
The guard selftest passes 9 cases. Both ports pass: 14 and 10 tests
Kiro ruled each retirement. The manifests record the upstream path, the
reason and the replacement, and the drift check keeps every retired file
out of the tree and out of the dprint excludes.

- xstate test/declarations.test.ts drives the TypeScript 6 compiler API,
  and the repo compiles with TypeScript 7 only. The replacement is
  tests/declaration-emit.test.ts, which emits the same fixtures with the
  TypeScript 7 tsc and asserts no diagnostics, the size bounds, one
  readonly c0 and p0 member, names from the entry point only, and a
  consumer that compiles against the emitted declaration. Two cases pass.
  The diagnostics case is red: TypeScript 7 reports type errors in four
  upstream fixtures, which the U3 typecheck repairs fix.
- xstate-effect src/lint.test.ts and xstate-react test/lint.test.ts run
  upstream's root oxlint plugins, which are not forked. Their fixtures go
  too. The replacement is the repo's own lint gate over the package
  sources.

Every upstream-verbatim suite passes: xstate 2417 with 29 skipped and 3
todo, xstate-effect 135, xstate-test 478, xstate-react 141
…sion

The package manifests set "type": "module", so the TypeScript 7 build
and its nodenext resolution read the sources as ESM. Upstream mixed
extensionless specifiers with .ts ones. Under ESM, TS2835 refuses the
extensionless ones and TS5097 refuses the .ts ones without
allowImportingTsExtensions. An unresolved module types as any, so every
type core reached through one collapsed to any. That any is what made
the event-descriptor validator build a string index of "Event type
'${any}' is not declared" and reject the declared GO, and what
implicitly typed the invoke input callbacks as any.

All 477 relative specifiers in the 135 non-test source files of the six
packages now name the .js file or /index.js directory entry, which is
the repo's convention. Verbatim upstream tests are not touched.

In core, TS2835 and TS5097 go from 218 to 0, and the declaration-emit
replacement's diagnostics case passes. The other two cases also had
probe bugs, fixed here: the name probe now imports every referenced
name from the entry point instead of aliasing generics without their
arguments, and the consumer now resolves the parent only through its
emitted .d.ts, with the parent source removed. All six packages' suites
pass: xstate 2420 with 29 skipped and 3 todo, xstate-effect 135,
xstate-test 478, xstate-react 141, xstate-store 294, xstate-store-react
24. Removing InferEvents from the entry point turns the name case red
Gate-forced repairs (plan U3). The repo's TypeScript 7 config enables
exactOptionalPropertyTypes, noUncheckedIndexedAccess and
noPropertyAccessFromIndexSignature, which upstream never compiled with.
tsc -p tsconfig.app.json in packages/xstate/xstate went from 289 errors
to 0, across 37 source files, and runtime behaviour is unchanged.

- Index-signature reads use bracket access (TS4111).
- Indexed reads are narrowed by an existing invariant or an explicit
  check that throws what upstream would have thrown. No new non-null
  assertion, any cast or suppression comment is added.
- Optional members a value really leaves undefined declare
  `| undefined`. This affects 22 public types, among them StateSchema,
  StateConfig, ActorOptions, Observer, LogicConfig, SetupSchemas and
  SetupStateSchema. Upstream compiled without exactOptionalPropertyTypes,
  where `?:` already accepted undefined, so each change keeps what a
  consumer could already pass and narrows nothing.

vitest run --bail=0 in the package still reports 145 files and 2420
passed, 29 skipped and 3 todo
…am's options

Kiro ruled that the verbatim tests are typechecked and never skipped.
Each package gets a second test project, tsconfig.upstream-test.json,
which its tsc -b solution now references. The project is generated by
scripts/guards/check-upstream-test-manifest.ts --write, and the check
fails when the generated file and the tree differ.

- Its compilerOptions are upstream's root tsconfig.json at 2146ae26,
  vendored byte-for-byte as packages/xstate/upstream-tsconfig.json. The
  check recomputes that file's git blob and refuses anything other than
  upstream's 312be9e.
- Each change on top of upstream's options is listed with its reason in
  the package's upstream-tests.json under typecheck.additions:
  - noEmit, composite, emitDeclarationOnly, outDir and tsBuildInfoFile,
    because a tsc -b reference must emit.
  - customConditions, so @systemfsoftware/* imports resolve to source.
  - paths for xstate and @xstate/*, generated from the packages' source
    exports.
  - types, adding node, which vitest 5's globals no longer bring in.
  - module preserve with bundler resolution. The fork's packages are
    type: module, so nodenext would read upstream's extensionless test
    imports as ESM.
- Its include lists exactly the verbatim test files, every port, the
  upstream helper files under test/ that they import, and the src JSON
  files they read. tsconfig.test.json excludes the same list, so every
  file is in exactly one of the two projects.
- A third port, xstate-store test/atom.port.test.ts, handles vitest 5
  typing an untyped vi.fn() as Mock<Constructable | Procedure>. Inside
  its one marked case, the inline mock is now typed
  vi.fn<(value: number) => void>().

All six upstream-test projects report 0 errors under TypeScript 7.0.2
(tsc -p tsconfig.upstream-test.json --noEmit). Each of these sabotages,
reverted afterwards, makes the check exit 1: turning off strict in a
generated project, editing the vendored tsconfig, leaving a verbatim
file in the repo test project, and editing the atom port outside its
case. Reverting the port's vi.fn typing brings back TS2769. Debt: the
whole upstream-test project is one entry, removed when layer 2 ports the
tests to the repo's style and its include list is empty
…'s strict flags

Gate-forced repairs (plan U3), done the same way as core. Every count
below is `tsc -p tsconfig.app.json` errors, from before to after:
xstate-effect 11 to 0, xstate-test 171 to 0, xstate-react 6 to 0,
xstate-store 31 to 0, and xstate-store-react 26 to 0 (all of
xstate-store-react's came from xstate-store).

- Index-signature reads use bracket access.
- Indexed reads are narrowed or destructured.
- Callbacks that fall through now return explicitly.
- ModelTestFailure.cause is marked override.
- xstate-test's two node-reading modules reference node types, since
  the tsconfig preset does not include them automatically.
- Optional members a value really leaves undefined declare
  `| undefined`. In xstate-store that covers Store.schemas,
  StoreLogic.eventTypes and schemas, and StoreValidationError.eventType.
  In xstate-test it covers the engine's replay, fixture, exploration,
  suite and linearizability records. These widen and never narrow:
  upstream compiled without exactOptionalPropertyTypes, so `?:` already
  accepted undefined.

No runtime behaviour changes. tsc -b in each of the six packages, from
a clean cache and including the new upstream-test projects, exits 0
with no errors. Under effect 4.0.1 the suites report xstate 2420 passed,
29 skipped and 3 todo, xstate-effect 135, xstate-test 478, xstate-react
141, xstate-store 294 and xstate-store-react 24
…n test

- Commits the API Extractor report for every entry point of the six
  packages (20 reports, written by pnpm api:update). The build's
  api:check compares against them, and the published-surface comparison
  in the plan starts from them.
- Adds publishConfig.provenance to the six manifests, which gritlint's
  npm-provenance rule requires of every non-private package.
- Adds tests to core's tsconfig.test.json include, so the TypeScript 7
  declaration-emit test is typechecked. guard:projects found it in no
  project
API Extractor's api:check fails on any warning, and upstream's comments
raised 43 across four packages: ambiguous links to overloaded or merged
declarations, links to names an entry point does not export,
multi-line code spans, bare braces and angle brackets, and dotted
@PARAM names. Overloads are linked by index, as in (createMachine:1).
Names an entry point cannot link become code spans. Spans are reflowed
onto one line. Only comments change, and five API reports regenerate.
api:check now passes in all six packages
Write every conditional operand as an explicit comparison so the rule sees a
boolean type instead of a truthiness test. lint:tsgo reports 75
strictBooleanExpressions diagnostics before this commit and 0 after
Give the schema-record map callback a concise body, since its block only
returned an array. lint:tsgo reports 1 unnecessaryArrowBlock diagnostic before
this commit and 0 after
Give ActorScope's service key and the three tagged errors' Data.TaggedError
keys the package-and-path form the rule expects. The error classes keep their
historical short `_tag` and `name` so the published contract and upstream tag
assertions hold. lint:tsgo reports 4 deterministicKeys diagnostics before and 0
after
Rethrow a listener's exception on a microtask instead of a macrotask timer,
so the failure still surfaces asynchronously without the global timer the
rule rejects. lint:tsgo reports 1 globalTimers diagnostic before and 0 after
Settle the hosted-effect promise through Effect.callback and Effect.runPromise
instead of constructing one by hand, so a failure still rejects with the
squashed cause. lint:tsgo reports 1 newPromise diagnostic before and 0 after
Run the durable transition through Effect.exit and read the thrown value from
the cause, instead of a try/catch inside the Effect generator. lint:tsgo
reports 1 tryCatchInEffectGen diagnostic before and 0 after
Call a wrapped action through a typed view that names the hosted shape, so
neither the call nor the narrowed result carries any or unknown error and
requirements channels. lint:tsgo reports 2 anyUnknownInErrorContext
diagnostics before and 0 after
Host each fromEffect Effect through startHostedEffect, which now carries the
requirements channel and runs it against the actor's own context, instead of
asserting the channel away. lint:tsgo reports 3 unsafeEffectTypeAssertion
diagnostics before this commit and 0 after
Stop exporting the internal host helpers and safeCall, exposing them through
one internals object, and name waitFor's narrowing predicate so both of its
call styles describe one shape. Regenerate the API reports. lint:tsgo
reports 10 missingPipeableSignature diagnostics before and 0 after
Give each cross-module helper (withEffectHost, createEffectHost, bindEffectHost,
startHostedEffect, runHostedEffect, relayToParent, safeCall) a data-first and
data-last form with Function.dual, and export the waitFor predicate from the
entry point. lint:tsgo reports 0 diagnostics before and after
The gate is pnpm --filter @systemfsoftware/xstate-test lint:tsgo
effect(globalTimers) drops from 1 to 0
PropertyTest's drain yields its macrotask turn through Effect.sleep(0) rather than the global setTimeout
The gate is pnpm --filter @systemfsoftware/xstate-test lint:tsgo
effect(newPromise) drops from 3 to 0
The outcome registry, the drain turn and the page-settle microtask yield run through Effect.callback
The gate is pnpm --filter @systemfsoftware/xstate-test lint:tsgo
effect(globalConsole) drops from 2 to 0
The printed reports log through Effect.log with a console logger that keeps their verbatim output
The macOS leg failed ERR_PNPM_TARBALL_INTEGRITY on stryker-js-17.0.2.tgz: nix on Darwin builds unsandboxed, and pnpm pack composes CHANGELOG.md from the registry's published history even with offline set, so the tarball took 861 changelog lines there and 9 on sandboxed Linux. The pack step now points pnpm at a closed local port, so the bytes follow the pinned source alone; sandboxed and unsandboxed rebuilds are identical and match the lockfile's integrity
Kiro ruling on Review13PredicateR2 P0: #13's gates run attw, so #13 needs the attw CLI #14 already builds. This ports #14's 317b179: arethetypeswrong-cli 4.2.0 is built from the released tag d43a8020, and effect-cell-types 7.0.0 from its release tag 4cf0f770 for the attw install alone. The catalog entry points at file:.sfs-deps/arethetypeswrong-cli-4.2.0.tgz, so no @systemfsoftware/* package comes from the registry

nix/attw/pnpm-lock.yaml carries the effect-cell-types 7.0.0 integrity #14 measured after 13349a7 moved the build into the sandbox (sha512-ongebnJP…), not the pre-sandbox value 317b179 recorded

(cherry picked from commit 317b179)
Kiro ruling on Review13PredicateR2 P0: #13's gate:tasks runs #14's set, lint lint:tsgo typecheck typecheck:node test test:scripts attw, the lint leg runs lint:tsgo and the dist leg runs attw after build, as #14's cb678a7 does

packages/starter is the only member, so it takes the lint:tsgo and attw scripts and their devDependencies. attw found that its exports name dist/index.js while tsdown emitted dist/index.mjs and index.d.mts, a NoResolution under node16-esm and bundler. tsdown now emits .js and .d.ts, the files the exports already name. attw runs with --profile esm-only: the package ships no CommonJS, so node10 and node16-cjs resolution do not apply, and an export naming a file the build did not emit still fails

CONST-W3: this changes packages/starter, which the predicate's clause 5 holds unchanged, because the ruling requires attw to execute against packages/starter and pass

The root lockfile takes the two devDependencies and the workspace deps hash moves with it
Kiro ruling on Review13PredicateR2 P1: the guard that refuses an @systemfsoftware/* package resolved from registry.npmjs.org ran only in nix run .#<instance>-lock, never in CI. The root task //#assert-local-sfs runs it on pnpm-lock.yaml and every nix/*/pnpm-lock.yaml, and //#test:scripts depends on it, so the test leg's pnpm test and check:ci's gate:tasks both run it with no new job, workflow or env switch. It keeps turbo's default output logs, so the CI log names the task and the files it read

scripts/assert-local-sfs.test.ts runs the guard on a lockfile fixture resolving @systemfsoftware/effect-cell-types@12.0.0 from the registry, which must fail and name the line, and on every committed lockfile, which must pass. test:scripts takes --allow-run=awk for it, and its turbo inputs take the lockfiles and the guard so a lockfile change reruns it
…gates into the packages

Brings #13's fixes for Kiro's ruling on Review13PredicateR2. The attw from-source instances, the gate:tasks set and the lint:tsgo task were already here from 317b179 and cb678a7, so the packages' side of flake.nix, pnpm-workspace.yaml and pnpm-lock.yaml stands. packages/starter stays deleted, as f61708f left it. The //#assert-local-sfs task and scripts/assert-local-sfs.test.ts arrive new and run on this branch's four committed lockfiles
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
…eam subtree layer

Brings the //#assert-local-sfs task and scripts/assert-local-sfs.test.ts from #13 through #14. The guard reads pnpm-lock.yaml and nix/*/pnpm-lock.yaml only, so the upstream lockfiles under repos/xstate-upstream stay outside it
main's #24 drops the macOS check:ci leg from CI and #26 drops the darwin systems from the flake, nix/dprint.nix and nix/comment-checker-sandbox.nix. The scaffold's flake keeps its lib binding and takes main's two Linux systems. #13 had no CI run on 59f3b22 because the flake.nix conflict left the pull request dirty
…ackages

Brings main's #24 and #26 through #13: no macOS CI leg and Linux-only flake systems
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
… the upstream subtree layer

Brings main's #24 and #26 through #13 and #14: no macOS CI leg and Linux-only flake systems
…ffold

Brings main's #27, which conflicted in pnpm-workspace.yaml and pnpm-lock.yaml.
The catalog takes #27's "@effect/tsgo": ^0.50.0 and keeps the scaffold's other pins.
minimumReleaseAgeExclude keeps the scaffold's "@effect/*" entry, which already
covers the @effect/tsgo platform packages #27 lists one by one. The registry
@systemfsoftware/* entries main lists are not taken, because the scaffold
resolves those from local tarballs.

pnpm install --lockfile-only re-resolved pnpm-lock.yaml to 0.50.0. The
workspace deps hash was re-measured sandboxed and confirmed with
nix-build --check
… the packages

Brings main's #27 through #13. The catalog takes "@effect/tsgo": ^0.50.0 and
keeps the packages' "@microsoft/api-extractor" pin. pnpm install --lockfile-only
re-resolved pnpm-lock.yaml, and the workspace deps hash was re-measured
sandboxed and confirmed with nix-build --check
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
…p into the upstream subtree layer

Brings main's #27 through #13 and #14, with the re-resolved lockfile and the re-measured workspace deps hash
…s into the scaffold

Brings main's #5 (nixpkgs 4975466 to c59305b) and #6 (comment-checker 00cc6a6 to 3bfedd8). Both conflicted in flake.lock.
flake.lock keeps the scaffold's lock and re-locks only comment-checker, to 3bfedd8, together with that input's own rust-overlay.
nixpkgs stays at the scaffold's aa48d34. That pin is newer than c59305b, so it already covers #5's bump, and it carries the lake1 toolchain (pnpm 12.9.0, Node 24) the scaffold was pinned for in 6e30cfb.
pnpm-lock.yaml is unchanged, so the workspace deps hash is unchanged; workspace-tarballs builds sandboxed
Brings main's #5 and #6 through #13: comment-checker re-locked to 3bfedd8 and nixpkgs kept at aa48d34, with pnpm-lock.yaml and the workspace deps hash unchanged
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
… upstream subtree layer

Brings main's #5 and #6 through #13 and #14: comment-checker re-locked to 3bfedd8 and nixpkgs kept at aa48d34
Base automatically changed from xs/scaffold to main October 7, 2026 06:21
kiro-systemf Bot pushed a commit that referenced this pull request Oct 7, 2026
* refactor(repo): delete the starter seed package

The template seed package has no place in the xstate workspace; the fork packages arrive in the next layer

* docs(repo): name the repository xstate

README, AGENTS.md and CONTRIBUTING.md describe the xstate fork instead of the starter template, and the CI badge points at systemfsoftware/xstate. STRATEGY.md was the starter kit's product strategy, so it goes rather than mislead; xstate has no strategy document yet

* ci(ci): move mutation to a release gate on main

As in the starter's lake1/release-gate: Stryker runs at break 100 on every push to main, one hosted job per package with a mutation script, and the shard planner refuses an empty or unmatched mutate set. check:ci no longer runs mutation

* build(deps): pin the starter's lake1 toolchain and run dependency code in the sandbox

pnpm 12.9.0 and Node 24 come from Nix (nixpkgs aa48d34), with exact catalog pins matching effect-endgame-starter-kit lake1/nix-sandbox: effect 4.0.1, typescript 7.0.2 with @effect/tsgo 0.48.1, oxlint 1.82.0 with @systemfsoftware/oxlint-config-recommended 4.0.0, vitest 5.0.3, turbo 2.11.7, dprint from nix. The @systemfsoftware packages are file: tarballs from the systemfsoftware flake input. Every script that runs dependency code, the git hooks and every workflow go through pnpm-release-management's sandbox launcher (with the starter's linked-worktree patch), installing offline from a hashless pnpm store. The flake exports each public workspace package as a tarball through lib.mkPnpmWorkspacePackages

* build(repo): fail the commit-msg hook when git cannot list the staged files

Taken verbatim from effect-endgame-starter-kit e89877a, the template owner's change to this evaluator. Inside the sandbox a git failure made stagedFiles return an empty list, so the diff-shape rules passed vacuously; git's error now fails the hook, which the sandbox git-hooks proof asserts

* build(deps): pin systemfsoftware to the #606 head that builds on aarch64-darwin

At c53bfc9, the starter's pin, systemfsoftware's workspace deps hash holds only on linux, so the macOS check:ci leg failed building its tarballs (specified ttbWYFJ, got x2Rm/ViN; the starter's own macOS leg fails the same way). bb5956b measures the hash per system, and its CI builds the flake outputs on aarch64-darwin, aarch64-linux and x86_64-linux. Its nixpkgs is aa48d34, the same as ours, and pnpm-release-management's lib is byte-identical at both pins. The lockfile records the sandboxed tarball integrities, and the workspace deps hash follows the lockfile

* build(deps): trust mitm-cache's CA in the pnpm store build on darwin

pnpm 12 is a native binary whose platform verifier reads SSL_CERT_FILE on linux and the keychain on darwin, so the offline store build failed on macos-latest with UnknownIssuer against the mitm-cache replay. NODE_EXTRA_CA_CERTS hands the replay's CA to pnpm on every system. Probe: on linux with SSL_CERT_FILE unset the build fails with the same UnknownIssuer, and it passes once NODE_EXTRA_CA_CERTS is set

* build(deps): replay the pnpm store's registry over plain http

Trusting mitm-cache's CA was not enough on darwin. macos-latest then rejected the forged leaf certificates with 'invalid peer certificate: EkuError', which no CA setting reaches. The store build now points pnpm at http://registry.npmjs.org/ and serves mitm-cache's recorded https tree under http, so no TLS is involved on any system. Every tarball is still authenticated by its lockfile integrity. Probe: with SSL_CERT_FILE, NIX_SSL_CERT_FILE and NODE_EXTRA_CA_CERTS all unset, the linux store builds, and bootstrap then installs 241 packages offline from it with none downloaded

* build(deps): pin pnpm-release-management to the #8 head for the darwin runtime dir

With the launcher at 149e762, the macOS leg failed in pnpm bootstrap with ERR_PNPM_STORE_DIR_OPEN_OPERATION_LOCK: pnpm 12 takes its store-operation lock under XDG_RUNTIME_DIR, falls back to /tmp, and the darwin profile refuses /tmp. 8f19844 (prm#8, stacked on #5 at 149e762) gives darwin runs a private 0700 XDG_RUNTIME_DIR and proves the failure without it. nix/lib is unchanged between the two pins, so systemfsoftware's tarballs keep their store path, and the starter's linked-worktree patch applies with offsets only

* fix(repo): let the sandbox proofs and script tests run on macOS

Two macOS-only failures surfaced once the store and bootstrap worked there. Deno refuses a spawn under the scoped --allow-run while the child environment carries an LD_* or DYLD_* variable, which the macOS runner sets, so the git-hooks proof died at its first git call; its children now get the caller environment minus those variables. Turbo strict env mode dropped TMPDIR, so script tests fell back to the /tmp the darwin profile refuses (PermissionDenied: tmpdir); TMPDIR now passes through, as in pnpm-release-management 8f19844. Repro on linux: with LD_LIBRARY_PATH set, the old proof fails with NotCapable

* ci(ci): build the workspace tarballs in the dist leg

The tarball builder's fetchPnpmDeps hash covers the whole lockfile, and a store that already holds the old output reuses it silently. A fresh runner store refetches, so building .#workspace-tarballs there fails on a stale hash instead of shipping it (Kiro ruling on #13, question 2)

* ci(ci): plan release-gate mutation from each stryker config and the debt ledger

Kiro rulings #2, #3, #4 and #5 on #13. The planner imports each package stryker.config.ts and reads its mutate list, refusing a package.json that still carries stryker.mutate. Every publishable package either declares a mutation script or has an XS1 entry in debt-ledger.yaml naming its removing unit; a package with neither, an empty workspace, or a plan with nothing mutated and nothing exempt is refused, each as its own tagged refusal. The summary lists the ledger-exempt packages. Every parsed document decodes through Effect Schema. stryker.shared.ts imports StrykerConfig as a type so Deno can load a package config; its values are unchanged. The scripts and gate tasks reach registry.npmjs.org for npm:effect and may run git and bash for the new script tests

* ci(ci): test the release cycle and fix the release PR opener

Kiro rulings #6, #8, #11 and #12 on #13. The tag-based published check splits into the pure owedPackages and the git-backed isTagged, both tested against a real repository. plan-release exports decidePhase and renderOutputs and pins the release, version and none lines release.yml gates on. open-release-pr.sh decides from the packages/*/package.json delta against the base instead of a clean tree, which pnpm version -r always leaves, and no longer names apps/

* build(repo): pass dprint arguments through unchanged

The wrapper put the first argument before the Nix plugins and the rest after, so dprint --version and calls without a subcommand failed. It now execs dprint with the caller arguments verbatim and seeds dprint plugin cache from the pinned store wasms. A sandbox proof checks --version, check on an unformatted file and lint-staged fmt --allow-no-files -- order; the old wrapper fails the --version case

* ci(ci): run sandboxed workflow steps through one composite action

Kiro ruling #7 and the P3 credential finding on #13. .github/actions/sandbox takes hosts, env names and a command through env, so no input is interpolated into a shell, and the four workflows use it for every sandboxed step; host-side writes to GITHUB_OUTPUT and the step summary stay in their own steps. Every release.yml checkout sets persist-credentials false. tag-released-packages.ts gains --no-push, the sandbox creates the tags, and a host step pushes them with an explicit token header, so the token never enters the sandbox

* test(repo): spawn every sandbox proof without the dynamic-loader environment

The dprint wrapper proof failed on macOS with NotCapable: Deno refuses a scoped --allow-run spawn whose environment carries LD_DYLD_PATH. The git-hooks proof already dropped LD_* and DYLD_*; both proofs now spawn through sandbox-proofs/spawn.ts, which keeps that filter in one place. With LD_DYLD_PATH set on linux the old dprint proof fails the same way and the new one passes

* build(repo): seed the dprint plugin cache as a writable copy

Review finding C13-1/C13-22 on #13. The wrapper linked the seed with ln -sfn, which nests a link inside a stale real plugins directory and points the cache into the read-only store. It now replaces stale entries with a writable copy, stamped with the seed path; a sandbox proof pre-creates a real plugins directory and fails on the old wrapper

* test(ci): cover the release PR opener against an open PR

Review finding C13-5 on #13: the close path (no version bump) and the edit path (bumps) now each have a case, and each fails when its gh call is removed

* ci(ci): let the release notes steps fetch octokit

create-github-releases.ts imports npm:octokit, which Deno downloads from registry.npmjs.org when it runs. The three steps that run it allowed only jsr.io and api.github.com, so they failed on the first fetch (reproduced with an empty DENO_DIR). This is a dependency fetch, not a publish

* feat(release): release the packages listed in release-set.json

Nothing here goes to npm, so every workspace package is private and private no longer means unreleased. release-set.json is the one source of what releases: scripts/lib/release-set.ts decodes it and refuses an unknown or duplicate entry, a listed package that is not private and any workspace package that is not private. Tagging, the release plan, the changeset check, the mutation planner and the flake tarballs all read it. A version is owed once pnpm version -r records it in .changeset/ledger.yaml and it has no tag; an intent counts as pending until the ledger lists it for every package it names, because a pnpm lane keeps consumed intent files. The GitHub Release body is that version's section of the package CHANGELOG.md

Also applies review findings C13-2/3/4 (refusal tests), C13-8 (ledger entry type from its schema) and C13-11 (package names decoded against npm's name grammar before they reach the release-gate shell)

* ci(ci): let the release-set readers fetch effect

check-changeset, plan-release and tag-released-packages now decode release-set.json with Effect Schema, so Deno downloads npm:effect from registry.npmjs.org when they run. With only jsr.io allowed, plan-release failed on a cold Deno cache. This is a dependency fetch, not a publish

* test(repo): pin the hooks a git-hooks proof commit runs

One pnpm test:sandbox run let a named-path feat commit of a tooling-only file land in 9ms, with no lint-staged output: git ran no hooks at all. The proof found its hooks through ambient discovery of a relative core.hooksPath, and commitlint passes an empty staged set, so an unhooked commit looked compliant. Every proof commit now passes -c core.hooksPath=<fixture>/.husky. A new step points ambient discovery at a missing directory and still expects the refusal; it fails without the pin

* build(deps): pin systemfsoftware to the merged #606

systemfsoftware#606 merged as 217c80d5d5. Its workspace tarballs build with the same bytes on every system, so the macOS leg's pnpm store accepts the integrity the lockfile records. Linux tarball bytes are unchanged (tsconfig-2.0.1 and effect-cell-types-12.0.0 hash to the recorded integrity), so the lockfile does not move. The systemfsoftware input stops following this repo's pnpm-release-management pin, because 217c80d calls mkPnpmConsumerStore, which that pin lacks

* build(deps): build the release gate's stryker from source and plan it with stryker plan

Kiro's C13-19 rulings: the release gate stops planning mutation with a repo-local glob matcher, and no @systemfsoftware/* package is fetched from registry.npmjs.org, at install or build. stryker-js 17.0.2, its typescript-checker 8.2.1 and vitest-runner 8.1.1 and their nine siblings are built in this flake from stryker-js-effect at 3db0c428 (flake = false input), through a committed overlay workspace and lockfile under nix/stryker-js/ and the existing hashless pnpm store, and packed into file:.stryker-deps tarballs the catalog resolves. nix run .#stryker-js-lock regenerates the overlay lockfile and refuses a registry-resolved @systemfsoftware/* entry.

The release gate's plan job lists the workspace packages with a mutation script, runs stryker plan over them, and scripts/stryker-plan-gate.ts refuses a plan that schedules no mutant for such a package (C13-13: a project resolved outside the root is refused too) or is vacuous with no ledgered debt; each matrix shard runs stryker run --plan --shard. The plan gate's tests are what test:scripts now runs, since the local release scripts left with main's shared toolchain

* ci(ci): run the intent check in the dev shell

pnpm-release-management's reusable changeset-check installs the caller's workspace with a bare pnpm install, which cannot read the file:.sfs-deps and file:.stryker-deps tarballs only this repository's Nix dev shell provides (ERR_PNPM_TARBALL_READ_LOCAL_TARBALL on effect-cell-types-12.0.0.tgz). The same check now runs in this workflow: the dev-shell action installs offline through the sandbox, and the sandbox runs changeset-management check against the pull request's base. The CLI comes from a new release-tools flake input pinned to pnpm-release-management's main (5432b8b), which keeps its own nixpkgs because its deno-compile runtime is pinned to that deno; the existing pin stays for mkPnpmWorkspacePackages

* build(repo): build every from-source package through one parameterized builder

nix/from-source.nix replaces nix/stryker-js.nix: pname, src, the overlay
directory, the packed list and the extra store files are arguments, and the
generic helpers move to nix/from-source/. The lock app and the deps directory
are generated from the instance map, so nix/stryker-js holds only its own
manifest data.

Every tarball a workspace here installs now lands in .sfs-deps: the
systemfsoftware flake's workspace tarballs plus the tarballs this flake builds
from source, so the catalog, the root lockfile, the pnpm store, the
workspace-source copy and the dev shell carry one directory instead of two.
The stryker tarballs are byte-identical before and after

* build(repo): build from-source packages inside the nix sandbox

CI's sandboxed nix failed the stryker-js tarballs with ERR_PNPM_NO_OFFLINE_TARBALL (reused 0), so every job died building the dev shell; local nix runs with sandbox = false, which hid it. Three faults, all sandbox-only. pnpm got the read-only store path, so it reused nothing; it now gets the writable view the sandbox launcher builds (index.db copied, every other entry linked, clone-or-copy import). pack.mjs renamed the packed tarball across filesystems (EXDEV); it copies now. And unsandboxed, pnpm pack fetched the published CHANGELOG of @systemfsoftware/stryker-js from registry.npmjs.org and prepended it, so the lockfile recorded an integrity for bytes that came through the registry. The sandboxed stryker-js-17.0.2.tgz carries only the repo's own changelog entry; the lockfile takes its integrity and the workspace deps hash moves with it. The other eleven stryker tarballs are byte-identical under the sandbox

* build(repo): keep the starter package in the scaffold

Kiro's ruling (cycle 27): the scaffold leaves packages/starter in place, byte-identical to main, so turbo enumerates a workspace package at this head and pnpm-release-management's turbo-gated changeset check evaluates instead of refusing an empty workspace. The deletion moves to the layer that adds the six fork packages, so no head in the stack has an empty workspace. The catalog regains the two pins the starter needs (rimraf 6.1.3, tsdown 0.23.0, the versions the packages layer pins), the lockfile gains its importer and the workspace deps hash moves with it

* build(deps): pin release-tools to the pnpm-release-management main that fetches sandboxed

Every CI job died building the dev shell: 5432b8b declares sha256-SljOBg for the changeset-management pnpm deps, and a sandboxed fetch yields sha256-ERG1u8 each time, on CI and locally (nix-build --check, sandbox on). This host's unsandboxed copy had hidden it. c10c1c4, main after #5, re-fetches its deps byte-identically under the sandbox. pnpm-release-management stays at 8f19844 for its sandbox launcher, whose commits main does not carry

* build(repo): pack from-source tarballs without the registry's changelog

The macOS leg failed ERR_PNPM_TARBALL_INTEGRITY on stryker-js-17.0.2.tgz: nix on Darwin builds unsandboxed, and pnpm pack composes CHANGELOG.md from the registry's published history even with offline set, so the tarball took 861 changelog lines there and 9 on sandboxed Linux. The pack step now points pnpm at a closed local port, so the bytes follow the pinned source alone; sandboxed and unsandboxed rebuilds are identical and match the lockfile's integrity

* build(deps): build the attw CLI and its effect-cell-types 7 from source

Kiro ruling on Review13PredicateR2 P0: #13's gates run attw, so #13 needs the attw CLI #14 already builds. This ports #14's 317b179: arethetypeswrong-cli 4.2.0 is built from the released tag d43a8020, and effect-cell-types 7.0.0 from its release tag 4cf0f770 for the attw install alone. The catalog entry points at file:.sfs-deps/arethetypeswrong-cli-4.2.0.tgz, so no @systemfsoftware/* package comes from the registry

nix/attw/pnpm-lock.yaml carries the effect-cell-types 7.0.0 integrity #14 measured after 13349a7 moved the build into the sandbox (sha512-ongebnJP…), not the pre-sandbox value 317b179 recorded

(cherry picked from commit 317b179)

* ci(repo): gate the starter on lint:tsgo and attw

Kiro ruling on Review13PredicateR2 P0: #13's gate:tasks runs #14's set, lint lint:tsgo typecheck typecheck:node test test:scripts attw, the lint leg runs lint:tsgo and the dist leg runs attw after build, as #14's cb678a7 does

packages/starter is the only member, so it takes the lint:tsgo and attw scripts and their devDependencies. attw found that its exports name dist/index.js while tsdown emitted dist/index.mjs and index.d.mts, a NoResolution under node16-esm and bundler. tsdown now emits .js and .d.ts, the files the exports already name. attw runs with --profile esm-only: the package ships no CommonJS, so node10 and node16-cjs resolution do not apply, and an export naming a file the build did not emit still fails

CONST-W3: this changes packages/starter, which the predicate's clause 5 holds unchanged, because the ruling requires attw to execute against packages/starter and pass

The root lockfile takes the two devDependencies and the workspace deps hash moves with it

* ci(repo): run the assert-local-sfs guard on the committed lockfiles

Kiro ruling on Review13PredicateR2 P1: the guard that refuses an @systemfsoftware/* package resolved from registry.npmjs.org ran only in nix run .#<instance>-lock, never in CI. The root task //#assert-local-sfs runs it on pnpm-lock.yaml and every nix/*/pnpm-lock.yaml, and //#test:scripts depends on it, so the test leg's pnpm test and check:ci's gate:tasks both run it with no new job, workflow or env switch. It keeps turbo's default output logs, so the CI log names the task and the files it read

scripts/assert-local-sfs.test.ts runs the guard on a lockfile fixture resolving @systemfsoftware/effect-cell-types@12.0.0 from the registry, which must fail and name the line, and on every committed lockfile, which must pass. test:scripts takes --allow-run=awk for it, and its turbo inputs take the lockfiles and the guard so a lockfile change reruns it
#13 landed on main as the squash commit 27107a0, so main no longer shares the scaffold's commits with this branch and the pull request went dirty.
27107a0's tree is byte-identical to xs/scaffold's head 5417a60, and 5417a60 is already an ancestor here. The merge therefore keeps this branch's tree unchanged (strategy ours): every line main brings is already present through the scaffold's own commits
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
…pstream subtree layer

Brings main's squash commit 27107a0 for #13 through #14, so this layer shares main's history. The tree is unchanged
…ages

Brings main's #28 (squash 928d17c): both Deno planner steps in release-gate.yml declare jsr.io and registry.npmjs.org, and sandbox-proofs/release-gate-planner.test.ts runs those steps on exactly the hosts the workflow declares
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
… into the upstream subtree layer

Brings main's #28 through #14: the release-gate planner steps declare jsr.io and registry.npmjs.org, and test:sandbox runs them on exactly those hosts
@systemfsoftware-maker
systemfsoftware-maker marked this pull request as ready for review October 7, 2026 07:15
…ages

Brings main's #29 and #30 (ff44090) into #14. The release-gate mutation step passes GITHUB_ACTIONS through the sandbox, and release-gate.test.ts derives that list from stryker-js's main-CI guard
Kiro ruling on the #14 ce-code-review, finding 1 (P0): the dprint exclude packages/*/{test,src}/**/*.test.{ts,tsx} silently exempted every future test in any package from the formatter.

dprint.json now lists the exact files from packages/*/upstream-tests.json: the 206 verbatim upstream test files plus the 3 *.port.test.ts ports, 209 paths. Today the old glob matched those same 209 files, so nothing is reformatted and dprint check passes; any test added under packages/ from now on is formatted unless a manifest lists it.

scripts/dprint-upstream-excludes.test.ts runs in test:scripts. The first test fails if an exclude under packages/ is a glob, or is neither a manifest path nor a file whose git blob is a manifest's recorded typecheck blob (packages/upstream-tsconfig.json), or if a manifest path is not excluded. The second fails if any exclude, including a root-level pattern, matches a package test the manifests do not list. turbo's test:scripts inputs gain dprint.json, the manifests and the package test files so the cache cannot replay a stale pass.

As a sabotage proof on a throwaway copy, each of these makes the suite fail: re-adding the old glob, packages/xstate/test/*.test.ts, a hand-written test path, a non-manifest source file, a directory, dropping one manifest file, **/*.test.ts, **/tests/** and **/*Precedence*

CONST-W3: dprint.json is a judgment surface (START-1) and the test is a new check. Both change on the explicit ruling of their owner (Kiro), not on the maker's own judgment
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
…s into the upstream subtree layer

Brings #14's 42d0000 (dprint excludes the manifest-listed upstream tests only, checked by scripts/dprint-upstream-excludes.test.ts) and its merge of main's #29 and #30. turbo.json's test:scripts inputs keep both sides: this layer's subtrees.toml and repos/xstate-upstream/** and the packages layer's dprint.json, manifests and package test files
@kiro-systemf
kiro-systemf Bot merged commit 9f01956 into main Oct 7, 2026
7 checks passed
systemfsoftware-maker added a commit that referenced this pull request Oct 7, 2026
#14 landed on main as the squash commit 9f01956, so main no longer shares the packages layer's commits with this branch and the PR went dirty. 9f01956's tree is byte-identical to the packages head 42d0000, and 42d0000 is already an ancestor here. The merge therefore keeps this branch's tree unchanged (strategy ours); every line main brings is already present through the packages layer's own commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant