You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/content/docs/handbook/beginners.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ This checks for structural issues: missing fields, duplicate IDs, non-kebab-case
130
130
131
131
**Forgetting keywords on domain entries.** Domain entries with no keywords can never be matched by the matcher. The `validate` command catches this as an error (`EMPTY_KEYWORDS`).
132
132
133
-
**Using regex in patterns.** The `patterns` field contains named intents like `"ci_pipeline"` -- they are matched as plain string lookups against the underscore-split words, not as regular expressions. A pattern of `"ci_pipeline"` matches a task containing the word "ci" or "pipeline."
133
+
**Using regex in patterns.** The `patterns` field contains named intents like `"ci_pipeline"` -- they are not regular expressions. The matcher splits each pattern on `_` and checks if **any** of those words appear in the task. A pattern of `"ci_pipeline"` matches a task containing the word "ci" or "pipeline." A matching pattern adds a +0.2 bonus to the entry's score.
134
134
135
135
**Huge payloads behind a single entry.** If one payload is 5,000 tokens and others are 200, the budget becomes misleading. Break large payloads into focused sub-topics with separate entries.
Copy file name to clipboardExpand all lines: site/src/content/docs/handbook/concepts.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,11 @@ sidebar:
9
9
10
10
A `LoadoutIndex` is the central data structure. It contains:
11
11
12
+
-**version** — the schema version (currently `"1.0.0"`)
13
+
-**generated** — ISO 8601 timestamp of when the index was generated
12
14
-**entries** — an array of `LoadoutEntry` objects, each describing one knowledge payload
13
15
-**budget** — token estimates for context planning
16
+
-**lazyLoad** (optional) — when `true`, signals that payloads should not be pre-loaded by consumers
14
17
15
18
The index is designed to be always-loaded alongside a lean instruction file. Payloads are loaded on demand when the matcher finds a hit.
16
19
@@ -42,12 +45,15 @@ The default is `{ task: true, plan: true, edit: false }`. These are advisory —
42
45
43
46
## Keyword Matching
44
47
45
-
The matcher tokenizes the task description into lowercase words, then compares against each entry's `keywords` array:
48
+
The matcher tokenizes the task description into lowercase words (stripping non-alphanumeric characters and filtering single-character tokens), then compares against each entry's `keywords` array:
Discover canonical layer locations and load any that exist. Lower-level than `resolveLoadout`.
77
+
Discover canonical layer locations and load any that exist. Lower-level than `resolveLoadout`. Missing layers are normal -- most setups only have project-level. Malformed files are treated the same as missing.
Append-only JSONL usage log. `recordUsage` appends, `readUsage` loads, `summarizeUsage` groups by entry.
147
+
Append-only JSONL usage log. `recordUsage` appends a single event, `readUsage` loads all events (silently skipping malformed lines), `summarizeUsage` groups events by entry ID sorted by load count descending.
148
+
149
+
**`summarizeUsage` returns:**`UsageSummary[]`
150
+
151
+
```typescript
152
+
interfaceUsageSummary {
153
+
entryId:string;
154
+
loadCount:number;
155
+
totalTokens:number;
156
+
lastLoaded:string; // ISO 8601
157
+
triggers:string[]; // unique triggers that caused loads
158
+
modes:Set<string>; // unique load modes used
159
+
}
160
+
```
146
161
147
162
### findDeadEntries(index, events)
148
163
149
-
Find entries that have never been loaded. Returns entries sorted by token cost (biggest waste first).
164
+
Find entries that have never been loaded. Core entries are excluded since they always load. Returns entries sorted by token cost descending (biggest waste first).
165
+
166
+
**Returns:**`DeadEntry[]`
167
+
168
+
```typescript
169
+
interfaceDeadEntry {
170
+
entry:LoadoutEntry;
171
+
reason:string;
172
+
}
173
+
```
150
174
151
175
### findKeywordOverlaps(index)
152
176
153
-
Find keywords shared between entries — routing ambiguities.
177
+
Find keywords shared between entries — routing ambiguities. Results sorted by overlap count descending.
178
+
179
+
**Returns:**`KeywordOverlap[]`
180
+
181
+
```typescript
182
+
interfaceKeywordOverlap {
183
+
keyword:string;
184
+
entries:string[]; // entry IDs sharing this keyword
185
+
}
186
+
```
154
187
155
188
### analyzeBudget(index, usage?)
156
189
157
190
Token budget breakdown by priority tier, with observed-vs-estimated comparison when usage data is available.
0 commit comments