Skip to content

generate-names: turn a sentence into a thousand candidates - #11

Merged
ralyodio merged 1 commit into
masterfrom
fix-generate-names-example
Aug 19, 2026
Merged

generate-names: turn a sentence into a thousand candidates#11
ralyodio merged 1 commit into
masterfrom
fix-generate-names-example

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor
generate-names "a registry that checks whether Lean proofs actually compile" | domainfree

Completes the pipeline that domainfree's help already described. That help used generate-names as a placeholder meaning "whatever produces your candidate list", which reads as a command that exists — running it gets command not found. It exists now.

The design decision

The model is asked for vocabulary, not for a thousand names. One cheap call returns ~40 head words and ~40 modifiers; the cross product is expanded locally and shuffled.

Asking a model for 1,000 names directly is the obvious approach and the wrong one — it repeats itself within a few hundred, drifts off the brief, and costs far more for a worse list. This way the call count is the same whether you ask for 10 names or 10,000.

Either provider

Uses whichever of OPENAI_API_KEY / ANTHROPIC_API_KEY is set, OpenAI first when both are. Defaults to the cheap tier on each side — gpt-4.1-mini or claude-haiku-4-5 — overridable with --model.

Both are called over plain fetch rather than an SDK, deliberately: this repo has zero runtime dependencies today and every existing tool imports only node: builtins. Two SDKs for two POST requests seemed a poor trade. Happy to switch if you'd rather have the SDKs.

Defaults

Two English words and .com, per the house preference. --tld, --words and --count change all three; --seed makes a run reproducible from the same vocabulary.

Two things this shook out

  • The word filter had a 3-letter floor, which silently dropped no — the single most useful modifier in this space (nosorry, noexit). Now 2.
  • src/registry.ts carries a SUMMARIES entry per command, and a test asserts none is empty. A new bin/*.ts isn't finished until it's listed there. Good convention — it caught this before review did.

Also in this PR

  • /domain:names added to the domain plugin, so the generator is available in moshcode alongside /domain:free and /domain:lookup.
  • domainfree's help and the README reference generate-names again, now that it's real.

Verified against the live API

  • 1,000 names generated — all unique, all .com
  • the documented pipeline end-to-end: 40 candidates → 9 registerable domains
  • --tld, --seed, --words, and every exit code (no-args 1, help 0, bad provider 1, API failure 2)
  • suite 137/137, typecheck clean

🤖 Generated with Claude Code

    generate-names "a registry that checks Lean proofs" | domainfree

Completes the pipeline domainfree's help already described. That help
referenced `generate-names` as a placeholder for "whatever produces your
list", which read as a command that existed — running it got
`command not found`. It exists now.

The model is asked for VOCABULARY, not for a thousand names: roughly 40 head
words and 40 modifiers, expanded into the cross product locally and shuffled.
That is one cheap API call whether you ask for 10 names or 10,000. Asking a
model for a thousand names directly is the obvious approach and the wrong one
— it repeats itself within a few hundred, drifts off the brief, and costs far
more for a worse list.

Either provider, whichever key is set, OpenAI first when both are:
gpt-4.1-mini or claude-haiku-4-5 by default, overridable with --model. Both
are called over plain fetch rather than an SDK, to keep this repo's zero
runtime dependencies — every existing tool here imports only node: builtins.

Defaults are two English words and .com, per the house naming preference;
--tld, --words and --count change all three. --seed makes a run reproducible
from the same vocabulary.

Two things this shook out:

- The word filter had a 3-letter floor, which silently dropped "no" — the
  single most useful modifier in this space (nosorry, noexit). Now 2.
- src/registry.ts carries a SUMMARIES entry per command and a test asserts
  none is empty, so a new bin/*.ts is not finished until it is listed there.
  Good convention; it caught this before review did.

Also exposes /domain:names in the domain plugin, and restores the pipeline
example in domainfree's help now that it names a real command.

Verified against the live API: 1000 names generated, all unique, all .com;
the documented pipeline end-to-end returned 9 registerable domains from 40
candidates; --tld, --seed, --words and every exit code exercised. Suite
137/137, typecheck clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

3 finding(s)

MEDIUM: 1 | LOW: 2

Severity Rule Location
MEDIUM redos-nested-quantifier src/domain-free.ts:56
LOW insecure-temp-file test/blog.test.ts:73
LOW insecure-temp-file test/blog.test.ts:74

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 95dc6d5 into master Aug 19, 2026
5 checks passed
@ralyodio ralyodio mentioned this pull request Aug 19, 2026
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.

2 participants