Skip to content

Add brief scan integration for research tooling detection - #233

Merged
andrew merged 3 commits into
mainfrom
brief-integration
Aug 24, 2026
Merged

Add brief scan integration for research tooling detection#233
andrew merged 3 commits into
mainfrom
brief-integration

Conversation

@andrew

@andrew andrew commented Aug 24, 2026

Copy link
Copy Markdown
Member

Adds a brief jsonb column on projects, a fetch_brief sync method that shells out to brief -json -depth 1 <clone_url> (bounded by a 120s timeout) and stores the trimmed output, and a check_research_tooling signal in ScienceScoreCalculator.

The check reads brief.tools[*].taxonomy.domain for research/bioinformatics/scientific-computing/high-performance-computing and falls back to name-matching against known research tools (Snakemake, Nextflow, nf-core, MultiQC, Dockstore, Quarto, DVC, targets, ASV, Fortitude, Jupyter, and the R/Julia package tooling clusters) for detectors that don't yet carry a domain tag.

fetch_brief is not called from the main sync loop since a shallow clone per project is too heavy for the shared worker. rake projects:fetch_brief populates it at a controllable rate (LIMIT env var, default 100). Failed scans store {error, attempted_at} so they don't block the backfill queue. The has_research_tooling scoring weight is 0 until that starts running.

Dockerfile installs brief 0.12.0 from GitHub releases.

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.

Pull request overview

Adds support for ingesting brief scanner output into Project records and uses it to surface a (currently zero-weight) “research tooling” signal in ScienceScoreCalculator, with a rake task for controlled backfilling and container support for installing the brief binary.

Changes:

  • Add projects.brief (jsonb) plus a Project::Sync#fetch_brief method to populate a trimmed subset of brief output.
  • Add ScienceScoreCalculator#check_research_tooling with taxonomy-domain detection and tiered name-based fallback.
  • Add tests for fetch_brief and check_research_tooling, plus a projects:fetch_brief rake task and Docker installation for brief.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/services/science_score_calculator_test.rb Adds coverage for research-tooling detection via taxonomy domain and name-tier fallback.
test/models/project_sync_test.rb Adds coverage for fetch_brief success/trim behavior and error/early-return cases.
lib/tasks/projects.rake Adds projects:fetch_brief backfill task with LIMIT control.
Dockerfile Installs the brief binary from GitHub releases during image build.
db/schema.rb Reflects new projects.brief jsonb column.
db/migrate/20260824152455_add_brief_to_projects.rb Migration adding brief jsonb column to projects.
app/services/science_score_calculator.rb Adds check_research_tooling and includes it in the breakdown (weight currently 0.0).
app/models/concerns/project/sync.rb Adds fetch_brief implementation using Open3.capture3 and trimmed JSON persistence.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Dockerfile
@andrew
andrew force-pushed the brief-integration branch from 20d6d13 to 9f0eaa1 Compare August 24, 2026 16:05
@andrew
andrew marked this pull request as ready for review August 24, 2026 16:08
andrew added 3 commits August 24, 2026 17:15
Adds a brief jsonb column, Project::Sync#fetch_brief which shells
out to 'brief -json -depth 1 <clone_url>' and stores languages/
package_managers/tools/resources/manifests/lines (dropping the
heavy dependencies/git/stats blocks), and
ScienceScoreCalculator#check_research_tooling which reads
brief.tools[*].taxonomy.domain against research/bioinformatics/
scientific-computing/high-performance-computing, falling back to
name matching against known research tools in three tiers.

fetch_brief is not called from sync (shallow clone per sync is
too heavy); a projects:fetch_brief rake task runs it against
LIMIT projects with brief IS NULL AND science_score > 0.
has_research_tooling weight is 0 until brief data is populated.

Dockerfile installs the brief linux binary from GitHub releases
(BRIEF_VERSION=0.11.0).
Wrap the brief invocation in 'timeout -k 10 120' so a stalled
clone cannot hang the sequential rake task. On non-zero exit,
timeout, or parse failure, store {error, attempted_at} in the
brief column so where(brief: nil) skips the row on the next
backfill run instead of retrying the same failures forever.
check_research_tooling reports the scan error in details but
scores absent.
Includes the research tool detectors (Snakemake, Nextflow, nf-core,
MultiQC, Dockstore, DVC, Quarto, Jupyter, targets, ASV, Fortitude,
R/Julia tooling) and taxonomy.domain tags on Snakemake, Nextflow,
nf-core, MultiQC and targets.
@andrew
andrew force-pushed the brief-integration branch from 9f0eaa1 to fd574c8 Compare August 24, 2026 16:15
@andrew
andrew merged commit 12746b9 into main Aug 24, 2026
4 checks passed
@andrew
andrew deleted the brief-integration branch August 24, 2026 16:16
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