Skip to content

Introduce a model source descriptor for the installer - #85

Open
webdevtodayjason wants to merge 1 commit into
drumih:mainfrom
webdevtodayjason:model-source-descriptor
Open

Introduce a model source descriptor for the installer#85
webdevtodayjason wants to merge 1 commit into
drumih:mainfrom
webdevtodayjason:model-source-descriptor

Conversation

@webdevtodayjason

Copy link
Copy Markdown

What

Collects the installer's pinned model values into a ModelSourceDescriptor
value type keyed by a ModelFamily, and registers the existing Gemma 4 pin as
the sole entry in SupportedModelSource.all.

Why

The supported source was a set of standalone static constants, so every pinned
value (repo, revision, index digest, size estimates) was addressable only as a
global. That works well for one model, but it means a second model has to
either mutate those globals or thread a parallel set of constants through the
call sites.

Separately, SourceFingerprint.knownFingerprints restated the Gemma index
digest as its own literal. Two copies of a value whose whole purpose is to
detect drift is a hazard, so the table now derives from the registry.

Behaviour

Unchanged. The legacy statics (SupportedModelSource.repoID, .revision,
.sourceIndexSHA256, .installOptions(...), etc.) remain and are thin shims
over SupportedModelSource.default, so existing callers and the CLI resolve
exactly the same values. This PR adds no user-visible flag or model choice.

Tests

New ModelSourceDescriptorTests covers:

  • shim/descriptor parity, including installOptions field-by-field
  • the pinned Gemma identity (repo, revision, index digest), so a silent
    re-pin fails in CI rather than at install time
  • registry key and repo-ID uniqueness — knownFingerprints is built with
    uniqueKeysWithValues, which traps on a duplicate repo ID, and this keeps
    that failure in the suite
  • fingerprint coverage and round-trip for every registered source

Full suite: 575 tests in 113 suites passing, swift build -c release clean.
Branch is one commit on top of 7a99f2a.

Context

This is the first of a few narrow PRs factored out of experimental multi-model
work discussed in #44. It is deliberately scoped to the descriptor seam and
stays Gemma-only: the repack planner is still single-family, so registering a
second descriptor here would expose a model choice the planner cannot yet
honour. Happy to adjust naming or drop the legacy shims if you would rather
migrate the call sites outright.

The installer's supported source was a set of standalone static constants,
so every pinned value (repo, revision, index digest, size estimates) was
addressable only as a global. Adding a second model meant either mutating
those globals or threading a parallel set through the call sites.

Collect the pinned values into a `ModelSourceDescriptor` value type keyed
by a `ModelFamily`, and register the existing Gemma pin as the sole entry
in `SupportedModelSource.all`. Behaviour is unchanged: the legacy statics
become thin shims over `SupportedModelSource.default`, so existing callers
and the CLI keep resolving exactly the same values.

`SourceFingerprint.knownFingerprints` now derives from the registry rather
than restating the Gemma digest, which keeps the verification table from
drifting away from the pin it is meant to enforce.

Tests cover shim/descriptor parity, the pinned Gemma identity, registry key
and repo uniqueness, and fingerprint coverage for every registered source.
rexmhall09 added a commit to rexmhall09/TUFF that referenced this pull request Aug 16, 2026
User-facing rename of the fork. The five executable products become TUFF,
TUFFCLI, TUFFServer, TUFFRepack, and TUFFDecodeService; the app window, About
panel, and every CLI usage banner say TUFF; README and docs are rewritten
around the name, with the new logo as the header image and app icon.

Internal Swift target and module names stay TurboFieldfare*. Renaming them
would touch every file for no user-visible gain and would make merges from
upstream impractical, which is the point of tracking a fork.

Not renamed, deliberately:
- docs/benchmark-prompts/**: frozen benchmark fixtures whose text must not
  change, or measured results stop being comparable.
- The afterword: it is the upstream author's, about his project, and is now
  labelled as such with a link back to turbo-fieldfare.

Adds a Fork notice and Merge notes section covering what the Qwen merge
required and why upstream PR drumih#85 was skipped.

774 tests pass; release build produces all five renamed executables and the
app launches clean.
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.

1 participant