Skip to content

Migrate to TypeScript 6.0; docs split and build/infra cleanup#161

Merged
aslanix merged 12 commits into
devfrom
dev-ts6
Jun 1, 2026
Merged

Migrate to TypeScript 6.0; docs split and build/infra cleanup#161
aslanix merged 12 commits into
devfrom
dev-ts6

Conversation

@aslanix

@aslanix aslanix commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Brings the dev-ts6 branch into dev. CI (build+tests and docker image) is green on the tip commit.

TypeScript 6.0 migration

  • Bump typescript ^5.8.3^6.0.3 (root + notebook).
  • Add explicit rootDir to notebook/tsconfig.json — TS6 now requires it for emit (error TS5011).
  • Earlier ts6 config work: modernized rt, p2p-tools, relay tsconfigs (Node16 module/resolution, ES2022, types: ["node"], explicit rootDir).
  • Config-only; no source changes. rt/p2p-tools/relay/notebook all build clean; all 890 golden tests pass.

Build / infra

  • Disable rollup tree-shaking to stop the bundle build from hanging.
  • .gitignore dist build output; rt clean wipes the tsc cache.
  • npm audit fix — resolve dependency advisories.

Docs

  • Split human-facing docs out of CLAUDE.md into docs/ (INSTALL, DEVELOPMENT, ARCHITECTURE, CONTRIBUTING, NETWORKING); CLAUDE.md now holds agent directives only; README.md is a thin landing page.
  • Replace the stale websocket-star node-discovery section in NETWORKING with the mechanisms actually used (bootstrap, mDNS, kad-DHT; circuit relay v2 for NAT), verified against rt/src/p2p/p2p.mts.
  • De-editorialize inherited prose; require AI commits to be verified.

Other

Verification

  • make all + bin/golden: all 890 tests pass.
  • CI on dev-ts6: "Build project and run tests" ✅, "Build docker image and push to registry" ✅.

aslanix and others added 12 commits March 11, 2026 17:30
Mark quarantining outline + implementation done, update label-format
option to --label-format v1|v2|v2-full, and note declassification
consolidation status (PR #151).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A value downgrade computed the result's integrity level as the tainted
target level, which incorrectly *raised* it. Per the agreed fix in #159,
the integrity of a downgraded value is now glb(data.tlev, taintedLevTo),
so e.g. `pdowngrade(x raisedTo {alice,bob}, authority, {alice})` yields
`%{}` instead of `%{alice}`.

- downgrading.mts: pass glb(data.tlev, taintedLevTo) as the LCopyVal tlev.
- Lval.mts: expose LCopyVal's third (integrity) arg; make posInfo and the
  nullable constructor params explicitly `| null` for stricter typing.
- tests/lib/IfcUtil.golden: regenerate declassifyDeep/downgradeDeep section
  to reflect the corrected integrity (%{}).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a "Commit quality" policy to CLAUDE.md: AI-generated commits must be
verified before committing; changes that cannot be verified (e.g. their
exercising tool hangs/is unavailable) must be held in the working tree and
surfaced, not committed on faith; verified changes must not be bundled with
unverified ones.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rollup's tree-shaking pass hangs indefinitely (observed 5+ CPU-hours)
on the compiled runtime's circular module graph
(runtimeMonitored <-> MailboxProcessor <-> QuarantineUtils <-> deserialize,
and <-> UserRuntime <-> exit). The hang is entirely in tree-shaking:
isolation showed plain `rollup` with zero plugins hangs, while the full
pipeline (resolve+commonjs+json+terser) with `treeshake: false` produces a
valid 148 KB minified bundle in ~1s. Dead-code elimination is unnecessary
here since terser still minifies, so disable tree-shaking.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply `npm audit fix` across the runtime and notebook trees. Notably bumps
@rollup/plugin-terser 0.4 -> 1.0 (fixes a high-severity serialize-javascript
RCE advisory) and dedupes libp2p transitive deps (multiformats, uint8arrays,
protons-runtime).

Verified: full `make test` green (890/890, multinode included) on the updated
tree; the rollup bundle builds and minifies correctly under plugin-terser 1.0
(148 KB, valid JS).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- .gitignore: ignore the /build/ distribution bundle produced by
  `make dist` / `rollup -c` (was previously untracked-but-unignored).
- rt/Makefile: `clean` now also removes tsconfig.tsbuildinfo. Removing
  only built/ left tsc's incremental cache behind, so a subsequent build
  emitted nothing (or regenerated stale layouts). This is what left the
  obsolete rt/built/src/ duplicate tree around after the rootDir change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hang is confirmed (5+ CPU-hours; ~1s with treeshake off) but its exact
trigger is not. Reword the comment to present the circular dependencies as
present-but-unconfirmed rather than the established cause, and reference the
known Rollup tree-shaking pathology class (rollup/rollup#5729).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move all human-relevant reference material out of CLAUDE.md so it holds
only agent-specific directives. README.md becomes a thin landing page;
installation, development, architecture, contributing, and networking
reference move into docs/.

- CLAUDE.md: agent directives only; add "Writing documentation" rule
  against editorializing; link to the new docs.
- README.md: intro, components, repository layout, quick start, docs index.
- docs/INSTALL.md, DEVELOPMENT.md, ARCHITECTURE.md, CONTRIBUTING.md,
  NETWORKING.md: split reference material, each with a scope blurb.
- NETWORKING.md: replace stale websocket-star node-discovery section with
  the mechanisms actually used (bootstrap, mDNS, kad-DHT; circuit relay v2
  for NAT), verified against rt/src/p2p/p2p.mts.
- De-editorialize inherited prose.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump typescript ^5.8.3 -> ^6.0.3 in root and notebook. Add explicit
rootDir to notebook/tsconfig.json (TS6 now requires it for emit, TS5011).

Config-only; no source changes. rt/p2p-tools/relay build clean, notebook
builds clean, all 890 golden tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aslanix
aslanix merged commit d2e8e1f into dev Jun 1, 2026
10 checks passed
@aslanix
aslanix deleted the dev-ts6 branch July 7, 2026 19:56
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