@dzhechkov/harness-core 0.8.34 → 0.8.35
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/.dz-manifest.json +41 -41
- package/README.md +157 -12
- package/dist/agentdb-index.d.ts +22 -1
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +156 -6
- package/dist/agentdb-index.js.map +1 -1
- package/dist/apply-leg.d.ts +142 -2
- package/dist/apply-leg.d.ts.map +1 -1
- package/dist/apply-leg.js +534 -38
- package/dist/apply-leg.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/mutation-gate.d.ts +19 -0
- package/dist/mutation-gate.d.ts.map +1 -1
- package/dist/mutation-gate.js +37 -1
- package/dist/mutation-gate.js.map +1 -1
- package/dist/operations.d.ts +16 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +72 -9
- package/dist/operations.js.map +1 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +90 -14
- package/dist/setup.js.map +1 -1
- package/dist/skills.d.ts +87 -3
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +266 -15
- package/dist/skills.js.map +1 -1
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +12 -8
- package/dist/vector-tier.js.map +1 -1
- package/package.json +2 -2
- package/sbom.json +40 -40
- package/src/agentdb-index.ts +158 -7
- package/src/apply-leg.ts +556 -38
- package/src/index.ts +9 -1
- package/src/mutation-gate.ts +58 -2
- package/src/operations.ts +76 -10
- package/src/setup.ts +81 -16
- package/src/skills.ts +303 -14
- package/src/vector-tier.ts +20 -10
package/.dz-manifest.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "README.md",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "37a3aab588b4b12b15d2d67a014abec49ae38615a1d28816310d5f2e6ad29f79"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "dist/__tests__/golden-baseline.test.d.ts",
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"path": "dist/agentdb-index.d.ts",
|
|
32
|
-
"sha256": "
|
|
32
|
+
"sha256": "179cd2dee305664b3c8365b4a8dcd64015b4e226b2753c6dd1e42769b4d0c96f"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"path": "dist/agentdb-index.d.ts.map",
|
|
36
|
-
"sha256": "
|
|
36
|
+
"sha256": "1e366365fadabe345c7d128da0250a4a21dc7e4924d1cc04f457fd38b40d3c72"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"path": "dist/agentdb-index.js",
|
|
40
|
-
"sha256": "
|
|
40
|
+
"sha256": "bbcee70ee0aa52d95960956a5692cff81d296e49083487c0bbfd3c3d93c94f9c"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "dist/agentdb-index.js.map",
|
|
44
|
-
"sha256": "
|
|
44
|
+
"sha256": "02208be0504446c12852720a17f99df8d64e69ba759a55f2ea4095ea19fa2f37"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "dist/agentdb-reindex-marker.d.ts",
|
|
@@ -125,19 +125,19 @@
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"path": "dist/apply-leg.d.ts",
|
|
128
|
-
"sha256": "
|
|
128
|
+
"sha256": "9cc4cf39b4ef8479eba5745c767c60a8a331f777e19251ec9faf42530f16b7c7"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"path": "dist/apply-leg.d.ts.map",
|
|
132
|
-
"sha256": "
|
|
132
|
+
"sha256": "5204913b80c8748926f20a1632658720b75336fcd7bdf15114ceb1707fde804c"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"path": "dist/apply-leg.js",
|
|
136
|
-
"sha256": "
|
|
136
|
+
"sha256": "f3e74e03e325569237340aace076e4e0507d12b48d47dcced7a836242ae13ac9"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"path": "dist/apply-leg.js.map",
|
|
140
|
-
"sha256": "
|
|
140
|
+
"sha256": "300050992853dba6e5cdd4dc54e66d77a506ac3750d81ed2d3da560086830e99"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"path": "dist/apply.d.ts",
|
|
@@ -1037,19 +1037,19 @@
|
|
|
1037
1037
|
},
|
|
1038
1038
|
{
|
|
1039
1039
|
"path": "dist/index.d.ts",
|
|
1040
|
-
"sha256": "
|
|
1040
|
+
"sha256": "5476546b291c2df0a0a4e3afd7b64900ada0b7ab26d400ae6fb6985853466c72"
|
|
1041
1041
|
},
|
|
1042
1042
|
{
|
|
1043
1043
|
"path": "dist/index.d.ts.map",
|
|
1044
|
-
"sha256": "
|
|
1044
|
+
"sha256": "593859b38d79431517940bccf25f5e8ae079e142ac6cb66396b38421555a1d17"
|
|
1045
1045
|
},
|
|
1046
1046
|
{
|
|
1047
1047
|
"path": "dist/index.js",
|
|
1048
|
-
"sha256": "
|
|
1048
|
+
"sha256": "a7264b451ffa98a04e54d23e83312abe3afe1f380b088e386841ea4325938596"
|
|
1049
1049
|
},
|
|
1050
1050
|
{
|
|
1051
1051
|
"path": "dist/index.js.map",
|
|
1052
|
-
"sha256": "
|
|
1052
|
+
"sha256": "67861fde05a1927927ab1951738fbed427a2d016b22433603136041df21b3f0d"
|
|
1053
1053
|
},
|
|
1054
1054
|
{
|
|
1055
1055
|
"path": "dist/integration-apply.d.ts",
|
|
@@ -1405,19 +1405,19 @@
|
|
|
1405
1405
|
},
|
|
1406
1406
|
{
|
|
1407
1407
|
"path": "dist/mutation-gate.d.ts",
|
|
1408
|
-
"sha256": "
|
|
1408
|
+
"sha256": "a77bd4063914f6dc09487990423e64c8186c5bc48b5285867852c905653605f4"
|
|
1409
1409
|
},
|
|
1410
1410
|
{
|
|
1411
1411
|
"path": "dist/mutation-gate.d.ts.map",
|
|
1412
|
-
"sha256": "
|
|
1412
|
+
"sha256": "6e414fbaee4a6ed940620fb44cb8c39a2fd945e32a966f8141f1923ec242bed3"
|
|
1413
1413
|
},
|
|
1414
1414
|
{
|
|
1415
1415
|
"path": "dist/mutation-gate.js",
|
|
1416
|
-
"sha256": "
|
|
1416
|
+
"sha256": "36dc04b58621a090dadaeefbd8d40e73196875f28a84f130f08bcad9b3ebcb53"
|
|
1417
1417
|
},
|
|
1418
1418
|
{
|
|
1419
1419
|
"path": "dist/mutation-gate.js.map",
|
|
1420
|
-
"sha256": "
|
|
1420
|
+
"sha256": "64c71e44dd9635b4480f0e64c27cf510c2859890b03f1a00ce555b438e365090"
|
|
1421
1421
|
},
|
|
1422
1422
|
{
|
|
1423
1423
|
"path": "dist/name-check.d.ts",
|
|
@@ -1485,19 +1485,19 @@
|
|
|
1485
1485
|
},
|
|
1486
1486
|
{
|
|
1487
1487
|
"path": "dist/operations.d.ts",
|
|
1488
|
-
"sha256": "
|
|
1488
|
+
"sha256": "60bd3d2d8ddc18535260e2b790ee25e6ddb77eab597248f05948987d7d5a39eb"
|
|
1489
1489
|
},
|
|
1490
1490
|
{
|
|
1491
1491
|
"path": "dist/operations.d.ts.map",
|
|
1492
|
-
"sha256": "
|
|
1492
|
+
"sha256": "f8021977e02820666664922176bca714047fc544c8b466f3956aae854e53dd53"
|
|
1493
1493
|
},
|
|
1494
1494
|
{
|
|
1495
1495
|
"path": "dist/operations.js",
|
|
1496
|
-
"sha256": "
|
|
1496
|
+
"sha256": "76105d806137ef947694e1cb10b2e8360411bd873e74386e87d933c99f53bbb3"
|
|
1497
1497
|
},
|
|
1498
1498
|
{
|
|
1499
1499
|
"path": "dist/operations.js.map",
|
|
1500
|
-
"sha256": "
|
|
1500
|
+
"sha256": "acbb9920848e738a286eff1f45ebdd3a9f5e3b09fec879567072573df15d171b"
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
1503
|
"path": "dist/package-skill-layouts.d.ts",
|
|
@@ -2177,15 +2177,15 @@
|
|
|
2177
2177
|
},
|
|
2178
2178
|
{
|
|
2179
2179
|
"path": "dist/setup.d.ts.map",
|
|
2180
|
-
"sha256": "
|
|
2180
|
+
"sha256": "3b8f5dc584a26b53be9f1e68cb8fffaaf68decbe1cf4b634f78c8ec0f3725b3d"
|
|
2181
2181
|
},
|
|
2182
2182
|
{
|
|
2183
2183
|
"path": "dist/setup.js",
|
|
2184
|
-
"sha256": "
|
|
2184
|
+
"sha256": "8644f836c6236867d8f238cf48465506361647f11bc58b50134a7a862b7e711a"
|
|
2185
2185
|
},
|
|
2186
2186
|
{
|
|
2187
2187
|
"path": "dist/setup.js.map",
|
|
2188
|
-
"sha256": "
|
|
2188
|
+
"sha256": "3bafd2f8eb1c3305be28c42d59365dc58751d199b5e702b69c581c5df7b97560"
|
|
2189
2189
|
},
|
|
2190
2190
|
{
|
|
2191
2191
|
"path": "dist/shell-veto-policy.d.ts",
|
|
@@ -2301,19 +2301,19 @@
|
|
|
2301
2301
|
},
|
|
2302
2302
|
{
|
|
2303
2303
|
"path": "dist/skills.d.ts",
|
|
2304
|
-
"sha256": "
|
|
2304
|
+
"sha256": "e2ee030cc763d5e909855239129aad5275aa42c9128458320759d321174fd697"
|
|
2305
2305
|
},
|
|
2306
2306
|
{
|
|
2307
2307
|
"path": "dist/skills.d.ts.map",
|
|
2308
|
-
"sha256": "
|
|
2308
|
+
"sha256": "857485e66830cc7a31e80a9a1b86614c5a02ceb074e7b209dbe62f12059f3198"
|
|
2309
2309
|
},
|
|
2310
2310
|
{
|
|
2311
2311
|
"path": "dist/skills.js",
|
|
2312
|
-
"sha256": "
|
|
2312
|
+
"sha256": "9659576b23f1c2f47cf5f6f78857495e44c89fffa4fc2010f6ded703e126738d"
|
|
2313
2313
|
},
|
|
2314
2314
|
{
|
|
2315
2315
|
"path": "dist/skills.js.map",
|
|
2316
|
-
"sha256": "
|
|
2316
|
+
"sha256": "f51408fe56f037d19219a828a5adba28f2bbe05337c3042d4fa25888ab31101b"
|
|
2317
2317
|
},
|
|
2318
2318
|
{
|
|
2319
2319
|
"path": "dist/slop-lint.d.ts",
|
|
@@ -2657,15 +2657,15 @@
|
|
|
2657
2657
|
},
|
|
2658
2658
|
{
|
|
2659
2659
|
"path": "dist/vector-tier.d.ts.map",
|
|
2660
|
-
"sha256": "
|
|
2660
|
+
"sha256": "8c504e223d4d78a29a24993078f4a90e771f56d6a62b310ab90b7ba44f1a6bd5"
|
|
2661
2661
|
},
|
|
2662
2662
|
{
|
|
2663
2663
|
"path": "dist/vector-tier.js",
|
|
2664
|
-
"sha256": "
|
|
2664
|
+
"sha256": "6554f0bd2566ac10e6c841732210daa2412028e520ce49acf197451024161382"
|
|
2665
2665
|
},
|
|
2666
2666
|
{
|
|
2667
2667
|
"path": "dist/vector-tier.js.map",
|
|
2668
|
-
"sha256": "
|
|
2668
|
+
"sha256": "23de503688790bbe679dae6c72b3c77faa43a14d4d0fbc54946c2e35cfd2d543"
|
|
2669
2669
|
},
|
|
2670
2670
|
{
|
|
2671
2671
|
"path": "dist/workflow-run-dispatch.d.ts",
|
|
@@ -2733,7 +2733,7 @@
|
|
|
2733
2733
|
},
|
|
2734
2734
|
{
|
|
2735
2735
|
"path": "package.json",
|
|
2736
|
-
"sha256": "
|
|
2736
|
+
"sha256": "273067dfe330063f7f449dea7480208e147a20eb7b554f921d1eb9ee33cb8ca4"
|
|
2737
2737
|
},
|
|
2738
2738
|
{
|
|
2739
2739
|
"path": "src/__tests__/golden-baseline.test.ts",
|
|
@@ -2741,7 +2741,7 @@
|
|
|
2741
2741
|
},
|
|
2742
2742
|
{
|
|
2743
2743
|
"path": "src/agentdb-index.ts",
|
|
2744
|
-
"sha256": "
|
|
2744
|
+
"sha256": "388fce3f17382373d5864dccc0c8685c1779d1101a490399ccbacb3bd6c1a2f5"
|
|
2745
2745
|
},
|
|
2746
2746
|
{
|
|
2747
2747
|
"path": "src/agentdb-reindex-marker.ts",
|
|
@@ -2765,7 +2765,7 @@
|
|
|
2765
2765
|
},
|
|
2766
2766
|
{
|
|
2767
2767
|
"path": "src/apply-leg.ts",
|
|
2768
|
-
"sha256": "
|
|
2768
|
+
"sha256": "9391b6e0d9f6ef3f39662d4f3c89dbc173881584c6956ad5add2ebd54cdc85cf"
|
|
2769
2769
|
},
|
|
2770
2770
|
{
|
|
2771
2771
|
"path": "src/apply.ts",
|
|
@@ -2997,7 +2997,7 @@
|
|
|
2997
2997
|
},
|
|
2998
2998
|
{
|
|
2999
2999
|
"path": "src/index.ts",
|
|
3000
|
-
"sha256": "
|
|
3000
|
+
"sha256": "f248dbc9f0fc735dcfe11ae399c8f7c52b4053bb10e29234dc27c6c9581b7945"
|
|
3001
3001
|
},
|
|
3002
3002
|
{
|
|
3003
3003
|
"path": "src/integration-apply.ts",
|
|
@@ -3093,7 +3093,7 @@
|
|
|
3093
3093
|
},
|
|
3094
3094
|
{
|
|
3095
3095
|
"path": "src/mutation-gate.ts",
|
|
3096
|
-
"sha256": "
|
|
3096
|
+
"sha256": "0e777534524e5042bcdb8eef9c5f3d23c5fd0f94e2fe45a52623f3122a5dedef"
|
|
3097
3097
|
},
|
|
3098
3098
|
{
|
|
3099
3099
|
"path": "src/name-check.ts",
|
|
@@ -3113,7 +3113,7 @@
|
|
|
3113
3113
|
},
|
|
3114
3114
|
{
|
|
3115
3115
|
"path": "src/operations.ts",
|
|
3116
|
-
"sha256": "
|
|
3116
|
+
"sha256": "8143fae14dbfcf0e87bf148add74e16e0ee8c2f8064fd2bfb0f90fbf1a21889b"
|
|
3117
3117
|
},
|
|
3118
3118
|
{
|
|
3119
3119
|
"path": "src/package-skill-layouts.ts",
|
|
@@ -3281,7 +3281,7 @@
|
|
|
3281
3281
|
},
|
|
3282
3282
|
{
|
|
3283
3283
|
"path": "src/setup.ts",
|
|
3284
|
-
"sha256": "
|
|
3284
|
+
"sha256": "0f44ef0d05c0ffabffe5e0f4fb4539b67fd72f62b42206d68bc98199ea718dcd"
|
|
3285
3285
|
},
|
|
3286
3286
|
{
|
|
3287
3287
|
"path": "src/shell-veto-policy.ts",
|
|
@@ -3313,7 +3313,7 @@
|
|
|
3313
3313
|
},
|
|
3314
3314
|
{
|
|
3315
3315
|
"path": "src/skills.ts",
|
|
3316
|
-
"sha256": "
|
|
3316
|
+
"sha256": "1dac38f95d956aa315554f6d7559e141a7acbebdab8c39d7f9880c3eae0f1f28"
|
|
3317
3317
|
},
|
|
3318
3318
|
{
|
|
3319
3319
|
"path": "src/slop-lint.ts",
|
|
@@ -3405,7 +3405,7 @@
|
|
|
3405
3405
|
},
|
|
3406
3406
|
{
|
|
3407
3407
|
"path": "src/vector-tier.ts",
|
|
3408
|
-
"sha256": "
|
|
3408
|
+
"sha256": "6607b712f768be25a140f224dc6c3c80d25e0e5144898fb819d488da7f0cd600"
|
|
3409
3409
|
},
|
|
3410
3410
|
{
|
|
3411
3411
|
"path": "src/workflow-run-dispatch.ts",
|
|
@@ -3425,5 +3425,5 @@
|
|
|
3425
3425
|
}
|
|
3426
3426
|
]
|
|
3427
3427
|
},
|
|
3428
|
-
"signature": "
|
|
3428
|
+
"signature": "dNZha0vxyf5ob2PcHUsX1zU0BQwDvQbcrZ5oKyPYXcgGmJAjvPkXAPf4scWIz152ujHWLaetlKNujBxedF+CDA=="
|
|
3429
3429
|
}
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ explicit skills-only short circuit. `--no-verify` cannot authorize emission. A C
|
|
|
210
210
|
|
|
211
211
|
| Module | Exports | Purpose |
|
|
212
212
|
|---|---|---|
|
|
213
|
-
| `skills` | `loadSkillFromDir`, `listSkills`, `listSkillsDetailed`, `describeSkillLoadFailure`, `formatSkillLoadFailures`, `formatSkillApplyFailures`, `discoverSkillIds` | Read skill directories into `CanonicalSkill` objects. **Two listing functions, deliberately:** `listSkills` THROWS on the first unloadable skill and always will — it is a published export, and silently turning it into a skip-and-collect function would downgrade every unknown third-party consumer from fail-closed to fail-silent without their consent (an incomplete catalogue reported as complete); a pinned regression test asserts it still throws. `listSkillsDetailed` is the total variant callers ask for BY NAME: it returns `{skills, failures}` with a per-id `try/catch`, so one unparseable `SKILL.md` never hides the ones after it (order-independence is the tested property — the offender first, middle or last yields the same counts). Every failure is NAMED — `describeSkillLoadFailure` is the single place a pathless parser throw becomes `{id, absolute path, verbatim reason, first line}`, because the parser is handed only TEXT and can never supply a path. `formatSkillLoadFailures` renders that list for stderr in one of two modes chosen by the CALLER (absolute paths for `dz list`/`dz sync`; relative-to-package for `dz install`, where a `node_modules/**` path is not actionable) |
|
|
213
|
+
| `skills` | `loadSkillFromDir`, `listSkills`, `listSkillsDetailed`, `describeSkillLoadFailure`, `formatSkillLoadFailures`, `formatSkillApplyFailures`, `discoverSkillIds`, `walkFiles`, `isSkillJunkFile`, `SKILL_JUNK_DIRS`, `SKILL_JUNK_FILES` | Read skill directories into `CanonicalSkill` objects. **Two listing functions, deliberately:** `listSkills` THROWS on the first unloadable skill and always will — it is a published export, and silently turning it into a skip-and-collect function would downgrade every unknown third-party consumer from fail-closed to fail-silent without their consent (an incomplete catalogue reported as complete); a pinned regression test asserts it still throws. `listSkillsDetailed` is the total variant callers ask for BY NAME: it returns `{skills, failures}` with a per-id `try/catch`, so one unparseable `SKILL.md` never hides the ones after it (order-independence is the tested property — the offender first, middle or last yields the same counts). Every failure is NAMED — `describeSkillLoadFailure` is the single place a pathless parser throw becomes `{id, absolute path, verbatim reason, first line}`, because the parser is handed only TEXT and can never supply a path. `formatSkillLoadFailures` renders that list for stderr in one of two modes chosen by the CALLER (absolute paths for `dz list`/`dz sync`; relative-to-package for `dz install`, where a `node_modules/**` path is not actionable). **Symlinks and junk (feature `skills-walk-symlinks-and-junk`):** `walkFiles`, the asset-discovery loop `loadSkillFromDir` and `getSkillInfo` both run on, resolves every symlink with `statSync` before deciding whether it names a file or a directory — a `Dirent` from `readdirSync` answers `false` to BOTH `isDirectory()` and `isFile()` for a symlink entry, so trusting those two checks alone silently drops every symlinked asset (MEASURED: 2 of 4 fixture assets vanished, exit 0, before this fix). A symlink whose target cannot be `stat`'d is a *broken symlink*; a directory (reached directly or through a symlink) whose `realpath` is already on the current ANCESTOR chain ends the walk there instead of recursing — the guard tracks the recursion path, not every directory ever visited, so two non-cyclic aliases of one directory (`alias1 -> shared`, `alias2 -> shared`) are both walked under their own logical paths (Codex r2, lead fix) (`walk-guards-cycles`, its own dedicated mutation entry as of fix-round 1 — the symlink-resolution mutation alone cannot prove the guard, because disabling symlink-following ALSO stops any cycle from ever being reached), which is what stops an `a -> ..` cycle from hanging. **Containment (fix-round 1, lead item AM-8):** a symlink is followed only when its RESOLVED target's real path lies within the skill directory's own real path — `assets/secret -> /etc/hostname`, or a relative `-> ../../..` that escapes upward, is refused with reason `'symlink escapes the skill directory'` and never bundled, whether the escaping target is a file or a directory; only a `..` path COMPONENT counts as an escape — a file legitimately named `..asset` is inside the root (Codex r2, lead fix). `SKILL.md` itself gets the same check BEFORE it is read: a `SKILL.md` that is a symlink escaping the skill directory makes the whole skill REFUSED with a named error (it is mandatory, so it cannot merely be skipped); an in-tree `SKILL.md` symlink still loads (Codex r2 CRITICAL, lead fix) (an escaping directory is not recursed into either — nothing beneath it is walked). **What counts as junk IS THE PUBLISHED CONTRACT** (fix-round 1 HIGH-1 — Codex's finding that this contradicts "never drops a legitimate skill asset" is REFUTED-BY-CONTRACT, not a bug: a skill cannot ship an asset under one of these exact names, on purpose or by accident, and that is the deliberate trade this design makes, not an oversight to be widened into content-sniffing): directories `__pycache__`, `node_modules`, `.git`, `__MACOSX`, `.pytest_cache`, `.mypy_cache` (`SKILL_JUNK_DIRS`); files named exactly `.DS_Store` or `Thumbs.db`, or matching `*.pyc`, `*.pyo`, `*.swp`, `*.swo`, or `.#*` (`SKILL_JUNK_FILES` + `isSkillJunkFile`) — a trailing `~` (editor backup) is deliberately NOT on the list: it is the one pattern a legitimate asset name can plausibly end with (`notes~`), and the list is conservative by contract — a false positive would silently drop a real asset (Codex r2, lead decision). This is NOT a whitelist — any other file (including a skill author's own `notes.local.txt`) is kept as a real asset; filtering someone else's files by name is not this list's job. Every junk entry, broken symlink, escaping symlink, and detected cycle is counted and NAMED, never silently dropped: `walkFiles` returns `{files, skipped}` where `skipped` is `{path, reason}[]` and `reason` NAMES the matched pattern (`'junk file (*.pyc)'`, `'junk directory (__pycache__)'`, not a bare `'junk file'` — fix-round 1 HIGH-1(b)), and `loadSkillFromDir` threads that list onto its `CanonicalSkill` result as an *optional* `skipped` field (present only when something was actually skipped, so every existing consumer that only reads the `CanonicalSkill` shape is unaffected). An unreadable directory (`readdirSync` throwing — fix-round 1 MEDIUM-3) is *also* a named `'unreadable directory (<errno>)'` skip, never a throw out of `loadSkillFromDir`. `dz install` sums the junk-tagged entries across the installed package's skills and prints one line — `skills: skipped N junk entr(y|ies) (…)` — only when N > 0; the count is ENTRIES, not files (a skipped junk directory is one entry regardless of how many files sit underneath it, since `walkFiles` never descends into it to count those), and a directory path in the list is shown with a trailing `/` (fix-round 1 MEDIUM-4) |
|
|
214
214
|
| `apply` | `applyEmitResult` | Write an adapter `EmitResult` to disk — **additively** |
|
|
215
215
|
| `repo-boundary` | `isRepoBoundary`, `RepoBoundaryIo` | A repository boundary is a `.git` directory with a real `HEAD` file or a worktree `gitdir:` redirect; an empty or unrelated `.git` entry is not a boundary, so `dz` run from a directory such as `/tmp` with a stray empty `.git` no longer treats it as a project root (and no longer creates a `.dz` store there). Named locks are unchanged: `<root>/.dz/locks/<name>.lock`, a pure function of the root. |
|
|
216
216
|
| `targets` | `TARGETS`, `TargetName`, `isTargetName`, `resolveTargetName`, `TARGET_ALIASES`, `TARGET_NAMES_SORTED`, `formatTargetProblem`, `formatTargetAliasNote`, `normalizeTargetToken` | `--target` name → platform adapter, plus the resolution layer in front of it. `isTargetName`/`TARGETS`/`TARGET_NAMES` are UNCHANGED: `boundaries.json` names `isTargetName` as the scanned `--target` validation boundary, and every resolution ends in exactly that guard — the boundary is routed THROUGH, never relocated. `resolveTargetName` is total and pure, with fixed precedence: exact canonical → normalised canonical (case/padding/separators: `Claude_Code`, `claudecode`) → an explicit `TARGET_ALIASES` row → unique normalised prefix → Levenshtein ≤ 3 strictly better than the runner-up → nothing. **Aliases ACCEPT; prefix and Levenshtein only SUGGEST** — an alias row is an owner decision recorded in DATA (adding one is one line and zero control flow), while a fuzzy match is a guess, and installing to the wrong target on a guess is worse than one round-trip. An ambiguous prefix (`co` → `codex`/`copilot`) is terminal with NO suggestion, for the same reason. `formatTargetProblem` renders the two-line refusal, keeping the literal `--target must be one of:` substring that shipped assertions pin |
|
|
@@ -556,10 +556,13 @@ hook entry at all).
|
|
|
556
556
|
`@dzhechkov/harness-core`, or the hub's own `harnessCoreDistDir()` for its own copies) — replacing
|
|
557
557
|
a hard-coded `/usr/lib/node_modules/...` guess that failed on any other npm prefix (nvm,
|
|
558
558
|
`/usr/local`, a differently-rooted global install).
|
|
559
|
-
- `applyLegHookEntries()` — the exact `UserPromptSubmit`/`SessionStart` hook-registry
|
|
560
|
-
`runSetup` merges into `.claude/settings.json` (a swallowed non-zero exit on the recall
|
|
561
|
-
broken body never blocks a prompt; a detached `nohup` spawn for the daemon so
|
|
562
|
-
waits on the ~1.5 s model load).
|
|
559
|
+
- `applyLegHookEntries(installRoot?)` — the exact `UserPromptSubmit`/`SessionStart` hook-registry
|
|
560
|
+
entries `runSetup` merges into `.claude/settings.json` (a swallowed non-zero exit on the recall
|
|
561
|
+
hook so a broken body never blocks a prompt; a detached `nohup` spawn for the daemon so
|
|
562
|
+
`SessionStart` never waits on the ~1.5 s model load). `installRoot` — an ABSOLUTE path — bakes both
|
|
563
|
+
commands as `node "<installRoot>/.claude/helpers/<file>" …`; omitting it (every zero-arg caller
|
|
564
|
+
before feature `apply-leg-install-root`) keeps the original `${CLAUDE_PROJECT_DIR:-.}`-relative
|
|
565
|
+
form. See "Install-root resolution" below for why the absolute form exists.
|
|
563
566
|
- `applyLegStatus(root)` — the ONE measurement `dz doctor` and `dz parity` both read: do both helper
|
|
564
567
|
files exist, at what version, and does `settings.json` actually reference them? Neither surface
|
|
565
568
|
may declare the leg "installed" from a static capability table again (ADR-001 Decision 3) — a
|
|
@@ -635,13 +638,84 @@ simply a second caller of the same contract.
|
|
|
635
638
|
|
|
636
639
|
`pickEngine` (the one seam `recallHybrid`, `mirrorPatternsToVector`, `teachGuard` etc. all resolve
|
|
637
640
|
their engine through) now routes through `getOrOpenEngine(projectRoot)` instead of calling
|
|
638
|
-
`resolveVectorEngine` directly — a per-process cache keyed by `(projectRoot
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
641
|
+
`resolveVectorEngine` directly — a per-process cache keyed by `realpath(projectRoot)`, invalidated
|
|
642
|
+
whenever `.dz/agentdb.db`'s mtime, size, inode, OR write-generation counter (see "Store
|
|
643
|
+
write-generation counter" below) changes, so a long-lived caller (the daemon) pays the
|
|
644
|
+
`isPackageInstalled`/`probeNativeDep` walk once, not once per prompt. A short-lived CLI invocation is
|
|
645
|
+
unaffected (the cache is populated and discarded within one process either way — I-1 parity holds).
|
|
646
|
+
`getOrOpenEngine`'s second parameter is an injectable resolver (default `resolveVectorEngine`) purely
|
|
647
|
+
for spy-testability — two functions in the same ES module cannot be reliably intercepted by
|
|
648
|
+
`vi.spyOn` when one calls the other by its local name.
|
|
649
|
+
|
|
650
|
+
### Install-root resolution (`apply-leg-install-root`, ADR-001, `APPLY_LEG_VERSION` 6→7)
|
|
651
|
+
|
|
652
|
+
Both generated files used to resolve their own store from `CLAUDE_PROJECT_DIR || cwd()` — the
|
|
653
|
+
SESSION's project, never the project the leg was actually installed into. A user-level install
|
|
654
|
+
(`dz setup --target claude-code --memory agentdb --project $HOME` — the owner's own layout, expecting
|
|
655
|
+
the leg everywhere `~/.claude/settings.json` is read) silently looked up a DIFFERENT project's `.dz/`
|
|
656
|
+
from every other session (issue #2, MEASURED on 0.8.25), and when `project === $HOME` the settings
|
|
657
|
+
command (`node "${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/recall-hook.cjs"`) broke down to `Cannot
|
|
658
|
+
find module` from a foreign session, swallowed by `2>/dev/null || true`.
|
|
659
|
+
|
|
660
|
+
- **The hook and daemon now resolve `PROJECT` install-root-first.** `INSTALL_ROOT =
|
|
661
|
+
path.resolve(__dirname, '..', '..')` (the hook, `.cjs`) / `dirname(dirname(fileURLToPath(import.meta.url)))`
|
|
662
|
+
(the daemon, ESM) — the precedent is `claude-hooks-assets.ts`'s own `path.resolve(__dirname, '..',
|
|
663
|
+
'..')` for the destructive-guard hook. Order for the hook: `INSTALL_ROOT` (used when it owns a
|
|
664
|
+
`.dz/`) → `CLAUDE_PROJECT_DIR` → `cwd()`. Order for the daemon is the same shape but
|
|
665
|
+
`DZ_PROJECT_ROOT` stays the TOP override (an explicit project root always wins over the install
|
|
666
|
+
root) → `INSTALL_ROOT` → `cwd()`. The hook's existing `[dz-recall] engine=…` diagnostic line (stderr
|
|
667
|
+
only, never `additionalContext`) now also names `root=<path> (install|env|cwd)`.
|
|
668
|
+
- **`dz setup` now bakes an ABSOLUTE command.** `applyLegHookEntries(opts.projectRoot)` writes
|
|
669
|
+
`node "<installRoot>/.claude/helpers/recall-hook.cjs" …` instead of the
|
|
670
|
+
`${CLAUDE_PROJECT_DIR:-.}`-relative form — the deployed helper already bakes an absolute
|
|
671
|
+
`CORE_DIST_DIR`, so the relative command only masked that non-portability. `hookCommandInvokes` (and
|
|
672
|
+
therefore `applyLegStatus`) recognizes BOTH forms — a command is "ours" once the helper's full
|
|
673
|
+
`.claude/helpers/<file>` path follows a `node` invocation, whatever the prefix. A re-`dz setup` over
|
|
674
|
+
a pre-feature relative entry REPLACES it in place (same array position — `addIfMissing` in
|
|
675
|
+
`setup.ts` is now add-or-replace, never reorders), so an upgrade never leaves two entries for one
|
|
676
|
+
event.
|
|
677
|
+
- **Limits, named plainly.** One store per install: from a foreign project's session the hook injects
|
|
678
|
+
the INSTALL ROOT's lessons, not the session project's — that is the requested behavior (a
|
|
679
|
+
per-project store alongside a user-level one is a separate feature). The Codex host's own hook
|
|
680
|
+
(`codex-hooks-assets.ts:232`/`:373`) resolves its root from `payload.cwd || PWD || cwd()` — the
|
|
681
|
+
SAME class of weakness — and is deliberately left unfixed here (named, not silently patched); see
|
|
682
|
+
that file's own comments and the project backlog.
|
|
683
|
+
|
|
684
|
+
### Store write-generation counter (`store-generation-counter`, `agentdb-index.ts`/`vector-tier.ts`)
|
|
685
|
+
|
|
686
|
+
`getOrOpenEngine`'s cache above invalidates on `.dz/agentdb.db`'s mtime/size/inode — AM-6 already
|
|
687
|
+
covers a temp+rename replace that preserves mtime (size or inode still differs), but a write of the
|
|
688
|
+
SAME byte length landing inside the same filesystem-mtime TICK, in place (no rename), could leave
|
|
689
|
+
all three signals coincidentally unchanged, serving the daemon a stale engine that never sees the
|
|
690
|
+
lesson `dz teach` just wrote. `indexPatternsToAgentdb` (`agentdb-index.ts` — the single write seam,
|
|
691
|
+
QR-6, every `dz teach`/consolidate/reindex/brain-mirror write) now bumps a sidecar counter file,
|
|
692
|
+
`<dbFile>.generation` (atomic tmp+`wx`+rename, next to the store itself so it travels with any copy),
|
|
693
|
+
on every successful write: `bumpStoreGeneration(projectRoot, dbPath?)` reads the current value via
|
|
694
|
+
`readStoreGeneration(projectRoot, dbPath?)` (missing/corrupt file degrades to `0` — the compatibility
|
|
695
|
+
floor for a store that predates this feature; a corrupt-but-numeric-looking value like `12junk` also
|
|
696
|
+
degrades to `0` — the parse is strict, `/^\d+$/`, not `Number.parseInt`'s leading-digits tolerance)
|
|
697
|
+
and writes `current + 1`. **Every exported store mutator bumps it** on its success path, not only
|
|
698
|
+
`indexPatternsToAgentdb`: `importVectorsToAgentdb`, `clearAgentdbQuarantine`, `deleteAgentdbByDzIds`,
|
|
699
|
+
`bumpAgentdbUses` and `reindexAgentdbRows` all call the same `bumpStoreGeneration` when they actually
|
|
700
|
+
changed a row (fix-round after independent Codex review, AM-1). The read-modify-write itself runs
|
|
701
|
+
under `withNamedLockSync(dirname(dbFile), 'store-generation', …)` (`named-lock.ts` — the repo's
|
|
702
|
+
advisory lock for a read-modify-write file store, `.claude/rules/cross-runtime-concurrency.md`; same
|
|
703
|
+
`dirname(dbFile)`-addressed pattern as `agentdb-reindex-marker.ts`'s `withAgentdbSnapshotLock`), with
|
|
704
|
+
the counter RE-READ from disk inside the lock — a bare read→compute→rename would let two concurrent
|
|
705
|
+
writers both publish the same `N+1` (one bump silently lost) or let a delayed writer overwrite a
|
|
706
|
+
later value with an earlier one (AM-2). Inside `indexPatternsToAgentdb`/`importVectorsToAgentdb` the
|
|
707
|
+
bump runs IMMEDIATELY after the row commit, BEFORE `writeEmbedManifest` — if the manifest write then
|
|
708
|
+
throws, the generation is already correct for the rows already on disk (AM-3). A write failure (a
|
|
709
|
+
jammed counter path, a full disk, an unresolvable path, or a lock that could not be acquired by its
|
|
710
|
+
deadline) is reported honestly on the index result (`generationBumped: false, generationReason`) but
|
|
711
|
+
NEVER fails the store write it accompanies, and `bumpStoreGeneration` itself never throws — telemetry
|
|
712
|
+
is not a gate (FR-4/AM-2/AM-4).
|
|
713
|
+
|
|
714
|
+
`getOrOpenEngine`'s cache-invalidation stat (`AgentdbDbStat`, `vector-tier.ts`) now carries
|
|
715
|
+
`generation` as a FOURTH independent signal alongside mtime/size/inode — a monotonically increasing
|
|
716
|
+
counter can never coincidentally match a stale cache entry the way mtime/size/inode occasionally can
|
|
717
|
+
on a coarse filesystem. Both public functions are exported from the package root
|
|
718
|
+
(`readStoreGeneration`, `bumpStoreGeneration`).
|
|
645
719
|
|
|
646
720
|
`dz doctor`'s "apply-leg alive (embed daemon)" check now sends one live `op: recall` probe
|
|
647
721
|
(`probeRecallEngine`, `operations.ts`, 1000 ms default — comfortably above the 500 ms production
|
|
@@ -660,6 +734,77 @@ budget. The p95/p50/reproducer script live in
|
|
|
660
734
|
cache is `agentdb-index.ts` work, outside this feature's touched files — named here as a follow-up,
|
|
661
735
|
not silently absorbed into a passing-looking number.
|
|
662
736
|
|
|
737
|
+
### Green means injected, not merely present (`apply-leg-never-silent`, ADR-001, `APPLY_LEG_VERSION` 8→9)
|
|
738
|
+
|
|
739
|
+
Issue #2's second half: the recall hook exited 0 with NO stderr on every early-return path, and
|
|
740
|
+
`dz setup`'s own UserPromptSubmit command swallowed even a `Cannot find module` behind
|
|
741
|
+
`2>/dev/null || true` — a MEASURED state where `dz doctor` printed three green checks
|
|
742
|
+
(`apply-leg installed`, `apply-leg alive`, `memory hooks match config`) and `dz parity` printed
|
|
743
|
+
`✓ Self-learning … via UserPromptSubmit hook (auto recall)` while the leg injected nothing in every
|
|
744
|
+
session but one. Both instruments were reading FILE PRESENCE and STRUCTURAL WIRING as proof of
|
|
745
|
+
FUNCTION — the same class of defect ADR-001 Decision 3 already named for `applyLegStatus`, one layer
|
|
746
|
+
deeper.
|
|
747
|
+
|
|
748
|
+
- **The hook never exits silently now (FR-1).** Every early return in `main()` — `store-not-found`
|
|
749
|
+
(no `.dz/` under the resolved `PROJECT`), `socket-absent` (no daemon listening), `core-unavailable`
|
|
750
|
+
(`recall-hook-policy.js` unresolvable), `empty-prompt`, `no-hits` — prints exactly one line,
|
|
751
|
+
`[dz-recall] skipped reason=<reason> root=<path> (<source>) session=<path>`, on stderr before
|
|
752
|
+
returning. Exit code stays 0 — NEVER-BLOCK is unchanged; only the silence is gone.
|
|
753
|
+
- **`dz setup`'s own command no longer swallows that line (FR-2).** `applyLegHookEntries()`'s
|
|
754
|
+
UserPromptSubmit command dropped `2>/dev/null` (both the legacy relative form and the
|
|
755
|
+
`installRoot`-given absolute form); `|| true` stays, so a broken hook body still never fails a
|
|
756
|
+
prompt. **Where that line actually goes, MEASURED against the real Claude Code binary** (strings
|
|
757
|
+
extracted from `bin/claude.exe`, the `UserPromptSubmit` entry in its own hook-reference table):
|
|
758
|
+
`Exit code 0 - stdout shown to Claude` / `Exit code 2 - block processing, erase original prompt,
|
|
759
|
+
and show stderr to user only` / `Other exit codes - show stderr to user only` — on exit 0
|
|
760
|
+
(NEVER-BLOCK's exit code), stderr is named NOWHERE in that table. So the reason line is NOT for a
|
|
761
|
+
user watching Claude Code's own transcript (that channel does not exist for this hook on exit 0,
|
|
762
|
+
whatever "verbose mode" might suggest) — it is for the two readers who actually read a spawned
|
|
763
|
+
child's stderr directly: `probeApplyLeg`'s own `child_process` call below, and a human running the
|
|
764
|
+
hook by hand from a terminal.
|
|
765
|
+
- **A live, end-to-end probe replaces "files present" as the proof of function (FR-3/FR-4, ADR-001
|
|
766
|
+
Decision 1).** `probeApplyLeg(root, opts?)` — new export — spawns the REAL configured
|
|
767
|
+
UserPromptSubmit command (read back from `.claude/settings.json`, never reconstructed — a
|
|
768
|
+
reconstruction would silently stop testing the legacy relative form's own `${CLAUDE_PROJECT_DIR:-.}`
|
|
769
|
+
shell-expansion dependency) from a TEMPORARY cwd with `CLAUDE_PROJECT_DIR` pointing at that same
|
|
770
|
+
temp dir — the shape of a real session, never the project root itself. It writes a throwaway
|
|
771
|
+
"beacon" lesson into the lexical store via `recordPattern` (the same seam `dz teach` uses — no
|
|
772
|
+
embedding needed; the daemon's `recallHybrid` runs its LEXICAL leg synchronously and always, so an
|
|
773
|
+
exact-token beacon is found even under a starved hybrid budget) immediately before the probe and
|
|
774
|
+
removes it via `removePatternsByIds` in a `finally` — unconditionally, so a probe that throws,
|
|
775
|
+
times out, or never finds the leg alive still leaves the store exactly as it found it (proven by a
|
|
776
|
+
count-before == count-after test, not merely claimed). `ok: true` ONLY when the beacon's own token
|
|
777
|
+
comes back inside `additionalContext`; every other outcome is `ok: false` with a `reason` — taken
|
|
778
|
+
from the hook's own `[dz-recall] skipped reason=…` line when present (FR-1 feeding FR-3 directly),
|
|
779
|
+
else a best-effort description.
|
|
780
|
+
- `dz doctor` gains `apply-leg injects (live probe)`, evaluated whenever the existing
|
|
781
|
+
`apply-leg alive (embed daemon)` row's `applyLegWired` gate is true — green with the elapsed
|
|
782
|
+
time on success, red with the probe's `reason` on failure. A dedicated `try`/`catch`, separate
|
|
783
|
+
from the socket-alive check beside it: a probe failure must never suppress that already-useful
|
|
784
|
+
row, and vice versa.
|
|
785
|
+
- `dz parity`'s Self-learning cell now gates on `probeApplyLeg(cwd).ok`, not
|
|
786
|
+
`applyLegStatus(cwd).installed` alone — `computeParity` itself is untouched (FR-5 of the earlier
|
|
787
|
+
feature). A structurally-installed-but-silent leg reads `◐ … installed but silent: <reason>`,
|
|
788
|
+
never `✓ full`; the SAME `reason` `dz doctor`'s row prints, so the two instruments cannot
|
|
789
|
+
disagree about WHY a leg is dead, matching the fix-round-1 discipline `applyLegReasonMessage`
|
|
790
|
+
already established for `stale-version`/`unreadable`.
|
|
791
|
+
- `probeHookLiveness` (`operations.ts`) gained optional `cwd`/`env`/`timeoutMs` overrides (additive
|
|
792
|
+
— every pre-existing 2-arg call site, the Codex veto-hook liveness checks, is unaffected) and now
|
|
793
|
+
also returns `stdout` alongside `status`/`stderr`, reused by `probeApplyLeg` via a dynamic
|
|
794
|
+
`import()` rather than duplicating a `child_process` surface in `apply-leg.ts` (the core-boundary
|
|
795
|
+
IO ratchet stayed at its pinned `files:63 imports:69` — no new top-level IO import anywhere).
|
|
796
|
+
- `timeoutMs` defaults to 8000 ms. Measured (this environment, 2026-09-14/15): a
|
|
797
|
+
`store-not-found`/`socket-absent` probe returns in well under 200 ms; a live-daemon probe answers
|
|
798
|
+
in ~100-200 ms (matching ADR-001's own estimate) once warm. `dz doctor`/`dz parity` are
|
|
799
|
+
measurably slower by one probe's worth of wall time when the leg is wired — named here, not
|
|
800
|
+
hidden.
|
|
801
|
+
- **A limit, named plainly.** Under HEAVY concurrent load (this repo's own ~2700-test suite run in
|
|
802
|
+
one process), a live probe against a just-spawned daemon can occasionally exceed the hook's own
|
|
803
|
+
hardcoded 800 ms client-side socket timeout even when the daemon itself answers — a CPU-contention
|
|
804
|
+
flake, not a correctness defect; the daemon's own `HOOK_RECALL_BUDGET_MS` is independently
|
|
805
|
+
widenable, and `probeApplyLeg`'s `env` option exists for exactly this in tests. A real single
|
|
806
|
+
`dz doctor`/`dz parity` invocation never contends with 100+ concurrent test files.
|
|
807
|
+
|
|
663
808
|
## Run a plan without the Claude host
|
|
664
809
|
|
|
665
810
|
`runWorkflow` (`workflow-run.ts`) is the PURE scheduler behind `dz workflow run`: it INTERPRETS a
|
package/dist/agentdb-index.d.ts
CHANGED
|
@@ -24,10 +24,14 @@ export interface AgentdbRow {
|
|
|
24
24
|
readonly uses?: number;
|
|
25
25
|
readonly avgReward?: number;
|
|
26
26
|
}
|
|
27
|
-
/** Outcome of {@link indexPatternsToAgentdb}.
|
|
27
|
+
/** Outcome of {@link indexPatternsToAgentdb}. `generationBumped`/`generationReason` are present only
|
|
28
|
+
* when a store write actually happened (`indexed > 0`) — FR-4: a failed counter write NEVER fails
|
|
29
|
+
* the indexing call itself, it is only reported so a caller (`dz doctor`, telemetry) can see it. */
|
|
28
30
|
export interface AgentdbIndexResult {
|
|
29
31
|
readonly indexed: number;
|
|
30
32
|
readonly error?: string | undefined;
|
|
33
|
+
readonly generationBumped?: boolean;
|
|
34
|
+
readonly generationReason?: string;
|
|
31
35
|
}
|
|
32
36
|
/** Resolve the shared store path: explicit opt → AGENTDB_PATH env → `<project>/.dz/agentdb.db`. */
|
|
33
37
|
export declare function resolveAgentdbPath(projectRoot: string, dbPath?: string): string;
|
|
@@ -58,6 +62,23 @@ export declare function ensureAgentdbSchema(projectRoot: string, dbPath?: string
|
|
|
58
62
|
readonly ok: boolean;
|
|
59
63
|
readonly error?: string;
|
|
60
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* FR-2/FR-3 (`store-generation-counter`): the store's write-generation counter, read back. A
|
|
67
|
+
* missing file (a store that predates this feature, or one that has never been written through
|
|
68
|
+
* {@link bumpStoreGeneration}) reads as `0` — the compatibility floor {@link getOrOpenEngine}'s
|
|
69
|
+
* caller compares against, never an error. A corrupt/non-numeric file degrades the same way (best
|
|
70
|
+
* effort — a bad counter must never crash a read path), never a throw. AM-5: the content must match
|
|
71
|
+
* {@link STRICT_GENERATION} exactly — `Number.parseInt`'s leading-digits-only tolerance is NOT used
|
|
72
|
+
* to decide validity, only to convert an already-validated string.
|
|
73
|
+
*/
|
|
74
|
+
export declare function readStoreGeneration(projectRoot: string, dbPath?: string): number;
|
|
75
|
+
export declare function bumpStoreGeneration(projectRoot: string, dbPath?: string): {
|
|
76
|
+
readonly ok: true;
|
|
77
|
+
readonly generation: number;
|
|
78
|
+
} | {
|
|
79
|
+
readonly ok: false;
|
|
80
|
+
readonly error: string;
|
|
81
|
+
};
|
|
61
82
|
/**
|
|
62
83
|
* Index `rows` into the shared AgentDB vector store. Returns `{indexed:0}` for an empty input and
|
|
63
84
|
* `{indexed:0, error}` when `agentdb`/`better-sqlite3` cannot be resolved from the project.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentdb-index.d.ts","sourceRoot":"","sources":["../src/agentdb-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,OAAO,EAAqC,KAAK,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAChH,OAAO,EAAiD,KAAK,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAehI,iGAAiG;AACjG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED
|
|
1
|
+
{"version":3,"file":"agentdb-index.d.ts","sourceRoot":"","sources":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