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,603 @@
|
|
|
1
|
+
use anyhow::{Result, Context};
|
|
2
|
+
use rusqlite::{Connection, params};
|
|
3
|
+
use std::path::Path;
|
|
4
|
+
use tracing::{info, debug, error};
|
|
5
|
+
use serde::{Serialize, Deserialize};
|
|
6
|
+
|
|
7
|
+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
|
8
|
+
pub enum EntityKind {
|
|
9
|
+
// Rust entities
|
|
10
|
+
Struct,
|
|
11
|
+
Enum,
|
|
12
|
+
Function,
|
|
13
|
+
Method,
|
|
14
|
+
Trait,
|
|
15
|
+
Impl,
|
|
16
|
+
Module,
|
|
17
|
+
Constant,
|
|
18
|
+
Static,
|
|
19
|
+
TypeAlias,
|
|
20
|
+
Macro,
|
|
21
|
+
|
|
22
|
+
// TypeScript entities
|
|
23
|
+
Class,
|
|
24
|
+
Interface,
|
|
25
|
+
Type,
|
|
26
|
+
Variable,
|
|
27
|
+
Parameter,
|
|
28
|
+
Property,
|
|
29
|
+
Constructor,
|
|
30
|
+
Getter,
|
|
31
|
+
Setter,
|
|
32
|
+
Namespace,
|
|
33
|
+
Import,
|
|
34
|
+
|
|
35
|
+
// Generic
|
|
36
|
+
File,
|
|
37
|
+
Package,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
impl EntityKind {
|
|
41
|
+
pub fn from_str(s: &str) -> Option<Self> {
|
|
42
|
+
match s {
|
|
43
|
+
"struct" => Some(EntityKind::Struct),
|
|
44
|
+
"enum" => Some(EntityKind::Enum),
|
|
45
|
+
"function" => Some(EntityKind::Function),
|
|
46
|
+
"method" => Some(EntityKind::Method),
|
|
47
|
+
"trait" => Some(EntityKind::Trait),
|
|
48
|
+
"impl" => Some(EntityKind::Impl),
|
|
49
|
+
"module" => Some(EntityKind::Module),
|
|
50
|
+
"constant" => Some(EntityKind::Constant),
|
|
51
|
+
"static" => Some(EntityKind::Static),
|
|
52
|
+
"type_alias" => Some(EntityKind::TypeAlias),
|
|
53
|
+
"macro" => Some(EntityKind::Macro),
|
|
54
|
+
"class" => Some(EntityKind::Class),
|
|
55
|
+
"interface" => Some(EntityKind::Interface),
|
|
56
|
+
"type" => Some(EntityKind::Type),
|
|
57
|
+
"variable" => Some(EntityKind::Variable),
|
|
58
|
+
"parameter" => Some(EntityKind::Parameter),
|
|
59
|
+
"property" => Some(EntityKind::Property),
|
|
60
|
+
"constructor" => Some(EntityKind::Constructor),
|
|
61
|
+
"getter" => Some(EntityKind::Getter),
|
|
62
|
+
"setter" => Some(EntityKind::Setter),
|
|
63
|
+
"namespace" => Some(EntityKind::Namespace),
|
|
64
|
+
"import" => Some(EntityKind::Import),
|
|
65
|
+
"file" => Some(EntityKind::File),
|
|
66
|
+
"package" => Some(EntityKind::Package),
|
|
67
|
+
_ => None,
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
pub fn as_str(&self) -> &'static str {
|
|
72
|
+
match self {
|
|
73
|
+
EntityKind::Struct => "struct",
|
|
74
|
+
EntityKind::Enum => "enum",
|
|
75
|
+
EntityKind::Function => "function",
|
|
76
|
+
EntityKind::Method => "method",
|
|
77
|
+
EntityKind::Trait => "trait",
|
|
78
|
+
EntityKind::Impl => "impl",
|
|
79
|
+
EntityKind::Module => "module",
|
|
80
|
+
EntityKind::Constant => "constant",
|
|
81
|
+
EntityKind::Static => "static",
|
|
82
|
+
EntityKind::TypeAlias => "type_alias",
|
|
83
|
+
EntityKind::Macro => "macro",
|
|
84
|
+
EntityKind::Class => "class",
|
|
85
|
+
EntityKind::Interface => "interface",
|
|
86
|
+
EntityKind::Type => "type",
|
|
87
|
+
EntityKind::Variable => "variable",
|
|
88
|
+
EntityKind::Parameter => "parameter",
|
|
89
|
+
EntityKind::Property => "property",
|
|
90
|
+
EntityKind::Constructor => "constructor",
|
|
91
|
+
EntityKind::Getter => "getter",
|
|
92
|
+
EntityKind::Setter => "setter",
|
|
93
|
+
EntityKind::Namespace => "namespace",
|
|
94
|
+
EntityKind::Import => "import",
|
|
95
|
+
EntityKind::File => "file",
|
|
96
|
+
EntityKind::Package => "package",
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
102
|
+
pub enum RefKind {
|
|
103
|
+
Call,
|
|
104
|
+
Calls,
|
|
105
|
+
Import,
|
|
106
|
+
Imports,
|
|
107
|
+
Extend,
|
|
108
|
+
Extends,
|
|
109
|
+
Implement,
|
|
110
|
+
Implements,
|
|
111
|
+
Reference,
|
|
112
|
+
Use,
|
|
113
|
+
Uses,
|
|
114
|
+
Instantiates,
|
|
115
|
+
Overrides,
|
|
116
|
+
Reads,
|
|
117
|
+
Writes,
|
|
118
|
+
TypeParameter,
|
|
119
|
+
GenericConstraint,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
impl RefKind {
|
|
123
|
+
pub fn from_str(s: &str) -> Option<Self> {
|
|
124
|
+
match s {
|
|
125
|
+
"call" => Some(RefKind::Call),
|
|
126
|
+
"calls" => Some(RefKind::Calls),
|
|
127
|
+
"import" => Some(RefKind::Import),
|
|
128
|
+
"imports" => Some(RefKind::Imports),
|
|
129
|
+
"extend" => Some(RefKind::Extend),
|
|
130
|
+
"extends" => Some(RefKind::Extends),
|
|
131
|
+
"implement" => Some(RefKind::Implement),
|
|
132
|
+
"implements" => Some(RefKind::Implements),
|
|
133
|
+
"reference" => Some(RefKind::Reference),
|
|
134
|
+
"use" => Some(RefKind::Use),
|
|
135
|
+
"uses" => Some(RefKind::Uses),
|
|
136
|
+
"instantiates" => Some(RefKind::Instantiates),
|
|
137
|
+
"overrides" => Some(RefKind::Overrides),
|
|
138
|
+
"reads" => Some(RefKind::Reads),
|
|
139
|
+
"writes" => Some(RefKind::Writes),
|
|
140
|
+
"type_parameter" => Some(RefKind::TypeParameter),
|
|
141
|
+
"generic_constraint" => Some(RefKind::GenericConstraint),
|
|
142
|
+
_ => None,
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
pub fn as_str(&self) -> &'static str {
|
|
147
|
+
match self {
|
|
148
|
+
RefKind::Call => "call",
|
|
149
|
+
RefKind::Calls => "calls",
|
|
150
|
+
RefKind::Import => "import",
|
|
151
|
+
RefKind::Imports => "imports",
|
|
152
|
+
RefKind::Extend => "extend",
|
|
153
|
+
RefKind::Extends => "extends",
|
|
154
|
+
RefKind::Implement => "implement",
|
|
155
|
+
RefKind::Implements => "implements",
|
|
156
|
+
RefKind::Reference => "reference",
|
|
157
|
+
RefKind::Use => "use",
|
|
158
|
+
RefKind::Uses => "uses",
|
|
159
|
+
RefKind::Instantiates => "instantiates",
|
|
160
|
+
RefKind::Overrides => "overrides",
|
|
161
|
+
RefKind::Reads => "reads",
|
|
162
|
+
RefKind::Writes => "writes",
|
|
163
|
+
RefKind::TypeParameter => "type_parameter",
|
|
164
|
+
RefKind::GenericConstraint => "generic_constraint",
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
170
|
+
pub enum Visibility {
|
|
171
|
+
Public,
|
|
172
|
+
Private,
|
|
173
|
+
Protected,
|
|
174
|
+
Crate,
|
|
175
|
+
Internal,
|
|
176
|
+
FilePrivate,
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
impl Visibility {
|
|
180
|
+
pub fn from_str(s: &str) -> Option<Self> {
|
|
181
|
+
match s {
|
|
182
|
+
"public" => Some(Visibility::Public),
|
|
183
|
+
"private" => Some(Visibility::Private),
|
|
184
|
+
"protected" => Some(Visibility::Protected),
|
|
185
|
+
"crate" => Some(Visibility::Crate),
|
|
186
|
+
"internal" => Some(Visibility::Internal),
|
|
187
|
+
"file_private" => Some(Visibility::FilePrivate),
|
|
188
|
+
_ => None,
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
pub fn as_str(&self) -> &'static str {
|
|
193
|
+
match self {
|
|
194
|
+
Visibility::Public => "public",
|
|
195
|
+
Visibility::Private => "private",
|
|
196
|
+
Visibility::Protected => "protected",
|
|
197
|
+
Visibility::Crate => "crate",
|
|
198
|
+
Visibility::Internal => "internal",
|
|
199
|
+
Visibility::FilePrivate => "file_private",
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
pub struct SchemaV2;
|
|
205
|
+
|
|
206
|
+
impl SchemaV2 {
|
|
207
|
+
pub fn initialize(conn: &Connection) -> Result<()> {
|
|
208
|
+
info!("Initializing Schema v2 with entity-based design");
|
|
209
|
+
|
|
210
|
+
// Execute schema creation directly on the connection
|
|
211
|
+
// The caller is responsible for transaction management
|
|
212
|
+
|
|
213
|
+
// Create entities table - core table for all code entities
|
|
214
|
+
conn.execute_batch(
|
|
215
|
+
r#"
|
|
216
|
+
CREATE TABLE IF NOT EXISTS entities (
|
|
217
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
218
|
+
kind TEXT NOT NULL,
|
|
219
|
+
name TEXT NOT NULL,
|
|
220
|
+
signature TEXT,
|
|
221
|
+
visibility TEXT NOT NULL DEFAULT 'private',
|
|
222
|
+
parent_id INTEGER,
|
|
223
|
+
file_path TEXT NOT NULL,
|
|
224
|
+
line_number INTEGER NOT NULL,
|
|
225
|
+
column_number INTEGER,
|
|
226
|
+
doc_comment TEXT,
|
|
227
|
+
attributes TEXT,
|
|
228
|
+
metadata TEXT,
|
|
229
|
+
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
230
|
+
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
231
|
+
|
|
232
|
+
FOREIGN KEY (parent_id) REFERENCES entities(id) ON DELETE CASCADE
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
-- Create refs table for cross-file and intra-file references
|
|
236
|
+
-- Note: target_entity_id can be 0 for unresolved references
|
|
237
|
+
CREATE TABLE IF NOT EXISTS refs (
|
|
238
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
239
|
+
source_entity_id INTEGER NOT NULL,
|
|
240
|
+
target_entity_id INTEGER NOT NULL DEFAULT 0,
|
|
241
|
+
target_name TEXT,
|
|
242
|
+
ref_kind TEXT NOT NULL,
|
|
243
|
+
file_path TEXT NOT NULL,
|
|
244
|
+
line_number INTEGER NOT NULL,
|
|
245
|
+
column_number INTEGER,
|
|
246
|
+
context TEXT,
|
|
247
|
+
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
-- Create type_usage table for tracking type usage in functions/methods
|
|
251
|
+
CREATE TABLE IF NOT EXISTS type_usage (
|
|
252
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
253
|
+
entity_id INTEGER NOT NULL,
|
|
254
|
+
type_name TEXT NOT NULL,
|
|
255
|
+
usage_kind TEXT NOT NULL, -- 'parameter', 'return_type', 'local_var', 'field'
|
|
256
|
+
file_path TEXT NOT NULL,
|
|
257
|
+
line_number INTEGER NOT NULL,
|
|
258
|
+
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
259
|
+
|
|
260
|
+
FOREIGN KEY (entity_id) REFERENCES entities(id) ON DELETE CASCADE
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
-- Create modules table for import/export tracking
|
|
264
|
+
CREATE TABLE IF NOT EXISTS modules (
|
|
265
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
266
|
+
name TEXT NOT NULL UNIQUE,
|
|
267
|
+
file_path TEXT NOT NULL,
|
|
268
|
+
module_type TEXT NOT NULL, -- 'mod', 'package', 'namespace'
|
|
269
|
+
is_root BOOLEAN NOT NULL DEFAULT FALSE,
|
|
270
|
+
parent_module_id INTEGER,
|
|
271
|
+
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
272
|
+
|
|
273
|
+
FOREIGN KEY (parent_module_id) REFERENCES modules(id) ON DELETE CASCADE
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
-- Create entity_embeddings table for vector search
|
|
277
|
+
CREATE TABLE IF NOT EXISTS entity_embeddings (
|
|
278
|
+
entity_id INTEGER PRIMARY KEY,
|
|
279
|
+
embedding BLOB NOT NULL,
|
|
280
|
+
embedding_model TEXT NOT NULL,
|
|
281
|
+
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
282
|
+
|
|
283
|
+
FOREIGN KEY (entity_id) REFERENCES entities(id) ON DELETE CASCADE
|
|
284
|
+
);
|
|
285
|
+
"#
|
|
286
|
+
)?;
|
|
287
|
+
|
|
288
|
+
// Create indexes for performance optimization
|
|
289
|
+
Self::create_indexes(conn)?;
|
|
290
|
+
|
|
291
|
+
// Create triggers for maintaining updated_at timestamps
|
|
292
|
+
Self::create_triggers(conn)?;
|
|
293
|
+
|
|
294
|
+
info!("Schema v2 initialized successfully");
|
|
295
|
+
Ok(())
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
fn create_indexes(conn: &Connection) -> Result<()> {
|
|
299
|
+
debug!("Creating performance indexes");
|
|
300
|
+
|
|
301
|
+
conn.execute_batch(
|
|
302
|
+
r#"
|
|
303
|
+
-- Entity indexes for fast lookups
|
|
304
|
+
CREATE INDEX IF NOT EXISTS idx_entities_kind ON entities(kind);
|
|
305
|
+
CREATE INDEX IF NOT EXISTS idx_entities_name ON entities(name);
|
|
306
|
+
CREATE INDEX IF NOT EXISTS idx_entities_file_path ON entities(file_path);
|
|
307
|
+
CREATE INDEX IF NOT EXISTS idx_entities_parent_id ON entities(parent_id);
|
|
308
|
+
CREATE INDEX IF NOT EXISTS idx_entities_visibility ON entities(visibility);
|
|
309
|
+
|
|
310
|
+
-- Composite indexes for common query patterns
|
|
311
|
+
CREATE INDEX IF NOT EXISTS idx_entities_kind_name ON entities(kind, name);
|
|
312
|
+
CREATE INDEX IF NOT EXISTS idx_entities_file_kind ON entities(file_path, kind);
|
|
313
|
+
CREATE INDEX IF NOT EXISTS idx_entities_parent_kind ON entities(parent_id, kind);
|
|
314
|
+
|
|
315
|
+
-- Reference indexes
|
|
316
|
+
CREATE INDEX IF NOT EXISTS idx_refs_source ON refs(source_entity_id);
|
|
317
|
+
CREATE INDEX IF NOT EXISTS idx_refs_target ON refs(target_entity_id);
|
|
318
|
+
CREATE INDEX IF NOT EXISTS idx_refs_kind ON refs(ref_kind);
|
|
319
|
+
CREATE INDEX IF NOT EXISTS idx_refs_file_path ON refs(file_path);
|
|
320
|
+
|
|
321
|
+
-- Composite reference indexes
|
|
322
|
+
CREATE INDEX IF NOT EXISTS idx_refs_source_kind ON refs(source_entity_id, ref_kind);
|
|
323
|
+
CREATE INDEX IF NOT EXISTS idx_refs_target_kind ON refs(target_entity_id, ref_kind);
|
|
324
|
+
|
|
325
|
+
-- Type usage indexes
|
|
326
|
+
CREATE INDEX IF NOT EXISTS idx_type_usage_entity ON type_usage(entity_id);
|
|
327
|
+
CREATE INDEX IF NOT EXISTS idx_type_usage_type_name ON type_usage(type_name);
|
|
328
|
+
CREATE INDEX IF NOT EXISTS idx_type_usage_kind ON type_usage(usage_kind);
|
|
329
|
+
|
|
330
|
+
-- Composite type usage indexes
|
|
331
|
+
CREATE INDEX IF NOT EXISTS idx_type_usage_type_kind ON type_usage(type_name, usage_kind);
|
|
332
|
+
CREATE INDEX IF NOT EXISTS idx_type_usage_entity_type ON type_usage(entity_id, type_name);
|
|
333
|
+
|
|
334
|
+
-- Module indexes
|
|
335
|
+
CREATE INDEX IF NOT EXISTS idx_modules_name ON modules(name);
|
|
336
|
+
CREATE INDEX IF NOT EXISTS idx_modules_file_path ON modules(file_path);
|
|
337
|
+
CREATE INDEX IF NOT EXISTS idx_modules_parent ON modules(parent_module_id);
|
|
338
|
+
|
|
339
|
+
-- Entity-module relationship index (via file path)
|
|
340
|
+
CREATE INDEX IF NOT EXISTS idx_entities_module_lookup ON entities(file_path);
|
|
341
|
+
"#
|
|
342
|
+
)?;
|
|
343
|
+
|
|
344
|
+
Ok(())
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
fn create_triggers(conn: &Connection) -> Result<()> {
|
|
348
|
+
debug!("Creating database triggers");
|
|
349
|
+
|
|
350
|
+
conn.execute_batch(
|
|
351
|
+
r#"
|
|
352
|
+
-- Trigger to update updated_at timestamp on entity modification
|
|
353
|
+
CREATE TRIGGER IF NOT EXISTS update_entity_timestamp
|
|
354
|
+
AFTER UPDATE ON entities
|
|
355
|
+
FOR EACH ROW
|
|
356
|
+
BEGIN
|
|
357
|
+
UPDATE entities SET updated_at = strftime('%s', 'now') WHERE id = NEW.id;
|
|
358
|
+
END;
|
|
359
|
+
"#
|
|
360
|
+
)?;
|
|
361
|
+
|
|
362
|
+
Ok(())
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/// Migrate from v1 schema to v2 schema
|
|
366
|
+
pub fn migrate_v1_to_v2(conn: &mut Connection) -> Result<()> {
|
|
367
|
+
info!("Starting migration from v1 to v2 schema");
|
|
368
|
+
|
|
369
|
+
// Check if v1 tables exist
|
|
370
|
+
let has_v1_tables = conn.prepare(
|
|
371
|
+
"SELECT name FROM sqlite_master WHERE type='table' AND name IN ('embeddings', 'files')"
|
|
372
|
+
)?.exists([])?;
|
|
373
|
+
|
|
374
|
+
if !has_v1_tables {
|
|
375
|
+
info!("No v1 tables found, skipping migration");
|
|
376
|
+
return Ok(());
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
let tx = conn.transaction()?;
|
|
380
|
+
|
|
381
|
+
// Step 1: Create new v2 schema
|
|
382
|
+
Self::initialize(&tx)?;
|
|
383
|
+
|
|
384
|
+
// Step 2: Migrate file data
|
|
385
|
+
info!("Migrating file metadata");
|
|
386
|
+
tx.execute(
|
|
387
|
+
r#"
|
|
388
|
+
INSERT OR IGNORE INTO files (path, hash, last_indexed, patterns_count)
|
|
389
|
+
SELECT path, hash, last_indexed, patterns_count FROM old_files
|
|
390
|
+
"#,
|
|
391
|
+
[],
|
|
392
|
+
)?;
|
|
393
|
+
|
|
394
|
+
// Step 3: Parse v1 embeddings and extract entities
|
|
395
|
+
info!("Migrating embeddings and extracting entities");
|
|
396
|
+
{
|
|
397
|
+
let mut stmt = tx.prepare(
|
|
398
|
+
"SELECT pattern, embedding, metadata, created_at, file_hash FROM old_embeddings"
|
|
399
|
+
)?;
|
|
400
|
+
|
|
401
|
+
let mut rows = stmt.query([])?;
|
|
402
|
+
while let Some(row) = rows.next()? {
|
|
403
|
+
let pattern: String = row.get(0)?;
|
|
404
|
+
let embedding: Vec<u8> = row.get(1)?;
|
|
405
|
+
let metadata: String = row.get(2)?;
|
|
406
|
+
let created_at: u64 = row.get(3)?;
|
|
407
|
+
let _file_hash: String = row.get(4)?;
|
|
408
|
+
|
|
409
|
+
// Parse metadata to extract entity information
|
|
410
|
+
if let Ok(index_metadata) = serde_json::from_str::<crate::search_engine::IndexMetadata>(&metadata) {
|
|
411
|
+
// Try to extract entity kind from pattern
|
|
412
|
+
let kind = Self::infer_entity_kind(&pattern);
|
|
413
|
+
let name = Self::extract_entity_name(&pattern, kind.as_str());
|
|
414
|
+
let visibility = Self::infer_visibility(&pattern);
|
|
415
|
+
|
|
416
|
+
// Insert entity
|
|
417
|
+
let entity_id = tx.query_row(
|
|
418
|
+
r#"
|
|
419
|
+
INSERT INTO entities (kind, name, signature, visibility, file_path, line_number, created_at)
|
|
420
|
+
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
|
|
421
|
+
RETURNING id
|
|
422
|
+
"#,
|
|
423
|
+
params![
|
|
424
|
+
kind.as_str(),
|
|
425
|
+
name,
|
|
426
|
+
pattern,
|
|
427
|
+
visibility.as_str(),
|
|
428
|
+
index_metadata.path,
|
|
429
|
+
index_metadata.line_number.unwrap_or(0) as i64,
|
|
430
|
+
created_at
|
|
431
|
+
],
|
|
432
|
+
|row| row.get::<_, i64>(0)
|
|
433
|
+
)?;
|
|
434
|
+
|
|
435
|
+
// Insert embedding
|
|
436
|
+
tx.execute(
|
|
437
|
+
"INSERT INTO entity_embeddings (entity_id, embedding, embedding_model) VALUES (?1, ?2, ?3)",
|
|
438
|
+
params![entity_id, embedding, "text-embedding-ada-002"]
|
|
439
|
+
)?;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Step 4: Create backup of old tables and drop them
|
|
445
|
+
info!("Creating backup of v1 tables");
|
|
446
|
+
tx.execute_batch(
|
|
447
|
+
r#"
|
|
448
|
+
ALTER TABLE embeddings RENAME TO embeddings_v1_backup;
|
|
449
|
+
ALTER TABLE files RENAME TO files_v1_backup;
|
|
450
|
+
"#
|
|
451
|
+
)?;
|
|
452
|
+
|
|
453
|
+
tx.commit()?;
|
|
454
|
+
|
|
455
|
+
info!("Migration from v1 to v2 completed successfully");
|
|
456
|
+
Ok(())
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
fn infer_entity_kind(pattern: &str) -> EntityKind {
|
|
460
|
+
// Simple heuristic to infer entity kind from pattern
|
|
461
|
+
if pattern.starts_with("struct ") || pattern.contains(" struct ") {
|
|
462
|
+
EntityKind::Struct
|
|
463
|
+
} else if pattern.starts_with("enum ") || pattern.contains(" enum ") {
|
|
464
|
+
EntityKind::Enum
|
|
465
|
+
} else if pattern.starts_with("fn ") || pattern.contains(" fn ") {
|
|
466
|
+
EntityKind::Function
|
|
467
|
+
} else if pattern.starts_with("impl ") || pattern.contains(" impl ") {
|
|
468
|
+
EntityKind::Impl
|
|
469
|
+
} else if pattern.starts_with("trait ") || pattern.contains(" trait ") {
|
|
470
|
+
EntityKind::Trait
|
|
471
|
+
} else if pattern.starts_with("mod ") || pattern.contains(" mod ") {
|
|
472
|
+
EntityKind::Module
|
|
473
|
+
} else if pattern.starts_with("const ") || pattern.contains(" const ") {
|
|
474
|
+
EntityKind::Constant
|
|
475
|
+
} else if pattern.starts_with("static ") || pattern.contains(" static ") {
|
|
476
|
+
EntityKind::Static
|
|
477
|
+
} else if pattern.starts_with("type ") || pattern.contains(" type ") {
|
|
478
|
+
EntityKind::TypeAlias
|
|
479
|
+
} else if pattern.starts_with("macro_rules!") || pattern.contains("macro_rules!") {
|
|
480
|
+
EntityKind::Macro
|
|
481
|
+
} else if pattern.starts_with("class ") || pattern.contains(" class ") {
|
|
482
|
+
EntityKind::Class
|
|
483
|
+
} else if pattern.starts_with("interface ") || pattern.contains(" interface ") {
|
|
484
|
+
EntityKind::Interface
|
|
485
|
+
} else {
|
|
486
|
+
EntityKind::Function // Default fallback
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
fn extract_entity_name(pattern: &str, kind: &str) -> String {
|
|
491
|
+
// Extract name from pattern based on entity kind
|
|
492
|
+
let pattern = pattern.trim();
|
|
493
|
+
|
|
494
|
+
match kind {
|
|
495
|
+
"struct" | "enum" | "trait" | "impl" | "mod" | "class" | "interface" => {
|
|
496
|
+
if let Some(start) = pattern.find(kind) {
|
|
497
|
+
let after = &pattern[start + kind.len()..].trim();
|
|
498
|
+
// Extract name before any < or { or :
|
|
499
|
+
if let Some(end) = after.find(['<', '{', ':', '(']) {
|
|
500
|
+
after[..end].trim().to_string()
|
|
501
|
+
} else {
|
|
502
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
503
|
+
}
|
|
504
|
+
} else {
|
|
505
|
+
"unknown".to_string()
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"function" | "method" => {
|
|
509
|
+
if let Some(start) = pattern.find("fn ") {
|
|
510
|
+
let after = &pattern[start + 3..].trim();
|
|
511
|
+
// Extract function name before (
|
|
512
|
+
if let Some(end) = after.find('(') {
|
|
513
|
+
after[..end].trim().to_string()
|
|
514
|
+
} else {
|
|
515
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
516
|
+
}
|
|
517
|
+
} else {
|
|
518
|
+
"unknown".to_string()
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
"constant" | "static" => {
|
|
522
|
+
let keyword = if pattern.starts_with("const ") { "const " } else { "static " };
|
|
523
|
+
if let Some(start) = pattern.find(keyword) {
|
|
524
|
+
let after = &pattern[start + keyword.len()..].trim();
|
|
525
|
+
// Extract name before :
|
|
526
|
+
if let Some(end) = after.find(':') {
|
|
527
|
+
after[..end].trim().to_string()
|
|
528
|
+
} else {
|
|
529
|
+
after.split_whitespace().next().unwrap_or("").to_string()
|
|
530
|
+
}
|
|
531
|
+
} else {
|
|
532
|
+
"unknown".to_string()
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
_ => pattern.split_whitespace().next().unwrap_or("unknown").to_string()
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
fn infer_visibility(pattern: &str) -> Visibility {
|
|
540
|
+
if pattern.contains("pub ") || pattern.starts_with("pub") {
|
|
541
|
+
Visibility::Public
|
|
542
|
+
} else if pattern.contains("pub(crate)") {
|
|
543
|
+
Visibility::Crate
|
|
544
|
+
} else {
|
|
545
|
+
Visibility::Private
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
#[cfg(test)]
|
|
551
|
+
mod tests {
|
|
552
|
+
use super::*;
|
|
553
|
+
use rusqlite::Connection;
|
|
554
|
+
use tempfile::tempdir;
|
|
555
|
+
|
|
556
|
+
#[test]
|
|
557
|
+
fn test_schema_initialization() -> Result<()> {
|
|
558
|
+
let dir = tempdir()?;
|
|
559
|
+
let db_path = dir.path().join("test.db");
|
|
560
|
+
let conn = Connection::open(db_path)?;
|
|
561
|
+
|
|
562
|
+
SchemaV2::initialize(&conn)?;
|
|
563
|
+
|
|
564
|
+
// Verify tables exist
|
|
565
|
+
let tables = conn.prepare(
|
|
566
|
+
"SELECT name FROM sqlite_master WHERE type='table'"
|
|
567
|
+
)?.query_map([], |row| row.get::<_, String>(0))?;
|
|
568
|
+
|
|
569
|
+
let table_names: Vec<String> = tables.collect::<Result<Vec<_>, _>>()?;
|
|
570
|
+
assert!(table_names.contains(&"entities".to_string()));
|
|
571
|
+
assert!(table_names.contains(&"refs".to_string()));
|
|
572
|
+
assert!(table_names.contains(&"type_usage".to_string()));
|
|
573
|
+
assert!(table_names.contains(&"modules".to_string()));
|
|
574
|
+
assert!(table_names.contains(&"entity_embeddings".to_string()));
|
|
575
|
+
|
|
576
|
+
Ok(())
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
#[test]
|
|
580
|
+
fn test_entity_kinds() -> Result<()> {
|
|
581
|
+
assert_eq!(EntityKind::from_str("struct").unwrap().as_str(), "struct");
|
|
582
|
+
assert_eq!(EntityKind::from_str("class").unwrap().as_str(), "class");
|
|
583
|
+
assert!(EntityKind::from_str("invalid").is_none());
|
|
584
|
+
Ok(())
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
#[test]
|
|
588
|
+
fn test_entity_name_extraction() -> Result<()> {
|
|
589
|
+
assert_eq!(
|
|
590
|
+
SchemaV2::extract_entity_name("struct MyStruct { field: i32 }", "struct"),
|
|
591
|
+
"MyStruct"
|
|
592
|
+
);
|
|
593
|
+
assert_eq!(
|
|
594
|
+
SchemaV2::extract_entity_name("fn my_function() -> Result<()>", "function"),
|
|
595
|
+
"my_function"
|
|
596
|
+
);
|
|
597
|
+
assert_eq!(
|
|
598
|
+
SchemaV2::extract_entity_name("impl MyStruct for Trait", "impl"),
|
|
599
|
+
"MyStruct"
|
|
600
|
+
);
|
|
601
|
+
Ok(())
|
|
602
|
+
}
|
|
603
|
+
}
|