@soleur/opencode 3.355.1 → 3.356.1
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.
|
@@ -90,15 +90,23 @@ Grep: pattern="component:.*background_job" path=knowledge-base/project/learnings
|
|
|
90
90
|
Grep: pattern="email" path=knowledge-base/project/learnings/ output_mode=files_with_matches -i=true
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
### Step 3b: Always Check
|
|
93
|
+
### Step 3b: Always Check Required-Reading Patterns
|
|
94
94
|
|
|
95
|
-
**Regardless of Grep results**,
|
|
95
|
+
**Regardless of Grep results**, check the pattern pages:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
|
|
98
|
+
Glob: knowledge-base/project/patterns/*.md
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
If `knowledge-base/project/patterns/` does not exist or the glob matches nothing, say so explicitly in the output ("no patterns directory in this repo") and continue; this is a normal state, not an error. Otherwise read the frontmatter of each page (limit:30) to select those with `status: open` and `required_reading: true`, then read the FULL body of each selected page and scan it for relevance to the current feature/task. If the directory exists but no page has `required_reading: true`, say so ("no required-reading pages") and report nothing from this step. If a page fails to parse (malformed frontmatter), skip it and mention it by file name in the output; do not abort.
|
|
102
|
+
|
|
103
|
+
**Fallback directory (repos with no `knowledge-base/project/patterns/`):** also check
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
Glob: knowledge-base/project/learnings/patterns/*.md
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This is where `compound-capture` appends required-reading entries when a repo has no patterns directory (`knowledge-base/project/learnings/patterns/required-reading.md`). Read any file found as before and merge its relevant entries into the same output section. Older installs may also carry a legacy required-reading file in that directory; it is read the same way.
|
|
102
110
|
|
|
103
111
|
### Step 4: Read Frontmatter of Candidates Only
|
|
104
112
|
|
|
@@ -219,8 +227,8 @@ Structure your findings as:
|
|
|
219
227
|
- **Files Scanned**: [X total files]
|
|
220
228
|
- **Relevant Matches**: [Y files]
|
|
221
229
|
|
|
222
|
-
###
|
|
223
|
-
[
|
|
230
|
+
### Required-Reading Patterns (Always Check)
|
|
231
|
+
[Matching open pattern pages with `required_reading: true`, plus any legacy required-reading entries; state if no patterns directory exists]
|
|
224
232
|
|
|
225
233
|
### Relevant Learnings
|
|
226
234
|
|
|
@@ -254,7 +262,7 @@ Structure your findings as:
|
|
|
254
262
|
- Use category directories to narrow scope when feature type is clear
|
|
255
263
|
- Do a broader content Grep as fallback if <3 candidates found
|
|
256
264
|
- Re-narrow with more specific patterns if >25 candidates found
|
|
257
|
-
- Always
|
|
265
|
+
- Always check the required-reading pattern pages (Step 3b)
|
|
258
266
|
- Only read frontmatter of Grep-matched candidates (not all files)
|
|
259
267
|
- Filter aggressively - only fully read truly relevant files
|
|
260
268
|
- Prioritize high-severity and critical patterns
|
|
@@ -272,7 +280,7 @@ Structure your findings as:
|
|
|
272
280
|
- Read every file in full (wasteful)
|
|
273
281
|
- Return raw document contents (distill instead)
|
|
274
282
|
- Include tangentially related learnings (focus on relevance)
|
|
275
|
-
- Skip the
|
|
283
|
+
- Skip the required-reading pattern pages (always check them)
|
|
276
284
|
|
|
277
285
|
## Integration Points
|
|
278
286
|
|
package/package.json
CHANGED
|
@@ -238,7 +238,7 @@ Replace `<category>` with the mapped category and `<filename>` with the generate
|
|
|
238
238
|
</step>
|
|
239
239
|
|
|
240
240
|
<step number="7" required="false" depends_on="6">
|
|
241
|
-
### Step 7: Cross-Reference &
|
|
241
|
+
### Step 7: Cross-Reference & Required-Reading Detection
|
|
242
242
|
|
|
243
243
|
If similar issues found in Step 3:
|
|
244
244
|
|
|
@@ -251,26 +251,9 @@ Already includes cross-reference from Step 6.
|
|
|
251
251
|
|
|
252
252
|
**Update patterns if applicable:**
|
|
253
253
|
|
|
254
|
-
If this
|
|
254
|
+
If this repo keeps `knowledge-base/project/patterns/`: extend an existing page, or note it for a new page once 5 or more learnings share the class (a page needs 5+ evidence entries, so one learning cannot create one). Structure pages with [pattern-page-template.md](./assets/pattern-page-template.md). A pattern page is added or extended by a reviewed PR, never written directly. Otherwise emit one line: `skipped: no patterns directory`.
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
# Add to knowledge-base/project/learnings/patterns/common-solutions.md
|
|
258
|
-
cat >> knowledge-base/project/learnings/patterns/common-solutions.md << 'EOF'
|
|
259
|
-
|
|
260
|
-
## [Pattern Name]
|
|
261
|
-
|
|
262
|
-
**Common symptom:** [Description]
|
|
263
|
-
**Root cause:** [Technical explanation]
|
|
264
|
-
**Solution pattern:** [General approach]
|
|
265
|
-
|
|
266
|
-
**Examples:**
|
|
267
|
-
- [Link to doc 1]
|
|
268
|
-
- [Link to doc 2]
|
|
269
|
-
- [Link to doc 3]
|
|
270
|
-
EOF
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
**Critical Pattern Detection (Optional Proactive Suggestion):**
|
|
256
|
+
**Required-Reading Detection (Optional Proactive Suggestion):**
|
|
274
257
|
|
|
275
258
|
If this issue has automatic indicators suggesting it might be critical:
|
|
276
259
|
|
|
@@ -286,9 +269,9 @@ Then in the decision menu, add a note:
|
|
|
286
269
|
|
|
287
270
|
But **NEVER auto-promote**. User decides via decision menu (Option 2).
|
|
288
271
|
|
|
289
|
-
**
|
|
272
|
+
**Required-reading entries:**
|
|
290
273
|
|
|
291
|
-
When user selects Option
|
|
274
|
+
When user selects Option 2, propose a pattern page with `required_reading: true`. In a repo without a patterns directory, append the entry to `knowledge-base/project/learnings/patterns/required-reading.md`.
|
|
292
275
|
</step>
|
|
293
276
|
|
|
294
277
|
<step number="8" required="false" depends_on="6">
|
|
@@ -538,7 +521,7 @@ File created:
|
|
|
538
521
|
|
|
539
522
|
What's next?
|
|
540
523
|
1. Continue workflow (recommended)
|
|
541
|
-
2. Add to Required Reading -
|
|
524
|
+
2. Add to Required Reading - Propose a pattern page (`required_reading: true`)
|
|
542
525
|
3. Link related issues - Connect to similar problems
|
|
543
526
|
4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)
|
|
544
527
|
5. Create new skill - Extract into new learning skill
|
|
@@ -566,10 +549,10 @@ User selects this when:
|
|
|
566
549
|
Action:
|
|
567
550
|
|
|
568
551
|
1. Extract pattern from the documentation
|
|
569
|
-
2.
|
|
570
|
-
3.
|
|
552
|
+
2. Fill the template sections (root cause, fix with a short wrong-versus-correct example, evidence)
|
|
553
|
+
3. Write the pattern page with `required_reading: true` (or, without a patterns directory, append the entry to `knowledge-base/project/learnings/patterns/required-reading.md`)
|
|
571
554
|
4. Add cross-reference back to this doc
|
|
572
|
-
5.
|
|
555
|
+
5. Only after step 3 wrote the entry or page: confirm "✓ Required-reading entry proposed."
|
|
573
556
|
|
|
574
557
|
**Option 3: Link related issues**
|
|
575
558
|
|
|
@@ -769,7 +752,7 @@ File created:
|
|
|
769
752
|
|
|
770
753
|
What's next?
|
|
771
754
|
1. Continue workflow (recommended)
|
|
772
|
-
2. Add to Required Reading -
|
|
755
|
+
2. Add to Required Reading - Propose a pattern page (`required_reading: true`)
|
|
773
756
|
3. Link related issues - Connect to similar problems
|
|
774
757
|
4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)
|
|
775
758
|
5. Create new skill - Extract into new learning skill
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Pattern Page Template
|
|
2
|
+
|
|
3
|
+
Copy to `knowledge-base/project/patterns/<slug>.md`. The filename equals `<slug>`. Delete these instructions and the inline comments from the copy.
|
|
4
|
+
|
|
5
|
+
## Open page
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
---
|
|
9
|
+
title: "<short pattern name>"
|
|
10
|
+
summary: "<one line: problem + root cause + fix>"
|
|
11
|
+
status: open # open | closed
|
|
12
|
+
opened_on: "2026-01-31" # quote the date
|
|
13
|
+
tags: [tag-one, tag-two]
|
|
14
|
+
evidence: # tracked, non-archived learnings; >= 5 for EVERY page
|
|
15
|
+
- knowledge-base/project/learnings/<file>.md
|
|
16
|
+
required_reading: false # true = agents read this page before code generation
|
|
17
|
+
---
|
|
18
|
+
## Root cause
|
|
19
|
+
|
|
20
|
+
<Technical explanation of why the failure recurs.>
|
|
21
|
+
|
|
22
|
+
## Fix
|
|
23
|
+
|
|
24
|
+
<The general approach, with a short wrong-versus-correct example where useful.>
|
|
25
|
+
|
|
26
|
+
## Evidence
|
|
27
|
+
|
|
28
|
+
<One line per evidence learning: what it showed.>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
An open page must NOT carry `closed_on` or `closed_by`.
|
|
32
|
+
|
|
33
|
+
## To close a page (human PR)
|
|
34
|
+
|
|
35
|
+
Open the PR first, then set `closed_by` to its number in a follow-up commit. Both keys are required on a closed page and only there; the reason lives in the body.
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
status: closed
|
|
39
|
+
closed_on: "2026-03-01"
|
|
40
|
+
closed_by: 12345 # positive integer: the PR number that fixed or retired the pattern
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Validator limits
|
|
44
|
+
|
|
45
|
+
The loader (`apps/web-platform/server/compound-promote-patterns.ts`) and the live-tree test drop or reject a page that breaks any of these:
|
|
46
|
+
|
|
47
|
+
- At least 5 and at most 40 evidence entries on EVERY page. A page left with fewer than 5 surviving keys is dropped.
|
|
48
|
+
- Evidence paths are unique, canonical (no `.`, empty or `..` segments), tracked and not archived.
|
|
49
|
+
- `title`: at most 120 printable ASCII characters. `summary`: at most 200 printable ASCII characters.
|
|
50
|
+
- `tags`: 1 to 12, each matching `^[a-z0-9][a-z0-9-]{0,40}$`.
|
|
51
|
+
- `slug` (the file name): `^[a-z0-9][a-z0-9-]{0,80}$`.
|
|
52
|
+
- Allowed frontmatter keys only: `title`, `summary`, `status`, `opened_on`, `tags`, `evidence`, `required_reading`, `closed_on`, `closed_by`.
|
|
53
|
+
- At most 16 KiB per page (a larger page is dropped with its own cause, `size`). The tree holds at most 8 pages (CI).
|
|
54
|
+
|
|
55
|
+
Body sections are not schema-validated and are never sent to the model, but they count toward the 16 KiB cap and are PII-scanned with the rest of the page: an email-, IP- or token-shaped string in a body drops the whole page. Only the slug, title, summary, tags, evidence keys and the first 10 lines of each evidence learning are sent.
|
|
56
|
+
|
|
57
|
+
## Authoring rules
|
|
58
|
+
|
|
59
|
+
1. Write no names, handles, tester, tenant, or session-derived detail in any field or body section. Nothing machine-screens person names or handles written without an `@`: this rule is the only control.
|
|
60
|
+
2. Cite only learnings that exist, are tracked, and are not archived. The PR that archives a learning must update or delete any page (including a closed one) that cites it.
|
|
61
|
+
3. Only a human PR edit closes a page. The weekly cron never writes a pattern page.
|
|
62
|
+
4. Add or extend a page through a reviewed PR; never auto-promote from a capture session.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Critical Pattern Template
|
|
2
|
-
|
|
3
|
-
Use this template when adding a pattern to `knowledge-base/project/learnings/patterns/critical-patterns.md`:
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## N. [Pattern Name] (ALWAYS REQUIRED)
|
|
8
|
-
|
|
9
|
-
### ❌ WRONG ([Will cause X error])
|
|
10
|
-
|
|
11
|
-
```[language]
|
|
12
|
-
[code showing wrong approach]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### ✅ CORRECT
|
|
16
|
-
|
|
17
|
-
```[language]
|
|
18
|
-
[code showing correct approach]
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Why:** [Technical explanation of why this is required]
|
|
22
|
-
|
|
23
|
-
**Placement/Context:** [When this applies]
|
|
24
|
-
|
|
25
|
-
**Documented in:** `knowledge-base/project/learnings/[category]/[filename].md`
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
**Instructions:**
|
|
30
|
-
|
|
31
|
-
1. Replace N with the next pattern number
|
|
32
|
-
2. Replace [Pattern Name] with descriptive title
|
|
33
|
-
3. Fill in WRONG example with code that causes the problem
|
|
34
|
-
4. Fill in CORRECT example with the solution
|
|
35
|
-
5. Explain the technical reason in "Why"
|
|
36
|
-
6. Clarify when this pattern applies in "Placement/Context"
|
|
37
|
-
7. Link to the full troubleshooting doc where this was originally solved
|