morluto/rea
+Browser exploration tool
+ 243,000 + 1,200 + 229,300 stars this week +diff --git a/.env.example b/.env.example index 3918540..42ea972 100644 --- a/.env.example +++ b/.env.example @@ -22,3 +22,6 @@ LLM_MODEL= ANTHROPIC_API_KEY= OPENAI_API_KEY= GEMINI_API_KEY= + +# Optional: number of repositories enriched through additional Web Data API calls (0–12; default 6) +GITHUB_METADATA_ENRICH_LIMIT=6 diff --git a/.github/workflows/research-quality-ci.yml b/.github/workflows/research-quality-ci.yml new file mode 100644 index 0000000..c27bf15 --- /dev/null +++ b/.github/workflows/research-quality-ci.yml @@ -0,0 +1,28 @@ +name: Research quality checks + +on: + pull_request: + paths: + - 'apps/backend/**' + - 'apps/shared/**' + - '.github/workflows/research-quality-ci.yml' + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - run: bun install --frozen-lockfile + - name: Build shared workspace + run: bun run --cwd apps/shared build + - name: Typecheck backend + run: bunx tsc --noEmit -p apps/backend/tsconfig.json + - name: Run research regression tests + run: bun run --cwd apps/backend test --runInBand --runTestsByPath src/features/research/research-insights.spec.ts src/features/github/github-parser.service.spec.ts diff --git a/README.md b/README.md index c0aae59..edd5630 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,17 @@ Keyword research can use: The LLM analyzes the normalized repository data and returns a research summary, recurring themes, notable repositories, and historical comparisons when previous matching runs exist. +### Research accuracy improvements + +- **Evidence-backed themes.** Each reported theme must have exact quotes from at least two current repositories and name its supporting repositories. The tool returns up to three themes and may return none rather than inventing connections. +- **Standout Trending activity.** Deterministic checks highlight dominant rolling period-star figures and unusually large changes in the rolling metric between saved snapshots. These are not the number of new stars earned between runs. +- **Recurring name clusters.** Terms shared by at least three repository names can be reported independently of the LLM, without claiming a shared cause. +- **More complete source data.** GitHub search attempts a second page when the first is full. Missing topics, descriptions, and fork counts can be filled by scraping a bounded subset of repository pages, while failures do not prevent the main report. +- **More dependable comparisons.** Historical runs are matched by research configuration, and overlapping repository counts and measured deltas are computed outside the LLM. Short comparison windows are described as diagnostic, not durable trends. +- **Richer exports.** The UI and Markdown reports include the standalone signals, name clusters, supported themes, and historical comparisons. + +Metadata enrichment can add up to six Web Data API requests per run by default. Set `GITHUB_METADATA_ENRICH_LIMIT=0` to disable it, or use a value between 1 and 12 to control the maximum number of additional repository requests. Pagination may add one more request in search-based modes. + ## Track GitHub repository research over time Any research configuration can be saved as a recurring monitor. @@ -260,6 +271,7 @@ The comparison describes each product's main workflow. These tools solve overlap | `MONGODB_URI` | MongoDB connection string | | `DECODO_AUTH_TOKEN` | Decodo Web Data API key, without the `Bearer` prefix | | `DECODO_SCRAPER_ENDPOINT` | Decodo scraping endpoint. The included default is normally sufficient | +| `GITHUB_METADATA_ENRICH_LIMIT` | Optional maximum repository-page metadata enrichment requests per run (default: 6; maximum: 12; 0 disables) | | `LLM_PROVIDER` | LLM provider: `claude`, `openai`, or `gemini` | | `LLM_MODEL` | Optional model override | | `ANTHROPIC_API_KEY` | Anthropic API key | diff --git a/apps/backend/src/features/github/github-parser.service.spec.ts b/apps/backend/src/features/github/github-parser.service.spec.ts new file mode 100644 index 0000000..36ff472 --- /dev/null +++ b/apps/backend/src/features/github/github-parser.service.spec.ts @@ -0,0 +1,76 @@ +import { GithubParserService } from './github-parser.service'; +import type { RepositorySnapshot } from './github.types'; + +describe('GitHub metadata extraction', () => { + const parser = new GithubParserService(); + + it('preserves a trending count expressed with comma separators', () => { + const repos = parser.parseTrending(`
Browser exploration tool
+ 243,000 + 1,200 + 229,300 stars this week +{report.executiveSummary}
{signal.message}
+Repeated terms in names, not evidence of a shared cause or wider adoption.
+{cluster.term} · {cluster.count} repositories
+{cluster.repositories.join(', ')}
+{topMover ? `${topMover.owner}/${topMover.name}` : 'Not available'}
{topMover?.periodStars !== undefined &&+{topMover.periodStars.toLocaleString()}
}> : <>{highestStarred ? `${highestStarred.owner}/${highestStarred.name}` : 'Not available'}
{highestStarred?.stars !== undefined &&{highestStarred.stars.toLocaleString()} stars
}>}{repositories.length}