Develop#19
Merged
Merged
Conversation
- Add plugin-error-paths test coverage for CLI plugin command - Add builtin-targets unit tests for catalog resolution - Add registry unit tests for target descriptor registration
…PI parity - Add loadProjectContext() for CLI-parity execution context loading - Fix loadCanonical() to merge extends and packs when config available - Fix importFrom() to resolve registered plugin descriptors - Fix plugin buildImportPaths() hooks for shared import normalization - Make getTargetCatalog() return immutable snapshots - Reject non-none capabilities without generators in descriptor registration - Update all public barrel exports with new types - Update tests for new API surface and stricter assertions - Update CHANGELOG with complete API changes
- Add Windows path safety utilities (windows-path-safety.ts) - Add portable path handling for cross-platform compatibility - Update install manifest and pack operations for Windows paths - Update all target skills with prepare-release improvements - Add Windows support metadata and CI workflow updates - Add comprehensive Windows path safety tests - Update documentation for Windows installation
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Between mkdir(lockPath) and writeFile(holder.json), a competing acquirer saw a metadata-less lock dir, treated it as orphaned, and rm -rf'd the live mutex. Both processes then entered the critical section concurrently and raced writeFileAtomic on .agentsmesh/.lock, producing the intermittent CI failure: ENOENT renaming .lock.tmp. Lock dirs younger than a 2s grace window are now treated as held even when holder.json is missing; only older dirs without metadata are considered orphaned and evicted. The grace check accepts negative ageMs to absorb FS-vs-clock skew under suite load. Covered by a new unit test in tests/unit/utils/process-lock.test.ts plus the existing parallel-CLI integration test.
Eight rule generators built the output slug via
rule.source.split('/').pop()!.replace(/\.md$/, ''), which on Windows
where rule.source uses \ separators silently returned the entire
absolute path. Generation then emitted paths like
'.cursor\rules\C:\Users\...\rules' and writeFileAtomic ENOENT'd on
mkdir. All 10 occurrences across claude-code, codex-cli, copilot,
cursor, continue, and catalog now use basename(rule.source, '.md')
from node:path, which honors native separators.
Three importer tests asserted on POSIX-style fromPath substrings
(.codex/agents/..., .gemini/antigravity/workflows, etc.) which fail
on Windows where fromPath legitimately uses \. Added
tests/helpers/posix-path.ts toPosixPath() and applied it to the
codex/junie/antigravity assertions.
src/cli/commands/watch.ts now sets usePolling: process.platform ===
'win32' on chokidar.watch — ReadDirectoryChangesW under the GitHub
Actions AppData\Local\Temp short-name path misses events for files
newly created in just-watched subdirectories. macOS/Linux keep the
native watcher.
Production fixes:
- buildArtifactPathMap, addPackSkillArtifactMappings,
applyCopilotInstructionArtifactRefs, collectPlannedPaths, and the
generated-markdown-link validator all used native node:path.join /
normalize. The link rebaser uses pathApi(projectRoot) which is path-
format-aware, not host-platform-aware. The mismatch silently no-op'd
the rewriter when synthetic POSIX project roots were combined with a
Windows host (or vice versa). All five sites now route through
pathApi(projectRoot) so map keys and lookups always agree.
- tests/fixtures/plugins/rich-plugin/index.js: rule.source.split('/')
swapped for path.basename — same Windows pattern as the builtin
generators.
Test-side fixes (no behavior change):
- matrix-codegen + matrix-drift-guard execFileSync('tsx', ...) needs
shell:true on Windows to invoke tsx.cmd.
- github-remote.test.ts mock buildCacheKey replaces ':' with '_' so the
resulting cache dir name is Windows-safe.
- agents.e2e.test.ts bodyWithoutFrontmatter regex normalizes CRLF first
so Windows checkouts (autocrlf) parse correctly.
- windows-support-metadata.test.ts CRLF normalization on read.
- skills.test.ts hardcodes the POSIX relativePath the parser intentionally
emits.
- install-sync, run-install-pack, run-install, generate, extends-native,
git-remote, native-skill-scan tests use platform-agnostic regex / join
for path assertions.
Skipped on Windows (CI environment limits, behavior unaffected):
- install-remote.e2e and extends.e2e refresh-cache: stub git via
chmod-755 Node script and NODE_OPTIONS=--import; neither works on
Windows.
- generate-global-path-rebasing symlink test: requires admin/dev mode.
- remote-fetcher-git native-format / cached: cache key embeds full
repo URL, blowing past MAX_PATH on Windows. Hashed cache keys
would unblock; tracked for follow-up.
…rewrite matrix - Update artifact-path-map-packs unit tests - Update generate-reference-rewrite-matrix e2e tests - Update matrix drift guard integration tests - Update lessons and agents-last-run tracking
- Update link-rebaser-helpers.ts with improvements - Update generate-reference-rewrite-matrix e2e tests - Update import-reference-rewrite e2e tests - Update lessons and agents-last-run tracking
- Add unit tests for core/reference/ module - Add portable-paths tests for install module - Update feature-loop.ts with improvements - Update programmatic-api integration tests - Update agents-last-run tracking
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