cgraphx 2.0.1 → 2.0.3
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/dist/.claude-template/FLOW-MAP.md +7 -5
- package/dist/.claude-template/commands/end.md +1 -1
- package/dist/.claude-template/skills/cgraphx-guide/SKILL.md +2 -1
- package/dist/.claude-template/skills/cgraphx-guide/how-to-use.html +4 -2
- package/dist/.claude-template/skills/cgraphx-guide/how-to-use.md +5 -2
- package/dist/.claude-template/skills/iboc-check/SKILL.md +116 -0
- package/dist/.claude-template/skills/iboc-check/filler-prompt.md +75 -0
- package/dist/.claude-template/skills/implementation/SKILL.md +7 -0
- package/dist/.claude-template/skills/init-project-guides/SKILL.md +1 -1
- package/dist/.claude-template/skills/run-api-test/references/db-verification.md +2 -2
- package/dist/.claude-template/skills/subagent-implement/SKILL.md +3 -2
- package/dist/.claude-template/skills/write-api/assets/template-request.bru +3 -3
- package/dist/.claude-template/skills/write-api/references/bru-format.md +6 -6
- package/dist/.claude-template/skills/write-delivery-guide/SKILL.md +97 -0
- package/dist/.claude-template/skills/write-delivery-guide/template-change-type.md +120 -0
- package/dist/.claude-template/skills/write-delivery-guide/template-multi-role-flow.md +148 -0
- package/dist/.claude-template/skills/write-unit-test-code/SKILL.md +23 -6
- package/dist/core/code/engine/cli/analyze-config.js +320 -0
- package/dist/core/code/engine/cli/analyze.js +1086 -0
- package/dist/core/code/engine/cli/cli-message.js +83 -0
- package/dist/core/code/engine/cli/detect-changes-format.js +58 -0
- package/dist/core/code/engine/cli/embedding-dims.js +43 -0
- package/dist/core/code/engine/cli/format-elapsed.js +12 -0
- package/dist/core/code/engine/cli/help-i18n.js +144 -0
- package/dist/core/code/engine/cli/i18n/en.js +110 -0
- package/dist/core/code/engine/cli/i18n/index.js +47 -0
- package/dist/core/code/engine/cli/i18n/resources.js +9 -0
- package/dist/core/code/engine/cli/i18n/zh-CN.js +110 -0
- package/dist/core/code/engine/cli/lazy-action.js +67 -0
- package/dist/core/code/engine/cli/optional-grammars.js +136 -0
- package/dist/core/code/engine/cli/resolve-invocation.js +76 -0
- package/dist/core/code/engine/cli/status.js +156 -0
- package/dist/core/code/engine/cli/tool.js +384 -0
- package/dist/core/code/engine/config/ignore-service.js +511 -0
- package/dist/core/code/engine/config/supported-languages.js +17 -0
- package/dist/core/code/engine/core/analysis-features.js +64 -0
- package/dist/core/code/engine/core/analyzer-identity.js +2171 -0
- package/dist/core/code/engine/core/git-staleness.js +180 -0
- package/dist/core/code/engine/core/graph/graph.js +180 -0
- package/dist/core/code/engine/core/graph/import-cycles.js +106 -0
- package/dist/core/code/engine/core/graph/types.js +2 -0
- package/dist/core/code/engine/core/index-freshness.js +12 -0
- package/dist/core/code/engine/core/ingestion/binding-accumulator.js +341 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/c-cpp.js +168 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/csharp.js +9 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/dart.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/go.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/jvm.js +54 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/php.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/python.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/ruby.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/rust.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/swift.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/typescript-javascript.js +11 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/generic.js +62 -0
- package/dist/core/code/engine/core/ingestion/call-processor.js +503 -0
- package/dist/core/code/engine/core/ingestion/call-routing.js +98 -0
- package/dist/core/code/engine/core/ingestion/call-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/cfg/callee-cell-format.js +45 -0
- package/dist/core/code/engine/core/ingestion/cfg/cfg-builder.js +202 -0
- package/dist/core/code/engine/core/ingestion/cfg/collect.js +81 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-dependence.js +185 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-flow-context.js +130 -0
- package/dist/core/code/engine/core/ingestion/cfg/emit.js +646 -0
- package/dist/core/code/engine/core/ingestion/cfg/post-dominators.js +182 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-def-reason-codec.js +139 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs-graph.js +322 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs.js +792 -0
- package/dist/core/code/engine/core/ingestion/cfg/synthetic-escape.js +305 -0
- package/dist/core/code/engine/core/ingestion/cfg/traversal-result.js +6 -0
- package/dist/core/code/engine/core/ingestion/cfg/types.js +14 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp-harvest.js +545 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp.js +590 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/call-site-harvest.js +356 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp-harvest.js +593 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp.js +871 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart-harvest.js +874 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart.js +840 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go-harvest.js +625 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go.js +642 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java-harvest.js +517 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java.js +816 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin-harvest.js +723 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin.js +813 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php-harvest.js +630 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php.js +725 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python-harvest.js +776 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby-harvest.js +591 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby.js +760 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust-harvest.js +877 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/scope-tree-harvest.js +120 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift-harvest.js +683 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift.js +791 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript-harvest.js +1060 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript.js +587 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/c-cpp.js +77 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/csharp.js +24 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/dart.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/go.js +28 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/jvm.js +67 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/php.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/python.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/ruby.js +13 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/rust.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/swift.js +21 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/typescript-javascript.js +31 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/generic.js +144 -0
- package/dist/core/code/engine/core/ingestion/class-types.js +2 -0
- package/dist/core/code/engine/core/ingestion/cluster-enricher.js +174 -0
- package/dist/core/code/engine/core/ingestion/community-processor.js +604 -0
- package/dist/core/code/engine/core/ingestion/constants.js +26 -0
- package/dist/core/code/engine/core/ingestion/cpp-ue-preprocessor.js +263 -0
- package/dist/core/code/engine/core/ingestion/csharp-namespace-gate.js +133 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/index.js +38 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/spring.js +310 -0
- package/dist/core/code/engine/core/ingestion/emit-references.js +244 -0
- package/dist/core/code/engine/core/ingestion/entry-point-scoring.js +201 -0
- package/dist/core/code/engine/core/ingestion/export-detection.js +244 -0
- package/dist/core/code/engine/core/ingestion/field-extractor.js +29 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/c-cpp.js +107 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/csharp.js +124 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/dart.js +99 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/go.js +102 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/helpers.js +198 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/jvm.js +172 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/php.js +67 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/python.js +94 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/ruby.js +79 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/rust.js +55 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/swift.js +93 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/typescript-javascript.js +59 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/generic.js +147 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/typescript.js +266 -0
- package/dist/core/code/engine/core/ingestion/field-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/filesystem-walker.js +136 -0
- package/dist/core/code/engine/core/ingestion/finalize-orchestrator.js +159 -0
- package/dist/core/code/engine/core/ingestion/framework-detection.js +432 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/analysis-features.js +38 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/annotation-arguments.js +234 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop-candidates.js +88 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop.js +487 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/auto-configuration.js +21 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-candidates.js +189 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-catalog.js +32 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-factories.js +73 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/conditionals.js +323 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/config-bindings.js +119 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/di-metadata.js +385 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/resource-injection.js +96 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/c-cpp.js +17 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/csharp.js +46 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/dart.js +59 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/go.js +30 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/jvm.js +73 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/php.js +19 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/python.js +45 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/rust.js +58 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/swift.js +94 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/typescript-javascript.js +26 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/csharp.js +128 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/go.js +50 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/jvm.js +112 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/php.js +80 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/python.js +75 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/resolver-factory.js +36 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/standard.js +180 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/types.js +7 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/utils.js +153 -0
- package/dist/core/code/engine/core/ingestion/import-target-adapter.js +99 -0
- package/dist/core/code/engine/core/ingestion/language-config.js +391 -0
- package/dist/core/code/engine/core/ingestion/language-provider.js +25 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity-metadata.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/c/capture-side-channel.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/c/captures.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/c/header-scan.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-decomposer.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/c/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/c/interpret.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/c/merge-bindings.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/c/query.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/c/scope-resolver.js +112 -0
- package/dist/core/code/engine/core/ingestion/languages/c/simple-hooks.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/c/static-linkage.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/c-cpp.js +506 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/adl.js +804 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity-metadata.js +258 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/capture-side-channel.js +89 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/captures.js +1975 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-extractor.js +311 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-filter.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/conversion-rank.js +163 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/file-local-linkage.js +327 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/header-scan.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-decomposer.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-target.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/inline-namespaces.js +379 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/interpret.js +239 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/member-lookup.js +470 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/merge-bindings.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/query.js +763 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/range-bindings.js +230 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/scope-resolver.js +354 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/simple-hooks.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/two-phase-lookup.js +348 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/type-classifier.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/user-defined-conversions.js +128 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/accessor-unwrap.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/captures.js +557 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-decomposer.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-target.js +176 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/index.js +95 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/interpret.js +150 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/merge-bindings.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/namespace-siblings.js +708 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/qualified-type-names.js +62 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/query.js +578 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/receiver-binding.js +142 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/resolution-config.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/scope-resolver.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/simple-hooks.js +81 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp.js +204 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity-metadata.js +38 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/built-ins.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/cache-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/captures.js +1096 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/expand-wildcards.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/extension-type-preprocess.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/import-target.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/index.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/interpret.js +101 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/merge-bindings.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/query.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/receiver-binding.js +90 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/scope-resolver.js +197 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/signature-bindings.js +54 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/simple-hooks.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/dart.js +138 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity-metadata.js +71 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity.js +17 -0
- package/dist/core/code/engine/core/ingestion/languages/go/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/captures.js +492 -0
- package/dist/core/code/engine/core/ingestion/languages/go/expand-wildcards.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/go/generic-type-parameters.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-decomposer.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-target.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/go/index.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interface-impls.js +955 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interpret.js +177 -0
- package/dist/core/code/engine/core/ingestion/languages/go/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/method-owners.js +131 -0
- package/dist/core/code/engine/core/ingestion/languages/go/namespace-mirror.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-clause.js +79 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-siblings.js +83 -0
- package/dist/core/code/engine/core/ingestion/languages/go/query.js +298 -0
- package/dist/core/code/engine/core/ingestion/languages/go/range-binding.js +127 -0
- package/dist/core/code/engine/core/ingestion/languages/go/receiver-binding.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/go/scope-resolver.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/go/simple-hooks.js +31 -0
- package/dist/core/code/engine/core/ingestion/languages/go/type-binding.js +279 -0
- package/dist/core/code/engine/core/ingestion/languages/go.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/index.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/java/analysis-features.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity-metadata.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity.js +27 -0
- package/dist/core/code/engine/core/ingestion/languages/java/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/java/capture-side-channel.js +123 -0
- package/dist/core/code/engine/core/ingestion/languages/java/captures.js +791 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-decomposer.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/java/index.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/interpret.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/java/merge-bindings.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/query.js +319 -0
- package/dist/core/code/engine/core/ingestion/languages/java/receiver-binding.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/java/scope-resolver.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/java/simple-hooks.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-aop.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-conditionals.js +52 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-config-bindings.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-di.js +165 -0
- package/dist/core/code/engine/core/ingestion/languages/java.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/arity.js +15 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/captures.js +1122 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/import-target.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/index.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/interpret.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/query.js +659 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/scope-resolver.js +78 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/simple-hooks.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-facts.js +46 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-siblings.js +200 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity-metadata.js +23 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/capture-side-channel.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/captures.js +1262 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/companion-scopes.js +72 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-decomposer.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-target.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/index.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/interpret.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/merge-bindings.js +28 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/owners.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/query.js +243 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/receiver-binding.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/scope-resolver.js +207 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/simple-hooks.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-aop.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-conditionals.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-di.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity-metadata.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/php/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/php/captures.js +1166 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-decomposer.js +238 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-target.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/php/index.js +85 -0
- package/dist/core/code/engine/core/ingestion/languages/php/interpret.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/php/merge-bindings.js +50 -0
- package/dist/core/code/engine/core/ingestion/languages/php/namespace-siblings.js +353 -0
- package/dist/core/code/engine/core/ingestion/languages/php/query.js +391 -0
- package/dist/core/code/engine/core/ingestion/languages/php/receiver-binding.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/php/scope-resolver.js +361 -0
- package/dist/core/code/engine/core/ingestion/languages/php/simple-hooks.js +116 -0
- package/dist/core/code/engine/core/ingestion/languages/php.js +302 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/python/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/python/captures.js +299 -0
- package/dist/core/code/engine/core/ingestion/languages/python/depends-references.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-decomposer.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-target.js +440 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/python/interpret.js +430 -0
- package/dist/core/code/engine/core/ingestion/languages/python/merge-bindings.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/python/query.js +323 -0
- package/dist/core/code/engine/core/ingestion/languages/python/receiver-binding.js +310 -0
- package/dist/core/code/engine/core/ingestion/languages/python/scope-resolver.js +80 -0
- package/dist/core/code/engine/core/ingestion/languages/python/simple-hooks.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/python.js +140 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/captures.js +864 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/import-target.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/interpret.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/query.js +349 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/receiver-binding.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/scope-resolver.js +263 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/simple-hooks.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby.js +215 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/arity.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/captures.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-decomposer.js +167 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-target.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/interpret.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/method-owners.js +76 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/module-path.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/qualified-call.js +482 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/query.js +280 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/range-binding.js +687 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/receiver-binding.js +148 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/scope-resolver.js +151 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/simple-hooks.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/rust.js +183 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity-metadata.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/base-type.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/captures.js +594 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/conditional-directive-preprocess.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/implicit-imports.js +60 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-decomposer.js +87 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-target.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/index.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/interpret.js +93 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/merge-bindings.js +51 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/query.js +226 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/receiver-binding.js +169 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/scope-resolver.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/sibling-type-bindings.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/signature-bindings.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/simple-hooks.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-grouping.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-siblings.js +74 -0
- package/dist/core/code/engine/core/ingestion/languages/swift.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity-metadata.js +106 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity.js +57 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/array-callback.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/captures.js +956 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-export-assignment.js +535 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-module-exports.js +196 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-decomposer.js +374 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-target.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/index.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/interpret.js +344 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/merge-bindings.js +161 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/nuxt-auto-imports.js +325 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/query.js +1328 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/receiver-binding.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/scope-resolver.js +293 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/simple-hooks.js +139 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript.js +455 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/captures.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/import-target.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/index.js +55 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/scope-resolver.js +295 -0
- package/dist/core/code/engine/core/ingestion/languages/vue.js +96 -0
- package/dist/core/code/engine/core/ingestion/local-symbol-pruner.js +68 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/csharp.js +290 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/dart.js +392 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/go.js +179 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/jvm.js +350 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/php.js +306 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/python.js +312 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/ruby.js +289 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/rust.js +198 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/swift.js +286 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/typescript-javascript.js +341 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/generic.js +209 -0
- package/dist/core/code/engine/core/ingestion/method-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/model/field-registry.js +41 -0
- package/dist/core/code/engine/core/ingestion/model/index.js +52 -0
- package/dist/core/code/engine/core/ingestion/model/method-registry.js +138 -0
- package/dist/core/code/engine/core/ingestion/model/owned-members-lookup.js +46 -0
- package/dist/core/code/engine/core/ingestion/model/registration-table.js +234 -0
- package/dist/core/code/engine/core/ingestion/model/resolve.js +183 -0
- package/dist/core/code/engine/core/ingestion/model/scope-resolution-indexes.js +43 -0
- package/dist/core/code/engine/core/ingestion/model/semantic-model.js +179 -0
- package/dist/core/code/engine/core/ingestion/model/symbol-table.js +216 -0
- package/dist/core/code/engine/core/ingestion/model/type-registry.js +84 -0
- package/dist/core/code/engine/core/ingestion/mro-processor.js +709 -0
- package/dist/core/code/engine/core/ingestion/parsing-processor.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/communities.js +69 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/cross-file.js +71 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/di.js +338 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/http-api-calls.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/index.js +54 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/mro.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/orm.js +78 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse-impl.js +1286 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse.js +41 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/processes.js +193 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/prune-local-symbols.js +29 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/registry.js +52 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/routes.js +409 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/rpc-edges.js +301 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/runner.js +207 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/scan.js +49 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-aop.js +442 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-auto-configuration.js +264 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-config.js +440 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/structure.js +38 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/tools.js +89 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/types.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline.js +152 -0
- package/dist/core/code/engine/core/ingestion/process-processor.js +325 -0
- package/dist/core/code/engine/core/ingestion/resolve-references.js +205 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/constant-resolver.js +135 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django-root-discovery.js +221 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django.js +428 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/expo.js +39 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/fastapi-router-bindings.js +264 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/laravel.js +501 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/middleware.js +175 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/nextjs.js +81 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/php.js +25 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/python-const-resolver.js +307 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/response-shapes.js +299 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/route-path.js +71 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring-shared.js +310 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor-bridge.js +60 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor.js +1373 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/contract/scope-resolver.js +282 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +72 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/edges.js +194 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/ids.js +472 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +43 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +274 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +93 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/callable-value-flow.js +1240 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/compound-receiver.js +1174 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/free-call-fallback.js +873 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/imported-return-types.js +226 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/mro.js +107 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/overload-narrowing.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/property-dispatch.js +122 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1720 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/phase.js +395 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +208 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/registry.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/run.js +632 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +112 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/resolution-outcome.js +41 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/namespace-targets.js +81 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/walkers.js +1835 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/unresolved-receivers.js +242 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/utils/definition-id.js +22 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/workspace-index.js +151 -0
- package/dist/core/code/engine/core/ingestion/structure-processor.js +40 -0
- package/dist/core/code/engine/core/ingestion/tree-sitter-queries.js +2244 -0
- package/dist/core/code/engine/core/ingestion/ts-js-hoc-utils.js +115 -0
- package/dist/core/code/engine/core/ingestion/type-env.js +1136 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/c-cpp.js +555 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/csharp.js +570 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/dart.js +372 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/go.js +508 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/jvm.js +875 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/php.js +537 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/python.js +477 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/ruby.js +380 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/rust.js +502 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/shared.js +843 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/swift.js +490 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/types.js +2 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/typescript.js +690 -0
- package/dist/core/code/engine/core/ingestion/utils/ast-helpers.js +1693 -0
- package/dist/core/code/engine/core/ingestion/utils/call-analysis.js +779 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-flow-captures.js +932 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-labels.js +49 -0
- package/dist/core/code/engine/core/ingestion/utils/deferred-resolution-profile.js +151 -0
- package/dist/core/code/engine/core/ingestion/utils/effective-ram.js +67 -0
- package/dist/core/code/engine/core/ingestion/utils/env.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/event-loop.js +9 -0
- package/dist/core/code/engine/core/ingestion/utils/graph-sort.js +103 -0
- package/dist/core/code/engine/core/ingestion/utils/heap-probe.js +45 -0
- package/dist/core/code/engine/core/ingestion/utils/heritage-marker.js +47 -0
- package/dist/core/code/engine/core/ingestion/utils/line-base.js +24 -0
- package/dist/core/code/engine/core/ingestion/utils/max-file-size.js +59 -0
- package/dist/core/code/engine/core/ingestion/utils/method-props.js +198 -0
- package/dist/core/code/engine/core/ingestion/utils/qualified-name.js +73 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-captures.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-codec.js +188 -0
- package/dist/core/code/engine/core/ingestion/utils/scope-tree-walk.js +36 -0
- package/dist/core/code/engine/core/ingestion/utils/symbol-labels.js +48 -0
- package/dist/core/code/engine/core/ingestion/utils/template-arguments.js +187 -0
- package/dist/core/code/engine/core/ingestion/utils/type-parameters.js +209 -0
- package/dist/core/code/engine/core/ingestion/utils/verbose.js +6 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/c-cpp.js +133 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/csharp.js +66 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/dart.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/go.js +153 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/jvm.js +145 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/php.js +61 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/python.js +104 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/ruby.js +55 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/swift.js +91 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/typescript-javascript.js +86 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/generic.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/vue-sfc-extractor.js +544 -0
- package/dist/core/code/engine/core/ingestion/workers/callable-id.js +122 -0
- package/dist/core/code/engine/core/ingestion/workers/clone-safety.js +470 -0
- package/dist/core/code/engine/core/ingestion/workers/parse-worker.js +2456 -0
- package/dist/core/code/engine/core/ingestion/workers/post-result.js +90 -0
- package/dist/core/code/engine/core/ingestion/workers/quarantine.js +41 -0
- package/dist/core/code/engine/core/ingestion/workers/result-merge.js +59 -0
- package/dist/core/code/engine/core/ingestion/workers/worker-pool.js +1725 -0
- package/dist/core/code/engine/core/ingestion/workspace-config.js +139 -0
- package/dist/core/code/engine/core/lbug/conn-lock.js +72 -0
- package/dist/core/code/engine/core/lbug/csv-generator.js +710 -0
- package/dist/core/code/engine/core/lbug/cypher-escape.js +24 -0
- package/dist/core/code/engine/core/lbug/extension-load-error.js +339 -0
- package/dist/core/code/engine/core/lbug/extension-loader.js +261 -0
- package/dist/core/code/engine/core/lbug/graph-emit-sink.js +584 -0
- package/dist/core/code/engine/core/lbug/lbug-adapter.js +2703 -0
- package/dist/core/code/engine/core/lbug/lbug-config.js +1029 -0
- package/dist/core/code/engine/core/lbug/native-check.js +435 -0
- package/dist/core/code/engine/core/lbug/pool-adapter.js +973 -0
- package/dist/core/code/engine/core/lbug/query-params.js +25 -0
- package/dist/core/code/engine/core/lbug/query-result-utils.js +31 -0
- package/dist/core/code/engine/core/lbug/rel-pair-routing.js +373 -0
- package/dist/core/code/engine/core/lbug/schema.js +771 -0
- package/dist/core/code/engine/core/lbug/shutdown-helpers.js +40 -0
- package/dist/core/code/engine/core/lbug/sidecar-recovery.js +716 -0
- package/dist/core/code/engine/core/lbug/stdio-capture.js +49 -0
- package/dist/core/code/engine/core/lbug/sync-csv-writer.js +115 -0
- package/dist/core/code/engine/core/lbug/wal-checkpoint-driver.js +215 -0
- package/dist/core/code/engine/core/lbug/wal-driver-state.js +28 -0
- package/dist/core/code/engine/core/logger.js +339 -0
- package/dist/core/code/engine/core/platform/capabilities.js +91 -0
- package/dist/core/code/engine/core/run-analyze.js +1098 -0
- package/dist/core/code/engine/core/tree-sitter/parser-loader.js +281 -0
- package/dist/core/code/engine/core/tree-sitter/safe-parse.js +258 -0
- package/dist/core/code/engine/core/tree-sitter/vendored-grammars.js +64 -0
- package/dist/core/code/engine/lib/utils.js +121 -0
- package/dist/core/code/engine/mcp/core/lbug-adapter.js +27 -0
- package/dist/core/code/engine/mcp/local/aop-metadata.js +230 -0
- package/dist/core/code/engine/mcp/local/bean-metadata.js +49 -0
- package/dist/core/code/engine/mcp/local/limits.js +15 -0
- package/dist/core/code/engine/mcp/local/line-display.js +6 -0
- package/dist/core/code/engine/mcp/local/local-backend.js +4142 -0
- package/dist/core/code/engine/storage/branch-index.js +72 -0
- package/dist/core/code/engine/storage/file-hash.js +95 -0
- package/dist/core/code/engine/storage/fs-atomic.js +34 -0
- package/dist/core/code/engine/storage/git.js +555 -0
- package/dist/core/code/engine/storage/index-lock.js +664 -0
- package/dist/core/code/engine/storage/parse-cache.js +650 -0
- package/dist/core/code/engine/storage/parsedfile-store.js +620 -0
- package/dist/core/code/engine/storage/repo-manager.js +1061 -0
- package/dist/core/code/engine/storage/scope-index-store.js +247 -0
- package/dist/core/code/engine/types/pipeline.js +2 -0
- package/dist/core/code/scripts/install-duckdb-extension.mjs +125 -0
- package/dist/core/code/scripts/resolve-analyze-cmd.cjs +346 -0
- package/dist/core/code/shared/graph/types.js +8 -0
- package/dist/core/code/shared/index.js +105 -0
- package/dist/core/code/shared/integrations/circuit-breaker.js +242 -0
- package/dist/core/code/shared/integrations/resilient-fetch.js +224 -0
- package/dist/core/code/shared/integrations/retry.js +70 -0
- package/dist/core/code/shared/integrations/understand-quickly.js +145 -0
- package/dist/core/code/shared/language-detection.js +162 -0
- package/dist/core/code/shared/languages.js +27 -0
- package/dist/core/code/shared/lbug/schema-constants.js +98 -0
- package/dist/core/code/shared/mro-strategy.js +2 -0
- package/dist/core/code/shared/pipeline.js +5 -0
- package/dist/core/code/shared/scope-resolution/callable-flow-site.js +11 -0
- package/dist/core/code/shared/scope-resolution/def-index.js +53 -0
- package/dist/core/code/shared/scope-resolution/evidence-weights.js +87 -0
- package/dist/core/code/shared/scope-resolution/finalize-algorithm.js +807 -0
- package/dist/core/code/shared/scope-resolution/language-classification.js +46 -0
- package/dist/core/code/shared/scope-resolution/method-dispatch-index.js +100 -0
- package/dist/core/code/shared/scope-resolution/module-scope-index.js +59 -0
- package/dist/core/code/shared/scope-resolution/origin-priority.js +23 -0
- package/dist/core/code/shared/scope-resolution/parsed-file.js +54 -0
- package/dist/core/code/shared/scope-resolution/position-index.js +136 -0
- package/dist/core/code/shared/scope-resolution/qualified-name-index.js +77 -0
- package/dist/core/code/shared/scope-resolution/reference-site.js +24 -0
- package/dist/core/code/shared/scope-resolution/registries/class-registry.js +32 -0
- package/dist/core/code/shared/scope-resolution/registries/context.js +52 -0
- package/dist/core/code/shared/scope-resolution/registries/evidence.js +152 -0
- package/dist/core/code/shared/scope-resolution/registries/field-registry.js +33 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-core.js +392 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-qualified.js +58 -0
- package/dist/core/code/shared/scope-resolution/registries/macro-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/method-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/tie-breaks.js +63 -0
- package/dist/core/code/shared/scope-resolution/resolve-type-ref.js +128 -0
- package/dist/core/code/shared/scope-resolution/scope-id.js +49 -0
- package/dist/core/code/shared/scope-resolution/scope-tree.js +225 -0
- package/dist/core/code/shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/core/code/shared/scope-resolution/types.js +25 -0
- package/dist/core/code/shared/test-helpers.js +17 -0
- package/dist/core/code/vendor/leiden/index.cjs +355 -0
- package/dist/core/code/vendor/leiden/utils.cjs +419 -0
- package/dist/core/features/scanner.d.ts +2 -0
- package/dist/core/features/scanner.d.ts.map +1 -1
- package/dist/core/features/scanner.js +27 -6
- package/dist/core/features/scanner.js.map +1 -1
- package/dist/core/timeline/cli.d.ts.map +1 -1
- package/dist/core/timeline/cli.js +13 -6
- package/dist/core/timeline/cli.js.map +1 -1
- package/dist/core/timeline/debris.d.ts +20 -0
- package/dist/core/timeline/debris.d.ts.map +1 -0
- package/dist/core/timeline/debris.js +124 -0
- package/dist/core/timeline/debris.js.map +1 -0
- package/dist/core/timeline/hook-runner.d.ts.map +1 -1
- package/dist/core/timeline/hook-runner.js +3 -1
- package/dist/core/timeline/hook-runner.js.map +1 -1
- package/dist/core/timeline/hooks.d.ts.map +1 -1
- package/dist/core/timeline/hooks.js +13 -5
- package/dist/core/timeline/hooks.js.map +1 -1
- package/dist/core/timeline/installer.d.ts +2 -0
- package/dist/core/timeline/installer.d.ts.map +1 -1
- package/dist/core/timeline/installer.js +12 -0
- package/dist/core/timeline/installer.js.map +1 -1
- package/dist/core/timeline/project-root.d.ts +21 -0
- package/dist/core/timeline/project-root.d.ts.map +1 -0
- package/dist/core/timeline/project-root.js +83 -0
- package/dist/core/timeline/project-root.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# 场景模板:改动型
|
|
2
|
+
|
|
3
|
+
本文件是 `write-delivery-guide` 的「改动型」形态场景模板——统一六项结构:判断特征 / 故事线主轴 / 讲解维度要求 / 图表类型 / 完整参考案例 / 常见讲错。生成交付讲解时 Read 本文件并照此生成。
|
|
4
|
+
|
|
5
|
+
> ⚠️ **本模板参考案例为拟真案例,待真实使用替换**(第一次真实改动交付后,用实际生成的讲解替换参考案例,并借此校准本模板六项)。
|
|
6
|
+
|
|
7
|
+
## 判断特征
|
|
8
|
+
|
|
9
|
+
- diff 以修改/删除既有代码为主(不是以新增文件为主);
|
|
10
|
+
- 触碰既有流程:状态机、既有接口行为、既有任务/事件的逻辑;
|
|
11
|
+
- spec 中表述为「修改/调整既有行为」,常伴随兼容性说明与需保留行为清单。
|
|
12
|
+
|
|
13
|
+
## 故事线主轴
|
|
14
|
+
|
|
15
|
+
**原流程中的部位**:先讲改动前的原故事线(读者已有的心智地图),再标出改动落在第几步。读者关心的第一问题是「改在我熟悉的流程的哪里」,不是「改了几个文件」。
|
|
16
|
+
|
|
17
|
+
## 讲解维度要求
|
|
18
|
+
|
|
19
|
+
1. **原流程全景**:改动前的完整故事线,高亮改动部位;
|
|
20
|
+
2. **前后对比**:之前什么样 → 现在什么样(两边各一句话逻辑 + 关键代码位置);
|
|
21
|
+
3. **为什么改**:来自 spec / 任务上下文,一句话;
|
|
22
|
+
4. **波及范围**:谁会受影响——逐个判断调用方、相关场景、定时任务、数据,列成表;
|
|
23
|
+
5. **什么没变**:显式列出需保留的行为(取自 spec「需保留行为」),让接收者确认既有行为安全;
|
|
24
|
+
6. 改动的组件按四问展开(见 SKILL.md 通用规则)。
|
|
25
|
+
|
|
26
|
+
## 图表类型
|
|
27
|
+
|
|
28
|
+
全景与改动定位用 flowchart / stateDiagram,改动部位用虚线或标注高亮;前后对比可用表格辅助。
|
|
29
|
+
|
|
30
|
+
## 完整参考案例
|
|
31
|
+
|
|
32
|
+
> 拟真案例(待真实使用替换):
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# 交付讲解:订单状态机加入退款分支
|
|
37
|
+
|
|
38
|
+
## 1. 30 秒看懂
|
|
39
|
+
|
|
40
|
+
给订单流程加了一条退款分支:订单支付完成后可以进入 REFUNDING,退款处理完毕回到 PAID 或终态 REFUNDED。只改了状态机的流转部位,下单与支付流程不变。
|
|
41
|
+
|
|
42
|
+
## 2. 全景(高亮改动部位)
|
|
43
|
+
|
|
44
|
+
```mermaid
|
|
45
|
+
flowchart LR
|
|
46
|
+
A[下单 CREATED] --> B[支付 PAID]
|
|
47
|
+
B --> C[发货 SHIPPED]
|
|
48
|
+
B --> D[关单 CLOSED]
|
|
49
|
+
B -. 本次新增 .-> E[退款中 REFUNDING]
|
|
50
|
+
E -. 取消 .-> B
|
|
51
|
+
E -. 成功 .-> F[已退款 REFUNDED]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 3. 场景故事线:原流程与改动部位
|
|
55
|
+
|
|
56
|
+
**原流程**(改动前):下单 → 支付 → {发货 | 关单}——PAID 之后只能去 SHIPPED / CLOSED。
|
|
57
|
+
|
|
58
|
+
**改动部位**:在「支付完成」这个环节之后,插入一条退款分支(上图虚线)。其余环节不变。
|
|
59
|
+
|
|
60
|
+
**为什么改**:业务要求支持支付后退款(spec:订单在发货前允许申请退款)。
|
|
61
|
+
|
|
62
|
+
## 4. 组件挂接(改动涉及的组件)
|
|
63
|
+
|
|
64
|
+
### `OrderStateMachine` — 状态流转注册(核心改动)
|
|
65
|
+
|
|
66
|
+
- **何时用**:任何推动订单状态的入口(支付回调、发货、关单、新增的退款入口)都会经过它
|
|
67
|
+
- **做什么**(改动后):PAID 的合法后继从 {SHIPPED, CLOSED} 扩为 {SHIPPED, CLOSED, REFUNDING};新增 REFUNDING 的两条出边(退款成功 → REFUNDED,退款取消 → 回 PAID)
|
|
68
|
+
- **用了之后使什么成为可能**:退款入口可以合法推动订单进入退款中
|
|
69
|
+
- **挂点**:各状态变更入口 → 本组件 → 下游按状态分发的逻辑
|
|
70
|
+
- 代码:`OrderStateMachine.java:45-67`(改动前仅 45 行的两条注册)
|
|
71
|
+
|
|
72
|
+
### `OrderCloseJob` — 关单定时任务(适配改动)
|
|
73
|
+
|
|
74
|
+
- **何时用**:定时扫描超时未发货订单并关单(既有任务,本次只加过滤)
|
|
75
|
+
- **做什么**(改动后):扫描 PAID 超时订单时**排除 REFUNDING**——退款中的订单不应被关单
|
|
76
|
+
- **用了之后使什么成为可能**:新分支不会误伤既有关单逻辑
|
|
77
|
+
- **挂点**:定时触发 → 本任务 → 订单置 CLOSED
|
|
78
|
+
- 代码:`OrderCloseJob.java:30`
|
|
79
|
+
|
|
80
|
+
## 5. 改动定位:前后对比与波及
|
|
81
|
+
|
|
82
|
+
| | 之前 | 现在 |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| PAID 可流转到 | SHIPPED / CLOSED | SHIPPED / CLOSED / **REFUNDING** |
|
|
85
|
+
| REFUNDING 流转到 | —(无此状态) | 退款成功 → REFUNDED;退款取消 → 回 PAID |
|
|
86
|
+
|
|
87
|
+
**波及范围**(逐个判断):
|
|
88
|
+
|
|
89
|
+
| 受影响方 | 影响 |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `OrderCloseJob` 关单定时任务 | 原扫描「所有 PAID 状态订单」——现在必须排除 REFUNDING,否则会把退款中的订单关掉(已处理) |
|
|
92
|
+
| 订单列表页状态筛选 | 需要新增 REFUNDING 枚举展示(本次只交付后端枚举与接口返回,前端后续需求) |
|
|
93
|
+
| 发货流程 | 不受影响——SHIPPED 前置仍是 PAID,退款分支是并行岔路不是串行 |
|
|
94
|
+
|
|
95
|
+
**什么没变**:下单、支付回调、发货流程、关单规则(除排除 REFUNDING 外)。
|
|
96
|
+
|
|
97
|
+
## 6. 已验证与已知边界
|
|
98
|
+
|
|
99
|
+
- 已验证:PAID → REFUNDING → REFUNDED;退款取消回 PAID;关单任务不再误关 REFUNDING 订单。
|
|
100
|
+
- 已知边界:部分退款本次不支持(业务确认 v1 砍掉)。
|
|
101
|
+
|
|
102
|
+
## 7. 导读入口
|
|
103
|
+
|
|
104
|
+
以上任何一节都可以追问,例如:
|
|
105
|
+
|
|
106
|
+
- 「为什么退款取消回到 PAID,而不是单独加一个状态?」
|
|
107
|
+
- 「除了关单任务,还有哪些地方扫描 PAID 状态?」
|
|
108
|
+
- 「REFUNDING 中的订单,用户再次下单/再次支付会被拦截吗?」
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
(参考案例完)
|
|
113
|
+
|
|
114
|
+
## 常见讲错
|
|
115
|
+
|
|
116
|
+
- ❌ 只列改动的文件/函数,不把它放回原流程——接收者找不到改动部位;
|
|
117
|
+
- ❌ 只讲新逻辑,不讲原来是什么样——没有前后对比就看不出「改了什么」;
|
|
118
|
+
- ❌ 漏波及范围——不讲哪些调用方/定时任务/场景受影响;
|
|
119
|
+
- ❌ 全景图不高亮改动范围——接收者误以为整条流程都变了;
|
|
120
|
+
- ❌ 不讲「什么没变」——接收者无法确认既有行为是否安全。
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# 场景模板:多角色流程
|
|
2
|
+
|
|
3
|
+
本文件是 `write-delivery-guide` 的「多角色流程」形态场景模板——统一六项结构:判断特征 / 故事线主轴 / 讲解维度要求 / 图表类型 / 完整参考案例 / 常见讲错。生成交付讲解时 Read 本文件并照此生成。
|
|
4
|
+
|
|
5
|
+
## 判断特征
|
|
6
|
+
|
|
7
|
+
- 交付包含服务不同角色的多个接口/入口(如申请人 / 审批人 / 管理员);
|
|
8
|
+
- 流程有明确环节,环节之间有状态流转(草稿 → 已提交 → 通过/拒绝 之类);
|
|
9
|
+
- spec 中有角色、环节、状态流转章节。
|
|
10
|
+
|
|
11
|
+
## 故事线主轴
|
|
12
|
+
|
|
13
|
+
**角色 × 环节**:谁在第几步干什么。读者的心智索引是「那条用户提交、管理员审批的流程」,不是「那 6 个接口」——先给故事,接口挂在故事环节上。
|
|
14
|
+
|
|
15
|
+
## 讲解维度要求
|
|
16
|
+
|
|
17
|
+
1. **故事线表**:环节 / 谁 / 干什么 / 入口,一步一行;
|
|
18
|
+
2. **一次完整走查**:至少一个带真实角色与数据的请求走查(故事式);
|
|
19
|
+
3. **状态流转讲透**:哪个接口把状态从哪推到哪、哪个状态驱动哪个接口可见(如待办列表由 PENDING 驱动)——这是多角色流程最容易漏的暗线;
|
|
20
|
+
4. **角色边界**:哪些接口属于哪个角色、谁能看见什么;
|
|
21
|
+
5. 每个接口按四问展开(见 SKILL.md 通用规则)。
|
|
22
|
+
|
|
23
|
+
## 图表类型
|
|
24
|
+
|
|
25
|
+
全景节用 flowchart(按角色分组);故事线可用 sequenceDiagram;状态流转用 stateDiagram。
|
|
26
|
+
|
|
27
|
+
## 完整参考案例
|
|
28
|
+
|
|
29
|
+
以下是「审批流」交付的讲解全文(真实交付场景)。生成时模仿它的结构与讲解深度:
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# 交付讲解:审批流
|
|
34
|
+
|
|
35
|
+
## 1. 30 秒看懂
|
|
36
|
+
|
|
37
|
+
给系统加了一条完整的「申请人发起 → 管理员审批」链路:申请人创建并提交审批,管理员在待办里看到并处理,通过后触发下游流程,拒绝后申请人可修改重提。本次交付全部为新增代码,未改动既有逻辑。
|
|
38
|
+
|
|
39
|
+
## 2. 全景
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
flowchart LR
|
|
43
|
+
subgraph A1[申请人]
|
|
44
|
+
A11[创建草稿] --> A12[提交审批]
|
|
45
|
+
end
|
|
46
|
+
subgraph M1[管理员]
|
|
47
|
+
B11[待办列表] --> B12[查看详情] --> B13{通过 / 拒绝}
|
|
48
|
+
end
|
|
49
|
+
A12 -->|状态 PENDING| B11
|
|
50
|
+
B13 -->|通过 APPROVED| C[下游通知/回调]
|
|
51
|
+
B13 -->|拒绝 REJECTED| A11
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
本次交付覆盖上图全部环节(均为新增)。
|
|
55
|
+
|
|
56
|
+
## 3. 场景故事线:审批流(角色:申请人 / 管理员)
|
|
57
|
+
|
|
58
|
+
| 环节 | 谁 | 干什么 | 入口 |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| 1 | 申请人 | 创建审批草稿 | `POST /approvals/draft` |
|
|
61
|
+
| 2 | 申请人 | 提交,进入审批流程 | `POST /approvals/{id}/submit` |
|
|
62
|
+
| 3 | 管理员 | 待办列表看到这条审批 | `GET /approvals/todo` |
|
|
63
|
+
| 4 | 管理员 | 查看审批详情 | `GET /approvals/{id}` |
|
|
64
|
+
| 5 | 管理员 | 通过或拒绝 | `POST /approvals/{id}/approve` / `reject` |
|
|
65
|
+
|
|
66
|
+
**一次审批走查**:张三要请假——先创建草稿(状态 DRAFT,可反复修改),确认后提交 → 状态变为 PENDING,系统给管理员生成一条待办 → 管理员李四打开待办列表看到「张三 · 请假」→ 点进详情查看 → 点通过:状态 APPROVED,张三收到通知,下游考勤流程触发;若拒绝:状态 REJECTED,张三可修改草稿后重新提交(回到环节 1)。
|
|
67
|
+
|
|
68
|
+
## 4. 组件挂接
|
|
69
|
+
|
|
70
|
+
### `POST /approvals/draft` — 创建草稿(环节 1)
|
|
71
|
+
|
|
72
|
+
- **何时用**:申请人开始填写审批时;无前置
|
|
73
|
+
- **做什么**:创建一条审批记录,状态初始化为 DRAFT
|
|
74
|
+
- **用了之后使什么成为可能**:草稿可反复修改、可提交(解锁环节 2)
|
|
75
|
+
- **挂点**:(入口)→ 本接口 → submit
|
|
76
|
+
- 副作用:`approval` 表 +1 行
|
|
77
|
+
- 代码:`ApprovalController.java:32` → `ApprovalService.createDraft()`
|
|
78
|
+
|
|
79
|
+
### `POST /approvals/{id}/submit` — 提交(环节 2)
|
|
80
|
+
|
|
81
|
+
- **何时用**:申请人填完草稿、要正式进入流程;前置:草稿存在且状态 = DRAFT
|
|
82
|
+
- **做什么**:校验必填 → 状态 DRAFT → PENDING → 给管理员生成待办
|
|
83
|
+
- **用了之后使什么成为可能**:这条审批出现在管理员待办列表(解锁环节 3)
|
|
84
|
+
- **挂点**:draft → 本接口 → 管理员待办
|
|
85
|
+
- 副作用:`approval.status` 变更、`todo` 表 +1 行、发通知
|
|
86
|
+
- 代码:`ApprovalService.java:58`
|
|
87
|
+
|
|
88
|
+
### `GET /approvals/todo` — 待办列表(环节 3)
|
|
89
|
+
|
|
90
|
+
- **何时用**:管理员打开待办页;须有审批权限
|
|
91
|
+
- **做什么**:查出本管理员权限范围内状态为 PENDING 的审批,返回列表
|
|
92
|
+
- **用了之后使什么成为可能**:管理员选择一条去处理(解锁环节 4)
|
|
93
|
+
- **挂点**:submit → 本接口 → 详情
|
|
94
|
+
- 关键点:列表由状态 = PENDING 驱动——是 submit 让数据出现在这里
|
|
95
|
+
- 代码:`ApprovalQueryController.java:21`
|
|
96
|
+
|
|
97
|
+
### `GET /approvals/{id}` — 查看详情(环节 4)
|
|
98
|
+
|
|
99
|
+
- **何时用**:管理员处理前看审批内容;前置:对该条有可见权限
|
|
100
|
+
- **做什么**:返回审批完整内容 + 附件信息 + 当前状态
|
|
101
|
+
- **用了之后使什么成为可能**:管理员能做出通过/拒绝决策(解锁环节 5)
|
|
102
|
+
- **挂点**:待办列表 → 本接口 → approve/reject
|
|
103
|
+
- 代码:`ApprovalQueryController.java:44`
|
|
104
|
+
|
|
105
|
+
### `POST /approvals/{id}/approve` — 通过(环节 5a)
|
|
106
|
+
|
|
107
|
+
- **何时用**:管理员决定通过;前置:状态 = PENDING 且有审批权限
|
|
108
|
+
- **做什么**:状态 PENDING → APPROVED → 移除待办 → 触发下游(通知 + 业务回调)
|
|
109
|
+
- **用了之后使什么成为可能**:审批生效,下游业务被触发
|
|
110
|
+
- **挂点**:详情 → 本接口 → 下游流程
|
|
111
|
+
- 副作用:`approval.status` 变更、`todo` 删行、发事件
|
|
112
|
+
- 代码:`ApprovalService.java:87`
|
|
113
|
+
|
|
114
|
+
### `POST /approvals/{id}/reject` — 拒绝(环节 5b)
|
|
115
|
+
|
|
116
|
+
- **何时用**:管理员决定拒绝;前置同通过
|
|
117
|
+
- **做什么**:状态 PENDING → REJECTED → 移除待办 → 记录拒绝原因 → 通知申请人
|
|
118
|
+
- **用了之后使什么成为可能**:申请人可修改草稿后重新提交(回到环节 1)
|
|
119
|
+
- **挂点**:详情 → 本接口 → 申请人修改重提
|
|
120
|
+
- 代码:`ApprovalService.java:112`
|
|
121
|
+
|
|
122
|
+
## 5. 改动定位
|
|
123
|
+
|
|
124
|
+
(本次交付全部为新增,未改动既有流程,此节省略。有改动已有流程时按改动型模板生成。)
|
|
125
|
+
|
|
126
|
+
## 6. 已验证与已知边界
|
|
127
|
+
|
|
128
|
+
- 已验证:提交 → 通过 → 下游触发全链路;拒绝 → 修改重提;待办列表由 PENDING 状态驱动。
|
|
129
|
+
- 已知边界:审批撤回本次不支持(业务已确认砍掉);会签/加签在下一期。
|
|
130
|
+
|
|
131
|
+
## 7. 导读入口
|
|
132
|
+
|
|
133
|
+
以上任何一节都可以追问,例如:
|
|
134
|
+
|
|
135
|
+
- 「为什么待办列表依赖 PENDING 状态,而不是单独维护一张待办表?」
|
|
136
|
+
- 「连续点两次通过会怎样(幂等)?」
|
|
137
|
+
- 「通过时触发的下游回调失败了怎么办?」
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
(参考案例完)
|
|
142
|
+
|
|
143
|
+
## 常见讲错
|
|
144
|
+
|
|
145
|
+
- ❌ 按接口清单逐个列协议,没有故事线——接收者无法重建场景;
|
|
146
|
+
- ❌ 只讲参数返回值,不讲何时用、谁触发;
|
|
147
|
+
- ❌ 漏掉状态流转暗线——没讲哪个状态驱动待办/可见性接口;
|
|
148
|
+
- ❌ 不标角色边界——分不清哪些接口是申请人的、哪些是管理员的。
|
|
@@ -40,6 +40,8 @@ description: 基于 write-unit-test-spec 产出的测试规格文档 + 已有实
|
|
|
40
40
|
|
|
41
41
|
## 流程
|
|
42
42
|
|
|
43
|
+
**前置(每次执行,先于步骤 1):读测试规范** `docs/guides/testing-standards.md` —— 约束步骤 4 测试文件产出:测试目录与命名(规范「目录与命名(偏离项)」优先于测试规格的骨架映射)、框架与文件后缀、Mock 政策与 fixture 组织、单测/集成边界。**缺失 → 中断,提示用户先跑 `/init-project-guides` 补齐**,用户明确表示不需要规范才可继续——不对齐项目约定的测试代码,合并时全是返工。
|
|
44
|
+
|
|
43
45
|
### 1. 前置检查
|
|
44
46
|
|
|
45
47
|
- 确认 `docs/features/<feature-id>/<前缀>-单元测试-spec.md` 存在。**不存在 → 报错退出**:"找不到测试规格,请先跑 /write-unit-test-spec"。不现场派生场景。
|
|
@@ -66,21 +68,36 @@ description: 基于 write-unit-test-spec 产出的测试规格文档 + 已有实
|
|
|
66
68
|
|
|
67
69
|
### 4. 产出测试文件(断言填实)
|
|
68
70
|
|
|
69
|
-
写到 `<项目测试目录>/<feature-id>.test.ts`(
|
|
71
|
+
写到 `<项目测试目录>/<feature-id>.test.ts`(命名/后缀:测试规范「目录与命名(偏离项)」优先,其次测试规格的"骨架映射"节)。形态:
|
|
70
72
|
|
|
71
73
|
- 实现已就绪的场景 → `describe` + `it`(含真实断言,基于读到的签名写,能真跑)
|
|
72
74
|
- 实现缺失的场景 → `it.skip` + `// TODO: 实现提供后填实` 占位
|
|
73
75
|
- import 被目标(已存在的模块直接 import;不存在的标 TODO 注释,不强行 import)
|
|
74
|
-
- 框架(vitest/jest/...)
|
|
76
|
+
- 框架(vitest/jest/...)和文件后缀按测试规范,规范未写按项目既有约定
|
|
75
77
|
- 已有同模块测试文件 → 文件名加后缀避免覆盖(如 `<feature-id>.补充.test.ts`),在报告里提示"已有 X,是否合并由用户判断"
|
|
76
78
|
|
|
77
|
-
**AI 自己发挥的空间**:fixture / mock 怎么组织、describe
|
|
79
|
+
**AI 自己发挥的空间**:fixture / mock 怎么组织、describe 嵌套多深、断言写多细——测试规范有约定按约定(Mock 政策 / fixture 组织),未约定处 agent 按既有测试风格判断,不强加模板。
|
|
78
80
|
|
|
79
81
|
### 5. 跑测试验证 + 产出测试报告
|
|
80
82
|
|
|
81
83
|
跑一次项目的测试命令(如 `npm test`),确认新写的测试能跑(通过或失败都行,失败说明实现有 bug 或测试断言写错)。
|
|
82
84
|
|
|
83
|
-
**产出单元测试报告**,写到 `docs/features/<feature-id>/<前缀>-单元测试报告.md
|
|
85
|
+
**产出单元测试报告**,写到 `docs/features/<feature-id>/<前缀>-单元测试报告.md`。头部直接写入(测试人取 `git config user.name`,不问用户),正文结构轻量,至少包含:
|
|
86
|
+
|
|
87
|
+
**头部样例**:
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
# 单元测试报告: <需求名称>
|
|
91
|
+
|
|
92
|
+
> feature-id: <feature-id>
|
|
93
|
+
> 测试人: <git config user.name>
|
|
94
|
+
> 测试时间: <YYYY-MM-DD>
|
|
95
|
+
> 关联测试规格: <前缀>-单元测试-spec.md
|
|
96
|
+
> 关联被测实现: <实现代码路径,多个逐行列出>
|
|
97
|
+
> 关联测试代码: <测试文件路径;补充测试文件一并列出>
|
|
98
|
+
> 测试框架: <如 JUnit 4.13.2 + Mockito / vitest 2.x>
|
|
99
|
+
> 运行时: <如 JDK 17.0.19(homebrew openjdk@17)/ Node v22.x>
|
|
100
|
+
```
|
|
84
101
|
|
|
85
102
|
- 测试概况:总数 / 通过 / 失败 / 跳过(it.skip 占位)/ 时长
|
|
86
103
|
- 逐场景详细结果:每个 `it` 的通过/失败/跳过 + 入参 + 执行过程 + 断言判定 + 失败原因(如有)
|
|
@@ -193,7 +210,7 @@ it.skip('权限不足应返回 403', () => {
|
|
|
193
210
|
| 产物 | 路径 | 形态 |
|
|
194
211
|
|---|---|---|
|
|
195
212
|
| 测试文件 | `<项目测试目录>/<feature-id>.test.ts` | describe + `it`(断言填实) / `it.skip`(实现待补) |
|
|
196
|
-
| 单元测试报告 | `docs/features/<feature-id>/<前缀>-单元测试报告.md` | 测试概况 + 逐场景结果 + 偏差小结 + 下一步建议 |
|
|
213
|
+
| 单元测试报告 | `docs/features/<feature-id>/<前缀>-单元测试报告.md` | 头部溯源(测试人/时间/关联产物/环境)+ 测试概况 + 逐场景结果 + 偏差小结 + 下一步建议 |
|
|
197
214
|
|
|
198
215
|
## 边界场景
|
|
199
216
|
|
|
@@ -211,7 +228,7 @@ it.skip('权限不足应返回 403', () => {
|
|
|
211
228
|
- 不修实现代码(失败如实报告)
|
|
212
229
|
- 不假装通过(断言不调到假绿)
|
|
213
230
|
- 不引入硬 gate(precommit hook / 提交拦截)
|
|
214
|
-
- 不假设测试框架(
|
|
231
|
+
- 不假设测试框架(从测试规范、测试规格的骨架映射读,或运行时探测)
|
|
215
232
|
- 不改 write-unit-test-spec / implementation / write-plan(它们对本 skill 零依赖)
|
|
216
233
|
|
|
217
234
|
## 和其他 skill 的关系
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Project-local `.cgraphrc` support for `cgraph analyze` (#243).
|
|
4
|
+
*
|
|
5
|
+
* Lets a repository commit recurring `analyze` defaults — embedding knobs,
|
|
6
|
+
* worker tuning, registry naming — so contributors don't re-pass the same
|
|
7
|
+
* flags on every run. Design rules:
|
|
8
|
+
*
|
|
9
|
+
* - Config is repo-local (`.cgraphrc` at the resolved repo root). It is NOT
|
|
10
|
+
* read from `.cgraphx/code/` because that directory is index storage and is
|
|
11
|
+
* commonly gitignored.
|
|
12
|
+
* - JSON only. No YAML, no `package.json` field, no global `~/.cgraphx/code`
|
|
13
|
+
* file in this pass.
|
|
14
|
+
* - CLI flags always override config (see {@link mergeAnalyzeOptions}).
|
|
15
|
+
* - Fail closed: unknown keys, wrong value types, and invalid JSON all throw
|
|
16
|
+
* {@link GitNexusRcError} so a typo never silently no-ops. Errors are
|
|
17
|
+
* actionable and surface before any expensive analysis.
|
|
18
|
+
* - Config values never reach a shell. Strings are validated against control
|
|
19
|
+
* and hidden/bidirectional characters.
|
|
20
|
+
*
|
|
21
|
+
* Both a flat shape and a nested `analyze` block are accepted:
|
|
22
|
+
*
|
|
23
|
+
* { "pdg": true, "workerTimeout": 60 }
|
|
24
|
+
* { "analyze": { "pdg": true } }
|
|
25
|
+
*
|
|
26
|
+
* When both set the same option, the nested `analyze` block wins (deterministic,
|
|
27
|
+
* documented precedence).
|
|
28
|
+
*/
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.GitNexusRcError = exports.CGRAPH_RC_FILENAME = void 0;
|
|
34
|
+
exports.validateBranchName = validateBranchName;
|
|
35
|
+
exports.sanitizeDetectedBranch = sanitizeDetectedBranch;
|
|
36
|
+
exports.loadAnalyzeConfig = loadAnalyzeConfig;
|
|
37
|
+
exports.mergeAnalyzeOptions = mergeAnalyzeOptions;
|
|
38
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
39
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
40
|
+
exports.CGRAPH_RC_FILENAME = '.cgraphrc';
|
|
41
|
+
/** Git refs longer than this are almost certainly a mistake / injection attempt. */
|
|
42
|
+
const BRANCH_MAX_LENGTH = 255;
|
|
43
|
+
/**
|
|
44
|
+
* Thrown for any `.cgraphrc` problem (missing-file is NOT an error — it
|
|
45
|
+
* returns `undefined`). The message is user-facing and names the file so the
|
|
46
|
+
* CLI can print it verbatim before starting the progress bar.
|
|
47
|
+
*/
|
|
48
|
+
class GitNexusRcError extends Error {
|
|
49
|
+
constructor(message) {
|
|
50
|
+
super(message);
|
|
51
|
+
this.name = 'GitNexusRcError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.GitNexusRcError = GitNexusRcError;
|
|
55
|
+
/** Allowed `.cgraphrc` keys and how each maps onto `AnalyzeOptions`. */
|
|
56
|
+
const KEY_SPECS = {
|
|
57
|
+
name: { target: 'name', kind: 'string' },
|
|
58
|
+
allowDuplicateName: { target: 'allowDuplicateName', kind: 'boolean' },
|
|
59
|
+
maxFileSize: { target: 'maxFileSize', kind: 'numeric-string' },
|
|
60
|
+
workerTimeout: { target: 'workerTimeout', kind: 'numeric-string' },
|
|
61
|
+
walCheckpointThreshold: { target: 'walCheckpointThreshold', kind: 'numeric-string' },
|
|
62
|
+
workers: { target: 'workers', kind: 'numeric-string' },
|
|
63
|
+
// #1589/#1852 residual — extra fetch-wrapper function names to treat as HTTP
|
|
64
|
+
// consumers. The auto-detector only flags functions that call the bare global
|
|
65
|
+
// `fetch()`; a wrapper built on axios / a custom client, or named outside the
|
|
66
|
+
// built-in convention set, is otherwise invisible to route_map consumers.
|
|
67
|
+
// Listing it here adds it to the cross-file consumer scan.
|
|
68
|
+
fetchWrappers: { target: 'fetchWrappers', kind: 'string-array' },
|
|
69
|
+
};
|
|
70
|
+
/** Top-level container key for the nested form; not itself an `AnalyzeOptions` field. */
|
|
71
|
+
const NESTED_KEY = 'analyze';
|
|
72
|
+
const ALLOWED_KEYS_HINT = `Allowed keys: ${Object.keys(KEY_SPECS).join(', ')} (or a nested "${NESTED_KEY}" object).`;
|
|
73
|
+
/**
|
|
74
|
+
* Reject control characters and hidden / bidirectional Unicode in a string
|
|
75
|
+
* value. These have no legitimate place in a branch name, registry name, or
|
|
76
|
+
* device string, and would otherwise let a committed config smuggle invisible
|
|
77
|
+
* controls into downstream consumers.
|
|
78
|
+
*/
|
|
79
|
+
const isHiddenOrControl = (codePoint) => codePoint < 0x20 ||
|
|
80
|
+
codePoint === 0x7f ||
|
|
81
|
+
(codePoint >= 0x200b && codePoint <= 0x200f) || // zero-width + LRM/RLM
|
|
82
|
+
(codePoint >= 0x202a && codePoint <= 0x202e) || // bidi embeddings/overrides
|
|
83
|
+
(codePoint >= 0x2060 && codePoint <= 0x2064) || // word-joiner + invisible math
|
|
84
|
+
(codePoint >= 0x2066 && codePoint <= 0x206f) || // bidi isolates + deprecated
|
|
85
|
+
codePoint === 0xfeff; // BOM / zero-width no-break space
|
|
86
|
+
const assertNoHiddenChars = (value, source) => {
|
|
87
|
+
for (const ch of value) {
|
|
88
|
+
const cp = ch.codePointAt(0);
|
|
89
|
+
if (cp !== undefined && isHiddenOrControl(cp)) {
|
|
90
|
+
throw new GitNexusRcError(`${source}: value contains control or hidden/bidirectional characters, which are not allowed.`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Validate a user-supplied branch name (from CLI or `.cgraphrc`). Returns the
|
|
96
|
+
* trimmed name or throws {@link GitNexusRcError}. Conservative but accepts the
|
|
97
|
+
* shapes real branches use (`feature/foo-bar`, `release/1.2`, `develop`).
|
|
98
|
+
*/
|
|
99
|
+
function validateBranchName(value, source) {
|
|
100
|
+
const trimmed = value.trim();
|
|
101
|
+
if (!trimmed) {
|
|
102
|
+
throw new GitNexusRcError(`${source}: branch name must not be empty.`);
|
|
103
|
+
}
|
|
104
|
+
if (trimmed.length > BRANCH_MAX_LENGTH) {
|
|
105
|
+
throw new GitNexusRcError(`${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}).`);
|
|
106
|
+
}
|
|
107
|
+
assertNoHiddenChars(trimmed, source);
|
|
108
|
+
if (/\s/.test(trimmed)) {
|
|
109
|
+
throw new GitNexusRcError(`${source}: branch name must not contain whitespace.`);
|
|
110
|
+
}
|
|
111
|
+
// git ref-name rules (subset): reject characters git itself forbids in refs.
|
|
112
|
+
if (/[~^:?*[\\]/.test(trimmed)) {
|
|
113
|
+
throw new GitNexusRcError(`${source}: branch name contains characters not allowed in a git ref (~ ^ : ? * [ \\).`);
|
|
114
|
+
}
|
|
115
|
+
if (trimmed.startsWith('-')) {
|
|
116
|
+
throw new GitNexusRcError(`${source}: branch name must not start with "-".`);
|
|
117
|
+
}
|
|
118
|
+
if (trimmed.includes('..')) {
|
|
119
|
+
throw new GitNexusRcError(`${source}: branch name must not contain "..".`);
|
|
120
|
+
}
|
|
121
|
+
// Git permits a backtick in a ref, but branch labels surface in user-facing
|
|
122
|
+
// messages and registry metadata; a backtick is rejected at this single
|
|
123
|
+
// chokepoint so all tiers (CLI flag, auto-detect via sanitizeDetectedBranch)
|
|
124
|
+
// are covered (#1996 tri-review P1).
|
|
125
|
+
if (trimmed.includes('`')) {
|
|
126
|
+
throw new GitNexusRcError(`${source}: branch name must not contain a backtick.`);
|
|
127
|
+
}
|
|
128
|
+
return trimmed;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Best-effort validation for an auto-detected branch (from git). Never throws —
|
|
132
|
+
* returns `undefined` for anything unusable so the resolver falls back to the
|
|
133
|
+
* next precedence tier.
|
|
134
|
+
*/
|
|
135
|
+
function sanitizeDetectedBranch(value) {
|
|
136
|
+
if (!value)
|
|
137
|
+
return undefined;
|
|
138
|
+
try {
|
|
139
|
+
return validateBranchName(value, 'detected branch');
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const normalizeValue = (kind, value, key) => {
|
|
146
|
+
const source = `${exports.CGRAPH_RC_FILENAME} "${key}"`;
|
|
147
|
+
switch (kind) {
|
|
148
|
+
case 'boolean':
|
|
149
|
+
if (typeof value !== 'boolean') {
|
|
150
|
+
throw new GitNexusRcError(`${source} must be a boolean (true/false).`);
|
|
151
|
+
}
|
|
152
|
+
return value;
|
|
153
|
+
case 'string': {
|
|
154
|
+
if (typeof value !== 'string') {
|
|
155
|
+
throw new GitNexusRcError(`${source} must be a string.`);
|
|
156
|
+
}
|
|
157
|
+
const trimmed = value.trim();
|
|
158
|
+
if (!trimmed) {
|
|
159
|
+
throw new GitNexusRcError(`${source} must not be empty.`);
|
|
160
|
+
}
|
|
161
|
+
assertNoHiddenChars(trimmed, source);
|
|
162
|
+
// `name` flows into registry metadata and user-facing messages, so a
|
|
163
|
+
// Markdown-significant character is rejected (#1996 tri-review P1). `_`
|
|
164
|
+
// is intentionally allowed (legitimate in repo names). embeddingDevice
|
|
165
|
+
// (the other `string`-kind option) only ever holds a fixed device token,
|
|
166
|
+
// so this guard never rejects a valid value there.
|
|
167
|
+
if (/[`*[\]<>]/.test(trimmed)) {
|
|
168
|
+
throw new GitNexusRcError(`${source} must not contain Markdown-significant characters (\` * [ ] < >).`);
|
|
169
|
+
}
|
|
170
|
+
return trimmed;
|
|
171
|
+
}
|
|
172
|
+
case 'string-array': {
|
|
173
|
+
// Generic shared validator — `source` already names the config key, so
|
|
174
|
+
// messages here stay key-agnostic (no fetch-wrapper coupling in the
|
|
175
|
+
// shared normalizer; #1589/#1852 review F7).
|
|
176
|
+
if (!Array.isArray(value)) {
|
|
177
|
+
throw new GitNexusRcError(`${source} must be an array of strings.`);
|
|
178
|
+
}
|
|
179
|
+
const names = [];
|
|
180
|
+
for (const item of value) {
|
|
181
|
+
if (typeof item !== 'string') {
|
|
182
|
+
throw new GitNexusRcError(`${source} entries must all be strings.`);
|
|
183
|
+
}
|
|
184
|
+
const trimmed = item.trim();
|
|
185
|
+
if (!trimmed) {
|
|
186
|
+
throw new GitNexusRcError(`${source} entries must not be empty.`);
|
|
187
|
+
}
|
|
188
|
+
assertNoHiddenChars(trimmed, source);
|
|
189
|
+
// Values may be interpolated into a RegExp downstream. Restrict to
|
|
190
|
+
// identifier / member-access shapes so a config value can never smuggle
|
|
191
|
+
// regex metacharacters into a consumer.
|
|
192
|
+
if (!/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(trimmed)) {
|
|
193
|
+
throw new GitNexusRcError(`${source} entry "${trimmed}" must be an identifier or member name ` +
|
|
194
|
+
`(letters, digits, _, $, . — e.g. "client.get").`);
|
|
195
|
+
}
|
|
196
|
+
names.push(trimmed);
|
|
197
|
+
}
|
|
198
|
+
if (names.length === 0) {
|
|
199
|
+
throw new GitNexusRcError(`${source} must list at least one string.`);
|
|
200
|
+
}
|
|
201
|
+
// De-duplicate and cap to a sane bound so a pathological config cannot
|
|
202
|
+
// blow up the consumer scan's alternation.
|
|
203
|
+
return Array.from(new Set(names)).slice(0, 100);
|
|
204
|
+
}
|
|
205
|
+
case 'numeric-string': {
|
|
206
|
+
// Mirror Commander's contract: these options reach the existing CLI
|
|
207
|
+
// validation as strings. Accept a JSON number or a string; normalize to a
|
|
208
|
+
// string and let the downstream per-flag validation enforce ranges so the
|
|
209
|
+
// error messages stay in one place.
|
|
210
|
+
if (typeof value === 'number') {
|
|
211
|
+
if (!Number.isFinite(value)) {
|
|
212
|
+
throw new GitNexusRcError(`${source} must be a finite number.`);
|
|
213
|
+
}
|
|
214
|
+
return String(value);
|
|
215
|
+
}
|
|
216
|
+
if (typeof value === 'string') {
|
|
217
|
+
const trimmed = value.trim();
|
|
218
|
+
if (!trimmed) {
|
|
219
|
+
throw new GitNexusRcError(`${source} must not be empty.`);
|
|
220
|
+
}
|
|
221
|
+
return trimmed;
|
|
222
|
+
}
|
|
223
|
+
throw new GitNexusRcError(`${source} must be a number or numeric string.`);
|
|
224
|
+
}
|
|
225
|
+
default:
|
|
226
|
+
// Exhaustive — kept for forward-compat if a new kind is added.
|
|
227
|
+
throw new GitNexusRcError(`${source}: unsupported config value kind.`);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Normalize one level (flat top-level or the nested `analyze` block) into a
|
|
232
|
+
* partial `AnalyzeOptions`. Rejects unknown keys (and, defensively, two keys
|
|
233
|
+
* that map onto the same option at the same level).
|
|
234
|
+
*/
|
|
235
|
+
const normalizeLevel = (obj, { allowNestedKey }) => {
|
|
236
|
+
const out = {};
|
|
237
|
+
const setBy = new Map();
|
|
238
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
239
|
+
if (allowNestedKey && key === NESTED_KEY)
|
|
240
|
+
continue; // handled separately
|
|
241
|
+
// `Object.hasOwn`, not a truthiness check: a plain-object lookup like
|
|
242
|
+
// `KEY_SPECS["__proto__"]` returns an inherited member (Object.prototype,
|
|
243
|
+
// truthy) and would slip past `if (!spec)`, hitting the wrong error branch
|
|
244
|
+
// instead of the documented "Unknown key" message (#1996 tri-review P3).
|
|
245
|
+
if (!Object.hasOwn(KEY_SPECS, key)) {
|
|
246
|
+
throw new GitNexusRcError(`Unknown key "${key}" in ${exports.CGRAPH_RC_FILENAME}. ${ALLOWED_KEYS_HINT}`);
|
|
247
|
+
}
|
|
248
|
+
const spec = KEY_SPECS[key];
|
|
249
|
+
const prev = setBy.get(spec.target);
|
|
250
|
+
if (prev && prev !== key) {
|
|
251
|
+
throw new GitNexusRcError(`${exports.CGRAPH_RC_FILENAME}: "${prev}" and "${key}" both configure the same option; set only one.`);
|
|
252
|
+
}
|
|
253
|
+
setBy.set(spec.target, key);
|
|
254
|
+
out[spec.target] = normalizeValue(spec.kind, value, key);
|
|
255
|
+
}
|
|
256
|
+
return out;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Locate, read, parse, validate, and normalize `.cgraphrc` at `repoRoot`.
|
|
260
|
+
*
|
|
261
|
+
* @returns the normalized config defaults, or `undefined` when no file exists
|
|
262
|
+
* (the normal case). Throws {@link GitNexusRcError} on any problem.
|
|
263
|
+
*/
|
|
264
|
+
function loadAnalyzeConfig(repoRoot) {
|
|
265
|
+
const filePath = node_path_1.default.join(repoRoot, exports.CGRAPH_RC_FILENAME);
|
|
266
|
+
let raw;
|
|
267
|
+
try {
|
|
268
|
+
raw = node_fs_1.default.readFileSync(filePath, 'utf-8');
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
if (err?.code === 'ENOENT')
|
|
272
|
+
return undefined;
|
|
273
|
+
throw new GitNexusRcError(`Could not read ${exports.CGRAPH_RC_FILENAME}: ${err.message}`);
|
|
274
|
+
}
|
|
275
|
+
// Strip a leading UTF-8 BOM: Node's 'utf-8' decode keeps it, and JSON.parse
|
|
276
|
+
// then fails with a confusing "Unexpected token" on an otherwise-valid file
|
|
277
|
+
// (#1996 tri-review). Only one leading BOM is stripped; in-string control
|
|
278
|
+
// rejection still applies to the parsed values.
|
|
279
|
+
if (raw.charCodeAt(0) === 0xfeff)
|
|
280
|
+
raw = raw.slice(1);
|
|
281
|
+
let parsed;
|
|
282
|
+
try {
|
|
283
|
+
parsed = JSON.parse(raw);
|
|
284
|
+
}
|
|
285
|
+
catch (err) {
|
|
286
|
+
throw new GitNexusRcError(`${exports.CGRAPH_RC_FILENAME} is not valid JSON: ${err.message}. ` +
|
|
287
|
+
`Expected a JSON object such as {"pdg": true, "workerTimeout": 60}.`);
|
|
288
|
+
}
|
|
289
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
290
|
+
throw new GitNexusRcError(`${exports.CGRAPH_RC_FILENAME} must contain a JSON object.`);
|
|
291
|
+
}
|
|
292
|
+
const obj = parsed;
|
|
293
|
+
const flat = normalizeLevel(obj, { allowNestedKey: true });
|
|
294
|
+
let nested = {};
|
|
295
|
+
if (Object.prototype.hasOwnProperty.call(obj, NESTED_KEY)) {
|
|
296
|
+
const nestedRaw = obj[NESTED_KEY];
|
|
297
|
+
if (nestedRaw === null || typeof nestedRaw !== 'object' || Array.isArray(nestedRaw)) {
|
|
298
|
+
throw new GitNexusRcError(`${exports.CGRAPH_RC_FILENAME} "${NESTED_KEY}" must be a JSON object.`);
|
|
299
|
+
}
|
|
300
|
+
nested = normalizeLevel(nestedRaw, { allowNestedKey: false });
|
|
301
|
+
}
|
|
302
|
+
// Nested `analyze` block overrides flat top-level keys for the same option.
|
|
303
|
+
return { ...flat, ...nested };
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Merge CLI options over `.cgraphrc` defaults. CLI wins whenever it provides a
|
|
307
|
+
* value — including an explicit `false` (so an explicit CLI off-switch beats a
|
|
308
|
+
* config `true`). Config fills only the genuinely-unset (`undefined`) options.
|
|
309
|
+
*/
|
|
310
|
+
function mergeAnalyzeOptions(cli, config) {
|
|
311
|
+
if (!config)
|
|
312
|
+
return cli;
|
|
313
|
+
const merged = { ...cli };
|
|
314
|
+
for (const key of Object.keys(config)) {
|
|
315
|
+
if (merged[key] === undefined) {
|
|
316
|
+
merged[key] = config[key];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return merged;
|
|
320
|
+
}
|