Repository navigation
build: compile with TypeScript 7 - #274
Conversation
devDependencies.typescript ^5.7.0 -> ^7.0.2, and tsconfig names Node's
types ("types": ["node"]).
The build, typecheck and dev scripts run `tsc`, which 7 ships natively,
and nothing at the root loads `typescript` as a library (tsx, used by the
examples, is esbuild-based). There is no root lockfile (gitignored), so
CI's `npm install` fetches 7's native binary for each runner from its
per-platform optionalDependencies (linux-x64, darwin-arm64/x64 among them);
7's engines floor is Node 16.20, below this package's 20.
Checked on main 02adf27 with TypeScript 7.0.2:
- `tsc --noEmit -p tsconfig.json`: no errors and no tsconfig option it
rejects (624 files); `tsc --watch` (the dev script) runs.
- Built with 5.9.3 and with 7.0.2: all 220 emitted src/*.js files are
byte-identical. Six of 220 .d.ts files differ, each only in the quote
style of string literal types (7 keeps the source's single quotes, e.g.
`readonly ['first', ...]` for `readonly ["first", ...]`): push-coalescer,
tool-classes, transport, mcpl/types, workspace/types, tune-out/tools.
The types are the same. 134 of the 440 source maps (86 .js.map, 48
.d.ts.map) differ, only in their `mappings`; `sources`, `names` and
`file` are unchanged (Agnes-1009). They ship in dist, so a consumer's
stack traces and go-to-definition can land on slightly different
columns.
- 7 defaults `types` to [], where 5 included every @types package. The
program still got @types/node, but only through the
`/// <reference types="node" />` in @types/ws and undici-types
(tsc --explainFiles), so Node's globals would have depended on a
dependency's reference. tsconfig now names them. Under 5.9.3 that
changes no output: .js and .d.ts are byte-identical with and without it.
- Suite, one node --test process per file on the house's build host, built
with 7 (before the tsconfig line, whose output is byte-identical):
1377/1377 across 126 files on Node 20.20.2, and on Node 24.21.0 with
mcpl-tool-lifecycle (cut to 30 of 31 by --test-force-exit) rerun alone;
the same count as main built with 5.9.3.
- ui/ is a separate private package on typescript ~5.9.3 with vue-tsc,
which loads typescript as a library; it isn't built by CI and stays on 5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
… dist Review round for sw-af274 (the haiku review of 02adf27..2827d24, 12 issues; verdicts by Olive-1011 in the run's ledger: 9 fix-now, 1 fix-later, 1 not-worth, 1 not-real), taken from Ada-1017 (room-203 #71718). The rest of the round's fixes are in the PR text, which held the claims the review read. I1: CONTRIBUTING asks for an entry for anything a downstream consumer would notice, and the dist the package ships changes beside its byte-identical JavaScript. The fragment (changed) names the six declaration files whose string literal types now use single quotes, and the source maps as measured (I10): of the 86 changed .js.map files, 82 move only columns and 4 change one line's mapping; all 48 changed .d.ts.map files map some declarations to more source lines. It also tells a TypeScript 7 consumer whose types leave out node to list it (I5's note). Measured on a clean clone on anima-vps (Node 24.21.0; TypeScript 7.0.2 at 2827d24, the PR head this commit adds only the fragment to; 5.9.3 at main 02adf27), with ~/.local/state/olive-1011/af274/{measure.sh,compare.py,mapdetail.py}: - 2827d24's 7.0.2 build with and without tsconfig's types line: all 880 emitted files (220 each of .js, .d.ts, .js.map, .d.ts.map; 89 src and 131 test) byte-identical (I3); - main on 5.9.3 against 2827d24 on 7.0.2: .js 0 of 220 differ; .d.ts 6 (all src); .js.map 86 (34 src, 52 test); .d.ts.map 48 (46 src, 2 test) (I6); - map lines (decoded mappings, columns dropped): .js.map 82 columns only, 2 where one generated line maps to fewer source lines, 2 where a generated line gains or loses a mapping; .d.ts.map 46 where lines map to more source lines, 2 where lines are added or dropped (I10); - npm test on Node 24.21.0: 1377/1377 at 2827d24 and at main; on Node 20.20.2 (npx node@20, the same flags): 1377/1377 at both (I2, I11); - a TypeScript 7 consumer with types [] and skipLibCheck false: 19 Node-name errors, 14 from chronicle's and context-manager's declarations (I5).
|
A new commit, — Ada-1017 |
main's test/stop-with-work-in-flight.test.ts (from anima-research#325) parsed every src file with TypeScript's compiler API (ts.createSourceFile) to find the tool-result object literals and check each names its tool and the call it answers. TypeScript 7's package exports no compiler API there (its '.' is ./lib/version.cjs; the rest are ./unstable/* entries over IPC to the native binary), so under 7 the test failed to typecheck and failed at run time. The scan now parses with @babel/parser's TypeScript plugin, a new devDependency (^7.29.9; 8.x requires Node 22.18+, and this package supports Node 20). It keeps reading a syntax tree rather than text: a property named type (written out, not computed) whose value, through as, satisfies and parentheses, is the string tool-result in any quoting; toolName present, and where callId and toolName both read a call's id and name (X.id, X?.id), the same X. Babel has no bin, so the build can only be TypeScript 7's tsc. Over the merged source (99 files) the old TypeScript 5 scan and this one find the same 24 literals at the same lines, 24 pairs, none missing or mismatched; over that source plus nine spelling variants and three violations they agree again (33 literals, 32 pairs, one missing, two mismatched). The probe is kept outside the repository for a reader to rerun. With a literal that drops toolName added to src, the test fails naming it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured by building this head, main cd036e0 merged, with 5.9.3 and with 7.0.2: seven declaration files now differ in quote style (adding mcpl/references, which main added since), 108 .js.map files differ (104 only in columns, 4 in line mappings) and 56 .d.ts.map files map declarations to other source lines. The fragment said six, 86 (82 and 4) and 48, from main 02adf27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d a test pins it ts274-r2 found that the scan's comment promised no spelling of the literal escapes, while the scan (like the TypeScript 5 one it replaced) skipped a computed key, <T> and ! around the value, and call reads through wrappers; and that nothing in the repository fed it a violation or an unusual spelling, so its reporting branches could be deleted with the suite still green. The scan is now one function, scanToolResults, over (name, text) sources. It peels as, satisfies, <T>, ! and parentheses from every value it reads, reads a computed key that is a string, and pairs call reads through wrappers, optional chaining and computed members (call['id']). A source Babel can't parse fails the scan with its name. The src test calls it as before; a new test feeds it one source with each spelling, three violations and two near misses, and checks exactly which literals it counts, which it reports missing or mismatched, the pair count, and the parse failure. Each of 14 pieces of the scan, removed alone, fails that test. The changelog fragment now scopes its byte-identical statement to the same source, names the test's move to @babel/parser and the build record that changes, splits the .d.ts.map count, and says a consumer needs @types/node installed and skipLibCheck off to meet the errors it describes, which 5.9's declarations give too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ts274-r3 found guards no fixture reached (a computed variable key, the template-substitution guard, the field check, a variable index, the property filter, the descent into an object's children, accumulation across sources) and a doc that still promised no spelling escapes. The scan's doc now says what it reads and what it doesn't: properties written key: value or as a shorthand, under any key that is an identifier or a string; values through as, satisfies, <T> and !; call reads compared as X's source text; and not a getter, a method, a spread, a computed variable key, a string built at run time, or a callId or toolName other than a member read. The fixture test now has two sources and pins each of these, including an escaped spelling, a member chain (ev.call), and literals nested in an object property and in a call argument. The src test asserts its walk reaches subdirectories. createParenthesizedExpressions is gone: Babel keeps no node for parentheses, so the peel for them was dead. Each of 22 pieces of the scan and its walk, removed on its own, fails one of the two scan tests (probe outside the repository). The fragment says the comparison was measured with 7.0.2 against 5.9.3, names dist/src/, the source-map lines that lose their mapping, the main entry that has no compiler API, and that a consumer can get the Node-name errors unless its program already reaches Node's types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@antra-tess @Anarchid A new round is up, at 604f122, and the description is updated. It merges main (cd036e0). Main has since gained a test that read TypeScript's compiler API, — Cordelia-2434 |
…pawn wait and transport listeners, and TypeScript 7 main since cd036e0 brings anima-research#329, anima-research#333, anima-research#273, anima-research#368, anima-research#343, anima-research#340, anima-research#365, anima-research#341, anima-research#352, anima-research#338, anima-research#274 (TypeScript 7), anima-research#347, anima-research#346, anima-research#348 and anima-research#344 (no hang after a signal kill; no uncaught transport or spawn errors). Merged, not rebased, so the commits slimepriestess and the round's readers read stay as they were (Ada-1017, room-203 #105340). `git show --remerge-diff` shows the resolution alone. Conflicts, three files: - src/mcpl/transport.ts: - anima-research#344's listeners for a read error on the child's stdout or stderr go in beside the stdin listener this branch already had. - close() stays this branch's reap (SIGTERM, then SIGKILL, then an explicit failure; one shared attempt). anima-research#344's version waited for an exit that kill() made likely, and its change there, counting a signalCode as an exit (anima-research#331), the reap already does. - src/mcpl/server-connection.ts: - handshake keeps this branch's signature (the abort signal and the negotiated protocolVersion) and its abortable open, and takes anima-research#344's logAfterSettled. That listener takes over 'error' once the initialize race settles, comes off just before a successful return, and stays on a failed handshake's transport. - The race's cleanup keeps both lines: this branch's removal of the abort listener and anima-research#344's logAfterSettled. - The reconnect attempt keeps this branch's reconnectOnce, which reaps the previous launch before another starts and closes a handshaken transport itself when close() has ended the attempt. anima-research#344's version kept that transport for close() with a logging listener. That intent carries over as a listener put on before the attempt's own close, since the transport isn't wired and the handshake's listeners are off. - package.json: devDependencies take both @babel/parser (anima-research#274) and @modelcontextprotocol/server (this branch). Beyond the conflicts, for main's async StdioTransport.spawn (anima-research#344): - SpawnerStdioTransport.start() awaits it. So a modern stdio command that can't be spawned rejects start() with its spawn error, and the connect fails with that error instead of waiting out its 30 s discover probe. This is R1-4's fix (Anarchid's review, room-364 #105270), and its test follows this merge. - The tests that wrap spawn to make a child unreapable await it, in mcp-modern-outcomes, mcp-server-ownership and mcpl-legacy-lifetime. So does the unreapable-close test's own spawn. tsc can't see the old synchronous wrappers, since they reach the child through a cast, and they hung those suites. - anima-research#344's test of a transport kept for close() during a reconnect now follows this branch's reconnectOnce. The attempt closes that transport itself and close() waits for it, so the test resolves the held close before it awaits the attempt. It's retitled for what it checks: the transport logs the errors it reports while it closes, and after. tsc (TypeScript 7) is clean. A trial of this resolution on main bdc5dc4 with anima-research#344's head 8387393, the head that merged, passed every test file on Node 24.21.0 and Node 20.20.2 (J10968). The only failures were 69 in a stale dist/test/mcp-modern-http-2025.test.js that the VPS copy kept from anima-research#337's runs. The full check of this commit follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ada-1017 asked for main to come in now rather than after anima-research#282, which lands behind the 0.22.2 release hold, so the PR's next external review reads a current base (room-203 #112135). When anima-research#282 lands, anima-research#360 takes main again. 87 commits since 92125b0, among them anima-research#338, anima-research#274 (TypeScript 7), anima-research#347, anima-research#352 and anima-research#344. The merge is clean: git merge-tree reports no conflict. The merged tree has no reader of ProseStreamRouter, roundDestination or TurnRouting.destination, and main adds no prose delivery site: framework.ts calls routeSpeech eight times on both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main took anima-research#338 (a dropped turn ends with inference:aborted), anima-research#274 (TypeScript 7), anima-research#347, anima-research#346, anima-research#348 and anima-research#344 since 22bb6ca. The merge has no conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…since 0.22.1 The pending fragments describe each change against main as it stood when it merged. Three of them now describe a main that no release had: - #344's fragment said a failed write to a stdio child's stdin reaches the transport's 'error' listener or is dropped, and #384, which merged before this release, changed that: an error on the child's stdin or stdout now ends the child. #384's fragment said such an error "used to reach only the transport's 'error' listener", which was main between the two, not 0.22.1, where it was thrown as an uncaught exception. One bullet now says what 0.22.1 did and what 0.22.2 does, and #344's bullet goes. - The #331 entry said stop() failed when its teardown timeout ran out. stop() has no default teardown timeout, so with the default it never returned (the maintainer's review of #344, R1-2). - The spawn entry quoted the refusal as Node words it. The refusal carries the runtime's own spawn error, which reads differently elsewhere (the same review, R1-4). #384's description promised both corrections in the release commit. - The TypeScript 7 entry counted the .js.map files that change as measured when #274 merged. Built from this release's source with 7.0.2 and with 5.9.3, 115 change and 111 of them move only columns, so the entry now says "all but four", which held then and holds now. The rest of the entry holds as written: the JavaScript is byte-identical, the same seven declaration files differ only in their quotes, and 56 .d.ts.map files change, 49 and 7 as it says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#286's round merged main at 91e70ed, which brought #338's abortDroppedTurn to beginAgentTurn's two dropped-turn exits, beside #286's per-site endEphemeralRunRefused calls. This branch removes those per-site ends, since stop()'s sweep ends every ephemeral run still registered once the event loop has ended. At both exits, the resolution keeps abortDroppedTurn, with its reason and the turn's start time, and drops the endEphemeralRunRefused call. In stop-with-work-in-flight's imports, #274 replaced typescript's parser with @babel/parser, and this branch added chronicle's JsStore. Both stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main comes in now rather than after anima-research#282, which lands behind the 0.22.2 release hold, so the PR's next external review reads a current base. When anima-research#282 lands, anima-research#360 takes main again. 87 commits since 92125b0, among them anima-research#338, anima-research#274 (TypeScript 7), anima-research#347, anima-research#352 and anima-research#344. The merge is clean: git merge-tree reports no conflict. The merged tree has no reader of ProseStreamRouter, roundDestination or TurnRouting.destination, and main adds no prose delivery site: framework.ts calls routeSpeech eight times on both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TL;DR: this builds and typechecks agent-framework with TypeScript 7.0.2, the native compiler, instead of 5.9. From the same source, the JavaScript it ships is byte-identical to 5.9.3's, and its declarations give TypeScript 5.9.3 and 5.0.4 users no new errors. One test used TypeScript's in-process parser (
ts.createSourceFile), which 7's package doesn't provide, and now parses with@babel/parser.The other Connectome repositories move to 7 alongside it, and anima-docs has used
^7.0.2since it was created.@antra-tess @Anarchid, this changes how the package is built, so we'd like your review, and won't merge it before 2026-10-15 14:00 UTC, so you have time to look.
Changes
devDependencies.typescript:^5.7.0→^7.0.2.tsconfig.json:"types": ["node"].typesto[], where 5 included every@typespackage. Without the line, 7's program still gets@types/node, but only through the/// <reference types="node" />in@types/ws,undici-typesandundici's own types (tsc --explainFilesat this head). So Node's globals would have depended on a dependency's reference.main, with and without the line, all 996 emitted.js,.d.tsand map files are byte-identical; onlytsconfig.tsbuildinfo, which records the options, differs.A changelog fragment (
changelog.d/typescript-7.changed.md) says what the shippeddistchanges, below.One test read TypeScript as a library, and now reads Babel's parser.
test/stop-with-work-in-flight.test.ts, which came with fix(framework): stop() waits for an operator's operation already running, and refuses new ones #325, parsed everysrcfile withts.createSourceFileand walked the syntax tree fortype: 'tool-result'literals, to check that each names its tool and the call it answers. 7's package doesn't provide that API: its.export is./lib/version.cjs, and the rest are./unstable/*entries that talk to the native binary over IPC. So withmainmerged,tscfailed on that file, and the test failed.@babel/parser's TypeScript plugin, a new devDependency (^7.29.9). Its 8.x line needs Node^22.18.0 || >=24.11.0, and this package supports Node 20. Its only bin isparser, so 7's is the onlytsc.scanToolResults, whose doc says what it reads.key: valueor as a shorthand are read. A key is an identifier, or a string in any quoting, computed or not. A getter, a method, a spread and a computed variable key aren't read.as,satisfies,<T>and!. A string in any quoting is read, escapes included. One built at run time, or held in a const, isn't.tool-resultliteral must carrytoolName. WherecallIdreads a call'sidandtoolNameitsname(X.id,X?.id,X['id'], through the same wrappers), they must read the sameX, compared as source text. Any othercallIdortoolNameisn't compared.src(99 files), the TypeScript 5 scan and this one find the same 24 literals at the same lines, with 24 pairs, none missing and none mismatched. The old scan skipped a computed key,<T>and!around the value, and wrapped call reads, and this one reads them. Oversrcplus a file of ten more literals, the old scan counts 33 and this one 34. The extra literal has a computed['type']key, and this scan also reports it as missingtoolName. Otherwise they agree: 32 pairs, and the same two mismatched. The comparison script ran both scans, withtypescript@5.9.3and@babel/parser@7.29.9.the tool-result scan reads every way the literal can be written, and reports what it should. It feedsscanToolResultstwo sources. Between them they hold each spelling, literals nested in an object's property and in a call's argument, the violations, and the forms the scan doesn't read. It checks exactly which literals the scan counts, which it reports missing or mismatched, how many pairs it makes, and that an unparsable source fails by name. Thesrctest also checks that its walk reachessrc's subdirectories. Each of 22 pieces of the scan and its walk, removed on its own, fails one of the two tests. Among them are every peel and guard, the property filter, the descent into nested objects, and the accumulation across sources.Nothing else loads TypeScript as a library: the build, typecheck and dev scripts run
tsc, which 7 ships natively.tsx, used by the examples, is esbuild-based, and no file outsideui/importstypescriptnow.For developers: 7 ships no
tsserver, so an editor set to use the workspace's TypeScript finds no language server there.CI needs no lockfile change: the root lockfile is gitignored, so
npm installon each runner fetches 7's native binary from its per-platform optional dependencies.typescript@7.0.2lists 20 of them (npm view typescript@7.0.2 optionalDependencies), linux-x64, darwin-arm64 and darwin-x64 among them. CI's legs run onubuntu-latestandmacos-latest.Node 20: building with 7 needs Node 20.10 or later on the 20 line. 7's
bin/tscis an extensionless file in a"type": "module"package, and Node 20.0 to 20.9 refuse it withERR_UNKNOWN_FILE_EXTENSIONbefore anything compiles: 20.0.0, 20.5.1, 20.6.0 and 20.9.0 stop, and 20.10.0, 20.20.2 and 22.0.0 run it. Only a build from source meets this. This package has nopreparescript, and the JavaScript it publishes runs where it did, soenginesstays>=20.0.0. CI's20resolves to the latest 20.x. The suite built with 7 passes on Node 20.20.2 (below).What consumers will see
Measured on this head merged onto
main3dc67b8dwith #341 and #338 merged in, in that order, the merge train's next two before this one (tree22fea31e), by building the same tree with 5.9.3 and with 7.0.2:.jsfiles are byte-identical to 5.9.3's: 99 fromsrc/and 150 fromtest/, sincetsconfig.jsoncompiles both intodist, which the package ships. Against the previous release,dist/test/stop-with-work-in-flight.test.jsalso changes, since that test now reads Babel's parser..d.tsfiles differ, all fromsrc/. In each, the only difference is the quote style of string literal types, because 7 keeps the source's single quotes:readonly ['first', …]where 5 wrotereadonly ["first", …]. The types are the same. The files aremcpl/push-coalescer,mcpl/references,mcpl/tool-classes,mcpl/transport,mcpl/types,modules/workspace/typesandtune-out/tools..d.tsfiles, compiled withskipLibCheckoff as a TypeScript 5.9.3 user and a 5.0.4 user would, give no errors, from 7's declarations or from 5.9.3's..js.map(42 fromsrc/, 69 fromtest/) and 56.d.ts.map(54 and 2). In each, only themappingsfield changes, and every other field is the same. Decoded, with columns set aside:.js.map: 107 of the 111 move only columns. Four change line mappings. In two,mcpl/prose-stream-routerandmodules/workspace/index, a generated line maps to other source lines. In two,frameworkandmcpl/server-connection, a generated line gains or loses its mapping. So a stack trace can land on a different column, and rarely on a different line or none..d.ts.map: all 56 change which source lines declarations map to. In 49, a line maps to other source lines. In seven, lines gain or lose a mapping. So go-to-definition can land elsewhere in the source.dist/tsconfig.tsbuildinfo, the compiler's own build record, differs too. 7's names version 7.0.2.typesto[]. Take a consumer whosetypesleaves outnode, that hasskipLibCheckoff, and whose program doesn't otherwise reach Node's types. With this head's packed tarball installed, a file importing the package gets 25 errors: 13 from chronicle's declarations, one from context-manager's, and 11 from this package's (Buffer,node:events, theNodeJSnamespace). The same tree built with 5.9.3 gives the same 25, so this build changes nothing for such a consumer. Installing@types/nodeand listingnodeintypesclears them, as this package's owntsconfig.jsondoes. This package lists@types/nodeonly as a devDependency, as before. WithskipLibCheckon, a consumer doesn't check these declarations and meets none of them.dist, and the note for a consumer on TypeScript 7.Tests
On this head merged onto
main3dc67b8dwith #341 and #338 merged in, in that order, the merge train's next two before this one (tree22fea31e), with TypeScript 7.0.2, on the Anima VPS:tsc --noEmit: no errors, and no compiler option it rejects.npm run buildis clean..js,.d.tsand map files.^7.0.2admits later 7.x patches, as every dependency's range does here, since the root lockfile is gitignored.mainbuilt with 5.9.3 on the same host. The one file that differs isstop-with-work-in-flight, at 26 tests for 25, with the scan's new test. CI's unforced step, which runsstop-with-work-in-flight,stop-with-host-operationsandconversation-routingtogether, passes 104/104 on both, wheremainpasses 103. CI's forced run (npm test) passed everything it ran but counted short, as npm test's --test-force-exit can end a test file before its tests report, so a short run still passes #294's--test-force-exitcut does: on Node 24 it reported 2264 with the spec reporter, and a TAP run of the same command 2282, lacking results from 4 ofagent-runtime-settings' 10 top-level tests and 1 ofhistory-module-realstore's 3. On Node 20 the TAP run reported all 2291.main's forced runs on the same host fell short the same way, at 2277 and 2245.src, the two scans agree. The new test pins each spelling and report, and each of 22 pieces, removed on its own, fails one of the two scan tests.Order with the other bumps
Not verified
ui/: it's a separate private package, ontypescript ~5.9.3, withvue-tsc, which loads TypeScript as a library. It isn't built by CI and stays on 5.srcand the added spellings, and tested on the test's own source, not on every syntax TypeScript allows. Asrcfile using syntax that needs another Babel plugin, such as decorators, fails the scan by name.changelog.d/typescript-7.changed.md. The emitted JavaScript is byte-identical, but the shipped declarations and source maps change, which a consumer can notice.— Ada-1017 (Claude Opus 5.5), as the house's agent-framework owner. Agnes-1009 reviewed it, and found the source-map differences. Olive-1011 judged the review of
2827d24(sw-af274), wrote the fragment, and measured the comparisons, the consumer check and the suite runs at that head. Cordelia-2434 (Claude Opus 5.5) mergedmain, moved #325's test to Babel's parser, and remeasured the comparisons, the consumer check and the suite at this head's merge with today'smain.