claude-flow-novice 2.18.12 → 2.18.14
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/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417503_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417531_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/metadata.json +8 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/original +3 -0
- package/.backups/unknown/1765417552_2999b9ec66f591dd76075617ec31fcea/revert.sh +7 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/metadata.json +8 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/original +1212 -0
- package/.backups/unknown/1765417613_1f34dbf0fe1ec3b6cb74ba7c4e12a2a4/revert.sh +7 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/metadata.json +8 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/original +1212 -0
- package/.backups/unknown/1765417613_332e9bb223a26270398922640c1c1653/revert.sh +7 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/metadata.json +8 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/original +1212 -0
- package/.backups/unknown/1765417613_45880a7afef063347b701e7e88e2df9c/revert.sh +7 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/metadata.json +8 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/original +1228 -0
- package/.backups/unknown/1765417614_1b6c3b658c2891dbe245aea4bad41661/revert.sh +7 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/metadata.json +8 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/original +1237 -0
- package/.backups/unknown/1765417614_1ed5bd129f0b5d1b297a04ec5267ef62/revert.sh +7 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/metadata.json +8 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/original +1240 -0
- package/.backups/unknown/1765417614_28e032bd1b62dbfcecbd56327a0b0e23/revert.sh +7 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/metadata.json +8 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/original +1216 -0
- package/.backups/unknown/1765417614_40a1ce1b0efa2e1ba1958c27b2cbc557/revert.sh +7 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/metadata.json +8 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/original +1238 -0
- package/.backups/unknown/1765417614_f65dbf58cff7a9aa1c5c3d0d1618074a/revert.sh +7 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/metadata.json +8 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/original +1167 -0
- package/.backups/unknown/1765417615_0f45c28b9b8d5204974421c06075ff74/revert.sh +7 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/metadata.json +8 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/original +1242 -0
- package/.backups/unknown/1765417615_41d36156891ddb6f63d1b4da59d1db4c/revert.sh +7 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/metadata.json +8 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/original +2 -0
- package/.backups/unknown/1765417709_77dda8631459cfc2ab94b8928f7d90b4/revert.sh +7 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/metadata.json +8 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/original +1169 -0
- package/.backups/unknown/1765417775_1405837bacf112ba832a139840fe94e7/revert.sh +7 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/metadata.json +8 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/original +1171 -0
- package/.backups/unknown/1765417775_8044b4a5cfdcb5cd71317831ad53f5a2/revert.sh +7 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/metadata.json +8 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/original +1170 -0
- package/.backups/unknown/1765417775_8eb94d60151e1db262377fbf8a187212/revert.sh +7 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/metadata.json +8 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/original +1173 -0
- package/.backups/unknown/1765417776_a0d4b709e15e0bfa002c4b128f5e4603/revert.sh +7 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/metadata.json +8 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/original +1170 -0
- package/.backups/unknown/1765417776_cb1bc24d98b63564eb73ef782b8c68b3/revert.sh +7 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/metadata.json +8 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/original +1172 -0
- package/.backups/unknown/1765417777_1c4cc8c33f476f0c87c8efd4e34efc22/revert.sh +7 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/metadata.json +8 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/original +1175 -0
- package/.backups/unknown/1765417777_325de83ffd34544909b8b9aa6e18dd05/revert.sh +7 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/metadata.json +8 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/original +1178 -0
- package/.backups/unknown/1765417950_402e7c1a8956b56ac7b88e89f024acb4/revert.sh +7 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/metadata.json +8 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/original +1174 -0
- package/.backups/unknown/1765417950_647e27e4da18ae42c339e04b4d334feb/revert.sh +7 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/metadata.json +8 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/original +1194 -0
- package/.backups/unknown/1765417951_1424d2dd67b8c8a4e7cf649b379d21f2/revert.sh +7 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/metadata.json +8 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/original +1186 -0
- package/.backups/unknown/1765417951_6df070ca287ea94a7f08efc69ec9ea51/revert.sh +7 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/metadata.json +8 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/original +1180 -0
- package/.backups/unknown/1765417951_848919a1365f6536e5ef8d85d0c80fa7/revert.sh +7 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/metadata.json +8 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/original +1198 -0
- package/.backups/unknown/1765417951_b0d1d4ecf85ad10cda0f3900d414b608/revert.sh +7 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/metadata.json +8 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/original +1202 -0
- package/.backups/unknown/1765417952_2b720e213b5197cbaad53f9f0857f23f/revert.sh +7 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/metadata.json +8 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/original +1202 -0
- package/.backups/unknown/1765417952_ef1d15e8b83a802a0c0f0fc03e56a89c/revert.sh +7 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/metadata.json +8 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/original +1209 -0
- package/.backups/unknown/1765418048_ac94238a69a6f86a6ba9d31f623c18a7/revert.sh +7 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/metadata.json +8 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/original +1207 -0
- package/.backups/unknown/1765418048_f3afed98da63fef9ff57fb5646976f63/revert.sh +7 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/metadata.json +8 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/original +1207 -0
- package/.backups/unknown/1765418049_9c392702a4e1cace37d17f6f2dfaf54e/revert.sh +7 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/metadata.json +8 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/original +1193 -0
- package/.backups/unknown/1765418049_9e0777555b51dea4d24d0503b584cfc5/revert.sh +7 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/metadata.json +8 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/original +1194 -0
- package/.backups/unknown/1765418050_22d534bed68f9f5d883bee54e7cbc4d3/revert.sh +7 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/metadata.json +8 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/original +1193 -0
- package/.backups/unknown/1765418051_d9243722dc90dabc851c5767a62ac7f2/revert.sh +7 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/metadata.json +8 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/original +1191 -0
- package/.backups/unknown/1765418177_21a2fa816d25d419b54ef2d429aab474/revert.sh +7 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/metadata.json +8 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/original +1190 -0
- package/.backups/unknown/1765418177_33b673dce1eb59d7eb4f752aec882794/revert.sh +7 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/metadata.json +8 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/original +1191 -0
- package/.backups/unknown/1765418177_72568812ea5a73cf6861a6b14da065fa/revert.sh +7 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/metadata.json +8 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/original +1189 -0
- package/.backups/unknown/1765418178_20c28b95f12194fe4b81cfb35f4f3757/revert.sh +7 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/metadata.json +8 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/original +1197 -0
- package/.backups/unknown/1765418178_cdf68719cc09173769027743e2718ad4/revert.sh +7 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/metadata.json +8 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/original +1190 -0
- package/.backups/unknown/1765418178_eb19e0f8542405480e51af09fad84b71/revert.sh +7 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/metadata.json +8 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/original +1197 -0
- package/.backups/unknown/1765418236_c016507725847318a3c369b047cbb802/revert.sh +7 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/metadata.json +8 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/original +1197 -0
- package/.backups/unknown/1765418237_932c3cc3a5c537b7933c2370b65f4b39/revert.sh +7 -0
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.md +194 -2
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.sh +264 -0
- package/.claude/agents/cfn-dev-team/utility/epic-creator-v2.sh.backup +698 -0
- package/.claude/agents/custom/claude-code-expert.md +56 -0
- package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/SKILL.md +1 -1
- package/.claude/hooks/README.md +148 -0
- package/.claude/hooks/SessionStart:cfn-load-openai-key.sh +35 -0
- package/.claude/hooks/cfn-invoke-pre-edit.sh +1 -1
- package/.claude/hooks/cfn-load-cerebras-env.sh +65 -0
- package/.claude/hooks/cfn-precompact-enhanced.sh +283 -0
- package/.claude/hooks/deprecated/README.md +27 -0
- package/.claude/settings.json +71 -6
- package/.claude/skills/cfn-agent-lifecycle/SKILL.md +1 -1
- package/.claude/skills/cfn-agent-tooling/SKILL.md +1 -1
- package/.claude/skills/cfn-cerebras-coordinator/QUICKSTART.md +348 -0
- package/.claude/skills/cfn-cerebras-coordinator/README.md +525 -0
- package/.claude/skills/cfn-cerebras-coordinator/TDD_COORDINATOR_OVERVIEW.md +284 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-py-v2-test-1733854200.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-py-v3-test-1765383241.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-rust-v2-test-1765381361.json +36 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-rust-v3-test-1765383242.json +46 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v2-test-1733864400.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v3-test-1765383238.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v4-test-1765386506.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/conversations/2025-12-10-ts-v5-test-1765393100.json +66 -0
- package/.claude/skills/cfn-cerebras-coordinator/example-usage.sh +206 -0
- package/.claude/skills/cfn-cerebras-coordinator/lib/tdd-conversation-coordinator.ts +569 -0
- package/.claude/skills/cfn-cerebras-coordinator/test-tdd-coordinator.sh +250 -0
- package/.claude/skills/cfn-compilation-error-fixer/SKILL.md +1 -1
- package/.claude/skills/cfn-compilation-error-fixer/lib/fixer/cerebras-gated-fixer-v2.ts +1 -1
- package/.claude/skills/cfn-config/SKILL.md +1 -1
- package/.claude/skills/cfn-dependency-management/SKILL.md +1 -1
- package/.claude/skills/cfn-deployment-lifecycle/SKILL.md +1 -1
- package/.claude/skills/cfn-edit-safety/SKILL.md +1 -1
- package/.claude/skills/cfn-epic-creator/SKILL.md +392 -0
- package/.claude/skills/cfn-epic-creator/estimate-costs.sh +524 -0
- package/.claude/skills/cfn-epic-creator/invoke.sh +445 -0
- package/.claude/skills/cfn-epic-creator/parse-personas.sh +533 -0
- package/.claude/skills/cfn-epic-creator/security-utils.sh +268 -0
- package/.claude/skills/cfn-epic-creator/security-verification-demo.sh +127 -0
- package/.claude/skills/cfn-epic-creator/test-invoke.sh +620 -0
- package/.claude/skills/cfn-epic-creator/test-security-fixes.sh +195 -0
- package/.claude/skills/cfn-epic-creator/test-security-simple.sh +165 -0
- package/.claude/skills/cfn-epic-creator/validate-epic.sh +474 -0
- package/.claude/skills/cfn-epic-parser/SKILL.md +8 -0
- package/.claude/skills/cfn-error-management/SKILL.md +1 -1
- package/.claude/skills/cfn-intervention-system/SKILL.md +1 -1
- package/.claude/skills/cfn-knowledge-base/SKILL.md +1 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/metadata.json +8 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/original +209 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/.backups/unknown/1765358428_2cf0ad7377232c919ff0a65630cb307d/revert.sh +7 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/AGENT_INTEGRATION_PATTERNS.md +255 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/Cargo.toml +8 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/Cargo.toml.backup +47 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/EXTRACTION_EXAMPLES.md +287 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/README.md +2 -563
- package/.claude/skills/cfn-local-ruvector-accelerator/SCHEMA_V2_IMPLEMENTATION.md +151 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/SECURITY_IMPLEMENTATION.md +185 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/SKILL.md +8 -343
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/EXECUTIVE_SUMMARY.txt +90 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/PHASE_4_QUERY_API.md +210 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/RUST_AST_EXTRACTOR_IMPLEMENTATION.md +222 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/TRANSACTION_MANAGEMENT.md +241 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/docs/VALIDATION_FINDINGS.txt +250 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/epic-ast-indexer.json +335 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/index-code.sh +292 -96
- package/.claude/skills/cfn-local-ruvector-accelerator/index-code.sh.backup +249 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/index_all.sh +65 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/find.rs +214 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index.rs +275 -94
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index_ast.rs +767 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index_modified.rs +37 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/init.rs +17 -12
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/migration.rs +34 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/mod.rs +6 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/query.rs +2 -2
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/refs.rs +209 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/embeddings.rs +82 -33
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/mod.rs +251 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/rust.rs +425 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/rust_placeholder.rs +420 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/text_fallback.rs +490 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/typescript.rs +520 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/extractors/typescript_full.rs +531 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/lib.rs +20 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/main.rs +33 -2
- package/.claude/skills/cfn-local-ruvector-accelerator/src/main.rs.backup +360 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration.rs +325 -318
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration_backup.rs +325 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/migration_tx.rs +513 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/paths.rs +29 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/query_api.rs +609 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/schema_v2.rs +603 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/search_engine.rs +150 -29
- package/.claude/skills/cfn-local-ruvector-accelerator/src/security_tests.rs +154 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/sqlite_store.rs +1 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2.rs +583 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_backup.rs +560 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_fixed.rs +0 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/store_v2_tx.rs +397 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/test_schema.rs +228 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/transaction_tests.rs +410 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_ast_indexing.rs +59 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_query_api.sh +103 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_schema.sql +158 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_schema_v2.sql +147 -0
- package/.claude/skills/cfn-loop-orchestration-v2/SKILL.md +1 -1
- package/.claude/skills/cfn-loop-orchestration-v2/lib/decision/SKILL.md +8 -0
- package/.claude/skills/cfn-loop-orchestration-v2/lib/orchestrator/SKILL.md +1 -1
- package/.claude/skills/cfn-loop-orchestration-v2/lib/output/SKILL.md +8 -0
- package/.claude/skills/cfn-loop-orchestration-v2/lib/validation/SKILL.md +11 -2
- package/.claude/skills/cfn-mdap-context-injection/SKILL.md +31 -10
- package/.claude/skills/cfn-mdap-error-fixer/skill.md +15 -205
- package/.claude/skills/cfn-memory-persistence/lib/auto/SKILL.md +7 -0
- package/.claude/skills/cfn-memory-persistence/lib/management/SKILL.md +7 -0
- package/.claude/skills/cfn-parameterized-queries/SKILL.md +8 -0
- package/.claude/skills/cfn-planning/SKILL.md +1 -1
- package/.claude/skills/cfn-session-handoff/SKILL.md +1 -53
- package/.claude/skills/cfn-skill-management/SKILL.md +1 -1
- package/.claude/skills/cfn-task-decomposition/SKILL.md +1 -0
- package/.claude/skills/cfn-task-intelligence/SKILL.md +39 -18
- package/.claude/skills/cfn-task-planning/SKILL.md +37 -12
- package/.claude/skills/cfn-transparency-middleware/SKILL.md +1 -1
- package/.claude/skills/cfn-utilities/SKILL.md +1 -1
- package/.claude/skills/cfn-validation-framework/SKILL.md +3 -60
- package/.claude/skills/cfn-vision-analysis/SKILL.md +3 -20
- package/.claude-flow/metrics/performance.json +3 -3
- package/.claude-flow/metrics/task-metrics.json +3 -3
- package/.ruvector/index_v2.db-shm +0 -0
- package/.ruvector/index_v2.db-wal +0 -0
- package/CLAUDE.md +9 -1
- package/README.md +56 -0
- package/docs/AGENT_PRODUCTION_FEEDBACK_PATTERNS.md +389 -0
- package/docs/CEREBRAS_TDD_COORDINATOR_TEST_RESULTS.md +213 -0
- package/docs/CEREBRAS_TDD_ROUND1_VS_ROUND2_COMPARISON.md +225 -0
- package/docs/CEREBRAS_TDD_ROUND3_FINAL_RESULTS.md +264 -0
- package/docs/EPIC_CREATOR_V2_ARCHITECTURE.md +629 -0
- package/docs/HOOKS_IMPLEMENTATION_PRIORITY.md +585 -0
- package/docs/SKILLS_HOOKS_INTEGRATION.md +1074 -0
- package/epic-with-personas-2025-12-09-17-15-13.json +253 -0
- package/index/index.bin +0 -0
- package/index/metadata.json +1 -0
- package/package.json +2 -1
- package/test-epic-creator-security.sh +203 -0
- package/.claude/skills/cfn-compilation-error-fixer/HANDOFF.md +0 -29
- package/.claude/skills/cfn-local-ruvector-accelerator/__pycache__/search_engine_v2.cpython-312.pyc +0 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/search_engine.py +0 -200
- package/.ruvector/index.db-journal +0 -0
- package/jest.config.ts.cjs +0 -17
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/context-analyzer.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-cerebras-code-generator/generate-code.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/execute.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/INTEGRATION.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/SAMPLE_OUTPUTS.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/capture-container-logs.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/enable-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/init-hybrid-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/analytics-summary.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-agent-timeline.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-consensus-history.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-coordination-timeline.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-failed-containers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/queries/query-gate-checks.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/schema.sql +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/sqlite-helpers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/logging/test-hybrid-logging.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/mcp/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/mcp/skill-mcp-selector.js +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/orchestration/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/orchestration/orchestrate.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/spawning/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/spawning/spawn-agent.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/cleanup-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/lib/docker-helpers.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/monitor-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-docker-runtime/lib/waves/spawn-wave.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-node-heap-sizer/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/cfn-node-heap-sizer/task-mode-heap-limiter.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/deprecated/analyze-patterns.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/README.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/SECURITY.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/SKILL.md +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/package.json +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/solve.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test-equation-solver-minimal.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test-equation-solver.sh +0 -0
- /package/.claude/{skills → cfn-extras/skills/deprecated}/equation-solver/test.cjs +0 -0
- /package/.claude/hooks/{cfn-credential-scanner.sh → deprecated/cfn-credential-scanner.sh} +0 -0
- /package/.claude/hooks/{cfn-detect-hardcoded-credentials.sh → deprecated/cfn-detect-hardcoded-credentials.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-post-edit-ts.sh → deprecated/cfn-invoke-post-edit-ts.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-pre-edit-ts.sh → deprecated/cfn-invoke-pre-edit-ts.sh} +0 -0
- /package/.claude/hooks/{cfn-invoke-security-validation.sh → deprecated/cfn-invoke-security-validation.sh} +0 -0
- /package/.claude/hooks/{cfn-lint-sql-injection.sh → deprecated/cfn-lint-sql-injection.sh} +0 -0
- /package/.claude/hooks/{cfn-post-edit.sh → deprecated/cfn-post-edit.sh} +0 -0
- /package/.claude/hooks/{cfn-pre-edit-backup.sh → deprecated/cfn-pre-edit-backup.sh} +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{embeddings_manager.py → embeddings_manager.py.backup} +0 -0
- /package/{.ruvector → .claude/skills/cfn-local-ruvector-accelerator/index}/index.bin +0 -0
- /package/{.ruvector → .claude/skills/cfn-local-ruvector-accelerator/index}/metadata.json +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{search_engine_v2.py → search_engine_v2.py.backup} +0 -0
- /package/.claude/skills/cfn-local-ruvector-accelerator/{sqlite_store.py → sqlite_store.py.backup} +0 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
// Transaction-aware migration module with proper error handling and rollback
|
|
2
|
+
use anyhow::{Result, Context, anyhow};
|
|
3
|
+
use rusqlite::{Connection, params, Transaction};
|
|
4
|
+
use tracing::{info, debug, error, warn};
|
|
5
|
+
use std::collections::HashMap;
|
|
6
|
+
|
|
7
|
+
use crate::schema_v2::{SchemaV2, EntityKind, Visibility};
|
|
8
|
+
use crate::search_engine::IndexMetadata;
|
|
9
|
+
|
|
10
|
+
pub struct MigrationWithTx;
|
|
11
|
+
|
|
12
|
+
impl MigrationWithTx {
|
|
13
|
+
pub fn migrate_v1_to_v2_atomic(conn: &mut Connection) -> Result<()> {
|
|
14
|
+
info!("Starting atomic migration from v1 to v2 schema");
|
|
15
|
+
|
|
16
|
+
// Check if v1 tables exist
|
|
17
|
+
let has_v1_tables = conn.prepare(
|
|
18
|
+
"SELECT name FROM sqlite_master WHERE type='table' AND name IN ('embeddings', 'files')"
|
|
19
|
+
)?.exists([])?;
|
|
20
|
+
|
|
21
|
+
if !has_v1_tables {
|
|
22
|
+
info!("No v1 tables found, skipping migration");
|
|
23
|
+
return Ok(());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Use a transaction for atomic operations
|
|
27
|
+
let tx = conn.transaction()?;
|
|
28
|
+
|
|
29
|
+
// Ensure atomic migration - if anything fails, rollback everything
|
|
30
|
+
let migration_result = (|| {
|
|
31
|
+
// Step 1: Create new v2 schema
|
|
32
|
+
info!("Creating v2 schema");
|
|
33
|
+
SchemaV2::initialize(&tx)?;
|
|
34
|
+
|
|
35
|
+
// Step 2: Migrate file data
|
|
36
|
+
info!("Migrating file metadata");
|
|
37
|
+
Self::migrate_files(&tx)?;
|
|
38
|
+
|
|
39
|
+
// Step 3: Migrate embeddings and entities in batches
|
|
40
|
+
info!("Migrating embeddings and extracting entities");
|
|
41
|
+
Self::migrate_embeddings_batch(&tx)?;
|
|
42
|
+
|
|
43
|
+
// Step 4: Create backup of old tables and drop them
|
|
44
|
+
info!("Creating backup of v1 tables");
|
|
45
|
+
tx.execute_batch(
|
|
46
|
+
r#"
|
|
47
|
+
ALTER TABLE embeddings RENAME TO embeddings_v1_backup;
|
|
48
|
+
ALTER TABLE files RENAME TO files_v1_backup;
|
|
49
|
+
"#
|
|
50
|
+
)?;
|
|
51
|
+
|
|
52
|
+
Ok::<(), anyhow::Error>(())
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
match migration_result {
|
|
56
|
+
Ok(()) => {
|
|
57
|
+
tx.commit()?;
|
|
58
|
+
info!("Migration from v1 to v2 completed successfully");
|
|
59
|
+
Ok(())
|
|
60
|
+
}
|
|
61
|
+
Err(e) => {
|
|
62
|
+
error!("Migration failed: {}. Rolling back changes.", e);
|
|
63
|
+
tx.rollback()?;
|
|
64
|
+
Err(anyhow!("Migration failed and was rolled back: {}", e))
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
fn migrate_files(tx: &Transaction) -> Result<()> {
|
|
70
|
+
// First check if old_files table exists
|
|
71
|
+
let old_files_exists = tx.prepare(
|
|
72
|
+
"SELECT 1 FROM sqlite_master WHERE type='table' AND name='old_files'"
|
|
73
|
+
)?.exists([])?;
|
|
74
|
+
|
|
75
|
+
if !old_files_exists {
|
|
76
|
+
warn!("old_files table not found, skipping file migration");
|
|
77
|
+
return Ok(());
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Backup the old files table first
|
|
81
|
+
tx.execute("CREATE TEMPORARY TABLE files_backup AS SELECT * FROM old_files", [])?;
|
|
82
|
+
|
|
83
|
+
// Migrate in batches to avoid long-running transactions
|
|
84
|
+
let batch_size = 1000;
|
|
85
|
+
let mut offset = 0;
|
|
86
|
+
let mut migrated_count = 0;
|
|
87
|
+
|
|
88
|
+
loop {
|
|
89
|
+
let mut stmt = tx.prepare(
|
|
90
|
+
"SELECT path, hash, last_indexed, patterns_count FROM old_files LIMIT ? OFFSET ?"
|
|
91
|
+
)?;
|
|
92
|
+
|
|
93
|
+
let mut rows = stmt.query([batch_size, offset])?;
|
|
94
|
+
let mut batch_count = 0usize;
|
|
95
|
+
|
|
96
|
+
while let Some(row) = rows.next()? {
|
|
97
|
+
let path: String = row.get(0)?;
|
|
98
|
+
let hash: String = row.get(1)?;
|
|
99
|
+
let last_indexed: Option<u64> = row.get(2)?;
|
|
100
|
+
let patterns_count: Option<u32> = row.get(3)?;
|
|
101
|
+
|
|
102
|
+
tx.execute(
|
|
103
|
+
"INSERT OR IGNORE INTO files (path, hash, last_indexed, patterns_count) VALUES (?1, ?2, ?3, ?4)",
|
|
104
|
+
params![path, hash, last_indexed, patterns_count]
|
|
105
|
+
)?;
|
|
106
|
+
batch_count += 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
migrated_count += batch_count;
|
|
110
|
+
|
|
111
|
+
if batch_count < batch_size {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
offset += batch_size;
|
|
116
|
+
debug!("Migrated {} files so far...", migrated_count);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
info!("Migrated {} files", migrated_count);
|
|
120
|
+
Ok(())
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
fn migrate_embeddings_batch(tx: &Transaction) -> Result<()> {
|
|
124
|
+
// First check if old_embeddings table exists
|
|
125
|
+
let old_embeddings_exists = tx.prepare(
|
|
126
|
+
"SELECT 1 FROM sqlite_master WHERE type='table' AND name='old_embeddings'"
|
|
127
|
+
)?.exists([])?;
|
|
128
|
+
|
|
129
|
+
if !old_embeddings_exists {
|
|
130
|
+
warn!("old_embeddings table not found, skipping embedding migration");
|
|
131
|
+
return Ok(());
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Prepare statements for batch operations
|
|
135
|
+
let mut insert_entity_stmt = tx.prepare(
|
|
136
|
+
r#"
|
|
137
|
+
INSERT INTO entities (
|
|
138
|
+
kind, name, signature, visibility, file_path, line_number, created_at
|
|
139
|
+
) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
|
|
140
|
+
RETURNING id
|
|
141
|
+
"#
|
|
142
|
+
)?;
|
|
143
|
+
|
|
144
|
+
let mut insert_embedding_stmt = tx.prepare(
|
|
145
|
+
"INSERT INTO entity_embeddings (entity_id, embedding, embedding_model) VALUES (?1, ?2, ?3)"
|
|
146
|
+
)?;
|
|
147
|
+
|
|
148
|
+
// Migration statistics
|
|
149
|
+
let mut total_count = 0;
|
|
150
|
+
let mut success_count = 0;
|
|
151
|
+
let mut error_count = 0;
|
|
152
|
+
let batch_size = 100;
|
|
153
|
+
|
|
154
|
+
// Get total count for progress reporting
|
|
155
|
+
let total_embeddings: u64 = tx.query_row(
|
|
156
|
+
"SELECT COUNT(*) FROM old_embeddings",
|
|
157
|
+
[],
|
|
158
|
+
|row| row.get(0)
|
|
159
|
+
).unwrap_or(0);
|
|
160
|
+
|
|
161
|
+
info!("Migrating {} embeddings", total_embeddings);
|
|
162
|
+
|
|
163
|
+
// Process in batches
|
|
164
|
+
let mut offset = 0;
|
|
165
|
+
loop {
|
|
166
|
+
let mut stmt = tx.prepare(
|
|
167
|
+
"SELECT id, pattern, embedding, metadata, created_at, file_hash FROM old_embeddings LIMIT ? OFFSET ?"
|
|
168
|
+
)?;
|
|
169
|
+
|
|
170
|
+
let mut rows = stmt.query([batch_size, offset])?;
|
|
171
|
+
let mut batch_count = 0;
|
|
172
|
+
let mut batch_success = 0;
|
|
173
|
+
|
|
174
|
+
while let Some(row) = rows.next()? {
|
|
175
|
+
let old_id: i64 = row.get(0)?;
|
|
176
|
+
let pattern: String = row.get(1)?;
|
|
177
|
+
let embedding: Vec<u8> = row.get(2)?;
|
|
178
|
+
let metadata: String = row.get(3)?;
|
|
179
|
+
let created_at: u64 = row.get(4)?;
|
|
180
|
+
let _file_hash: String = row.get(5)?;
|
|
181
|
+
|
|
182
|
+
batch_count += 1;
|
|
183
|
+
|
|
184
|
+
// Parse metadata to extract entity information
|
|
185
|
+
match serde_json::from_str::<IndexMetadata>(&metadata) {
|
|
186
|
+
Ok(index_metadata) => {
|
|
187
|
+
// Try to extract entity information
|
|
188
|
+
let kind = Self::infer_entity_kind(&pattern);
|
|
189
|
+
let name = Self::extract_entity_name(&pattern, kind.as_str());
|
|
190
|
+
let visibility = Self::infer_visibility(&pattern);
|
|
191
|
+
|
|
192
|
+
// Insert entity
|
|
193
|
+
let entity_id = insert_entity_stmt.query_row(
|
|
194
|
+
params![
|
|
195
|
+
kind.as_str(),
|
|
196
|
+
name,
|
|
197
|
+
pattern,
|
|
198
|
+
visibility.as_str(),
|
|
199
|
+
index_metadata.path,
|
|
200
|
+
index_metadata.line_number.unwrap_or(0) as i64,
|
|
201
|
+
created_at
|
|
202
|
+
],
|
|
203
|
+
|row| row.get::<_, i64>(0)
|
|
204
|
+
)?;
|
|
205
|
+
|
|
206
|
+
// Insert embedding
|
|
207
|
+
insert_embedding_stmt.execute(
|
|
208
|
+
params![entity_id, embedding, "text-embedding-ada-002"]
|
|
209
|
+
)?;
|
|
210
|
+
|
|
211
|
+
batch_success += 1;
|
|
212
|
+
success_count += 1;
|
|
213
|
+
}
|
|
214
|
+
Err(e) => {
|
|
215
|
+
// Try to create a basic entity even if metadata parsing fails
|
|
216
|
+
warn!("Failed to parse metadata for embedding {}: {}. Creating basic entity.", old_id, e);
|
|
217
|
+
|
|
218
|
+
let kind = EntityKind::Function; // Default
|
|
219
|
+
let name = Self::extract_entity_name(&pattern, kind.as_str());
|
|
220
|
+
let visibility = Visibility::Public;
|
|
221
|
+
let file_path = "unknown".to_string();
|
|
222
|
+
let line_number = 0i64;
|
|
223
|
+
|
|
224
|
+
// Insert basic entity
|
|
225
|
+
let entity_id = insert_entity_stmt.query_row(
|
|
226
|
+
params![
|
|
227
|
+
kind.as_str(),
|
|
228
|
+
name,
|
|
229
|
+
pattern,
|
|
230
|
+
visibility.as_str(),
|
|
231
|
+
file_path,
|
|
232
|
+
line_number,
|
|
233
|
+
created_at
|
|
234
|
+
],
|
|
235
|
+
|row| row.get::<_, i64>(0)
|
|
236
|
+
)?;
|
|
237
|
+
|
|
238
|
+
// Insert embedding
|
|
239
|
+
insert_embedding_stmt.execute(
|
|
240
|
+
params![entity_id, embedding, "text-embedding-ada-002"]
|
|
241
|
+
)?;
|
|
242
|
+
|
|
243
|
+
batch_success += 1;
|
|
244
|
+
success_count += 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
total_count += batch_count;
|
|
250
|
+
let batch_errors = batch_count - batch_success;
|
|
251
|
+
error_count += batch_errors;
|
|
252
|
+
|
|
253
|
+
if batch_count == 0 {
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
offset += batch_size;
|
|
258
|
+
|
|
259
|
+
// Progress reporting
|
|
260
|
+
if total_count % (batch_size * 10) == 0 {
|
|
261
|
+
info!("Migration progress: {}/{} embeddings ({:.1}%), {} errors",
|
|
262
|
+
total_count, total_embeddings,
|
|
263
|
+
(total_count as f64 / total_embeddings as f64) * 100.0,
|
|
264
|
+
error_count);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
info!("Migration completed: {} total, {} successful, {} errors",
|
|
269
|
+
total_count, success_count, error_count);
|
|
270
|
+
|
|
271
|
+
if error_count > 0 {
|
|
272
|
+
warn!("Migration completed with {} errors", error_count);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
Ok(())
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
fn infer_entity_kind(pattern: &str) -> EntityKind {
|
|
279
|
+
// Enhanced heuristic to infer entity kind from pattern
|
|
280
|
+
let pattern_lower = pattern.to_lowercase();
|
|
281
|
+
|
|
282
|
+
if pattern.starts_with("struct ") || pattern_lower.contains(" struct ") {
|
|
283
|
+
EntityKind::Struct
|
|
284
|
+
} else if pattern.starts_with("enum ") || pattern_lower.contains(" enum ") {
|
|
285
|
+
EntityKind::Enum
|
|
286
|
+
} else if pattern.starts_with("fn ") || pattern_lower.contains(" fn ") {
|
|
287
|
+
EntityKind::Function
|
|
288
|
+
} else if pattern.starts_with("impl ") || pattern_lower.contains(" impl ") {
|
|
289
|
+
EntityKind::Impl
|
|
290
|
+
} else if pattern.starts_with("trait ") || pattern_lower.contains(" trait ") {
|
|
291
|
+
EntityKind::Trait
|
|
292
|
+
} else if pattern.starts_with("mod ") || pattern_lower.contains(" mod ") {
|
|
293
|
+
EntityKind::Module
|
|
294
|
+
} else if pattern.starts_with("const ") || pattern_lower.contains(" const ") {
|
|
295
|
+
EntityKind::Constant
|
|
296
|
+
} else if pattern.starts_with("static ") || pattern_lower.contains(" static ") {
|
|
297
|
+
EntityKind::Static
|
|
298
|
+
} else if pattern.starts_with("type ") || pattern_lower.contains(" type ") {
|
|
299
|
+
EntityKind::TypeAlias
|
|
300
|
+
} else if pattern.starts_with("macro_rules!") || pattern_lower.contains("macro_rules!") {
|
|
301
|
+
EntityKind::Macro
|
|
302
|
+
} else if pattern.starts_with("class ") || pattern_lower.contains(" class ") {
|
|
303
|
+
EntityKind::Class
|
|
304
|
+
} else if pattern.starts_with("interface ") || pattern_lower.contains(" interface ") {
|
|
305
|
+
EntityKind::Interface
|
|
306
|
+
} else if pattern_lower.contains("->") || pattern_lower.contains("return") {
|
|
307
|
+
EntityKind::Function // Likely a function/method
|
|
308
|
+
} else if pattern_lower.contains("{") && pattern_lower.contains("}") {
|
|
309
|
+
EntityKind::Struct // Could be a struct definition
|
|
310
|
+
} else {
|
|
311
|
+
EntityKind::Function // Default fallback
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
fn extract_entity_name(pattern: &str, kind: &str) -> String {
|
|
316
|
+
// Enhanced name extraction logic
|
|
317
|
+
let pattern = pattern.trim();
|
|
318
|
+
|
|
319
|
+
// Look for specific patterns based on kind
|
|
320
|
+
match kind {
|
|
321
|
+
"struct" | "enum" | "trait" | "impl" | "mod" | "class" | "interface" => {
|
|
322
|
+
let keyword = if kind == "impl" { "impl" } else { kind };
|
|
323
|
+
if let Some(start) = pattern.find(keyword) {
|
|
324
|
+
let after = &pattern[start + keyword.len()..].trim();
|
|
325
|
+
|
|
326
|
+
// Handle impl special cases (impl Trait for Struct)
|
|
327
|
+
if kind == "impl" {
|
|
328
|
+
if let Some(for_pos) = after.find("for") {
|
|
329
|
+
let before_for = &after[..for_pos].trim();
|
|
330
|
+
if let Some(end) = before_for.find(['<', '{']) {
|
|
331
|
+
return before_for[..end].trim().to_string();
|
|
332
|
+
}
|
|
333
|
+
return before_for.split_whitespace().next().unwrap_or("").to_string();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Extract name before any < or { or : or (
|
|
338
|
+
if let Some(end) = after.find(['<', '{', ':', '(', ' ']) {
|
|
339
|
+
after[..end].trim().to_string()
|
|
340
|
+
} else {
|
|
341
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
342
|
+
}
|
|
343
|
+
} else {
|
|
344
|
+
// Try to extract using regex as fallback
|
|
345
|
+
Self::extract_name_fallback(pattern)
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"function" | "method" => {
|
|
349
|
+
if let Some(start) = pattern.find("fn ") {
|
|
350
|
+
let after = &pattern[start + 3..].trim();
|
|
351
|
+
// Extract function name before (
|
|
352
|
+
if let Some(end) = after.find('(') {
|
|
353
|
+
after[..end].trim().to_string()
|
|
354
|
+
} else {
|
|
355
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
// Try to find any identifier followed by (
|
|
359
|
+
if let Some(paren) = pattern.find('(') {
|
|
360
|
+
let before = &pattern[..paren].trim();
|
|
361
|
+
before.split_whitespace().last().unwrap_or("unknown").to_string()
|
|
362
|
+
} else {
|
|
363
|
+
Self::extract_name_fallback(pattern)
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"constant" | "static" => {
|
|
368
|
+
let keyword = if pattern.starts_with("const ") { "const " } else { "static " };
|
|
369
|
+
if let Some(start) = pattern.find(keyword) {
|
|
370
|
+
let after = &pattern[start + keyword.len()..].trim();
|
|
371
|
+
// Extract name before :
|
|
372
|
+
if let Some(end) = after.find(':') {
|
|
373
|
+
after[..end].trim().to_string()
|
|
374
|
+
} else {
|
|
375
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
376
|
+
}
|
|
377
|
+
} else {
|
|
378
|
+
Self::extract_name_fallback(pattern)
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"typealias" => {
|
|
382
|
+
if let Some(start) = pattern.find("type ") {
|
|
383
|
+
let after = &pattern[start + 5..].trim();
|
|
384
|
+
// Extract name before =
|
|
385
|
+
if let Some(end) = after.find('=') {
|
|
386
|
+
after[..end].trim().to_string()
|
|
387
|
+
} else {
|
|
388
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
389
|
+
}
|
|
390
|
+
} else {
|
|
391
|
+
Self::extract_name_fallback(pattern)
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
_ => Self::extract_name_fallback(pattern),
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
fn extract_name_fallback(pattern: &str) -> String {
|
|
399
|
+
// Fallback: extract the first camel case or snake_case identifier
|
|
400
|
+
use regex::Regex;
|
|
401
|
+
|
|
402
|
+
if let Ok(re) = Regex::new(r"[a-zA-Z_][a-zA-Z0-9_]*") {
|
|
403
|
+
if let Some(m) = re.find(pattern) {
|
|
404
|
+
m.as_str().to_string()
|
|
405
|
+
} else {
|
|
406
|
+
"unknown".to_string()
|
|
407
|
+
}
|
|
408
|
+
} else {
|
|
409
|
+
"unknown".to_string()
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
fn infer_visibility(pattern: &str) -> Visibility {
|
|
414
|
+
// Infer visibility from pattern
|
|
415
|
+
if pattern.contains("pub ") || pattern.starts_with("pub ") {
|
|
416
|
+
Visibility::Public
|
|
417
|
+
} else if pattern.contains("pub(crate)") {
|
|
418
|
+
Visibility::Private // Limited to crate
|
|
419
|
+
} else if pattern.contains("pub(super)") {
|
|
420
|
+
Visibility::Private // Limited to parent module
|
|
421
|
+
} else {
|
|
422
|
+
Visibility::Private // Default to private
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/// Validates migration was successful
|
|
427
|
+
pub fn validate_migration(conn: &Connection) -> Result<()> {
|
|
428
|
+
info!("Validating migration results");
|
|
429
|
+
|
|
430
|
+
// Check if v2 tables exist
|
|
431
|
+
let v2_tables = [
|
|
432
|
+
"entities", "refs", "type_usage", "modules",
|
|
433
|
+
"entity_embeddings", "files", "file_hashes"
|
|
434
|
+
];
|
|
435
|
+
|
|
436
|
+
for table in &v2_tables {
|
|
437
|
+
let exists = conn.prepare(
|
|
438
|
+
"SELECT 1 FROM sqlite_master WHERE type='table' AND name=?"
|
|
439
|
+
)?.exists([table])?;
|
|
440
|
+
|
|
441
|
+
if !exists {
|
|
442
|
+
return Err(anyhow!("Missing v2 table: {}", table));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Check data integrity
|
|
447
|
+
let entity_count: u64 = conn.query_row(
|
|
448
|
+
"SELECT COUNT(*) FROM entities",
|
|
449
|
+
[],
|
|
450
|
+
|row| row.get(0)
|
|
451
|
+
)?;
|
|
452
|
+
|
|
453
|
+
let embedding_count: u64 = conn.query_row(
|
|
454
|
+
"SELECT COUNT(*) FROM entity_embeddings",
|
|
455
|
+
[],
|
|
456
|
+
|row| row.get(0)
|
|
457
|
+
)?;
|
|
458
|
+
|
|
459
|
+
// Check if all embeddings have corresponding entities
|
|
460
|
+
let orphaned_embeddings: u64 = conn.query_row(
|
|
461
|
+
"SELECT COUNT(*) FROM entity_embeddings ee LEFT JOIN entities e ON ee.entity_id = e.id WHERE e.id IS NULL",
|
|
462
|
+
[],
|
|
463
|
+
|row| row.get(0)
|
|
464
|
+
)?;
|
|
465
|
+
|
|
466
|
+
if orphaned_embeddings > 0 {
|
|
467
|
+
warn!("Found {} orphaned embeddings", orphaned_embeddings);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
info!("Migration validation complete: {} entities, {} embeddings",
|
|
471
|
+
entity_count, embedding_count);
|
|
472
|
+
|
|
473
|
+
Ok(())
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
#[cfg(test)]
|
|
478
|
+
mod tests {
|
|
479
|
+
use super::*;
|
|
480
|
+
use tempfile::tempdir;
|
|
481
|
+
|
|
482
|
+
#[test]
|
|
483
|
+
fn test_entity_name_extraction() {
|
|
484
|
+
// Test various patterns
|
|
485
|
+
assert_eq!(
|
|
486
|
+
MigrationWithTx::extract_entity_name("struct MyStruct { field: i32 }", "struct"),
|
|
487
|
+
"MyStruct"
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
assert_eq!(
|
|
491
|
+
MigrationWithTx::extract_entity_name("fn my_function() -> Result<()>", "function"),
|
|
492
|
+
"my_function"
|
|
493
|
+
);
|
|
494
|
+
|
|
495
|
+
assert_eq!(
|
|
496
|
+
MigrationWithTx::extract_entity_name("impl MyTrait for MyStruct", "impl"),
|
|
497
|
+
"MyTrait"
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#[test]
|
|
502
|
+
fn test_visibility_inference() {
|
|
503
|
+
assert_eq!(
|
|
504
|
+
MigrationWithTx::infer_visibility("pub fn public_function()"),
|
|
505
|
+
Visibility::Public
|
|
506
|
+
);
|
|
507
|
+
|
|
508
|
+
assert_eq!(
|
|
509
|
+
MigrationWithTx::infer_visibility("fn private_function()"),
|
|
510
|
+
Visibility::Private
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Centralized path management for RuVector index
|
|
2
|
+
use std::path::PathBuf;
|
|
3
|
+
use anyhow::{Result, Context};
|
|
4
|
+
|
|
5
|
+
/// Get the centralized RuVector directory
|
|
6
|
+
/// Location: ~/.local/share/ruvector/
|
|
7
|
+
pub fn get_ruvector_dir() -> Result<PathBuf> {
|
|
8
|
+
let home = std::env::var("HOME")
|
|
9
|
+
.context("HOME environment variable not set")?;
|
|
10
|
+
|
|
11
|
+
let ruvector_dir = PathBuf::from(home)
|
|
12
|
+
.join(".local")
|
|
13
|
+
.join("share")
|
|
14
|
+
.join("ruvector");
|
|
15
|
+
|
|
16
|
+
Ok(ruvector_dir)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Get the centralized database path
|
|
20
|
+
/// Location: ~/.local/share/ruvector/index_v2.db
|
|
21
|
+
pub fn get_database_path() -> Result<PathBuf> {
|
|
22
|
+
Ok(get_ruvector_dir()?.join("index_v2.db"))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// Get the legacy V1 index path (for migration)
|
|
26
|
+
/// Location: ~/.local/share/ruvector/index/
|
|
27
|
+
pub fn get_v1_index_dir() -> Result<PathBuf> {
|
|
28
|
+
Ok(get_ruvector_dir()?.join("index"))
|
|
29
|
+
}
|