feat(security): add CI, CodeQL, dependency review, and PR security checklist - #1
Merged
Merged
Conversation
…klist - CI pipeline: pytest matrix (Python 3.11, 3.12) on push/PR to master - CodeQL: static analysis on push/PR + weekly schedule - Dependency review: blocks PRs with high-severity vulns, denies AGPL/GPL-3.0 - OpenSSF Scorecard: continuous security posture monitoring with SARIF upload - Dependabot: weekly updates for pip and github-actions ecosystems - PR template: security review checklist for maintainer - SECURITY.md: vulnerability reporting policy - CONTRIBUTING.md: contribution guidelines - All GitHub Actions pinned to full commit SHA (not tags) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
…s modes DOM signals (sources, action buttons) appear mid-generation on Perplexity, causing research_query to scrape partial responses. Added three guards: - Min elapsed time before trusting DOM signals (45s research, 90s labs) - Min text length requirement (1500 chars) - 10s confirmation wait after DOM triggers to verify text stopped growing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
intellegix
pushed a commit
that referenced
this pull request
May 14, 2026
Two Claude Code sessions running /research-perplexity simultaneously produced the user-visible symptom "browsers kept canceling each other and trying." Forensic evidence on 2026-05-14 07:57 PDT: Session 2 spawned three Chrome temp profiles in sequence (council_np_nfeloa8y_ at +0s, wautgz7l_ at +4s = retry #1, 2ctuv7v_ at +58s = retry #2) for what should have been ONE logical query. Both sessions eventually returned valid synthesis (error: null), but the retry cascade is the symptom. Root cause (per /research-perplexity diagnosis, 129s deep query + 97s plan critique): the 4-second failure window is too fast for Cloudflare/rate-limit/WebSocket; matches Windows OS focus-acquisition timing. Session 2's chromium.launch_persistent_context (channel= "chrome", headless=False) calls SetForegroundWindow / BringWindow- ToTop during startup, stealing OS-level keyboard focus from Session 1's page.keyboard.type("/research") + press("Space") mid- keystroke. Wrong target receives keys; slash-command palette dismissed before commit; query submits in Search mode instead of Research; .prose comes back empty; server.js retry-once spawns new subprocess → new Chrome window. The amplifier: _verify_research_activation (and council/labs siblings) returned optimistic True even when the indicator couldn't be found, so the focus glitch turned into a silent bad-submission instead of a clean abort. Changes: 1. New file submission_lock.py — cross-process FileLock around the focus-sensitive submit critical section. Co-located with SessionSemaphore (~/.claude/config/browser-sessions/.perplexity_- submit.lock). Timeout scales with MAX_CONCURRENT_SESSIONS (max(120, MAX*30) → 240s at saturation, prevents tail starvation). 180s stale-mtime reclaim covers SIGKILL'd holders. 2. council_browser.py: PerplexityCouncil._acquire_submit_lock async helper wraps FileLock.acquire in asyncio.to_thread to avoid blocking the event loop. The submit critical section in run() (activate_mode + submit_query) is wrapped in try/finally with the lock acquired BEFORE activate_mode (the very first input click inside activate_mode is itself focus-sensitive and must be inside the lock). Released after submit_query returns (which already internally waits for .prose to appear, proving the submission landed). wait_for_completion runs OUTSIDE the lock — fully parallel across sessions. 3. council_browser.py: _verify_research_activation, _verify_council_- activation, _verify_labs_activation rewritten as 2-tier selector cascades. Tier 1: exact-text match on the activated mode pill. Tier 2: looser case-insensitive contains-scan tolerating Perplexity DOM tweaks. Both miss → SELECTOR_DRIFT_DETECTED at log level, return False (was: optimistic True). Caller in run() short-circuits cleanly on False with the existing artifact-save + error-return path. Step 6 plan critique ruled this hygiene on a shared bug class, not scope creep. Verification: - ast.parse council_browser.py + submission_lock.py clean - get_submit_lock() returns WindowsFileLock, timeout=240s, path=~/.claude/config/browser-sessions/.perplexity_submit.lock - council_browser imports clean; PerplexityCouncil._acquire_submit_lock attribute present; get_submit_lock symbol imported - test_parallel.py default suite 7/7 PASS (no regressions to existing SessionSemaphore + browser-launch tests) - LIVE concurrent-Claude verification deferred to next user-triggered two-session research_query — expected: 2 Chrome windows ~4s apart, no retry subprocess spawn, exactly 2 council_np_* temp dirs Plan: ~/.claude/plans/lexical-toasting-babbage.md (Step 6 APPROVED-WITH- CONDITIONS, all 5 conditions integrated). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All GitHub Actions are pinned to full commit SHA to prevent supply chain attacks via tag mutation.
Test plan
master(Phase 1 — manual GitHub UI)🤖 Generated with Claude Code