Skip to content

fix(mcp): build gittensory-engine before the publish gate + switch to workflow_dispatch - #4135

Merged
JSONbored merged 3 commits into
mainfrom
fix/npm-publish-engine-build-and-dispatch
Jul 8, 2026
Merged

fix(mcp): build gittensory-engine before the publish gate + switch to workflow_dispatch#4135
JSONbored merged 3 commits into
mainfrom
fix/npm-publish-engine-build-and-dispatch

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • npm-publish.yml never built @jsonbored/gittensory-engine before running the MCP release validation gate, unlike ci.yml. That package's dist/ is gitignored, so every publish attempt fails the moment the test suite imports src/mcp/find-opportunities.ts (transitively pulls in gittensory-engine via gittensory-miner's opportunity-fanout.js).
  • Reproduced live today: pushing the mcp-v0.7.0 tag triggered the workflow, which failed at the "MCP release validation gate" step — before the tarball/publish steps, so nothing was published to npm.
  • Also switches the trigger from push: tags: to workflow_dispatch, needed for the release-automation follow-up (a GITHUB_TOKEN-created tag doesn't fire push-triggered workflows). Version/tag are now resolved from the dispatched commit's package.json rather than the tag ref; the tag is created if it doesn't already exist (self-tag, matching the old manual flow) or verified to point at HEAD if it does.

Test plan

  • npm run actionlint — clean
  • Reproduced the exact CI failure locally by removing packages/gittensory-engine/dist and confirming require("@jsonbored/gittensory-engine") fails the same way; confirmed npm run build --workspace @jsonbored/gittensory-engine resolves it
  • After merge: manually dispatch this workflow against main to complete the stalled mcp-v0.7.0 publish (tag already exists, points at the merged v0.7.0 commit)

… workflow_dispatch

The MCP release validation gate imports src/mcp/find-opportunities.ts transitively
(via gittensory-miner's opportunity-fanout.js), which needs @jsonbored/gittensory-engine's
gitignored dist/ built first -- ci.yml already has this step, npm-publish.yml never did,
so every publish attempt failed before reaching npm (reproduced today on the mcp-v0.7.0 tag;
nothing was published).

Also switches the trigger from push:tags: to workflow_dispatch, since a GITHUB_TOKEN-created
tag (from the release automation landing next) won't fire a push-triggered workflow. The
version/tag are now resolved from the dispatched commit's package.json instead of the tag ref.

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 2 security concern(s).

Comment thread .github/workflows/npm-publish.yml
Comment thread .github/workflows/npm-publish.yml Outdated
@superagent-security superagent-security Bot added the pr:flagged PR flagged for review by security analysis. label Jul 8, 2026
Splits the single publish job into an unprivileged validate job (contents:
read, runs npm ci/build/test:release:mcp/pack) and a privileged publish job
(contents: write, id-token: write, environment: release) that only downloads
the already-tested tarball and publishes it -- no dependency install/build
ever runs with write or OIDC-token access (P2: a compromised build
dependency could otherwise abuse contents:write to push arbitrary tags).

Also gates the publish job behind the existing `release` GitHub environment
(same one release-selfhost.yml already uses), requiring reviewer approval
per repo Settings > Environments before a real npm publish can run (P1: a
workflow_dispatch trigger has no branch/tag restriction on its own).

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 1 security concern(s).

Comment thread .github/workflows/npm-publish.yml Outdated
@JSONbored JSONbored self-assigned this Jul 8, 2026
grep -E without -q prints the matching line to stdout before the if
condition even evaluates it, so a real secret accidentally packaged into
the tarball would get echoed straight into the (world-readable) Actions
log by the very step meant to catch it. -q keeps the exit-code check,
drops the echo.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@superagent-security superagent-security Bot removed the pr:flagged PR flagged for review by security analysis. label Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.71%. Comparing base (06689bc) to head (fdf847d).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4135   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files         385      385           
  Lines       36197    36197           
  Branches    13264    13264           
=======================================
  Hits        33921    33921           
  Misses       1618     1618           
  Partials      658      658           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 8, 2026
@loopover-orb

loopover-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 07:40:45 UTC

1 file · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unknown

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR fixes a real, reproduced bug: npm-publish.yml never built @​jsonbored/gittensory-engine before running test:release:mcp, so every publish attempt failed at the validation gate before anything reached npm (confirmed by the stalled mcp-v0.7.0 tag). It also switches the trigger to workflow_dispatch (required since GITHUB_TOKEN-created tags don't fire push triggers) and splits the job into an unprivileged validate job (build/test/pack/smoke-test, contents: read only) and a privileged publish job (environment: release, contents: write + id-token: write) that publishes the exact tarball artifact validate already tested. The permission split, tag create-vs-verify handoff between the two jobs, and version/tag propagation via job outputs are all internally consistent and correctly scoped.

Nits — 6 non-blocking
  • The tag-existence check is duplicated almost verbatim between the validate job's 'Resolve release version' step and the publish job's 'Create or verify release tag' step — worth a shared shell function or composite action if this workflow gets touched again.
  • Superagent Security Scan is failing with 'PR requires security review' given the new contents: write/id-token: write escalation and environment: release gate — make sure that manual security review actually happens before merging, since CI won't block it for you.
  • No linked issue in the PR description per repo convention for contributor PRs, though this reads as a maintainer hotfix for a live, reproduced failure rather than unsolicited feature work.
  • Consider factoring the tag-existence check (.github/workflows/npm-publish.yml, both in 'Resolve release version' and 'Create or verify release tag') into one reusable step/script to avoid drift between the two copies.
  • Explicitly confirm in the PR or a follow-up comment that the 'release' GitHub environment has reviewer-approval protection configured in repo settings, since the whole privilege-separation design depends on that being true and it isn't visible from the diff.
  • Diff looks like trivial or whitespace-only churn — Reduce whitespace-only or formatting-only churn and keep the diff focused on substantive changes.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 52 registered-repo PR(s), 43 merged, 496 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 52 PR(s), 496 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 52 PR(s), 496 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 8, 2026
@JSONbored
JSONbored merged commit acddda9 into main Jul 8, 2026
10 checks passed
@JSONbored
JSONbored deleted the fix/npm-publish-engine-build-and-dispatch branch July 8, 2026 07:40
JSONbored added a commit that referenced this pull request Jul 8, 2026
#4135 (fix(mcp): build gittensory-engine before the publish gate + switch
to workflow_dispatch) merged after PR #4132 originally generated this
changelog, and it's classified as a direct MCP-relevant commit (touches
.github/workflows/npm-publish.yml), so changelog:check:mcp correctly
flagged the committed file as stale relative to the new mcp-v0.6.0..HEAD
range. Regenerated -- 251 commits now, one new line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

1 participant