@mycodemap/mycodemap 1.9.0 → 2.7.0
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/CHANGELOG.md +38 -0
- package/README.md +63 -978
- package/README.zh-CN.md +1096 -0
- package/dist/cli/commands/agent-metrics/human.d.ts +4 -0
- package/dist/cli/commands/agent-metrics/human.d.ts.map +1 -0
- package/dist/cli/commands/agent-metrics/human.js +134 -0
- package/dist/cli/commands/agent-metrics/human.js.map +1 -0
- package/dist/cli/commands/agent-metrics/index.d.ts +15 -0
- package/dist/cli/commands/agent-metrics/index.d.ts.map +1 -0
- package/dist/cli/commands/agent-metrics/index.js +116 -0
- package/dist/cli/commands/agent-metrics/index.js.map +1 -0
- package/dist/cli/commands/analyze-options.d.ts.map +1 -1
- package/dist/cli/commands/analyze-options.js +8 -0
- package/dist/cli/commands/analyze-options.js.map +1 -1
- package/dist/cli/commands/analyze.d.ts +3 -196
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +27 -1162
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/benchmark.d.ts +8 -0
- package/dist/cli/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/commands/benchmark.js +153 -0
- package/dist/cli/commands/benchmark.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -1
- package/dist/cli/commands/complexity.js +62 -95
- package/dist/cli/commands/complexity.js.map +1 -1
- package/dist/cli/commands/deps.d.ts +3 -59
- package/dist/cli/commands/deps.d.ts.map +1 -1
- package/dist/cli/commands/deps.js +25 -331
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +34 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/env-contract.d.ts +3 -0
- package/dist/cli/commands/env-contract.d.ts.map +1 -0
- package/dist/cli/commands/env-contract.js +221 -0
- package/dist/cli/commands/env-contract.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +19 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +735 -89
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/impact.d.ts +4 -38
- package/dist/cli/commands/impact.d.ts.map +1 -1
- package/dist/cli/commands/impact.js +133 -375
- package/dist/cli/commands/impact.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +61 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/preview.d.ts +3 -0
- package/dist/cli/commands/preview.d.ts.map +1 -0
- package/dist/cli/commands/preview.js +216 -0
- package/dist/cli/commands/preview.js.map +1 -0
- package/dist/cli/commands/query.d.ts +2 -20
- package/dist/cli/commands/query.d.ts.map +1 -1
- package/dist/cli/commands/query.js +23 -708
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/commands/watch-foreground.d.ts.map +1 -1
- package/dist/cli/commands/watch-foreground.js +5 -1
- package/dist/cli/commands/watch-foreground.js.map +1 -1
- package/dist/cli/config-loader.d.ts.map +1 -1
- package/dist/cli/config-loader.js +51 -13
- package/dist/cli/config-loader.js.map +1 -1
- package/dist/cli/doctor/check-agent.d.ts +3 -0
- package/dist/cli/doctor/check-agent.d.ts.map +1 -0
- package/dist/cli/doctor/check-agent.js +60 -0
- package/dist/cli/doctor/check-agent.js.map +1 -0
- package/dist/cli/doctor/check-env-contract.d.ts +3 -0
- package/dist/cli/doctor/check-env-contract.d.ts.map +1 -0
- package/dist/cli/doctor/check-env-contract.js +96 -0
- package/dist/cli/doctor/check-env-contract.js.map +1 -0
- package/dist/cli/doctor/check-ghost-commands.d.ts +3 -0
- package/dist/cli/doctor/check-ghost-commands.d.ts.map +1 -0
- package/dist/cli/doctor/check-ghost-commands.js +86 -0
- package/dist/cli/doctor/check-ghost-commands.js.map +1 -0
- package/dist/cli/doctor/check-native-deps.d.ts +3 -0
- package/dist/cli/doctor/check-native-deps.d.ts.map +1 -0
- package/dist/cli/doctor/check-native-deps.js +70 -0
- package/dist/cli/doctor/check-native-deps.js.map +1 -0
- package/dist/cli/doctor/check-workspace-drift.d.ts +3 -0
- package/dist/cli/doctor/check-workspace-drift.d.ts.map +1 -0
- package/dist/cli/doctor/check-workspace-drift.js +83 -0
- package/dist/cli/doctor/check-workspace-drift.js.map +1 -0
- package/dist/cli/doctor/formatter.d.ts +20 -0
- package/dist/cli/doctor/formatter.d.ts.map +1 -0
- package/dist/cli/doctor/formatter.js +91 -0
- package/dist/cli/doctor/formatter.js.map +1 -0
- package/dist/cli/doctor/index.d.ts +8 -0
- package/dist/cli/doctor/index.d.ts.map +1 -0
- package/dist/cli/doctor/index.js +9 -0
- package/dist/cli/doctor/index.js.map +1 -0
- package/dist/cli/doctor/orchestrator.d.ts +3 -0
- package/dist/cli/doctor/orchestrator.d.ts.map +1 -0
- package/dist/cli/doctor/orchestrator.js +40 -0
- package/dist/cli/doctor/orchestrator.js.map +1 -0
- package/dist/cli/doctor/types.d.ts +19 -0
- package/dist/cli/doctor/types.d.ts.map +1 -0
- package/dist/cli/doctor/types.js +4 -0
- package/dist/cli/doctor/types.js.map +1 -0
- package/dist/cli/env-contract/check.d.ts +18 -0
- package/dist/cli/env-contract/check.d.ts.map +1 -0
- package/dist/cli/env-contract/check.js +118 -0
- package/dist/cli/env-contract/check.js.map +1 -0
- package/dist/cli/env-contract/discovery.d.ts +12 -0
- package/dist/cli/env-contract/discovery.d.ts.map +1 -0
- package/dist/cli/env-contract/discovery.js +249 -0
- package/dist/cli/env-contract/discovery.js.map +1 -0
- package/dist/cli/env-contract/filters.d.ts +10 -0
- package/dist/cli/env-contract/filters.d.ts.map +1 -0
- package/dist/cli/env-contract/filters.js +23 -0
- package/dist/cli/env-contract/filters.js.map +1 -0
- package/dist/cli/env-contract/index.d.ts +6 -0
- package/dist/cli/env-contract/index.d.ts.map +1 -0
- package/dist/cli/env-contract/index.js +8 -0
- package/dist/cli/env-contract/index.js.map +1 -0
- package/dist/cli/env-contract/reminder-engine.d.ts +34 -0
- package/dist/cli/env-contract/reminder-engine.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-engine.js +51 -0
- package/dist/cli/env-contract/reminder-engine.js.map +1 -0
- package/dist/cli/env-contract/reminder-hook-runner.d.ts +45 -0
- package/dist/cli/env-contract/reminder-hook-runner.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-hook-runner.js +273 -0
- package/dist/cli/env-contract/reminder-hook-runner.js.map +1 -0
- package/dist/cli/env-contract/reminder-ledger.d.ts +11 -0
- package/dist/cli/env-contract/reminder-ledger.d.ts.map +1 -0
- package/dist/cli/env-contract/reminder-ledger.js +37 -0
- package/dist/cli/env-contract/reminder-ledger.js.map +1 -0
- package/dist/cli/env-contract/types.d.ts +48 -0
- package/dist/cli/env-contract/types.d.ts.map +1 -0
- package/dist/cli/env-contract/types.js +22 -0
- package/dist/cli/env-contract/types.js.map +1 -0
- package/dist/cli/env-contract/validation.d.ts +10 -0
- package/dist/cli/env-contract/validation.d.ts.map +1 -0
- package/dist/cli/env-contract/validation.js +116 -0
- package/dist/cli/env-contract/validation.js.map +1 -0
- package/dist/cli/first-run-guide.d.ts.map +1 -1
- package/dist/cli/first-run-guide.js +8 -3
- package/dist/cli/first-run-guide.js.map +1 -1
- package/dist/cli/index.js +94 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/assistant-plan.d.ts +14 -0
- package/dist/cli/init/assistant-plan.d.ts.map +1 -0
- package/dist/cli/init/assistant-plan.js +208 -0
- package/dist/cli/init/assistant-plan.js.map +1 -0
- package/dist/cli/init/detect.d.ts +28 -0
- package/dist/cli/init/detect.d.ts.map +1 -0
- package/dist/cli/init/detect.js +63 -0
- package/dist/cli/init/detect.js.map +1 -0
- package/dist/cli/init/env-contract-plan.d.ts +28 -0
- package/dist/cli/init/env-contract-plan.d.ts.map +1 -0
- package/dist/cli/init/env-contract-plan.js +184 -0
- package/dist/cli/init/env-contract-plan.js.map +1 -0
- package/dist/cli/init/manifest-extractors.d.ts +22 -0
- package/dist/cli/init/manifest-extractors.d.ts.map +1 -0
- package/dist/cli/init/manifest-extractors.js +185 -0
- package/dist/cli/init/manifest-extractors.js.map +1 -0
- package/dist/cli/init/profile-loader.d.ts +49 -0
- package/dist/cli/init/profile-loader.d.ts.map +1 -0
- package/dist/cli/init/profile-loader.js +107 -0
- package/dist/cli/init/profile-loader.js.map +1 -0
- package/dist/cli/init/profile-plan.d.ts +38 -0
- package/dist/cli/init/profile-plan.d.ts.map +1 -0
- package/dist/cli/init/profile-plan.js +120 -0
- package/dist/cli/init/profile-plan.js.map +1 -0
- package/dist/cli/init/profiles/generic.json +16 -0
- package/dist/cli/init/profiles/go.json +12 -0
- package/dist/cli/init/profiles/nodejs.json +16 -0
- package/dist/cli/init/profiles/python.json +17 -0
- package/dist/cli/init/profiles/rust.json +12 -0
- package/dist/cli/init/receipt.d.ts.map +1 -1
- package/dist/cli/init/receipt.js +107 -7
- package/dist/cli/init/receipt.js.map +1 -1
- package/dist/cli/init/reconciler.d.ts +10 -1
- package/dist/cli/init/reconciler.d.ts.map +1 -1
- package/dist/cli/init/reconciler.js +85 -15
- package/dist/cli/init/reconciler.js.map +1 -1
- package/dist/cli/interface-contract/commands/agent-metrics.d.ts +3 -0
- package/dist/cli/interface-contract/commands/agent-metrics.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/agent-metrics.js +217 -0
- package/dist/cli/interface-contract/commands/agent-metrics.js.map +1 -0
- package/dist/cli/interface-contract/commands/analyze.d.ts +3 -0
- package/dist/cli/interface-contract/commands/analyze.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/analyze.js +139 -0
- package/dist/cli/interface-contract/commands/analyze.js.map +1 -0
- package/dist/cli/interface-contract/commands/benchmark.d.ts +3 -0
- package/dist/cli/interface-contract/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/benchmark.js +108 -0
- package/dist/cli/interface-contract/commands/benchmark.js.map +1 -0
- package/dist/cli/interface-contract/commands/deps.d.ts +3 -0
- package/dist/cli/interface-contract/commands/deps.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/deps.js +130 -0
- package/dist/cli/interface-contract/commands/deps.js.map +1 -0
- package/dist/cli/interface-contract/commands/doctor.d.ts +3 -0
- package/dist/cli/interface-contract/commands/doctor.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/doctor.js +60 -0
- package/dist/cli/interface-contract/commands/doctor.js.map +1 -0
- package/dist/cli/interface-contract/commands/env-contract.d.ts +3 -0
- package/dist/cli/interface-contract/commands/env-contract.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/env-contract.js +168 -0
- package/dist/cli/interface-contract/commands/env-contract.js.map +1 -0
- package/dist/cli/interface-contract/commands/index.d.ts +12 -0
- package/dist/cli/interface-contract/commands/index.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/index.js +24 -0
- package/dist/cli/interface-contract/commands/index.js.map +1 -0
- package/dist/cli/interface-contract/commands/init.d.ts +3 -0
- package/dist/cli/interface-contract/commands/init.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/init.js +96 -0
- package/dist/cli/interface-contract/commands/init.js.map +1 -0
- package/dist/cli/interface-contract/commands/preview.d.ts +3 -0
- package/dist/cli/interface-contract/commands/preview.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/preview.js +118 -0
- package/dist/cli/interface-contract/commands/preview.js.map +1 -0
- package/dist/cli/interface-contract/commands/query.d.ts +3 -0
- package/dist/cli/interface-contract/commands/query.d.ts.map +1 -0
- package/dist/cli/interface-contract/commands/query.js +186 -0
- package/dist/cli/interface-contract/commands/query.js.map +1 -0
- package/dist/cli/interface-contract/index.d.ts +22 -0
- package/dist/cli/interface-contract/index.d.ts.map +1 -0
- package/dist/cli/interface-contract/index.js +41 -0
- package/dist/cli/interface-contract/index.js.map +1 -0
- package/dist/cli/interface-contract/schema.d.ts +30 -0
- package/dist/cli/interface-contract/schema.d.ts.map +1 -0
- package/dist/cli/interface-contract/schema.js +73 -0
- package/dist/cli/interface-contract/schema.js.map +1 -0
- package/dist/cli/interface-contract/types.d.ts +77 -0
- package/dist/cli/interface-contract/types.d.ts.map +1 -0
- package/dist/cli/interface-contract/types.js +4 -0
- package/dist/cli/interface-contract/types.js.map +1 -0
- package/dist/cli/output/apply-suggestion.d.ts +12 -0
- package/dist/cli/output/apply-suggestion.d.ts.map +1 -0
- package/dist/cli/output/apply-suggestion.js +29 -0
- package/dist/cli/output/apply-suggestion.js.map +1 -0
- package/dist/cli/output/error-codes.d.ts +24 -0
- package/dist/cli/output/error-codes.d.ts.map +1 -0
- package/dist/cli/output/error-codes.js +94 -0
- package/dist/cli/output/error-codes.js.map +1 -0
- package/dist/cli/output/errors.d.ts +14 -0
- package/dist/cli/output/errors.d.ts.map +1 -0
- package/dist/cli/output/errors.js +182 -0
- package/dist/cli/output/errors.js.map +1 -0
- package/dist/cli/output/index.d.ts +13 -0
- package/dist/cli/output/index.d.ts.map +1 -0
- package/dist/cli/output/index.js +11 -0
- package/dist/cli/output/index.js.map +1 -0
- package/dist/cli/output/mode.d.ts +12 -0
- package/dist/cli/output/mode.d.ts.map +1 -0
- package/dist/cli/output/mode.js +23 -0
- package/dist/cli/output/mode.js.map +1 -0
- package/dist/cli/output/progress.d.ts +9 -0
- package/dist/cli/output/progress.d.ts.map +1 -0
- package/dist/cli/output/progress.js +65 -0
- package/dist/cli/output/progress.js.map +1 -0
- package/dist/cli/output/render.d.ts +11 -0
- package/dist/cli/output/render.d.ts.map +1 -0
- package/dist/cli/output/render.js +18 -0
- package/dist/cli/output/render.js.map +1 -0
- package/dist/cli/output/types.d.ts +53 -0
- package/dist/cli/output/types.d.ts.map +1 -0
- package/dist/cli/output/types.js +14 -0
- package/dist/cli/output/types.js.map +1 -0
- package/dist/cli/output/wasm-fallback.d.ts +14 -0
- package/dist/cli/output/wasm-fallback.d.ts.map +1 -0
- package/dist/cli/output/wasm-fallback.js +92 -0
- package/dist/cli/output/wasm-fallback.js.map +1 -0
- package/dist/cli/preview/complexity-scanner.d.ts +21 -0
- package/dist/cli/preview/complexity-scanner.d.ts.map +1 -0
- package/dist/cli/preview/complexity-scanner.js +52 -0
- package/dist/cli/preview/complexity-scanner.js.map +1 -0
- package/dist/cli/preview/dependency-extractor.d.ts +38 -0
- package/dist/cli/preview/dependency-extractor.d.ts.map +1 -0
- package/dist/cli/preview/dependency-extractor.js +140 -0
- package/dist/cli/preview/dependency-extractor.js.map +1 -0
- package/dist/cli/preview/preview-renderer.d.ts +32 -0
- package/dist/cli/preview/preview-renderer.d.ts.map +1 -0
- package/dist/cli/preview/preview-renderer.js +54 -0
- package/dist/cli/preview/preview-renderer.js.map +1 -0
- package/dist/cli/storage-runtime.d.ts +7 -0
- package/dist/cli/storage-runtime.d.ts.map +1 -1
- package/dist/cli/storage-runtime.js +22 -0
- package/dist/cli/storage-runtime.js.map +1 -1
- package/dist/cli/tree-sitter-check.d.ts +6 -1
- package/dist/cli/tree-sitter-check.d.ts.map +1 -1
- package/dist/cli/tree-sitter-check.js +23 -1
- package/dist/cli/tree-sitter-check.js.map +1 -1
- package/dist/cli-new/index.js +1 -1
- package/dist/cli-new/index.js.map +1 -1
- package/dist/composition/parser-composition.d.ts +7 -0
- package/dist/composition/parser-composition.d.ts.map +1 -0
- package/dist/composition/parser-composition.js +15 -0
- package/dist/composition/parser-composition.js.map +1 -0
- package/dist/core/analyzer.d.ts.map +1 -1
- package/dist/core/analyzer.js +83 -67
- package/dist/core/analyzer.js.map +1 -1
- package/dist/core/ast-complexity-analyzer.d.ts +12 -6
- package/dist/core/ast-complexity-analyzer.d.ts.map +1 -1
- package/dist/core/ast-complexity-analyzer.js +368 -209
- package/dist/core/ast-complexity-analyzer.js.map +1 -1
- package/dist/core/file-discovery.d.ts +1 -1
- package/dist/core/file-discovery.d.ts.map +1 -1
- package/dist/core/file-discovery.js +3 -0
- package/dist/core/file-discovery.js.map +1 -1
- package/dist/core/global-index.d.ts +3 -1
- package/dist/core/global-index.d.ts.map +1 -1
- package/dist/core/global-index.js +69 -4
- package/dist/core/global-index.js.map +1 -1
- package/dist/domain/entities/CodeGraph.d.ts +3 -0
- package/dist/domain/entities/CodeGraph.d.ts.map +1 -1
- package/dist/domain/entities/CodeGraph.js +19 -2
- package/dist/domain/entities/CodeGraph.js.map +1 -1
- package/dist/domain/entities/Dependency.d.ts +5 -2
- package/dist/domain/entities/Dependency.d.ts.map +1 -1
- package/dist/domain/entities/Dependency.js +49 -3
- package/dist/domain/entities/Dependency.js.map +1 -1
- package/dist/domain/repositories/CodeGraphRepository.d.ts +5 -0
- package/dist/domain/repositories/CodeGraphRepository.d.ts.map +1 -1
- package/dist/domain/repositories/CodeGraphRepository.js.map +1 -1
- package/dist/execution/contract-tools/analyze.d.ts +205 -0
- package/dist/execution/contract-tools/analyze.d.ts.map +1 -0
- package/dist/execution/contract-tools/analyze.js +1215 -0
- package/dist/execution/contract-tools/analyze.js.map +1 -0
- package/dist/execution/contract-tools/deps.d.ts +62 -0
- package/dist/execution/contract-tools/deps.d.ts.map +1 -0
- package/dist/execution/contract-tools/deps.js +234 -0
- package/dist/execution/contract-tools/deps.js.map +1 -0
- package/dist/execution/contract-tools/index.d.ts +5 -0
- package/dist/execution/contract-tools/index.d.ts.map +1 -0
- package/dist/execution/contract-tools/index.js +7 -0
- package/dist/execution/contract-tools/index.js.map +1 -0
- package/dist/execution/contract-tools/query.d.ts +60 -0
- package/dist/execution/contract-tools/query.d.ts.map +1 -0
- package/dist/execution/contract-tools/query.js +532 -0
- package/dist/execution/contract-tools/query.js.map +1 -0
- package/dist/execution/contract-tools/types.d.ts +26 -0
- package/dist/execution/contract-tools/types.d.ts.map +1 -0
- package/dist/execution/contract-tools/types.js +32 -0
- package/dist/execution/contract-tools/types.js.map +1 -0
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +0 -3
- package/dist/generator/index.js.map +1 -1
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts +12 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.d.ts.map +1 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js +55 -0
- package/dist/infrastructure/parser/enhancers/TypeScriptTypeEnhancer.js.map +1 -0
- package/dist/infrastructure/parser/implementations/GoParser.d.ts +2 -1
- package/dist/infrastructure/parser/implementations/GoParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/GoParser.js +13 -1
- package/dist/infrastructure/parser/implementations/GoParser.js.map +1 -1
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts +114 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js +1022 -0
- package/dist/infrastructure/parser/implementations/PythonTreeSitterParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts +78 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.d.ts.map +1 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.js +648 -0
- package/dist/infrastructure/parser/implementations/TreeSitterParser.js.map +1 -0
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts +3 -55
- package/dist/infrastructure/parser/implementations/TypeScriptParser.d.ts.map +1 -1
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js +4 -411
- package/dist/infrastructure/parser/implementations/TypeScriptParser.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +2 -0
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +9 -6
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interfaces/ParserBase.d.ts.map +1 -1
- package/dist/infrastructure/parser/interfaces/ParserBase.js +1 -0
- package/dist/infrastructure/parser/interfaces/ParserBase.js.map +1 -1
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts +2 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.d.ts.map +1 -1
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js +4 -0
- package/dist/infrastructure/repositories/CodeGraphRepositoryImpl.js.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.d.ts +5 -18
- package/dist/infrastructure/storage/StorageFactory.d.ts.map +1 -1
- package/dist/infrastructure/storage/StorageFactory.js +30 -98
- package/dist/infrastructure/storage/StorageFactory.js.map +1 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts +13 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.d.ts.map +1 -1
- package/dist/infrastructure/storage/adapters/SQLiteStorage.js +322 -76
- package/dist/infrastructure/storage/adapters/SQLiteStorage.js.map +1 -1
- package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts +45 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.d.ts.map +1 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.js +266 -0
- package/dist/infrastructure/storage/adapters/sqlite-loader.js.map +1 -0
- package/dist/infrastructure/storage/community-helpers.d.ts +4 -0
- package/dist/infrastructure/storage/community-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/community-helpers.js +392 -0
- package/dist/infrastructure/storage/community-helpers.js.map +1 -0
- package/dist/infrastructure/storage/graph-helpers.d.ts +22 -5
- package/dist/infrastructure/storage/graph-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/graph-helpers.js +496 -91
- package/dist/infrastructure/storage/graph-helpers.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +1 -1
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -1
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts +2 -2
- package/dist/infrastructure/storage/interfaces/StorageBase.d.ts.map +1 -1
- package/dist/infrastructure/storage/interfaces/StorageBase.js.map +1 -1
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts +2 -0
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js +52 -12
- package/dist/infrastructure/storage/sqlite/GovernanceGraphCache.js.map +1 -1
- package/dist/infrastructure/storage/sqlite/schema.d.ts +2 -2
- package/dist/infrastructure/storage/sqlite/schema.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite/schema.js +49 -1
- package/dist/infrastructure/storage/sqlite/schema.js.map +1 -1
- package/dist/interface/config/index.d.ts +5 -3
- package/dist/interface/config/index.d.ts.map +1 -1
- package/dist/interface/types/index.d.ts +37 -6
- package/dist/interface/types/index.d.ts.map +1 -1
- package/dist/interface/types/parser.d.ts +85 -0
- package/dist/interface/types/parser.d.ts.map +1 -1
- package/dist/interface/types/storage.d.ts +227 -10
- package/dist/interface/types/storage.d.ts.map +1 -1
- package/dist/orchestrator/agent-metrics-service.d.ts +126 -0
- package/dist/orchestrator/agent-metrics-service.d.ts.map +1 -0
- package/dist/orchestrator/agent-metrics-service.js +444 -0
- package/dist/orchestrator/agent-metrics-service.js.map +1 -0
- package/dist/orchestrator/types.d.ts +2 -0
- package/dist/orchestrator/types.d.ts.map +1 -1
- package/dist/orchestrator/types.js.map +1 -1
- package/dist/parser/enhancers/PythonTypeEnhancer.d.ts +26 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.d.ts.map +1 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.js +440 -0
- package/dist/parser/enhancers/PythonTypeEnhancer.js.map +1 -0
- package/dist/parser/implementations/smart-parser.d.ts.map +1 -1
- package/dist/parser/implementations/smart-parser.js +7 -69
- package/dist/parser/implementations/smart-parser.js.map +1 -1
- package/dist/parser/implementations/tree-sitter-loader.d.ts +18 -0
- package/dist/parser/implementations/tree-sitter-loader.d.ts.map +1 -0
- package/dist/parser/implementations/tree-sitter-loader.js +136 -0
- package/dist/parser/implementations/tree-sitter-loader.js.map +1 -0
- package/dist/parser/index.d.ts +5 -3
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +68 -6
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/interfaces/IParser.d.ts +19 -6
- package/dist/parser/interfaces/IParser.d.ts.map +1 -1
- package/dist/parser/interfaces/IParser.js +2 -3
- package/dist/parser/interfaces/IParser.js.map +1 -1
- package/dist/server/handlers/AnalysisHandler.d.ts +13 -2
- package/dist/server/handlers/AnalysisHandler.d.ts.map +1 -1
- package/dist/server/handlers/AnalysisHandler.js +24 -0
- package/dist/server/handlers/AnalysisHandler.js.map +1 -1
- package/dist/server/handlers/QueryHandler.d.ts.map +1 -1
- package/dist/server/handlers/QueryHandler.js +11 -30
- package/dist/server/handlers/QueryHandler.js.map +1 -1
- package/dist/server/mcp/context-tool.d.ts +9 -0
- package/dist/server/mcp/context-tool.d.ts.map +1 -0
- package/dist/server/mcp/context-tool.js +257 -0
- package/dist/server/mcp/context-tool.js.map +1 -0
- package/dist/server/mcp/schema-adapter.d.ts +55 -0
- package/dist/server/mcp/schema-adapter.d.ts.map +1 -0
- package/dist/server/mcp/schema-adapter.js +409 -0
- package/dist/server/mcp/schema-adapter.js.map +1 -0
- package/dist/server/mcp/server.d.ts +3 -3
- package/dist/server/mcp/server.d.ts.map +1 -1
- package/dist/server/mcp/server.js +134 -20
- package/dist/server/mcp/server.js.map +1 -1
- package/dist/server/mcp/service.d.ts +6 -2
- package/dist/server/mcp/service.d.ts.map +1 -1
- package/dist/server/mcp/service.js +138 -36
- package/dist/server/mcp/service.js.map +1 -1
- package/dist/server/mcp/stdio-transport.d.ts +23 -0
- package/dist/server/mcp/stdio-transport.d.ts.map +1 -0
- package/dist/server/mcp/stdio-transport.js +101 -0
- package/dist/server/mcp/stdio-transport.js.map +1 -0
- package/dist/server/mcp/types.d.ts +133 -8
- package/dist/server/mcp/types.d.ts.map +1 -1
- package/dist/server/routes/api.d.ts.map +1 -1
- package/dist/server/routes/api.js +11 -2
- package/dist/server/routes/api.js.map +1 -1
- package/docs/AI_ASSISTANT_SETUP.md +281 -12
- package/docs/API.md +170 -0
- package/docs/CONFIGURATION.md +141 -0
- package/docs/DEVELOPMENT.md +96 -0
- package/docs/GETTING-STARTED.md +114 -0
- package/docs/README.md +40 -1
- package/docs/SETUP_GUIDE.md +60 -14
- package/docs/TESTING.md +81 -0
- package/docs/ai-guide/COMMANDS.md +68 -10
- package/docs/ai-guide/INTEGRATION.md +77 -10
- package/docs/ai-guide/OUTPUT.md +345 -9
- package/docs/ai-guide/PROMPTS.md +2 -2
- package/docs/ai-guide/QUICKSTART.md +28 -1
- package/docs/ai-guide/README.md +2 -2
- package/docs/archive/ideation/2026-04-15-executable-architecture-constitution-ideation-archive.md +70 -0
- package/docs/archive/ideation/2026-04-20-mycodemap-init-enhancements-ideation-archive.md +109 -0
- package/docs/archive/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation-archive.md +54 -0
- package/docs/backlog.md +232 -144
- package/docs/brainstorms/2026-05-10-agent-effectiveness-validation-requirements.md +112 -0
- package/docs/generated/phase-58/subagent-evidence/claude-hook-example.json +15 -0
- package/docs/generated/phase-58/subagent-evidence/claude-session.md +146 -0
- package/docs/generated/phase-58/subagent-evidence/claude-subagent.json +28 -0
- package/docs/generated/phase-58/subagent-evidence/codex-agent-example.toml +19 -0
- package/docs/generated/phase-58/subagent-evidence/codex-session.md +150 -0
- package/docs/generated/phase-58/subagent-evidence/codex-subagent.json +20 -0
- package/docs/generated/phase-58/subagent-evidence/negative-no-retrieval.json +12 -0
- package/docs/generated/phase-58/subagent-evidence/verification-manifest.json +19 -0
- package/docs/ideation/2026-04-15-executable-architecture-constitution-ideation.md +10 -22
- package/docs/ideation/2026-04-20-mycodemap-init-enhancements-ideation.md +15 -60
- package/docs/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation.md +47 -52
- package/docs/ideation/2026-04-29-ux-install-agent-experience-ideation.md +256 -0
- package/docs/ideation/2026-05-02-subagent-environment-contract-injection-ideation.md +183 -0
- package/docs/ideation/2026-05-04-subagent-hooks-deep-dive-ideation.md +133 -0
- package/docs/ideation/2026-05-10-agent-effectiveness-validation-ideation.md +219 -0
- package/docs/plans/2026-04-30-install-guide-and-repo-analyzer-design.md +394 -0
- package/docs/rules/README.md +1 -0
- package/docs/rules/architecture-guardrails.md +2 -1
- package/docs/rules/engineering-with-codex-openai.md +1 -1
- package/docs/rules/harness.md +106 -0
- package/docs/rules/pre-release-checklist.md +28 -0
- package/docs/rules/testing.md +51 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/SKILL.md +294 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/references/analysis-guide.md +166 -0
- package/examples/claude/skills/mycodemap-repo-analyzer/references/module-analysis-guide.md +150 -0
- package/package.json +12 -4
- package/scripts/copy-build-assets.mjs +23 -0
- package/scripts/hooks/templates/pre-commit +33 -2
- package/scripts/sync-analyze-docs.js +2 -2
- package/scripts/tests/test_rule_control_workflow.py +15 -1
- package/scripts/validate-docs.js +113 -16
- package/scripts/verify-subagent-env-contract.mjs +279 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts +0 -57
- package/dist/parser/implementations/tree-sitter-parser.d.ts.map +0 -1
- package/dist/parser/implementations/tree-sitter-parser.js +0 -375
- package/dist/parser/implementations/tree-sitter-parser.js.map +0 -1
- package/docs/references/tmp.md +0 -527
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
date: 2026-04-22
|
|
3
|
+
updated: 2026-04-29
|
|
3
4
|
topic: rules-entry-docs-optimization-consolidated
|
|
4
5
|
focus: 融合两份 2026-04-22 ideation 的最佳部分,形成更强的 rules / AGENTS.md / CLAUDE.md 终稿提案
|
|
5
6
|
mode: repo-grounded
|
|
@@ -10,17 +11,19 @@ sources:
|
|
|
10
11
|
|
|
11
12
|
# Ideation: Consolidated rules / AGENTS.md / CLAUDE.md optimization
|
|
12
13
|
|
|
14
|
+
> **状态更新(2026-04-29)**:本文档原始包含 6 个想法,其中 #1(One Constitution, Two Thin Adapters)已实现并归档至 `docs/archive/ideation/2026-04-22-rules-entry-docs-optimization-consolidated-ideation-archive.md`。本文档保留剩余 5 项。
|
|
15
|
+
|
|
13
16
|
## Grounding Context
|
|
14
17
|
|
|
15
18
|
### Codebase Context
|
|
16
19
|
|
|
17
|
-
- [证据] 仓库自我定义已经很清楚:`AGENTS.md`
|
|
18
|
-
- [证据] 但当前根 `CLAUDE.md` 同时承载了 post-edit 默认验证、路径路由、rule-system 默认值、CLI dogfood
|
|
20
|
+
- [证据] 仓库自我定义已经很清楚:`AGENTS.md` 应是"强约束 + 路由",`CLAUDE.md` 应是"启动清单、检索顺序、最小操作手册";而且入口文档应该保持短小:`AGENTS.md:3`、`AGENTS.md:14`、`AGENTS.md:15`、`AGENTS.md:329`。
|
|
21
|
+
- [证据] 但当前根 `CLAUDE.md` 同时承载了 post-edit 默认验证、路径路由、rule-system 默认值、CLI dogfood、交付清单,已经超过"薄入口"定位:`CLAUDE.md:25`、`CLAUDE.md:43`、`CLAUDE.md:57`、`CLAUDE.md:65`、`CLAUDE.md:80`。
|
|
19
22
|
- [证据] `.claude/CLAUDE.md` 又额外定义了任务开始前/结束后清单、TDD 流程、禁止行为、commit 策略和 `npm run check:all`,与根 `CLAUDE.md` 形成双入口:`.claude/CLAUDE.md:1`、`.claude/CLAUDE.md:7`、`.claude/CLAUDE.md:33`、`.claude/CLAUDE.md:51`。
|
|
20
|
-
- [证据]
|
|
21
|
-
- [证据]
|
|
22
|
-
- [证据]
|
|
23
|
-
- [推论]
|
|
23
|
+
- [证据] 文档已经主张"先路由、再按需下钻"和"按改动类型做最小验证",但根 `CLAUDE.md` 仍保留一套统一 post-edit 命令与固定 checklist,存在叙事冲突:`docs/rules/README.md:19`、`docs/rules/validation.md:5`、`docs/rules/validation.md:29`、`docs/rules/validation.md:31`、`CLAUDE.md:25`。
|
|
24
|
+
- [证据] 当前部分验证命令存在"文档真、脚本假"的信任问题:`docs/rules/architecture-guardrails.md` 把 `npm run check:architecture` 列为快速验证,但 `package.json` 中它仍是 `echo` stub;`check:unused` 也是同样情况:`docs/rules/architecture-guardrails.md:24`、`docs/rules/architecture-guardrails.md:29`、`package.json:45`、`package.json:46`、`package.json:48`。
|
|
25
|
+
- [证据] 仓库处于过渡态,文档体系与执行面并存新旧结构;历史归档仍在,少量指南仍在根层,官方要求"以实际存在的文件为准":`AGENTS.md:324`、`AGENTS.md:327`、`AGENTS.md:329`。
|
|
26
|
+
- [推论] 因此当前核心问题不是"规则数量不足",而是"shared truth source 不够清晰 + 入口过载 + 某些执行约束与真实自动化不一致"。
|
|
24
27
|
|
|
25
28
|
### External Context
|
|
26
29
|
|
|
@@ -32,88 +35,80 @@ sources:
|
|
|
32
35
|
|
|
33
36
|
### Synthesis
|
|
34
37
|
|
|
35
|
-
- [推论]
|
|
36
|
-
- [推论]
|
|
38
|
+
- [推论] 文档一的强项是"战略方向正确、外部 grounding 充分、结构完整",文档二的强项是"repo-specific 问题抓得具体、能直接落实施工项"。
|
|
39
|
+
- [推论] 更强的终稿不应在两者之间二选一,而应采用"文档一的治理框架 + 文档二的具体问题卡片"。
|
|
37
40
|
|
|
38
41
|
## Ranked Ideas
|
|
39
42
|
|
|
40
|
-
### 1.
|
|
41
|
-
**Description:** [推论]
|
|
42
|
-
**Rationale:** [推论]
|
|
43
|
-
**Repo-Specific Leverage:** [证据] 当前双入口问题真实存在:根 `CLAUDE.md:25` 到 `CLAUDE.md:88` 已是一整套执行面,`.claude/CLAUDE.md:7` 到 `.claude/CLAUDE.md:39` 又重复定义任务前后动作。
|
|
44
|
-
**Downsides:** [观点] 需要一次性定义清楚三者边界,否则很容易演变成“三份薄文档互相引用但仍然漂移”。
|
|
45
|
-
**Confidence:** 97%
|
|
46
|
-
**Complexity:** Medium
|
|
47
|
-
**Status:** Explored
|
|
48
|
-
|
|
49
|
-
### 2. Validation Router + No Ghost Commands
|
|
50
|
-
**Description:** [推论] 把根 `CLAUDE.md` 中“修改后必须执行”改写为 1 屏验证决策树:按改动类型跳转到 `docs/rules/validation.md`;同时禁止在入口与规则文档中引用 `echo` stub 命令,所有写进 quick-start 的命令都必须是真实可运行命令。
|
|
51
|
-
**Rationale:** [推论] 这是把 harness 的“最小必要验证”从口号变成真正可信的路由;它还顺手修掉最伤信任的“跑了命令但其实没验证”的问题。
|
|
43
|
+
### 1. Validation Router + No Ghost Commands
|
|
44
|
+
**Description:** [推论] 把根 `CLAUDE.md` 中"修改后必须执行"改写为 1 屏验证决策树:按改动类型跳转到 `docs/rules/validation.md`;同时禁止在入口与规则文档中引用 `echo` stub 命令,所有写进 quick-start 的命令都必须是真实可运行命令。
|
|
45
|
+
**Rationale:** [推论] 这是把 harness 的"最小必要验证"从口号变成真正可信的路由;它还顺手修掉最伤信任的"跑了命令但其实没验证"的问题。
|
|
52
46
|
**Repo-Specific Leverage:** [证据] `docs/rules/architecture-guardrails.md:29` 当前推荐 `npm run check:architecture`,但 `package.json:46` 仍是提示安装 dependency-cruiser 的 `echo`;`check:unused` 在 `package.json:48` 也是同类问题。
|
|
53
47
|
**Downsides:** [观点] 若短期内不想落地真实检查,就必须先从入口与规则文档中移除这些命令,否则只会继续制造假安全感。
|
|
54
48
|
**Confidence:** 96%
|
|
55
49
|
**Complexity:** Medium
|
|
56
|
-
**Status:**
|
|
50
|
+
**Status:** Partially Implemented(根 `CLAUDE.md` 已改为纯路由,但 `package.json` 与 `docs/rules/architecture-guardrails.md` 中的 ghost commands 仍在)
|
|
57
51
|
|
|
58
|
-
###
|
|
52
|
+
### 2. Behavior / Enforcement Split
|
|
59
53
|
**Description:** [推论] 明确分层:`AGENTS.md` / `CLAUDE.md` 负责行为与路由;`.claude/settings*.json`、hooks、`scripts/validate-rules.py`、CI 负责确定性 enforcement;`docs/rules/*` 只解释何时触发、如何恢复、失败后果是什么。
|
|
60
|
-
**Rationale:** [推论] 这既符合 Claude
|
|
61
|
-
**Repo-Specific Leverage:** [证据] 根 `CLAUDE.md`
|
|
62
|
-
**Downsides:** [观点]
|
|
54
|
+
**Rationale:** [推论] 这既符合 Claude 官方"behavioral guidance vs technical enforcement"的划分,也与本仓库已有 `report-only` / `soft_gate` / `hard_gate` 设计天然一致。
|
|
55
|
+
**Repo-Specific Leverage:** [证据] 根 `CLAUDE.md` 现在同时扮演"行为协议""默认 gate 配置""交付 checklist"三种角色:`CLAUDE.md:57`、`CLAUDE.md:61`、`CLAUDE.md:62`、`CLAUDE.md:63`、`CLAUDE.md:80`。
|
|
56
|
+
**Downsides:** [观点] 需要重写措辞,让"默认路由/默认验证"与"真正 blocker"区分得非常清楚,否则用户会误会规则被放松。
|
|
63
57
|
**Confidence:** 93%
|
|
64
58
|
**Complexity:** Medium
|
|
65
|
-
**Status:**
|
|
59
|
+
**Status:** Partially Implemented(行为路由已分离,但缺少 `scripts/validate-rules.py` 等专门 enforcement 工具,部分 enforcement 仍由 `validate-docs.js` 兼任)
|
|
66
60
|
|
|
67
|
-
###
|
|
68
|
-
**Description:** [推论]
|
|
69
|
-
**Rationale:** [推论]
|
|
70
|
-
**Repo-Specific Leverage:** [证据]
|
|
71
|
-
**Downsides:** [观点] 若没有命名约定和 archive discipline
|
|
61
|
+
### 3. Path-Scoped Governance for a Transitional Repo
|
|
62
|
+
**Description:** [推论] 根入口只维护"如何选规则"的导航,细节继续下沉到按路径加载的文档:Codex 依赖更近的 `AGENTS.md`,Claude 依赖 `.claude/rules/**` 的 `paths:`;同时在根入口显式声明"当前是迁移仓库,MVP3 层级优先,但历史目录仍可能存在"。
|
|
63
|
+
**Rationale:** [推论] 这把文档二的"路由覆盖不足"问题与文档一的"progressive disclosure"主张合并起来:根文件不需要越来越长,但路径规则必须覆盖真实项目形态。
|
|
64
|
+
**Repo-Specific Leverage:** [证据] 仓库已明确"过渡说明"和"入口文档应保持短小":`AGENTS.md:324`、`AGENTS.md:327`、`AGENTS.md:329`;根 `CLAUDE.md` 当前路由表仍是高度 layer-centric:`CLAUDE.md:43` 到 `CLAUDE.md:55`。
|
|
65
|
+
**Downsides:** [观点] 若没有命名约定和 archive discipline,路径化后会把问题从"根太长"转移成"子规则散落"。
|
|
72
66
|
**Confidence:** 91%
|
|
73
67
|
**Complexity:** Medium-High
|
|
74
|
-
**Status:**
|
|
68
|
+
**Status:** Unexplored(不存在 `.claude/rules/` 目录,无 `paths:` 配置)
|
|
75
69
|
|
|
76
|
-
###
|
|
77
|
-
**Description:** [推论] 明确标注 live governance surface:只认 `AGENTS.md`、根 `CLAUDE.md`、`.claude/CLAUDE.md`、`docs/rules/README.md` 与活跃规则文档;历史 rollout、模板母本、迁移提案要统一降级为 reference/archive
|
|
70
|
+
### 4. Live Rulebook + Archive Demotion
|
|
71
|
+
**Description:** [推论] 明确标注 live governance surface:只认 `AGENTS.md`、根 `CLAUDE.md`、`.claude/CLAUDE.md`、`docs/rules/README.md` 与活跃规则文档;历史 rollout、模板母本、迁移提案要统一降级为 reference/archive,并在文件头写明"不可作为当前执行真相"。
|
|
78
72
|
**Rationale:** [推论] 对 agent 来说,最贵的不是少一条规则,而是不知道哪份文档才是现在真的生效。
|
|
79
|
-
**Repo-Specific Leverage:** [证据]
|
|
73
|
+
**Repo-Specific Leverage:** [证据] 仓库已承认"历史归档仍保留、少量操作指南仍在根层、执行时以实际存在文件为准":`AGENTS.md:327`。
|
|
80
74
|
**Downsides:** [观点] 这是文档身份治理,不是炫目的功能增强;但如果不做,后续所有瘦身都会被旧文档重新污染。
|
|
81
75
|
**Confidence:** 92%
|
|
82
76
|
**Complexity:** Low-Medium
|
|
83
|
-
**Status:**
|
|
77
|
+
**Status:** Partially Implemented(`docs/archive/` 目录存在,但并非所有历史文档都被显式标注"不可作为当前执行真相";`docs/ideation/` 中仍有未归档的历史文档)
|
|
84
78
|
|
|
85
|
-
###
|
|
86
|
-
**Description:** [推论]
|
|
87
|
-
**Rationale:** [推论] 文档二抓住了 repo
|
|
79
|
+
### 5. Governance Self-Audit + Generated Shared Tables
|
|
80
|
+
**Description:** [推论] 把"规则重复"和"规则自身腐烂"合并成一个治理能力:高频重复表格(如代码红线、职责映射、验证入口)应由单一结构化源生成;并定期审计链接、命令存在性、路径路由覆盖和 live/reference 身份是否一致。
|
|
81
|
+
**Rationale:** [推论] 文档二抓住了 repo 的真实维护痛点,而文档一提供了更高层的约束原则;把两者合并后,能防止"今天瘦身,明天重新 drift"。
|
|
88
82
|
**Repo-Specific Leverage:** [证据] 当前重复与漂移已在多处出现:`AGENTS.md:127`、`docs/rules/engineering-with-codex-openai.md:89`;而命令存在性问题已被 `package.json:46`、`package.json:48` 证明。
|
|
89
|
-
**Downsides:** [观点]
|
|
83
|
+
**Downsides:** [观点] 这已经逼近"小型文档治理系统"了;若一次做太大,容易反向过度工程化。
|
|
90
84
|
**Confidence:** 88%
|
|
91
85
|
**Complexity:** Medium
|
|
92
|
-
**Status:**
|
|
86
|
+
**Status:** Partially Implemented(`scripts/validate-docs.js` 已实现入口文档自动化审计,但无"从单一结构化源生成重复表格"的机制,也无定期审计 package.json stub 命令的能力)
|
|
93
87
|
|
|
94
88
|
## Recommended Final Direction
|
|
95
89
|
|
|
96
|
-
- [观点]
|
|
97
|
-
|
|
98
|
-
- [观点] **第二优先级**:`#
|
|
99
|
-
|
|
100
|
-
- [观点] **第三优先级**:`#
|
|
101
|
-
|
|
102
|
-
- [推论]
|
|
90
|
+
- [观点] **当前首选主轴**:`#2 Validation Router + No Ghost Commands`
|
|
91
|
+
在 #1 已完成后,这是最强的信任修复:把"文档说一套、命令做一套"的错位消掉。
|
|
92
|
+
- [观点] **第二优先级**:`#3 Behavior / Enforcement Split`
|
|
93
|
+
这是最强的长期维护修复,防止入口文件再次被确定性流程污染。
|
|
94
|
+
- [观点] **第三优先级**:`#4 Path-Scoped Governance`
|
|
95
|
+
把路由从根文件进一步下沉到路径作用域,是 progressive disclosure 的下一步。
|
|
96
|
+
- [推论] 若只允许保留一个总原则,应是:**根入口只负责"让 agent 知道去哪读、何时验证、谁在阻断",不负责承载全部细节、全部命令、全部历史。**
|
|
103
97
|
|
|
104
98
|
## Rejection Summary
|
|
105
99
|
|
|
106
100
|
| # | Idea | Reason Rejected |
|
|
107
101
|
|---|------|-----------------|
|
|
108
|
-
| 1 | `Universal Mega Entry File` | [推论] 与 Codex / Claude
|
|
102
|
+
| 1 | `Universal Mega Entry File` | [推论] 与 Codex / Claude 官方"短入口 + 路由 + 作用域加载"方向完全相反。 |
|
|
109
103
|
| 2 | `Per-Tool Twin Rulebooks` | [推论] 会把多 agent 共享规则重新复制成两套真相,长期必漂移。 |
|
|
110
104
|
| 3 | `Everything as Structured YAML First` | [观点] 对重复表格很有价值,但若把全部治理文档都数据化,会过早走向工具化治理。 |
|
|
111
105
|
| 4 | `Only Fix Ghost Commands` | [推论] 只能修补信任问题,不能解决入口过载与 shared truth source 不清晰。 |
|
|
112
106
|
| 5 | `Only Merge the Two CLAUDE Files` | [推论] 不触及 `AGENTS.md` / `docs/rules/*` 的职责划分,仍会留下多真相竞争。 |
|
|
113
|
-
| 6 | `Archive Nothing, Just Add More Cross Links` | [观点]
|
|
107
|
+
| 6 | `Archive Nothing, Just Add More Cross Links` | [观点] 交叉链接能缓解迷路,不能解决"哪份文档是 live contract"的根问题。 |
|
|
114
108
|
|
|
115
109
|
## Session Log
|
|
116
110
|
|
|
117
111
|
- [证据] 2026-04-22:对比 `docs/archive/ideation/2026-04-22-harness-rules-entry-docs-optimization-ideation.md` 与 `docs/archive/ideation/2026-04-22-rules-claude-agents-optimization-ideation.md`,确认前者更强在治理框架与外部 grounding,后者更强在 repo-specific 问题识别。
|
|
118
|
-
- [证据] 2026-04-22:补充校验根 `CLAUDE.md`、`.claude/CLAUDE.md`、`package.json`、`docs/rules/architecture-guardrails.md
|
|
119
|
-
- [推论] 2026-04-22
|
|
112
|
+
- [证据] 2026-04-22:补充校验根 `CLAUDE.md`、`.claude/CLAUDE.md`、`package.json`、`docs/rules/architecture-guardrails.md`,把"双入口""ghost commands""迁移仓库"三个具体问题收敛进统一提案。
|
|
113
|
+
- [推论] 2026-04-22:最终终稿选择"保留文档一的骨架,吸收文档二最具体的实施抓手",而不是继续保留两份并行 ideation。
|
|
114
|
+
- 2026-04-29:验证 #1 完全实现并归档;更新剩余项状态为 Partially Implemented / Unexplored
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# Ideation: CodeMap User Experience, Installation/Configuration, and Human vs AI Agent Experience
|
|
2
|
+
|
|
3
|
+
**Date:** 2026-04-29
|
|
4
|
+
**Focus:** User experience, installation and configuration experience, human vs AI agent experience
|
|
5
|
+
**Run ID:** 9e3b69d4496d7cc8
|
|
6
|
+
**Agents dispatched:** 9 (codebase scan + learnings + web research + 6 ideation frames)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Grounding Summary
|
|
11
|
+
|
|
12
|
+
### Codebase Context
|
|
13
|
+
CodeMap is a TypeScript/Node.js ESM CLI tool generating structured code maps (`AI_MAP.md`, `codemap.json`) for AI/Agent consumption. Uses `commander`, `tree-sitter`, `better-sqlite3`, `hono`. Layered architecture with `src/cli-new/` coexisting alongside `src/cli/`, signaling migration in progress. Heavy AI-agent governance docs (`AGENTS.md`, `CLAUDE.md`, `.claude/`, `.kimi/`, `.agents/`).
|
|
14
|
+
|
|
15
|
+
### Key Pain Points
|
|
16
|
+
- **Native dependency install friction** (`better-sqlite3`, `tree-sitter` often fail without build tools) — #1 drop-off point
|
|
17
|
+
- **Broken promises in `package.json`** (`check:architecture`, `check:unused` are no-ops)
|
|
18
|
+
- **Dual CLI confusion** (`cli/` + `cli-new/`)
|
|
19
|
+
- **MCP underpowered** (only 2 tools: `codemap_query`, `codemap_impact`)
|
|
20
|
+
- **Agent interface inconsistency** (`--json` not uniform, silent failures, low confidence on explicit paths)
|
|
21
|
+
- **Onboarding overload** — manual skill copying from `examples/`
|
|
22
|
+
- **Agent dogfood rated 6/10** agent-friendly (2026-04-17)
|
|
23
|
+
|
|
24
|
+
### Past Learnings
|
|
25
|
+
- `init` redesigned as "project state reconciler" with `.mycodemap/` workspace (v1.7 shipped)
|
|
26
|
+
- v0.5.1 install bug: `devDependencies` used at runtime caused global install crashes
|
|
27
|
+
- CLI surface cleanup (v1.0): removed commands with explicit failure + migration messages
|
|
28
|
+
- Three-layer readiness gate (`hard`/`warn-only`/`fallback`) from v1.11
|
|
29
|
+
|
|
30
|
+
### External Context
|
|
31
|
+
- CLI is beating MCP for coding agents in 2025-2026 due to token efficiency
|
|
32
|
+
- Agent-native patterns: JSON-first, structured errors, predictable exit codes, field filtering, `--help-json`, progress on stderr
|
|
33
|
+
- Prior art: `hubspot-cli` (dual entry point), `gdelt-cli` (machine-readable help), `discord-cli` (YAML structured output)
|
|
34
|
+
- Snyk praised for smoothest onboarding (`snyk test` = seconds)
|
|
35
|
+
- Research pain points: false positives up to 60%, lack of meaningful messages, configuration effort
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Raw Candidate Pool
|
|
40
|
+
|
|
41
|
+
52 candidates generated across 6 ideation frames + 4 cross-cutting combinations. Full list preserved in checkpoint:
|
|
42
|
+
`/tmp/compound-engineering/ce-ideate/9e3b69d4496d7cc8/raw-candidates.md`
|
|
43
|
+
|
|
44
|
+
### Frame Summary
|
|
45
|
+
| Frame | Count | Key Themes |
|
|
46
|
+
|-------|-------|------------|
|
|
47
|
+
| Pain and friction | 8 | Graceful degradation, presumptive onboarding, unified CLI, agent handshake, streaming MCP, confidence metadata, pre-install check, doctor |
|
|
48
|
+
| Inversion/removal/automation | 8 | Zero-command install, config-as-cache, honest CLI, intent router, JSON-RPC daemon, auto-provisioned skills, failure-to-action, CLI-as-MCP gateway |
|
|
49
|
+
| Assumption-breaking | 8 | Zero-install runtime, split human/agent interface, self-healing init, SDK mode, confidence-first output, progressive disclosure, git-native maps, declarative contract |
|
|
50
|
+
| Leverage/compounding | 8 | WASM-first build, auto-reconciling state, interface contract architecture, zero-config preview, structured errors, skill ecosystem, agent-native mode, uncertainty budget |
|
|
51
|
+
| Cross-domain analogy | 8 | Auto-mode installer, RPG onboarding, Netflix recommendations, language server daemon, tasting menu presets, accessibility profiles, pairing mode, confidence routing |
|
|
52
|
+
| Constraint-flipping | 8 | 100ms install, self-teaching CLI, AI-first default, fingerprint config, unconfigurable tool, MCP-primary, concierge daemon, self-healing promise |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Explicit Rejections (Why These Did Not Survive)
|
|
57
|
+
|
|
58
|
+
### Rejected: Incremental / Already In Progress
|
|
59
|
+
- **Unified CLI Surface with Subcommand Shadows** — Addresses real pain but is essentially "finish the cli-new migration," already in progress. Not an ideation breakthrough.
|
|
60
|
+
- **Presumptive Onboarding / Config Proposed Not Asked** — Overlaps with existing v1.7 init reconciler design; less precise than Zero-Config Preview.
|
|
61
|
+
- **Streaming MCP with Progress Tokens** — Good but naturally follows from CLI-as-MCP Gateway; not a standalone priority.
|
|
62
|
+
|
|
63
|
+
### Rejected: Over-Engineered / Heavy Solutions to Simple Problems
|
|
64
|
+
- **Agent Handshake Protocol** — Over-engineered for the actual problem: inconsistent `--json` and silent failures. A formal pre-command negotiation adds complexity; explicit flags/env vars are simpler.
|
|
65
|
+
- **Smart Home "Pairing Mode" Auto-Negotiation** — Auto-detecting agent vs human is fragile (env vars, parent process names). Explicit `--agent` or `CODEMAP_MACHINE=1` is more reliable.
|
|
66
|
+
- **Intent-Based Unified Router / Natural Language** — "Map my backend API surface" is cool but adds NLP complexity for marginal gain over good subcommand naming.
|
|
67
|
+
|
|
68
|
+
### Rejected: Too Speculative / Missing Prerequisites
|
|
69
|
+
- **100ms Install Mandate: Pure-JS Mode** — More extreme than WASM-first. Node 22+ `node:sqlite` is not universally available. Pure-JS tree-sitter grammar pack doesn't exist yet.
|
|
70
|
+
- **The Embedded CodeMap / SDK Mode** — Powerful but scope explosion. If WASM-first happens, SDK mode becomes natural. Doing both simultaneously is too much.
|
|
71
|
+
- **10x Budget: Agent Concierge Mode / Daemon + IDE Extension** — Visionary but the project already deferred viz/TUI/API (MVP3 PRD). A daemon is an architectural commitment for a future milestone.
|
|
72
|
+
- **No Users, Only Agents: MCP as Primary Interface** — Inverts reality: the CLI exists and works. Making MCP primary would discard human UX investment.
|
|
73
|
+
|
|
74
|
+
### Rejected: Provocative but Not Actionable
|
|
75
|
+
- **Team of One: The Unconfigurable Tool** — Radical convention-over-configuration that would alienate power users and non-standard projects.
|
|
76
|
+
- **Self-Correcting CLI Surface / Honest CLI** — "CLI audits itself on startup" is harder to implement and explain than a `doctor` command. Overlaps with #7 survivor.
|
|
77
|
+
- **The Declarative Project Contract / codemap.yaml** — Overlaps with existing `.mycodemap/config.json` approach. YAML doesn't add enough value to justify migration.
|
|
78
|
+
|
|
79
|
+
### Rejected: Framing Devices, Not Technical Directions
|
|
80
|
+
- **Video Game Accessibility Profiles** — Good analogy but essentially combines "split interface" + "AI-first default" into a framing device.
|
|
81
|
+
- **RPG "First Quest" Tutorial Onboarding** — UX polish framing of Zero-Config Preview. The tutorial aspect is surface, not architecture.
|
|
82
|
+
- **Fine Dining "Tasting Menu" Presets** — Same as accessibility profiles; a UX framing of modes that already exist in other forms.
|
|
83
|
+
- **Airport Customs "Green Lane / Red Lane"** — Clever analogy but confidence routing is already captured by Confidence-First Output.
|
|
84
|
+
|
|
85
|
+
### Rejected: Overlap with Stronger Survivors
|
|
86
|
+
- **Pre-Install Environment Contract Check** — Narrower than WASM-first; solves same problem less completely.
|
|
87
|
+
- **The Self-Healing Init** — Covered by existing init reconciler + doctor command.
|
|
88
|
+
- **Auto-Reconciling Project State** — Extension of existing v1.7 init reconciler; incremental, not breakthrough.
|
|
89
|
+
- **Netflix "Because You Watched" Config Recommendations** — Incremental enhancement to init; not a distinct direction.
|
|
90
|
+
- **Structured Error Recovery Protocol** — Overlaps heavily with Failure-to-Action Protocol.
|
|
91
|
+
- **Configuration as a Cache, Not a Contract** — Interesting reframing but risks making configuration opaque and hard to debug.
|
|
92
|
+
- **Agent-Native Streaming Protocol / JSON-RPC Daemon** — High complexity; daemon mode deferred per project scope.
|
|
93
|
+
- **No Docs Allowed: The Self-Teaching CLI** — Framing device; interactive help is a feature, not a strategic direction.
|
|
94
|
+
- **1M Users, Zero Support: Auto-Configured by Fingerprint** — Overlaps with Zero-Config Preview + existing init reconciler.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Top Survivors (Ranked)
|
|
99
|
+
|
|
100
|
+
### 1. Machine-Readable Interface Contract as Core Architecture
|
|
101
|
+
**Source:** Leverage frame
|
|
102
|
+
**Idea:** Define the entire CLI surface as a formal schema (commands, args, flags, output shapes, error codes) in a single source-of-truth file. Generate the human CLI parser, the MCP server, `--help-json`, shell completions, and documentation from this schema. Never hand-write argument parsing or output formatting again.
|
|
103
|
+
|
|
104
|
+
**Why it survived:**
|
|
105
|
+
- **Highest leverage:** Every new command automatically gets full agent support, MCP exposure, and perfect consistency.
|
|
106
|
+
- **Addresses root cause:** `--json` inconsistency, MCP underpoweredness, and agent-friendly 6/10 rating all stem from hand-maintained dual surfaces.
|
|
107
|
+
- **Compounding:** As the CLI grows, the benefit multiplies. Adding one schema entry creates CLI flag, MCP tool, help text, and completion in one shot.
|
|
108
|
+
- **Grounded:** Agent-native patterns from external research explicitly demand JSON-first, structured errors, and `--help-json`. This makes them free.
|
|
109
|
+
|
|
110
|
+
**Risks:** Upfront schema design effort; migration of existing commands. Mitigation: incremental adoption, one command at a time.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### 2. WASM-First Build, Native-Opt-In Runtime
|
|
115
|
+
**Source:** Leverage frame / Constraint-flip frame
|
|
116
|
+
**Idea:** Ship `tree-sitter` and `better-sqlite3` as WASM modules by default; detect and opportunistically upgrade to native binaries only when the environment supports it and the user opts in. `npm install codemap` works on every platform, every CI image, every fresh laptop with zero build tools.
|
|
117
|
+
|
|
118
|
+
**Why it survived:**
|
|
119
|
+
- **#1 pain point killer:** Native dependency install friction is the top drop-off point. This eliminates it entirely.
|
|
120
|
+
- **Proven pattern:** esbuild's WASM fallback mode works in the same ecosystem. `web-tree-sitter` exists. Node 22 ships `node:sqlite` built-in.
|
|
121
|
+
- **Platform coverage:** Reaches 100% of users instead of 70% who have build tools installed.
|
|
122
|
+
- **Agent value:** Eliminates environment-dependent failures that break automated workflows.
|
|
123
|
+
|
|
124
|
+
**Risks:** Performance regression for very large repos. Mitigation: native opt-in for performance-sensitive users; benchmark WASM vs native.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### 3. CLI-as-MCP Automatic Gateway
|
|
129
|
+
**Source:** Inversion frame
|
|
130
|
+
**Idea:** Implement a generic `--mcp-stdio` adapter that dynamically exposes every CodeMap CLI subcommand as an MCP tool with auto-generated JSON schemas derived from TypeScript types (or the Interface Contract schema). Adding a new CLI command instantly creates a new MCP tool with zero extra work. The entire CLI surface becomes the MCP surface.
|
|
131
|
+
|
|
132
|
+
**Why it survived:**
|
|
133
|
+
- **Closes the integration gap:** MCP is currently underpowered (2 tools) while CLI has 20+ commands. Agents route around MCP to CLI because of this.
|
|
134
|
+
- **Eliminates drift:** No more hand-maintained MCP server that lags behind CLI features.
|
|
135
|
+
- **Depends on #1:** Best paired with Interface Contract architecture, but can start with TypeScript type reflection.
|
|
136
|
+
- **High agent impact:** Transforms MCP from a second-class citizen into a first-class, complete interface.
|
|
137
|
+
|
|
138
|
+
**Risks:** MCP schema generation must handle complex nested types. Mitigation: start with simple commands, iterate.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### 4. AI-First Default, Human-Pretty Optional
|
|
143
|
+
**Source:** Constraint-flip frame / Assumption-breaking frame
|
|
144
|
+
**Idea:** Flip the output paradigm. All commands emit structured JSON/NDJSON on stdout by default. A `--human` flag (or auto-detected TTY) pipes through a built-in renderer for tables, spinners, and color. Progress goes to stderr as structured events. This makes the CLI natively composable for agents without special flags.
|
|
145
|
+
|
|
146
|
+
**Why it survived:**
|
|
147
|
+
- **Directly fixes agent inconsistency:** The current `--json` bolt-on is inconsistent across commands. Making structured output the default forces consistency.
|
|
148
|
+
- **External evidence:** Research confirms CLI beats MCP for token efficiency when structured. This maximizes that advantage.
|
|
149
|
+
- **Low implementation risk:** TTY detection is standard; renderers can be built incrementally.
|
|
150
|
+
- **Composable:** `codemap analyze | jq '.findings[] | select(.severity=="high")'` works out of the box.
|
|
151
|
+
|
|
152
|
+
**Risks:** Breaking change for existing human users who expect pretty output. Mitigation: major version bump; TTY auto-detection preserves current behavior for interactive use.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### 5. Zero-Config Preview / Progressive Commitment Model
|
|
157
|
+
**Source:** Leverage frame / Cross-domain analogy
|
|
158
|
+
**Idea:** `npx codemap` with no config, no init, no flags performs a full analysis and emits a rich preview (top-level summary, detected project type, sample map). It then offers: "Looks good? Run `codemap --persist` to save configuration and generate full artifacts." No setup, no decisions, no config files until the user sees value.
|
|
159
|
+
|
|
160
|
+
**Why it survived:**
|
|
161
|
+
- **Snyk-inspired:** Snyk is praised for smoothest onboarding because `snyk test` demonstrates value in seconds.
|
|
162
|
+
- **Low implementation cost:** Can be built on top of existing init reconciler and analysis pipeline.
|
|
163
|
+
- **High conversion impact:** Removes the fear of side effects from trying the tool.
|
|
164
|
+
- **Dual audience:** Humans see a preview and decide; agents can run `--persist` non-interactively.
|
|
165
|
+
|
|
166
|
+
**Risks:** Preview must be fast (<5 seconds) or it backfires. Mitigation: default to shallow/symbolic scan for preview; deep analysis on demand.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 6. Failure-to-Action Protocol
|
|
171
|
+
**Source:** Inversion frame / Leverage frame
|
|
172
|
+
**Idea:** Every error returns a structured document containing: what was attempted, the root cause, a machine-readable remediation plan, and a confidence score. For native dep failures: auto-suggest `--wasm-fallback` or a prebuilt binary URL. For agents, errors include the exact next command to try. Errors become state transitions, not dead ends.
|
|
173
|
+
|
|
174
|
+
**Why it survived:**
|
|
175
|
+
- **Addresses silent failures:** The dogfood report explicitly found `analyze -i find` failing silently with near-empty JSON. This makes every failure explicit and actionable.
|
|
176
|
+
- **Research-backed:** Studies cite "lack of meaningful messages" as a top pain point for code analysis tools.
|
|
177
|
+
- **Agent self-healing:** Agents can attempt remediation without human intervention.
|
|
178
|
+
- **Incremental:** Can be adopted command by command; doesn't require a big-bang rewrite.
|
|
179
|
+
|
|
180
|
+
**Risks:** Remediation suggestions can be wrong, creating cascading failures. Mitigation: confidence scoring on suggestions; never auto-execute without `--apply-suggestion`.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### 7. codemap doctor as Continuous Health Monitor
|
|
185
|
+
**Source:** Pain frame / Constraint-flip frame
|
|
186
|
+
**Idea:** A living diagnostics command that audits the entire CodeMap ecosystem: detects no-op scripts in `package.json` (`check:architecture`, `check:unused`), verifies native dep health, checks `.mycodemap/` workspace drift, validates CLI vs MCP version skew, and runs agent interface regression checks. Emits both human-readable reports and machine-readable diagnostics. Can run in CI as a health gate.
|
|
187
|
+
|
|
188
|
+
**Why it survived:**
|
|
189
|
+
- **Familiar pattern:** `npm doctor`, `brew doctor`, `flutter doctor` — users know what to expect.
|
|
190
|
+
- **Addresses broken promises directly:** Surfaces the no-op scripts and other latent brokenness that erodes trust.
|
|
191
|
+
- **CI-friendly:** Machine-readable output enables automated health checks in CI pipelines.
|
|
192
|
+
- **Incremental:** Each diagnostic is a small addition; the command grows over time.
|
|
193
|
+
|
|
194
|
+
**Risks:** Can become a dumping ground for random checks. Mitigation: categorize diagnostics (install, config, runtime, agent); require evidence tags for each check.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### 8. Auto-Provisioned Agent Skills / Self-Distributing Integration
|
|
199
|
+
**Source:** Inversion frame
|
|
200
|
+
**Idea:** When CodeMap detects it is being invoked by an AI agent (via `KIMI_`, `CLAUDE_`, or `CODEX_` env vars), it automatically writes or updates the appropriate skill files into the agent's skill directory (`.claude/skills/codemap/`, `.kimi/skills/codemap/`). The tool maintains its own bindings, ensuring agents always use the latest integration layer.
|
|
201
|
+
|
|
202
|
+
**Why it survived:**
|
|
203
|
+
- **Directly solves onboarding overload:** "Manual skill copying from `examples/`" is explicitly cited as a pain point.
|
|
204
|
+
- **Self-describing:** CodeMap knows its own CLI schema better than any human; it should generate its own agent integration.
|
|
205
|
+
- **Version safety:** Skills stay in sync with the installed CodeMap version.
|
|
206
|
+
- **Low cost if paired with #1 and #3:** If we have an interface contract and auto-generated MCP, skill generation is a thin layer on top.
|
|
207
|
+
|
|
208
|
+
**Risks:** Overwriting user-customized skill files. Mitigation: write to `.mycodemap/skills/` and symlink/copy to agent dirs; never modify existing files without `--force`.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Cross-Cutting Synthesis
|
|
213
|
+
|
|
214
|
+
Three meta-patterns emerge from the survivors:
|
|
215
|
+
|
|
216
|
+
### A. Self-Describing Universal API (#1 + #3 + #8)
|
|
217
|
+
If the CLI surface is defined as a machine-readable contract, then:
|
|
218
|
+
- The MCP server generates automatically (#3)
|
|
219
|
+
- Agent skills generate automatically (#8)
|
|
220
|
+
- `--help-json`, shell completions, and docs generate automatically (#1)
|
|
221
|
+
- Every new CLI command is instantly agent-ready
|
|
222
|
+
|
|
223
|
+
This is the **highest-compounding architectural bet** in the entire ideation set.
|
|
224
|
+
|
|
225
|
+
### B. Zero-Friction Installation & Onboarding (#2 + #5)
|
|
226
|
+
WASM-first eliminates install failures (#2). Zero-config preview eliminates configuration anxiety (#5). Together they create a "Snyk-class" onboarding where a new user goes from "heard about it" to "seeing value" in under 10 seconds with zero prerequisites.
|
|
227
|
+
|
|
228
|
+
### C. Trust Architecture (#6 + #7 + confidence implications of #1)
|
|
229
|
+
Failure-to-action protocol makes errors recoverable (#6). Doctor command continuously audits health (#7). Interface contract ensures output schemas are predictable (#1). Together they address the agent-friendly 6/10 rating by making the tool transparent, honest, and self-healing.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Ideas by Dimension
|
|
234
|
+
|
|
235
|
+
| Dimension | Top Idea |
|
|
236
|
+
|-----------|----------|
|
|
237
|
+
| **Workflow / DX** | Zero-Config Preview (#5) — demonstrates value before asking commitment |
|
|
238
|
+
| **Reliability** | WASM-First Build (#2) — eliminates #1 source of install failures |
|
|
239
|
+
| **Extensibility** | Interface Contract Architecture (#1) — every new feature is agent-ready by construction |
|
|
240
|
+
| **Missing capabilities** | CLI-as-MCP Gateway (#3) — closes the 2-tool gap |
|
|
241
|
+
| **Docs / Knowledge compounding** | Auto-Provisioned Skills (#8) — self-generating agent integration |
|
|
242
|
+
| **Quality / Maintenance** | codemap doctor (#7) — continuous health monitoring |
|
|
243
|
+
| **Agent experience** | AI-First Default (#4) — JSON-first, consistent, composable |
|
|
244
|
+
| **Error handling** | Failure-to-Action Protocol (#6) — structured, recoverable errors |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Next Steps Menu
|
|
249
|
+
|
|
250
|
+
This ideation artifact identifies promising directions. The next step depends on what you want to do with these ideas:
|
|
251
|
+
|
|
252
|
+
1. **Refine** — Deep-dive into one or more survivors, exploring edge cases, implementation approaches, and interdependencies.
|
|
253
|
+
2. **Brainstorm** — Select one survivor and define it precisely enough for planning (requirements, boundaries, acceptance criteria). This hands off to `ce:brainstorm`.
|
|
254
|
+
3. **Save and end** — Archive this ideation and return to it later when priorities shift.
|
|
255
|
+
|
|
256
|
+
> **Routing note:** `ce:ideate` answers "What are the strongest ideas worth exploring?" `ce:brainstorm` answers "What exactly should one chosen idea mean?" `ce:plan` answers "How should it be built?" Do not skip to planning from ideation output.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-05-02
|
|
3
|
+
topic: subagent-environment-contract-retrieval
|
|
4
|
+
focus: Phase 58 subagent environment contract retrieval (revised v2)
|
|
5
|
+
mode: repo-grounded
|
|
6
|
+
run_id: b5a40dda
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Ideation: Subagent Environment Contract Retrieval
|
|
10
|
+
|
|
11
|
+
> **修订说明(v2)**:经社区实践验证,平台提供的"注入"机制存在根本性缺陷。本 ideation 从"注入模式"调整为"检索模式":不预编译 prompt snippet 塞给子代理,而是让子代理通过 CLI/MCP 自行查询项目规则。
|
|
12
|
+
|
|
13
|
+
## Grounding Context
|
|
14
|
+
|
|
15
|
+
### Codebase Context
|
|
16
|
+
|
|
17
|
+
- [证据] Phase 58 的问题定义是:Claude Code 与 Codex CLI 都有子代理能力,但项目级环境契约不会可靠进入子代理,导致 `rtk` 包装、commit 格式、测试入口、CodeMap 检索优先级等规则丢失:`.planning/phases/58-subagent-environment-contract-injection/58-CONTEXT.md:29`。
|
|
18
|
+
- [证据] **社区验证:平台注入机制不可靠**——Claude Code `SubagentStart` 的 `additionalContext` append 到 user context,会被上下文压缩丢弃(issue #23885);`PreToolUse` 的 `updatedInput` 对 Agent tool 静默丢弃(issue #39814);Codex `developer_instructions` 在 Windows 上不生效(#19399)、项目级自定义角色 `spawn_agent` 不认识(#14579):详见 `.planning/phases/58-subagent-environment-contract-injection/58-CONTEXT.md` 调研修正声明。
|
|
19
|
+
- [证据] Phase 58 scope 已锁定为环境契约发现、`.mycodemap/env-contract.json`、检索接口、平台适配配置示例、`mycodemap env-contract`、`init`、`doctor`、MCP 集成。`.mycodemap/prompt-snippets/` 已废弃:`.planning/phases/58-subagent-environment-contract-injection/58-CONTEXT.md:74`。
|
|
20
|
+
- [证据] Phase 58 明确 out of scope:不替代平台 spawn/wait/close、不自动重写 `CLAUDE.md` / `AGENTS.md`、不做跨仓库委派、不生成 prompt snippets 进行注入:`.planning/phases/58-subagent-environment-contract-injection/58-CONTEXT.md:103`。
|
|
21
|
+
- [证据] 设计已有 `ContractItem` 模型:`category`、`severity`、`content`、`metadata`、`sources.file/line/hash`:`.planning/phases/58-subagent-environment-contract-injection/58-DESIGN.md:64`。
|
|
22
|
+
- [证据] 现有 role filter 已覆盖 `explore`、`plan`、`edit`、`worker`、`verify`、`default`:`.planning/phases/58-subagent-environment-contract-injection/58-DESIGN.md:109`。
|
|
23
|
+
- [证据] CodeMap 已有可复用落点:`init` 的 plan/apply/receipt 架构:`src/cli/init/reconciler.ts:536`;`doctor` checker orchestrator:`src/cli/doctor/orchestrator.ts:10`;MCP 从 interface contract 自动注册 tools:`src/server/mcp/server.ts:78`。
|
|
24
|
+
- [证据] `.githooks/commit-msg` 实际接受 uppercase tags:`BUGFIX FEATURE REFACTOR CONFIG DOCS DELETE`,并要求 `[TAG] scope: message`:`.githooks/commit-msg:7`、`.githooks/commit-msg:25`、`.githooks/commit-msg:34`。
|
|
25
|
+
|
|
26
|
+
### Past Learnings
|
|
27
|
+
|
|
28
|
+
- [证据] 既有 ideation 已把 `init` 定位为项目级 AI 助手基础设施初始化器,并强调不自动改写 `CLAUDE.md` / `AGENTS.md`:`docs/ideation/2026-04-20-mycodemap-init-enhancements-ideation.md:17`。
|
|
29
|
+
- [证据] UX/agent experience ideation 已把机器可读接口契约、CLI-as-MCP、doctor、agent skills 自动分发列为高杠杆方向:`docs/ideation/2026-04-29-ux-install-agent-experience-ideation.md:100`。
|
|
30
|
+
- [证据] dogfood 报告指出 agent 高风险点包括 `--json` 不一致、静默通过、低置信度空结果和噪音输出:`docs/eatdogfood-reports/2026-04-17-eatdogfood-agent-experience.md:85`。
|
|
31
|
+
- [推论] Phase 58 最稳形态不是"把更多规则塞进 prompt",也不是"编译成可审计 IR 后注入",而是**"发现真实契约 -> 建立结构化索引 -> 提供统一检索接口 -> 让子代理自行查询"**。
|
|
32
|
+
|
|
33
|
+
### External Context
|
|
34
|
+
|
|
35
|
+
- [证据] OpenAI Codex 官方文档确认 Codex 支持 subagent workflows、自定义 agents、`.codex/agents/` TOML、`developer_instructions`、sandbox 继承与显式 spawn:https://developers.openai.com/codex/subagents
|
|
36
|
+
- [证据] Claude Code 官方文档确认 project subagents 位于 `.claude/agents/`,subagent 有独立 context window、custom system prompt、tool access;subagent file body 成为 system prompt,且不会收到完整 Claude Code system prompt:https://docs.anthropic.com/en/docs/claude-code/sub-agents
|
|
37
|
+
- [推论] 两个平台都提供了"平台级子代理运行时",但**项目级契约注入机制存在已知缺陷**。CodeMap 作为项目层工具,应提供**检索能力**而非**注入能力**。
|
|
38
|
+
|
|
39
|
+
### Risk Snapshot
|
|
40
|
+
|
|
41
|
+
- [推论] 最大风险从"把错误规则注入子代理"变为"子代理不执行检索提示,导致不知道规则"。
|
|
42
|
+
- [证据] 本轮 grounding 发现具体冲突风险:Phase 58 示例里出现 lowercase tags,但当前 hook 接受 uppercase tags;真实实现必须以 hook 或更权威来源为准。
|
|
43
|
+
- [证据] CodeMap CLI 本轮对真实存在的 phase Markdown 文件执行 `analyze -i read` 返回"未找到文件",已记录到 `.mycodemap/issues/codemap-issues.md`。
|
|
44
|
+
|
|
45
|
+
## Ranked Ideas
|
|
46
|
+
|
|
47
|
+
### 1. Env Contract Discovery + Retrieval Index
|
|
48
|
+
|
|
49
|
+
**Description:** [推论] 把 env-contract 生成做成"发现+索引"流程。扫描仓库规则源(hooks、docs、configs),提取结构化契约项,输出 `.mycodemap/env-contract.json` 作为**检索索引**。子代理通过 `mycodemap env-contract --for <type> --json` 或 MCP `codemap_env_contract` 自行查询。
|
|
50
|
+
|
|
51
|
+
**Rationale:** [推论] 这是 Phase 58 v2 的核心。不依赖平台注入机制,而是利用子代理自身的 Bash/MCP 工具能力。规则始终最新,跨平台一致,上下文占用极小(只有一条检索提示)。
|
|
52
|
+
|
|
53
|
+
**Downsides:** [观点] 依赖子代理自觉执行检索提示;Explore/Plan 子代理动机强,Edit/Worker 可能直接开干。需通过简洁明确的提示和 agent type 适配来缓解。
|
|
54
|
+
|
|
55
|
+
**Confidence:** 90%
|
|
56
|
+
|
|
57
|
+
**Complexity:** Medium
|
|
58
|
+
|
|
59
|
+
**Status:** Expanded to Phase 58 Design v2
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### 2. Contract Consistency Checker (冲突检测降级)
|
|
64
|
+
|
|
65
|
+
**Description:** [推论] 契约发现过程中检测多源冲突(如 hook 要求大写 tags,文档示例写小写)。输出 `conflicts[]` 到 `env-contract.json`,`mycodemap doctor` 报告冲突并给出 recommendation。不阻断生成,只 warn。
|
|
66
|
+
|
|
67
|
+
**Rationale:** [推论] 旧设计中的"冲突优先编译器"过于厚重(quarantined 状态、阻断策略)。降级为一致性检查更轻量,也避免变成小型规则推理系统。冲突由使用者决定以谁为准。
|
|
68
|
+
|
|
69
|
+
**Downsides:** [观点] 不自动解决冲突,需要人工判断。但自动解决冲突的权重分配本身就需要人工定义,warn-only 是务实的起点。
|
|
70
|
+
|
|
71
|
+
**Confidence:** 88%
|
|
72
|
+
|
|
73
|
+
**Complexity:** Low-Medium
|
|
74
|
+
|
|
75
|
+
**Status:** Incorporated into Phase 58 Design v2
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### 3. Platform Adapter Config Generator
|
|
80
|
+
|
|
81
|
+
**Description:** [推论] `mycodemap env-contract --as-hook-config` 生成 Claude Code `SubagentStart` hook 配置;`mycodemap env-contract --as-codex-agent` 生成 Codex `developer_instructions` 检索提示模板。作为 `.mycodemap/assistants/` 下的 copy-paste 示例,不自动修改用户配置。
|
|
82
|
+
|
|
83
|
+
**Rationale:** [推论] 降低用户接入门槛。用户不需要手写 hook JSON 或 TOML,只需 copy-paste 生成的示例到 `.claude/settings.json` 或 `.codex/agents/`。
|
|
84
|
+
|
|
85
|
+
**Downsides:** [观点] Codex agent 配置存在已知 bug(#19399, #14579),生成的配置在部分平台可能不生效。需在文档中标注已知限制和备选方案。
|
|
86
|
+
|
|
87
|
+
**Confidence:** 85%
|
|
88
|
+
|
|
89
|
+
**Complexity:** Low
|
|
90
|
+
|
|
91
|
+
**Status:** Incorporated into Phase 58 Design v2
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 4. Agent Readiness Doctor With Probe Matrix
|
|
96
|
+
|
|
97
|
+
**Description:** [推论] 为每个 critical/high contract item 增加 probe 定义:来源 hash、抽取规则、验证命令、失败样例。`doctor` 新增 env-contract checker,报告 missing、stale、conflicting、MCP-tool-missing。
|
|
98
|
+
|
|
99
|
+
**Rationale:** [推论] 这把"生成了契约"提升为"契约可被真实 CLI/subprocess 验证",贴合仓库真实场景验证阈值,也复用现有 doctor 架构。
|
|
100
|
+
|
|
101
|
+
**Downsides:** [观点] probe 初版应覆盖少数关键契约,如 commit、test、retrieval、output mode;不要一开始覆盖所有 docs/rules。
|
|
102
|
+
|
|
103
|
+
**Confidence:** 84%
|
|
104
|
+
|
|
105
|
+
**Complexity:** Medium
|
|
106
|
+
|
|
107
|
+
**Status:** Unexplored
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### 5. Context-Budgeted Contract Fetch
|
|
112
|
+
|
|
113
|
+
**Description:** [推论] `mycodemap env-contract --for <role>` 和 MCP `codemap_env_contract` 支持按 agent type 过滤返回契约;无 MCP 环境使用 `.mycodemap/env-contract.json` 文件直接读取。
|
|
114
|
+
|
|
115
|
+
**Rationale:** [推论] 子代理上下文有限,按类型过滤可减少返回数据量。MCP 强时动态拉取,MCP 不可用时仍能靠文件工作。
|
|
116
|
+
|
|
117
|
+
**Downsides:** [观点] 这是检索模式的自然延伸,不是独立架构方向。
|
|
118
|
+
|
|
119
|
+
**Confidence:** 82%
|
|
120
|
+
|
|
121
|
+
**Complexity:** Low
|
|
122
|
+
|
|
123
|
+
**Status:** Incorporated into Phase 58 Design v2
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### 6. Failure-Mode-First Contract Items
|
|
128
|
+
|
|
129
|
+
**Description:** [推论] 契约项不写成长手册,而是优先表达高频失败边界:不要裸 shell(本仓需 `rtk`)、不要错误 commit tag、不要用错误测试入口、低置信度空结果必须声明、机器输出必须保持 JSON/NDJSON 纯净。
|
|
130
|
+
|
|
131
|
+
**Rationale:** [推论] 子代理查询结果需要快速消化,负面边界比完整规范更能减少实际事故,也能自然支持失败场景验证。
|
|
132
|
+
|
|
133
|
+
**Downsides:** [观点] 如果只写禁止项,可能缺少正向示例;每个 critical item 至少应包含一个正确命令或正确格式。
|
|
134
|
+
|
|
135
|
+
**Confidence:** 78%
|
|
136
|
+
|
|
137
|
+
**Complexity:** Low-Medium
|
|
138
|
+
|
|
139
|
+
**Status:** Unexplored
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### 7. Subagent Preflight Receipt
|
|
144
|
+
|
|
145
|
+
**Description:** [推论] 子代理执行任务前,通过检索获取契约并在输出中简短 ACK(如"已检索项目规则:使用 rtk 包装、commit 格式 [TAG] scope: message")。父代理或验证脚本可观测到 ACK。
|
|
146
|
+
|
|
147
|
+
**Rationale:** [推论] 让"检索成功"成为可观测事件。如果子代理输出中没有规则 ACK,说明它可能忽略了检索提示。
|
|
148
|
+
|
|
149
|
+
**Downsides:** [观点] 不能要求所有子代理都复诵规则;ACK 应保持极短,主要用于验证与高风险任务。
|
|
150
|
+
|
|
151
|
+
**Confidence:** 72%
|
|
152
|
+
|
|
153
|
+
**Complexity:** Medium
|
|
154
|
+
|
|
155
|
+
**Status:** Unexplored
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Rejection Summary
|
|
160
|
+
|
|
161
|
+
| # | Idea | Reason Rejected |
|
|
162
|
+
|---|---|-----------------|
|
|
163
|
+
| 1 | Conflict-First Env Contract Compiler (v1) | [推论] 旧设计假设"注入可靠",但社区验证表明平台注入机制不可靠。"编译器+阻断"模型过于厚重,降级为"发现+索引+一致性检查"。 |
|
|
164
|
+
| 2 | EnvContract IR And Adapter Compiler (prompt snippet lowering) | [推论] 旧设计包含生成 prompt snippets 并注入子代理。因注入路径不可靠,不再生成 `.mycodemap/prompt-snippets/`。适配层改为"检索指引生成"。 |
|
|
165
|
+
| 3 | Role-scoped prompt packs / wristband / checklist | [推论] 是必要呈现形态,但已被检索模式覆盖。子代理通过查询获取适合自身的规则子集。 |
|
|
166
|
+
| 4 | Source freshness hash check | [推论] 是 doctor/probe matrix 的组成部分,不够独立。 |
|
|
167
|
+
| 5 | Init receipt with manual injection tasks | [推论] 已在 Phase 58 scope 和现有 init receipt 架构中,适合作为实现细节。 |
|
|
168
|
+
| 6 | MCP env contract tool standalone gate | [推论] MCP 很重要,但 standalone 版本过度依赖 MCP;已并入检索接口设计。 |
|
|
169
|
+
| 7 | Platform-specific snippet packs | [推论] 已被平台适配配置生成覆盖。 |
|
|
170
|
+
| 8 | Contract as environment API | [推论] 是检索模式的核心原则,而非单独产品方向。 |
|
|
171
|
+
| 9 | 10x-token dossier | [观点] 可作为 debug mode,但主路径需要最小必要契约。 |
|
|
172
|
+
| 10 | Solo maintainer profile | [观点] 太窄,和 default profile 区别不够大。 |
|
|
173
|
+
| 11 | Multi-team role lattice | [推论] 方向合理,但 scenario profiles 更简单、更适合 Phase 58。 |
|
|
174
|
+
| 12 | No-platform bootstrap packet | [观点] 是边界原则,不是独立实施项。 |
|
|
175
|
+
| 13 | Subagent context gap report | [推论] 适合作为 doctor/fetch 的报告视图。 |
|
|
176
|
+
| 14 | JSON/NDJSON contract audit stream | [推论] 是检索接口必备输出属性,不是独立方向。 |
|
|
177
|
+
|
|
178
|
+
## Session Log
|
|
179
|
+
|
|
180
|
+
- 2026-05-02: 初始 ideation(v1);假设"注入可靠",提出冲突优先编译器、prompt snippet 生成等方案。
|
|
181
|
+
- 2026-05-02: 社区验证:发现 Claude Code `additionalContext` 压缩丢弃、`updatedInput` 静默丢弃、Codex agent 配置 bug 等关键证据。
|
|
182
|
+
- 2026-05-02: **修订为 v2**:从"注入模式"全面转向"检索模式",废弃 prompt snippets 和冲突编译器,改为检索索引 + 一致性检查 + 平台适配配置生成。
|
|
183
|
+
- 2026-05-02: Phase 58 Context 和 Design 文档已同步更新为 v2。
|