diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-30 01:04:47 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-30 01:04:47 -0500 |
| commit | eefd55510cf6b180a7dcc9be40fde894d9adf3ac (patch) | |
| tree | 24e2db3344fa1f6d63a49ab99e02ba0849f90f95 /docs | |
| parent | 540d805bd917a37d0fafa5393f3bfc7e3603570e (diff) | |
| download | gloss-eefd55510cf6b180a7dcc9be40fde894d9adf3ac.tar.gz gloss-eefd55510cf6b180a7dcc9be40fde894d9adf3ac.zip | |
feat: implement gloss orchestration core (lookup + fetch-online)
Two pure-ish helpers and two interactive entry points.
`gloss--orchestrate-fetch-result' is a pure pattern-matcher that
classifies a fetch result into one of five decision symbols. The
ordering matters: definition count gates first, then the error
taxonomy. All-empty falls through to `:error-no-defs' so the user
never sees a silent no-op.
`gloss--lookup-flow' is the orchestration. Cache hit dispatches
straight to display. Cache miss runs a fetch, classifies via the
helper, and either auto-saves the lone definition, prompts the user
to pick, or messages the right error. The `force-fetch' arg lets
`gloss-fetch-online' reuse the same flow without duplicating logic.
`gloss-core-save' is called with the `replace' collision action so
force-fetch over an existing entry replaces it cleanly. On a real
cache miss the entry is fresh, so `replace' is moot — the action
only matters when the term is already there.
`gloss-lookup' and `gloss-fetch-online' are now thin interactive
wrappers around `gloss--lookup-flow'. The remaining stubs (add, edit,
list-terms, stats, reload, drill-export) still raise user-error.
111 tests pass in 0.23s — 98 prior plus 13 new across the two new
files.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
