fix(signals): count focused validation runs as passing evidence - #1912
Conversation
A LocalBranchValidation with status "focused" is a green subset run (e.g. `vitest run path/to/file.test.ts`). The PR-packet validation summary (summarizeValidation), the freshness evidence list (validationEvidence), and pr-body-draft already count it as passing, but two surfaces matched only "passed": - local-workspace-intelligence's passedValidationCount, so a focused-only run collapsed testEvidence.level to "none" instead of "validation_commands". - the validation_as_test_evidence local finding, which never fired for a focused run. Single-source the predicate as isPassingValidation and route all four sites through it so the surfaces cannot drift again. Adds a direct helper test plus regressions through buildLocalBranchAnalysis and buildLocalWorkspaceIntelligence. No issue because issue creation is restricted on this repo; this is a small, self-evident consistency fix in pure signal logic with no schema or API change.
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-30 22:35:07 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
JSONbored
left a comment
There was a problem hiding this comment.
I'd prefer
The only notable maintainability concern is that the helper now lives in a broad module and is imported as a runtime value by another signals module, which may be worth isolating if these modules already depend on each other.
Summary
A local validation command with
status: "focused"is a green run of a subset of tests (e.g.vitest run path/to/file.test.ts). The PR-packet validation summary (summarizeValidation), the freshness evidence list (validationEvidence), andservices/pr-body-draft.tsalready count a focused run as passing evidence — but two surfaces still matched only"passed", so the same focused run was credited or dropped depending on where you looked:src/signals/local-workspace-intelligence.tspassedValidationCountcounted only"passed", so a focused-only run collapsedtestEvidence.levelto"none"instead of"validation_commands".src/signals/local-branch.ts— thevalidation_as_test_evidencelocal finding fired on.some(status === "passed")only, so it never surfaced for a focused run.This single-sources the rule as an exported
isPassingValidation(entry)predicate ("passed" || "focused") and routes all four sites through it, so the evidence surfaces agree by construction and cannot drift apart again. Pure deterministic signal logic — no schema, OpenAPI, or API change.No issue because issue creation is restricted on this repo for outside accounts; this is a small, self-evident consistency fix.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/signals/**, so the UI / MCP-package / OpenAPI / workers-pool steps are not exercised by the diff and were not run locally (the local Windows working tree has pre-existing, unrelated failures from CRLF line endings and missing optional CLI binaries that do not occur in CI's Linux environment). CI runs the fullvalidatematrix on a clean checkout. The changed lines and both branches of the new predicate are fully covered by the added tests.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots. — N/A: no visible UI change.Notes
isPassingValidation(coveringpassed,focused, and the non-passing statuses) plus regression tests throughbuildLocalBranchAnalysisandbuildLocalWorkspaceIntelligencethat assert a focused run yieldspassedValidationCount === 1,testEvidence.level === "validation_commands", and thevalidation_as_test_evidencefinding.