diff --git a/AGENTS.md b/AGENTS.md index e2d6a1643d..8ac4d169f3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,12 +85,13 @@ Commands and Rust coding style: [nanvm-lib/AGENTS.md](./nanvm-lib/AGENTS.md). A PR implements only one feature or improvement, with minimal code changes, and every check above passing. Its title and description become the squash commit on `main`, so write them as one: a `: ` title and a -description ending in a mandatory `Changelog:` section. A PR that changes code -adds `changelog/unreleased/.md`, named by the real PR number once the PR -exists; a PR that only touches `todo/`, `AGENTS.md`, or other documentation -writes `Changelog: none` instead. Breaking changes are welcome when they improve -the API — prefix the entry with `**BREAKING CHANGES:**` and update every importer -in the same PR. +description ending in a mandatory `Changelog:` section. A PR that changes +behavior or the public API adds `changelog/unreleased/.md`, named by the +real PR number once the PR exists; a PR that doesn't — internal refactors, +test-only changes, and PRs that only touch `todo/`, `AGENTS.md`, or other +documentation — writes `Changelog: none` instead. Breaking changes are welcome +when they improve the API — prefix the entry with `**BREAKING CHANGES:**` and +update every importer in the same PR. Commit-message format and the PR checklist: [CONTRIBUTING.md](./CONTRIBUTING.md#opening-a-pull-request). Changelog entry rules, breaking changes, and versioning: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa7dc78dd4..dcb0225ef6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -160,9 +160,9 @@ For tool details and package-consumer setup for Claude and Codex, see A pull request implements only one feature or improvement, with minimal code changes. Before submitting, ensure every check above passes, delete the `todo/` -issue file in the same pull request, and — for code changes — add a changelog -entry as `changelog/unreleased/.md`, named by the real pull request number -once the pull request exists (see +issue file in the same pull request, and — when the change affects behavior or +the public API — add a changelog entry as `changelog/unreleased/.md`, named +by the real pull request number once the pull request exists (see [changelog/README.md](./changelog/README.md)). The everyday workflow around this is [AGENTS.md §1](./AGENTS.md#1-workflow). @@ -197,9 +197,9 @@ squash, so their messages are working notes. The section holds exactly the list items of `changelog/unreleased/.md` — same Markdown subset, same `**BREAKING CHANGES:**` prefix where it applies, no PR link ([changelog/README.md](./changelog/README.md#entries)). A pull - request that needs no entry writes `Changelog: none`. The section is - **mandatory** either way, so a forgotten entry is a visible omission rather - than a silent one. + request that doesn't change behavior or the public API needs no entry and + writes `Changelog: none`. The section is **mandatory** either way, so a + forgotten entry is a visible omission rather than a silent one. It duplicates the entry file on purpose: the file is what today's release process reads, the section is what a generator reading Git history would diff --git a/changelog/README.md b/changelog/README.md index 11487af623..6fb2b978a5 100644 --- a/changelog/README.md +++ b/changelog/README.md @@ -45,9 +45,11 @@ inside the file — the file name already carries the number, and a renderer derives the link from it. A pull request with several entries puts them all in its one file, most important first. -Only add entries for code changes — pull requests that only touch `todo/`, -`AGENTS.md`, or other documentation files do not need one, and say -`Changelog: none` in the description instead. +Only add entries for changes that affect behavior or the public API — a pull +request that doesn't (internal refactors, test-only changes, coverage +improvements, and pull requests that only touch `todo/`, `AGENTS.md`, or other +documentation files) does not need one, and says `Changelog: none` in the +description instead. - **Keep it short.** An entry is **at most a few lines** (about three wrapped lines, ~250 characters) — what changed and, when it isn't obvious, why. It is a diff --git a/deno.json b/deno.json index 6f83506660..9440ddfcb1 100644 --- a/deno.json +++ b/deno.json @@ -2,7 +2,8 @@ "tasks": { "fjs": "deno run --allow-read --allow-write --allow-env --allow-net --allow-sys ./fjs/module.mjs", "test": "deno test --allow-read --allow-env --allow-sys", - "cov": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --include='.*module\\.f\\.mjs'" + "cov": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --include='.*module\\.f\\.mjs'", + "cov-html": "deno test --allow-read --allow-env --allow-sys --coverage && deno coverage --html --include='.*module\\.f\\.mjs$'" }, "fmt": { "indentWidth": 4, diff --git a/fjs/types/btree/set/module.f.mjs b/fjs/types/btree/set/module.f.mjs index 1f1abd53f3..c8ce1f4e4e 100644 --- a/fjs/types/btree/set/module.f.mjs +++ b/fjs/types/btree/set/module.f.mjs @@ -11,6 +11,7 @@ import { collapseRoot } from '../types/module.f.mjs' import { find } from '../find/module.f.mjs' import { fold } from '../../list/module.f.mjs' +import { assert } from '../../../asserts/module.f.mjs' /** * @template T @@ -79,31 +80,24 @@ const nodeSet = c => g => node => { case 2: { // insert const value = g(null) - // TODO: remove after TSGO fix the regression. - // const _xl: 1|2 = x.length switch (x.length) { case 1: { return [[x[0], value]] } case 2: { return [[x[0]], value, [x[1]]] } } - // TODO: remove after TSGO fix the regression. - // See https://github.com/microsoft/typescript-go/issues/4613 - throw 'unreachable' } case 3: { // replace // TODO: remove after TSGO fix the regression. - // const _xl: 2|5 = x.length - switch (x.length) { + const xL = x.length + // See https://github.com/microsoft/typescript-go/issues/4613 + assert(xL === 2 || xL === 5) + switch (xL) { case 2: { return [[x[0], g(x[1])]] } case 5: { return [[x[0], x[1], x[2], g(x[3]), x[4]]] } } - // TODO: remove after TSGO fix the regression. - throw 'unreachable' } case 4: { // insert - // TODO: remove after TSGO fix the regression. - // const _xl: 2 = x.length const [v0, v1] = x return [[v0], v1, [g(null)]] } diff --git a/package.json b/package.json index e8261d21ed..1e75c63bb7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "prepack": "tsc --noEmit false --emitDeclarationOnly && tsc", "test": "tsc && node ./fjs/module.mjs t", - "cov": "node --test --experimental-test-coverage --test-coverage-include=**/module.f.mjs fjs/emergent_testing/all.test.mjs", + "cov": "node --test --experimental-test-coverage --test-coverage-include=**/module.f.mjs", "start": "node ./fjs/module.mjs", "ci-update": "node ./fjs/module.mjs ci && node ./fjs/module.mjs r ./fjs/nanvm/update/module.f.mjs", "dev-update": "node ./fjs/module.mjs r ./fjs/dev/update/module.f.mjs",