generate-names: turn a sentence into a thousand candidates - #11
Merged
Conversation
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>
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
ThreatCrush Security Scan3 finding(s) MEDIUM: 1 | LOW: 2
Snippets are redacted; ThreatCrush never prints matched credential material. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the pipeline that
domainfree's help already described. That help usedgenerate-namesas a placeholder meaning "whatever produces your candidate list", which reads as a command that exists — running it getscommand 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_KEYis set, OpenAI first when both are. Defaults to the cheap tier on each side —gpt-4.1-miniorclaude-haiku-4-5— overridable with--model.Both are called over plain
fetchrather than an SDK, deliberately: this repo has zero runtime dependencies today and every existing tool imports onlynode: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,--wordsand--countchange all three;--seedmakes a run reproducible from the same vocabulary.Two things this shook out
no— the single most useful modifier in this space (nosorry,noexit). Now 2.src/registry.tscarries aSUMMARIESentry per command, and a test asserts none is empty. A newbin/*.tsisn't finished until it's listed there. Good convention — it caught this before review did.Also in this PR
/domain:namesadded to thedomainplugin, so the generator is available in moshcode alongside/domain:freeand/domain:lookup.domainfree's help and the README referencegenerate-namesagain, now that it's real.Verified against the live API
.com--tld,--seed,--words, and every exit code (no-args 1, help 0, bad provider 1, API failure 2)🤖 Generated with Claude Code