aaronsb_obsidian-mcp-plugin/Makefile
Aaron Bockelie bf1aa6319a chore(worker): remove dormant worker-offload path (ADR-105, closes #197)
The worker-thread pool ratified/extended by ADR-104 has never executed a
single request since introduction (v0.5.8b, 22742bd): ConnectionPool's
action-level workerOps gate (tool.vault.search, …) never matched the
operation-level method strings the pool emits (tool.vault, tool.edit, …),
so processWithWorker was unreachable. Independently, the worker built to
dist/workers/workers/semantic-worker.js while WorkerManager loaded
dist/workers/semantic-worker.js — load would have failed anyway.

Verified dead against current main; no CPU-starvation field reports.
Fixing forward was rejected: it would ship an untested concurrency path
that widens the #139 parallel-edit race via a new TOCTOU window for an
unproven perf need (see #197 analysis).

- delete src/workers/semantic-worker.ts, src/utils/worker-manager.ts,
  build-worker.js; drop build:worker + the build-worker.js build step
- strip worker wiring from ConnectionPool (retained as a main-thread
  bounded queue — the only behaviour that ever ran) and the dead
  prepareWorkerContext/workerScript from mcp-server.ts
- ADR-105 records the removal as a partial reversal of ADR-104; ADR-104
  stays Accepted (SSE-route deconfliction half, shipped #196, still
  governs) with a banner pointing to ADR-105

Behaviour-preserving by construction: the deleted path never ran.
make check green (build + lint 0 errors + 225/225 tests).
2026-05-18 22:26:14 -05:00

104 lines
3.5 KiB
Makefile

.PHONY: help build dev test lint lint-fix check clean install \
release-patch release-minor release-major release publish promote sync-version mcpb scorecard set-description
MIN_OBSIDIAN := 1.6.6
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
# --- Development ---
install: ## Install dependencies
npm install
dev: ## Start dev mode (watch + rebuild)
npm run dev
build: ## Build plugin (typecheck + bundle)
npm run build
# --- Quality ---
lint: ## Run ESLint
npm run lint
lint-fix: ## Run ESLint with auto-fix
npm run lint:fix
test: ## Run test suite
npm test
check: build lint test ## Run all quality gates (build + lint + test)
# --- Release ---
# Full cycle: bump → sync → update versions.json → commit → push → trigger workflow
release-patch: ## Release patch (0.0.x) — check, bump, publish
$(MAKE) check
npm version patch --no-git-tag-version
$(MAKE) _update-versions-json
$(MAKE) _commit-and-publish
release-minor: ## Release minor (0.x.0) — check, bump, publish
$(MAKE) check
npm version minor --no-git-tag-version
$(MAKE) _update-versions-json
$(MAKE) _commit-and-publish
release-major: ## Release major (x.0.0) — check, bump, publish
$(MAKE) check
npm version major --no-git-tag-version
$(MAKE) _update-versions-json
$(MAKE) _commit-and-publish
publish: ## Trigger GitHub Actions release for current version
@VERSION=$$(jq -r .version package.json); \
echo "Publishing version $$VERSION..."; \
gh workflow run release.yml --field release_notes="$${RELEASE_NOTES:-}"
promote: ## Promote a release from prerelease to stable+Latest (defaults to current package.json version; override with TAG=X.Y.Z)
@TAG=$${TAG:-$$(jq -r .version package.json)}; \
echo "Promoting release $$TAG to stable + Latest..."; \
gh release edit "$$TAG" --prerelease=false --latest; \
echo "$$TAG is now the Latest release"
# Internal targets (not in help)
_update-versions-json:
@VERSION=$$(jq -r .version package.json); \
jq --arg v "$$VERSION" --arg m "$(MIN_OBSIDIAN)" '. + {($$v): $$m}' versions.json > versions.json.tmp && \
mv versions.json.tmp versions.json; \
echo "Updated versions.json with $$VERSION → $(MIN_OBSIDIAN)"
_commit-and-publish:
@VERSION=$$(jq -r .version package.json); \
git add package.json package-lock.json manifest.json mcpb/manifest.json src/version.ts versions.json; \
git commit -m "chore: Bump version to $$VERSION"; \
git push origin HEAD; \
echo "Triggering release for $$VERSION..."; \
gh workflow run release.yml --field release_notes="$${RELEASE_NOTES:-}"
# --- Utility ---
clean: ## Remove build artifacts
rm -rf main.js main.js.map dist/ obsidian-mcp-*.mcpb obsidian-mcp.mcpb
sync-version: ## Sync version + description from package.json to manifest.json, mcpb, version.ts
node sync-version.mjs
mcpb: ## Build MCPB bundle (obsidian-mcp-<version>.mcpb) for Claude Desktop
node scripts/build-mcpb.mjs
scorecard: ## Pull the Obsidian community portal scorecard + freshness delta (free post-release signal)
@node scripts/scorecard.mjs
scorecard-gate: ## Diff the live scorecard vs the committed baseline (exit 1 = regression, 3 = drift)
@node scripts/scorecard-gate.mjs
scorecard-baseline: ## DELIBERATELY re-snapshot scorecard-baseline.json (only after an ACCEPTED change; commit it)
@node scripts/scorecard-baseline.mjs
set-description: ## Set plugin description (SoT: package.json) + sync. Usage: make set-description DESC='...'
@node scripts/set-description.mjs "$(DESC)"
@node sync-version.mjs