@@ -11,7 +11,7 @@ Quick lookup reference for functions in `cli_audit.py`, organized by category.
1111| ** Classification** | ` detect_install_method ` , ` _classify_install_method ` | Installation method detection |
1212| ** Upstream APIs** | ` latest_github ` , ` latest_pypi ` , ` latest_crates ` , ` latest_npm ` , ` latest_gnu ` | Fetch upstream versions |
1313| ** HTTP** | ` http_fetch ` , ` http_get ` | Network layer with retries |
14- | ** Cache** | ` load_manual_versions ` , ` get_manual_latest ` , ` set_manual_latest ` , ` load_hints ` , ` get_hint ` , ` set_hint ` | Multi-tier cache management |
14+ | ** Cache** | ` load_manual_versions ` , ` get_manual_latest ` , ` set_manual_latest ` | Cache management |
1515| ** Core** | ` audit_tool ` , ` get_latest ` , ` main ` | Main audit logic |
1616
1717---
@@ -134,7 +134,6 @@ Extract version string from executable.
134134- Most tools: ` <path> --version `
135135- ` go ` , ` curlie ` , ` isort ` : Custom version flags
136136- ` entr ` , ` sponge ` : No version flag (returns empty)
137- - Uses hints cache to remember working flags
138137
139138** Usage:**
140139``` python
@@ -335,8 +334,6 @@ Fetch latest GitHub release.
335334** Strategies:**
3363351 . Try ` /repos/{owner}/{repo}/releases/latest ` with redirect following
3373362 . On failure, try Atom feed at ` /releases.atom `
338- 3 . Use hints cache to skip failed methods
339- 4 . Store successful method as hint for next run
340337
341338** Usage:**
342339``` python
@@ -345,9 +342,6 @@ tag, method = latest_github("sharkdp", "fd")
345342
346343tag, method = latest_github(" BurntSushi" , " ripgrep" )
347344# ("14.1.1", "latest_redirect")
348-
349- # Hint is stored automatically for next run
350- hint = get_hint(" gh:sharkdp/fd" )
351345# "latest_redirect"
352346```
353347
@@ -603,76 +597,6 @@ set_manual_latest("ripgrep", "14.1.1")
603597
604598---
605599
606- ### ` load_hints() -> None `
607-
608- Load API method hints from ` __hints__ ` in ` upstream_versions.json ` .
609-
610- ** Side Effects:** Populates global ` HINTS ` dict
611-
612- ** Usage:**
613- ``` python
614- load_hints()
615- method = HINTS .get(" gh:owner/repo" , " " )
616- ```
617-
618- ** See:** [ API_REFERENCE.md#load_hints] ( API_REFERENCE.md#load_hints )
619-
620- ---
621-
622- ### ` get_hint(key) -> str `
623-
624- Get cached API method for a source.
625-
626- ** Parameters:**
627- - ` key ` (` str ` ) - Hint key formats:
628- - ` "gh:owner/repo" ` - GitHub API method
629- - ` "local_flag:tool" ` - Version flag that worked
630-
631- ** Returns:**
632- - ` str ` - Method string (e.g., ` "latest_redirect" ` , ` "--version" ` ) or empty
633-
634- ** Usage:**
635- ``` python
636- # Get GitHub API method
637- method = get_hint(" gh:sharkdp/fd" )
638- if method == " latest_redirect" :
639- # Try latest redirect first
640-
641- # Get version flag
642- flag = get_hint(" local_flag:ripgrep" )
643- if flag == " -V" :
644- # Use -V instead of --version
645- ```
646-
647- ** See:** [ API_REFERENCE.md#get_hint] ( API_REFERENCE.md#get_hint )
648-
649- ---
650-
651- ### ` set_hint(key, value) -> None `
652-
653- Store API method hint for future runs.
654-
655- ** Parameters:**
656- - ` key ` (` str ` ) - Hint key
657- - ` value ` (` str ` ) - Method that worked
658-
659- ** Side Effects:** Writes to ` __hints__ ` in ` upstream_versions.json `
660-
661- ** Lock Ordering:** Requires ` MANUAL_LOCK ` → ` HINTS_LOCK `
662-
663- ** Usage:**
664- ``` python
665- # Store successful GitHub method
666- set_hint(" gh:owner/repo" , " latest_redirect" )
667-
668- # Store working version flag
669- set_hint(" local_flag:ripgrep" , " -V" )
670- ```
671-
672- ** See:** [ API_REFERENCE.md#set_hint] ( API_REFERENCE.md#set_hint )
673-
674- ---
675-
676600## Core Audit Functions
677601
678602Main audit logic coordinating all subsystems.
@@ -732,12 +656,10 @@ Get latest upstream version for a tool.
732656- ` tuple[str, str] ` - ` (version, method) ` - version string and source method
733657
734658** Cache Strategy:**
735- 1 . If ` MANUAL_FIRST=1 ` , check manual cache first
736- 2 . Check hints cache for fastest method
737- 3 . Try upstream API (with retries)
738- 4 . On success, update hints and manual caches
739- 5 . On failure, fall back to manual cache
740- 6 . Final fallback: return ` ("", "") `
659+ 1 . Try upstream API (with retries)
660+ 2 . On success, update cache
661+ 3 . On failure, fall back to cached upstream
662+ 4 . Final fallback: return ` ("", "") `
741663
742664** Usage:**
743665``` python
0 commit comments