Repository navigation
refactor(registry): Extract registry.Transport interface - #228
Merged
Merged
Conversation
…kage Move transport abstraction from lorepackage into a dedicated internal/registry package. Provider→Transport, GitProvider→gitTransport (unexported), single NewTransport(Config) constructor. Eliminates all (*GitProvider) type assertions from Registry — version operations now delegate through the interface. ForceTags moves into registry.Config so the transport handles it internally.
7 tasks
David-Noble-at-work
added a commit
that referenced
this pull request
Sep 23, 2026
…r owns (#934) * chore(plan): self install replaces the record Lane 17 of noblefactor-ops#217, ahead of #228 -- a serious bug, corrected while the analysis is fresh. Ruled 2026-09-23: the manifest is a record of what the tool owns, self install implicitly uninstalls a prior install, and that holds for every app. All four products build through cli.NewRootCmd, so it is one function. Ruled the same day, B over A: install, then retire what the prior record owned and this one does not -- rather than retire first and install into the gap. Both reach the same state. B does not remove a running executable, which Windows refuses, and does not leave the tool absent if the install then fails. Nothing here is transactional. Ruled the same day on vocabulary: writ's verb is reused to describe the function, and its model is not. "We get a manifest, not a trace." A trace has receipts that fold, lifetimes to prune, and a replayable graph behind its reconciliation; a manifest is paths and hashes written at the end of one operation. The plan records the distinction so a later reader does not reach for readback.Fold here. One open question carries a proposal rather than an answer: a file whose hash has changed cannot be deleted and cannot be trusted, and that does not change. But the forgetting can -- the new record could retain it as a modified entry instead of dropping it, which is this issue reproduced one file at a time. Not in the phases; a requirement of its own if wanted. * fix(cli): self install replaces the record, retiring what it no longer owns runSelfInstall never read the prior manifest. It wrote files, then overwrote the record with a list built from scratch -- so a file at a path this install no longer writes was left on disk and disowned in the same operation, and self uninstall, which reads only the record, could never reach it again. star's extensions moved under devlore/ in #918 and stranded 24 files exactly that way. They were removed by hand on 2026-09-23. Ruled that day: the manifest is a record of what the tool owns, self install implicitly uninstalls a prior install, and it holds for every app. lore, star, writ and devlore-test all build through cli.NewRootCmd, so this one function satisfies it for all four. Ruled B over A: install, then retire what the prior record owned and this one does not -- rather than retire first and install into the gap. Both reach the same state. B does not remove the running executable, which Windows refuses, and does not leave the tool absent when the install that was to replace it fails partway. Nothing here is transactional. The removal loop is now removeRecordedFiles, shared with self uninstall, hash guard included: a file whose content no longer matches what was recorded may be the operator's edit, so it is left and reported. That does not change -- there is no safe way to delete it and no way to trust it. runSelfUninstall loses its nolint:gocognit; extracting the loop took it back under the threshold, verified by golangci-lint. Five tests, and the two that prove the fix were made to fail with the retirement disabled. The other three still pass without it, correctly: they guard against over-deletion, not under-deletion. * doc(cli): self install takes deploy's verb, and not its model 10-command-line-interface.md section 3 is where #913 defines the four lifecycle operations by what each does to the record. self install has a record too -- share/<tool>/manifest.json -- and now replaces it rather than overwriting it, so the note belongs beside them, with the reason the verb is the same. It also says what is deliberately not shared. A trace carries receipts that fold, lifetimes to prune, and a reconciliation that can restore a system because the graph behind it is replayable. A manifest is paths and hashes written at the end of one operation. It answers "is this the file I wrote" and cannot answer "what would it take to get back here". Ruled 2026-09-23: reuse the vocabulary to describe the function, not the infrastructure behind it. self install's own Long listed five steps and the retirement made it six. That correction belonged in the commit that made it stale -- rule 12, missed, and caught here rather than left. docs/cli needs no commit: gitignored in this repository, generated by make build and published by docs-publish.yaml. The behaviour reaches it through the Long above. * chore(plan): #933 reads complete The last commit of the pull request closes the plan, per #199. Every other box is ticked: vet, lint and test clean, gofmt clean, and the live path exercised with the built binary -- a superseded completion retired and reported, and a file edited after install left and reported. Two findings recorded in the plan because they will recur. misspell enforces US spelling in Go source even though this repository's prose is British, which cost the first lint run. And `gofmt -l` with no file operands reads standard input, so the pre-flight added to the PR script is guarded on there being changed Go files -- unguarded it would hang on a branch that touches no Go. The CI box states the arrangement rather than the outcome, which arrives after this commit; the merge gate enforces it.
This was referenced Sep 23, 2026
David-Noble-at-work
added a commit
that referenced
this pull request
Sep 24, 2026
…942) * chore(plan): the star design record arrives where the code is Step 1 of noblefactor-ops#228, lane 19 of noblefactor-ops#217 -- the last lane of that schedule. Three documents in noblefactor-ops are the only written design of code that ships here: the goast doc-comment styler, five star analysis providers absent from this repository's own provider catalog, and pkg/gitignore's ignore stack. Ruled 2026-09-23: the numbered series, "as is our pattern for design documents (they sort in read order that way)." Section 9, Star, turns out to be the only section whose documents are not numbered -- 1 through 8 and 10 all are -- so the section is numbered here too, not only its new arrivals. star-extensions.md becomes 9-star-extensions.md and the three arrive as 9.1, 9.2 and 9.3. The plan also corrects #228's scope. It says this step closes the index's two "(planned)" gaps; neither is a document that moves, and the WASM one can never be filled -- noblefactor-ops#230 deleted it because no repository holds that subsystem. The index gains three entries and loses two promises. * doc(architecture): the star design record arrives, numbered Section 9, Star, was the only section whose documents were not numbered -- 1 through 8 and 10 all are. star-extensions.md becomes 9-star-extensions.md and the three arrivals are numbered with it: 9.1-doc-comment-styling.md the goast styler behind star lint go-style 9.2-source-analysis.md five providers: starcode, starindex, starstats, starcomplexity, staranalysis 9.3-file-tree-walking.md pkg/gitignore's ignore stack Each carries a note saying what is as-is against this code and what is already superseded. noblefactor-ops#130 deleted that repository's Starlark warning that "a diverged second copy is how the next person builds the wrong thing"; a document moved without that note is the same hazard in prose. 9.1's note is the longest, because its "Porting to devlore-cli" section is an unfinished migration and reads like instructions -- #938. 9.2 arrived wrapped in a stray ```markdown fence, opened on line 1 and closed at EOF, so its frontmatter was never frontmatter. That is why noblefactor-ops carried it in .github/frontmatter-exempt. Unwrapped on arrival. Two salvages. "The Shape of the Tree" -- star <service> <resource> <verb>, a service token names a service or product and never a tool, and a flag that changes what a command is is a second verb -- had no counterpart here. 10-command-line-interface.md section 3 states only the two-token rule for writ and lore. And two tables into configuration.md: the field-type strings and the config.sync mapping, with the type names brought up to date (ConfigSpec is config.Spec now). * doc(architecture): the indices name what is actually there index.md section 9 gains the three arrivals and loses two promises. #228 said this step closes the two "(planned)" entries; neither was a document that moved, and one could never be closed -- Star WASM Receivers described a subsystem noblefactor-ops#230 deleted the design for, because no repository holds it. Removed rather than filled. Star Configuration is not moving as a document, so its entry points at configuration.md, where its two salvaged tables now live. 3.5-provider-catalog.md calls itself "the index of record for which providers exist" and listed none of star's own. It gains goast and the five analysis providers in a table of their own: they announce the same way, but live under cmd/star/provider rather than pkg/op/provider, and that distinction is worth seeing. pkg/gitignore is named as not-a-provider with a pointer to 9.3. Six back-references repointed. Two were absolute URLs into noblefactor-ops plans that #228 deletes, so they are no longer links; one pointed at star-file-tree-walking.md, which is now 9.3 here, so it is a local link; three were prose naming documents that #228 retires, which now say so. One broken link came in with the move: 9.3 linked twice to ../guides/writing-extensions.md, a noblefactor-ops guide that does not exist here and that #228 disposes of. Every relative .md link in the seven changed architecture documents now resolves, checked. * chore(plan): #937 records Phase 4, and corrects a claim it nearly shipped vet, lint and test all rc=0. No Go changed, so they prove nothing was broken rather than anything fixed. What was actually checked: every relative .md link in the seven changed architecture documents resolves -- which caught one the move carried in, 9.3 linking twice to ../guides/writing-extensions.md, a noblefactor-ops guide that does not exist here -- and codespell's en-GB_to_en-US dictionary over the three arrivals reports zero. Phase 5 was wrong. It said this branch closes devlore-cli#935. #935's remaining box reads "in the next noblefactor-ops pull request through", a condition no pull request in this repository can satisfy, so the claim was false and is removed from the plan and from the pull request body before either shipped. The shape is worth more than the tick: a plan whose last phase lands in another repository cannot close itself. #234 and #935 are the same trap pointing in opposite directions, written the same day by the same hand. #234 closes in noblefactor-ops#228 step 2, and #935 in whatever devlore-cli pull request follows it.
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.
Summary
registry.Transportinterface fromlorepackage.Providerinto newinternal/registrypackageGitProviderto unexportedgitTransportbehindNewTransport(Config)constructor(*GitProvider)type assertions —Registrydelegates through the interfaceSyncOptions,SyncResult,SyncInfotoregistrypackage;ForceTagsintoregistry.Configlorepackage/git.go,Providerinterface,ForceTags(),Branch()Test plan
go vetpasses on all modified packagesinternal/lorepackage,internal/registry)legacy|backward|compat|deprecated— clean(*GitProvider)type assertions remain