mdcontext 0.0.1 → 0.2.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/.changeset/README.md +28 -0
- package/.changeset/config.json +11 -0
- package/.claude/settings.local.json +25 -0
- package/.github/workflows/ci.yml +83 -0
- package/.github/workflows/claude-code-review.yml +44 -0
- package/.github/workflows/claude.yml +85 -0
- package/.github/workflows/release.yml +113 -0
- package/.tldrignore +112 -0
- package/BACKLOG.md +338 -0
- package/CONTRIBUTING.md +186 -0
- package/NOTES/NOTES +44 -0
- package/README.md +434 -11
- package/biome.json +36 -0
- package/cspell.config.yaml +14 -0
- package/dist/chunk-23UPXDNL.js +3044 -0
- package/dist/chunk-2W7MO2DL.js +1366 -0
- package/dist/chunk-3NUAZGMA.js +1689 -0
- package/dist/chunk-7TOWB2XB.js +366 -0
- package/dist/chunk-7XOTOADQ.js +3065 -0
- package/dist/chunk-AH2PDM2K.js +3042 -0
- package/dist/chunk-BNXWSZ63.js +3742 -0
- package/dist/chunk-BTL5DJVU.js +3222 -0
- package/dist/chunk-HDHYG7E4.js +104 -0
- package/dist/chunk-HLR4KZBP.js +3234 -0
- package/dist/chunk-IP3FRFEB.js +1045 -0
- package/dist/chunk-KHU56VDO.js +3042 -0
- package/dist/chunk-KRYIFLQR.js +88 -0
- package/dist/chunk-LBSDNLEM.js +287 -0
- package/dist/chunk-MNTQ7HCP.js +2643 -0
- package/dist/chunk-MUJELQQ6.js +1387 -0
- package/dist/chunk-MXJGMSLV.js +2199 -0
- package/dist/chunk-N6QJGC3Z.js +2636 -0
- package/dist/chunk-OBELGBPM.js +1713 -0
- package/dist/chunk-OT7R5XTA.js +3192 -0
- package/dist/chunk-P7X4RA2T.js +106 -0
- package/dist/chunk-PIDUQNC2.js +3185 -0
- package/dist/chunk-POGCDIH4.js +3187 -0
- package/dist/chunk-PSIEOQGZ.js +3043 -0
- package/dist/chunk-PVRT3IHA.js +3238 -0
- package/dist/chunk-QNN4TT23.js +1430 -0
- package/dist/chunk-RE3R45RJ.js +3042 -0
- package/dist/chunk-S7E6TFX6.js +803 -0
- package/dist/chunk-SG6GLU4U.js +1378 -0
- package/dist/chunk-SJCDV2ST.js +274 -0
- package/dist/chunk-SYE5XLF3.js +104 -0
- package/dist/chunk-T5VLYBZD.js +103 -0
- package/dist/chunk-TOQB7VWU.js +3238 -0
- package/dist/chunk-VFNMZ4ZQ.js +3228 -0
- package/dist/chunk-VVTGZNBT.js +1629 -0
- package/dist/chunk-W7Q4RFEV.js +104 -0
- package/dist/chunk-XTYYVRLO.js +3190 -0
- package/dist/chunk-Y6MDYVJD.js +3063 -0
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +5458 -0
- package/dist/index.d.ts +653 -0
- package/dist/index.js +79 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +472 -0
- package/dist/schema-BAWSG7KY.js +22 -0
- package/dist/schema-E3QUPL26.js +20 -0
- package/dist/schema-EHL7WUT6.js +20 -0
- package/docs/019-USAGE.md +625 -0
- package/docs/020-current-implementation.md +364 -0
- package/docs/021-DOGFOODING-FINDINGS.md +175 -0
- package/docs/BACKLOG.md +80 -0
- package/docs/CONFIG.md +1123 -0
- package/docs/DESIGN.md +439 -0
- package/docs/ERRORS.md +383 -0
- package/docs/PROJECT.md +88 -0
- package/docs/ROADMAP.md +407 -0
- package/docs/summarization.md +320 -0
- package/docs/test-links.md +9 -0
- package/justfile +40 -0
- package/package.json +74 -9
- package/pnpm-workspace.yaml +5 -0
- package/research/INDEX.md +315 -0
- package/research/code-review/README.md +90 -0
- package/research/code-review/cli-error-handling-review.md +979 -0
- package/research/code-review/code-review-validation-report.md +464 -0
- package/research/code-review/main-ts-review.md +1128 -0
- package/research/config-analysis/01-current-implementation.md +470 -0
- package/research/config-analysis/02-strategy-recommendation.md +428 -0
- package/research/config-analysis/03-task-candidates.md +715 -0
- package/research/config-analysis/033-research-configuration-management.md +828 -0
- package/research/config-analysis/034-research-effect-cli-config.md +1504 -0
- package/research/config-analysis/04-consolidated-task-candidates.md +277 -0
- package/research/config-docs/SUMMARY.md +357 -0
- package/research/config-docs/TEST-RESULTS.md +776 -0
- package/research/config-docs/TODO.md +542 -0
- package/research/config-docs/analysis.md +744 -0
- package/research/config-docs/fix-validation.md +502 -0
- package/research/config-docs/help-audit.md +264 -0
- package/research/config-docs/help-system-analysis.md +890 -0
- package/research/dogfood/consolidated-tool-evaluation.md +373 -0
- package/research/dogfood/strategy-a/a-synthesis.md +184 -0
- package/research/dogfood/strategy-a/a1-docs.md +226 -0
- package/research/dogfood/strategy-a/a2-amorphic.md +156 -0
- package/research/dogfood/strategy-a/a3-llm.md +164 -0
- package/research/dogfood/strategy-b/b-synthesis.md +228 -0
- package/research/dogfood/strategy-b/b1-architecture.md +207 -0
- package/research/dogfood/strategy-b/b2-gaps.md +258 -0
- package/research/dogfood/strategy-b/b3-workflows.md +250 -0
- package/research/dogfood/strategy-c/c-synthesis.md +451 -0
- package/research/dogfood/strategy-c/c1-explorer.md +192 -0
- package/research/dogfood/strategy-c/c2-diver-memory.md +145 -0
- package/research/dogfood/strategy-c/c3-diver-control.md +148 -0
- package/research/dogfood/strategy-c/c4-diver-failure.md +151 -0
- package/research/dogfood/strategy-c/c5-diver-execution.md +221 -0
- package/research/dogfood/strategy-c/c6-diver-org.md +221 -0
- package/research/effect-cli-error-handling.md +845 -0
- package/research/effect-errors-as-values.md +943 -0
- package/research/errors-task-analysis/00-consolidated-tasks.md +207 -0
- package/research/errors-task-analysis/cli-commands-analysis.md +909 -0
- package/research/errors-task-analysis/embeddings-analysis.md +709 -0
- package/research/errors-task-analysis/index-search-analysis.md +812 -0
- package/research/frontmatter/COMMENTS-ARE-SKIPPED.md +149 -0
- package/research/frontmatter/LLM-CODE-NAVIGATION.md +276 -0
- package/research/issue-review.md +603 -0
- package/research/llm-summarization/agent-cli-tools-2026.md +1082 -0
- package/research/llm-summarization/alternative-providers-2026.md +1428 -0
- package/research/llm-summarization/anthropic-2026.md +367 -0
- package/research/llm-summarization/claude-cli-integration.md +1706 -0
- package/research/llm-summarization/cli-integration-patterns.md +3155 -0
- package/research/llm-summarization/openai-2026.md +473 -0
- package/research/llm-summarization/openai-compatible-providers-2026.md +1022 -0
- package/research/llm-summarization/opencode-cli-integration.md +1552 -0
- package/research/llm-summarization/prompt-engineering-2026.md +1426 -0
- package/research/llm-summarization/prototype-results.md +56 -0
- package/research/llm-summarization/provider-switching-patterns-2026.md +2153 -0
- package/research/llm-summarization/typescript-llm-libraries-2026.md +2436 -0
- package/research/mdcontext-error-analysis.md +521 -0
- package/research/mdcontext-pudding/00-EXECUTIVE-SUMMARY.md +282 -0
- package/research/mdcontext-pudding/01-index-embed.md +956 -0
- package/research/mdcontext-pudding/02-search-COMMANDS.md +142 -0
- package/research/mdcontext-pudding/02-search-SUMMARY.md +146 -0
- package/research/mdcontext-pudding/02-search.md +970 -0
- package/research/mdcontext-pudding/03-context.md +779 -0
- package/research/mdcontext-pudding/04-navigation-and-analytics.md +803 -0
- package/research/mdcontext-pudding/04-tree.md +704 -0
- package/research/mdcontext-pudding/05-config.md +1038 -0
- package/research/mdcontext-pudding/06-links-summary.txt +87 -0
- package/research/mdcontext-pudding/06-links.md +679 -0
- package/research/mdcontext-pudding/07-stats.md +693 -0
- package/research/mdcontext-pudding/BUG-FIX-PLAN.md +388 -0
- package/research/mdcontext-pudding/P0-BUG-VALIDATION.md +167 -0
- package/research/mdcontext-pudding/README.md +168 -0
- package/research/mdcontext-pudding/TESTING-SUMMARY.md +128 -0
- package/research/npm_publish/011-npm-workflow-research-agent2.md +792 -0
- package/research/npm_publish/012-npm-workflow-research-agent1.md +530 -0
- package/research/npm_publish/013-npm-workflow-research-agent3.md +722 -0
- package/research/npm_publish/014-npm-workflow-synthesis.md +556 -0
- package/research/npm_publish/031-npm-workflow-task-analysis.md +134 -0
- package/research/research-quality-review.md +834 -0
- package/research/semantic-search/002-research-embedding-models.md +490 -0
- package/research/semantic-search/003-research-rag-alternatives.md +523 -0
- package/research/semantic-search/004-research-vector-search.md +841 -0
- package/research/semantic-search/032-research-semantic-search.md +427 -0
- package/research/semantic-search/embedding-text-analysis.md +156 -0
- package/research/semantic-search/multi-word-failure-reproduction.md +171 -0
- package/research/semantic-search/query-processing-analysis.md +207 -0
- package/research/semantic-search/root-cause-and-solution.md +114 -0
- package/research/semantic-search/threshold-validation-report.md +69 -0
- package/research/semantic-search/vector-search-analysis.md +63 -0
- package/research/task-management-2026/00-synthesis-recommendations.md +295 -0
- package/research/task-management-2026/01-ai-workflow-tools.md +416 -0
- package/research/task-management-2026/02-agent-framework-patterns.md +476 -0
- package/research/task-management-2026/03-lightweight-file-based.md +567 -0
- package/research/task-management-2026/04-established-tools-ai-features.md +541 -0
- package/research/task-management-2026/linear/01-core-features-workflow.md +771 -0
- package/research/task-management-2026/linear/02-api-integrations.md +930 -0
- package/research/task-management-2026/linear/03-ai-features.md +368 -0
- package/research/task-management-2026/linear/04-pricing-setup.md +205 -0
- package/research/task-management-2026/linear/05-usage-patterns-best-practices.md +605 -0
- package/research/test-path-issues.md +276 -0
- package/review/ALP-76/1-error-type-design.md +962 -0
- package/review/ALP-76/2-error-handling-patterns.md +906 -0
- package/review/ALP-76/3-error-presentation.md +624 -0
- package/review/ALP-76/4-test-coverage.md +625 -0
- package/review/ALP-76/5-migration-completeness.md +440 -0
- package/review/ALP-76/6-effect-best-practices.md +755 -0
- package/scripts/apply-branch-protection.sh +47 -0
- package/scripts/branch-protection-templates.json +79 -0
- package/scripts/prototype-summarization.ts +346 -0
- package/scripts/rebuild-hnswlib.js +58 -0
- package/scripts/setup-branch-protection.sh +64 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/active-provider.json +7 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/bm25.json +541 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/bm25.meta.json +5 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/config.json +8 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.bin +0 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.meta.bin +0 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/documents.json +60 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/links.json +13 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/sections.json +1197 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/configuration-management.md +99 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/distributed-systems.md +92 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/error-handling.md +78 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/failure-automation.md +55 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/job-context.md +69 -0
- package/src/__tests__/fixtures/semantic-search/multi-word-corpus/process-orchestration.md +99 -0
- package/src/cli/argv-preprocessor.test.ts +210 -0
- package/src/cli/argv-preprocessor.ts +202 -0
- package/src/cli/cli.test.ts +627 -0
- package/src/cli/commands/backlinks.ts +54 -0
- package/src/cli/commands/config-cmd.ts +642 -0
- package/src/cli/commands/context.ts +285 -0
- package/src/cli/commands/duplicates.ts +122 -0
- package/src/cli/commands/embeddings.ts +529 -0
- package/src/cli/commands/index-cmd.ts +480 -0
- package/src/cli/commands/index.ts +16 -0
- package/src/cli/commands/links.ts +52 -0
- package/src/cli/commands/search.ts +1281 -0
- package/src/cli/commands/stats.ts +149 -0
- package/src/cli/commands/tree.ts +128 -0
- package/src/cli/config-layer.ts +176 -0
- package/src/cli/error-handler.test.ts +235 -0
- package/src/cli/error-handler.ts +655 -0
- package/src/cli/flag-schemas.ts +341 -0
- package/src/cli/help.ts +588 -0
- package/src/cli/index.ts +9 -0
- package/src/cli/main.ts +435 -0
- package/src/cli/options.ts +41 -0
- package/src/cli/shared-error-handling.ts +199 -0
- package/src/cli/typo-suggester.test.ts +105 -0
- package/src/cli/typo-suggester.ts +130 -0
- package/src/cli/utils.ts +259 -0
- package/src/config/file-provider.test.ts +320 -0
- package/src/config/file-provider.ts +273 -0
- package/src/config/index.ts +72 -0
- package/src/config/integration.test.ts +667 -0
- package/src/config/precedence.test.ts +277 -0
- package/src/config/precedence.ts +451 -0
- package/src/config/schema.test.ts +414 -0
- package/src/config/schema.ts +603 -0
- package/src/config/service.test.ts +320 -0
- package/src/config/service.ts +243 -0
- package/src/config/testing.test.ts +264 -0
- package/src/config/testing.ts +110 -0
- package/src/core/index.ts +1 -0
- package/src/core/types.ts +113 -0
- package/src/duplicates/detector.test.ts +183 -0
- package/src/duplicates/detector.ts +414 -0
- package/src/duplicates/index.ts +18 -0
- package/src/embeddings/embedding-namespace.test.ts +300 -0
- package/src/embeddings/embedding-namespace.ts +947 -0
- package/src/embeddings/heading-boost.test.ts +222 -0
- package/src/embeddings/hnsw-build-options.test.ts +198 -0
- package/src/embeddings/hyde.test.ts +272 -0
- package/src/embeddings/hyde.ts +264 -0
- package/src/embeddings/index.ts +10 -0
- package/src/embeddings/openai-provider.ts +414 -0
- package/src/embeddings/pricing.json +22 -0
- package/src/embeddings/provider-constants.ts +204 -0
- package/src/embeddings/provider-errors.test.ts +967 -0
- package/src/embeddings/provider-errors.ts +565 -0
- package/src/embeddings/provider-factory.test.ts +240 -0
- package/src/embeddings/provider-factory.ts +225 -0
- package/src/embeddings/provider-integration.test.ts +788 -0
- package/src/embeddings/query-preprocessing.test.ts +187 -0
- package/src/embeddings/semantic-search-threshold.test.ts +508 -0
- package/src/embeddings/semantic-search.ts +1270 -0
- package/src/embeddings/types.ts +359 -0
- package/src/embeddings/vector-store.ts +708 -0
- package/src/embeddings/voyage-provider.ts +313 -0
- package/src/errors/errors.test.ts +845 -0
- package/src/errors/index.ts +533 -0
- package/src/index/ignore-patterns.test.ts +354 -0
- package/src/index/ignore-patterns.ts +305 -0
- package/src/index/index.ts +4 -0
- package/src/index/indexer.ts +684 -0
- package/src/index/storage.ts +260 -0
- package/src/index/types.ts +147 -0
- package/src/index/watcher.ts +189 -0
- package/src/index.ts +30 -0
- package/src/integration/search-keyword.test.ts +678 -0
- package/src/mcp/server.ts +612 -0
- package/src/parser/index.ts +1 -0
- package/src/parser/parser.test.ts +291 -0
- package/src/parser/parser.ts +394 -0
- package/src/parser/section-filter.test.ts +277 -0
- package/src/parser/section-filter.ts +392 -0
- package/src/search/__tests__/hybrid-search.test.ts +650 -0
- package/src/search/bm25-store.ts +366 -0
- package/src/search/cross-encoder.test.ts +253 -0
- package/src/search/cross-encoder.ts +406 -0
- package/src/search/fuzzy-search.test.ts +419 -0
- package/src/search/fuzzy-search.ts +273 -0
- package/src/search/hybrid-search.ts +448 -0
- package/src/search/path-matcher.test.ts +276 -0
- package/src/search/path-matcher.ts +33 -0
- package/src/search/query-parser.test.ts +260 -0
- package/src/search/query-parser.ts +319 -0
- package/src/search/searcher.test.ts +280 -0
- package/src/search/searcher.ts +724 -0
- package/src/search/wink-bm25.d.ts +30 -0
- package/src/summarization/cli-providers/claude.ts +202 -0
- package/src/summarization/cli-providers/detection.test.ts +273 -0
- package/src/summarization/cli-providers/detection.ts +118 -0
- package/src/summarization/cli-providers/index.ts +8 -0
- package/src/summarization/cost.test.ts +139 -0
- package/src/summarization/cost.ts +102 -0
- package/src/summarization/error-handler.test.ts +127 -0
- package/src/summarization/error-handler.ts +111 -0
- package/src/summarization/index.ts +102 -0
- package/src/summarization/pipeline.test.ts +498 -0
- package/src/summarization/pipeline.ts +231 -0
- package/src/summarization/prompts.test.ts +269 -0
- package/src/summarization/prompts.ts +133 -0
- package/src/summarization/provider-factory.test.ts +396 -0
- package/src/summarization/provider-factory.ts +178 -0
- package/src/summarization/types.ts +184 -0
- package/src/summarize/budget-bugs.test.ts +620 -0
- package/src/summarize/formatters.ts +419 -0
- package/src/summarize/index.ts +20 -0
- package/src/summarize/summarizer.test.ts +275 -0
- package/src/summarize/summarizer.ts +597 -0
- package/src/summarize/verify-bugs.test.ts +238 -0
- package/src/types/huggingface-transformers.d.ts +66 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/tokens.test.ts +142 -0
- package/src/utils/tokens.ts +186 -0
- package/tests/fixtures/cli/.mdcontext/active-provider.json +7 -0
- package/tests/fixtures/cli/.mdcontext/config.json +8 -0
- package/tests/fixtures/cli/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.bin +0 -0
- package/tests/fixtures/cli/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.meta.bin +0 -0
- package/tests/fixtures/cli/.mdcontext/indexes/documents.json +33 -0
- package/tests/fixtures/cli/.mdcontext/indexes/links.json +12 -0
- package/tests/fixtures/cli/.mdcontext/indexes/sections.json +247 -0
- package/tests/fixtures/cli/README.md +9 -0
- package/tests/fixtures/cli/api-reference.md +11 -0
- package/tests/fixtures/cli/getting-started.md +11 -0
- package/tests/integration/embed-index.test.ts +712 -0
- package/tests/integration/search-context.test.ts +469 -0
- package/tests/integration/search-semantic.test.ts +522 -0
- package/tsconfig.json +26 -0
- package/vitest.config.ts +16 -0
- package/vitest.setup.ts +12 -0
package/justfile
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# CSS Shorthand Expand - Build Commands
|
|
2
|
+
set shell := ["bash", "-cu"]
|
|
3
|
+
|
|
4
|
+
# Default task
|
|
5
|
+
default: check test
|
|
6
|
+
|
|
7
|
+
# ------------- Build & Test -------------
|
|
8
|
+
build:
|
|
9
|
+
pnpm run build
|
|
10
|
+
|
|
11
|
+
test:
|
|
12
|
+
pnpm test
|
|
13
|
+
|
|
14
|
+
coverage:
|
|
15
|
+
pnpm run test:coverage
|
|
16
|
+
|
|
17
|
+
watch:
|
|
18
|
+
pnpm run test:watch
|
|
19
|
+
|
|
20
|
+
# ------------- Quality Gates -------------
|
|
21
|
+
|
|
22
|
+
typecheck:
|
|
23
|
+
pnpm run typecheck
|
|
24
|
+
|
|
25
|
+
lint:
|
|
26
|
+
biome check .
|
|
27
|
+
|
|
28
|
+
format:
|
|
29
|
+
biome format --write .
|
|
30
|
+
|
|
31
|
+
fix:
|
|
32
|
+
biome check --write .
|
|
33
|
+
|
|
34
|
+
check: format fix typecheck
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# test:
|
|
38
|
+
# npx tsx --test src/**/*.test.ts
|
|
39
|
+
|
|
40
|
+
# check: lint format typecheck
|
package/package.json
CHANGED
|
@@ -1,19 +1,84 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdcontext",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Token-efficient markdown analysis tool for LLM consumption",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/mdcontext/mdcontext.git"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public",
|
|
12
|
+
"provenance": true
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"bin": {
|
|
17
|
+
"mdcontext": "./dist/cli/main.js",
|
|
18
|
+
"mdcontext-mcp": "./dist/mcp/server.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"postinstall": "node scripts/rebuild-hnswlib.js",
|
|
22
|
+
"build": "tsup src/cli/main.ts src/mcp/server.ts src/index.ts --format esm --dts --external @huggingface/transformers",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:all": "INCLUDE_EMBED_TESTS=true vitest run",
|
|
26
|
+
"test:rebuild": "REBUILD_TEST_INDEX=true vitest run",
|
|
27
|
+
"test:all:rebuild": "REBUILD_TEST_INDEX=true INCLUDE_EMBED_TESTS=true vitest run",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"lint": "biome lint --write .",
|
|
31
|
+
"format": "biome format --write . && biome check --write .",
|
|
32
|
+
"check": "pnpm format && pnpm lint && pnpm typecheck",
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"quality": "pnpm build && npx publint && npx attw --pack .",
|
|
35
|
+
"prepublishOnly": "pnpm build && pnpm test && pnpm typecheck",
|
|
36
|
+
"changeset": "changeset",
|
|
37
|
+
"release": "changeset publish"
|
|
38
|
+
},
|
|
5
39
|
"keywords": [
|
|
6
40
|
"markdown",
|
|
7
|
-
"context",
|
|
8
41
|
"llm",
|
|
9
|
-
"
|
|
42
|
+
"ai",
|
|
43
|
+
"analysis",
|
|
44
|
+
"search",
|
|
10
45
|
"embeddings"
|
|
11
46
|
],
|
|
12
|
-
"author": "
|
|
47
|
+
"author": "",
|
|
13
48
|
"license": "MIT",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@clack/prompts": "^0.11.0",
|
|
54
|
+
"@effect/cli": "^0.73.1",
|
|
55
|
+
"@effect/platform": "^0.94.2",
|
|
56
|
+
"@effect/platform-node": "^0.104.1",
|
|
57
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
58
|
+
"@msgpack/msgpack": "^3.1.3",
|
|
59
|
+
"chokidar": "^5.0.0",
|
|
60
|
+
"effect": "^3.19.15",
|
|
61
|
+
"gray-matter": "^4.0.3",
|
|
62
|
+
"hnswlib-node": "^3.0.0",
|
|
63
|
+
"ignore": "^7.0.5",
|
|
64
|
+
"openai": "^6.16.0",
|
|
65
|
+
"remark": "^15.0.1",
|
|
66
|
+
"remark-gfm": "^4.0.1",
|
|
67
|
+
"remark-parse": "^11.0.0",
|
|
68
|
+
"stemmer": "^2.0.1",
|
|
69
|
+
"tiktoken": "^1.0.22",
|
|
70
|
+
"unified": "^11.0.5",
|
|
71
|
+
"unist-util-visit": "^5.1.0",
|
|
72
|
+
"wink-bm25-text-search": "^3.1.2"
|
|
17
73
|
},
|
|
18
|
-
"
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@biomejs/biome": "^2.3.12",
|
|
76
|
+
"@changesets/changelog-github": "^0.5.2",
|
|
77
|
+
"@changesets/cli": "^2.29.8",
|
|
78
|
+
"@types/mdast": "^4.0.4",
|
|
79
|
+
"@types/node": "^25.0.10",
|
|
80
|
+
"tsup": "^8.5.1",
|
|
81
|
+
"typescript": "^5.9.3",
|
|
82
|
+
"vitest": "^4.0.18"
|
|
83
|
+
}
|
|
19
84
|
}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# Research Documentation Index
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-01-24 06:38:24 UTC
|
|
4
|
+
**Git Commit:** 07c9e72ba01cda840046b96a1be4743a85e3d4c5
|
|
5
|
+
**Worktree:** nancy-ALP-139
|
|
6
|
+
**Last Updated:** 2026-01-24 06:49:16 UTC
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
This directory contains research documentation created during the development of mdcontext. Documents vary in accuracy and status based on when they were created relative to code changes.
|
|
13
|
+
|
|
14
|
+
**Legend:**
|
|
15
|
+
- **Authoritative** - Most reliable, validated against current code
|
|
16
|
+
- **Valid** - Accurate to current code state
|
|
17
|
+
- **Outdated** - Based on older code, findings may no longer apply
|
|
18
|
+
- **Needs Validation** - Line numbers/findings need checking against current code
|
|
19
|
+
- **Historical** - Preserved for methodology reference
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Frontmatter Research (LLM Code Navigation)
|
|
24
|
+
|
|
25
|
+
**Seminal research into how structured metadata enables 88-97% token reduction for LLM code navigation.**
|
|
26
|
+
|
|
27
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
28
|
+
|----------|--------|----------|----------------|---------|
|
|
29
|
+
| [frontmatter/LLM-CODE-NAVIGATION.md](frontmatter/LLM-CODE-NAVIGATION.md) | **Authoritative** | 100% | 2026-01-28 | **THE THESIS** - Comprehensive research proving frontmatter reduces LLM token usage by 88-97% on real codebases. Includes methodology, benchmarks, and adoption path. |
|
|
30
|
+
| [frontmatter/COMMENTS-ARE-SKIPPED.md](frontmatter/COMMENTS-ARE-SKIPPED.md) | **Authoritative** | 100% | 2026-01-28 | **THE PIVOT** - Critical insight: LLMs skip comments. Frontmatter as comments is invisible. Solution: manifest JSON for LLMs, inline comments for humans. |
|
|
31
|
+
|
|
32
|
+
**Key Findings:**
|
|
33
|
+
- LLMs waste tokens reading entire files to understand what they do
|
|
34
|
+
- Frontmatter (metadata in first 10 lines) enables "peek first" triage
|
|
35
|
+
- 88-97% token reduction on architecture exploration, refactoring, code review tasks
|
|
36
|
+
- **Critical insight:** LLMs skip comments → frontmatter as comments is invisible
|
|
37
|
+
- **Solution:** Manifest JSON for LLMs, inline comments for humans - generate both
|
|
38
|
+
- fmm CLI generates/maintains frontmatter automatically
|
|
39
|
+
|
|
40
|
+
**Related Project:** [fmm (Frontmatter Matters)](https://github.com/mdcontext/fmm) - CLI tool for generating frontmatter
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Config System Research
|
|
45
|
+
|
|
46
|
+
Research into the configuration system, including bugs, documentation gaps, and implementation validation.
|
|
47
|
+
|
|
48
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
49
|
+
|----------|--------|----------|----------------|---------|
|
|
50
|
+
| [config-docs/fix-validation.md](config-docs/fix-validation.md) | Authoritative | 100% | 2026-01-24 | **START HERE** - Validates all proposed fixes against actual code. Most critical issues already fixed. |
|
|
51
|
+
| [config-docs/help-system-analysis.md](config-docs/help-system-analysis.md) | Valid | 100% | 2026-01-24 | **Architecture deep-dive** - How custom help and Effect CLI work together. Pattern matching logic and implementation details. |
|
|
52
|
+
| [config-docs/help-audit.md](config-docs/help-audit.md) | Valid | 100% | 2026-01-24 | Help system UX analysis. Identifies ugly Effect CLI output for bare `config` command. |
|
|
53
|
+
| [config-docs/TEST-RESULTS.md](config-docs/TEST-RESULTS.md) | Valid | 95% | 2026-01-24 | Manual test audit of config commands. Accurate for time tested (pre-fix). |
|
|
54
|
+
| [config-docs/SUMMARY.md](config-docs/SUMMARY.md) | Outdated | 60% | 2026-01-24 | Executive summary of config issues. **Note:** Most issues described here have been fixed. |
|
|
55
|
+
| [config-docs/analysis.md](config-docs/analysis.md) | Outdated | 60% | 2026-01-24 | Deep dive analysis (711 lines). Based on pre-fix code. Excellent methodology. |
|
|
56
|
+
| [config-docs/TODO.md](config-docs/TODO.md) | Outdated | 40% | 2026-01-24 | Action plan with code examples. 5 of 6 P0/P1 tasks complete. Only troubleshooting docs remain. |
|
|
57
|
+
|
|
58
|
+
**Key Findings:**
|
|
59
|
+
- TypeScript config loading: Fixed (documented limitation, default changed to .js)
|
|
60
|
+
- Summarization config exposure: Fixed (fully implemented)
|
|
61
|
+
- README configuration section: Fixed (comprehensive)
|
|
62
|
+
- Remaining work: Add troubleshooting section to CONFIG.md
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Config Analysis (Architecture)
|
|
67
|
+
|
|
68
|
+
Strategic analysis of configuration management approaches and implementation recommendations.
|
|
69
|
+
|
|
70
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
71
|
+
|----------|--------|----------|----------------|---------|
|
|
72
|
+
| [config-analysis/01-current-implementation.md](config-analysis/01-current-implementation.md) | Historical | TBD | Pending | Current config implementation analysis |
|
|
73
|
+
| [config-analysis/02-strategy-recommendation.md](config-analysis/02-strategy-recommendation.md) | Historical | TBD | Pending | Configuration strategy recommendations |
|
|
74
|
+
| [config-analysis/03-task-candidates.md](config-analysis/03-task-candidates.md) | Historical | TBD | Pending | Task breakdown for config work |
|
|
75
|
+
| [config-analysis/04-consolidated-task-candidates.md](config-analysis/04-consolidated-task-candidates.md) | Historical | TBD | Pending | Consolidated task list |
|
|
76
|
+
| [config-analysis/033-research-configuration-management.md](config-analysis/033-research-configuration-management.md) | Historical | TBD | Pending | Configuration management patterns research |
|
|
77
|
+
| [config-analysis/034-research-effect-cli-config.md](config-analysis/034-research-effect-cli-config.md) | Historical | TBD | Pending | Effect CLI configuration research |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Code Reviews
|
|
82
|
+
|
|
83
|
+
Detailed code reviews identifying bugs, anti-patterns, and quality issues.
|
|
84
|
+
|
|
85
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
86
|
+
|----------|--------|----------|----------------|---------|
|
|
87
|
+
| [code-review/main-ts-review.md](code-review/main-ts-review.md) | Needs Validation | TBD | Pending | 16 issues in main.ts (1 critical, 7 high, 5 medium, 3 low). **Warning:** Line numbers may be outdated. |
|
|
88
|
+
| [code-review/cli-error-handling-review.md](code-review/cli-error-handling-review.md) | Needs Validation | TBD | Pending | Error handling pattern analysis across 7 CLI commands. Identifies duplication and migration path. |
|
|
89
|
+
|
|
90
|
+
**Note:** Both code reviews reference specific line numbers that may have shifted since creation. Validation recommended before acting on findings.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Error Handling Research
|
|
95
|
+
|
|
96
|
+
Analysis of error handling patterns and migration strategies.
|
|
97
|
+
|
|
98
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
99
|
+
|----------|--------|----------|----------------|---------|
|
|
100
|
+
| [effect-cli-error-handling.md](effect-cli-error-handling.md) | Historical | TBD | Pending | Effect CLI error handling patterns |
|
|
101
|
+
| [effect-errors-as-values.md](effect-errors-as-values.md) | Historical | TBD | Pending | Errors-as-values pattern research |
|
|
102
|
+
| [mdcontext-error-analysis.md](mdcontext-error-analysis.md) | Historical | TBD | Pending | mdcontext error handling analysis |
|
|
103
|
+
| [errors-task-analysis/00-consolidated-tasks.md](errors-task-analysis/00-consolidated-tasks.md) | Historical | TBD | Pending | Consolidated error handling tasks |
|
|
104
|
+
| [errors-task-analysis/cli-commands-analysis.md](errors-task-analysis/cli-commands-analysis.md) | Historical | TBD | Pending | CLI commands error analysis |
|
|
105
|
+
| [errors-task-analysis/embeddings-analysis.md](errors-task-analysis/embeddings-analysis.md) | Historical | TBD | Pending | Embeddings module error analysis |
|
|
106
|
+
| [errors-task-analysis/index-search-analysis.md](errors-task-analysis/index-search-analysis.md) | Historical | TBD | Pending | Index/search error analysis |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## NPM Publishing Research
|
|
111
|
+
|
|
112
|
+
Research for setting up automated npm publishing workflow.
|
|
113
|
+
|
|
114
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
115
|
+
|----------|--------|----------|----------------|---------|
|
|
116
|
+
| [npm_publish/014-npm-workflow-synthesis.md](npm_publish/014-npm-workflow-synthesis.md) | Historical | TBD | Pending | Synthesis of npm workflow research |
|
|
117
|
+
| [npm_publish/031-npm-workflow-task-analysis.md](npm_publish/031-npm-workflow-task-analysis.md) | Historical | TBD | Pending | Task analysis for npm workflow |
|
|
118
|
+
| [npm_publish/011-npm-workflow-research-agent2.md](npm_publish/011-npm-workflow-research-agent2.md) | Historical | TBD | Pending | Agent 2 research findings |
|
|
119
|
+
| [npm_publish/012-npm-workflow-research-agent1.md](npm_publish/012-npm-workflow-research-agent1.md) | Historical | TBD | Pending | Agent 1 research findings |
|
|
120
|
+
| [npm_publish/013-npm-workflow-research-agent3.md](npm_publish/013-npm-workflow-research-agent3.md) | Historical | TBD | Pending | Agent 3 research findings |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Semantic Search Research
|
|
125
|
+
|
|
126
|
+
Research into semantic search, embeddings, and vector search capabilities.
|
|
127
|
+
|
|
128
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
129
|
+
|----------|--------|----------|----------------|---------|
|
|
130
|
+
| [semantic-search/032-research-semantic-search.md](semantic-search/032-research-semantic-search.md) | Historical | TBD | Pending | Semantic search implementation research |
|
|
131
|
+
| [semantic-search/004-research-vector-search.md](semantic-search/004-research-vector-search.md) | Historical | TBD | Pending | Vector search technologies |
|
|
132
|
+
| [semantic-search/003-research-rag-alternatives.md](semantic-search/003-research-rag-alternatives.md) | Historical | TBD | Pending | RAG and alternative approaches |
|
|
133
|
+
| [semantic-search/002-research-embedding-models.md](semantic-search/002-research-embedding-models.md) | Historical | TBD | Pending | Embedding model evaluation |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Task Management Research
|
|
138
|
+
|
|
139
|
+
Evaluation of task management tools and workflows for AI-assisted development.
|
|
140
|
+
|
|
141
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
142
|
+
|----------|--------|----------|----------------|---------|
|
|
143
|
+
| [task-management-2026/00-synthesis-recommendations.md](task-management-2026/00-synthesis-recommendations.md) | Historical | TBD | Pending | Synthesis and recommendations |
|
|
144
|
+
| [task-management-2026/01-ai-workflow-tools.md](task-management-2026/01-ai-workflow-tools.md) | Historical | TBD | Pending | AI workflow tools evaluation |
|
|
145
|
+
| [task-management-2026/02-agent-framework-patterns.md](task-management-2026/02-agent-framework-patterns.md) | Historical | TBD | Pending | Agent framework patterns |
|
|
146
|
+
| [task-management-2026/03-lightweight-file-based.md](task-management-2026/03-lightweight-file-based.md) | Historical | TBD | Pending | Lightweight file-based approaches |
|
|
147
|
+
| [task-management-2026/04-established-tools-ai-features.md](task-management-2026/04-established-tools-ai-features.md) | Historical | TBD | Pending | Established tools with AI features |
|
|
148
|
+
|
|
149
|
+
### Linear Deep Dive
|
|
150
|
+
|
|
151
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
152
|
+
|----------|--------|----------|----------------|---------|
|
|
153
|
+
| [task-management-2026/linear/01-core-features-workflow.md](task-management-2026/linear/01-core-features-workflow.md) | Historical | TBD | Pending | Linear core features and workflow |
|
|
154
|
+
| [task-management-2026/linear/02-api-integrations.md](task-management-2026/linear/02-api-integrations.md) | Historical | TBD | Pending | Linear API and integrations |
|
|
155
|
+
| [task-management-2026/linear/03-ai-features.md](task-management-2026/linear/03-ai-features.md) | Historical | TBD | Pending | Linear AI features |
|
|
156
|
+
| [task-management-2026/linear/04-pricing-setup.md](task-management-2026/linear/04-pricing-setup.md) | Historical | TBD | Pending | Linear pricing and setup |
|
|
157
|
+
| [task-management-2026/linear/05-usage-patterns-best-practices.md](task-management-2026/linear/05-usage-patterns-best-practices.md) | Historical | TBD | Pending | Linear usage patterns |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Dogfooding / Strategy Research
|
|
162
|
+
|
|
163
|
+
Strategic analysis of mdcontext usage for its own development.
|
|
164
|
+
|
|
165
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
166
|
+
|----------|--------|----------|----------------|---------|
|
|
167
|
+
| [dogfood/consolidated-tool-evaluation.md](dogfood/consolidated-tool-evaluation.md) | Historical | TBD | Pending | Consolidated evaluation of strategies |
|
|
168
|
+
|
|
169
|
+
### Strategy A: Documentation-First
|
|
170
|
+
|
|
171
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
172
|
+
|----------|--------|----------|----------------|---------|
|
|
173
|
+
| [dogfood/strategy-a/a-synthesis.md](dogfood/strategy-a/a-synthesis.md) | Historical | TBD | Pending | Strategy A synthesis |
|
|
174
|
+
| [dogfood/strategy-a/a1-docs.md](dogfood/strategy-a/a1-docs.md) | Historical | TBD | Pending | Documentation approach |
|
|
175
|
+
| [dogfood/strategy-a/a2-amorphic.md](dogfood/strategy-a/a2-amorphic.md) | Historical | TBD | Pending | Amorphic patterns |
|
|
176
|
+
| [dogfood/strategy-a/a3-llm.md](dogfood/strategy-a/a3-llm.md) | Historical | TBD | Pending | LLM integration |
|
|
177
|
+
|
|
178
|
+
### Strategy B: Architecture-First
|
|
179
|
+
|
|
180
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
181
|
+
|----------|--------|----------|----------------|---------|
|
|
182
|
+
| [dogfood/strategy-b/b-synthesis.md](dogfood/strategy-b/b-synthesis.md) | Historical | TBD | Pending | Strategy B synthesis |
|
|
183
|
+
| [dogfood/strategy-b/b1-architecture.md](dogfood/strategy-b/b1-architecture.md) | Historical | TBD | Pending | Architecture analysis |
|
|
184
|
+
| [dogfood/strategy-b/b2-gaps.md](dogfood/strategy-b/b2-gaps.md) | Historical | TBD | Pending | Gap analysis |
|
|
185
|
+
| [dogfood/strategy-b/b3-workflows.md](dogfood/strategy-b/b3-workflows.md) | Historical | TBD | Pending | Workflow patterns |
|
|
186
|
+
|
|
187
|
+
### Strategy C: Deep Dive
|
|
188
|
+
|
|
189
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
190
|
+
|----------|--------|----------|----------------|---------|
|
|
191
|
+
| [dogfood/strategy-c/c-synthesis.md](dogfood/strategy-c/c-synthesis.md) | Historical | TBD | Pending | Strategy C synthesis |
|
|
192
|
+
| [dogfood/strategy-c/c1-explorer.md](dogfood/strategy-c/c1-explorer.md) | Historical | TBD | Pending | Explorer pattern |
|
|
193
|
+
| [dogfood/strategy-c/c2-diver-memory.md](dogfood/strategy-c/c2-diver-memory.md) | Historical | TBD | Pending | Memory management |
|
|
194
|
+
| [dogfood/strategy-c/c3-diver-control.md](dogfood/strategy-c/c3-diver-control.md) | Historical | TBD | Pending | Control patterns |
|
|
195
|
+
| [dogfood/strategy-c/c4-diver-failure.md](dogfood/strategy-c/c4-diver-failure.md) | Historical | TBD | Pending | Failure handling |
|
|
196
|
+
| [dogfood/strategy-c/c5-diver-execution.md](dogfood/strategy-c/c5-diver-execution.md) | Historical | TBD | Pending | Execution patterns |
|
|
197
|
+
| [dogfood/strategy-c/c6-diver-org.md](dogfood/strategy-c/c6-diver-org.md) | Historical | TBD | Pending | Organization patterns |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Meta / Quality Reviews
|
|
202
|
+
|
|
203
|
+
Reviews of the research documentation itself.
|
|
204
|
+
|
|
205
|
+
| Document | Status | Accuracy | Last Validated | Summary |
|
|
206
|
+
|----------|--------|----------|----------------|---------|
|
|
207
|
+
| [research-quality-review.md](research-quality-review.md) | Valid | 100% | 2026-01-24 | Comprehensive quality review of all config research. Identifies accuracy issues and timeline problems. |
|
|
208
|
+
| [issue-review.md](issue-review.md) | Valid | 100% | 2026-01-24 | Review of Linear issues ALP-149, ALP-150, ALP-151, ALP-152. Finds 2 of 4 issues obsolete. |
|
|
209
|
+
| [test-path-issues.md](test-path-issues.md) | Valid | 100% | 2026-01-24 | Test path fix validation |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Document Statistics
|
|
214
|
+
|
|
215
|
+
- **Total Documents:** 61
|
|
216
|
+
- **Authoritative:** 3 (fix-validation.md, LLM-CODE-NAVIGATION.md, COMMENTS-ARE-SKIPPED.md)
|
|
217
|
+
- **Valid:** 5 (help-system-analysis, help-audit, TEST-RESULTS, quality reviews)
|
|
218
|
+
- **Outdated:** 3 (SUMMARY, analysis, TODO)
|
|
219
|
+
- **Needs Validation:** 2 (code reviews)
|
|
220
|
+
- **Historical/TBD:** 48
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Usage Guidelines
|
|
225
|
+
|
|
226
|
+
### For Current Work
|
|
227
|
+
|
|
228
|
+
1. **Start with Authoritative docs** - [fix-validation.md](config-docs/fix-validation.md) for config system status
|
|
229
|
+
2. **Check Valid docs** - These are accurate to current code
|
|
230
|
+
3. **Be cautious with Outdated** - Cross-reference with fix-validation.md
|
|
231
|
+
4. **Validate before using** - Code review docs may have stale line numbers
|
|
232
|
+
|
|
233
|
+
### For Research Methodology
|
|
234
|
+
|
|
235
|
+
1. **Use Historical docs as templates** - Excellent analysis patterns
|
|
236
|
+
2. **Note the validation process** - fix-validation.md shows proper validation
|
|
237
|
+
3. **Learn from mistakes** - research-quality-review.md explains what went wrong
|
|
238
|
+
|
|
239
|
+
### For Creating New Research
|
|
240
|
+
|
|
241
|
+
1. **Add metadata header** with date, commit hash, status
|
|
242
|
+
2. **Validate against current code** before creating issues
|
|
243
|
+
3. **Use file:line format** for references
|
|
244
|
+
4. **Update this index** when adding new documents
|
|
245
|
+
5. **Mark status clearly** - Authoritative/Valid/Outdated/Needs Validation
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Recommended Reading Order
|
|
250
|
+
|
|
251
|
+
### Understanding Config System (Current State)
|
|
252
|
+
|
|
253
|
+
1. [config-docs/fix-validation.md](config-docs/fix-validation.md) - What's actually implemented
|
|
254
|
+
2. [config-docs/help-system-analysis.md](config-docs/help-system-analysis.md) - How help system works (architecture)
|
|
255
|
+
3. [config-docs/help-audit.md](config-docs/help-audit.md) - Help UX quality evaluation
|
|
256
|
+
4. [config-docs/TODO.md](config-docs/TODO.md) - Check which items are still needed
|
|
257
|
+
|
|
258
|
+
### Understanding Code Quality Issues
|
|
259
|
+
|
|
260
|
+
1. [code-review/main-ts-review.md](code-review/main-ts-review.md) - Async/await bugs (validate line numbers first)
|
|
261
|
+
2. [code-review/cli-error-handling-review.md](code-review/cli-error-handling-review.md) - Error patterns (validate first)
|
|
262
|
+
|
|
263
|
+
### Understanding Research Quality
|
|
264
|
+
|
|
265
|
+
1. [research-quality-review.md](research-quality-review.md) - Meta-analysis of research quality
|
|
266
|
+
2. [issue-review.md](issue-review.md) - Linear issue accuracy review
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Contributing to Research
|
|
271
|
+
|
|
272
|
+
When adding new research documents:
|
|
273
|
+
|
|
274
|
+
1. Add metadata header (see template below)
|
|
275
|
+
2. Update this INDEX.md
|
|
276
|
+
3. Link from related documents
|
|
277
|
+
4. Mark status appropriately
|
|
278
|
+
|
|
279
|
+
### Metadata Template
|
|
280
|
+
|
|
281
|
+
```markdown
|
|
282
|
+
---
|
|
283
|
+
**RESEARCH METADATA**
|
|
284
|
+
|
|
285
|
+
- Analysis Date: YYYY-MM-DD
|
|
286
|
+
- Git Commit: [full SHA]
|
|
287
|
+
- Status: [Authoritative | Valid | Outdated | Needs Validation | Historical]
|
|
288
|
+
- Last Validated: YYYY-MM-DD
|
|
289
|
+
- Superseded By: [document if applicable]
|
|
290
|
+
|
|
291
|
+
**ACCURACY NOTE**
|
|
292
|
+
|
|
293
|
+
[Brief note about current accuracy and any known issues]
|
|
294
|
+
---
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Known Issues
|
|
300
|
+
|
|
301
|
+
1. **Line number drift** - Code review docs may have outdated line numbers
|
|
302
|
+
2. **Validation needed** - 48 historical docs need validation against current code
|
|
303
|
+
3. **Timeline confusion** - Some docs created after fixes were implemented
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Maintenance
|
|
308
|
+
|
|
309
|
+
This index should be updated:
|
|
310
|
+
- When new research documents are created
|
|
311
|
+
- When document status changes (e.g., Valid → Outdated)
|
|
312
|
+
- When validation is performed
|
|
313
|
+
- When documents are removed or consolidated
|
|
314
|
+
|
|
315
|
+
**Last maintenance:** 2026-01-28 by Claude Opus 4.5 (added frontmatter research)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Code Review Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains comprehensive code reviews and validation reports for the mdcontext CLI codebase.
|
|
4
|
+
|
|
5
|
+
## Documents
|
|
6
|
+
|
|
7
|
+
### 1. main-ts-review.md
|
|
8
|
+
**Focus:** `src/cli/main.ts` - CLI entry point
|
|
9
|
+
**Last Validated:** 2026-01-24 06:38:24 UTC
|
|
10
|
+
**Status:** 75% of issues resolved (12 of 16)
|
|
11
|
+
|
|
12
|
+
Comprehensive review covering:
|
|
13
|
+
- Async/await patterns
|
|
14
|
+
- Error handling
|
|
15
|
+
- TypeScript safety
|
|
16
|
+
- Edge cases
|
|
17
|
+
- Config loading
|
|
18
|
+
|
|
19
|
+
**Key Achievements:**
|
|
20
|
+
- Critical IIFE error handling fixed
|
|
21
|
+
- All high-priority type safety issues resolved
|
|
22
|
+
- Config validation significantly improved
|
|
23
|
+
|
|
24
|
+
### 2. cli-error-handling-review.md
|
|
25
|
+
**Focus:** All CLI command files and error handling infrastructure
|
|
26
|
+
**Last Validated:** 2026-01-24 06:38:24 UTC
|
|
27
|
+
**Status:** All 11 issues remain valid and accurately documented
|
|
28
|
+
|
|
29
|
+
Covers:
|
|
30
|
+
- Error handling patterns across commands
|
|
31
|
+
- Exit code correctness
|
|
32
|
+
- Effect composition issues
|
|
33
|
+
- Code duplication (150+ lines in search.ts)
|
|
34
|
+
- Legacy error handling
|
|
35
|
+
|
|
36
|
+
**Grade:** B+
|
|
37
|
+
|
|
38
|
+
### 3. code-review-validation-report.md
|
|
39
|
+
**Type:** Validation Report
|
|
40
|
+
**Date:** 2026-01-24 06:38:24 UTC
|
|
41
|
+
**Commit:** `07c9e72ba01cda840046b96a1be4743a85e3d4c5`
|
|
42
|
+
|
|
43
|
+
Summary of validation across both review documents:
|
|
44
|
+
- 27 total issues tracked
|
|
45
|
+
- 12 resolved (44%)
|
|
46
|
+
- 12 valid (44%)
|
|
47
|
+
- 3 moved (11%)
|
|
48
|
+
- 0 not found (0%)
|
|
49
|
+
|
|
50
|
+
## Status Legend
|
|
51
|
+
|
|
52
|
+
- ✅ **RESOLVED**: Issue has been fixed in the codebase
|
|
53
|
+
- ✓ **VALID**: Issue still exists as originally described
|
|
54
|
+
- 📍 **MOVED**: Issue still exists but line numbers changed
|
|
55
|
+
- ❌ **NOT FOUND**: Issue no longer applicable or code removed
|
|
56
|
+
|
|
57
|
+
## Next Steps
|
|
58
|
+
|
|
59
|
+
Based on the validation report, the recommended priorities are:
|
|
60
|
+
|
|
61
|
+
1. **Extract duplicated error handlers** (High priority, 2-3 hours)
|
|
62
|
+
- 150+ lines of duplication in search.ts
|
|
63
|
+
- 100+ lines in index-cmd.ts
|
|
64
|
+
|
|
65
|
+
2. **Replace Effect.runSync** (Medium priority, 3-4 hours)
|
|
66
|
+
- 15+ occurrences across codebase
|
|
67
|
+
- Breaks Effect composition model
|
|
68
|
+
|
|
69
|
+
3. **Remove process.exit() calls** (Medium priority, 4-5 hours)
|
|
70
|
+
- Requires Effect interrupt mechanism
|
|
71
|
+
- Bypasses cleanup
|
|
72
|
+
|
|
73
|
+
4. **Document error handling strategy** (Low priority, 1-2 hours)
|
|
74
|
+
- Guidelines for when to catch vs propagate
|
|
75
|
+
- Best practices documentation
|
|
76
|
+
|
|
77
|
+
**Total estimated effort:** 10-14 hours
|
|
78
|
+
|
|
79
|
+
## Validation Process
|
|
80
|
+
|
|
81
|
+
Each review document is validated against the current codebase by:
|
|
82
|
+
1. Verifying line numbers are accurate
|
|
83
|
+
2. Checking code patterns still exist
|
|
84
|
+
3. Determining if issues have been resolved
|
|
85
|
+
4. Updating status indicators
|
|
86
|
+
|
|
87
|
+
Re-validation should be performed:
|
|
88
|
+
- After major refactoring
|
|
89
|
+
- Before releases
|
|
90
|
+
- Quarterly as part of code quality reviews
|