Interfaces become type aliases with comma members (extends becomes
intersection), and class privates use #names instead of the private
keyword.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Node builtins come in as node:-prefixed namespace imports;
multi-symbol internal imports use short namespace aliases (artifact,
cas, subst, db, api, executor). Single-symbol pulls, types, and the
buildfile DSL names stay braced, matching the sanctioned exceptions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per the house rule, const survives only where TypeScript hangs
behavior off the spelling: the <const T> type parameter in rule()
and the as const option tables.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Annotation colons are tight (ternaries keep their spaces), plain
double-quoted strings become single-quoted, and .editorconfig comes
over verbatim. Rule cmd values are untouched; the sheet rules reran
once because their tool sources are declared deps, byte-identically.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
deploy(ctx => ...) registers like rule() does, so a buildFile
co-locates each shipping block with the rules it ships instead of
one monolithic finish; the blocks run in registration order after
the build, sharing one output tree per module. The CLI slices the
registry across its sequential imports to know which blocks belong
to which file.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The xy and xyicons rsyncs move from ad-hoc scripts (updatexyicons.sh
and the untracked syncdexani.sh) into dir-mode deploy entries;
deploy smogon replaces both.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
deploy <names> -o <dir> materializes each entry's subset under
<dir>/<name>/<entry index>/ instead of running its command (tar
entries included), for eyeballing what would ship.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Nothing in tools/build or tools/deploy imports debug, and the
deploy package never imports sprite-data (its consumers live in
the root package, which declares it).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Unhandled rejections crash Node by default since v15, and node:sqlite
covers the Store: readBigInts replaces defaultSafeIntegers, a manual
BEGIN/COMMIT helper replaces transaction(), busy detection keys on
errcode, and lookupRule normalizes the null-prototype rows. No native
build step remains (allowBuilds gone from the workspace).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The deploy CLI gets a hand-rolled verb dispatch over per-verb
parseArgs option tables and one usage text; trim and
smogdexspritesheet are plain parseArgs calls. tools/build only
listed the dep without importing it.
The smogdex sheet rule depends on its tool's source, so it reran
once; the rebuild was byte-identical (stamps unchanged).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An entry with dir: true materializes its subset into a temp
directory whose path replaces %d in the cmd, instead of piping a
tar on stdin -- rsync-style transports (the PS ani sync) need real
files. The flag and %d must agree, so a forgotten one is caught at
config load.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A dying consumer destroys the tar pack and its pending entry sinks,
each of which emits the EPIPE as an unhandled streamx error and
crashed the process before the child's exit code was reported. Keep
the pack and its sinks quiet; the command's exit code is the report.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying is opt-in per name; with no names the verb prints each
deploy's buildFile and (subset, cmd) entries instead of shipping
everything.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An untracked json5 config maps deploy names to a buildFile plus
(subset globs, cmd) entries: the deploy verb builds the named
buildFiles, finishes each, routes the outputs through the subset
globs, and pipes one tar per entry to its command. Every glob must
match an output and every output must be covered by some entry.
The tar no longer carries __key; the upload command names the asset
set itself (smogonctl assets upload sprites).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
They are the buildFiles the upcoming deploy config points at; "deploy"
now belongs to the config entries that ship their outputs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- casInsert verifies an existing object's bytes before trusting it, fsyncs
before the rename, and the store records object sizes so a crash-truncated
object reads as dirty instead of clean forever.
- The driver hashes sources over the producer closure, so partial builds
(inspect) that pull in producers outside the demanded set work.
- Unknown executor errors are reported and abort the build instead of
vanishing into allSettled.
- %b/%B expand to nominal names at declaration (never CAS basenames), which
also puts name-dependence in the identity key; cmds are key-joined with
NUL so a multi-line command cannot collide with split commands. This
churns every rule key once.
- Rules must declare at least one output; output names reject shell-hostile
characters.
- run --link copies read-only (CAS) sources instead of hardlinking 0444
modes into deploy trees; ctx.list filters dotfiles and directories like
the build-side glob; inspect resolves targets against the invoking cwd.
- The registry dedupes identical declarations (same cmds/inputs/deps/
outputs/display), returning the existing artifacts, so shared rule sets
are plain functions and memo() is gone; ps.deploy.ts no longer declares
the gen5 gif set it never ships.
- rule() returns a tuple typed by its literal output list (single string
output returns the Artifact directly), so destructuring needs no
non-null assertions.
- Manifest is a class carrying the deploy ctx: set() rejects duplicate
keys, write(dst) emits the sorted JSON, and spritecopy/itemspritecopy/
stampcopy take just the manifest. The unstamped smogon sets (xyitems,
fbsprites, twittersprites) are deprecated and commented out.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pnpm build/deploy now run the umbrella CLI (build/deploy/run/inspect); the
fixed-name build/ tree, the old planner (rename detection, adopt, tamper
checks), and the vm deploy sandbox are gone. Also lands tools/deploy/api.ts
and the CLI, which earlier commits referenced but an overbroad local
gitignore pattern had silently excluded.
Migration: the store migrates the v1 db in place; build/ is dead and can be
deleted. A full rebuild repopulated .build/cas, and the old and new deploy
trees were diffed: byte-identical except the two multi-file hash pointers
(algorithm change), fb/twitter PNG re-encodes (pixel-identical; old outputs
predated current tool versions), and a stale 2023 orphan sprite the old
system never cleaned up.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
date:create/date:modify tEXt chunks made rebuilds nondeterministic, which
would churn every content-addressed name.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rules/ holds the shared sets (memoized) and the publish helpers that were
duplicated across the vm scripts; assets/smogon/ps .deploy.ts each declare
their rules and finish. The smogdex sheet is split into two chained rules,
retiring the undeclared spritesheet.png temp.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
makeCtx serves finish over the CAS and ActionQueue; cli.ts adds the
build/deploy/run/inspect verbs (unwired until cutover). Copy-mode
materialization chmods CAS-sourced files back to 0644.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keys resolve after producers finish, so there is no upfront plan; identical
keys share one execution, failures block dependents, and GC (union builds
only) drops undeclared keys then sweeps the CAS.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
helpers.ts is a pure move out of api.ts; artifact.ts introduces
Artifact-returning rule()/forEachRule() with execution-time content keys.
The old api.ts machinery still powers Buildfile.ts until cutover.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keeps the v1 file_cache on migration; failures are never recorded, so
failed and never-ran are the same state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
updatepmdsprites.sh is gone entirely; updateminisprites.sh loses its
spritesheet/forumsprites/dex-suffix steps and becomes updatexyicons.sh.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The deploy tool grows a deploy subcommand that runs the build, packs the
tar, and streams it to the command .env names. Packing now finalizes the
archive; without the end-of-archive marker, strict stream readers
(Python tarfile, hence smogonctl) die on truncation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
spritesheet, minisprites, pmd, and forumsprites now ship as a tar to the
__assets tree: __key leads the tar, and the mutable pointer files
(manifests, css suffix, minisprites hash) ride in __meta/ instead of
being published as immortal assets. xy and xyicons stay in
smogon.deploy.js on the rsync path for now.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the esbuild invocation that ran out of the smogon.com checkout:
the deploy script now stamps the webp, rewrites the css urls, and writes
the hashed css plus the suffix file that updateminisprites.sh ships to
/smog2/dex/spritesheet_css_suffix.txt. updateminisprites.sh no longer
depends on ~/smogon/smogon.com/run, esbuild, python, or zopfli/brotli
(css precompression dropped; to be handled separately). Minification is
also dropped (machine-generated css, ~same size compressed).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deployed names become <alias>-<HASH>.png (sha256/base32/8, same format as
the existing minisprites dir hash) with a manifest.json per set mapping
the unhashed name to the hashed one, riding the existing rsyncs. Other
deploy sections are unchanged; alias collisions now error via the
manifest-key check since hashed destinations no longer collide.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
They are outside the rule key, so a format change (like the one in the
previous commit) silently disabled rename detection for existing records.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Verify rename sources against recorded stats at copy time; colliding
rename destinations/sources fall back to running the rule
- Restrict rename detection to single-input, no-deps rules (sheet-style
rules embed input names in output bytes)
- Include input extensions in the rename template (magick picks output
format from extensions)
- Adopt only rules with no stored record, never known-dirty ones
- Skip dotfiles in glob (tup parity)
- Complete sheet dep closures (data/lib, lib/root)
- Validate --jobs; reject non-numeric values instead of silently no-oping
- Worker pool drains all workers before rethrowing; per-rule internal
errors abort scheduling instead of racing db.close()
- SIGKILL all live process groups on second Ctrl-C
- Transactional loadStoredRules snapshot; dry run without existing state
uses an in-memory db; idempotent DDL
- rule() rejects % placeholders in literal outputs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The build is now driven by tools/build (see Buildfile.ts). tupctime is
obsolete: the new tool hashes content behind a stat cache, so ctime/mtime
churn without content changes no longer causes rebuilds.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The .sheet.mjs files imported bare @smogon/sprite-data / @smogon/sprite-root,
which stopped resolving from the repo root after the TS7/Node 24 migration
dropped dist mains. Use explicit index.ts imports and add the workspace deps
to the root package.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>