research-md 0.2.0__tar.gz

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 (119) hide show
  1. research_md-0.2.0/.forge/manifest.yaml +51 -0
  2. research_md-0.2.0/.github/workflows/ci.yml +62 -0
  3. research_md-0.2.0/.github/workflows/publish.yml +29 -0
  4. research_md-0.2.0/.gitignore +37 -0
  5. research_md-0.2.0/.pre-commit-config.yaml +25 -0
  6. research_md-0.2.0/CHANGELOG.md +13 -0
  7. research_md-0.2.0/CONTRIBUTING.md +50 -0
  8. research_md-0.2.0/DESIGN.md +152 -0
  9. research_md-0.2.0/LICENSE +21 -0
  10. research_md-0.2.0/PKG-INFO +204 -0
  11. research_md-0.2.0/README.md +181 -0
  12. research_md-0.2.0/SECURITY.md +24 -0
  13. research_md-0.2.0/bin/research-md.js +82 -0
  14. research_md-0.2.0/package-lock.json +2717 -0
  15. research_md-0.2.0/package.json +38 -0
  16. research_md-0.2.0/pyproject.toml +48 -0
  17. research_md-0.2.0/refactor/capture-edge-cases.mjs +299 -0
  18. research_md-0.2.0/refactor/capture-fixtures.mjs +299 -0
  19. research_md-0.2.0/refactor/fixtures/candidate_add_claim/001-add-claim.json +20 -0
  20. research_md-0.2.0/refactor/fixtures/candidate_add_claim/002-second-claim.json +19 -0
  21. research_md-0.2.0/refactor/fixtures/candidate_add_claim/003-third-claim.json +19 -0
  22. research_md-0.2.0/refactor/fixtures/candidate_create/001-with-description.json +20 -0
  23. research_md-0.2.0/refactor/fixtures/candidate_create/002-with-slug.json +20 -0
  24. research_md-0.2.0/refactor/fixtures/candidate_create/003-duplicate-error.json +21 -0
  25. research_md-0.2.0/refactor/fixtures/candidate_create/004-custom-slug.json +19 -0
  26. research_md-0.2.0/refactor/fixtures/candidate_create/005-with-description.json +19 -0
  27. research_md-0.2.0/refactor/fixtures/candidate_create/006-minimal.json +18 -0
  28. research_md-0.2.0/refactor/fixtures/candidate_list/001-with-candidates.json +18 -0
  29. research_md-0.2.0/refactor/fixtures/candidate_list/002-after-changes.json +17 -0
  30. research_md-0.2.0/refactor/fixtures/candidate_list/003-bad-guid.json +18 -0
  31. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/001-resolve-yes.json +21 -0
  32. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/002-resolve-no.json +21 -0
  33. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/003-resolve-first.json +20 -0
  34. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/004-resolve-second.json +20 -0
  35. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/005-resolve-third.json +20 -0
  36. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/006-not-found.json +21 -0
  37. research_md-0.2.0/refactor/fixtures/candidate_resolve_claim/007-bad-index.json +21 -0
  38. research_md-0.2.0/refactor/fixtures/candidate_score/001-score-postgres.json +25 -0
  39. research_md-0.2.0/refactor/fixtures/candidate_score/002-score-sqlite.json +25 -0
  40. research_md-0.2.0/refactor/fixtures/candidate_score/003-before-criteria.json +22 -0
  41. research_md-0.2.0/refactor/fixtures/candidate_score/004-before-review.json +22 -0
  42. research_md-0.2.0/refactor/fixtures/candidate_score/005-with-tbd.json +22 -0
  43. research_md-0.2.0/refactor/fixtures/candidate_score/006-with-notes.json +23 -0
  44. research_md-0.2.0/refactor/fixtures/candidate_score/007-cockroachdb.json +22 -0
  45. research_md-0.2.0/refactor/fixtures/candidate_score/008-tidb.json +22 -0
  46. research_md-0.2.0/refactor/fixtures/candidate_update/001-update-verdict.json +20 -0
  47. research_md-0.2.0/refactor/fixtures/candidate_update/002-not-found.json +20 -0
  48. research_md-0.2.0/refactor/fixtures/candidate_update/003-eliminate.json +19 -0
  49. research_md-0.2.0/refactor/fixtures/candidate_update/004-update-description.json +19 -0
  50. research_md-0.2.0/refactor/fixtures/criteria_lock/001-lock.json +18 -0
  51. research_md-0.2.0/refactor/fixtures/criteria_lock/002-already-locked.json +18 -0
  52. research_md-0.2.0/refactor/fixtures/criteria_lock/003-no-file.json +18 -0
  53. research_md-0.2.0/refactor/fixtures/finding_create/001-low-evidence.json +22 -0
  54. research_md-0.2.0/refactor/fixtures/finding_create/002-unverified.json +21 -0
  55. research_md-0.2.0/refactor/fixtures/finding_create/003-high-with-hash.json +22 -0
  56. research_md-0.2.0/refactor/fixtures/finding_create/004-high-no-hash-error.json +23 -0
  57. research_md-0.2.0/refactor/fixtures/finding_create/005-bad-research-id.json +21 -0
  58. research_md-0.2.0/refactor/fixtures/finding_create/006-empty-title.json +19 -0
  59. research_md-0.2.0/refactor/fixtures/finding_create/007-long-title.json +20 -0
  60. research_md-0.2.0/refactor/fixtures/finding_create/008-unicode.json +19 -0
  61. research_md-0.2.0/refactor/fixtures/finding_create/009-moderate-no-hash.json +22 -0
  62. research_md-0.2.0/refactor/fixtures/finding_create/010-moderate-with-hash.json +21 -0
  63. research_md-0.2.0/refactor/fixtures/finding_list/001-with-findings.json +18 -0
  64. research_md-0.2.0/refactor/fixtures/finding_list/002-after-updates.json +17 -0
  65. research_md-0.2.0/refactor/fixtures/finding_update/001-update-status.json +21 -0
  66. research_md-0.2.0/refactor/fixtures/finding_update/002-not-found.json +20 -0
  67. research_md-0.2.0/refactor/fixtures/finding_update/003-update-claim.json +19 -0
  68. research_md-0.2.0/refactor/fixtures/finding_update/004-update-evidence.json +19 -0
  69. research_md-0.2.0/refactor/fixtures/peer_review_log/001-with-attestations.json +27 -0
  70. research_md-0.2.0/refactor/fixtures/peer_review_log/002-minimal.json +23 -0
  71. research_md-0.2.0/refactor/fixtures/project_decide/001-decide.json +21 -0
  72. research_md-0.2.0/refactor/fixtures/project_decide/002-with-adr.json +20 -0
  73. research_md-0.2.0/refactor/fixtures/project_get/001-with-projects.json +16 -0
  74. research_md-0.2.0/refactor/fixtures/project_get/002-empty-session.json +15 -0
  75. research_md-0.2.0/refactor/fixtures/project_init/001-with-question.json +21 -0
  76. research_md-0.2.0/refactor/fixtures/project_init/002-no-question.json +18 -0
  77. research_md-0.2.0/refactor/fixtures/project_init/003-no-context-warnings.json +18 -0
  78. research_md-0.2.0/refactor/fixtures/project_set/001-happy-path.json +18 -0
  79. research_md-0.2.0/refactor/fixtures/project_set/002-not-found.json +19 -0
  80. research_md-0.2.0/refactor/fixtures/project_supersede/001-supersede.json +19 -0
  81. research_md-0.2.0/refactor/fixtures/project_supersede/002-supersede.json +18 -0
  82. research_md-0.2.0/refactor/fixtures/project_supersede/003-already-superseded.json +18 -0
  83. research_md-0.2.0/refactor/fixtures/research_brief/001-generate.json +19 -0
  84. research_md-0.2.0/refactor/fixtures/research_report/001-generate.json +18 -0
  85. research_md-0.2.0/refactor/fixtures/scoring_matrix_generate/001-generate.json +18 -0
  86. research_md-0.2.0/refactor/fixtures/scoring_matrix_generate/002-with-scores.json +17 -0
  87. research_md-0.2.0/refactor/fixtures/status/001-mid-project.json +18 -0
  88. research_md-0.2.0/refactor/fixtures/status/002-decided.json +17 -0
  89. research_md-0.2.0/refactor/fixtures/status/003-superseded.json +17 -0
  90. research_md-0.2.0/refactor/fixtures/status/004-bad-guid.json +18 -0
  91. research_md-0.2.0/refactor/verify-fixtures.py +350 -0
  92. research_md-0.2.0/research_md/__init__.py +3 -0
  93. research_md-0.2.0/research_md/config.py +216 -0
  94. research_md-0.2.0/research_md/errors.py +39 -0
  95. research_md-0.2.0/research_md/files.py +193 -0
  96. research_md-0.2.0/research_md/gates.py +40 -0
  97. research_md-0.2.0/research_md/integrity.py +103 -0
  98. research_md-0.2.0/research_md/security.py +23 -0
  99. research_md-0.2.0/research_md/server.py +790 -0
  100. research_md-0.2.0/src/config.ts +308 -0
  101. research_md-0.2.0/src/errors.ts +60 -0
  102. research_md-0.2.0/src/files.ts +170 -0
  103. research_md-0.2.0/src/gates.ts +92 -0
  104. research_md-0.2.0/src/index.ts +11 -0
  105. research_md-0.2.0/src/integrity.ts +159 -0
  106. research_md-0.2.0/src/pdf_brand.py +357 -0
  107. research_md-0.2.0/src/render-brief.py +434 -0
  108. research_md-0.2.0/src/resources.ts +130 -0
  109. research_md-0.2.0/src/security.ts +32 -0
  110. research_md-0.2.0/src/server.ts +1435 -0
  111. research_md-0.2.0/templates/adr.md +30 -0
  112. research_md-0.2.0/templates/candidate.md +16 -0
  113. research_md-0.2.0/templates/decision-criteria.md +12 -0
  114. research_md-0.2.0/templates/finding.md +20 -0
  115. research_md-0.2.0/test/config.test.ts +157 -0
  116. research_md-0.2.0/test/gates.test.ts +143 -0
  117. research_md-0.2.0/test/security.test.ts +43 -0
  118. research_md-0.2.0/tsconfig.json +19 -0
  119. research_md-0.2.0/vitest.config.ts +7 -0
@@ -0,0 +1,51 @@
1
+ # .forge/manifest.yaml — research.md
2
+ # The decision forge — evidence-graded, phase-gated, peer-reviewed decisions
3
+ # Generated by /forge-manifest-init on 2026-03-22
4
+
5
+ manifest_version: 1
6
+
7
+ repo:
8
+ visibility: public
9
+ org: eidos-agi
10
+ topics: [mcp, research, decisions, evidence, agent-tools]
11
+
12
+ packaging:
13
+ build_system: hatchling
14
+ pypi:
15
+ name: research-md
16
+ publish: true
17
+ trusted_publisher:
18
+ owner: eidos-agi
19
+ repo: research.md
20
+ workflow: publish.yml
21
+ environment: pypi
22
+ readme:
23
+ absolute_images: true
24
+
25
+ quality:
26
+ required_files:
27
+ - LICENSE
28
+ - README.md
29
+ - CHANGELOG.md
30
+ - CONTRIBUTING.md
31
+ - SECURITY.md
32
+ min_grade:
33
+ foss_check: B
34
+ ship_check: pass
35
+ sec_audit: clean
36
+
37
+ security:
38
+ secret_scanning: true
39
+ dependency_audit: true
40
+
41
+ dependencies:
42
+ max_count: 3
43
+
44
+ ci:
45
+ workflows:
46
+ ci: true
47
+ publish: true
48
+ permissions:
49
+ contents_read: true
50
+ pre_commit: true
51
+ build_verification: true
@@ -0,0 +1,62 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Lint
22
+ run: |
23
+ pip install ruff
24
+ ruff check research_md/
25
+ ruff format --check research_md/
26
+
27
+ test:
28
+ runs-on: ubuntu-latest
29
+ strategy:
30
+ matrix:
31
+ python-version: ["3.11", "3.12", "3.13"]
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: actions/setup-python@v5
35
+ with:
36
+ python-version: ${{ matrix.python-version }}
37
+ - name: Install dependencies
38
+ run: pip install -e ".[dev]"
39
+ - name: Run fixture verification
40
+ run: python refactor/verify-fixtures.py || true
41
+ - name: Run tests
42
+ run: pytest tests/ -v || echo "No pytest tests yet"
43
+
44
+ build-verify:
45
+ runs-on: ubuntu-latest
46
+ needs: [lint, test]
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+ - uses: actions/setup-python@v5
50
+ with:
51
+ python-version: "3.12"
52
+ - name: Build
53
+ run: |
54
+ pip install build twine
55
+ python -m build
56
+ - name: Verify metadata
57
+ run: twine check dist/*
58
+ - name: Verify wheel installs
59
+ run: |
60
+ python -m venv /tmp/test-venv
61
+ /tmp/test-venv/bin/pip install dist/*.whl
62
+ /tmp/test-venv/bin/python -c "import research_md; print(research_md.__version__)"
@@ -0,0 +1,29 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install build tools
23
+ run: pip install build
24
+
25
+ - name: Build package
26
+ run: python -m build
27
+
28
+ - name: Publish to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,37 @@
1
+ # Node (TypeScript original)
2
+ node_modules/
3
+ dist/
4
+ *.js.map
5
+ *.tsbuildinfo
6
+
7
+ # Python (new primary)
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+ *.egg-info/
12
+ build/
13
+ *.egg
14
+ *.whl
15
+
16
+ .venv/
17
+ venv/
18
+ env/
19
+ .env
20
+ .env.local
21
+
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *.swo
26
+ *~
27
+
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ .pytest_cache/
32
+ .coverage
33
+ htmlcov/
34
+ .mypy_cache/
35
+ .ruff_cache/
36
+
37
+ .mcp.json
@@ -0,0 +1,25 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.8.0
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix, --exit-non-zero-on-fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v5.0.0
11
+ hooks:
12
+ - id: check-yaml
13
+ - id: check-toml
14
+ - id: end-of-file-fixer
15
+ - id: trailing-whitespace
16
+ - id: check-merge-conflict
17
+ - id: check-added-large-files
18
+ args: ['--maxkb=500']
19
+ - id: detect-private-key
20
+
21
+ - repo: https://github.com/codespell-project/codespell
22
+ rev: v2.3.0
23
+ hooks:
24
+ - id: codespell
25
+ args: [--skip, "*.lock,*.cast"]
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-03-22
11
+
12
+ ### Added
13
+ - Initial release
@@ -0,0 +1,50 @@
1
+ # Contributing to research-md
2
+
3
+ Thanks for your interest in contributing.
4
+
5
+ ## Quick start
6
+
7
+ ```bash
8
+ git clone https://github.com/eidos-agi/research.md.git
9
+ cd research.md
10
+ pip install -e ".[dev]"
11
+ ```
12
+
13
+ ## Development
14
+
15
+ We use [ruff](https://docs.astral.sh/ruff/) for linting and formatting:
16
+
17
+ ```bash
18
+ ruff check .
19
+ ruff format .
20
+ ```
21
+
22
+ Run tests:
23
+
24
+ ```bash
25
+ pytest
26
+ ```
27
+
28
+ ## For agent developers
29
+
30
+ If you're building tools that AI agents will use, pay special attention to:
31
+
32
+ 1. **Tool descriptions** — Every `@tool` decorator must have a description that explains *when* to use it, not just *what* it does. An agent choosing between 20 tools needs clear differentiation.
33
+ 2. **Parameter descriptions** — Every parameter needs a `description` field. Agents don't have UI tooltips — the description is all they get.
34
+ 3. **Error messages** — When something fails, the error message must tell the agent what to do next. "Invalid input" is useless. "Expected ISO 8601 date string (e.g., 2026-03-22), got: 'yesterday'" is actionable.
35
+ 4. **Typed everything** — Type hints on all public functions. Agents parse types to understand contracts.
36
+
37
+ ## Pull requests
38
+
39
+ - Keep PRs focused — one feature or fix per PR
40
+ - Include tests for new functionality
41
+ - Update CHANGELOG.md with your changes
42
+ - Ensure `ruff check .` and `pytest` pass
43
+
44
+ ## Reporting issues
45
+
46
+ Open an issue with:
47
+
48
+ 1. What you were trying to do
49
+ 2. What happened instead
50
+ 3. Steps to reproduce
@@ -0,0 +1,152 @@
1
+ # Design: research.md
2
+
3
+ ## The Problem
4
+
5
+ AI agents skip process when they're under time pressure or context is long. Advisory rules in markdown — "lock criteria before scoring," "do peer review first" — are ignored the moment they're inconvenient. The agent has good intentions but no guardrails.
6
+
7
+ This is true for two categories of mistakes:
8
+
9
+ 1. **Process shortcuts** — scoring without peer review, accepting decisions without documenting alternatives
10
+ 2. **Wrong-target writes** — operating on the wrong research project because the agent guessed from its working directory
11
+
12
+ Both categories share a root cause: the tooling trusts the agent to do the right thing. research.md doesn't.
13
+
14
+ ## Two Layers of Enforcement
15
+
16
+ ### Layer 1: Process Gates
17
+
18
+ Certain research operations have prerequisites. research.md encodes these as hard failures:
19
+
20
+ | Gate | Tool | Prerequisite |
21
+ |------|------|-------------|
22
+ | Criteria must be locked before scoring | `candidate_score` | `criteria_lock` must have been called |
23
+ | Peer review must exist before scoring | `candidate_score` | `peer_review_log` must have been called |
24
+ | No unresolved claims before scoring | `candidate_score` | All `_TBD_` items must be resolved Y/N |
25
+
26
+ These aren't warnings. The tool returns an error with `isError: true`. The agent cannot proceed. The error message tells it exactly what's missing and which tool to call.
27
+
28
+ The gates exist because research quality degrades silently. An unreviewed scoring matrix looks identical to a reviewed one. A score assigned before criteria were locked might have been anchored to a preferred candidate. The output looks fine. The process was wrong. By the time anyone notices, the decision is made.
29
+
30
+ ### Layer 2: GUID-Based Project Targeting
31
+
32
+ Every research project gets a UUID at initialization:
33
+
34
+ ```json
35
+ {
36
+ "id": "959b9b96-7f18-4ccb-8e22-76ab54301086",
37
+ "version": "0.1.0",
38
+ "projectName": "secrets-manager",
39
+ "created": "2026-03-18"
40
+ }
41
+ ```
42
+
43
+ Every tool call requires this GUID as `research_id`. No GUID, no operation.
44
+
45
+ This solves a problem that most MCP servers ignore: **how does the server know which project the agent is talking about?**
46
+
47
+ The common answer is working directory detection — walk up the filesystem looking for a config file, infer the project from `cwd`. This is fragile:
48
+
49
+ - The agent doesn't control its own `cwd`. That's set by how the user launched their editor.
50
+ - Moving a terminal tab, opening a second workspace, or renaming a folder silently changes which project the server operates on.
51
+ - In a multi-project research repo, `cwd` is ambiguous — are you in the root or a subproject?
52
+ - Detection failures are silent. The server finds the wrong config and writes to the wrong project. Nothing errors. The agent doesn't know.
53
+
54
+ research.md rejects detection entirely. The agent must:
55
+
56
+ 1. **Call `project_set`** with an explicit path to register the project
57
+ 2. **Read the config file** to discover the GUID
58
+ 3. **Pass the GUID on every tool call**
59
+
60
+ If the GUID is missing, the tool fails with:
61
+
62
+ > Missing required parameter: research_id. Read the project's research-md.json file to find the 'id' field (a UUID). If the project hasn't been registered this session, call `project_set` with its path first.
63
+
64
+ If the GUID is wrong or unregistered:
65
+
66
+ > Unknown research_id '...'. This project hasn't been registered in this session. Call `project_set` with the project's path to register it.
67
+
68
+ The error messages are instructional. They don't just say "failed" — they tell the agent exactly what to do next.
69
+
70
+ ## Why a GUID Instead of a Path
71
+
72
+ A path would work mechanically. But a GUID forces the agent to read the config file before operating. This is the intentionality gate:
73
+
74
+ - **Path**: the agent can construct it from convention (`/home/dev/repos/research/secrets-manager`). It might be right. It might be stale.
75
+ - **GUID**: the agent must open `research-md.json` and extract the `id` field. This guarantees it has seen the current state of the project config before writing to it.
76
+
77
+ The extra friction is the point. Making the agent work to obtain the targeting key ensures it knows exactly which project it's about to modify. Wrong-project writes become structurally impossible rather than merely unlikely.
78
+
79
+ ## Multi-Project, Multi-Window, No Singletons
80
+
81
+ The GUID-to-path mapping lives in process memory, not on disk. Each Claude Code window spawns its own MCP server process. Each process maintains its own independent map.
82
+
83
+ - Window 1 registers `secrets-manager` (GUID A) → operates on secrets-manager
84
+ - Window 2 registers `cost-accounting` (GUID B) → operates on cost-accounting
85
+ - Neither blocks the other. No shared state. No lock contention.
86
+
87
+ A single session can also register multiple projects simultaneously:
88
+
89
+ ```
90
+ project_set /home/dev/repos/research → registers root + all subprojects
91
+ ```
92
+
93
+ The root GUID is registered but can't be used directly for data operations — it points to a container, not a project. The agent must use a subproject's GUID. If it tries the root GUID on `finding_create`, it gets:
94
+
95
+ > research_id '...' points to a multi-project root, not a specific project. Use the research_id of one of its subprojects: secrets-manager, cost-accounting.
96
+
97
+ ## Project Structure
98
+
99
+ research.md supports standalone projects and multi-project roots:
100
+
101
+ ```
102
+ # Standalone
103
+ my-research/
104
+ ├── research-md.json ← { id: "...", projectName: "my-research" }
105
+ ├── findings/
106
+ ├── candidates/
107
+ └── evaluations/
108
+
109
+ # Multi-project root
110
+ research/
111
+ ├── research-md.json ← { id: "...", projects: ["secrets-manager", "cost-accounting"] }
112
+ ├── secrets-manager/
113
+ │ ├── research-md.json ← { id: "...", projectName: "secrets-manager" }
114
+ │ ├── findings/
115
+ │ ├── candidates/
116
+ │ └── evaluations/
117
+ └── cost-accounting/
118
+ ├── research-md.json ← { id: "...", projectName: "cost-accounting" }
119
+ └── ...
120
+ ```
121
+
122
+ Each subproject is fully self-contained. Extract it to its own repo and it works standalone — it has its own config, its own GUID, its own folder structure. The root config is just a convenience for grouping related research.
123
+
124
+ ## Comparison to Backlog.md
125
+
126
+ research.md is modeled on [Backlog.md](https://github.com/MrLesk/Backlog.md), the task management MCP. The structural patterns are aligned:
127
+
128
+ | Pattern | Backlog.md | research.md |
129
+ |---------|-----------|-------------|
130
+ | Transport | stdio | stdio |
131
+ | CLI structure | `backlog init` / `backlog mcp start` | `research-md init` / `research-md mcp start` |
132
+ | Tool naming | `task_create`, `task_list` | `finding_create`, `candidate_list` |
133
+ | Schema enforcement | `additionalProperties: false` | `additionalProperties: false` |
134
+ | Error hierarchy | `McpError` → subtypes | `ResearchError` → subtypes |
135
+
136
+ The key divergence is project targeting:
137
+
138
+ | | Backlog.md | research.md |
139
+ |--|-----------|-------------|
140
+ | Project detection | `cwd` + `BACKLOG_CWD` env var | None — explicit GUID |
141
+ | Multi-project | Not supported | Root + subprojects |
142
+ | Concurrency | One project per process | Multiple projects per process |
143
+ | Wrong-target protection | None (trusts cwd) | GUID mismatch = hard fail |
144
+
145
+ ## Summary
146
+
147
+ research.md enforces two things:
148
+
149
+ 1. **You can't skip process.** The gates are in the code, not in a conventions doc.
150
+ 2. **You can't hit the wrong target.** The GUID is a targeting lock that requires intentional acquisition.
151
+
152
+ Both follow the same principle: make the right thing automatic and the wrong thing impossible. Advisory rules get skipped. Tooling doesn't.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Daniel Shanklin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: research-md
3
+ Version: 0.2.0
4
+ Summary: The decision forge — evidence-graded, phase-gated, peer-reviewed decisions
5
+ Project-URL: Homepage, https://github.com/eidos-agi/research.md
6
+ Project-URL: Repository, https://github.com/eidos-agi/research.md
7
+ Author-email: Daniel Shanklin <daniel@eidosagi.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: agent-tools,decisions,evidence,mcp,research
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: mcp>=1.0.0
19
+ Requires-Dist: pyyaml>=6.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # research.md
25
+
26
+ MCP server for structured research workflows. Enforces process gates in code so agents cannot skip findings, peer review, or criteria locking under time pressure.
27
+
28
+ ## What it enforces
29
+
30
+ | Gate | Trigger |
31
+ |------|---------|
32
+ | Criteria locked before scoring | `candidate_score` fails if `decision-criteria.md` not locked |
33
+ | No TBD on scored candidates | `candidate_score` fails if candidate has `_TBD_` claims |
34
+ | Peer review before scoring | `candidate_score` fails if no `evaluations/peer-review.md` |
35
+
36
+ ## Install
37
+
38
+ Not yet published to npm. Install from local path.
39
+
40
+ ```bash
41
+ npm install
42
+ npm run build
43
+ ```
44
+
45
+ Add to `.mcp.json` (use `node` with the local path, not `npx`):
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "research-md": {
51
+ "command": "node",
52
+ "args": ["/absolute/path/to/research.md/dist/index.js"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ Or for Claude Code:
59
+
60
+ ```bash
61
+ claude mcp add research-md --scope user -- node /absolute/path/to/research.md/dist/index.js
62
+ ```
63
+
64
+ ## Trilogy conventions
65
+
66
+ research.md follows shared conventions with ike.md and visionlog.md. See [CONVENTIONS.md](https://github.com/eidos-agi/ike.md/blob/main/CONVENTIONS.md) for the full standard: dot-dirs, git commitment, GUID routing, monorepo patterns.
67
+
68
+ - Config lives at `.research/research.json` (committed to git)
69
+ - Tools: `project_init` (new project) and `project_set` (register existing for session)
70
+
71
+ ## Targeting pattern: project_set + research_id
72
+
73
+ Every tool call requires a `research_id` -- the GUID from the project's `.research/research.json`. This is an in-memory mapping that does not persist across MCP server restarts.
74
+
75
+ **Session startup:**
76
+
77
+ 1. Call `project_set` with the project's absolute path
78
+ 2. It returns the project's `research_id` (a UUID)
79
+ 3. Pass that `research_id` on every subsequent tool call
80
+
81
+ If you call a tool without a valid `research_id`, the server tells you exactly how to fix it.
82
+
83
+ ## Project structure
84
+
85
+ ### Single project
86
+
87
+ ```
88
+ my-research/
89
+ .research/
90
+ research.json <- config with project GUID (commit this)
91
+ findings/ <- NNNN-slug.md
92
+ candidates/ <- slug.md
93
+ evaluations/
94
+ decision-criteria.md <- criteria table (lock before scoring)
95
+ peer-review.md <- reviewer log (required before scoring)
96
+ scoring-matrix.md <- generated from locked criteria + candidates
97
+ ```
98
+
99
+ ### Multi-project root
100
+
101
+ A root directory holds multiple research projects. Each subproject is a full project with its own GUID.
102
+
103
+ ```
104
+ research-root/
105
+ .research/
106
+ research.json <- root config (lists subprojects)
107
+ vendor-selection/
108
+ .research/
109
+ research.json <- subproject GUID
110
+ findings/
111
+ candidates/
112
+ evaluations/
113
+ platform-comparison/
114
+ .research/
115
+ research.json <- subproject GUID
116
+ findings/
117
+ candidates/
118
+ evaluations/
119
+ ```
120
+
121
+ Initialize a root and add subprojects:
122
+
123
+ ```
124
+ project_init { path: "/path/to/root", root: true }
125
+ project_init { path: "/path/to/root", subproject: "vendor-selection" }
126
+ project_init { path: "/path/to/root", subproject: "platform-comparison" }
127
+ ```
128
+
129
+ When you `project_set` a root, all subprojects are registered automatically. Use each subproject's `research_id` for tool calls -- you cannot operate on the root directly.
130
+
131
+ ## Tools (16)
132
+
133
+ ### Session
134
+
135
+ | Tool | Description |
136
+ |------|-------------|
137
+ | `project_set` | Register a project path, returns its GUID. Also registers subprojects if root. |
138
+ | `project_get` | List all registered projects and their GUIDs for this session. |
139
+
140
+ ### Project
141
+
142
+ | Tool | Description |
143
+ |------|-------------|
144
+ | `init` | Initialize project structure (single, root, or subproject). |
145
+ | `status` | Project health: criteria locked, peer review done, TBD count, finding/candidate totals. |
146
+
147
+ ### Findings
148
+
149
+ | Tool | Description |
150
+ |------|-------------|
151
+ | `finding_create` | Create finding with evidence grade and source. |
152
+ | `finding_list` | List all findings with status and evidence grade. |
153
+ | `finding_update` | Update status, evidence grade, or claim text. |
154
+
155
+ ### Candidates
156
+
157
+ | Tool | Description |
158
+ |------|-------------|
159
+ | `candidate_create` | Create candidate for evaluation. |
160
+ | `candidate_list` | List all candidates with verdict status. |
161
+ | `candidate_update` | Update verdict (provisional/recommended/eliminated) or description. |
162
+ | `candidate_add_claim` | Add binary testable claim to validation checklist. |
163
+ | `candidate_resolve_claim` | Mark a claim Y or N (clears `_TBD_`). |
164
+
165
+ ### Scoring
166
+
167
+ | Tool | Description |
168
+ |------|-------------|
169
+ | `criteria_lock` | Lock decision criteria weights. Required before scoring. |
170
+ | `candidate_score` | Score a candidate against locked criteria. Gated on criteria lock + peer review + no TBD. |
171
+ | `scoring_matrix_generate` | Generate `evaluations/scoring-matrix.md` comparison table. |
172
+
173
+ ### Peer Review
174
+
175
+ | Tool | Description |
176
+ |------|-------------|
177
+ | `peer_review_log` | Log reviewer name and findings. Required before scoring. |
178
+
179
+ ## Evidence grades
180
+
181
+ | Grade | Meaning |
182
+ |-------|---------|
183
+ | `HIGH` | Peer-reviewed, primary source, reproducible |
184
+ | `MODERATE` | Secondary source, credible but not independently verified |
185
+ | `LOW` | Anecdotal, single source, unverified claim |
186
+ | `UNVERIFIED` | Not yet assessed |
187
+
188
+ ## Resources
189
+
190
+ ```
191
+ research://workflow/overview -> workflow guide (auto-loaded into agent context)
192
+ research://findings/all -> all findings as markdown
193
+ research://candidates/all -> all candidates with verdict
194
+ research://scoring-matrix -> current scoring matrix
195
+ research://status -> project health summary
196
+ ```
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ npm install
202
+ npm run build
203
+ npm run dev
204
+ ```