Repository navigation
Conversation
sdd summarize --all overwrote the title of an entry that held a title but no summary with the paired call's generated one, and its cost line counted such an entry as getting a title.
The hint named sdd summarize <id>, which regenerates both fields and so replaced a summary or title the caller had supplied with --summary or --title. sdd summarize --all fills only what is missing.
sdd new --title and a capture's correctedTitle stored a title holding a line break, since NormalizeTitle keeps one; only summarize --title and a generated title refused it. model.CheckTitle is now the one check every title writer runs.
sdd new and sdd summarize built the embedder before running, so sdd new --summary --title and --dry-run, which make no title call, failed on a broken embedding config. The handler now takes one TitleSearchOpener that a title call opens.
A summarize worker held the graph read lock across the embedding call, so a worker waiting to write its entry, and every worker behind it, waited on another worker's network round trip. SearchFinder.EmbedPhrase now embeds the query ahead; only the index query and graph reads run under the lock.
…d of committing them later CommitStrandedTitles committed whole working files, so a hand edit could land in its commit, and a file added but not at HEAD failed every later fill. A summarize run whose commit fails now returns an error naming the files it left uncommitted and the git commit command that commits them.
A capture searched the target's snapshot but read the hit entries' attachments from the project's default store, so on a branch target a similar entry with attachments failed the capture or dropped out of the similar titles.
newFillProgress drove the single-producer cliout.Reporter from every summarize worker, so a stale snapshot could land last and the bar end below the total.
Quote removal turned "sdd" output into Sdd output: the term lost its quotes and then its casing. A title opening with a single quoted word now keeps its casing, as one opening with a code span does.
The prompt allowed reusing a related entry's title for the same subject, while Retitle re-runs any title that repeats another entry's, so each permitted reuse cost a re-run.
… names The command joined bare absolute paths, so a graph directory holding a space or a quote broke it in the shell.
…usal sdd new --title with a value empty once normalized fell back to a generated title, while summarize --title refused it; both refuse now. A dry run refused by command validation or the title check returned before it registered the stdin save, so the piped attachment was lost.
…ndex package model.Entry.Unfilled is now what both the cost line's count and the summarize plan skip by. index.OpenBuilt replaces handlers.SearchIndexDir, a disk adapter only the CLI used.
--only title|summary writes that field alone and keeps the other, on named entries, --all and --all --force. The sdd new failure hint names sdd summarize <id> with the --only that keeps what the caller supplied.
--only=summary on an untitled entry still re-ran a repeated title: an extra paid call whose failure failed the entry, for a title the run throws away.
The CLI refused --title "" before NewEntry registered the dry-run stdin save, so the piped attachment was lost. NewEntryCmd.Title is now a pointer: nil generates, any given value is checked in the handler.
sdd summarize --text - --only=title read and discarded stdin and built the runner before the handler refused the conflict.
The guide said an interrupted fill leaves its files uncommitted; a cancelled run still commits them, only a killed one does not. The Force comment now reads with --only.
…he write A correctedTitle like "..." passed prepare, then ReplaceSummary refused it, leaving the capture on an unfinished operation only cancel escaped. model.ParseTitle now normalizes and refuses for every title writer.
The summary check said each correction replaces the stored one verbatim.
On Ctrl-C or SIGTERM the joined commit failure was mapped to the plain cancelled message, hiding the files left uncommitted. The failure now wraps model.ErrUncommittedWrite, which the coordinator and main keep and print.
A refused correctedTitle stayed in the store, so a following correction that left the title out was refused again. A new engine type title validates through model.ParseTitle at the store write.
Ctrl-C during the summary call of sdd new printed only cancelled., hiding the written entry's hint and a failed commit. Both now carry model.ErrIncompleteWrite, which replaces ErrUncommittedWrite.
…o-op A capture's quoted lowercase opener lost its casing: the title type stored the normalized title and the write normalized it again. A quoted opener now becomes a code span, so NormalizeTitle is a fixpoint, and the title type only checks.
…span A quoted run of punctuation such as „…“ became a code span, so a title of nothing but quotes and punctuation was no longer refused as empty.
… backticks CheckTitle let U+0085, U+2028 and U+2029 through, and a quoted opening word that already held a backtick became a broken code span.
CheckTitle let VT and FF through, which also break a one-line listing.
sdd new committed as sdd: <type> <layer> <opening> and an engine capture as sdd: capture <id>. Both now use Entry.CaptureCommitMessage: type, layer and title, the opening content where the entry has no title.
…document CreateEntry built its batch subject from the untrimmed draft while the committed one came from entryPublicationBatch; both now use one builder. The getting-started guide names the new subject.
The summary prompt let the model add a cause or consequence the entry never stated, or lend it a related entry's claim.
Listings already show an entry's type, layer and confidence; the summary opened on a label such as "Signal:" or restated them.
Parallel summarize workers share one saved index and query it together; its lazily built published view was read and written without a lock, so concurrent first queries each built a full copy and raced on publishing it.
This branch has not been deployed
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.
This PR gives every entry an optional title that names it in brief listings and in its capture commit subject, written by the same model call as its summary. Titles stay apart from the titles of the most similar entries, and
sdd summarize --allfills them in for existing entries. The capture commit also names the entry ID in anEntry:line, so the history finds a capture by its entry.Depends on: nothing.
Why the model writes the title, from the summary call
sdd summarize --all --concurrency)Why
Problems today
sdd new: logged warning only, command succeedssdd newnames the body's opening cut at 72 characterssdd: capture <id>, nothing to scan ingit logGains
sdd new: visible errorSolution
titlefrontmatter field--titleonsdd newandsdd summarize--term) matches the title toosdd summarize --allsdd newfails loud on a failed summary or titleEntry.CaptureCommitMessage()Examples
applicationpackage is declared the single composition root of the SDD Go application: CLI and MCP are shells over it, and its exported surface speaks the existing CQRS vocabulary, taking command and query structs frominternal/commandandinternal/queryrather than growing a parallel method dialect.sdd viewso that each incoming ref contributesrefWeight(refKind, targetClass) * decay(refAge)to heat, and coldness uses a weighted in-degree denominator, with an initial weight table kept deliberately small and revisable.sdd initconnects none of a repository's declared dependencies: it prints onesdd repo add <clone-url>line per dependency and leaves the user to work out each URL, suggesting an HTTPS form while this team clones over SSH.sdd initdependency connection gapHow the parts fit together
flowchart TD R[Title rule] I[Similar titles via the index] P[Summary call, summary.json] T[Title-only call, title.json] X[One re-run on a repeat] G[--title flag] Z[NormalizeTitle] F[title field] L[Brief listings, show, export] B[sdd summarize --all backfill] N[sdd new, fail loud] C[Capture correction] R --> P R --> T I --> P I --> T P -->|repeated title| X T -->|repeated title| X X -->|re-run| T P --> Z T --> Z G --> Z C --> Z Z --> F F --> L B -->|no summary| P B -->|summary, no title| T N --> P N --> T F -->|shown at verifySummary| CArrow: data flows from source to target.
titlefield: read by brief listings,sdd show,sdd exportsummary.jsontitle.jsonNormalizeTitle--title: normalized, no call, never re-runsdd new: either call, fails loud on failureWhat changed
titlein the entry frontmattersdd new,sdd summarizeand capturetitlekey for an untitled entrysdd new --title--dry-run: piped stdin saved on a refused--titleor an invalid commandsdd summarize--only: new;title,summaryortitle,summary(default)--textor--title, before stdin is read--title: new; exactly one entry ID, not with--all--text--all,--force,--concurrency: existing;--allnow fills titles too--onlyvalue, one more hand-set flag like--titleCapture commit subject
Entry: <id>trailer, sogit log --grepfinds the commit by entry IDSDD-Mutation:Entry.CaptureCommitMessage()sdd newand by engine captures (Application.CreateEntry)sdd: capture <id>beforeFill output
--allfill, not with--forceor named entries--onlyappliedFailure output
sdd new: entry written and committed, command fails--summarygiven:title,sdd summarize <id> --only=title--titlegiven:summary,sdd summarize <id> --only=summarysummary or title,sdd summarize <id>sdd summarize: a failed commit names the files and the command that commits them--pathspec-from-file: it needs a file written on the error pathARG_MAXmodel.ErrIncompleteWritecancelled., exit 130Engine type
titletext,labeland the otherscorrectedTitleTitle field and listings
titleonmodel.Entrytitlekey written for an untitled entryListingTitle(): title, else first summary sentenceEntryLineBrief) usesListingTitle()sdd showtree linestitleinsdd showtitleinsdd exportsearchableTextininternal/finders/search.go): title, summary, body, Markdown attachmentssdd search --termand thesearchtoolSummary and title calls
response_schemas/summary.jsonSignal:opening a sentencepkg/llmcontract change:ResponseSchemallm.PurposeTitlellm.ByPurposemap without a fallback: must routellm.PurposeTitle, else title calls fail "no runner routed"llm.PurposeTitle,response_schemas/title.jsontitledescription points at the title ruleCall choice per command
flowchart TD N[sdd new] --> N1{--summary given?} N1 -- no --> NP[Summary call: title + summary] NP --> NS[Store the call's summary; store --title if given, else the call's title] N1 -- yes --> N2{--title given?} N2 -- yes --> NV[No call: store both as given] N2 -- no --> NT[Title-only call over the given summary] S[sdd summarize] --> S1{--title or --text given?} S1 -- yes --> SV[No call: write what was given on one entry] S1 -- no --> S2{Named entries or --force?} S2 -- yes --> SP[Summary call: replace title and summary] S2 -- "no (--all)" --> S3{Entry has a summary?} S3 -- no --> SF[Summary call: write title and summary] S3 -- yes --> S4{Entry has a title?} S4 -- yes --> SK[Skip: no call] S4 -- no --> ST[Title-only call over the stored summary]sdd summarizewithout--only--only: the call is chosen as if only the named field were missing--only=title, summary stored: title-only call--only=title, no summary: summary call, summary discarded--only=summary: summary call, title kept, no title re-runTitle rule and normalization
sdd new --title,sdd summarize --titlemodel.ParseTitleSimilar titles and repeats
flowchart TD E[Entry body] --> Q{Embedder and built index?} Q -- no --> NS[No similar-titles section, no error] Q -- yes --> CUT[Body cut to one indexed chunk] CUT --> SR[Vector search over titled entries] SR --> EX[Entry itself, refs, closes, supersedes left out] EX --> TOP[5 most similar titles in the prompt] NS --> CALL[Summary or title-only call] TOP --> CALL CALL --> REP{Title repeats another entry's title?} REP -- no --> STORE[Store the title] REP -- yes --> RE[One title-only re-run: repeat listed first, previous 5th dropped] RE --> STORE2[Store the result as is, repeat or not]sdd summarize: failssdd new: handled as a failed callAGENTS.mdsdd new --summary --title,--dry-run: embedding config never read--titlevalue: never re-run--force: re-described entries drop out of the searchBackfill in
sdd summarize --all--only:--force: summary call for every entry--only: only the named field filled or regeneratedsummarizing, counted likeindexingCapture
verifySummarytitledriftedwithout a correction refusedReplaceSummary)Docs
sdd: <type> <layer> <title>, entry ID in anEntry:linetitlein frontmatter--titlegit commitcommand--only--termmatches title, summary, body and Markdown attachmentsBackfill numbers
sdd summarize --concurrency, default 4glm-5.3-flash, from the.sdd/stats/llm.jsonlof a graph of about 1,000 entries:Tests
internal/model/title_test.go:CaptureCommitMessage: title, else opening contenttitlekey when untitledListingTitle,NormalizeTitle,RepeatedTitle,TitleBackfillCheckTitle: multi-line title refusedParseTitle: normalized, empty and multi-line refusedIncompleteWrite: marks without changing the messageTitleBackfillper--onlyvalueParseDescriptionFields: allowed values, unknown refusedinternal/engine/types_test.go:titletype stores the value as given, unusable refusedinternal/index/open_built_test.go: no index opened or created where none is builtinternal/model/phase_test.go:TestPhaseCountedinternal/llmops/summary_test.go:TestNewDescriptionChoosesTheCall)titledescription pointing at the title rulepkg/llmcontract change)internal/finders/search_text_test.go,TestSearchFinder_TextModeMatchesTheTitle: a term only the title holds finds that entry aloneinternal/query/search_test.go:internal/handlers/title_search_test.go:sdd newandsdd summarizesummarizesdd new: entry written, command fails naming itinternal/handlers/handler_new_entry_test.go:--titlerefusedinternal/handlers/handler_summarize_test.go,handler_summarize_batch_test.go:--titlenormalized--titlerefused--titleon one entry only--allfilling what is missing--allkeeping a stored title--onlyon named entries keeping the other field--only=summaryrunning no title re-run--all --onlyand--all --force --onlywriting only the named fieldgit commitcommand that parses inshinternal/cliapp/summarize_test.go:--forceor named entries--all --only title--onlyrefusals: unknown value, with--text, with--title--onlyconflict refused before stdin is read--titleneeding one entryinternal/cliapp/app_test.go: blanksdd new --titlerefused; empty--titlekeeps piped stdin on a dry runinternal/cliapp/summarize_internal_test.go: progress ends at the total under concurrent workersinternal/cliout/coordinator_test.go: cancellation keeps an incomplete writeinternal/cliapp/app_test.go: embedder built only for a title callinternal/cliapp:title_help_test.go,progress_internal_test.go,export_test.goTestModel_SummarizingShowsTheBarinternal/presenters:titleinsdd showinternal/proctest/capture_title_test.go:verifySummarydriftedwithout a correction refusedpkg/local/repository_targets_test.go:Entry:beforeSDD-Mutation:internal/handlers/handler_new_entry_test.go:sdd newcommit names title and entry IDinternal/model/title_test.go: commit message of a titled and an untitled entrypkg/application/capture_titles_test.go:devbox run test(green: vet, every package, the example module) anddevbox run lintDetails
The title rides on the summary call, so a new entry costs no extra model call. The title-only call serves entries whose summary may have been corrected by hand, since regenerating both would overwrite the correction. A required title would need a graph schema bump, and that is upstream's decision.
Both response shapes are JSON files under
internal/llmops/response_schemas/, enforced by each adapter's structured output. The prompts state the title rule but no JSON format rules, as 20261004-134853-d-cpt-sw8 requires. This changes the publicpkg/llmcontract: the summarize request now carries aResponseSchemaand its answer must be JSON, so an external runner that returns plain text fails the summary step; the title-only call addsllm.PurposeTitle.A failed similar-titles search stays a loud failure: without the list the model writes titles that repeat its neighbours'. Only a title call builds the embedder, so commands making none never read the embedding config.
Upstream compatibility
pkg/: no exported function, type or method of upstreammainremoved or changed (checked withapidiffagainstca555fd1)pkg/llmbehaviour: the summarize request carries aResponseSchema; an external runner answering in plain text fails the summary step (see Details)title: an optional frontmatter field; a build without it drops the title when it rewrites an entrysdd: <type> <layer> <title>,Entry: <id>trailer in the body