learning-agent 0.2.0 → 0.2.2
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/CHANGELOG.md +81 -2
- package/README.md +17 -5
- package/dist/cli.js +1250 -750
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +40 -2
- package/dist/index.js +85 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.2] - 2026-02-01
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Age-based Temporal Validity** (LANDSCAPE.md: eik)
|
|
15
|
+
- `CompactionLevelSchema` for lesson lifecycle (0=active, 1=flagged, 2=archived)
|
|
16
|
+
- Age distribution display in `stats` command (<30d, 30-90d, >90d)
|
|
17
|
+
- Age warnings in `load-session` for lessons older than 90 days
|
|
18
|
+
- New schema fields: `compactionLevel`, `compactedAt`, `lastRetrieved`
|
|
19
|
+
|
|
20
|
+
- **Manual Invalidation** (LANDSCAPE.md: mov)
|
|
21
|
+
- `learning-agent wrong <id>` - Mark a lesson as invalid/wrong
|
|
22
|
+
- `learning-agent validate <id>` - Re-enable a previously invalidated lesson
|
|
23
|
+
- `list --invalidated` flag to show only invalidated lessons
|
|
24
|
+
- New schema fields: `invalidatedAt`, `invalidationReason`
|
|
25
|
+
|
|
26
|
+
- **Optional Citation Field** (LANDSCAPE.md: tn3)
|
|
27
|
+
- `CitationSchema` for lesson provenance tracking
|
|
28
|
+
- Store file path, line number, and git commit with lessons
|
|
29
|
+
- `learn --citation <file:line>` and `--citation-commit <hash>` flags
|
|
30
|
+
|
|
31
|
+
- **Count Warning** (LANDSCAPE.md: qp9)
|
|
32
|
+
- Warning in `stats` when lesson count exceeds 20 (context pollution prevention)
|
|
33
|
+
- Note in `load-session` when total lessons may degrade retrieval quality
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Lesson schema now includes optional fields for citation, age-tracking, and invalidation
|
|
38
|
+
- `list` command shows `[INVALID]` marker for invalidated lessons
|
|
39
|
+
- `load-session` JSON output includes `totalCount` field
|
|
40
|
+
- CLI refactored into command modules (`src/commands/`) for maintainability
|
|
41
|
+
- Age calculation logic centralized in `src/utils.ts`
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **SQLite schema now stores v0.2.2 fields** (x9y)
|
|
46
|
+
- Added columns: `invalidated_at`, `invalidation_reason`, `citation_*`, `compaction_level`, `compacted_at`
|
|
47
|
+
- `rebuildIndex` preserves all v0.2.2 fields during cache rebuild
|
|
48
|
+
- `rowToLesson` correctly maps all fields back to Lesson objects
|
|
49
|
+
|
|
50
|
+
- **Retrieval paths filter out invalidated lessons** (z8k)
|
|
51
|
+
- `searchKeyword` excludes lessons with `invalidated_at` set
|
|
52
|
+
- `searchVector` skips invalidated lessons during scoring
|
|
53
|
+
- `loadSessionLessons` filters out invalidated high-severity lessons
|
|
54
|
+
|
|
55
|
+
## [0.2.1] - 2026-02-01
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- **CLI Commands**
|
|
60
|
+
- `lna` short alias for `learning-agent` CLI
|
|
61
|
+
- `show <id>` - Display lesson details
|
|
62
|
+
- `update <id>` - Modify lesson fields (insight, severity, tags, confirmed)
|
|
63
|
+
- `delete <id>` - Create tombstone for lesson removal
|
|
64
|
+
- `download-model` - Download embedding model (~278MB)
|
|
65
|
+
- `--severity` flag for `learn` command to set lesson severity
|
|
66
|
+
|
|
67
|
+
- **Documentation**
|
|
68
|
+
- Complete lesson schema documentation in README
|
|
69
|
+
- Required vs optional fields explained
|
|
70
|
+
- Session-start loading requirements (type=full + severity=high + confirmed=true)
|
|
71
|
+
- "Never Edit JSONL Directly" warning in AGENTS.md template
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
|
|
75
|
+
- `setup claude` now defaults to project-local (was global)
|
|
76
|
+
- `setup claude --global` required for global installation
|
|
77
|
+
- `init` now includes `setup claude` step by default
|
|
78
|
+
- Auto-sync SQLite after every CLI mutation (learn, update, delete, import)
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- Pre-commit hook now inserted before exit statements (not appended after)
|
|
83
|
+
- JSONL edits properly sync to SQLite index
|
|
84
|
+
- High-severity lessons load correctly at session start
|
|
85
|
+
|
|
10
86
|
## [0.2.0] - 2026-01-31
|
|
11
87
|
|
|
12
88
|
### Added
|
|
@@ -110,5 +186,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
110
186
|
- Vitest test suite
|
|
111
187
|
- tsup build configuration
|
|
112
188
|
|
|
113
|
-
[Unreleased]: https://github.com/
|
|
114
|
-
[0.
|
|
189
|
+
[Unreleased]: https://github.com/Nathandela/learning_agent/compare/v0.2.2...HEAD
|
|
190
|
+
[0.2.2]: https://github.com/Nathandela/learning_agent/compare/v0.2.1...v0.2.2
|
|
191
|
+
[0.2.1]: https://github.com/Nathandela/learning_agent/compare/v0.2.0...v0.2.1
|
|
192
|
+
[0.2.0]: https://github.com/Nathandela/learning_agent/compare/v0.1.0...v0.2.0
|
|
193
|
+
[0.1.0]: https://github.com/Nathandela/learning_agent/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -93,18 +93,30 @@ pnpm download-model
|
|
|
93
93
|
# Capture a lesson manually
|
|
94
94
|
pnpm learn "Use Polars for large files, not pandas"
|
|
95
95
|
|
|
96
|
+
# Capture with citation (file:line provenance)
|
|
97
|
+
learning-agent learn "API requires auth header" --citation src/api.ts:42
|
|
98
|
+
|
|
96
99
|
# Search lessons
|
|
97
100
|
learning-agent search "data processing"
|
|
98
101
|
|
|
99
|
-
# Rebuild index from JSONL
|
|
100
|
-
learning-agent rebuild
|
|
101
|
-
|
|
102
102
|
# List all lessons
|
|
103
103
|
learning-agent list
|
|
104
104
|
|
|
105
|
-
#
|
|
105
|
+
# List only invalidated lessons
|
|
106
|
+
learning-agent list --invalidated
|
|
107
|
+
|
|
108
|
+
# Mark a lesson as wrong/invalid
|
|
109
|
+
learning-agent wrong L12345678 --reason "This advice was incorrect"
|
|
110
|
+
|
|
111
|
+
# Re-enable an invalidated lesson
|
|
112
|
+
learning-agent validate L12345678
|
|
113
|
+
|
|
114
|
+
# Show database stats (includes age distribution)
|
|
106
115
|
learning-agent stats
|
|
107
116
|
|
|
117
|
+
# Rebuild index from JSONL
|
|
118
|
+
learning-agent rebuild
|
|
119
|
+
|
|
108
120
|
# Compact and archive old lessons
|
|
109
121
|
learning-agent compact
|
|
110
122
|
```
|
|
@@ -237,7 +249,7 @@ pnpm lint
|
|
|
237
249
|
|
|
238
250
|
## Project Status
|
|
239
251
|
|
|
240
|
-
Version 0.2.
|
|
252
|
+
Version 0.2.2 - Hardening release with quality gates based on [LANDSCAPE.md](doc/LANDSCAPE.md) reviewer feedback. Adds age-based validity warnings, manual invalidation commands, optional citation tracking, and context pollution warnings. See [CHANGELOG.md](CHANGELOG.md) for details.
|
|
241
253
|
|
|
242
254
|
## Documentation
|
|
243
255
|
|