@open-mercato/search 0.6.3-develop.3810.1.ad92c339f5 → 0.6.3-develop.3811.1.be22750402
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/AGENTS.md +21 -4
- package/package.json +4 -4
package/AGENTS.md
CHANGED
|
@@ -2,16 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
When working on search functionality, use this guide. It covers indexing, querying, and configuring search across all entity types.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Always
|
|
6
6
|
|
|
7
7
|
1. **MUST** create a `search.ts` file for every module with searchable entities.
|
|
8
8
|
2. **MUST** define `fieldPolicy.excluded` for any sensitive fields (passwords, tokens, SSNs, bank accounts) -- never allow them into any index.
|
|
9
9
|
3. **MUST** define `formatResult` for every entity that uses the tokens strategy -- without it, users see raw UUIDs instead of names.
|
|
10
10
|
4. **MUST** include `checksumSource` in every `buildSource` return value so the indexer can detect changes and skip redundant re-embedding.
|
|
11
11
|
5. **MUST** use the `entityId` format `module:entity_name` and ensure it matches the entity registry exactly.
|
|
12
|
-
6. **MUST
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
6. **MUST** use `fieldPolicy.hashOnly` for PII fields (email, phone, tax_id) that need exact-match filtering but not fuzzy search.
|
|
13
|
+
|
|
14
|
+
## Ask First
|
|
15
|
+
|
|
16
|
+
- Ask before changing search strategy defaults, entity IDs, queue behavior, or vector provider assumptions.
|
|
17
|
+
- Ask before indexing a field whose sensitivity is unclear.
|
|
18
|
+
|
|
19
|
+
## Never
|
|
20
|
+
|
|
21
|
+
- Never call raw `fetch` against the search API; use `apiCall`/`apiCallOrThrow` from `@open-mercato/ui/backend/utils/apiCall`.
|
|
22
|
+
- Never include encrypted or sensitive fields in `buildSource` text output; they end up in plain text in vector stores.
|
|
23
|
+
- Never skip `fieldPolicy.hashOnly` for PII fields (email, phone, tax_id) that need exact-match filtering but not fuzzy search.
|
|
24
|
+
|
|
25
|
+
## Validation Commands
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn generate
|
|
29
|
+
yarn workspace @open-mercato/search test
|
|
30
|
+
yarn workspace @open-mercato/search build
|
|
31
|
+
```
|
|
15
32
|
|
|
16
33
|
## Search Strategies -- When to Use Each
|
|
17
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/search",
|
|
3
|
-
"version": "0.6.3-develop.
|
|
3
|
+
"version": "0.6.3-develop.3811.1.be22750402",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
"zod": "^4.4.3"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
|
-
"@open-mercato/core": "0.6.3-develop.
|
|
130
|
-
"@open-mercato/queue": "0.6.3-develop.
|
|
131
|
-
"@open-mercato/shared": "0.6.3-develop.
|
|
129
|
+
"@open-mercato/core": "0.6.3-develop.3811.1.be22750402",
|
|
130
|
+
"@open-mercato/queue": "0.6.3-develop.3811.1.be22750402",
|
|
131
|
+
"@open-mercato/shared": "0.6.3-develop.3811.1.be22750402"
|
|
132
132
|
},
|
|
133
133
|
"devDependencies": {
|
|
134
134
|
"@types/jest": "^30.0.0",
|