claude-flow-novice 2.18.13 → 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/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-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-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-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 -351
- 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 +259 -103
- 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/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/security_tests.rs +154 -0
- 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-mdap-context-injection/SKILL.md +31 -10
- package/.claude/skills/cfn-mdap-error-fixer/skill.md +15 -205
- package/.claude/skills/cfn-session-handoff/SKILL.md +1 -53
- 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-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/package.json +2 -1
- package/test-epic-creator-security.sh +203 -0
- 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/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/SKILL.md +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,560 @@
|
|
|
1
|
+
use anyhow::{Result, Context, anyhow};
|
|
2
|
+
use rusqlite::{Connection, params, Row};
|
|
3
|
+
use std::path::Path;
|
|
4
|
+
use serde::{Serialize, Deserialize};
|
|
5
|
+
use tracing::{info, debug, error, warn};
|
|
6
|
+
use chrono::{DateTime, Utc};
|
|
7
|
+
|
|
8
|
+
use crate::schema_v2::{EntityKind, RefKind, Visibility};
|
|
9
|
+
use crate::search_engine::SearchResult;
|
|
10
|
+
|
|
11
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
12
|
+
pub struct Entity {
|
|
13
|
+
pub id: i64,
|
|
14
|
+
pub kind: EntityKind,
|
|
15
|
+
pub name: String,
|
|
16
|
+
pub signature: Option<String>,
|
|
17
|
+
pub visibility: Visibility,
|
|
18
|
+
pub parent_id: Option<i64>,
|
|
19
|
+
pub file_path: String,
|
|
20
|
+
pub line_number: i64,
|
|
21
|
+
pub column_number: Option<i64>,
|
|
22
|
+
pub doc_comment: Option<String>,
|
|
23
|
+
pub attributes: Option<String>,
|
|
24
|
+
pub metadata: Option<String>,
|
|
25
|
+
pub created_at: DateTime<Utc>,
|
|
26
|
+
pub updated_at: DateTime<Utc>,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
30
|
+
pub struct Reference {
|
|
31
|
+
pub id: i64,
|
|
32
|
+
pub source_entity_id: i64,
|
|
33
|
+
pub target_entity_id: i64,
|
|
34
|
+
pub ref_kind: RefKind,
|
|
35
|
+
pub file_path: String,
|
|
36
|
+
pub line_number: i64,
|
|
37
|
+
pub column_number: Option<i64>,
|
|
38
|
+
pub context: Option<String>,
|
|
39
|
+
pub created_at: DateTime<Utc>,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
43
|
+
pub struct TypeUsage {
|
|
44
|
+
pub id: i64,
|
|
45
|
+
pub entity_id: i64,
|
|
46
|
+
pub type_name: String,
|
|
47
|
+
pub usage_kind: String,
|
|
48
|
+
pub file_path: String,
|
|
49
|
+
pub line_number: i64,
|
|
50
|
+
pub created_at: DateTime<Utc>,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
54
|
+
pub struct Module {
|
|
55
|
+
pub id: i64,
|
|
56
|
+
pub name: String,
|
|
57
|
+
pub file_path: String,
|
|
58
|
+
pub module_type: String,
|
|
59
|
+
pub is_root: bool,
|
|
60
|
+
pub parent_module_id: Option<i64>,
|
|
61
|
+
pub created_at: DateTime<Utc>,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
pub struct StoreV2 {
|
|
65
|
+
pub(crate) conn: Connection,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
impl StoreV2 {
|
|
69
|
+
pub fn new(db_path: &Path) -> Result<Self> {
|
|
70
|
+
let conn = Connection::open(db_path)
|
|
71
|
+
.context("Failed to open database")?;
|
|
72
|
+
|
|
73
|
+
// Performance optimizations
|
|
74
|
+
conn.pragma_update(None, "journal_mode", "WAL")?;
|
|
75
|
+
conn.pragma_update(None, "synchronous", "NORMAL")?;
|
|
76
|
+
conn.pragma_update(None, "cache_size", 10000)?; // 10MB cache
|
|
77
|
+
conn.pragma_update(None, "temp_store", "memory")?;
|
|
78
|
+
conn.pragma_update(None, "mmap_size", 268435456)?; // 256MB memory map
|
|
79
|
+
|
|
80
|
+
Ok(Self { conn })
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pub fn transaction(&self) -> Result<rusqlite::Transaction> {
|
|
84
|
+
Ok(self.conn.unchecked_transaction()?)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Entity operations
|
|
88
|
+
pub fn insert_entity(&self, entity: &Entity) -> Result<i64> {
|
|
89
|
+
debug!("Inserting entity: {} ({})", entity.name, entity.kind.as_str());
|
|
90
|
+
|
|
91
|
+
self.conn.execute(
|
|
92
|
+
r#"
|
|
93
|
+
INSERT INTO entities (
|
|
94
|
+
kind, name, signature, visibility, parent_id, file_path,
|
|
95
|
+
line_number, column_number, doc_comment, attributes, metadata
|
|
96
|
+
) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)
|
|
97
|
+
"#,
|
|
98
|
+
params![
|
|
99
|
+
entity.kind.as_str(),
|
|
100
|
+
entity.name,
|
|
101
|
+
entity.signature,
|
|
102
|
+
entity.visibility.as_str(),
|
|
103
|
+
entity.parent_id,
|
|
104
|
+
entity.file_path,
|
|
105
|
+
entity.line_number,
|
|
106
|
+
entity.column_number,
|
|
107
|
+
entity.doc_comment,
|
|
108
|
+
entity.attributes,
|
|
109
|
+
entity.metadata
|
|
110
|
+
],
|
|
111
|
+
)?;
|
|
112
|
+
|
|
113
|
+
Ok(self.conn.last_insert_rowid())
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
pub fn get_entity(&self, id: i64) -> Result<Option<Entity>> {
|
|
117
|
+
debug!("Getting entity with id: {}", id);
|
|
118
|
+
|
|
119
|
+
let mut stmt = self.conn.prepare(
|
|
120
|
+
"SELECT * FROM entities WHERE id = ?"
|
|
121
|
+
)?;
|
|
122
|
+
|
|
123
|
+
let entity = stmt.query_row([id], |row| {
|
|
124
|
+
self.row_to_entity(row)
|
|
125
|
+
}).optional()?;
|
|
126
|
+
|
|
127
|
+
Ok(entity)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
pub fn find_entities_by_name(&self, name: &str, limit: usize) -> Result<Vec<Entity>> {
|
|
131
|
+
debug!("Finding entities with name: {}", name);
|
|
132
|
+
|
|
133
|
+
let mut stmt = self.conn.prepare(
|
|
134
|
+
"SELECT * FROM entities WHERE name = ? ORDER BY file_path, line_number LIMIT ?"
|
|
135
|
+
)?;
|
|
136
|
+
|
|
137
|
+
let entities = stmt.query_map(
|
|
138
|
+
params![name, limit as i64],
|
|
139
|
+
|row| self.row_to_entity(row)
|
|
140
|
+
)?.collect::<Result<Vec<_>, _>>()?;
|
|
141
|
+
|
|
142
|
+
Ok(entities)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
pub fn find_entities_by_kind(&self, kind: EntityKind, limit: usize) -> Result<Vec<Entity>> {
|
|
146
|
+
debug!("Finding entities of kind: {}", kind.as_str());
|
|
147
|
+
|
|
148
|
+
let mut stmt = self.conn.prepare(
|
|
149
|
+
"SELECT * FROM entities WHERE kind = ? ORDER BY name LIMIT ?"
|
|
150
|
+
)?;
|
|
151
|
+
|
|
152
|
+
let entities = stmt.query_map(
|
|
153
|
+
params![kind.as_str(), limit as i64],
|
|
154
|
+
|row| self.row_to_entity(row)
|
|
155
|
+
)?.collect::<Result<Vec<_>, _>>()?;
|
|
156
|
+
|
|
157
|
+
Ok(entities)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
pub fn find_entities_in_file(&self, file_path: &str) -> Result<Vec<Entity>> {
|
|
161
|
+
debug!("Finding entities in file: {}", file_path);
|
|
162
|
+
|
|
163
|
+
let mut stmt = self.conn.prepare(
|
|
164
|
+
"SELECT * FROM entities WHERE file_path = ? ORDER BY line_number"
|
|
165
|
+
)?;
|
|
166
|
+
|
|
167
|
+
let entities = stmt.query_map([file_path], |row| {
|
|
168
|
+
self.row_to_entity(row)
|
|
169
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
170
|
+
|
|
171
|
+
Ok(entities)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
pub fn search_entities(&self, query: &str, limit: usize) -> Result<Vec<Entity>> {
|
|
175
|
+
debug!("Searching entities with query: {}", query);
|
|
176
|
+
|
|
177
|
+
let mut stmt = self.conn.prepare(
|
|
178
|
+
r#"
|
|
179
|
+
SELECT * FROM entities
|
|
180
|
+
WHERE name LIKE ? OR signature LIKE ? OR doc_comment LIKE ?
|
|
181
|
+
ORDER BY
|
|
182
|
+
CASE WHEN name LIKE ? THEN 1 ELSE 2 END,
|
|
183
|
+
name
|
|
184
|
+
LIMIT ?
|
|
185
|
+
"#
|
|
186
|
+
)?;
|
|
187
|
+
|
|
188
|
+
let pattern = format!("%{}%", query);
|
|
189
|
+
let entities = stmt.query_map(
|
|
190
|
+
params![pattern, pattern, pattern, pattern, limit as i64],
|
|
191
|
+
|row| self.row_to_entity(row)
|
|
192
|
+
)?.collect::<Result<Vec<_>, _>>()?;
|
|
193
|
+
|
|
194
|
+
Ok(entities)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Reference operations
|
|
198
|
+
pub fn insert_reference(&self, reference: &Reference) -> Result<i64> {
|
|
199
|
+
debug!("Inserting reference: {} -> {}", reference.source_entity_id, reference.target_entity_id);
|
|
200
|
+
|
|
201
|
+
self.conn.execute(
|
|
202
|
+
r#"
|
|
203
|
+
INSERT INTO refs (
|
|
204
|
+
source_entity_id, target_entity_id, ref_kind, file_path,
|
|
205
|
+
line_number, column_number, context
|
|
206
|
+
) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
|
|
207
|
+
"#,
|
|
208
|
+
params![
|
|
209
|
+
reference.source_entity_id,
|
|
210
|
+
reference.target_entity_id,
|
|
211
|
+
reference.ref_kind.as_str(),
|
|
212
|
+
reference.file_path,
|
|
213
|
+
reference.line_number,
|
|
214
|
+
reference.column_number,
|
|
215
|
+
reference.context
|
|
216
|
+
],
|
|
217
|
+
)?;
|
|
218
|
+
|
|
219
|
+
Ok(self.conn.last_insert_rowid())
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
pub fn find_references_to_entity(&self, entity_id: i64) -> Result<Vec<Reference>> {
|
|
223
|
+
debug!("Finding references to entity: {}", entity_id);
|
|
224
|
+
|
|
225
|
+
let mut stmt = self.conn.prepare(
|
|
226
|
+
"SELECT * FROM refs WHERE target_entity_id = ? ORDER BY file_path, line_number"
|
|
227
|
+
)?;
|
|
228
|
+
|
|
229
|
+
let refs = stmt.query_map([entity_id], |row| {
|
|
230
|
+
self.row_to_reference(row)
|
|
231
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
232
|
+
|
|
233
|
+
Ok(refs)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
pub fn find_references_from_entity(&self, entity_id: i64) -> Result<Vec<Reference>> {
|
|
237
|
+
debug!("Finding references from entity: {}", entity_id);
|
|
238
|
+
|
|
239
|
+
let mut stmt = self.conn.prepare(
|
|
240
|
+
"SELECT * FROM refs WHERE source_entity_id = ? ORDER BY ref_kind, file_path"
|
|
241
|
+
)?;
|
|
242
|
+
|
|
243
|
+
let refs = stmt.query_map([entity_id], |row| {
|
|
244
|
+
self.row_to_reference(row)
|
|
245
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
246
|
+
|
|
247
|
+
Ok(refs)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Type usage operations
|
|
251
|
+
pub fn insert_type_usage(&self, type_usage: &TypeUsage) -> Result<i64> {
|
|
252
|
+
debug!("Inserting type usage: {} uses {}", type_usage.entity_id, type_usage.type_name);
|
|
253
|
+
|
|
254
|
+
self.conn.execute(
|
|
255
|
+
r#"
|
|
256
|
+
INSERT INTO type_usage (
|
|
257
|
+
entity_id, type_name, usage_kind, file_path, line_number
|
|
258
|
+
) VALUES (?1, ?2, ?3, ?4, ?5)
|
|
259
|
+
"#,
|
|
260
|
+
params![
|
|
261
|
+
type_usage.entity_id,
|
|
262
|
+
type_usage.type_name,
|
|
263
|
+
type_usage.usage_kind,
|
|
264
|
+
type_usage.file_path,
|
|
265
|
+
type_usage.line_number
|
|
266
|
+
],
|
|
267
|
+
)?;
|
|
268
|
+
|
|
269
|
+
Ok(self.conn.last_insert_rowid())
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
pub fn find_entities_using_type(&self, type_name: &str) -> Result<Vec<i64>> {
|
|
273
|
+
debug!("Finding entities using type: {}", type_name);
|
|
274
|
+
|
|
275
|
+
let mut stmt = self.conn.prepare(
|
|
276
|
+
"SELECT DISTINCT entity_id FROM type_usage WHERE type_name = ?"
|
|
277
|
+
)?;
|
|
278
|
+
|
|
279
|
+
let entity_ids = stmt.query_map([type_name], |row| {
|
|
280
|
+
row.get(0)
|
|
281
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
282
|
+
|
|
283
|
+
Ok(entity_ids)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Module operations
|
|
287
|
+
pub fn insert_module(&self, module: &Module) -> Result<i64> {
|
|
288
|
+
debug!("Inserting module: {}", module.name);
|
|
289
|
+
|
|
290
|
+
self.conn.execute(
|
|
291
|
+
r#"
|
|
292
|
+
INSERT INTO modules (
|
|
293
|
+
name, file_path, module_type, is_root, parent_module_id
|
|
294
|
+
) VALUES (?1, ?2, ?3, ?4, ?5)
|
|
295
|
+
"#,
|
|
296
|
+
params![
|
|
297
|
+
module.name,
|
|
298
|
+
module.file_path,
|
|
299
|
+
module.module_type,
|
|
300
|
+
module.is_root,
|
|
301
|
+
module.parent_module_id
|
|
302
|
+
],
|
|
303
|
+
)?;
|
|
304
|
+
|
|
305
|
+
Ok(self.conn.last_insert_rowid())
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
pub fn find_module_by_file(&self, file_path: &str) -> Result<Option<Module>> {
|
|
309
|
+
debug!("Finding module for file: {}", file_path);
|
|
310
|
+
|
|
311
|
+
let mut stmt = self.conn.prepare(
|
|
312
|
+
"SELECT * FROM modules WHERE file_path = ?"
|
|
313
|
+
)?;
|
|
314
|
+
|
|
315
|
+
let module = stmt.query_row([file_path], |row| {
|
|
316
|
+
self.row_to_module(row)
|
|
317
|
+
}).optional()?;
|
|
318
|
+
|
|
319
|
+
Ok(module)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Embedding operations
|
|
323
|
+
pub fn store_embedding(&self, entity_id: i64, embedding: &[f32], model: &str) -> Result<()> {
|
|
324
|
+
debug!("Storing embedding for entity: {}", entity_id);
|
|
325
|
+
|
|
326
|
+
// Serialize embedding to bytes
|
|
327
|
+
let embedding_bytes: Vec<u8> = embedding
|
|
328
|
+
.iter()
|
|
329
|
+
.flat_map(|&v| v.to_le_bytes().to_vec())
|
|
330
|
+
.collect();
|
|
331
|
+
|
|
332
|
+
self.conn.execute(
|
|
333
|
+
"INSERT OR REPLACE INTO entity_embeddings (entity_id, embedding, embedding_model) VALUES (?1, ?2, ?3)",
|
|
334
|
+
params![entity_id, embedding_bytes, model]
|
|
335
|
+
)?;
|
|
336
|
+
|
|
337
|
+
Ok(())
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
pub fn get_embedding(&self, entity_id: i64) -> Result<Option<Vec<f32>>> {
|
|
341
|
+
debug!("Getting embedding for entity: {}", entity_id);
|
|
342
|
+
|
|
343
|
+
let mut stmt = self.conn.prepare(
|
|
344
|
+
"SELECT embedding FROM entity_embeddings WHERE entity_id = ?"
|
|
345
|
+
)?;
|
|
346
|
+
|
|
347
|
+
let embedding = stmt.query_row([entity_id], |row| {
|
|
348
|
+
let embedding_bytes: Vec<u8> = row.get(0)?;
|
|
349
|
+
let mut embedding: Vec<f32> = Vec::with_capacity(embedding_bytes.len() / 4);
|
|
350
|
+
|
|
351
|
+
for chunk in embedding_bytes.chunks_exact(4) {
|
|
352
|
+
let bytes: [u8; 4] = chunk.try_into().unwrap();
|
|
353
|
+
embedding.push(f32::from_le_bytes(bytes));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
Ok(embedding)
|
|
357
|
+
}).optional()?;
|
|
358
|
+
|
|
359
|
+
Ok(embedding)
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Performance optimization methods
|
|
363
|
+
pub fn get_entity_batch(&self, ids: &[i64]) -> Result<Vec<Entity>> {
|
|
364
|
+
debug!("Getting batch of {} entities", ids.len());
|
|
365
|
+
|
|
366
|
+
if ids.is_empty() {
|
|
367
|
+
return Ok(Vec::new());
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
let placeholders = ids.iter().map(|_| "?").collect::<Vec<_>>().join(",");
|
|
371
|
+
let query = format!(
|
|
372
|
+
"SELECT * FROM entities WHERE id IN ({}) ORDER BY id",
|
|
373
|
+
placeholders
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
let params: Vec<&dyn rusqlite::ToSql> = ids
|
|
377
|
+
.iter()
|
|
378
|
+
.map(|id| id as &dyn rusqlite::ToSql)
|
|
379
|
+
.collect();
|
|
380
|
+
|
|
381
|
+
let mut stmt = self.conn.prepare(&query)?;
|
|
382
|
+
let entities = stmt.query_map(¶ms[..], |row| {
|
|
383
|
+
self.row_to_entity(row)
|
|
384
|
+
})?.collect::<Result<Vec<_>, _>>()?;
|
|
385
|
+
|
|
386
|
+
Ok(entities)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Statistics
|
|
390
|
+
pub fn get_stats(&self) -> Result<StoreStats> {
|
|
391
|
+
debug!("Getting store statistics");
|
|
392
|
+
|
|
393
|
+
let entities_count: i64 = self.conn.query_row(
|
|
394
|
+
"SELECT COUNT(*) FROM entities",
|
|
395
|
+
[],
|
|
396
|
+
|row| row.get(0)
|
|
397
|
+
)?;
|
|
398
|
+
|
|
399
|
+
let refs_count: i64 = self.conn.query_row(
|
|
400
|
+
"SELECT COUNT(*) FROM refs",
|
|
401
|
+
[],
|
|
402
|
+
|row| row.get(0)
|
|
403
|
+
)?;
|
|
404
|
+
|
|
405
|
+
let type_usage_count: i64 = self.conn.query_row(
|
|
406
|
+
"SELECT COUNT(*) FROM type_usage",
|
|
407
|
+
[],
|
|
408
|
+
|row| row.get(0)
|
|
409
|
+
)?;
|
|
410
|
+
|
|
411
|
+
let modules_count: i64 = self.conn.query_row(
|
|
412
|
+
"SELECT COUNT(*) FROM modules",
|
|
413
|
+
[],
|
|
414
|
+
|row| row.get(0)
|
|
415
|
+
)?;
|
|
416
|
+
|
|
417
|
+
let embeddings_count: i64 = self.conn.query_row(
|
|
418
|
+
"SELECT COUNT(*) FROM entity_embeddings",
|
|
419
|
+
[],
|
|
420
|
+
|row| row.get(0)
|
|
421
|
+
)?;
|
|
422
|
+
|
|
423
|
+
let files_count: i64 = self.conn.query_row(
|
|
424
|
+
"SELECT COUNT(DISTINCT file_path) FROM entities",
|
|
425
|
+
[],
|
|
426
|
+
|row| row.get(0)
|
|
427
|
+
)?;
|
|
428
|
+
|
|
429
|
+
let db_size = std::fs::metadata("index.db")
|
|
430
|
+
.map(|m| m.len())
|
|
431
|
+
.unwrap_or(0);
|
|
432
|
+
|
|
433
|
+
Ok(StoreStats {
|
|
434
|
+
entities_count: entities_count as usize,
|
|
435
|
+
refs_count: refs_count as usize,
|
|
436
|
+
type_usage_count: type_usage_count as usize,
|
|
437
|
+
modules_count: modules_count as usize,
|
|
438
|
+
embeddings_count: embeddings_count as usize,
|
|
439
|
+
files_count: files_count as usize,
|
|
440
|
+
database_size_bytes: db_size,
|
|
441
|
+
})
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Helper methods to convert rows to structs
|
|
445
|
+
pub(crate) fn row_to_entity(&self, row: &Row) -> Result<Entity> {
|
|
446
|
+
let created_timestamp: i64 = row.get(14)?;
|
|
447
|
+
let updated_timestamp: i64 = row.get(15)?;
|
|
448
|
+
|
|
449
|
+
Ok(Entity {
|
|
450
|
+
id: row.get(0)?,
|
|
451
|
+
kind: EntityKind::from_str(&row.get::<_, String>(1)?)
|
|
452
|
+
.ok_or_else(|| anyhow!("Invalid entity kind"))?,
|
|
453
|
+
name: row.get(2)?,
|
|
454
|
+
signature: row.get(3)?,
|
|
455
|
+
visibility: Visibility::from_str(&row.get::<_, String>(4)?)
|
|
456
|
+
.ok_or_else(|| anyhow!("Invalid visibility"))?,
|
|
457
|
+
parent_id: row.get(5)?,
|
|
458
|
+
file_path: row.get(6)?,
|
|
459
|
+
line_number: row.get(7)?,
|
|
460
|
+
column_number: row.get(8)?,
|
|
461
|
+
doc_comment: row.get(9)?,
|
|
462
|
+
attributes: row.get(10)?,
|
|
463
|
+
metadata: row.get(11)?,
|
|
464
|
+
created_at: DateTime::from_timestamp(created_timestamp, 0).unwrap_or_default(),
|
|
465
|
+
updated_at: DateTime::from_timestamp(updated_timestamp, 0).unwrap_or_default(),
|
|
466
|
+
})
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
fn row_to_reference(&self, row: &Row) -> Result<Reference> {
|
|
470
|
+
let created_timestamp: i64 = row.get(7)?;
|
|
471
|
+
|
|
472
|
+
Ok(Reference {
|
|
473
|
+
id: row.get(0)?,
|
|
474
|
+
source_entity_id: row.get(1)?,
|
|
475
|
+
target_entity_id: row.get(2)?,
|
|
476
|
+
ref_kind: RefKind::from_str(&row.get::<_, String>(3)?)
|
|
477
|
+
.ok_or_else(|| anyhow!("Invalid reference kind"))?,
|
|
478
|
+
file_path: row.get(4)?,
|
|
479
|
+
line_number: row.get(5)?,
|
|
480
|
+
column_number: row.get(6)?,
|
|
481
|
+
context: row.get(7)?,
|
|
482
|
+
created_at: DateTime::from_timestamp(created_timestamp, 0).unwrap_or_default(),
|
|
483
|
+
})
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
fn row_to_module(&self, row: &Row) -> Result<Module> {
|
|
487
|
+
let created_timestamp: i64 = row.get(5)?;
|
|
488
|
+
|
|
489
|
+
Ok(Module {
|
|
490
|
+
id: row.get(0)?,
|
|
491
|
+
name: row.get(1)?,
|
|
492
|
+
file_path: row.get(2)?,
|
|
493
|
+
module_type: row.get(3)?,
|
|
494
|
+
is_root: row.get(4)?,
|
|
495
|
+
parent_module_id: row.get(5)?,
|
|
496
|
+
created_at: DateTime::from_timestamp(created_timestamp, 0).unwrap_or_default(),
|
|
497
|
+
})
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#[derive(Debug)]
|
|
502
|
+
pub struct StoreStats {
|
|
503
|
+
pub entities_count: usize,
|
|
504
|
+
pub refs_count: usize,
|
|
505
|
+
pub type_usage_count: usize,
|
|
506
|
+
pub modules_count: usize,
|
|
507
|
+
pub embeddings_count: usize,
|
|
508
|
+
pub files_count: usize,
|
|
509
|
+
pub database_size_bytes: u64,
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
#[cfg(test)]
|
|
513
|
+
mod tests {
|
|
514
|
+
use super::*;
|
|
515
|
+
use tempfile::tempdir;
|
|
516
|
+
use crate::schema_v2::SchemaV2;
|
|
517
|
+
|
|
518
|
+
#[test]
|
|
519
|
+
fn test_entity_crud() -> Result<()> {
|
|
520
|
+
let dir = tempdir()?;
|
|
521
|
+
let db_path = dir.path().join("test_entities.db");
|
|
522
|
+
let conn = Connection::open(&db_path)?;
|
|
523
|
+
|
|
524
|
+
// Initialize schema
|
|
525
|
+
SchemaV2::initialize(&conn)?;
|
|
526
|
+
|
|
527
|
+
let store = StoreV2::new(&db_path)?;
|
|
528
|
+
|
|
529
|
+
// Insert entity
|
|
530
|
+
let entity = Entity {
|
|
531
|
+
id: 0,
|
|
532
|
+
kind: EntityKind::Function,
|
|
533
|
+
name: "test_function".to_string(),
|
|
534
|
+
signature: Some("fn test_function() -> Result<()>".to_string()),
|
|
535
|
+
visibility: Visibility::Public,
|
|
536
|
+
parent_id: None,
|
|
537
|
+
file_path: "/test.rs".to_string(),
|
|
538
|
+
line_number: 10,
|
|
539
|
+
column_number: Some(0),
|
|
540
|
+
doc_comment: Some("Test function".to_string()),
|
|
541
|
+
attributes: None,
|
|
542
|
+
metadata: None,
|
|
543
|
+
created_at: Utc::now(),
|
|
544
|
+
updated_at: Utc::now(),
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
let entity_id = store.insert_entity(&entity)?;
|
|
548
|
+
assert!(entity_id > 0);
|
|
549
|
+
|
|
550
|
+
// Retrieve entity
|
|
551
|
+
let retrieved = store.get_entity(entity_id)?;
|
|
552
|
+
assert!(retrieved.is_some());
|
|
553
|
+
|
|
554
|
+
let retrieved = retrieved.unwrap();
|
|
555
|
+
assert_eq!(retrieved.name, "test_function");
|
|
556
|
+
assert_eq!(retrieved.kind, EntityKind::Function);
|
|
557
|
+
|
|
558
|
+
Ok(())
|
|
559
|
+
}
|
|
560
|
+
}
|
|
File without changes
|