AGENTS.md@packages/profile ยท diff
git:20261009.95ca1ef to git:20261012.83db886
9 added, 13 removed. Audit A to A.
# @shadowclone/profile
- Holds the learned rule model, the legacy profile, scoped references, and the Claude memory migration. Environment and learning read and write rules through it.
+ Holds the learned rule model: rule types, evidence helpers, rejection records, and the Claude memory scanner. Environment and learning use it. The skills environment in `environment` stores the rules.
<!-- package-facts:start -->
(generated by `bun run guides`; do not edit by hand)
- Package name: `@shadowclone/profile`
- - Workspace dependencies: `@shadowclone/changes`, `@shadowclone/core`, `@shadowclone/redact`, `@shadowclone/sessions`, `@shadowclone/skills`
+ - Workspace dependencies: `@shadowclone/core`, `@shadowclone/sessions`
- External dependencies: `zod`
- - Export subpaths: `.`, `./testing`
+ - Export subpaths: `.`
<!-- package-facts:end -->
## Owns
- - `src/profile/`: rule parsing and rendering, evidence, `compileProfile`, `writeLegacyProfile`, and repair plans.
- - `src/references/`: scoped reference records, with `readScopedReferences`, `searchReferences`, and `recallReferences`.
- - `src/migrate/claudeMemory/`: `scanClaudeMemory`, `createClaudeMemoryMigrationPlan`, and `migrateClaudeMemory`.
+ - `src/profile/`: the rule types, evidence identifiers and statistics, rule keys and paths, rejection parsing and rendering, `renderMirror`, and `renderAgent`.
+ - `src/claudeMemory/`: `scanClaudeMemory` and `claudeMemoryDirectory`.
## Rules
- - A rule that the model infers needs three independent sessions (`independentSessionThreshold`). Explicit evidence can activate after one.
- - References read through `resolveRedacted`, so recall returns redacted text.
- - The profile compiler has a byte budget (`defaultProfileByteBudget`, `defaultIndexByteBudget`). It lists omitted rules.
- - `writeLegacyProfile` takes a lock and writes through `commitLocalChanges`, so `undo` can reverse it.
- - A reference file is at most 64 KiB. A memory scan reads at most 256 files and 2 MiB.
- - This package keeps the legacy profile only. Active skill delivery lives in `environment`.
+ - This package stores nothing. `storeLearningRules` and `learningSnapshot` in `environment` own the store.
+ - A memory scan reads through `resolveRedacted`. It reads at most 256 files and 2 MiB.
+ - Rejection records use one JSON line for each rule.
## Tests
- Run `bun test` in this folder, or `bun test packages/profile` from the root. The `./testing` export gives `rule` and `fixture`. The tests use temporary profile folders.
+ Run `bun test` in this folder, or `bun test packages/profile` from the root. The tests use synthetic memory folders.
Update this file in the same commit when you change the package purpose, public exports, dependencies, or a rule above.