minirag-mcp 0.1.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.
- minirag_mcp-0.1.0/.beads/.gitignore +70 -0
- minirag_mcp-0.1.0/.beads/README.md +81 -0
- minirag_mcp-0.1.0/.beads/config.yaml +55 -0
- minirag_mcp-0.1.0/.beads/hooks/post-checkout +24 -0
- minirag_mcp-0.1.0/.beads/hooks/post-merge +24 -0
- minirag_mcp-0.1.0/.beads/hooks/pre-commit +24 -0
- minirag_mcp-0.1.0/.beads/hooks/pre-push +24 -0
- minirag_mcp-0.1.0/.beads/hooks/prepare-commit-msg +24 -0
- minirag_mcp-0.1.0/.beads/interactions.jsonl +11 -0
- minirag_mcp-0.1.0/.beads/issues.jsonl +13 -0
- minirag_mcp-0.1.0/.beads/metadata.json +7 -0
- minirag_mcp-0.1.0/.claude/settings.json +26 -0
- minirag_mcp-0.1.0/.github/workflows/ci.yml +65 -0
- minirag_mcp-0.1.0/.github/workflows/release.yml +158 -0
- minirag_mcp-0.1.0/.gitignore +20 -0
- minirag_mcp-0.1.0/AGENTS.md +96 -0
- minirag_mcp-0.1.0/CLAUDE.md +70 -0
- minirag_mcp-0.1.0/LICENSE +21 -0
- minirag_mcp-0.1.0/PKG-INFO +587 -0
- minirag_mcp-0.1.0/README.md +571 -0
- minirag_mcp-0.1.0/docs/superpowers/plans/2026-08-07-minirag-mcp-v1.md +3539 -0
- minirag_mcp-0.1.0/docs/superpowers/specs/2026-08-07-minirag-mcp-v1-design.md +326 -0
- minirag_mcp-0.1.0/pyproject.toml +78 -0
- minirag_mcp-0.1.0/src/minirag_mcp/__init__.py +15 -0
- minirag_mcp-0.1.0/src/minirag_mcp/__main__.py +18 -0
- minirag_mcp-0.1.0/src/minirag_mcp/chunker/__init__.py +0 -0
- minirag_mcp-0.1.0/src/minirag_mcp/chunker/semantic.py +80 -0
- minirag_mcp-0.1.0/src/minirag_mcp/chunker/structural.py +98 -0
- minirag_mcp-0.1.0/src/minirag_mcp/cli/__init__.py +404 -0
- minirag_mcp-0.1.0/src/minirag_mcp/config.py +157 -0
- minirag_mcp-0.1.0/src/minirag_mcp/embedder.py +59 -0
- minirag_mcp-0.1.0/src/minirag_mcp/ingest/__init__.py +0 -0
- minirag_mcp-0.1.0/src/minirag_mcp/ingest/parser.py +425 -0
- minirag_mcp-0.1.0/src/minirag_mcp/ingest/pipeline.py +206 -0
- minirag_mcp-0.1.0/src/minirag_mcp/ingest/scanner.py +197 -0
- minirag_mcp-0.1.0/src/minirag_mcp/results.py +37 -0
- minirag_mcp-0.1.0/src/minirag_mcp/scope.py +51 -0
- minirag_mcp-0.1.0/src/minirag_mcp/security.py +162 -0
- minirag_mcp-0.1.0/src/minirag_mcp/server.py +335 -0
- minirag_mcp-0.1.0/src/minirag_mcp/store.py +437 -0
- minirag_mcp-0.1.0/src/minirag_mcp/sync.py +170 -0
- minirag_mcp-0.1.0/tests/conftest.py +154 -0
- minirag_mcp-0.1.0/tests/integration/test_real_model.py +48 -0
- minirag_mcp-0.1.0/tests/test_chunker_semantic.py +96 -0
- minirag_mcp-0.1.0/tests/test_chunker_structural.py +73 -0
- minirag_mcp-0.1.0/tests/test_cli.py +256 -0
- minirag_mcp-0.1.0/tests/test_config.py +105 -0
- minirag_mcp-0.1.0/tests/test_embedder.py +39 -0
- minirag_mcp-0.1.0/tests/test_parser.py +350 -0
- minirag_mcp-0.1.0/tests/test_pipeline.py +429 -0
- minirag_mcp-0.1.0/tests/test_scaffold.py +25 -0
- minirag_mcp-0.1.0/tests/test_scanner.py +150 -0
- minirag_mcp-0.1.0/tests/test_scope.py +57 -0
- minirag_mcp-0.1.0/tests/test_security.py +217 -0
- minirag_mcp-0.1.0/tests/test_server.py +229 -0
- minirag_mcp-0.1.0/tests/test_store.py +229 -0
- minirag_mcp-0.1.0/tests/test_store_search.py +287 -0
- minirag_mcp-0.1.0/tests/test_sync.py +163 -0
- minirag_mcp-0.1.0/uv.lock +3000 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Dolt database (managed by Dolt, not git)
|
|
2
|
+
dolt/
|
|
3
|
+
embeddeddolt/
|
|
4
|
+
|
|
5
|
+
# Runtime files
|
|
6
|
+
bd.sock
|
|
7
|
+
bd.sock.startlock
|
|
8
|
+
sync-state.json
|
|
9
|
+
last-touched
|
|
10
|
+
.exclusive-lock
|
|
11
|
+
|
|
12
|
+
# Daemon runtime (lock, log, pid)
|
|
13
|
+
daemon.*
|
|
14
|
+
|
|
15
|
+
# Push state (runtime, per-machine)
|
|
16
|
+
push-state.json
|
|
17
|
+
|
|
18
|
+
# Lock files (various runtime locks)
|
|
19
|
+
*.lock
|
|
20
|
+
|
|
21
|
+
# Credential key (encryption key for federation peer auth — never commit)
|
|
22
|
+
.beads-credential-key
|
|
23
|
+
|
|
24
|
+
# Local version tracking (prevents upgrade notification spam after git ops)
|
|
25
|
+
.local_version
|
|
26
|
+
|
|
27
|
+
# Worktree redirect file (contains relative path to main repo's .beads/)
|
|
28
|
+
# Must not be committed as paths would be wrong in other clones
|
|
29
|
+
redirect
|
|
30
|
+
|
|
31
|
+
# Sync state (local-only, per-machine)
|
|
32
|
+
# These files are machine-specific and should not be shared across clones
|
|
33
|
+
.sync.lock
|
|
34
|
+
export-state/
|
|
35
|
+
export-state.json
|
|
36
|
+
|
|
37
|
+
# Ephemeral store (SQLite - wisps/molecules, intentionally not versioned)
|
|
38
|
+
ephemeral.sqlite3
|
|
39
|
+
ephemeral.sqlite3-journal
|
|
40
|
+
ephemeral.sqlite3-wal
|
|
41
|
+
ephemeral.sqlite3-shm
|
|
42
|
+
|
|
43
|
+
# Dolt server management (auto-started by bd)
|
|
44
|
+
dolt-server.pid
|
|
45
|
+
dolt-server.log
|
|
46
|
+
dolt-server.lock
|
|
47
|
+
dolt-server.port
|
|
48
|
+
dolt-server.activity
|
|
49
|
+
|
|
50
|
+
# Corrupt backup directories (created by bd doctor --fix recovery)
|
|
51
|
+
*.corrupt.backup/
|
|
52
|
+
|
|
53
|
+
# Backup data (auto-exported JSONL, local-only)
|
|
54
|
+
backup/
|
|
55
|
+
|
|
56
|
+
# Per-project environment file (Dolt connection config, GH#2520)
|
|
57
|
+
.env
|
|
58
|
+
|
|
59
|
+
# Legacy files (from pre-Dolt versions)
|
|
60
|
+
*.db
|
|
61
|
+
*.db?*
|
|
62
|
+
*.db-journal
|
|
63
|
+
*.db-wal
|
|
64
|
+
*.db-shm
|
|
65
|
+
db.sqlite
|
|
66
|
+
bd.db
|
|
67
|
+
# NOTE: Do NOT add negation patterns here.
|
|
68
|
+
# They would override fork protection in .git/info/exclude.
|
|
69
|
+
# Config files (metadata.json, config.yaml) are tracked by git by default
|
|
70
|
+
# since no pattern above ignores them.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Beads - AI-Native Issue Tracking
|
|
2
|
+
|
|
3
|
+
Welcome to Beads! This repository uses **Beads** for issue tracking - a modern, AI-native tool designed to live directly in your codebase alongside your code.
|
|
4
|
+
|
|
5
|
+
## What is Beads?
|
|
6
|
+
|
|
7
|
+
Beads is issue tracking that lives in your repo, making it perfect for AI coding agents and developers who want their issues close to their code. No web UI required - everything works through the CLI and integrates seamlessly with git.
|
|
8
|
+
|
|
9
|
+
**Learn more:** [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Essential Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create new issues
|
|
17
|
+
bd create "Add user authentication"
|
|
18
|
+
|
|
19
|
+
# View all issues
|
|
20
|
+
bd list
|
|
21
|
+
|
|
22
|
+
# View issue details
|
|
23
|
+
bd show <issue-id>
|
|
24
|
+
|
|
25
|
+
# Update issue status
|
|
26
|
+
bd update <issue-id> --claim
|
|
27
|
+
bd update <issue-id> --status done
|
|
28
|
+
|
|
29
|
+
# Sync with Dolt remote
|
|
30
|
+
bd dolt push
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Working with Issues
|
|
34
|
+
|
|
35
|
+
Issues in Beads are:
|
|
36
|
+
- **Git-native**: Stored in Dolt database with version control and branching
|
|
37
|
+
- **AI-friendly**: CLI-first design works perfectly with AI coding agents
|
|
38
|
+
- **Branch-aware**: Issues can follow your branch workflow
|
|
39
|
+
- **Always in sync**: Auto-syncs with your commits
|
|
40
|
+
|
|
41
|
+
## Why Beads?
|
|
42
|
+
|
|
43
|
+
✨ **AI-Native Design**
|
|
44
|
+
- Built specifically for AI-assisted development workflows
|
|
45
|
+
- CLI-first interface works seamlessly with AI coding agents
|
|
46
|
+
- No context switching to web UIs
|
|
47
|
+
|
|
48
|
+
🚀 **Developer Focused**
|
|
49
|
+
- Issues live in your repo, right next to your code
|
|
50
|
+
- Works offline, syncs when you push
|
|
51
|
+
- Fast, lightweight, and stays out of your way
|
|
52
|
+
|
|
53
|
+
🔧 **Git Integration**
|
|
54
|
+
- Automatic sync with git commits
|
|
55
|
+
- Branch-aware issue tracking
|
|
56
|
+
- Dolt-native three-way merge resolution
|
|
57
|
+
|
|
58
|
+
## Get Started with Beads
|
|
59
|
+
|
|
60
|
+
Try Beads in your own projects:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install Beads
|
|
64
|
+
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
|
65
|
+
|
|
66
|
+
# Initialize in your repo
|
|
67
|
+
bd init
|
|
68
|
+
|
|
69
|
+
# Create your first issue
|
|
70
|
+
bd create "Try out Beads"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Learn More
|
|
74
|
+
|
|
75
|
+
- **Documentation**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
|
|
76
|
+
- **Quick Start Guide**: Run `bd quickstart`
|
|
77
|
+
- **Examples**: [github.com/steveyegge/beads/examples](https://github.com/steveyegge/beads/tree/main/examples)
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
*Beads: Issue tracking that moves at the speed of thought* ⚡
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Beads Configuration File
|
|
2
|
+
# This file configures default behavior for all bd commands in this repository
|
|
3
|
+
# All settings can also be set via environment variables (BD_* prefix)
|
|
4
|
+
# or overridden with command-line flags
|
|
5
|
+
|
|
6
|
+
# Issue prefix for this repository (used by bd init)
|
|
7
|
+
# If not set, bd init will auto-detect from directory name
|
|
8
|
+
# Example: issue-prefix: "myproject" creates issues like "myproject-1", "myproject-2", etc.
|
|
9
|
+
# issue-prefix: ""
|
|
10
|
+
|
|
11
|
+
# Use no-db mode: JSONL-only, no Dolt database
|
|
12
|
+
# When true, bd will use .beads/issues.jsonl as the source of truth
|
|
13
|
+
# no-db: false
|
|
14
|
+
|
|
15
|
+
# Enable JSON output by default
|
|
16
|
+
# json: false
|
|
17
|
+
|
|
18
|
+
# Feedback title formatting for mutating commands (create/update/close/dep/edit)
|
|
19
|
+
# 0 = hide titles, N > 0 = truncate to N characters
|
|
20
|
+
# output:
|
|
21
|
+
# title-length: 255
|
|
22
|
+
|
|
23
|
+
# Default actor for audit trails (overridden by BEADS_ACTOR or --actor)
|
|
24
|
+
# actor: ""
|
|
25
|
+
|
|
26
|
+
# Export events (audit trail) to .beads/events.jsonl on each flush/sync
|
|
27
|
+
# When enabled, new events are appended incrementally using a high-water mark.
|
|
28
|
+
# Use 'bd export --events' to trigger manually regardless of this setting.
|
|
29
|
+
# events-export: false
|
|
30
|
+
|
|
31
|
+
# Multi-repo configuration (experimental - bd-307)
|
|
32
|
+
# Allows hydrating from multiple repositories and routing writes to the correct database
|
|
33
|
+
# repos:
|
|
34
|
+
# primary: "." # Primary repo (where this database lives)
|
|
35
|
+
# additional: # Additional repos to hydrate from (read-only)
|
|
36
|
+
# - ~/beads-planning # Personal planning repo
|
|
37
|
+
# - ~/work-planning # Work planning repo
|
|
38
|
+
|
|
39
|
+
# JSONL backup (periodic export for off-machine recovery)
|
|
40
|
+
# Auto-enabled when a git remote exists. Override explicitly:
|
|
41
|
+
# backup:
|
|
42
|
+
# enabled: false # Disable auto-backup entirely
|
|
43
|
+
# interval: 15m # Minimum time between auto-exports
|
|
44
|
+
# git-push: false # Disable git push (export locally only)
|
|
45
|
+
# git-repo: "" # Separate git repo for backups (default: project repo)
|
|
46
|
+
|
|
47
|
+
# Integration settings (access with 'bd config get/set')
|
|
48
|
+
# Non-secret keys (stored in the database):
|
|
49
|
+
# - jira.url, jira.project
|
|
50
|
+
# - linear.team_id
|
|
51
|
+
# - github.org, github.repo
|
|
52
|
+
#
|
|
53
|
+
# Secret keys (stored in this file but prefer env vars to avoid git exposure):
|
|
54
|
+
# - linear.api_key → use LINEAR_API_KEY env var instead
|
|
55
|
+
# - github.token → use GITHUB_TOKEN env var instead
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# --- BEGIN BEADS INTEGRATION v1.0.4 ---
|
|
3
|
+
# This section is managed by beads. Do not remove these markers.
|
|
4
|
+
if command -v bd >/dev/null 2>&1; then
|
|
5
|
+
export BD_GIT_HOOK=1
|
|
6
|
+
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
|
7
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
8
|
+
timeout "$_bd_timeout" bd hooks run post-checkout "$@"
|
|
9
|
+
_bd_exit=$?
|
|
10
|
+
if [ $_bd_exit -eq 124 ]; then
|
|
11
|
+
echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
|
|
12
|
+
_bd_exit=0
|
|
13
|
+
fi
|
|
14
|
+
else
|
|
15
|
+
bd hooks run post-checkout "$@"
|
|
16
|
+
_bd_exit=$?
|
|
17
|
+
fi
|
|
18
|
+
if [ $_bd_exit -eq 3 ]; then
|
|
19
|
+
echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
|
|
20
|
+
_bd_exit=0
|
|
21
|
+
fi
|
|
22
|
+
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
|
23
|
+
fi
|
|
24
|
+
# --- END BEADS INTEGRATION v1.0.4 ---
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# --- BEGIN BEADS INTEGRATION v1.0.4 ---
|
|
3
|
+
# This section is managed by beads. Do not remove these markers.
|
|
4
|
+
if command -v bd >/dev/null 2>&1; then
|
|
5
|
+
export BD_GIT_HOOK=1
|
|
6
|
+
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
|
7
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
8
|
+
timeout "$_bd_timeout" bd hooks run post-merge "$@"
|
|
9
|
+
_bd_exit=$?
|
|
10
|
+
if [ $_bd_exit -eq 124 ]; then
|
|
11
|
+
echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
|
|
12
|
+
_bd_exit=0
|
|
13
|
+
fi
|
|
14
|
+
else
|
|
15
|
+
bd hooks run post-merge "$@"
|
|
16
|
+
_bd_exit=$?
|
|
17
|
+
fi
|
|
18
|
+
if [ $_bd_exit -eq 3 ]; then
|
|
19
|
+
echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
|
|
20
|
+
_bd_exit=0
|
|
21
|
+
fi
|
|
22
|
+
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
|
23
|
+
fi
|
|
24
|
+
# --- END BEADS INTEGRATION v1.0.4 ---
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# --- BEGIN BEADS INTEGRATION v1.0.4 ---
|
|
3
|
+
# This section is managed by beads. Do not remove these markers.
|
|
4
|
+
if command -v bd >/dev/null 2>&1; then
|
|
5
|
+
export BD_GIT_HOOK=1
|
|
6
|
+
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
|
7
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
8
|
+
timeout "$_bd_timeout" bd hooks run pre-commit "$@"
|
|
9
|
+
_bd_exit=$?
|
|
10
|
+
if [ $_bd_exit -eq 124 ]; then
|
|
11
|
+
echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
|
|
12
|
+
_bd_exit=0
|
|
13
|
+
fi
|
|
14
|
+
else
|
|
15
|
+
bd hooks run pre-commit "$@"
|
|
16
|
+
_bd_exit=$?
|
|
17
|
+
fi
|
|
18
|
+
if [ $_bd_exit -eq 3 ]; then
|
|
19
|
+
echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
|
|
20
|
+
_bd_exit=0
|
|
21
|
+
fi
|
|
22
|
+
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
|
23
|
+
fi
|
|
24
|
+
# --- END BEADS INTEGRATION v1.0.4 ---
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# --- BEGIN BEADS INTEGRATION v1.0.4 ---
|
|
3
|
+
# This section is managed by beads. Do not remove these markers.
|
|
4
|
+
if command -v bd >/dev/null 2>&1; then
|
|
5
|
+
export BD_GIT_HOOK=1
|
|
6
|
+
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
|
7
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
8
|
+
timeout "$_bd_timeout" bd hooks run pre-push "$@"
|
|
9
|
+
_bd_exit=$?
|
|
10
|
+
if [ $_bd_exit -eq 124 ]; then
|
|
11
|
+
echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
|
|
12
|
+
_bd_exit=0
|
|
13
|
+
fi
|
|
14
|
+
else
|
|
15
|
+
bd hooks run pre-push "$@"
|
|
16
|
+
_bd_exit=$?
|
|
17
|
+
fi
|
|
18
|
+
if [ $_bd_exit -eq 3 ]; then
|
|
19
|
+
echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
|
|
20
|
+
_bd_exit=0
|
|
21
|
+
fi
|
|
22
|
+
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
|
23
|
+
fi
|
|
24
|
+
# --- END BEADS INTEGRATION v1.0.4 ---
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# --- BEGIN BEADS INTEGRATION v1.0.4 ---
|
|
3
|
+
# This section is managed by beads. Do not remove these markers.
|
|
4
|
+
if command -v bd >/dev/null 2>&1; then
|
|
5
|
+
export BD_GIT_HOOK=1
|
|
6
|
+
_bd_timeout=${BEADS_HOOK_TIMEOUT:-300}
|
|
7
|
+
if command -v timeout >/dev/null 2>&1; then
|
|
8
|
+
timeout "$_bd_timeout" bd hooks run prepare-commit-msg "$@"
|
|
9
|
+
_bd_exit=$?
|
|
10
|
+
if [ $_bd_exit -eq 124 ]; then
|
|
11
|
+
echo >&2 "beads: hook 'prepare-commit-msg' timed out after ${_bd_timeout}s — continuing without beads"
|
|
12
|
+
_bd_exit=0
|
|
13
|
+
fi
|
|
14
|
+
else
|
|
15
|
+
bd hooks run prepare-commit-msg "$@"
|
|
16
|
+
_bd_exit=$?
|
|
17
|
+
fi
|
|
18
|
+
if [ $_bd_exit -eq 3 ]; then
|
|
19
|
+
echo >&2 "beads: database not initialized — skipping hook 'prepare-commit-msg'"
|
|
20
|
+
_bd_exit=0
|
|
21
|
+
fi
|
|
22
|
+
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
|
|
23
|
+
fi
|
|
24
|
+
# --- END BEADS INTEGRATION v1.0.4 ---
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{"id":"int-9b01529e","kind":"field_change","created_at":"2026-08-07T13:29:14.271617Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-l7s","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Folded into v1 by user decision 2026-08-07: ingest_url is in the v1 spec (markitdown convert_url, http/https whitelist)"}}
|
|
2
|
+
{"id":"int-6c1f2625","kind":"field_change","created_at":"2026-08-07T13:33:56.622208Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-jpw","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Spec approved by user 2026-08-07: docs/superpowers/specs/2026-08-07-minirag-mcp-v1-design.md (commits 1560284, e44dbf9)"}}
|
|
3
|
+
{"id":"int-d9448818","kind":"field_change","created_at":"2026-08-07T13:50:01.881154Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-01m","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Plan written and committed: docs/superpowers/plans/2026-08-07-minirag-mcp-v1.md"}}
|
|
4
|
+
{"id":"int-5f6f3aea","kind":"field_change","created_at":"2026-08-07T19:29:00.081229Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-cuz","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"v1 implemented, reviewed, verified on a real 558-document corpus, published at https://github.com/sfrangulov/minirag-mcp"}}
|
|
5
|
+
{"id":"int-309c65cf","kind":"field_change","created_at":"2026-08-07T21:57:00.016884Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-4rd","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
6
|
+
{"id":"int-66a5e93a","kind":"field_change","created_at":"2026-08-07T21:57:01.109984Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-vqj","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
7
|
+
{"id":"int-2a8dc369","kind":"field_change","created_at":"2026-08-07T21:57:01.712873Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-abr","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
8
|
+
{"id":"int-5c101c2e","kind":"field_change","created_at":"2026-08-07T21:57:02.297905Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-jr1","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
9
|
+
{"id":"int-a03f9271","kind":"field_change","created_at":"2026-08-07T21:57:02.904885Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-1l1","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
10
|
+
{"id":"int-99b88fb6","kind":"field_change","created_at":"2026-08-07T21:57:03.520049Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-pfi","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
11
|
+
{"id":"int-bcfa5939","kind":"field_change","created_at":"2026-08-07T21:57:04.152758Z","actor":"Sergei Frangulov","issue_id":"minirag-mcp-hap","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Done on branch debts (pushed, not merged)"}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{"_type":"issue","id":"minirag-mcp-vqj","title":"ingest_url: restrict hosts, not only schemes","description":"security.check_url_scheme (security.py:28) whitelists http/https but places no restriction on the host. http://169.254.169.254/latest/meta-data/ (cloud metadata) and http://localhost:8080/admin both pass. The URL is frequently chosen by an LLM rather than a human, and that LLM may be acting on text from an already-indexed document — a prompt-injection to SSRF path. Consider: block link-local/loopback/private ranges by default, resolve the hostname and check the resolved IP (not just the literal), and offer an opt-out env var for users who deliberately index an internal wiki.","status":"closed","priority":1,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:16Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:01Z","closed_at":"2026-08-07T21:57:01Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
2
|
+
{"_type":"issue","id":"minirag-mcp-4rd","title":"scope: unify prefix semantics between scanner and store","description":"Two different meanings of scope in one codebase. scanner._in_scope (scanner.py:89) compares path COMPONENTS (correct). store._scope_clause (store.py:65) uses starts_with(), and list_files filters entries with str.startswith (server.py:251, cli/__init__.py:322) — raw string prefixes. Result: scope='/data/proj' also matches '/data/project-secret/f.md'. Scope is the only mechanism for narrowing what an agent can see, so a surprise here is both a correctness and a confidentiality issue. Fix: make store/list_files use component-wise containment (append a path separator, or reuse a shared helper). Also update the spec, which still describes scope as a post-fusion filter while the code prefilters both vector and FTS sides.","status":"closed","priority":1,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:14Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:00Z","closed_at":"2026-08-07T21:57:00Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
3
|
+
{"_type":"issue","id":"minirag-mcp-cuz","title":"Implement v1 per plan","description":"Execute docs/superpowers/plans/2026-08-07-minirag-mcp-v1.md: 16 tasks, TDD, commit per task. All library APIs in the plan were live-probed 2026-08-07.","status":"closed","priority":1,"issue_type":"task","assignee":"Sergei Frangulov","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T13:50:01Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T19:29:00Z","started_at":"2026-08-07T13:58:42Z","closed_at":"2026-08-07T19:29:00Z","close_reason":"v1 implemented, reviewed, verified on a real 558-document corpus, published at https://github.com/sfrangulov/minirag-mcp","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
4
|
+
{"_type":"issue","id":"minirag-mcp-01m","title":"Write implementation plan for v1","description":"After spec approval: invoke writing-plans skill, produce step-by-step implementation plan.","status":"closed","priority":1,"issue_type":"task","assignee":"Sergei Frangulov","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T13:07:44Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T13:50:02Z","started_at":"2026-08-07T13:33:57Z","closed_at":"2026-08-07T13:50:02Z","close_reason":"Plan written and committed: docs/superpowers/plans/2026-08-07-minirag-mcp-v1.md","dependencies":[{"issue_id":"minirag-mcp-01m","depends_on_id":"minirag-mcp-jpw","type":"blocks","created_at":"2026-08-07T17:07:50Z","created_by":"Sergei Frangulov","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0}
|
|
5
|
+
{"_type":"issue","id":"minirag-mcp-jpw","title":"Design \u0026 spec minirag-mcp v1","description":"Brainstorm -\u003e design doc -\u003e spec review. Python rewrite of shinpr/mcp-local-rag: fastmcp + markitdown (ingest, recursive dir scan) + trafilatura (HTML main-content extraction, markitdown fallback) + fastembed (default paraphrase-multilingual-MiniLM-L12-v2) + LanceDB (hybrid search). v1 scope: MCP server (9 tools, parity) + CLI (same index, typer/argparse). No PDF visual mode, no ingest_url. All docs and functionality in English.","status":"closed","priority":1,"issue_type":"task","assignee":"Sergei Frangulov","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T13:07:36Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T13:33:57Z","started_at":"2026-08-07T13:07:50Z","closed_at":"2026-08-07T13:33:57Z","close_reason":"Spec approved by user 2026-08-07: docs/superpowers/specs/2026-08-07-minirag-mcp-v1-design.md (commits 1560284, e44dbf9)","dependency_count":0,"dependent_count":1,"comment_count":0}
|
|
6
|
+
{"_type":"issue","id":"minirag-mcp-hap","title":"Add CI: tests, lint, build on push and PR","description":"The repository is public with no CI. A GitHub Actions workflow should run: uv sync, uv run pytest -q, uv run ruff check + format --check, and uv build on push and pull_request. Consider running the slow test (real model, ~220 MB download) on a schedule or behind a label rather than on every push, with the model cached between runs.","status":"closed","priority":2,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:40Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:04Z","closed_at":"2026-08-07T21:57:04Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
7
|
+
{"_type":"issue","id":"minirag-mcp-1l1","title":"Avoid embedding every chunk twice per ingest","description":"Pipeline._chunk_and_store embeds twice: once inside merge_blocks (pipeline.py:101, block granularity, for the similarity merge decision) and again for the final chunks (pipeline.py:109). Any block that survives unmerged is embedded twice — roughly 2x the ingest cost, which is the dominant cost on a large corpus (558 docs took 35 min). Fix needs merge_blocks to return (text, vector) pairs instead of list[str], reusing the vectors it already computed for chunks that were not merged; merged chunks still need a fresh vector.","status":"closed","priority":2,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:39Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:03Z","closed_at":"2026-08-07T21:57:03Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
8
|
+
{"_type":"issue","id":"minirag-mcp-jr1","title":"Strip image placeholders from ingested markdown","description":"Measured on a real 558-document corpus: 4442 of 52231 chunks (8.5%) contain markitdown image placeholders like  — 0.9% of all indexed characters. Harmless for ranking but noisy in query results and read_file output, and one boilerplate-heading case was actually an image placeholder acting as the H1 (already handled in parser._is_usable_heading). Strip data: image links during parsing, keeping any alt text.","status":"closed","priority":2,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:17Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:02Z","closed_at":"2026-08-07T21:57:02Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
9
|
+
{"_type":"issue","id":"minirag-mcp-abr","title":"query_documents: bound topK","description":"store.search (store.py:346) computes fetch = max(top_k * 4, 50) with no upper bound, so query_documents(query='x', topK=10**8) attempts to pull 400M rows. Clamp topK at the tool boundary (e.g. 100) and document the cap.","status":"closed","priority":2,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:16Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:02Z","closed_at":"2026-08-07T21:57:02Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
10
|
+
{"_type":"issue","id":"minirag-mcp-73h","title":"Reindex the solidcore corpus with current code","description":"The working index under scratchpad (built 2026-08-07) predates the title-precedence fixes in 1bb475c: titles there come from 9f43457's rule, which preferred the filename even when a real H1 existed. An offline re-measurement showed the final rule differs on only 7 of 558 documents, so this is low urgency — but any real use of that corpus should start from a fresh sync with current code. Note DB_PATH defaults to \u003croot\u003e/.minirag/lancedb, i.e. inside the documents folder; pass --db-path explicitly to keep the index elsewhere.","status":"open","priority":3,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:41Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T19:52:41Z","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
11
|
+
{"_type":"issue","id":"minirag-mcp-ef0","title":"Publish to PyPI so uvx minirag-mcp works","description":"The package is installable only via uvx --from git+https://github.com/sfrangulov/minirag-mcp. Publishing to PyPI shortens every install snippet in the README and in MCP client configs. Needs: name availability check, a trusted-publisher or API-token setup, a release workflow, and a README pass to switch the snippets back to the short form.","status":"open","priority":3,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:41Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T19:52:41Z","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
12
|
+
{"_type":"issue","id":"minirag-mcp-pfi","title":"Narrow the open_table exception handler","description":"store.py:138-139 catches bare Exception around open_table and treats any failure as table-missing, then calls create_table. A corrupt table or a permissions error is therefore misreported as a confusing create-time error instead of the real cause. Narrow to the not-found error (ValueError in lancedb 0.36) and let other failures surface. Small related cleanups: delete_source (store.py:225) materializes rows just to count them — use count_rows(filter=...); ingest_file (pipeline.py:135,149) stats the file twice — capture one stat result.","status":"closed","priority":3,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T19:52:39Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T21:57:03Z","closed_at":"2026-08-07T21:57:03Z","close_reason":"Done on branch debts (pushed, not merged)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
13
|
+
{"_type":"issue","id":"minirag-mcp-l7s","title":"Deferred: ingest_url tool (server-side web fetch)","description":"Server fetches URL itself and extracts main content. Deferred from v1 by user decision (2026-08-07). Implementation note (verified 2026-08-07): markitdown ships convert_url()/convert_uri() plus special converters for YouTube/Wikipedia/RSS out of the box, so fetching is nearly free — combine with trafilatura for main-content extraction of generic pages. Keep the offline-after-model-download privacy promise clear in docs if this ships.","status":"closed","priority":3,"issue_type":"task","owner":"sfrangulov@gmail.com","created_at":"2026-08-07T13:07:45Z","created_by":"Sergei Frangulov","updated_at":"2026-08-07T13:29:14Z","closed_at":"2026-08-07T13:29:14Z","close_reason":"Folded into v1 by user decision 2026-08-07: ingest_url is in the v1 spec (markitdown convert_url, http/https whitelist)","dependency_count":0,"dependent_count":0,"comment_count":0}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PreCompact": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"command": "bd prime",
|
|
8
|
+
"type": "command"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"matcher": ""
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"SessionStart": [
|
|
15
|
+
{
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"command": "bd prime",
|
|
19
|
+
"type": "command"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"matcher": ""
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, debts]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "17 5 * * 1" # Mondays, for the slow job only
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-latest, macos-latest]
|
|
18
|
+
# 3.13 is what development happens on, and security.py reasons explicitly
|
|
19
|
+
# about interpreter-version differences in `ipaddress` — untested versions
|
|
20
|
+
# are the ones that break.
|
|
21
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- uses: astral-sh/setup-uv@v6
|
|
25
|
+
with:
|
|
26
|
+
enable-cache: true
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
- run: uv sync
|
|
29
|
+
- run: uv run ruff check src tests
|
|
30
|
+
- run: uv run ruff format --check src tests
|
|
31
|
+
- run: uv run pytest -q
|
|
32
|
+
|
|
33
|
+
build:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: astral-sh/setup-uv@v6
|
|
38
|
+
with:
|
|
39
|
+
enable-cache: true
|
|
40
|
+
- run: uv build
|
|
41
|
+
# Installing from the wheel into an empty venv is the only check that the
|
|
42
|
+
# packaged distribution — not the source tree — has a working entry point.
|
|
43
|
+
- name: Smoke-test the installed console script
|
|
44
|
+
run: |
|
|
45
|
+
uv venv /tmp/smoke
|
|
46
|
+
VIRTUAL_ENV=/tmp/smoke uv pip install dist/*.whl
|
|
47
|
+
/tmp/smoke/bin/minirag-mcp status --base-dir .
|
|
48
|
+
|
|
49
|
+
slow:
|
|
50
|
+
# Downloads a ~220 MB embedding model: never on push or pull_request.
|
|
51
|
+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
env:
|
|
54
|
+
MINIRAG_TEST_MODEL_CACHE: ${{ github.workspace }}/.model-cache
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
- uses: astral-sh/setup-uv@v6
|
|
58
|
+
with:
|
|
59
|
+
enable-cache: true
|
|
60
|
+
- uses: actions/cache@v4
|
|
61
|
+
with:
|
|
62
|
+
path: ${{ github.workspace }}/.model-cache
|
|
63
|
+
key: fastembed-${{ runner.os }}-${{ hashFiles('src/minirag_mcp/config.py') }}
|
|
64
|
+
- run: uv sync
|
|
65
|
+
- run: uv run pytest -q -m slow
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
# `published` also fires for a pre-release, and that is deliberate: PyPI
|
|
6
|
+
# understands PEP 440 pre-release versions natively and `pip install`
|
|
7
|
+
# skips them unless the user passes `--pre`, so shipping 0.2.0rc1 costs a
|
|
8
|
+
# version number and reaches only people who asked for it. Gating them off
|
|
9
|
+
# would mean the rc is only ever tested by the maintainer. The version
|
|
10
|
+
# check below is what keeps a pre-release honest: the tag and
|
|
11
|
+
# pyproject.toml must still agree.
|
|
12
|
+
types: [published]
|
|
13
|
+
# Re-running a failed publish. The version check below is ref-based, so this
|
|
14
|
+
# is only usable from a tag — a dispatch from a branch fails the run.
|
|
15
|
+
# Prefer "Re-run failed jobs" on the original release run; see the README.
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
# Nothing is granted by default; the publish job opts into the one token it needs.
|
|
19
|
+
permissions: {}
|
|
20
|
+
|
|
21
|
+
# Two runs for the same project must not upload concurrently: a partial upload
|
|
22
|
+
# racing a retry is exactly how a version ends up half-published. Never cancel
|
|
23
|
+
# in flight — an upload interrupted mid-file is worse than one that waits.
|
|
24
|
+
concurrency:
|
|
25
|
+
group: publish-pypi
|
|
26
|
+
cancel-in-progress: false
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build:
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read # actions/checkout
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: astral-sh/setup-uv@v6
|
|
36
|
+
with:
|
|
37
|
+
enable-cache: true
|
|
38
|
+
|
|
39
|
+
# ci.yml triggers on branch pushes, pull_request, dispatch and schedule —
|
|
40
|
+
# a tag push matches none of them, and nothing requires a release's commit
|
|
41
|
+
# to be an ancestor of a branch that has a green run. So a release cut
|
|
42
|
+
# from an untested commit would otherwise publish, permanently. This is
|
|
43
|
+
# the release gate, not a second CI: one leg on the project's development
|
|
44
|
+
# interpreter. Proving the code works on every OS and Python version is
|
|
45
|
+
# ci.yml's job, on the branch, before the tag exists.
|
|
46
|
+
- run: uv sync
|
|
47
|
+
- run: uv run ruff check src tests
|
|
48
|
+
- run: uv run pytest -q
|
|
49
|
+
|
|
50
|
+
- run: uv build
|
|
51
|
+
|
|
52
|
+
# What this actually gives us, verified against twine 7.0.0: the
|
|
53
|
+
# distribution metadata parses and is valid (an unparseable Requires-Dist
|
|
54
|
+
# fails it), and `--strict` turns a missing or empty long_description into
|
|
55
|
+
# a non-zero exit instead of a warning.
|
|
56
|
+
#
|
|
57
|
+
# What it does NOT give us: any validation of the README itself. This
|
|
58
|
+
# project declares `readme = "README.md"` → text/markdown, and
|
|
59
|
+
# readme_renderer only validates reStructuredText — a deliberately
|
|
60
|
+
# mangled README.md passes this step. Do not read it as README coverage.
|
|
61
|
+
#
|
|
62
|
+
# Pinned to a major: this is a release gate, and an unbounded `uvx twine`
|
|
63
|
+
# would let its behaviour change with no commit to this repository.
|
|
64
|
+
- run: uvx twine@7 check --strict dist/*
|
|
65
|
+
|
|
66
|
+
- name: Assert both distributions were built
|
|
67
|
+
run: |
|
|
68
|
+
shopt -s nullglob
|
|
69
|
+
sdists=(dist/*.tar.gz)
|
|
70
|
+
wheels=(dist/*.whl)
|
|
71
|
+
if [ ${#sdists[@]} -ne 1 ] || [ ${#wheels[@]} -ne 1 ]; then
|
|
72
|
+
echo "expected exactly one sdist and one wheel, got: ${sdists[*]} ${wheels[*]}" >&2
|
|
73
|
+
exit 1
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# A tag that disagrees with pyproject.toml is how the wrong artifact gets
|
|
77
|
+
# published under a right-looking release; there is no way to unpublish it.
|
|
78
|
+
#
|
|
79
|
+
# This check is ref-based and unconditional, deliberately. Keying it on
|
|
80
|
+
# `github.event_name == 'release'` would skip it on workflow_dispatch —
|
|
81
|
+
# and dispatch accepts any ref, so a feature branch whose version was
|
|
82
|
+
# already bumped could publish unfinished code under the next version
|
|
83
|
+
# number, unreclaimably. Since a branch carries no version to check a
|
|
84
|
+
# build against, a dispatch from a branch must fail rather than publish.
|
|
85
|
+
- name: Assert the built version matches the tag being released
|
|
86
|
+
env:
|
|
87
|
+
# `github.ref` is the unambiguous form — `refs/tags/v1.2.3` on a
|
|
88
|
+
# release and on a tag dispatch, `refs/heads/<branch>` otherwise —
|
|
89
|
+
# and `github.ref_name` is the same thing with the prefix stripped.
|
|
90
|
+
REF: ${{ github.ref }}
|
|
91
|
+
REF_NAME: ${{ github.ref_name }}
|
|
92
|
+
run: |
|
|
93
|
+
case "$REF" in
|
|
94
|
+
refs/tags/*) ;;
|
|
95
|
+
*)
|
|
96
|
+
echo "refusing to publish from non-tag ref '${REF}'." >&2
|
|
97
|
+
echo "a branch has no version to check the build against, so publishing" >&2
|
|
98
|
+
echo "from one would upload whatever 'version =' happens to say at that" >&2
|
|
99
|
+
echo "commit — and a PyPI version number can never be reused." >&2
|
|
100
|
+
echo "re-run this workflow from a v* tag instead, or better, use" >&2
|
|
101
|
+
echo "'Re-run failed jobs' on the original release run." >&2
|
|
102
|
+
exit 1
|
|
103
|
+
;;
|
|
104
|
+
esac
|
|
105
|
+
wheel=$(basename dist/*.whl)
|
|
106
|
+
version=${wheel#*-}
|
|
107
|
+
version=${version%%-*}
|
|
108
|
+
expected=${REF_NAME#v}
|
|
109
|
+
if [ "$version" != "$expected" ]; then
|
|
110
|
+
echo "built version '$version' does not match tag '$REF_NAME'" >&2
|
|
111
|
+
echo "bump the version in pyproject.toml, or retag" >&2
|
|
112
|
+
exit 1
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# Installing from the wheel into an empty venv is the only check that the
|
|
116
|
+
# packaged distribution — not the source tree — has a working entry point.
|
|
117
|
+
- name: Smoke-test the installed console script
|
|
118
|
+
run: |
|
|
119
|
+
uv venv /tmp/smoke
|
|
120
|
+
VIRTUAL_ENV=/tmp/smoke uv pip install dist/*.whl
|
|
121
|
+
/tmp/smoke/bin/minirag-mcp status --base-dir .
|
|
122
|
+
|
|
123
|
+
- uses: actions/upload-artifact@v4
|
|
124
|
+
with:
|
|
125
|
+
name: dist
|
|
126
|
+
path: dist/
|
|
127
|
+
|
|
128
|
+
# Separate job so every check above runs with no credentials at all. The
|
|
129
|
+
# `pypi` environment restricts deployments to `v*` tags, so a run that somehow
|
|
130
|
+
# reached this job from any other ref cannot obtain the OIDC token. It has no
|
|
131
|
+
# required reviewer: adding one in Settings → Environments → pypi is a
|
|
132
|
+
# one-click hardening that turns the upload into a manual approval, but the
|
|
133
|
+
# gate as configured today is the ref restriction, not a human.
|
|
134
|
+
publish:
|
|
135
|
+
needs: build
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
environment: pypi
|
|
138
|
+
permissions:
|
|
139
|
+
id-token: write # trusted publishing: OIDC in place of an API token
|
|
140
|
+
steps:
|
|
141
|
+
- uses: actions/download-artifact@v4
|
|
142
|
+
with:
|
|
143
|
+
name: dist
|
|
144
|
+
path: dist/
|
|
145
|
+
# The action ref is a moving branch, which is PyPA's own documented
|
|
146
|
+
# recommendation: an upload path is where you want a security fix to
|
|
147
|
+
# arrive without a commit here. The tradeoff — the step's behaviour can
|
|
148
|
+
# change under us — is accepted for this one action and rejected for
|
|
149
|
+
# everything else in this file.
|
|
150
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
151
|
+
with:
|
|
152
|
+
# The action uploads all of dist/ in one call and does not roll back:
|
|
153
|
+
# if the sdist lands and the wheel then fails, every retry re-uploads
|
|
154
|
+
# the same sdist filename, gets 400 "File already exists", and exits
|
|
155
|
+
# before reaching the wheel — leaving the version stuck sdist-only
|
|
156
|
+
# forever. This flag is exactly that case: skip what is already there
|
|
157
|
+
# and upload the rest, so a retry is idempotent.
|
|
158
|
+
skip-existing: true
|