Skip to content

test(miner-discovery): end-to-end fixture-driven discovery scenario across the full Phase 1 pipeline#4416

Closed
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:test/miner-discovery-pipeline
Closed

test(miner-discovery): end-to-end fixture-driven discovery scenario across the full Phase 1 pipeline#4416
joaovictor91123 wants to merge 1 commit into
JSONbored:mainfrom
joaovictor91123:test/miner-discovery-pipeline

Conversation

@joaovictor91123

Copy link
Copy Markdown
Contributor

Summary

  • Closes test(miner-discovery): end-to-end fixture-driven discovery scenario across the full Phase 1 pipeline #2311 by adding one integration-shaped test that exercises the full Phase 1 miner-discovery pipeline end-to-end against fixture data: AI-policy hard-skip, GitHub fan-out, goal-model lane-fit, and opportunity ranking, composed in a single realistic scenario.
  • test/integration/miner-discovery-pipeline.test.ts builds a 6-repo candidate batch (fetchCandidateIssuesWithSummary) and ranks it (rankMetadataOpportunities): one AI-PR-banned repo (fully excluded, costing exactly one policy-doc fetch and zero issue-listing calls), one with no .gittensory-miner.yml (neutral goal-model default, doesn't error), one matching the repo's preferredLabels (ranks highest), one matching the repo's blockedPaths (collapses to zero via the goal-model short-circuit), one stale issue (ranks lower via the freshness factor), and one repo contributing two title-overlapping issues (ranks lower via the in-batch duplicate-risk signal).
  • Asserts the exact final ranked order as a literal array of owner/repo#issueNumber (not a "contains" check), plus the isolated laneFit/freshness/dupRisk value behind each differentiator, so a future refactor of any one module's weights/matching logic that breaks the composed behavior fails this test even if every per-module unit suite still passes.
  • Reuses the existing AI-policy fixture corpus (test/fixtures/ai-policy/banned-ai-usage.md, allowed-silent.md) and the established vi.stubGlobal("fetch", ...) call-counting pattern from test/unit/opportunity-fanout-ai-policy.test.ts.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes. Test-only: one new file under test/integration/.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint — not run; no workflow files touched.
  • npm run typecheck (clean)
  • Focused vitest run across the new file plus every existing unit suite for the modules it composes (opportunity-fanout, ai-policy-map, miner-goal-lane-fit, opportunity-ranker, opportunity-metadata-signals, opportunity-freshness): 137/137 tests pass. This is a test-only change under test/integration/, which Codecov's codecov/patch gate does not count, so there is no line/branch coverage obligation for this diff.
  • npm run test:workers — not run; no Cloudflare Worker code touched.
  • npm run build:mcp / npm run test:mcp-pack — not run; unrelated to this change (also currently fail locally on this Windows machine for an unrelated, pre-existing spawnSync("npm", ...) reason, independent of this diff).
  • npm run ui:openapi:check / ui:lint / ui:typecheck / ui:build — not run; no apps/gittensory-ui files touched.
  • npm audit --audit-level=moderate — not run; no dependency changes.
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries. This PR is the added test.

If any required check was skipped, explain why:

  • This is a test-only addition with zero production code changes, so the UI/MCP/miner-pack/actionlint/audit checks above are inapplicable to the diff; the ones actually exercised (typecheck, targeted test run across every touched module, git diff --check) are green.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session behavior is not changed.
  • API/OpenAPI/MCP behavior is not changed.
  • No visible UI changes; UI evidence is not applicable.
  • Public docs/changelogs are not changed.

UI Evidence

Not applicable; test-only change.

Notes

  • Test-only change in test/integration/miner-discovery-pipeline.test.ts.

@superagent-security

Copy link
Copy Markdown
Contributor

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

@philluiz2323

Copy link
Copy Markdown
Contributor

Closing: while this was in flight, #2311 was already resolved by #3756 (merged), which lands a file at the exact same path (test/integration/miner-discovery-pipeline.test.ts) covering the same scope. Duplicate, no longer needed.

@joaovictor91123

Copy link
Copy Markdown
Contributor Author

Closing: while this was in flight, #2311 was already resolved by #3756 (merged), which lands a file at the exact same path (test/integration/miner-discovery-pipeline.test.ts) covering the same scope. Duplicate, no longer needed.

@joaovictor91123
joaovictor91123 deleted the test/miner-discovery-pipeline branch July 9, 2026 16:56
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.

test(miner-discovery): end-to-end fixture-driven discovery scenario across the full Phase 1 pipeline

2 participants