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.
Files changed (337) hide show
  1. package/.changeset/README.md +28 -0
  2. package/.changeset/config.json +11 -0
  3. package/.claude/settings.local.json +25 -0
  4. package/.github/workflows/ci.yml +83 -0
  5. package/.github/workflows/claude-code-review.yml +44 -0
  6. package/.github/workflows/claude.yml +85 -0
  7. package/.github/workflows/release.yml +113 -0
  8. package/.tldrignore +112 -0
  9. package/BACKLOG.md +338 -0
  10. package/CONTRIBUTING.md +186 -0
  11. package/NOTES/NOTES +44 -0
  12. package/README.md +434 -11
  13. package/biome.json +36 -0
  14. package/cspell.config.yaml +14 -0
  15. package/dist/chunk-23UPXDNL.js +3044 -0
  16. package/dist/chunk-2W7MO2DL.js +1366 -0
  17. package/dist/chunk-3NUAZGMA.js +1689 -0
  18. package/dist/chunk-7TOWB2XB.js +366 -0
  19. package/dist/chunk-7XOTOADQ.js +3065 -0
  20. package/dist/chunk-AH2PDM2K.js +3042 -0
  21. package/dist/chunk-BNXWSZ63.js +3742 -0
  22. package/dist/chunk-BTL5DJVU.js +3222 -0
  23. package/dist/chunk-HDHYG7E4.js +104 -0
  24. package/dist/chunk-HLR4KZBP.js +3234 -0
  25. package/dist/chunk-IP3FRFEB.js +1045 -0
  26. package/dist/chunk-KHU56VDO.js +3042 -0
  27. package/dist/chunk-KRYIFLQR.js +88 -0
  28. package/dist/chunk-LBSDNLEM.js +287 -0
  29. package/dist/chunk-MNTQ7HCP.js +2643 -0
  30. package/dist/chunk-MUJELQQ6.js +1387 -0
  31. package/dist/chunk-MXJGMSLV.js +2199 -0
  32. package/dist/chunk-N6QJGC3Z.js +2636 -0
  33. package/dist/chunk-OBELGBPM.js +1713 -0
  34. package/dist/chunk-OT7R5XTA.js +3192 -0
  35. package/dist/chunk-P7X4RA2T.js +106 -0
  36. package/dist/chunk-PIDUQNC2.js +3185 -0
  37. package/dist/chunk-POGCDIH4.js +3187 -0
  38. package/dist/chunk-PSIEOQGZ.js +3043 -0
  39. package/dist/chunk-PVRT3IHA.js +3238 -0
  40. package/dist/chunk-QNN4TT23.js +1430 -0
  41. package/dist/chunk-RE3R45RJ.js +3042 -0
  42. package/dist/chunk-S7E6TFX6.js +803 -0
  43. package/dist/chunk-SG6GLU4U.js +1378 -0
  44. package/dist/chunk-SJCDV2ST.js +274 -0
  45. package/dist/chunk-SYE5XLF3.js +104 -0
  46. package/dist/chunk-T5VLYBZD.js +103 -0
  47. package/dist/chunk-TOQB7VWU.js +3238 -0
  48. package/dist/chunk-VFNMZ4ZQ.js +3228 -0
  49. package/dist/chunk-VVTGZNBT.js +1629 -0
  50. package/dist/chunk-W7Q4RFEV.js +104 -0
  51. package/dist/chunk-XTYYVRLO.js +3190 -0
  52. package/dist/chunk-Y6MDYVJD.js +3063 -0
  53. package/dist/cli/main.d.ts +1 -0
  54. package/dist/cli/main.js +5458 -0
  55. package/dist/index.d.ts +653 -0
  56. package/dist/index.js +79 -0
  57. package/dist/mcp/server.d.ts +1 -0
  58. package/dist/mcp/server.js +472 -0
  59. package/dist/schema-BAWSG7KY.js +22 -0
  60. package/dist/schema-E3QUPL26.js +20 -0
  61. package/dist/schema-EHL7WUT6.js +20 -0
  62. package/docs/019-USAGE.md +625 -0
  63. package/docs/020-current-implementation.md +364 -0
  64. package/docs/021-DOGFOODING-FINDINGS.md +175 -0
  65. package/docs/BACKLOG.md +80 -0
  66. package/docs/CONFIG.md +1123 -0
  67. package/docs/DESIGN.md +439 -0
  68. package/docs/ERRORS.md +383 -0
  69. package/docs/PROJECT.md +88 -0
  70. package/docs/ROADMAP.md +407 -0
  71. package/docs/summarization.md +320 -0
  72. package/docs/test-links.md +9 -0
  73. package/justfile +40 -0
  74. package/package.json +74 -9
  75. package/pnpm-workspace.yaml +5 -0
  76. package/research/INDEX.md +315 -0
  77. package/research/code-review/README.md +90 -0
  78. package/research/code-review/cli-error-handling-review.md +979 -0
  79. package/research/code-review/code-review-validation-report.md +464 -0
  80. package/research/code-review/main-ts-review.md +1128 -0
  81. package/research/config-analysis/01-current-implementation.md +470 -0
  82. package/research/config-analysis/02-strategy-recommendation.md +428 -0
  83. package/research/config-analysis/03-task-candidates.md +715 -0
  84. package/research/config-analysis/033-research-configuration-management.md +828 -0
  85. package/research/config-analysis/034-research-effect-cli-config.md +1504 -0
  86. package/research/config-analysis/04-consolidated-task-candidates.md +277 -0
  87. package/research/config-docs/SUMMARY.md +357 -0
  88. package/research/config-docs/TEST-RESULTS.md +776 -0
  89. package/research/config-docs/TODO.md +542 -0
  90. package/research/config-docs/analysis.md +744 -0
  91. package/research/config-docs/fix-validation.md +502 -0
  92. package/research/config-docs/help-audit.md +264 -0
  93. package/research/config-docs/help-system-analysis.md +890 -0
  94. package/research/dogfood/consolidated-tool-evaluation.md +373 -0
  95. package/research/dogfood/strategy-a/a-synthesis.md +184 -0
  96. package/research/dogfood/strategy-a/a1-docs.md +226 -0
  97. package/research/dogfood/strategy-a/a2-amorphic.md +156 -0
  98. package/research/dogfood/strategy-a/a3-llm.md +164 -0
  99. package/research/dogfood/strategy-b/b-synthesis.md +228 -0
  100. package/research/dogfood/strategy-b/b1-architecture.md +207 -0
  101. package/research/dogfood/strategy-b/b2-gaps.md +258 -0
  102. package/research/dogfood/strategy-b/b3-workflows.md +250 -0
  103. package/research/dogfood/strategy-c/c-synthesis.md +451 -0
  104. package/research/dogfood/strategy-c/c1-explorer.md +192 -0
  105. package/research/dogfood/strategy-c/c2-diver-memory.md +145 -0
  106. package/research/dogfood/strategy-c/c3-diver-control.md +148 -0
  107. package/research/dogfood/strategy-c/c4-diver-failure.md +151 -0
  108. package/research/dogfood/strategy-c/c5-diver-execution.md +221 -0
  109. package/research/dogfood/strategy-c/c6-diver-org.md +221 -0
  110. package/research/effect-cli-error-handling.md +845 -0
  111. package/research/effect-errors-as-values.md +943 -0
  112. package/research/errors-task-analysis/00-consolidated-tasks.md +207 -0
  113. package/research/errors-task-analysis/cli-commands-analysis.md +909 -0
  114. package/research/errors-task-analysis/embeddings-analysis.md +709 -0
  115. package/research/errors-task-analysis/index-search-analysis.md +812 -0
  116. package/research/frontmatter/COMMENTS-ARE-SKIPPED.md +149 -0
  117. package/research/frontmatter/LLM-CODE-NAVIGATION.md +276 -0
  118. package/research/issue-review.md +603 -0
  119. package/research/llm-summarization/agent-cli-tools-2026.md +1082 -0
  120. package/research/llm-summarization/alternative-providers-2026.md +1428 -0
  121. package/research/llm-summarization/anthropic-2026.md +367 -0
  122. package/research/llm-summarization/claude-cli-integration.md +1706 -0
  123. package/research/llm-summarization/cli-integration-patterns.md +3155 -0
  124. package/research/llm-summarization/openai-2026.md +473 -0
  125. package/research/llm-summarization/openai-compatible-providers-2026.md +1022 -0
  126. package/research/llm-summarization/opencode-cli-integration.md +1552 -0
  127. package/research/llm-summarization/prompt-engineering-2026.md +1426 -0
  128. package/research/llm-summarization/prototype-results.md +56 -0
  129. package/research/llm-summarization/provider-switching-patterns-2026.md +2153 -0
  130. package/research/llm-summarization/typescript-llm-libraries-2026.md +2436 -0
  131. package/research/mdcontext-error-analysis.md +521 -0
  132. package/research/mdcontext-pudding/00-EXECUTIVE-SUMMARY.md +282 -0
  133. package/research/mdcontext-pudding/01-index-embed.md +956 -0
  134. package/research/mdcontext-pudding/02-search-COMMANDS.md +142 -0
  135. package/research/mdcontext-pudding/02-search-SUMMARY.md +146 -0
  136. package/research/mdcontext-pudding/02-search.md +970 -0
  137. package/research/mdcontext-pudding/03-context.md +779 -0
  138. package/research/mdcontext-pudding/04-navigation-and-analytics.md +803 -0
  139. package/research/mdcontext-pudding/04-tree.md +704 -0
  140. package/research/mdcontext-pudding/05-config.md +1038 -0
  141. package/research/mdcontext-pudding/06-links-summary.txt +87 -0
  142. package/research/mdcontext-pudding/06-links.md +679 -0
  143. package/research/mdcontext-pudding/07-stats.md +693 -0
  144. package/research/mdcontext-pudding/BUG-FIX-PLAN.md +388 -0
  145. package/research/mdcontext-pudding/P0-BUG-VALIDATION.md +167 -0
  146. package/research/mdcontext-pudding/README.md +168 -0
  147. package/research/mdcontext-pudding/TESTING-SUMMARY.md +128 -0
  148. package/research/npm_publish/011-npm-workflow-research-agent2.md +792 -0
  149. package/research/npm_publish/012-npm-workflow-research-agent1.md +530 -0
  150. package/research/npm_publish/013-npm-workflow-research-agent3.md +722 -0
  151. package/research/npm_publish/014-npm-workflow-synthesis.md +556 -0
  152. package/research/npm_publish/031-npm-workflow-task-analysis.md +134 -0
  153. package/research/research-quality-review.md +834 -0
  154. package/research/semantic-search/002-research-embedding-models.md +490 -0
  155. package/research/semantic-search/003-research-rag-alternatives.md +523 -0
  156. package/research/semantic-search/004-research-vector-search.md +841 -0
  157. package/research/semantic-search/032-research-semantic-search.md +427 -0
  158. package/research/semantic-search/embedding-text-analysis.md +156 -0
  159. package/research/semantic-search/multi-word-failure-reproduction.md +171 -0
  160. package/research/semantic-search/query-processing-analysis.md +207 -0
  161. package/research/semantic-search/root-cause-and-solution.md +114 -0
  162. package/research/semantic-search/threshold-validation-report.md +69 -0
  163. package/research/semantic-search/vector-search-analysis.md +63 -0
  164. package/research/task-management-2026/00-synthesis-recommendations.md +295 -0
  165. package/research/task-management-2026/01-ai-workflow-tools.md +416 -0
  166. package/research/task-management-2026/02-agent-framework-patterns.md +476 -0
  167. package/research/task-management-2026/03-lightweight-file-based.md +567 -0
  168. package/research/task-management-2026/04-established-tools-ai-features.md +541 -0
  169. package/research/task-management-2026/linear/01-core-features-workflow.md +771 -0
  170. package/research/task-management-2026/linear/02-api-integrations.md +930 -0
  171. package/research/task-management-2026/linear/03-ai-features.md +368 -0
  172. package/research/task-management-2026/linear/04-pricing-setup.md +205 -0
  173. package/research/task-management-2026/linear/05-usage-patterns-best-practices.md +605 -0
  174. package/research/test-path-issues.md +276 -0
  175. package/review/ALP-76/1-error-type-design.md +962 -0
  176. package/review/ALP-76/2-error-handling-patterns.md +906 -0
  177. package/review/ALP-76/3-error-presentation.md +624 -0
  178. package/review/ALP-76/4-test-coverage.md +625 -0
  179. package/review/ALP-76/5-migration-completeness.md +440 -0
  180. package/review/ALP-76/6-effect-best-practices.md +755 -0
  181. package/scripts/apply-branch-protection.sh +47 -0
  182. package/scripts/branch-protection-templates.json +79 -0
  183. package/scripts/prototype-summarization.ts +346 -0
  184. package/scripts/rebuild-hnswlib.js +58 -0
  185. package/scripts/setup-branch-protection.sh +64 -0
  186. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/active-provider.json +7 -0
  187. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/bm25.json +541 -0
  188. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/bm25.meta.json +5 -0
  189. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/config.json +8 -0
  190. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.bin +0 -0
  191. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.meta.bin +0 -0
  192. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/documents.json +60 -0
  193. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/links.json +13 -0
  194. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/.mdcontext/indexes/sections.json +1197 -0
  195. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/configuration-management.md +99 -0
  196. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/distributed-systems.md +92 -0
  197. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/error-handling.md +78 -0
  198. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/failure-automation.md +55 -0
  199. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/job-context.md +69 -0
  200. package/src/__tests__/fixtures/semantic-search/multi-word-corpus/process-orchestration.md +99 -0
  201. package/src/cli/argv-preprocessor.test.ts +210 -0
  202. package/src/cli/argv-preprocessor.ts +202 -0
  203. package/src/cli/cli.test.ts +627 -0
  204. package/src/cli/commands/backlinks.ts +54 -0
  205. package/src/cli/commands/config-cmd.ts +642 -0
  206. package/src/cli/commands/context.ts +285 -0
  207. package/src/cli/commands/duplicates.ts +122 -0
  208. package/src/cli/commands/embeddings.ts +529 -0
  209. package/src/cli/commands/index-cmd.ts +480 -0
  210. package/src/cli/commands/index.ts +16 -0
  211. package/src/cli/commands/links.ts +52 -0
  212. package/src/cli/commands/search.ts +1281 -0
  213. package/src/cli/commands/stats.ts +149 -0
  214. package/src/cli/commands/tree.ts +128 -0
  215. package/src/cli/config-layer.ts +176 -0
  216. package/src/cli/error-handler.test.ts +235 -0
  217. package/src/cli/error-handler.ts +655 -0
  218. package/src/cli/flag-schemas.ts +341 -0
  219. package/src/cli/help.ts +588 -0
  220. package/src/cli/index.ts +9 -0
  221. package/src/cli/main.ts +435 -0
  222. package/src/cli/options.ts +41 -0
  223. package/src/cli/shared-error-handling.ts +199 -0
  224. package/src/cli/typo-suggester.test.ts +105 -0
  225. package/src/cli/typo-suggester.ts +130 -0
  226. package/src/cli/utils.ts +259 -0
  227. package/src/config/file-provider.test.ts +320 -0
  228. package/src/config/file-provider.ts +273 -0
  229. package/src/config/index.ts +72 -0
  230. package/src/config/integration.test.ts +667 -0
  231. package/src/config/precedence.test.ts +277 -0
  232. package/src/config/precedence.ts +451 -0
  233. package/src/config/schema.test.ts +414 -0
  234. package/src/config/schema.ts +603 -0
  235. package/src/config/service.test.ts +320 -0
  236. package/src/config/service.ts +243 -0
  237. package/src/config/testing.test.ts +264 -0
  238. package/src/config/testing.ts +110 -0
  239. package/src/core/index.ts +1 -0
  240. package/src/core/types.ts +113 -0
  241. package/src/duplicates/detector.test.ts +183 -0
  242. package/src/duplicates/detector.ts +414 -0
  243. package/src/duplicates/index.ts +18 -0
  244. package/src/embeddings/embedding-namespace.test.ts +300 -0
  245. package/src/embeddings/embedding-namespace.ts +947 -0
  246. package/src/embeddings/heading-boost.test.ts +222 -0
  247. package/src/embeddings/hnsw-build-options.test.ts +198 -0
  248. package/src/embeddings/hyde.test.ts +272 -0
  249. package/src/embeddings/hyde.ts +264 -0
  250. package/src/embeddings/index.ts +10 -0
  251. package/src/embeddings/openai-provider.ts +414 -0
  252. package/src/embeddings/pricing.json +22 -0
  253. package/src/embeddings/provider-constants.ts +204 -0
  254. package/src/embeddings/provider-errors.test.ts +967 -0
  255. package/src/embeddings/provider-errors.ts +565 -0
  256. package/src/embeddings/provider-factory.test.ts +240 -0
  257. package/src/embeddings/provider-factory.ts +225 -0
  258. package/src/embeddings/provider-integration.test.ts +788 -0
  259. package/src/embeddings/query-preprocessing.test.ts +187 -0
  260. package/src/embeddings/semantic-search-threshold.test.ts +508 -0
  261. package/src/embeddings/semantic-search.ts +1270 -0
  262. package/src/embeddings/types.ts +359 -0
  263. package/src/embeddings/vector-store.ts +708 -0
  264. package/src/embeddings/voyage-provider.ts +313 -0
  265. package/src/errors/errors.test.ts +845 -0
  266. package/src/errors/index.ts +533 -0
  267. package/src/index/ignore-patterns.test.ts +354 -0
  268. package/src/index/ignore-patterns.ts +305 -0
  269. package/src/index/index.ts +4 -0
  270. package/src/index/indexer.ts +684 -0
  271. package/src/index/storage.ts +260 -0
  272. package/src/index/types.ts +147 -0
  273. package/src/index/watcher.ts +189 -0
  274. package/src/index.ts +30 -0
  275. package/src/integration/search-keyword.test.ts +678 -0
  276. package/src/mcp/server.ts +612 -0
  277. package/src/parser/index.ts +1 -0
  278. package/src/parser/parser.test.ts +291 -0
  279. package/src/parser/parser.ts +394 -0
  280. package/src/parser/section-filter.test.ts +277 -0
  281. package/src/parser/section-filter.ts +392 -0
  282. package/src/search/__tests__/hybrid-search.test.ts +650 -0
  283. package/src/search/bm25-store.ts +366 -0
  284. package/src/search/cross-encoder.test.ts +253 -0
  285. package/src/search/cross-encoder.ts +406 -0
  286. package/src/search/fuzzy-search.test.ts +419 -0
  287. package/src/search/fuzzy-search.ts +273 -0
  288. package/src/search/hybrid-search.ts +448 -0
  289. package/src/search/path-matcher.test.ts +276 -0
  290. package/src/search/path-matcher.ts +33 -0
  291. package/src/search/query-parser.test.ts +260 -0
  292. package/src/search/query-parser.ts +319 -0
  293. package/src/search/searcher.test.ts +280 -0
  294. package/src/search/searcher.ts +724 -0
  295. package/src/search/wink-bm25.d.ts +30 -0
  296. package/src/summarization/cli-providers/claude.ts +202 -0
  297. package/src/summarization/cli-providers/detection.test.ts +273 -0
  298. package/src/summarization/cli-providers/detection.ts +118 -0
  299. package/src/summarization/cli-providers/index.ts +8 -0
  300. package/src/summarization/cost.test.ts +139 -0
  301. package/src/summarization/cost.ts +102 -0
  302. package/src/summarization/error-handler.test.ts +127 -0
  303. package/src/summarization/error-handler.ts +111 -0
  304. package/src/summarization/index.ts +102 -0
  305. package/src/summarization/pipeline.test.ts +498 -0
  306. package/src/summarization/pipeline.ts +231 -0
  307. package/src/summarization/prompts.test.ts +269 -0
  308. package/src/summarization/prompts.ts +133 -0
  309. package/src/summarization/provider-factory.test.ts +396 -0
  310. package/src/summarization/provider-factory.ts +178 -0
  311. package/src/summarization/types.ts +184 -0
  312. package/src/summarize/budget-bugs.test.ts +620 -0
  313. package/src/summarize/formatters.ts +419 -0
  314. package/src/summarize/index.ts +20 -0
  315. package/src/summarize/summarizer.test.ts +275 -0
  316. package/src/summarize/summarizer.ts +597 -0
  317. package/src/summarize/verify-bugs.test.ts +238 -0
  318. package/src/types/huggingface-transformers.d.ts +66 -0
  319. package/src/utils/index.ts +1 -0
  320. package/src/utils/tokens.test.ts +142 -0
  321. package/src/utils/tokens.ts +186 -0
  322. package/tests/fixtures/cli/.mdcontext/active-provider.json +7 -0
  323. package/tests/fixtures/cli/.mdcontext/config.json +8 -0
  324. package/tests/fixtures/cli/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.bin +0 -0
  325. package/tests/fixtures/cli/.mdcontext/embeddings/openai_text-embedding-3-small_512/vectors.meta.bin +0 -0
  326. package/tests/fixtures/cli/.mdcontext/indexes/documents.json +33 -0
  327. package/tests/fixtures/cli/.mdcontext/indexes/links.json +12 -0
  328. package/tests/fixtures/cli/.mdcontext/indexes/sections.json +247 -0
  329. package/tests/fixtures/cli/README.md +9 -0
  330. package/tests/fixtures/cli/api-reference.md +11 -0
  331. package/tests/fixtures/cli/getting-started.md +11 -0
  332. package/tests/integration/embed-index.test.ts +712 -0
  333. package/tests/integration/search-context.test.ts +469 -0
  334. package/tests/integration/search-semantic.test.ts +522 -0
  335. package/tsconfig.json +26 -0
  336. package/vitest.config.ts +16 -0
  337. package/vitest.setup.ts +12 -0
@@ -0,0 +1,221 @@
1
+ # Report: C5 - Diver: Execution Model
2
+
3
+ ## Mission
4
+
5
+ Deep-dive into: Execution Model (Jobs, Contexts, Workflows)
6
+
7
+ ## Command Log
8
+
9
+ | # | Command | Purpose | Result | Useful? |
10
+ | --- | --------------------------------------------------------------------------------------------- | ---------------------------------- | --------------------------------------- | ----------- |
11
+ | 1 | `mdcontext --help` | Understand available commands | Full command listing with examples | Yes |
12
+ | 2 | `mdcontext tree` | List all markdown files | 23 files found, identified key docs | Yes |
13
+ | 3 | `mdcontext tree docs/04-EXECUTION_MODEL.md` | Show document outline | 38 sections, 7418 tokens total | Very useful |
14
+ | 4 | `mdcontext context docs/04-EXECUTION_MODEL.md -t 4000` | Get overview of execution model | Truncated to 36%, got main sections | Useful |
15
+ | 5 | `mdcontext search "job" --json` | Find job-related content | 10 results across multiple files | Useful |
16
+ | 6 | `mdcontext search "execution context"` | Find execution context content | 10 results with context lines | Useful |
17
+ | 7 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "2. Jobs"` | Deep dive on Jobs | Full Jobs section extracted | Very useful |
18
+ | 8 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "3. Execution Contexts"` | Deep dive on Contexts | Full Execution Contexts section | Very useful |
19
+ | 9 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "4. Workflows in Execution"` | Workflows in execution | Full workflows section | Very useful |
20
+ | 10 | `mdcontext tree docs/06-WORKFLOWS.md` | Outline of dedicated Workflows doc | 37 sections, 8541 tokens | Useful |
21
+ | 11 | `mdcontext context docs/06-WORKFLOWS.md --section "1. Workflow Philosophy"` | Workflow philosophy | Core principles extracted | Very useful |
22
+ | 12 | `mdcontext context docs/06-WORKFLOWS.md --section "2. What Problem Workflows Solve"` | Problem statement | Clear value proposition | Useful |
23
+ | 13 | `mdcontext search "parallel execution"` | Find parallel patterns | 10 results, multiple examples | Useful |
24
+ | 14 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "5. Execution Coordination Patterns"` | Coordination patterns | Pipeline, Fan-out, Background patterns | Very useful |
25
+ | 15 | `mdcontext search "context resumption"` | Find resumption info | 6 results across docs | Useful |
26
+ | 16 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "6. Context Creation and Resumption"` | Resumption mechanics | Critical resumption model explained | Very useful |
27
+ | 17 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "7. Scope and Mutual Exclusion"` | Concurrency rules | Hard invariant explained | Very useful |
28
+ | 18 | `mdcontext search "scope"` | Find scope usage | 10 results showing scope patterns | Useful |
29
+ | 19 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "16. Guarantees"` | System guarantees | 7 key guarantees listed | Very useful |
30
+ | 20 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "18. Summary"` | Executive summary | Clean separation of concerns | Very useful |
31
+ | 21 | `mdcontext tree docs/07-EXAMPLE_WORKFLOWS.md` | Example workflows outline | 5 detailed examples, 14423 tokens | Useful |
32
+ | 22 | `mdcontext context docs/07-EXAMPLE_WORKFLOWS.md --section "Summary Across All Examples"` | Examples summary | Common patterns across use cases | Very useful |
33
+ | 23 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "8. Steps and Agents"` | Steps and Agents | Atomic execution units | Very useful |
34
+ | 24 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "17. Why This Model Scales"` | Scalability | Scale dimensions explained | Very useful |
35
+ | 25 | `mdcontext search "disposable"` | Find disposable concept | 10 results showing ephemeral nature | Useful |
36
+ | 26 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "10. External Workflow Integration"` | External framework integration | BMAD, RD-Agent integration pattern | Very useful |
37
+ | 27 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "11. Key Execution Patterns"` | Execution patterns | Ad-hoc, guided, background, parallel | Very useful |
38
+ | 28 | `mdcontext context docs/04-EXECUTION_MODEL.md --section "12. Control Plane Integration"` | Control plane | Intervention capabilities | Very useful |
39
+ | 29 | `mdcontext search "checkpoint"` | Find checkpoint content | 10 results showing checkpoint usage | Useful |
40
+ | 30 | `mdcontext context docs/06-WORKFLOWS.md --section "12. Checkpoints in Depth"` | Checkpoint mechanics | 6 checkpoint types, enforcement rules | Very useful |
41
+ | 31 | `mdcontext search "immutable"` | Find immutability patterns | 10 results confirming append-only model | Useful |
42
+ | 32 | `mdcontext stats` | Index statistics | 23 docs, 924 sections, no embeddings | Useful |
43
+
44
+ ## Findings
45
+
46
+ ### Key Discoveries
47
+
48
+ - **Execution is scoped, disposable attempts guided by durable intent** - This is the philosophical core
49
+ - **Jobs coordinate, Contexts execute, Workflows guide** - Clean separation of concerns
50
+ - **Immutability transforms conflicts into choices** - No race conditions, no merge logic
51
+ - **Resumption creates new contexts** - No hidden state, perfect auditability
52
+ - **External frameworks (BMAD, RD-Agent) execute WITHIN the model** - Not above it
53
+
54
+ ### Model Components
55
+
56
+ #### Jobs: Human-Meaningful Coordination Envelopes
57
+
58
+ > "A Job is a human-meaningful coordination envelope that groups one or more Execution Contexts to achieve an objective."
59
+ > Source: docs/04-EXECUTION_MODEL.md, Section 2
60
+
61
+ Jobs provide:
62
+
63
+ - **Continuity**: Survive execution attempts
64
+ - **Grouping**: Relate multiple execution contexts
65
+ - **Navigation**: Stable handle for UI/API
66
+ - **Signals**: Aggregate status and attention needs
67
+ - **Artifact reference**: Point to key outputs
68
+
69
+ Jobs have NO stored state - status is derived from signals. They can coordinate serial, parallel, or mixed execution patterns.
70
+
71
+ #### Execution Contexts: Disposable Actors
72
+
73
+ > "An Execution Context is a temporary, scoped binding that performs one unit of concrete work."
74
+ > Source: docs/04-EXECUTION_MODEL.md, Section 3
75
+
76
+ Key duality:
77
+
78
+ - **Contexts are disposable**: May be deleted anytime, not resumed
79
+ - **But emit permanent records**: Events logged immutably, artifacts preserved, provenance captured
80
+
81
+ **The Hard Concurrency Rule**:
82
+
83
+ > "No two Execution Contexts may concurrently mutate the same scope of work."
84
+ > Source: docs/04-EXECUTION_MODEL.md, Section 3
85
+
86
+ Because the system is fully immutable:
87
+
88
+ - Contexts do not mutate - they produce new artifacts
89
+ - "Conflict" is just parallel alternatives
90
+ - Resolution is a separate, explicit act
91
+
92
+ #### Workflows: Guidance Not Execution
93
+
94
+ > "Reusable coordination patterns that shape how work unfolds, without prescribing execution logic."
95
+ > Source: docs/06-WORKFLOWS.md, Section 1
96
+
97
+ Workflows consist of:
98
+
99
+ - **Entry Signals**: When relevant
100
+ - **Roles**: Which perspectives needed
101
+ - **Phases**: Broad stages of work
102
+ - **Activities**: What kind of work happens
103
+ - **Checkpoints**: Deliberate pauses for human re-engagement
104
+
105
+ **Critical Rule**: An Execution Context may reference AT MOST ONE workflow.
106
+
107
+ ### Relevant Quotes/Sections Found
108
+
109
+ > "HumanWork treats execution as a series of scoped, disposable attempts guided by durable intent."
110
+ > Source: docs/04-EXECUTION_MODEL.md, Section 1
111
+
112
+ > "Execution Contexts do not resume. Instead: A new Execution Context is created. It reads Workspace Memory to understand prior work."
113
+ > Source: docs/04-EXECUTION_MODEL.md, Section 6
114
+
115
+ > "This transforms conflicts from correctness problems into choice problems."
116
+ > Source: docs/04-EXECUTION_MODEL.md, Section 3
117
+
118
+ > "Workflows do not execute. They provide coordination patterns."
119
+ > Source: docs/04-EXECUTION_MODEL.md, Section 4
120
+
121
+ ### Execution Coordination Patterns
122
+
123
+ **Pattern A: Serial Execution (Pipeline)**
124
+
125
+ - Context 1: Design -> spec
126
+ - Context 2: Implement -> code
127
+ - Context 3: Review -> approval
128
+ - Job survives and maintains continuity
129
+
130
+ **Pattern B: Parallel Execution (Fan-Out/Fan-In)**
131
+
132
+ - Context A, B, C run concurrently on distinct scopes
133
+ - Context D compares and merges
134
+ - Resolution is explicit, not automatic
135
+
136
+ **Pattern C: Background + Foreground**
137
+
138
+ - Long-running analysis + interactive brainstorming
139
+ - Both execute because scopes are distinct
140
+
141
+ ### Steps and Agents
142
+
143
+ - **Steps**: Atomic units within Execution Context, owned by role, emit progress
144
+ - **Agents**: Stateless workers, receive assembled context, must report status before token exhaustion
145
+
146
+ **Agent Replaceability**: Work continues seamlessly if agent crashes/exhausts tokens because context is external.
147
+
148
+ ### System Guarantees
149
+
150
+ 1. Single-scope coherence: no concurrent mutation of same scope
151
+ 2. Human control: execution always interruptible
152
+ 3. Deterministic replay: all execution reproducible from records
153
+ 4. Cost attribution: every execution traceable
154
+ 5. No hidden state: all context external and inspectable
155
+ 6. Agent replaceability: work continues regardless of agent instance
156
+ 7. Workflow interoperability: external systems integrate cleanly
157
+
158
+ ### Summary of Theme
159
+
160
+ The HumanWork execution model separates:
161
+
162
+ - **Human intent** (Jobs)
163
+ - **Work attempts** (Execution Contexts)
164
+ - **Guidance patterns** (Workflows)
165
+ - **Concrete execution** (Steps/Agents)
166
+
167
+ This enables:
168
+
169
+ - Parallel exploration without conflicts
170
+ - Long-running work without loss of control
171
+ - Framework integration without lock-in
172
+ - Enterprise safety without bureaucracy
173
+ - Scale without brittleness
174
+
175
+ The model scales from $3 individual explorations to $3000 enterprise compliance reviews without changing architecture.
176
+
177
+ ## Proposed Spec Changes
178
+
179
+ - [ ] Add glossary entry clarifying "scope" types (explicit, implicit, tag-based, artifact-based)
180
+ - [ ] Create diagram showing Job -> Context -> Steps -> Agents hierarchy
181
+ - [ ] Document checkpoint timeout escalation paths in more detail
182
+ - [ ] Add explicit guidance on when to use parallel vs serial execution patterns
183
+ - [ ] Clarify what "Semantic Memory" contributes to context resumption (mentioned but not detailed)
184
+ - [ ] Add example of scope conflict resolution workflow
185
+
186
+ ## Tool Evaluation
187
+
188
+ ### What Worked Well
189
+
190
+ - **`--section` flag is excellent**: Precise extraction of specific sections without reading full documents
191
+ - **`tree` on individual files**: Instant document outline with token counts per section - perfect for planning
192
+ - **Search with context lines**: Default context before/after matches aids understanding
193
+ - **Section numbering**: Consistent 1.2, 1.3 scheme makes navigation predictable
194
+ - **Token budgeting**: `-t 4000` respects limits while showing included/excluded sections
195
+ - **Stats command**: Quick index health check
196
+
197
+ ### What Was Frustrating
198
+
199
+ - **Initial `--section` syntax error**: Passing multiple `--section` flags tried to read flag as filename (had to call once per section)
200
+ - **No embeddings**: Semantic search would have helped find conceptual relationships
201
+ - **Search results capped at 10**: Sometimes wanted to see more matches
202
+ - **Context command truncation**: 36% of 7418 tokens shown with default budget; would prefer explicit "this section won't fit" warning
203
+
204
+ ### Confidence Level
205
+
206
+ [X] High - The execution model is thoroughly documented with clear definitions, examples, and guarantees. The section-based extraction worked extremely well for deep-diving into complex technical documentation.
207
+
208
+ ### Would Use Again? (1-5)
209
+
210
+ **5** - The `--section` flag is a game-changer for deep dives. Being able to see the full document outline with token counts, then surgically extract specific sections, made this investigation highly efficient. The search found relevant content across files quickly. This is exactly how technical documentation exploration should work.
211
+
212
+ **Key workflow discovered**:
213
+
214
+ 1. `tree <file>` - see structure and token counts
215
+ 2. `context <file> --section "X"` - extract needed sections
216
+ 3. `search "term"` - find cross-references
217
+ 4. Repeat as needed
218
+
219
+ Total commands: 32
220
+ Useful commands: 32 (100%)
221
+ Highly useful commands: ~20 (63%)
@@ -0,0 +1,221 @@
1
+ # Report: C6 - Diver: Org-Workspace Model
2
+
3
+ ## Mission
4
+
5
+ Deep-dive into: Org-Workspace-Cost Model (Theme #5 from C1 Explorer)
6
+
7
+ ## Command Log
8
+
9
+ | # | Command | Purpose | Result | Useful? |
10
+ | --- | ------------------------------------------------------------------ | ------------------------------- | --------------------------------------- | ------- |
11
+ | 1 | `mdcontext search "workspace"` | Find workspace content | 10 results spanning 4 docs | Yes |
12
+ | 2 | `mdcontext search "org"` | Find org content | 10 results, good coverage | Yes |
13
+ | 3 | `mdcontext search "cost"` | Find cost-related content | 10 results, found key docs | Yes |
14
+ | 4 | `mdcontext context docs/03-ORG_WORKSPACE_MODEL.md` | Get main doc overview | Truncated to 24%, but overview helpful | Partial |
15
+ | 5 | `mdcontext context --section "5. Authority Model"` | Get authority details | Complete section retrieved | Yes |
16
+ | 6 | `mdcontext context --sections` | List all sections | Full section index shown | Yes |
17
+ | 7 | `mdcontext context --section "6. Cost and Resource Model"` | Get cost model details | Complete section with all subsections | Yes |
18
+ | 8 | `mdcontext context --section "9. Org-Workspace Information Flow"` | Cross-workspace learning | Found key principle on authority flow | Yes |
19
+ | 9 | `mdcontext search "promotion"` | Find artifact promotion content | 10 results, good workflow examples | Yes |
20
+ | 10 | `mdcontext context --section "Phase 11: Promotion to Org Level"` | Example workflow | Concrete promotion example | Yes |
21
+ | 11 | `mdcontext search "governance"` | Find governance content | 10 results including enterprise docs | Yes |
22
+ | 12 | `mdcontext context --section "12. Why This Model Works"` | Model rationale | Scaling from individuals to enterprises | Yes |
23
+ | 13 | `mdcontext search "job"` | Find job layer content | 10 results, found architecture section | Yes |
24
+ | 14 | `mdcontext context --section "6. Job Layer"` | Get job definition | Complete job layer explanation | Yes |
25
+ | 15 | `mdcontext search "execution context"` | Find context layer content | 10 results | Yes |
26
+ | 16 | `mdcontext context --section "7. Execution Context Layer"` | Get context definition | Full lifecycle and semantics | Yes |
27
+ | 17 | `mdcontext context --section "2. High-Level Stack"` | Get hierarchy diagram | ASCII stack visualization | Yes |
28
+ | 18 | `mdcontext context --section "15. Cost and Resource Model"` (arch) | Architecture cost summary | Concise cost flow explanation | Yes |
29
+ | 19 | `mdcontext search "enterprise"` | Find enterprise examples | Example 5 compliance review | Yes |
30
+ | 20 | `mdcontext context --section "Example 5: Enterprise"` | Get enterprise workflow | Detailed compliance review walkthrough | Yes |
31
+ | 21 | `mdcontext search "knowledge graph"` | Find org knowledge graph | Found definitions and usage | Yes |
32
+ | 22 | `mdcontext context --section "Org Knowledge Graph"` | Get knowledge graph details | Derived graph properties | Yes |
33
+ | 23 | `mdcontext context --section "13. Summary"` | Get model summary | Core principles list | Yes |
34
+ | 24 | `mdcontext search "policy"` | Find policy overlay content | 10 results on optional controls | Yes |
35
+ | 25 | `mdcontext context --section "Cost Attribution"` (exec) | Get cost attribution levels | Three-level cost hierarchy | Yes |
36
+ | 26 | `mdcontext search "authority"` | Find authority invariants | Key authority principles | Yes |
37
+ | 27 | `mdcontext search "boundary"` | Find containment boundaries | Workspace isolation semantics | Yes |
38
+ | 28 | `mdcontext context --section "Workspace Boundaries"` | Get boundary details | Strict isolation guarantees | Yes |
39
+ | 29 | `mdcontext context --section "17. Org Knowledge Graph"` (prim) | Formal knowledge graph def | Guarantees and properties | Yes |
40
+
41
+ ## Findings
42
+
43
+ ### Key Discoveries
44
+
45
+ 1. **Two-Tier Model is Intentional**: The Org/Workspace split enables "shared learning without central control, reuse without coupling, governance without bureaucracy, cost visibility without micromanagement"
46
+
47
+ 2. **Authority Never Flows Downward**: Critical invariant - Org-level artifacts can be suggested/referenced but never auto-attach, auto-execute, or auto-override Workspace decisions
48
+
49
+ 3. **Agents Explicitly Excluded from Org-Level Authority**: Agents cannot create Workspaces, promote artifacts, or invite users - "keeps humans firmly in control"
50
+
51
+ 4. **Governance is an Overlay, Not Foundation**: Default is permissive (trust-by-default), enterprise controls are optional policy additions
52
+
53
+ 5. **Cost Visibility Over Control**: Philosophy emphasizes transparency and self-regulation over enforcement
54
+
55
+ ### Model Hierarchy
56
+
57
+ ```
58
+ Human(s)
59
+ |
60
+ Control Plane (ALWAYS LISTENING, PREEMPTIVE)
61
+ |
62
+ Org (identity, ownership, learning)
63
+ |
64
+ Workspace (shared reality, work boundary)
65
+ |
66
+ Jobs (intent over time, coordination)
67
+ |
68
+ Execution Contexts (disposable actors, scoped attempts)
69
+ |
70
+ Workflows/Steps/Agents/Tools
71
+ |
72
+ Artifacts/Records (immutable facts)
73
+ ```
74
+
75
+ - **Org**: Top-level identity and ownership boundary. Owns Workspaces, participants, Org-level Artifacts, Knowledge Graph, policies, and cost allocation. Represents an individual, family, team, company, or any collective.
76
+
77
+ - **Workspace**: The ONLY place where work occurs. Provides strict isolation - execution state, artifacts, history, and cost all exist within a Workspace. Can reference other Workspaces but never implicitly share state.
78
+
79
+ - **Job**: Human-meaningful coordination envelope that groups Execution Contexts. Provides continuity across execution attempts, UI handles, signal aggregation. Does NOT execute or store state - survives deletion of its contexts.
80
+
81
+ - **Context (Execution Context)**: The unit of actual work. Ephemeral, scoped, disposable. Binds a scope of work, roles, and optionally a workflow. Creates permanent records (events) but is itself temporary.
82
+
83
+ ### Cost Model
84
+
85
+ **Three-Level Attribution:**
86
+
87
+ 1. **Execution Context Level (Most Granular)**
88
+ - Token consumption
89
+ - Tool invocations
90
+ - Compute time
91
+ - Storage of context artifacts
92
+
93
+ 2. **Job Level (Aggregated)**
94
+ - Sum of all associated Execution Contexts
95
+ - Visible to humans
96
+ - Used for budget decisions
97
+
98
+ 3. **Workspace Level (Boundary)**
99
+ - Sum of all Jobs
100
+ - Org-level reporting
101
+ - Policy enforcement point
102
+
103
+ **Key Principles:**
104
+
105
+ - Cost is owned at Org level, attributed at Workspace level, accrued at Execution Context level
106
+ - Dormant Workspaces incur minimal cost
107
+ - Navigation and discovery are low-cost by design
108
+ - Default Workspace is intentionally lightweight (zero-friction onboarding)
109
+
110
+ **Future Controls (Optional Overlays):**
111
+
112
+ - Soft budgets per Workspace
113
+ - Org-level usage alerts
114
+ - Creation limits
115
+ - Execution throttles
116
+ - Approval workflows
117
+
118
+ ### Cross-Workspace Learning (Promotion)
119
+
120
+ **Upward Flow (Workspace to Org):**
121
+
122
+ - Artifacts promoted via explicit human or policy action
123
+ - Patterns extracted for Org Knowledge Graph
124
+ - Learning aggregated
125
+ - Flow is one-way, lossy, asynchronous, revocable
126
+
127
+ **Downward Flow (Org to Workspace):**
128
+
129
+ - Org artifacts can be suggested, referenced, or explicitly imported
130
+ - May NEVER auto-attach, auto-execute, or auto-override
131
+
132
+ > **"Truth is local. Meaning is global. Authority never flows downward."**
133
+
134
+ ### Relevant Quotes/Sections Found
135
+
136
+ > "This document defines the identity, containment, cost, and authority model for HumanWork."
137
+ > Source: docs/03-ORG_WORKSPACE_MODEL.md, intro
138
+
139
+ > "Workspace boundaries are strict and enforced... Workspaces may reference one another, but they never implicitly share state."
140
+ > Source: docs/03-ORG_WORKSPACE_MODEL.md, Workspace Boundaries
141
+
142
+ > "Cost is: owned at the Org level, attributed at the Workspace level, accrued at the Execution Context level, visible in real-time"
143
+ > Source: docs/01-ARCHITECTURE.md, Section 15
144
+
145
+ > "No authority flows from Org to Workspace automatically"
146
+ > Source: docs/02-PRIMITIVES.md, Section 19 Invariants
147
+
148
+ > "Agents: Never have Org-level roles, Only operate within Workspaces, Inherit authority from Workspace roles, Cannot create Workspaces, Cannot promote artifacts, Cannot invite users"
149
+ > Source: docs/03-ORG_WORKSPACE_MODEL.md, Agents Never Have Org-Level Authority
150
+
151
+ ### Enterprise Governance Example
152
+
153
+ The compliance review example (Example 5) demonstrates:
154
+
155
+ - 10 participants across 5 functional areas
156
+ - Heavy checkpoint enforcement
157
+ - Parallel review streams (security, legal, technical)
158
+ - Remediation loops with clear ownership
159
+ - Executive approval flow with dual sign-off
160
+ - Automatic audit trail generation
161
+ - Org-level promotion of compliance artifacts
162
+ - Cost: $3,240 tracked and attributed
163
+ - Time: 23 days with full visibility
164
+
165
+ ### Summary of Theme
166
+
167
+ The Org-Workspace model enables governance through:
168
+
169
+ 1. **Clear Containment**: Two-tier hierarchy separates identity/ownership (Org) from execution/work (Workspace)
170
+
171
+ 2. **Cost Attribution by Design**: Every cost element flows up from Context to Job to Workspace to Org, making budget decisions transparent
172
+
173
+ 3. **Promotion Mechanism**: Cross-workspace learning happens through explicit artifact promotion, preserving autonomy while enabling reuse
174
+
175
+ 4. **Authority Boundaries**: Agents operate only within Workspaces; humans control cross-workspace flows
176
+
177
+ 5. **Overlay Architecture**: Governance is additive - enterprises add policy controls, individuals get trust-by-default
178
+
179
+ 6. **Audit Trail**: Immutable events enable regulatory-grade compliance without bureaucratic overhead
180
+
181
+ ## Proposed Spec Changes
182
+
183
+ - [ ] Add explicit cost budget alerts/limits API to the Cost Model section
184
+ - [ ] Define formal promotion workflow stages (propose, review, approve, publish)
185
+ - [ ] Clarify how Org Knowledge Graph recommendations surface in Workspace UX
186
+ - [ ] Add section on Workspace archival policies for cost management
187
+ - [ ] Define multi-Org scenarios (user belonging to multiple Orgs) and cross-Org patterns
188
+ - [ ] Add monitoring/dashboard primitives for cost visibility
189
+
190
+ ## Tool Evaluation
191
+
192
+ ### What Worked Well
193
+
194
+ - **Search was fast and relevant**: Every search returned useful results with context
195
+ - **Section targeting**: `--section` flag allowed precise extraction of specific topics
196
+ - **Hierarchical navigation**: `--sections` gave clear document structure for navigation
197
+ - **Line-level context**: Search showed surrounding lines which helped understand context
198
+ - **Token efficiency**: Got focused content without loading entire documents
199
+
200
+ ### What Was Frustrating
201
+
202
+ - **Initial context truncation**: Default context command only showed 24% of large document
203
+ - **Two-word search failure**: `mdcontext search "job context"` returned 0 results (had to search separately)
204
+ - **No semantic search**: Tip kept reminding to run `--embed` but this was out of scope
205
+ - **Section name matching**: Had to get exact section names (e.g., "6" didn't work, needed "6. Cost and Resource Model")
206
+
207
+ ### Confidence Level
208
+
209
+ [X] High / Medium / Low
210
+
211
+ The Org-Workspace-Cost Model is well-documented with:
212
+
213
+ - Dedicated document (03-ORG_WORKSPACE_MODEL.md)
214
+ - Architecture section coverage
215
+ - Primitives definitions
216
+ - Detailed enterprise example workflow
217
+ - Clear invariants and guarantees
218
+
219
+ ### Would Use Again? (1-5)
220
+
221
+ **4** - The tool effectively supported deep-dive research. Section targeting was invaluable for large documents. The combination of search (for discovery) and context (for retrieval) worked well. Lost one point for multi-word search limitations and initial truncation confusion.