Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ structured evidence, and ship a `SKILL.md` edit only after a previously-failing
> **Phase 2 IN PROGRESS — F3 (`skillet doctor`, the $0 preflight) and F14 (`skillet run --axis
> trigger`, the deterministic description axis) shipped 2026-07-04; F15 (`skillet run --ab`, the
> provably skill-free baseline arm with paired Δ) shipped 2026-07-07; F16 (`skillet run --judge
> grounded-judge`, the file-contents grader) shipped 2026-07-08**
> grounded-judge`, the file-contents grader) shipped 2026-07-08; F17 (`skillet score`, free
> deterministic scorers over produced text → SARIF 2.1.0) shipped 2026-07-09**
> ([Specs/008](Specs/008-doctor-preflight/plan.md), [Specs/009](Specs/009-trigger-axis/plan.md),
> [Specs/010](Specs/010-ab-baseline/plan.md), [Specs/011](Specs/011-grounded-judge/plan.md)).
> [Specs/010](Specs/010-ab-baseline/plan.md), [Specs/011](Specs/011-grounded-judge/plan.md),
> [Specs/012](Specs/012-deterministic-scorers/plan.md)).
> `Package.swift` plus `EDDCore`, `TraceKit`,
> `ProjectKit`, `RenderKit`, `HarnessKit`, `LintKit`, `JudgeKit`, `RunKit`, `ConfigYAML`, and the
> `ProjectKit`, `RenderKit`, `HarnessKit`, `LintKit`, `ScoreKit`, `JudgeKit`, `RunKit`, `ConfigYAML`, and the
> `skillet` executable exist — the executable owns the full ArgumentParser command tree (no
> `skilletCLI` library; `ProjectKit` is the discovery/config-IO home) — with 356 tests green
> (`swift build && swift test`). Shipped commands: `init` · `doctor` · `lint` · `run` · `harness
> `skilletCLI` library; `ProjectKit` is the discovery/config-IO home) — with 390 tests green
> (`swift build && swift test`). Shipped commands: `init` · `doctor` · `lint` · `score` · `run` · `harness
> list`/`info` — see *Commands* below. **Per-feature records live nearest the artifact**: each
> feature's detailed capsule is its [`Specs/NNN` plan](Specs/README.md) status, with design-only
> changes in [`skillet-design-changelog.md`](skillet-design-changelog.md); this banner stays a
Expand Down Expand Up @@ -44,11 +46,11 @@ Contributing, security disclosure, and code of conduct are handled at the org le
## Commands (true now — Phase 1 / F1, F2, F4–F8)

- `swift build` — build the package (resolves `swift-argument-parser`, `swift-subprocess`, `swift-system`, `swift-yaml`).
- `swift test` — run the unit + integration suites (356 tests, all green). The integration suite drives
- `swift test` — run the unit + integration suites (390 tests, all green). The integration suite drives
the built binary, which `swift test` builds first; filter with tags, e.g. `swift test --skip slow`.
- `.build/debug/skillet` — the CLI: try `skillet`, `skillet --json`, `skillet -C <dir>`, `skillet init`,
`skillet init --json`, `skillet doctor [<skill>...] [--json]` (free $0 preflight; exit 3 + remedy on failure),
`skillet lint [--json]`, `skillet harness list`, `skillet harness info [--json]`,
`skillet lint [--json]`, `skillet score <path> [--format tty|json|sarif]` (free, model-free deterministic scorers over produced text → SARIF 2.1.0; a reporter, not a gate — exit 0 even with findings, exit 4 on a corrupt config), `skillet harness list`, `skillet harness info [--json]`,
`skillet run [<skill>] [--axis behavior|trigger|all] [--ab] [--judge text-judge|grounded-judge] [--runs <k>] [--dry-run] [--yes] [--no-input] [--keep-workspace]` (paid: shells `claude`, resolved via `SKILLET_CLAUDE_CODE_BIN` env → `harness.claude-code.path` in `skillet.yaml` → `PATH` — behavioral trials add the judge; trigger trials are judge-free single calls; `--ab` doubles behavioral trials with a provably skill-free baseline arm, both arms judged; `--judge grounded-judge` reads produced-file contents to catch created-but-wrong, larger grading requests — gated by the combined spend estimate),
`skillet --help`, `skillet --version`. Hidden test seams on `run`: `--replay` (offline adapter+judge),
`--replay-map <json>` (with-arm canned verdicts), `--replay-baseline-map <json>` (baseline-arm canned
Expand Down
10 changes: 8 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ let package = Package(
.target(name: "RenderKit", dependencies: ["EDDCore"]),
// Free static-lint rule engine — pure (rules run over a parsed SkillSource), no I/O, no YAML.
.target(name: "LintKit", dependencies: ["EDDCore"]),
// Free, model-free deterministic output scorers → SARIF (F17). Reads produced text via ProjectKit's
// SafeFile; emits EDDCore's SarifDocument / ScoreReport. No network, no subprocess.
.target(name: "ScoreKit", dependencies: ["EDDCore", "ProjectKit"]),
.target(
name: "HarnessKit",
dependencies: [
"TraceKit",
"EDDCore",
"ProjectKit", // SafeFile — shared confinement/hidden predicates (F17)
// Sole sanctioned launcher — for the real ProcessLauncher (probe; F7's run).
.product(name: "Subprocess", package: "swift-subprocess"),
.product(name: "SystemPackage", package: "swift-system")
Expand All @@ -68,7 +72,7 @@ let package = Package(
.target(name: "JudgeKit", dependencies: ["EDDCore", "TraceKit"]),
// The runner (F7): the per-trial sandbox lifecycle + the run/judge/aggregate loop. The
// orchestrator that wires the harness adapter + judge over the pure pass^k core.
.target(name: "RunKit", dependencies: ["EDDCore", "TraceKit", "HarnessKit", "JudgeKit"]),
.target(name: "RunKit", dependencies: ["EDDCore", "TraceKit", "HarnessKit", "JudgeKit", "ProjectKit"]),

// Isolated YAML config seam: swift-yaml + C++ interop live ONLY here. It exposes a pure-Swift
// API (decodes into EDDCore's pure SkilletConfig), so consumers stay interop-free.
Expand All @@ -90,6 +94,7 @@ let package = Package(
"ProjectKit",
"RenderKit",
"LintKit",
"ScoreKit",
"TraceKit",
"HarnessKit",
"JudgeKit",
Expand All @@ -109,7 +114,8 @@ let package = Package(
.testTarget(name: "LintKitTests", dependencies: ["LintKit"]),
.testTarget(name: "HarnessKitTests", dependencies: ["HarnessKit"]),
.testTarget(name: "JudgeKitTests", dependencies: ["JudgeKit"]),
.testTarget(name: "RunKitTests", dependencies: ["RunKit"]),
.testTarget(name: "RunKitTests", dependencies: ["RunKit", "ProjectKit"]),
.testTarget(name: "ScoreKitTests", dependencies: ["ScoreKit"]),
// Consumer of ConfigYAML — must also enable C++ interop (it's viral to direct importers).
.testTarget(name: "ConfigYAMLTests", dependencies: ["ConfigYAML"], swiftSettings: [.interoperabilityMode(.Cxx)]),

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ skillet drafts and proves — **a human lands every write**.
> F7 (`skillet run` — the neutral runner with `pass^k`) have landed, and Phase 2 is underway:
> F3 (`skillet doctor` — the free $0 preflight), F14 (`skillet run --axis trigger` — the
> description axis: does the skill *fire*?), F15 (`skillet run --ab` — the provably
> skill-free baseline arm with paired Δ), and F16 (`skillet run --judge grounded-judge` — the
> file-contents grader: did it write the *right* file?) shipped. The rest
> skill-free baseline arm with paired Δ), F16 (`skillet run --judge grounded-judge` — the
> file-contents grader: did it write the *right* file?), and F17 (`skillet score` — free,
> model-free deterministic scorers over produced text → SARIF 2.1.0) shipped. The rest
> of the loop lights up across later phases. See [ROADMAP.md](ROADMAP.md).

## How it works
Expand Down Expand Up @@ -69,6 +70,9 @@ skillet doctor [<skill>...] # free $0 preflight: config, harness, skill visibili
skillet doctor --json # machine-readable check rows (schema: skillet.doctor/1)
skillet lint # free static analysis of SKILL.md (exit 1 on error-tier findings)
skillet lint --json # machine-readable findings (schema: skillet.lint/1)
skillet score <path> # free, model-free scorers over produced text → SARIF 2.1.0 (reporter, not a gate; exit 0 with findings)
skillet score <path> --format json # machine-readable findings (schema: skillet.score/1)
skillet score <path> --format sarif # standard SARIF 2.1.0 on stdout
skillet run <skill> # run the skill's evals k×, judge, report pass^k (paid; spend-gated)
skillet run <skill> -n # dry-run: preview the trial-count estimate, spend nothing
skillet run <skill> --axis trigger # description axis: did it fire? (deterministic, judge-free)
Expand Down
4 changes: 4 additions & 0 deletions ROADMAP-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The roadmap's versioned change log, extracted from `ROADMAP.md` on 2026-07-04 (v
stays lean. Latest first; every version is a linkable heading; historical entries are never rewritten.
Companion: [`skillet-design-changelog.md`](skillet-design-changelog.md).

## v1.17.0 — 2026-07-09

MINOR — **F17 SHIPPED: deterministic scorers → SARIF** ([Specs/012](Specs/012-deterministic-scorers/plan.md); design → v0.49). New `skillet score <path> [--format tty|json|sarif]` — free, model-free checks over produced text emitting standard SARIF 2.1.0; a reporter, not a gate. Adds `ScoreKit` (S001–S007 + S000), `scorers:` config block, `SarifDocument`/`ScoreReport` frozen boundary formats, RenderKit human table, and ProjectKit safe-read/confinement ownership. 390 tests green. Phase 2 remains IN PROGRESS.

## v1.16.6 — 2026-07-08

PATCH — **F16 polish round 6** (4 optional-polish observations; 2 acted, 2 reaffirmed-as-tracked;
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Product Roadmap — skillet

**Version:** v1.16.6
**Last Updated:** 2026-07-08
**Version:** v1.17.0
**Last Updated:** 2026-07-09

`skillet` is the SKILL.md Evaluation Toolkit — eval-driven development (EDD)
for agent skills, as a public, multi-harness Swift CLI. This roadmap is
Expand Down
25 changes: 19 additions & 6 deletions Roadmap/phase-2-measurement-static-gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,24 @@ believable before the workflow layer starts acting on it.
explicitly (default `text-judge`); auto-routing staged (design §14-21); a P9 cost note prints.
Suite green — see the Specs/011 status row.

5. **[F17]** Deterministic scorers → SARIF (CLI: `skillet score`) — PLANNED · Ported
- Purpose & user value: Free, model-free checks over outputs/bundles emitting
5. **[F17]** Deterministic scorers → SARIF (CLI: `skillet score <path>`) — IMPLEMENTED
- Purpose & user value: Free, model-free checks over produced text emitting
standard SARIF 2.1.0 — the deterministic-first signal that feeds triage and
editors/CI.
editors/CI. A reporter, not a gate (exit 0 even with findings).
- Northstar: deterministic-first; gap #1 input.
- Success metrics:
- `score <bundle>` emits valid SARIF 2.1.0 on stdout (schema-validated).
- `score <path>` emits valid SARIF 2.1.0 on stdout (`--format sarif`; structural
goldens). *(`<path>` input ships now; the saved-run `<bundle>` mode arrives with
capture, Phase 3.)*
- Runs with no model and no network.
- Dependencies: Trace/bundle model.
- Confidence: Medium — design §6.2, §11 (ScoreKit).
- Checks: `SKILL-S001`–`S005` (slop-vocabulary, puffery, em-dash, rule-of-three,
knowledge-cutoff), `S006` not-x-but-y (experimental, default-off), `S007`
sarif-validity, `S000` file-unreadable. Also `--format tty|json`.
- Dependencies: ProjectKit `SafeFile`; EDDCore `SarifDocument`/`ScoreReport`.
- Known limitation: reads repo `skillet.yaml` + built-in defaults only; the
user/`$XDG_CONFIG_HOME` config layer for `scorers` is deferred to **F24** (config
precedence), a known gap vs. design §5.2.
- Confidence: High — shipped; Specs/012-deterministic-scorers/plan.md, design §6.2, §11 (ScoreKit).

6. **[F18]** Flaky-eval hygiene, watchdog & infra-only retry — PLANNED · Net-new
- Purpose & user value: Make reliability honest — flag flaky evals as hygiene
Expand Down Expand Up @@ -224,6 +232,11 @@ believable before the workflow layer starts acting on it.

## Phase Change Log

- 2026-07-09: **F17 IMPLEMENTED** — deterministic scorers → SARIF ([Specs/012](../Specs/012-deterministic-scorers/plan.md)):
`skillet score <path> [--format tty|json|sarif]`, free model-free checks over produced text,
`ScoreKit` (S001–S007 + S000), `scorers:` config block, EDDCore `SarifDocument`/`ScoreReport`
frozen boundaries, RenderKit human table. A reporter, not a gate. Fifth Phase-2 feature.
Roadmap → v1.17.0. Design → v0.49.
- 2026-07-08: PATCH — F16 capture-hardening rounds 1–5 (17 reviewed points, incl. one correctness
bug): grounded capture never opens special files (FIFO/socket/device — a hang past the harness
timeout) or hard-linked/symlinked files (host-content leak), withholds non-UTF-8/unreadable files
Expand Down
133 changes: 133 additions & 0 deletions Sources/EDDCore/Boundary/SarifDocument.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import Foundation

/// A discrete SARIF severity (`result.level`). Distinct from the continuous ``SarifResult/rank``:
/// `level` buckets, `rank` (0–100) carries the fine-grained score. `none` is emitted for a pass-like
/// result; the scorers use `note`/`warning`/`error` only.
public enum SarifLevel: String, Codable, Sendable, Equatable, CaseIterable {
case none, note, warning, error
}

/// A **typed, emit-only** SARIF 2.1.0 log (F17). Companion to the tolerant reader ``SarifLog`` — this
/// is the *writer*: skillet authors the shape, so there is no unknown-key round-tripping to preserve.
/// Serialized by ``jsonString()`` with a **camelCase** encoder (the shared `SkilletJSON` is snake_case,
/// which would emit `start_line`/`rule_id` and break GitHub/SonarQube ingestion). Frozen boundary
/// format — golden-tested.
public struct SarifDocument: Encodable, Sendable, Equatable {
/// The advisory schema pointer. The community mirror (what the repo's reader tests already use);
/// the OASIS canonical is the authoritative source:
/// `https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json`.
public static let schemaURI = "https://json.schemastore.org/sarif-2.1.0.json"
public static let version = "2.1.0"

public let runs: [SarifRun]
public init(runs: [SarifRun]) { self.runs = runs }

private enum CodingKeys: String, CodingKey { case schema = "$schema"; case version; case runs }
public func encode(to encoder: Encoder) throws {
var c = encoder.container(keyedBy: CodingKeys.self)
try c.encode(Self.schemaURI, forKey: .schema)
try c.encode(Self.version, forKey: .version)
try c.encode(runs, forKey: .runs)
}

/// Serialize to camelCase SARIF 2.1.0 JSON (no trailing newline). Deterministic (`sortedKeys`), and
/// **not** via `SkilletJSON` — the default key strategy keeps `startLine`/`ruleId`/`$schema` literal.
public func jsonString() throws -> String {
let encoder = JSONEncoder()
encoder.outputFormatting = [.sortedKeys, .withoutEscapingSlashes]
return String(decoding: try encoder.encode(self), as: UTF8.self)
}
}

public struct SarifRun: Encodable, Sendable, Equatable {
public let tool: SarifTool
public let results: [SarifResult]
public init(tool: SarifTool, results: [SarifResult]) { self.tool = tool; self.results = results }
}

public struct SarifTool: Encodable, Sendable, Equatable {
public let driver: SarifDriver
public init(driver: SarifDriver) { self.driver = driver }
}

/// The tool descriptor. `rules` is a **static catalog** — every rule the tool can emit, listed whether
/// or not it fired this run (the SARIF-idiomatic "advertise your catalog" model).
public struct SarifDriver: Encodable, Sendable, Equatable {
public let name: String
public let version: String
public let rules: [SarifRule]
public init(name: String, version: String, rules: [SarifRule]) {
self.name = name; self.version = version; self.rules = rules
}
}

public struct SarifRule: Encodable, Sendable, Equatable {
public let id: String
public let name: String
public let shortDescription: SarifMessage
public let properties: [String: JSONValue]?
public init(id: String, name: String, shortDescription: String, properties: [String: JSONValue]? = nil) {
self.id = id; self.name = name; self.shortDescription = SarifMessage(text: shortDescription)
self.properties = (properties?.isEmpty ?? true) ? nil : properties
}
}

public struct SarifResult: Encodable, Sendable, Equatable {
public let ruleId: String
public let level: SarifLevel
public let rank: Double?
public let message: SarifMessage
public let locations: [SarifLocation]
public let properties: [String: JSONValue]?

public init(ruleId: String, level: SarifLevel, rank: Double?, message: String,
locations: [SarifLocation], properties: [String: JSONValue]?) {
self.ruleId = ruleId; self.level = level; self.rank = rank
self.message = SarifMessage(text: message); self.locations = locations
self.properties = (properties?.isEmpty ?? true) ? nil : properties
}
}

public struct SarifMessage: Encodable, Sendable, Equatable {
public let text: String
public init(text: String) { self.text = text }
}

public struct SarifLocation: Encodable, Sendable, Equatable {
public let physicalLocation: SarifPhysicalLocation
public init(physicalLocation: SarifPhysicalLocation) { self.physicalLocation = physicalLocation }
/// A file-level location (categorical rules): `artifactLocation` only, no `region`.
public static func file(_ uri: String) -> SarifLocation {
SarifLocation(physicalLocation: SarifPhysicalLocation(artifactLocation: SarifArtifactLocation(uri: uri), region: nil))
}
}

public struct SarifPhysicalLocation: Encodable, Sendable, Equatable {
public let artifactLocation: SarifArtifactLocation
public let region: SarifRegion?
public init(artifactLocation: SarifArtifactLocation, region: SarifRegion?) {
self.artifactLocation = artifactLocation; self.region = region
}
}

public struct SarifArtifactLocation: Encodable, Sendable, Equatable {
public let uri: String
public init(uri: String) { self.uri = uri }
}

/// A region within an artifact. Line/column are **1-based**; `charOffset`/`charLength` are **0-based**,
/// per the SARIF spec. All counts are **Unicode scalars** (§4.3). `endColumn` is the column immediately
/// after the region.
public struct SarifRegion: Encodable, Sendable, Equatable {
public let startLine: Int
public let startColumn: Int
public let endLine: Int
public let endColumn: Int
public let charOffset: Int
public let charLength: Int
public init(startLine: Int, startColumn: Int, endLine: Int, endColumn: Int, charOffset: Int, charLength: Int) {
self.startLine = startLine; self.startColumn = startColumn
self.endLine = endLine; self.endColumn = endColumn
self.charOffset = charOffset; self.charLength = charLength
}
}
Loading