replen 1.0.25 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,6 +67,28 @@ Parse the JSON response. Note:
67
67
  the verdict isn't just "X is risky" but "X is risky; Y is the maintained
68
68
  replacement, N similar projects adopted it".
69
69
 
70
+ ### Step 2a — JIT grounding: profile this repo if onboarding hasn't yet
71
+
72
+ A large-portfolio `/replen-onboard` grounds the most-active repos fully and
73
+ gives the long tail a cheap version-only pass — so a registered repo can have
74
+ versions but **no capability profile yet**. Triaging it would fall back to
75
+ coarse tag matching (you'll see `filterMode: "tags"` and few/no facet-led
76
+ candidates). When that happens, ground it inline FIRST — it's just-in-time
77
+ onboarding, and it's why the user opening this repo is the right moment:
78
+
79
+ 1. Confirm the gap: call `replen_onboard_state` and find this repo — if
80
+ `hasCapabilities` is false, it needs grounding.
81
+ 2. Run the grounding contract (same as `/replen-onboard` step 2a–2e, condensed):
82
+ read the code, derive 8–15 grounded `{tag, descriptor, modality, paths}`
83
+ capabilities + a technical report, and push via `replen_set_capabilities`
84
+ (+ `replen_set_tags`, + `replen_set_versions` if not already reported).
85
+ Respect the cover — describe the tech, never de-sanitize the application.
86
+ 3. Re-pull the inventory (Step 2) — now it returns real facet-led matches.
87
+
88
+ Skip this when `hasCapabilities` is already true (the common case). One quiet
89
+ line to the user is enough: *"This repo wasn't fully profiled yet — grounding
90
+ it now so the matches actually fit."*
91
+
70
92
  ### Step 2b — Keep the version picture fresh (cheap, do it)
71
93
 
72
94
  If `git status` shows the lockfile changed since you last reported, or you
@@ -35,6 +35,16 @@ missing, stop and tell the user to run `npx replen` first.
35
35
 
36
36
  Find the user's local repositories and filter to the ones worth onboarding.
37
37
 
38
+ > **Shell portability (read before scripting the scan).** Assume macOS/zsh:
39
+ > - **BSD `sed`/`grep` reject GNU regex** like `+?` and `\|` — don't pipe remote
40
+ > URLs through `sed -E 's#…(…)?…#'`; parse `owner/name` with `basename`/`${}`
41
+ > or `git remote get-url` + a simple `cut`/parameter-expansion instead.
42
+ > - **`gh` is often shadowed** by a shell function/alias — if `gh` errors weirdly,
43
+ > call the real binary (`command gh …` or `/opt/homebrew/bin/gh`).
44
+ > - **zsh does NOT word-split unquoted vars** — build repo lists as arrays
45
+ > (`repos=(a b c); for r in $repos`), not space-strings in a `for` loop.
46
+ > Get these right up front; debugging them mid-sweep wastes cycles and looks broken.
47
+
38
48
  1. **Locate local clones.** Look in the parent directory of the cwd (sibling
39
49
  repos) and any obvious code root (`~/github`, `~/code`, `~/src`, `~/dev`).
40
50
  A repo is any directory containing `.git`.
@@ -50,26 +60,55 @@ Find the user's local repositories and filter to the ones worth onboarding.
50
60
  aegis-api, … — go, or want me to drop any?"* This is the **only** question you
51
61
  ask. Once confirmed, run the rest autonomously.
52
62
 
53
- ## Step 2Per-repo grounding (autonomous; fan out if you can)
63
+ ## Step 1.5Pre-flight: decide the MINIMUM work per repo (do NOT skip this)
54
64
 
55
- **Parallelise if your host supports it.** In Claude Code, spawn one background
56
- subagent per repo (Task tool / background agents) so the sweep runs concurrently
57
- and the user isn't blocked. If your host has no background/subagent primitive,
58
- process repos sequentially the autonomy matters more than the parallelism.
65
+ Before grounding anything, call **`replen_onboard_state`** ONCE. It returns
66
+ every repo's server-side state (`hasCapabilities`, `hasVersions`, `hasReport`).
67
+ Cross-reference each in-scope LOCAL repo against it and bucket it this is what
68
+ turns a 24-minute re-run into ~2 minutes, and a re-run should mostly be skips:
59
69
 
60
- **Idempotent + resumable.** Before working a repo, you may check whether it's
61
- already onboarded (it already has capabilities/facets). Re-running is always
62
- safe pushing again just overwrites so an interrupted sweep resumes cleanly by
63
- re-running and skipping repos already done.
70
+ - **FULL ground** not listed, or `hasCapabilities=false`. Read the code, do
71
+ the whole 2a–2e contract. (On a true cold start every repo is here — expected.)
72
+ - **VERSION-ONLY backfill**`hasCapabilities=true` but `hasVersions=false`.
73
+ Do NOT read the codebase or touch docs. Just read the lockfile + runtime pins
74
+ and call `replen_set_versions` (2e.4). Seconds per repo, no LLM-heavy read.
75
+ - **SKIP** — `hasCapabilities && hasVersions && hasReport` and the repo's
76
+ `git log -1` hasn't moved since it was last grounded. Already done; leave it.
64
77
 
65
- **"Done" includes a version report.** A repo that has capabilities but has
66
- never reported versions is NOT done give it the lightweight backfill pass:
67
- skip the doc work and re-profiling entirely, just read the lockfile + runtime
68
- pins and call `replen_set_versions` (Step 2e.4). This is how an existing
69
- portfolio gets version-aware deadlines/security awareness after upgrading
70
- Replen — a re-run backfills versions across every repo in minutes.
78
+ State the plan in one line ("12 to ground, 18 version-backfills, 3 skips") so
79
+ the user sees why it'll be fast. **A full code-read on an already-grounded repo
80
+ is wasted work the pre-flight exists to prevent exactly the 24-minute re-run.**
71
81
 
72
- For each in-scope repo, do this contract:
82
+ ## Step 2 — Per-repo grounding (autonomous; fan out if you can)
83
+
84
+ **Parallelise if your host supports it.** In Claude Code, spawn one background
85
+ subagent per repo in the FULL-ground bucket (Task tool / background agents) so
86
+ the sweep runs concurrently. Version-only backfills are cheap enough to batch
87
+ inline (no subagent needed). If your host has no subagent primitive, process
88
+ sequentially — autonomy matters more than parallelism.
89
+
90
+ **Cold-start at scale (tens → hundreds of repos).** A new user with 200 repos
91
+ must not block on a 3-hour read. Tier the work so value lands fast:
92
+ 1. **Order by recency** — ground the most-recently-committed repos first; those
93
+ are what the user is actively working on and will see footnotes for soonest.
94
+ 2. **Cap concurrency** to what the host sustains (Claude Code parallel subagents
95
+ are capped automatically; don't try to launch 200 at once — launch in waves).
96
+ 3. **Version-first is the DEFAULT for the long tail** (not a fallback). Pick a
97
+ full-ground budget N (the most-recently-committed repos — say the active ~20–
98
+ 30, or what the user confirms). Everything BEYOND N gets a version-only
99
+ backfill: cheap, no code read, and it turns on EOL/security/dependency-
100
+ exclusion awareness immediately. Full capability grounding for the tail then
101
+ happens **just-in-time on first `/replen` in that repo** — the `/replen`
102
+ skill grounds a `hasVersions && !hasCapabilities` repo inline before triaging
103
+ (its Step 2a). This is the key to a hundreds-of-repos cold start staying
104
+ minutes, not hours: you never speculatively read 170 repos the user may never
105
+ open. Tell the user: "Grounding your N most-active repos now; the rest get
106
+ version-aware coverage immediately and a full profile the first time you open
107
+ them." Don't silently drop the tail — it's covered, just lazily.
108
+
109
+ **"Done" includes a version report** — covered by the VERSION-ONLY bucket above.
110
+
111
+ For each repo in the FULL-ground bucket, do this contract:
73
112
 
74
113
  ### 2a-pre. Check for an existing knowledge graph FIRST (the adapter step)
75
114
 
@@ -165,9 +204,16 @@ specific — `cloudflare bypass`/`proxy rotation`, not just `web scraping`.
165
204
 
166
205
  ### 2e. Push to Replen
167
206
 
168
- 1. **Register** the repo if it isn't already: `npx replen sync-projects` (scans
169
- local repos and pushes them). Ensure each in-scope repo has a GitHub remote so
170
- it's scoped by `owner/name`.
207
+ 1. **Register** the repo if it isn't already. The per-repo `replen_set_tags` /
208
+ `replen_set_capabilities` push below resolves owner-tolerantly and CREATES
209
+ the project row if missing — so for the fan-out flow you usually don't need a
210
+ separate register step at all. If you do want a bulk pre-register, run
211
+ `npx replen sync-projects` **from a neutral directory like `$HOME`** (e.g.
212
+ `cd "$HOME" && npx replen sync-projects`) — NOT from inside a checkout named
213
+ `replen`, where the local package shadows the CLI and npx fails with "could
214
+ not determine executable to run". `npx replen@latest sync-projects` also
215
+ sidesteps the shadow. Ensure each repo has a GitHub remote so it scopes by
216
+ `owner/name`.
171
217
  2. **Set domain tags** with `replen_set_tags` — broad domain labels.
172
218
  3. **Set capabilities + report** with `replen_set_capabilities`, passing the
173
219
  grounded `capabilities` array AND the `report` from 2c. The server builds the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replen",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "description": "Make your AI coding tools smarter. One command, no API keys, free. Replen watches what your projects actually do and surfaces a few things worth bringing in each month. Use one as is, port a piece of another, cherry pick an idea, or build it clean room. The match happens inside your AI tool's session. A few actionable matches a month, by design.",
5
5
  "type": "module",
6
6
  "bin": {