ci(release): use node 24 for trusted publishing#14
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
sampleXbro
pushed a commit
that referenced
this pull request
Jun 3, 2026
Introduces `src/lessons/store.ts` — a target-agnostic high-level layer that sits between the low-level primitives (parser, matcher, hash) and the operations every harness needs: - `loadLessonsIndex(projectRoot)` — parse + validate the canonical index from its canonical location. - `readTriggeredLessons(projectRoot, event)` — normalize tool-event paths, match against cluster triggers, return content with per-call file-read memoization. - `formatLessonBullet(input)` — validate + format a capture bullet in the canonical journal shape (rejects empty heading / sentence). - `appendLessonToJournal(projectRoot, input)` — atomic append with newline normalization, returns the resolved line number for Evidence citations. **Cross-tool unification.** The store normalizes every Edit/Write event path to canonical project-relative POSIX form BEFORE applying `file_globs`. Tools across harnesses give paths in different forms (absolute `/proj/src/foo.ts`, Windows `C:\proj\src\foo.ts`, backslash-relative `src\utils\foo.ts`, leading-dot `./src/foo.ts`) — all now resolve to the same `src/utils/foo.ts` and match the same glob. This is the single fix that makes triggers behave identically across Codex (`apply_patch`), Cline (`write_to_file` / `replace_in_file`), Cursor (IDE), Gemini CLI, Aider, Goose, and Claude Code. **Security boundary.** `resolveProjectFile` rejects `..`-escape AND Windows-absolute paths (`/^[A-Za-z]:[\\/]/`) regardless of host OS, protecting against malicious or malformed `index.yaml` files reading outside the project root. **Import-side safety net.** `src/cli/commands/import.ts` gains `ensureImportedLessonsSubsystem`: when an imported `_root.md` contains the lessons paragraph but `.agentsmesh/lessons/index.yaml` doesn't exist, auto-scaffolds the subsystem so the rule isn't orphaned. Idempotent. **Contract matrix lock.** `tests/contract/target-contract.matrix.test.ts` adds a per-target test: every supported target's generated root file MUST project the lessons ritual. The e2e matrix gets the same lock. A future regression in any target's projection pipeline will fail this gate. **Public API.** Helpers exported from both `agentsmesh/lessons` (focused subpath) and the root `agentsmesh` barrel. Programmatic API test asserts root-barrel exposure. **Distill test isolation.** Rewrites `distill-tool.integration.test.ts` to seed an isolated tmpdir with explicit fixtures and invoke the script via absolute `tsx` path with `cwd=tmpdir`. No longer mutates the real project journal. Adds 13 journal entries + 2 topic Rules captured during the work, including the path-normalization rule (windows-paths #19) and the `-e`/`--` rg-flag-leading rule (shell-quoting #14).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Type of change
Checklist
pnpm test,pnpm lint,pnpm typecheck)pnpm changeset) for user-visible changes