Skip to content

fix(dx): derive artifact tool count from the registry - #110

Open
Dodothereal wants to merge 3 commits into
alexanderolvera:mainfrom
Dodothereal:codex/fix-tool-surface-bookkeeping-70
Open

Dodothereal wants to merge 3 commits into
alexanderolvera:mainfrom
Dodothereal:codex/fix-tool-surface-bookkeeping-70

Conversation

@Dodothereal

Copy link
Copy Markdown

What & why

Closes #70. Restore alphabetical registry ordering and derive the artifact smoke check's expected count from ALL_TOOLS using the existing gating predicate. The current hardcoded count becomes stale whenever a tool is added.

The build emits dist/surface.js so the installed tarball supplies the expectation on Node 20, which cannot import the TypeScript registry directly. Convert the import path to a file URL so temporary paths containing spaces, # or % work.

How it was verified

  • npm run typecheck
  • npm run lint
  • 25 unit tests, build and T0 checks
  • Installed-tarball smoke on Node 20 and 24, including temporary paths needing URL encoding

The ordering test fails on the unchanged base. In an isolated copy, adding a tool passes the smoke at 46 tools; restoring the old literal fails.

Facts-only check (tool changes)

Not applicable: registry bookkeeping and release verification; no tool payload changes or live-fort test claim.

Notes

#109 edits the same registry and smoke files. Its count bump does not fix the drift mechanism; whichever lands second may need a rebase.

AI assistance was used for implementation and review. Checks above were run locally.

The registry declared an alphabetical-by-tool-name invariant and broke it:
mandates_and_justice sorts before map_overview, so the entries (and their
imports) were swapped back into order.

smoke-artifact.mjs also pinned the expected tool count to the literal 45, so
the next tool to land would fail the release gate until someone remembered the
constant. The count now comes from the registry itself: the build emits
dist/surface.js from ALL_TOOLS through the same isGatedOff predicate the server
uses, and the smoke imports it. That keeps the release check working on Node 20,
which cannot load the .ts registry (verify.mjs stays Node-24-only).

Refs alexanderolvera#70.
Drop the source-text regex test: it asserted on implementation text rather than
observable behaviour, and the artifact-mutation proof already covers the derived
count end to end. The file now has no comment block and no unused helpers, which
matches the repo's zero-comment-block target.
A bare filesystem path handed to import() is not a URL: on Windows a C:\ path
is read as an unsupported scheme, and on POSIX a '#' or '%' in any path segment
is taken as a fragment or escape. This repo is Windows-native, and TMPDIR can
legitimately contain those characters, so convert with pathToFileURL first.
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.

tool-surface bookkeeping: smoke-artifact hardcodes 32 tools; registry breaks its alphabetical invariant

1 participant