Skip to content

Audit: security hardening, claim accuracy, MCP batch tool and npm publishing - #24

Merged
alphasafal merged 8 commits into
mainfrom
audit/launch-hardening
Oct 29, 2026
Merged

alphasafal merged 8 commits into
mainfrom
audit/launch-hardening

Conversation

@alphasafal

Copy link
Copy Markdown
Owner

Linked issue

Audit of the 0.4.0 release before the next version; no single issue. Findings are listed below so they can be split into issues if preferred.

What and why

A full review of the extension, the core heuristics, the MCP server, CI and the docs, with fixes for everything confirmed. Six commits, one concern each:

  1. Security hardening — claim detection ignores HTML comments and collapsed <details> (a hidden "I'll take this" faked a claim); comment text can no longer forge a --- @user (project team) header or close the <thread> tag in the transcript agents and on-device AI read; safeHref is limited to github.com hosts.
  2. MCP for agents — check_issues (up to 10 issues per call), detail: "brief" (verdict + URL, ~40 tokens), numbers rounded to one decimal, a duplicated field dropped, install path npx -y contri-mcp, version 0.2.0.
  3. CI — actions pinned to commit SHAs, CI builds the MCP server, new publish-mcp.yml publishes to npm with provenance on mcp-v* tags (one-time trusted-publisher setup on npmjs.com, see the workflow header).
  4. Core fixes — "@bob is already working on this" no longer claims for the commenter; "Is anyone working on this? If not, I'd like to take it" is a claim; "can't finish this week" is a delay, not a release; a foreign-repo open PR no longer makes an issue "Open PR #n"; anonymous Overview flags a capped merge sample; the "Anonymous mode" note no longer cuts the cache TTL to a third; a newcomer never joins an aborted in-flight job; "last four weeks" is 28 days; no comment request for zero-comment issues.
  5. Content script — orphaned badges removed when badges are turned off; the panel takes focus when opened and Escape stops at the panel; launcher position saved once per movement; Prompt API uses measureContextUsage/contextWindow; Firefox package gets options_ui so Settings is reachable.
  6. Changelog.

Type of change

  • Bug fix
  • New feature or improvement
  • Documentation or website only

Evidence

Before → after on main (probe run against src/core/claims.ts):

Input main this branch
@bob is already working on this, see #45 claim ✗ not a claim ✓
Is anyone working on this? If not, I'd like to take it. not a claim ✗ claim ✓
I can't finish this week, will continue next week release ✗ delay ✓
<!-- I'd like to work on this --> claim ✗ not a claim ✓

Anonymous overview with a full page of 100 closed PRs of which 70 merged: sample.limited was false, now true with the "100 most recently updated" warning.

MCP payloads measured over stdio: tools/list 8 tools; check_issue full ≈ 230–470 tokens, detail: "brief" ≈ 40; repo_health no longer sends averageHours: 4.360079365079365.

Firefox package manifest now contains "options_ui": {"page": "settings.html", "open_in_tab": true} and no options_page.

Tests

  • I added or updated tests: tests/unit/claims.test.ts (hidden text, third-party "working on", question-then-claim, delays, release-and-claim, foreign open PR); tests/unit/reports.test.ts (forged transcript header, capped REST sample); tests/unit/core.test.ts (safeHref hosts, cache policy notes, 28-day window); mcp/tests/mcp.test.ts (brief detail, check_issues, tidy); tests/e2e/extension.spec.ts (panel focused on open).

How I verified it

  • npm run check passes (format, lint, docs links, 175 unit tests, build, build:mcp)
  • npm run test:e2e passes (21 passed, 3 skipped)
  • Tried it in Chrome on a real repository: not from this environment — the MCP server was exercised live against alphasafal/contri over stdio instead.

AI assistance

  • AI tools were used: Claude Code — audit (four parallel reviews), code, tests, this description.
  • I reviewed every changed line and can explain it
  • I ran the commands above myself and the results are real

Notes for reviewers

  • Request cost: no new requests; zero-comment issues now cost one request less anonymously, and anonymous Team/Discover reports are refetched 3× less often.
  • publish-mcp.yml needs the one-time trusted-publisher link on npmjs.com before the first mcp-v0.2.0 tag; until then npx contri-mcp in the READMEs will not resolve.
  • Not changed, worth a follow-up: the Prompt API ("How do I start?") is only exposed to github.com pages from Chrome 148; on 138–147 it works in extension pages only, so an offscreen document would bring it back for those versions (needs the offscreen permission).

Generated by Claude Code

- Claim detection ignores HTML comments and collapsed <details>, so hidden
  text cannot fake a claim or a release.
- Comment text cannot forge a '--- @user (project team)' transcript header
  or close the <thread> tag read by on-device AI and check_issue.
- safeHref accepts only https links on github.com and its subdomains.
…mbers

- check_issues checks up to 10 issues in one call, verdicts only by default.
- detail: "brief" on check_issue returns the verdict and URL (~40 tokens).
- Fractional hours are rounded to one decimal; repo_health no longer sends
  sample.from twice.
- Install path is npx contri-mcp; version 0.2.0.
…mcp to npm

Adds publish-mcp.yml (mcp-v* tags, npm provenance via trusted publishing).
…che TTL and 28-day window

- Claims: first-person only for 'working on', drop the 'is anyone working
  on' question before judging, delays are not releases, release-and-claim
  comments count as claims, fewer verb false positives.
- Verdict and watch: only this repository's open PRs make an issue busy.
- Overview (REST): a full closed-PR page marks the merge sample limited.
- Cache policy: 'Anonymous mode' notes are not coverage warnings.
- Worker: never join an already-aborted in-flight job.
- Metrics: weekly buckets counted back from now; last four weeks = 28 days.
- Insight (REST): skip the comment request for issues with no comments.
…ptions_ui

- Badges are removed when turned off or when leaving a repository.
- The panel takes focus when opened; Escape stops at the panel; the
  launcher position is saved once per movement.
- Prompt API: measureContextUsage/contextWindow with the old names as
  fallback, so long threads fit the real context window.
- Firefox package rewrites options_page to options_ui.
Copilot AI balanced review requested due to automatic review settings October 29, 2026 16:48
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
contri Ready Ready Preview Oct 29, 2026 5:05pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…, shorter MCP descriptions

- setPrefs broadcasts a badge-mode change to open GitHub tabs.
- education, team, join, premium-support, watching are reserved paths.
- A later 'disconnected' timeline event cancels 'connected'.
- watchAdd seeds the snapshot by URL, not issue number.
- Settings: preference save errors are shown; token form order fixed.
- Worker: initializeAuth and notifications.create rejections handled.
- Tabs use role=tablist/tab with aria-selected.
- MCP: tool and parameter descriptions trimmed.
- Extension and manifest 0.5.0; changelog section titled.
- mcp/server.json and mcpName for the official MCP Registry; the
  publish workflow lists the server there after npm (GitHub OIDC).
- README: Firefox needs the github.com permission allowed once.
- LAUNCH.md: agent-audience post, the 'Before you start' snippet for
  other projects, and the MCP directories to list in.
@alphasafal
alphasafal merged commit ac631f9 into main Oct 29, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — eb913f39 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants