fix: tier-check branch support and draft/extension scoring (#153)

* fix: pass --branch to tier-check CLI in tier-audit skill

The skill was not forwarding the --branch argument to the tier-check
CLI, causing policy signal checks to always run against the repo's
default branch. Files on feature branches showed as 'Not found.'

Now derives the branch from the local checkout if not explicitly
provided, and always passes it to the CLI.

* fix: exclude draft/extension scenarios from tier-scoring conformance rates

SEP-1730 says date-versioned scenarios count toward tier scoring while
draft and extension scenarios are informational. The CLI was including
all scenarios in pass_rate, causing extension-only failures to block
Tier 1.

Changes:
- pass_rate now only counts scenarios with at least one date-versioned
  spec version
- Terminal and markdown output split into a tier-scoring matrix
  (date-versioned + All*) and an informational section (draft/extension)
  that only renders when there are draft/extension scenarios
This commit is contained in:
Felix Weinberger 2026-02-17 13:09:31 +00:00 • committed by GitHub
commit 066b2d7080
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,15 @@ import {
listActiveClientScenarios,
getScenarioSpecVersions
} from '../../scenarios';
import { ConformanceCheck } from '../../types';
import { ConformanceCheck, SpecVersion } from '../../types';
const NON_SCORING_VERSIONS: SpecVersion[] = ['draft', 'extension'];
/** Whether a scenario counts toward tier scoring (has at least one date-versioned spec). */
function isTierScoring(specVersions?: SpecVersion[]): boolean {
if (!specVersions || specVersions.length === 0) return true; // unknown = count it
return specVersions.some((v) => !NON_SCORING_VERSIONS.includes(v));
}
/**
* Parse conformance results from an output directory.
@ -132,7 +140,16 @@ function reconcileWithExpected(
}
}
result.pass_rate = result.total > 0 ? result.passed / result.total : 0;
// pass_rate only counts tier-scoring scenarios (date-versioned, not draft/extension).
// passed/failed/total reflect ALL scenarios for full reporting; pass_rate and status
// reflect only tier-scoring scenarios for tier logic.
const tierDetails = result.details.filter((d) =>
isTierScoring(d.specVersions)
);
const tierPassed = tierDetails.filter((d) => d.passed).length;
const tierTotal = tierDetails.length;
result.pass_rate = tierTotal > 0 ? tierPassed / tierTotal : 0;
result.status =
result.pass_rate >= 1.0
? 'pass'