repo-nexus 0.7.4 → 0.7.5

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.
package/lib/ai.sh CHANGED
@@ -672,11 +672,11 @@ sync_windsurf() {
672
672
  }
673
673
 
674
674
  sync_ai_providers() {
675
- # Clean legacy Copilot prompt harness if present
676
- rm -rf "$NEXUS_DIR/.github/prompts" "$NEXUS_DIR/.github/copilot-instructions.md" 2>/dev/null || true
675
+ # Clean legacy Copilot prompt harness and skills if present, strictly preserving custom Copilot instructions
676
+ rm -rf "$NEXUS_DIR/.github/prompts" 2>/dev/null || true
677
+ clean_rnex_instructions "$NEXUS_DIR/.github/copilot-instructions.md"
677
678
  clean_provider_user_skills "$NEXUS_DIR/.github/skills"
678
679
  clean_provider_agents "$NEXUS_DIR/.github/agents" ".agent.md"
679
- rmdir "$NEXUS_DIR/.github" 2>/dev/null || true
680
680
 
681
681
  sync_claude
682
682
  sync_gemini
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-nexus",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Lightweight, zero-dependency Virtual Meta-Repo companion for multi-repo workspaces and shared AI context (no git submodules)",
5
5
  "bin": {
6
6
  "repo-nexus": "rnex",
@@ -197,6 +197,18 @@ ingest_member_readme() {
197
197
  _needs_gen=1
198
198
  fi
199
199
 
200
+ # Determine navigation reference (avoid linking to missing navigation pages)
201
+ _nav_target="index.md"
202
+ _nav_label="Wiki Index"
203
+ _nav_related="[]"
204
+ _nav_extends="[]"
205
+ if [ -f "$_wiki_path/member-repositories.md" ]; then
206
+ _nav_target="member-repositories.md"
207
+ _nav_label="Member Repositories"
208
+ _nav_related='["member-repositories.md"]'
209
+ _nav_extends='["member-repositories.md"]'
210
+ fi
211
+
200
212
  if [ "$_needs_gen" -eq 1 ]; then
201
213
  cat > "$_target_page" <<PAGE_EOF
202
214
  ---
@@ -204,8 +216,8 @@ title: "Member Repo: ${_m_repo}"
204
216
  tags: [member-repo, ${_m_repo}]
205
217
  last_updated: ${_today}
206
218
  sources: ["${_rel_source}"]
207
- related: ["member-repositories.md"]
208
- extends: ["member-repositories.md"]
219
+ related: ${_nav_related}
220
+ extends: ${_nav_extends}
209
221
  contradicts: []
210
222
  mentioned_in: ["index.md", "hot.md"]
211
223
  ---
@@ -221,7 +233,7 @@ ${_m_summary}
221
233
  * **Management:** Tracked as an autonomous Git member repository in Repo Nexus.
222
234
 
223
235
  ## Contextual Links
224
- * See [Member Repositories](./member-repositories.md) for workspace member repository lifecycle.
236
+ * See [${_nav_label}](./${_nav_target}) for workspace member repository catalog.
225
237
  PAGE_EOF
226
238
 
227
239
  # Append to Operation Log (_log.md)
@@ -277,8 +289,17 @@ LOG_EOF
277
289
 
278
290
  # 5. Register in hot cache (hot.md) under Section 1 if not already present
279
291
  if [ -f "$_wiki_path/hot.md" ] && ! grep -q "${_rel_loc}" "$_wiki_path/hot.md"; then
292
+ # Ultra-concise summary for bounded hot cache (~500-word ceiling)
293
+ _hot_summary="$(printf '%s' "$_m_summary" | sed -e 's/[.?!][[:space:]].*//' -e 's/[.?!]$//' | awk '{
294
+ out=""
295
+ for (i=1; i<=NF && i<=7; i++) {
296
+ out = (out == "") ? $i : out " " $i
297
+ }
298
+ print out
299
+ }')"
300
+ [ -z "$_hot_summary" ] && _hot_summary="Member repository"
301
+ _hot_line="* **${_m_repo} (\`${_rel_loc}\`):** ${_hot_summary}."
280
302
  _tmp_hot="$(mktemp)"
281
- _hot_line="* **${_m_repo} (\`${_rel_loc}\`):** ${_m_summary}"
282
303
  if LINE="$_hot_line" awk '
283
304
  /^## 1\. Architecture & Member Repo Map/ {
284
305
  print
@@ -345,3 +366,34 @@ if [ -d "$RNEX_ROOT/$REPOS_DIR" ]; then
345
366
  done
346
367
  done
347
368
  fi
369
+
370
+ # 3. Enforce strict ~500-word ceiling on hot.md (condense Section 1 if needed)
371
+ if [ -f "$_wiki_path/hot.md" ]; then
372
+ _hot_words="$(wc -w < "$_wiki_path/hot.md" 2>/dev/null || echo 0)"
373
+ if [ "$_hot_words" -gt 480 ]; then
374
+ _num_repos="$(grep -cE '^\* \*\*[a-zA-Z0-9_.-]+ \(`?repos/' "$_wiki_path/hot.md" 2>/dev/null || echo 0)"
375
+ if [ "$_num_repos" -gt 3 ]; then
376
+ _repo_names="$(grep -E '^\* \*\*[a-zA-Z0-9_.-]+ \(`?repos/' "$_wiki_path/hot.md" | sed -e 's/^\* \*\*//' -e 's/ .*//' | tr '\n' ', ' | sed -e 's/, $//')"
377
+ _clean_repos="$(printf '%s' "$REPOS_DIR" | sed -e 's#^\./##' -e 's#^/##' -e 's#/$##')"
378
+ _tmp_b="$(mktemp)"
379
+ if awk -v rnames="$_repo_names" -v nrepos="$_num_repos" -v rdir="$_clean_repos" '
380
+ BEGIN { in_s1=0; replaced=0 }
381
+ /^## 1\. Architecture & Member Repo Map/ { in_s1=1; print; next }
382
+ in_s1 && /^## / { in_s1=0 }
383
+ in_s1 && /^\* \*\*[a-zA-Z0-9_.-]+ \(`?repos\// {
384
+ if (!replaced) {
385
+ print "* **Member Repositories (" nrepos " repos):** Autonomous repositories under `" rdir "/`: " rnames ". See [Wiki Index](./index.md#member-repositories) for individual architecture pages."
386
+ replaced=1
387
+ }
388
+ next
389
+ }
390
+ { print }
391
+ ' "$_wiki_path/hot.md" > "$_tmp_b"; then
392
+ mv "$_tmp_b" "$_wiki_path/hot.md"
393
+ else
394
+ rm -f "$_tmp_b"
395
+ fi
396
+ fi
397
+ fi
398
+ fi
399
+