ai-first-os 1.10.0 → 2.0.0
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/README.md +33 -31
- package/core/CLAUDE.md +48 -12
- package/core/VERSION +1 -1
- package/core/install.sh +173 -52
- package/core/lib/bootstrap.sh +41 -26
- package/core/lib/build-indexes.sh +283 -0
- package/core/lib/capture.sh +126 -55
- package/core/lib/check-resolvable.sh +13 -2
- package/core/lib/close-session.sh +172 -119
- package/core/lib/common.sh +505 -92
- package/core/lib/focus-read.sh +94 -58
- package/core/lib/manual-link.sh +10 -8
- package/core/lib/markdown.py +2 -2
- package/core/lib/migrate-layout.sh +92 -0
- package/core/lib/migrate-root.sh +497 -0
- package/core/lib/migrate_layout.py +2000 -0
- package/core/lib/new-memory.sh +33 -44
- package/core/lib/new-product.sh +11 -13
- package/core/lib/new-workspace.sh +18 -9
- package/core/lib/orchestrator-init.sh +80 -0
- package/core/lib/pack-install.sh +44 -30
- package/core/lib/recall.sh +1 -1
- package/core/lib/recall_index.py +48 -6
- package/core/lib/remote-backup.sh +30 -20
- package/core/lib/rename-heads.sh +8 -8
- package/core/lib/rename-workspaces.sh +3 -3
- package/core/lib/session-read.sh +133 -73
- package/core/lib/session-start.sh +238 -221
- package/core/lib/supersede.sh +199 -3
- package/core/lib/sweep.sh +5 -0
- package/core/manual/COMO-FUNCIONA.md +169 -58
- package/core/manual/HOW-IT-WORKS.md +158 -57
- package/core/resolver.md +4 -2
- package/core/skills/bootstrap.md +63 -44
- package/core/skills/capture.md +15 -8
- package/core/skills/check-resolvable.md +1 -1
- package/core/skills/close-session.md +9 -5
- package/core/skills/grill.md +3 -3
- package/core/skills/migrate-layout.md +48 -0
- package/core/skills/migrate-root.md +64 -0
- package/core/skills/mount-repo.md +6 -6
- package/core/skills/new-memory.md +20 -18
- package/core/skills/new-product.md +4 -3
- package/core/skills/new-spec.md +6 -0
- package/core/skills/new-workspace.md +7 -5
- package/core/skills/orchestrator.md +101 -0
- package/core/skills/supersede.md +14 -0
- package/core/templates/node-repo/context/open-questions.md +3 -0
- package/core/templates/strings.md +396 -271
- package/core/templates/tree.md +22 -27
- package/package.json +1 -1
- package/core/lib/my-wiki-gates.sh +0 -137
- package/core/lib/my-wiki.sh +0 -202
- package/core/lib/my_wiki_build.py +0 -548
- package/core/lib/my_wiki_graph.py +0 -137
- package/core/lib/my_wiki_overview.py +0 -392
- package/core/skills/my-wiki.md +0 -103
- package/core/templates/my-wiki-graph.js +0 -431
- package/core/templates/my-wiki-overview.js +0 -174
- package/core/templates/my-wiki.html +0 -1017
package/core/lib/rename-heads.sh
CHANGED
|
@@ -232,14 +232,14 @@ PLAN
|
|
|
232
232
|
# llamador. El mapa se pasa entero, después de todos los movimientos.
|
|
233
233
|
OS_RW_MAP="$mapa"
|
|
234
234
|
|
|
235
|
-
objetivos="
|
|
236
|
-
objetivos="$objetivos$
|
|
235
|
+
objetivos="$OS_OPERATOR_FILE${OS_SEP}$OS_ROOT_RESOLVER_FILE${OS_SEP}backlog.md${OS_SEP}decisions.md${OS_SEP}learnings.md${OS_SEP}"
|
|
236
|
+
objetivos="$objetivos$OS_MOUNTS_ARCHIVO$OS_SEP"
|
|
237
237
|
for f in "$brain/initiatives"/*/"$nuevo" \
|
|
238
|
-
"$brain/$wsdir"/*/resolver.md "$brain/$wsdir"/*/backlog.md \
|
|
238
|
+
"$brain/$wsdir"/*/.resolver.md "$brain/$wsdir"/*/resolver.md "$brain/$wsdir"/*/backlog.md \
|
|
239
239
|
"$brain/$wsdir"/*/decisions.md "$brain/$wsdir"/*/learnings.md \
|
|
240
240
|
"$brain/$wsdir"/*/"$nuevo" \
|
|
241
241
|
"$brain/$wsdir"/*/initiatives/*/"$nuevo" \
|
|
242
|
-
"$brain/$wsdir"/*/products/*/resolver.md "$brain/$wsdir"/*/products/*/decisions.md \
|
|
242
|
+
"$brain/$wsdir"/*/products/*/.resolver.md "$brain/$wsdir"/*/products/*/resolver.md "$brain/$wsdir"/*/products/*/decisions.md \
|
|
243
243
|
"$brain/$wsdir"/*/products/*/"$nuevo"; do
|
|
244
244
|
[ -f "$f" ] || continue
|
|
245
245
|
objetivos="$objetivos${f#$brain/}$OS_SEP"
|
|
@@ -262,8 +262,8 @@ done
|
|
|
262
262
|
IFS="$old_ifs"
|
|
263
263
|
|
|
264
264
|
# ---------------------------------------------------------------- (5) el árbol, último
|
|
265
|
-
tree_tmp="$brain
|
|
266
|
-
if [ -f "$brain
|
|
265
|
+
tree_tmp="$brain/$OS_TREE_FILE.os-tmp"
|
|
266
|
+
if [ -f "$brain/$OS_TREE_FILE" ]; then
|
|
267
267
|
cambio_tree=0
|
|
268
268
|
: > "$tree_tmp"
|
|
269
269
|
while IFS= read -r line || [ -n "$line" ]; do
|
|
@@ -281,9 +281,9 @@ if [ -f "$brain/tree.md" ]; then
|
|
|
281
281
|
esac
|
|
282
282
|
[ "$nueva" = "$line" ] || cambio_tree=1
|
|
283
283
|
printf '%s\n' "$nueva"
|
|
284
|
-
done < "$brain
|
|
284
|
+
done < "$brain/$OS_TREE_FILE" >> "$tree_tmp"
|
|
285
285
|
if [ "$cambio_tree" = "1" ]; then
|
|
286
|
-
mv "$tree_tmp" "$brain
|
|
286
|
+
mv "$tree_tmp" "$brain/$OS_TREE_FILE"
|
|
287
287
|
reescritos="$reescritos tree.md$nl"
|
|
288
288
|
hubo_cambio=1
|
|
289
289
|
else
|
|
@@ -168,7 +168,7 @@ rewrite_about() {
|
|
|
168
168
|
# ---------------------------------------------------------------- (1) tree.md primero
|
|
169
169
|
reescritos=""
|
|
170
170
|
hubo_cambio=0
|
|
171
|
-
if rewrite_prefix "$brain
|
|
171
|
+
if rewrite_prefix "$brain/$OS_TREE_FILE"; then
|
|
172
172
|
reescritos="$reescritos tree.md
|
|
173
173
|
"
|
|
174
174
|
hubo_cambio=1
|
|
@@ -188,7 +188,7 @@ if [ -d "$brain/$old_name" ]; then
|
|
|
188
188
|
fi
|
|
189
189
|
|
|
190
190
|
# ---------------------------------------------------------------- (3) el resto del ruteo
|
|
191
|
-
objetivos="
|
|
191
|
+
objetivos="$OS_ROOT_RESOLVER_FILE${OS_SEP}"
|
|
192
192
|
for res in "$brain/$new_name"/*/resolver.md; do
|
|
193
193
|
[ -f "$res" ] || continue
|
|
194
194
|
objetivos="$objetivos${res#$brain/}$OS_SEP"
|
|
@@ -198,7 +198,7 @@ for bl in "$brain/$new_name"/*/backlog.md; do
|
|
|
198
198
|
[ -f "$bl" ] || continue
|
|
199
199
|
objetivos="$objetivos${bl#$brain/}$OS_SEP"
|
|
200
200
|
done
|
|
201
|
-
objetivos="$objetivos$
|
|
201
|
+
objetivos="$objetivos$OS_MOUNTS_ARCHIVO$OS_SEP"
|
|
202
202
|
|
|
203
203
|
old_ifs="$IFS"
|
|
204
204
|
IFS="$OS_SEP"
|
package/core/lib/session-read.sh
CHANGED
|
@@ -1,46 +1,80 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Startup read of a scope:
|
|
2
|
+
# Startup read of a scope: a workspace.
|
|
3
3
|
# Internal: not invocable — the session contract (core/CLAUDE.md) fires it, right after the startup
|
|
4
4
|
# scan and before the model answers the first message.
|
|
5
5
|
#
|
|
6
6
|
# Usage: session-read.sh --brain DIR --org SLUG
|
|
7
7
|
# session-read.sh --brain DIR --workspace SLUG
|
|
8
|
-
# session-read.sh --brain DIR --root
|
|
9
8
|
#
|
|
10
|
-
# `--workspace` is an exact synonym of `--org` (spec 039)
|
|
11
|
-
#
|
|
9
|
+
# `--workspace` is an exact synonym of `--org` (spec 039), the same way `session-start.sh` reads its
|
|
10
|
+
# scope.
|
|
11
|
+
#
|
|
12
|
+
# `--root` no longer exists (spec 059): the root of the brain holds only machinery, and the
|
|
13
|
+
# operator's own work is the `personal` workspace. The flag is accepted only to stop with the same
|
|
14
|
+
# answer as `session-start.sh --root` (`os_root_gone`): the workspaces there are, the migration, exit
|
|
15
|
+
# 2, nothing printed on stdout.
|
|
12
16
|
#
|
|
13
17
|
# READING ORDER — this comment is the only place the reading order is written down, and the body
|
|
14
18
|
# below is what executes it. The contract names this script instead of listing files:
|
|
15
19
|
#
|
|
16
|
-
# 1. operator.md
|
|
17
|
-
# 2.
|
|
18
|
-
# 3. <workspaces-dir>/<slug
|
|
19
|
-
# 4. <workspaces-dir>/<slug>/
|
|
20
|
-
# 5.
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
20
|
+
# 1. account/operator.md
|
|
21
|
+
# 2. <workspaces-dir>/<slug>/<head>
|
|
22
|
+
# 3. <workspaces-dir>/<slug>/.resolver.md
|
|
23
|
+
# 4. <workspaces-dir>/<slug>/context/glossary.md (only when it exists, spec 072 and 076)
|
|
24
|
+
# 5. <workspaces-dir>/<slug>/context/context-map.md (only when it exists, spec 072 and 076)
|
|
25
|
+
# 6. the key decisions of the scope (spec 069, revised by spec 076 C19): every decision in
|
|
26
|
+
# `<workspaces-dir>/<slug>/decisions/` whose frontmatter carries `key:`, that is not replaced
|
|
27
|
+
# and that names no node in `about:` — one index line each, newest first, read from each file's
|
|
28
|
+
# frontmatter and never from an index. A key decision about a node loads with the focus on that
|
|
29
|
+
# node (`focus-read.sh`), not here. Lines only, never the bodies they link to.
|
|
30
|
+
# 7. .os/core/resolver.md
|
|
31
|
+
# 8. <skills-dir>/*-resolver/SKILL.md — zero or more, `LC_ALL=C sort` by path, for the skills
|
|
32
|
+
# folders `.agents/skills` and `.claude/skills` (spec 076, C10); a pack present in both counts
|
|
33
|
+
# once
|
|
34
|
+
# 9. .system/resolver.md
|
|
35
|
+
# 10. the standing role's craft file, when the node declares `role:` and the craft is installed
|
|
36
|
+
#
|
|
37
|
+
# The operator's voice (`account/voice/voice.md`) is not part of this read (spec 076, C9): the session
|
|
38
|
+
# contract tells the session to read the voice of whoever signs, right before writing a text to
|
|
39
|
+
# publish. Loading it at startup cost every session the voice and served only the ones that write.
|
|
28
40
|
#
|
|
29
41
|
# Output format, fixed:
|
|
30
42
|
# - Header per file: `── <path relative to the brain>`.
|
|
31
43
|
# - Body: the bytes of the file; a file that does not end in a newline gets one, so the next
|
|
32
44
|
# header always starts its own line. A 0-byte file exists: header and nothing else.
|
|
33
|
-
# - The key decisions open with the fixed marker `key-decisions: <
|
|
34
|
-
# both languages, like `about-jump:` and `active-role:`; it never starts with `── `,
|
|
35
|
-
# what follows is a cut
|
|
36
|
-
#
|
|
37
|
-
#
|
|
45
|
+
# - The key decisions open with the fixed marker `key-decisions: <workspaces-dir>/<slug>/decisions/`
|
|
46
|
+
# —English in both languages, like `about-jump:` and `active-role:`; it never starts with `── `,
|
|
47
|
+
# because what follows is a cut and not a file— and one index line per decision, its link
|
|
48
|
+
# relative to that folder (`os_doc_index_line`, the shape every generated index uses). A scope with
|
|
49
|
+
# no key decision prints no marker and no lines.
|
|
50
|
+
# - Right after them, the indexes of the scope are generated (`build-indexes.sh`, spec 076 C18):
|
|
51
|
+
# `decisions/index.md`, `learnings/index.md` and the `index.md` of each area node something names
|
|
52
|
+
# in `about:`. Nothing of them is printed — the focus of a node prints its index — except, as one
|
|
53
|
+
# entry, a `gitignore-declared: <path>` line per path written for the first time, which the
|
|
54
|
+
# session contract tells the session to commit (`.gitignore`) in the same turn, and a
|
|
55
|
+
# `gitignore-declare-failed: <path>` line per index that could not be ignored and so was not written.
|
|
38
56
|
# - A file that is not there prints `── missing: <path>` and no body, and never stops the read.
|
|
39
57
|
# - Exactly one blank line between entries, nothing before the first.
|
|
40
58
|
# - The standing role closes the output: the blank line that separates entries, the line
|
|
41
59
|
# `active-role: <slug> · <path>` (the same fixed marker `session-start.sh` prints, spec 009),
|
|
42
60
|
# and on the next line the craft file's header and body, with no blank line in between.
|
|
43
61
|
#
|
|
62
|
+
# Steps 4 and 5 are optional files of the workspace: when one is not there nothing is printed for
|
|
63
|
+
# it, not even a `── missing:` line, so a workspace without them reads byte for byte as before
|
|
64
|
+
# spec 072.
|
|
65
|
+
#
|
|
66
|
+
# Steps 4 and 5 are also one of the two writes of this read (spec 072, C4; the other is the indexes): when the file exists and no
|
|
67
|
+
# line of `tree.md` reaches it —a brain born before the spec—, the read appends
|
|
68
|
+
# `content: <workspaces-dir>/*/context/*.md` with `os_tree_ensure` and prints, as its own entry right
|
|
69
|
+
# after the file's, the fixed marker `tree-declared: content: <glob>` (English in both languages,
|
|
70
|
+
# like `key-decisions:`). The session that sees the marker commits `tree.md` in the same turn, as it
|
|
71
|
+
# does with anything else written in the brain. The scan never writes: it diagnoses, and in the
|
|
72
|
+
# session where the line is added it still reports the file as not reached. A workspace without
|
|
73
|
+
# the files, or a tree that already reaches them, is never written and reads as before. A write
|
|
74
|
+
# that does not land —a `tree.md` that cannot be written— never stops the read: the entry is then
|
|
75
|
+
# `tree-declare-failed: content: <glob> — ` followed by `SESSION_READ_TREE_DECLARE_FAILED` from
|
|
76
|
+
# `strings.md`, so the session tells the operator instead of the failure passing as a clean read.
|
|
77
|
+
#
|
|
44
78
|
# Nothing is printed between `.os/core/resolver.md` and `resolver.md` when no pack is installed,
|
|
45
79
|
# and nothing is printed for a `role:` whose craft is not installed: the scan already reports that
|
|
46
80
|
# under Checks.
|
|
@@ -63,7 +97,7 @@ nl="${nl%x}"
|
|
|
63
97
|
brain=""
|
|
64
98
|
org=""
|
|
65
99
|
workspace=""
|
|
66
|
-
|
|
100
|
+
root_pedido=0
|
|
67
101
|
# A flag that takes a value checks that the value is there before consuming it: with the flag as the
|
|
68
102
|
# last argument (`--brain . --org`), `shift 2` fails without consuming anything, `$#` stays at 1 and
|
|
69
103
|
# the loop repeats the same argument forever — the script has no `set -e` to stop it.
|
|
@@ -72,7 +106,7 @@ while [ $# -gt 0 ]; do
|
|
|
72
106
|
--brain) [ $# -ge 2 ] || os_die "--brain needs a value"; brain="$2"; shift 2 ;;
|
|
73
107
|
--org) [ $# -ge 2 ] || os_die "--org needs a value"; org="$2"; shift 2 ;;
|
|
74
108
|
--workspace) [ $# -ge 2 ] || os_die "--workspace needs a value"; workspace="$2"; shift 2 ;;
|
|
75
|
-
--root)
|
|
109
|
+
--root) root_pedido=1; shift ;;
|
|
76
110
|
*) os_die "unknown argument: $1" ;;
|
|
77
111
|
esac
|
|
78
112
|
done
|
|
@@ -84,12 +118,10 @@ if [ -n "$org" ] && [ -n "$workspace" ] && [ "$org" != "$workspace" ]; then
|
|
|
84
118
|
fi
|
|
85
119
|
[ -n "$org" ] || org="$workspace"
|
|
86
120
|
|
|
121
|
+
[ "$root_pedido" = "0" ] || os_root_gone "$brain"
|
|
122
|
+
|
|
87
123
|
[ -n "$brain" ] || os_die "missing --brain"
|
|
88
|
-
|
|
89
|
-
[ -z "$org" ] || os_die "--root and --org/--workspace are exclusive"
|
|
90
|
-
else
|
|
91
|
-
[ -n "$org" ] || os_die "missing --org, --workspace or --root"
|
|
92
|
-
fi
|
|
124
|
+
[ -n "$org" ] || os_die "missing --org or --workspace"
|
|
93
125
|
[ -d "$brain" ] || os_die "no such brain: $brain"
|
|
94
126
|
brain=$(cd "$brain" && pwd)
|
|
95
127
|
|
|
@@ -105,25 +137,22 @@ os_lang_load "$lang"
|
|
|
105
137
|
|
|
106
138
|
# ---------------------------------------------------------------- the scope is validated by listing
|
|
107
139
|
# Byte for byte against the real names under the workspaces folder, never with `-d`, and with the
|
|
108
|
-
# same keys the scan uses: a scope that does not exist has to read the same in both places.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
slugs="$slugs $slug$nl"
|
|
117
|
-
done <<SLUGS
|
|
140
|
+
# same keys the scan uses: a scope that does not exist has to read the same in both places.
|
|
141
|
+
if ! os_org_existe "$brain" "$org"; then
|
|
142
|
+
printf "$S_SESSION_ORG_NOT_FOUND\n" "$org" >&2
|
|
143
|
+
slugs=""
|
|
144
|
+
while IFS= read -r slug || [ -n "$slug" ]; do
|
|
145
|
+
[ -n "$slug" ] || continue
|
|
146
|
+
slugs="$slugs $slug$nl"
|
|
147
|
+
done <<SLUGS
|
|
118
148
|
$(os_org_slugs "$brain")
|
|
119
149
|
SLUGS
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
fi
|
|
125
|
-
exit 2
|
|
150
|
+
if [ -n "$slugs" ]; then
|
|
151
|
+
printf '%s' "$slugs" >&2
|
|
152
|
+
else
|
|
153
|
+
printf ' %s\n' "$S_SESSION_NO_ORGS" >&2
|
|
126
154
|
fi
|
|
155
|
+
exit 2
|
|
127
156
|
fi
|
|
128
157
|
|
|
129
158
|
# ---------------------------------------------------------------- the standing role
|
|
@@ -131,12 +160,10 @@ fi
|
|
|
131
160
|
# readers of the same function cannot answer differently. The scan's output is never parsed.
|
|
132
161
|
role=""
|
|
133
162
|
rol_ruta=""
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if
|
|
138
|
-
if ! rol_ruta=$(os_buscar_oficio "$brain" "$role"); then rol_ruta=""; fi
|
|
139
|
-
fi
|
|
163
|
+
fm_read "$brain/$wsdir/$org/$head"
|
|
164
|
+
role="$fm_role"
|
|
165
|
+
if [ -n "$role" ]; then
|
|
166
|
+
if ! rol_ruta=$(os_buscar_oficio "$brain" "$role"); then rol_ruta=""; fi
|
|
140
167
|
fi
|
|
141
168
|
|
|
142
169
|
# ---------------------------------------------------------------- output
|
|
@@ -169,50 +196,83 @@ emitir() {
|
|
|
169
196
|
return 0
|
|
170
197
|
}
|
|
171
198
|
|
|
172
|
-
emitir "
|
|
173
|
-
emitir "
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
199
|
+
emitir "$OS_OPERATOR_FILE"
|
|
200
|
+
emitir "$wsdir/$org/$head"
|
|
201
|
+
emitir "$wsdir/$org/.resolver.md"
|
|
202
|
+
|
|
203
|
+
# emitir_si_existe RUTA — an optional entry (spec 072): printed when the file is there, silent when not.
|
|
204
|
+
emitir_si_existe() {
|
|
205
|
+
[ -f "$brain/$1" ] || return 0
|
|
206
|
+
emitir "$1"
|
|
207
|
+
}
|
|
178
208
|
|
|
179
|
-
#
|
|
209
|
+
# declarar RUTA GLOB — the one write of this read (spec 072, C4): a brain whose `tree.md` predates
|
|
210
|
+
# the spec has the file and no line that reaches it. Only when the file exists and no line of any
|
|
211
|
+
# class reaches it, the `content:` line is appended with `os_tree_ensure`, and the marker is printed
|
|
212
|
+
# only after the line is read back: a write that did not happen never reports success. It never
|
|
213
|
+
# creates the file.
|
|
214
|
+
declarar() {
|
|
215
|
+
local ruta="$1" glob="$2" clase
|
|
216
|
+
[ -f "$brain/$ruta" ] || return 0
|
|
217
|
+
for clase in glob content archive; do
|
|
218
|
+
os_tree_class_matches "$brain" "$clase" "$ruta" && return 0
|
|
219
|
+
done
|
|
220
|
+
os_tree_ensure "$brain" "$glob" content > /dev/null 2>&1
|
|
221
|
+
if ! os_tree_class_matches "$brain" content "$ruta"; then
|
|
222
|
+
separar
|
|
223
|
+
printf 'tree-declare-failed: content: %s — ' "$glob"
|
|
224
|
+
printf "$S_SESSION_READ_TREE_DECLARE_FAILED\n" "$ruta"
|
|
225
|
+
return 0
|
|
226
|
+
fi
|
|
227
|
+
separar
|
|
228
|
+
printf 'tree-declared: content: %s\n' "$glob"
|
|
229
|
+
return 0
|
|
230
|
+
}
|
|
231
|
+
emitir_si_existe "$wsdir/$org/context/glossary.md"
|
|
232
|
+
declarar "$wsdir/$org/context/glossary.md" "$wsdir/*/context/*.md"
|
|
233
|
+
emitir_si_existe "$wsdir/$org/context/context-map.md"
|
|
234
|
+
declarar "$wsdir/$org/context/context-map.md" "$wsdir/*/context/*.md"
|
|
235
|
+
|
|
236
|
+
# claves — step 6: the key decisions of the scope that name no node, under a fixed marker.
|
|
180
237
|
claves() {
|
|
181
238
|
local lineas
|
|
182
|
-
lineas=$(
|
|
239
|
+
lineas=$(os_key_decisions "$brain" "$wsdir/$org")
|
|
183
240
|
[ -n "$lineas" ] || return 0
|
|
184
241
|
separar
|
|
185
|
-
printf 'key-decisions: %s
|
|
242
|
+
printf 'key-decisions: %s/decisions/\n' "$wsdir/$org"
|
|
186
243
|
printf '%s\n' "$lineas"
|
|
187
244
|
return 0
|
|
188
245
|
}
|
|
189
|
-
|
|
246
|
+
claves
|
|
247
|
+
|
|
248
|
+
# The indexes of the scope (spec 076, C18): generated on every read, never by the scan. Only the
|
|
249
|
+
# `gitignore-declared:` lines reach the output, together, as one entry.
|
|
250
|
+
indexado=$("$here/build-indexes.sh" --brain "$brain" --workspace "$org" 2>/dev/null | grep -E '^gitignore-declare(d|-failed): ')
|
|
251
|
+
if [ -n "$indexado" ]; then
|
|
252
|
+
separar
|
|
253
|
+
printf '%s\n' "$indexado"
|
|
254
|
+
fi
|
|
190
255
|
|
|
191
256
|
emitir ".os/core/resolver.md"
|
|
192
257
|
|
|
193
258
|
# The pack indexes are discovered, never declared: zero of them is a legitimate installation, so
|
|
194
259
|
# there is nothing to report as missing.
|
|
195
260
|
#
|
|
196
|
-
#
|
|
197
|
-
# `.claude/skills/<pack>-resolver` as a SYMLINK to the folder
|
|
198
|
-
# `find` does not walk into a linked directory without `-L`, so on
|
|
199
|
-
#
|
|
200
|
-
|
|
201
|
-
if [ -
|
|
202
|
-
indices=""
|
|
203
|
-
for f in "$brain"/.claude/skills/*-resolver/SKILL.md; do
|
|
204
|
-
[ -f "$f" ] || continue
|
|
205
|
-
indices="$indices${f#$brain/}$nl"
|
|
206
|
-
done
|
|
261
|
+
# `os_skill_resolver_indexes` (common.sh) walks both skills folders with the glob of the shell, and
|
|
262
|
+
# never `find`: `npx skills add` leaves `.claude/skills/<pack>-resolver` as a SYMLINK to the folder
|
|
263
|
+
# where the CLI keeps the pack, and `find` does not walk into a linked directory without `-L`, so on
|
|
264
|
+
# a real brain the index simply did not print. A pack present in both folders prints once.
|
|
265
|
+
indices=$(os_skill_resolver_indexes "$brain")
|
|
266
|
+
if [ -n "$indices" ]; then
|
|
207
267
|
while IFS= read -r f || [ -n "$f" ]; do
|
|
208
268
|
[ -n "$f" ] || continue
|
|
209
269
|
emitir "$f"
|
|
210
270
|
done <<INDICES
|
|
211
|
-
$(printf '%s' "$indices" | LC_ALL=C sort)
|
|
271
|
+
$(printf '%s\n' "$indices" | LC_ALL=C sort)
|
|
212
272
|
INDICES
|
|
213
273
|
fi
|
|
214
274
|
|
|
215
|
-
emitir "
|
|
275
|
+
emitir "$OS_ROOT_RESOLVER_FILE"
|
|
216
276
|
|
|
217
277
|
if [ -n "$rol_ruta" ]; then
|
|
218
278
|
printf '\n'
|