aaronsb_obsidian-mcp-plugin/Makefile
Aaron Bockelie f1cc9d63ba feat(scorecard): scheduled regression gate vs committed baseline (#165)
Standalone weekly watch (+ workflow_dispatch) that FAILS only on a real
portal regression vs scripts/scorecard-baseline.json:
- Health/Review score-ratio downgrade
- automated issue count increase
- a new behaviour/permission ("**Title**:") finding

Never inspects advisory wording — structured deltas only. Scraper drift
→ exit 3, reported distinctly (fix scorecard.mjs, not a regression).
Portal unreachable → exit 0 (inconclusive, never a false fail). Gates
nothing in the release path; no PR/release triggers; no dependency
install (Node builtins only).

`make scorecard-gate` runs it; `make scorecard-baseline` re-snapshots
deliberately (refuses on drift) — a named act, since an accidental
re-baseline silently disarms the gate. Baseline captured for 0.11.25
(Health Excellent 4/4, Review Satisfactory 3/4, 5 issues, 12 findings)
— still shows Dynamic Code Execution; it clears (an improvement, not a
fail) when a post-ADR-201 release is scanned.

Validated: happy path exit 0, simulated regression exit 1 (all 3
classes), drift refusal, idempotent re-baseline.

Closes #165
2026-05-16 23:42:05 -05:00

104 lines
3.6 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 + workers + 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