Remove unused fmtTerm helper - #1739
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
functionalscript | 2f7f373 | Commit Preview URL Branch Preview URL |
Aug 27 2026, 06:39 PM |
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Approved. Verified at 1ea3261ba: a whole-repo grep — every extension, generated files included — finds fmtTerm only at its definition (emergent_testing/module.f.mjs:341) and its own import and self-test (proof.f.mjs:16, :585-591). No live call, no dynamic reach, no doc mention. The sorted proof leaf diff against main removes exactly one line, proof.helpers.fmtTerm(), which tested exactly the deleted helper — so 3470 → 3469 is fully accounted for and no coverage of live code is lost. tsc --noEmit exit 0 on both sides.
The +3 in djs/serializer/module.f.mjs is const { entries } = Object moved below the import block — inert (ESM imports hoist regardless) and consistent with the placement in types/object/module.f.mjs and nanvm/rust/module.f.mjs. Unrelated to the stated purpose, but not worth holding the PR for.
Ready to leave draft as far as I can tell. No changelog entry needed — dead code and a test-only removal.
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Measured at 6ba521773. Gates are fine — npm test 3471/3471 exit 0, tsc --noEmit exit 0 (main 8609666e: 3472/3472), and the -1 is still exactly the fmtTerm self-test: the sorted leaf multiset differs from main in that one name and nothing else. fmtTerm itself is gone from the whole repo.
The thing to settle before this leaves draft: the branch now carries PR #1740's topic. Its own commits are e37271e22, 1ea3261ba, 985bb2dd6 "private.ts", eb21a3e88, and git diff origin/main...6ba521773 is 9 files / +51-67, adding new private.ts files with moved type aliases in asn.1, bnf/data, bnf/descent and emergent_testing. The title is still "Remove unused fmtTerm helper". Either split those commits out (or fold them into #1740), or retitle and redescribe this PR — as it stands the squash message will not describe what lands.
The moves themselves are sound, and I checked the one thing that could hide a problem: they add and remove zero proof leaves, so tsc is the entire gate. It does bite — changing _FRuleMap = StringMap<FRule> to StringMap<number> in fjs/bnf/data/private.ts gives tsc --noEmit exit 1 with module.f.mjs(191,39): error TS2345 … not assignable to parameter of type '_FRuleMap'. So the refactor is behaviour-preserving and covered, just not by this PR's stated subject.
No changelog is owed: the moves are type-only and the leaf diff shows no behaviour change. The "ok"/"private.ts" commit messages break no rule — CONTRIBUTING.md:171-178 says branch commits are discarded by the squash and their messages are working notes.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 Codex Review
fmtTerm
When a published consumer imports fmtTerm, upgrading to this version will fail during module linking because the named export no longer exists; a repository-wide search only establishes that there are no in-repo callers. This commit adds neither a changelog/unreleased entry nor a Changelog: section, so the removal may ship with an incorrectly non-breaking version bump; retain the export or record it as a breaking API change.
AGENTS.md reference: AGENTS.md:L91-L98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,22 @@ | |||
| import type { Vec } from "../types/bit_vec/types.ts" | |||
There was a problem hiding this comment.
Keep implementation-only types out of
private.ts files
This adds authored TypeScript under a new filename even though types.ts is the repository's sole permitted authored TypeScript form. The same violation occurs in fjs/bnf/data/private.ts and fjs/bnf/descent/private.ts; these implementation-only aliases should remain JSDoc typedefs in their .f.mjs owners rather than introducing a second TypeScript source convention.
AGENTS.md reference: fjs/AGENTS.md:L192-L193
Useful? React with 👍 / 👎.
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Raising this again only because the PR has left draft with the finding unresolved — that changes the stakes, since the squash lands the body as the commit message.
At 0e7237140 the branch still carries the type relocation: its own commits are e37271e22, 1ea3261ba, 985bb2dd6, eb21a3e88, 0e7237140, and git diff origin/main... is 9 files adding private.ts in fjs/asn.1, fjs/bnf/data and fjs/bnf/descent. The body still reads only "Remove fmtTerm from module.f.mjs … and its test in proof.f.mjs". Either fold those commits into #1740, or add a sentence to the body naming the private.ts moves — a terse title is fine if the body describes what lands.
The work itself is clean: npm test 3476/3476 exit 0 and tsc --noEmit exit 0 (main 438dd85a3: 3477/3477), the leaf diff is exactly one removal — proof.helpers.fmtTerm() — and fmtTerm has zero hits repo-wide. 0e7237140 is type-only: _Result<T> moved from a bnf/descent JSDoc into private.ts, an unused @import dropped, no executable statement touched.
No changelog is owed: the five moved aliases are all underscore-prefixed and have no references outside their own directories, unlike the types/rtti → rtti move that was logged breaking because it relocated externally-consumed code.
There was a problem hiding this comment.
💡 Codex Review
When a package consumer imports fmtTerm from functionalscript/fjs/emergent_testing/module.f.mjs, this removal makes module instantiation fail because the package has no restrictive exports map and publishes these .mjs subpaths. If the removal is intentional, add a **BREAKING CHANGES:** changelog entry so the next release receives the required version bump; otherwise retain the export.
AGENTS.md reference: AGENTS.md:L91-L98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
o2alexanderfedin
left a comment
There was a problem hiding this comment.
Correcting myself: I said earlier that no changelog entry was needed here. That was wrong for the fmtTerm removal itself.
fmtTerm was export const fmtTerm in fjs/emergent_testing/module.f.mjs, and package.json's files ships fjs/, so it was reachable API — not internal dead code. Precedent in this repo treats that module's exports as public: removals from it were logged in changelog/unreleased/1734.md and 1738.md, one of them as a breaking change. Under changelog/README.md's "affects behavior or the public API" test, changelog/unreleased/1739.md looks owed. My earlier "dead code, test-only" reading was about the wrong half of the diff — the private.ts moves genuinely are exempt ("Private _ names are not public API"), but the export removal is not.
Good news on the other half: now that #1740's design is in main, I checked this branch against it. All three private.ts files comply — no types.ts imports private.ts, only already-underscored types moved, and the @typedefs still in fjs/bnf/descent/module.f.mjs:82-157 are function-local inside descentParserRuleSet, which the design explicitly permits. A clean early implementation.
Gates at 2f7f373ba: npm test 3476/3476 exit 0, tsc --noEmit exit 0 (main: 3477/3477); the sorted leaf diff is exactly one removal, proof.helpers.fmtTerm(). The delta since my last review is merge-only.
The title/body mismatch I raised twice still stands; not repeating the argument.
Summary
fmtTermfrommodule.f.mjs(unused terminal-output key-chain formatter) and its test inproof.f.mjsTest plan