Repository navigation
feat(session): name sessions from the meaningful words of the first prompt - #702
Merged
Merged
Conversation
…rompt Session labels took the literal first words, so a prompt that opened with pleasantries was named after them: "Can you please fix the login bug?" became `can-you-please-fix`. Skip the filler instead — articles, conjunctions, prepositions, pronouns, auxiliaries, question words, and the pleasantries and opener verbs that introduce a request — so the name says what the prompt is about. Filler does not consume one of the four word slots, and a first sentence made only of filler falls back to its literal opening, so such a prompt still gets a name of its own rather than `untitled-session`. Open-class words stay eligible even when a prompt uses them as filler, so `--help fails` still names the session `help-fails`. The kebab normalization, the token and character caps, and the `forge/<slug>` branch invariant are unchanged; only which words reach them is.
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.
What
Session names — and the
forge/<slug>branch derived from them — came from the literal first four words of the first prompt, so a polite or hedging opener named the session after itself:Can you please fix the login bug?→can-you-please-fix.title_from_promptnow keeps the meaningful opening: up to four words, with filler skipped (the,and,to,you,please,want), soCan you please fix the login bug?→fix-login-bug.Details
I want to rewrite the parser→rewrite-parser.please just do it→please-just-do-it) rather than collapsing tountitled-session.--help failsstill names the sessionhelp-fails.sanitize_labelno-op /forge/<slug>invariant are unchanged — only which words reach them is./resumehint all read from.Tests
cargo test --package forge-types --locked— 28 passed (new cases for filler skipping and the pure-filler fallback)cargo test --package forge-core --locked session_title_hint— 2 passedcargo test --package forge-tui --locked bare_resume_list_shows_title_hint— 1 passedcargo test --package forge-session --locked— the prompt-derived label/branch testscargo fmt --all -- --checkandcargo clippy --package forge-types --package forge-core --package forge-session --package forge-tui --all-targets --locked -- -D warnings— cleanDownstream expectations moved with the rule:
fix-the-login-bug→fix-login-bug, and the four-word prompt now yieldsfix-login-bug-run.