Repository navigation
Add Swift as a language (not yet proven): workspace-substrate audits of SwiftPM packages - #563
Merged
Merged
Conversation
…nswers for everything else, because registering a language is what puts it under every registry-derived test at once, and the later tasks should fill capabilities one at a time against tests that already run. Detection is the .swift extension minus SwiftPM's manifests (Package.swift and Package@swift-*.swift describe the build, they are not code under audit). Pairing follows SwiftPM: Sources/<Target>/X.swift pairs with Tests/<Target>Tests/XTests.swift, and every file under Tests/ is a test whatever its name, because a project like Lariat names its tests for behaviour and would otherwise have them audited as sources. The first needed a new Rule field, DirSuffix, on the existing ParallelTree shape: no existing shape could say "the target directory plus Tests", and a new Shape would have duplicated ParallelTree. .build and .swiftpm were walked by the repo scan, the repo reader and the jail seed, since only the review walkers skip every dot-directory. They are declared as RunWrites dependency directories (the .tox precedent), so every walker skips them and the workspace pool never links one build directory into trees that build at once; .build is also a BuildDir keyed on Package.swift so the jail seed leaves it out. Every capability the language lacks is exempted in the parity table with the task that builds it. The runner golden no longer asks languages it never recorded, the repoindex gets a grammar row and fixture, and the canary syntax table gets a swiftc entry (skipped here, no toolchain). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…pm, and reword the Swift parity exemptions without plan numbers, because a comment that says the jail seed skips a dependency directory it never reads would mislead the next person to touch the seed, and the exemption reasons are rendered onto the public language-support page, where a reader cannot see a private plan. The repo scan and repo reader skip both directories because they are declared dependencies. The jail seed does not read that declaration: it skips .git and the BuildDirs, so .build stays out only through BuildDirs beside a Package.swift, and .swiftpm is still copied into every seed. The BuildDirs comment now records the consequence, that leaving .build out also leaves out .build/checkouts, so a package with remote dependencies cannot resolve them in the offline jail, which is why the default sandbox does not run Swift yet. Each exemption now says what is not built, and nothing unmeasured is stated as fact: fail-fast, failure-hook and units say only "not built yet". The generated page is regenerated in both copies. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…one swift-testing and one XCTest target, before writing any parser for it, because a Swift runner row built from output we expected would be tested against our expectation. The capture already overturned one: swift-testing matches --filter against the test id followed by its source location, so a pattern anchored with `$` alone selects no test and the run passes, which the script now records as a measurement beside the union of two --filter options and `swift test list` ignoring --filter. SWIFT lets the capture run the toolchain from a container, as RSPEC lets it name another rspec, and --swift-only captures Swift alone, since this host has no Swift and the other runners need tools a Swift box may not have. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…alone, the killing test's name and test-target units, because each now has a real Swift 6.3.2 run behind it, and the exemptions that remain say what was observed instead of "not built yet". The one-test pattern ends at "/" or the end rather than at `$`, since swift-testing matches --filter against the id plus its source location and a `$`-anchored id ran nothing and passed. confirm-alone and salvage stay exempt because neither framework's failure line names a test's target (swift-testing names no suite either), so a name read from it is a label, not a selector. The line-per-test listing reader cargo used is lifted to a neutral listLines that Swift shares, and the row otherwise reuses the shared refusal, decoding, alternation and unit helpers, so Swift adds no copy of logic another runner already has. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…its target, the two untested id shapes run alone, and the `$`-anchored filter run kept as a fixture with its exit status, because the review found claims the old captures could not support: a class and target both called CalcXCTests could not show which one XCTest's failure line names, the suite-nested and parameterised ids had never been run alone, and the evidence for departing from `^id$` was a count that reads 0 for a build error as readily as for an empty run. The capture script also now checks `$SWIFT --version` before it writes anything, so a full run on a box without Swift stops with every committed capture intact instead of overwriting them with empty files and "command not found"; it writes PROVENANCE.txt's Swift paragraph itself so a full run no longer drops it; and its flags parse in either order, as its usage line says. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ures show, because the Note claimed a filter verified for every id shape when two had never run, and three sentences on the public page said XCTest's failure line omits the target when the fixture could not tell its target from its class. The one-test test now covers all four listed shapes, a new test pins the `$`-anchored run as built, zero tests and passed, the confirm-alone exemption states what XCTest's failure and error lines carry in that run without promising a feature, and the salvage exemption says that `--skip` was read from the help and not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… plugin's file name, because Swift's parallel-tree rule mapped the dev test's directory a second time and wrote the test into a directory SwiftPM never compiles. When the dev test's name does not hold the source's stem as a whole token, which is every SwiftPM-named test (Calc is not a token of CalcTests), authoredTestPath asked pairing.Primary for a synthetic source already sited in the test directory, and Sources/<T>/ to Tests/<T>Tests/ turned Tests/CalcTests/ into Tests/CalcTestsTests/: every survivor would have read unproven while the run looked healthy. Every other path language's primary rule is a sibling, so its path is unchanged, and Rust lands Into a file before this point. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…prompt from captured Swift 6.3.2 runs, because each placeholder from registration was either project-wide or said nothing, and the shared writer prompt told a Swift writer to import the code by file path. CompileCheck builds one target with `swift build --target`: the authored test's test target, or the mutant's source target. The captures show a test target building with its dependency, leaving a broken sibling test target unbuilt, and failing on a source that does not compile. Preflight refuses a non-Linux host, a missing swift and a repository with no Package.swift at or above it, each naming the fix. JailPreflight refuses every jailed run before any spend, naming `--substrate workspace` on a scratch clone, because the sandbox's seed leaves out .build and with it the resolved dependency checkouts. A dry run never asks it, for Swift as for Rust. TestNamesInSource lists ids in the exact form `swift test list` prints, or nil for anything it cannot name completely, so the critic-list exemption is deleted. The swift row now resolves a critic's name through the listing, because `swift test list` lists the whole package and not the file. ImportPath names the source target's module, so the writer is told `@testable import <Module>`. The writer prompt ranks the project's conventions first and puts every authored test inside one corral-named type, which built and ran in both frameworks, where a top-level test named like the project's own did not build. The scanner pieces Rust, PHP and Swift share (identifier bytes, blanking, comments, tokens) are lifted to codescan.go rather than copied. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…iter the file the scorer actually writes, because the gate checked the code alone for every mutant and the writer was told a path computed on an empty tree. A mutant that still compiled but broke the tests' view of it (a changed signature a test calls) failed the suite's build and was scored as a kill. The fix is one shared rule, JailScorer.mutantGateTestPath. It takes the authored test if the tree already has it, else the dev test, which the jail's map holds and which the workspace substrate's empty map leaves on disk, else the code. So Swift now builds the dev test's target, and TypeScript type-checks the dev test against each mutant. Go and Rust ignore the path, and Python, Ruby, JavaScript and PHP add the unchanged dev test to their per-file checks. That can move a shipped TypeScript verdict, so VerdictGeneration goes to 49 as the convention requires. The writer is now told RunSpec.AuthoredTestPath, the scorer's resolved path renamed past files already in its workspace, so a file the developer kept from an earlier audit no longer gets its PHPUnit class or Swift type declared twice. Swift's one type is now named after that file rather than after the source. The Swift door tests no longer need cgo: the Rust dry-run half moved beside the landingRepo it uses. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e, reduced by one llvm-cov export reducer that Rust now shares, because both toolchains end in the same JSON and a second copy of the reducer would drift from the first. The reducer splits on "filename" rather than on `{"filename"`, because SwiftPM's full export sorts each file's branches and expansions ahead of its name, and it refuses an export that does not end the way a complete one ends: an empty or truncated export is disclosed as unavailable instead of being read in part, for Rust as for Swift. Rust's output on a complete export is unchanged, and its live capture still matches. The coverage build gets its own scratch path, .build/corral-coverage. Measured on taplin/Lariat with Swift 6.3.2, a coverage run in the default scratch path made the next ordinary build recompile 1,026 steps (56.2 s against a 2.7 s no-op), and in its own scratch path neither kind of build recompiled the other. A run with a failing test or a failed build writes no export (measured), so the script removes any stale export first and discloses a missing one, with the suite's exit status, as unavailable rather than printing an empty report. The swift coverage and selection exemptions are removed, the support page is regenerated, and the fixture export is captured by capture-runner-fixtures.sh --swift-coverage-only so it can be reproduced.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… developer's test as it stands, because handing the gate the dev test switched it off for whole files. A JavaScript file whose Jest test fails oxlint's no-undef on describe, it and expect lost its gate, and so would a Python test that fails ruff F821 or a TypeScript test with type errors. Undefined-name mutants were then graded by execution and counted as kills, the inflation the gate exists to stop. The probe now checks the unmutated tree with the dev test first. If that is rejected and the code alone passes, the gate runs on the code alone for that file, which is exactly the check every language ran before. Only a check that rejects the code itself switches the gate off. Each note now names the files it checked, instead of blaming "the source". The generation comment no longer claims the note reaches the verdict, since it is a log line. The CHANGELOG records generation 49, the gate change and the writer-path change. A test pins that in single-file mode the writer is told the file the scorer writes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ld run on the workspace substrate, because a Swift mutant relinks every product that links its module and the unmutated baseline relinks nothing, so a cap derived from the baseline alone can be shorter than a mutant's own build. On taplin/Lariat with Swift 6.3.2, `swift test` took 7.8 s with the file rewritten unchanged, as every workspace run rewrites it, and 17.1 s on a one-line mutant. The probe is one line comment put before the file's first line, not appended: an appended comment moves no line, the compiled object is identical and SwiftPM relinks nothing (measured), while a leading line relinks the same six products the mutant did. The rule lives once in internal/lang (leadingCommentProbe); a language opts in through PerRunBuilder with one line, and only Swift does. Rust does not: cargo rebuilds by timestamp and rustc relinks what it rebuilds, so the baseline's own rewrite already pays a mutant's rebuild (regex-syntax 0.8.5: 0.44 to 0.51 s rewritten unchanged, 0.47 to 0.57 s for a mutant), and a probe would only add a suite run. Score now reads the floor through WarmDurationJail, which a RunCacheJail and the WorkspacePool both satisfy, so mutantTimeoutCap stays the one place a cap is derived. The run goes through the pool's ordinary RunTest and the runner's journaled restore; a restore that fails is now a typed RestoreError so the caller stops instead of carrying on. A run that fails or times out is said on one line and yields no floor; a floor over the five-minute ceiling makes the file not graded, with the reason; --test-timeout skips the run. Its time is counted in the pool phase. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e checkout's Package.resolved, and say on the scan line what an extra tree costs and which branch-pinned dependencies have no Package.resolved, because a tree holds no .build and so resolves SwiftPM's dependencies for itself on its first run. Trees agree on the versions only when each holds the lockfile; without it they could build versions the checkout does not. The rule is shared, not Swift's: a language declares its lockfile (lang.Lockfiler: the file, its manifest and the bound of the upward walk), lang.LockfileFor finds it beside the nearest manifest at or above the root, and the pool takes it through WithLockfile, a pool-only option shaped like WithTreeEnv. A declared lockfile that is not among the files the pool copies (ignored, absent, or above the copied root) sends the pool down its existing one-tree path with a note naming the file, never an error. An untracked lockfile git does not ignore is copied, so it keeps the trees. Only Swift declares one; no other language's pool changes. The option list certify builds for a pool is lifted unchanged into workspaceRunnerOpts so its effect can be tested against the real pool. The swift row's Disclose says, with no figure because another project's numbers are not this operator's, that each tree beyond the checkout resolves and builds cold into its own build directory, since .build is neither copied nor linked. It names the dependencies Package.swift pins to a branch when there is no Package.resolved beside it, read from the manifest blanked by swiftCode so a comment or a string never yields a pin, and says nothing for a command with --package-path, whose manifest is another. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r from, and put the rebuild floor in the parity table, because a floor that reached only stdout left the record unable to tell a Swift file graded on a measured rebuild run from one graded on the baseline-only cap, the measurement-dropped-on-the-floor shape this codebase keeps gating. The new CapFloor field rides the file's result, not the Verdict, and states the source for every substrate from the one place Score reads the floor (WarmDurationJail): "run-cache warming run, <duration>" for Go's warmed cache in the jail, "rebuild run, <duration>" for a measured rebuild run, "none: <why>" when a rebuild run was due and gave none, and empty when no floor source applies. RunCache records what it did before. A test follows the value through every boundary to the signed row, back out of the ledger directory, and into and out of the warehouse's new cap_floor column. The field is tiered measured and the record-fields page is regenerated. The parity table gains "rebuild-floor", judged on PerRunBuilder: Swift has it, Rust's exemption gives the one crate measured and its figures, the interpreted languages say not measured, and Go's says the workspace substrate is unmeasured while its sandbox floor comes from the shared build cache, because the table has one answer per language and a tick would have hidden that. The one-off implementer test is deleted in favour of the table's own gate, and the language-support pages are regenerated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ning key, and add taplin/Lariat to the foreign sweep, because without a real toolchain the Swift tests that call swift and swiftc skip on every runner, and without a Swift repository the sweep says nothing about Swift's enumeration and pairing. swift.org publishes no checksum for its tarballs, only a detached PGP signature, so the provisioning script checks the tarball against that signature in a throwaway GNUPGHOME before unpacking anything, and accepts it only when gpg reports a good signature whose primary key is the pinned Swift 6.x Release Signing Key fingerprint; the keyring is fetched from swift.org over HTTPS and trusted only as far as that pin, and the comment says where the pin came from and that no keyserver is asked. The toolchain is unpacked whole under /usr/local/swift-6.3.2, following the script's rule that every toolchain lives under /usr, rather than over /usr where its clang, lld and lldb would replace the runner's, and only swift and swiftc are linked onto /usr/local/bin. Ubuntu 24.04 on x86_64 or aarch64 is provisioned; any other host says so and installs nothing, and any failure leaves Swift absent so its tests skip, as every block here degrades. Run in a clean ubuntu:24.04 container, the block installed the toolchain in 46 s, swift --version printed 6.3.2, a tampered file was refused with BADSIG, and the Swift halves of the coverage live-run check, the suite-exit check and the canary syntax check passed against it. The sweep gains taplin/Lariat pinned at be0c5fdc9e046b529bff2b588bf4cc2c32a2ff8a, cloned at run time like every other row, and every place that states the sweep's size now says nine repositories and ten rows. The golden row follows in a commit of its own. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…mmit of its own so the founder reads this diff before merge, because regenerating the golden file is a deliberate act and a row nobody read would let the sweep absorb whatever the tree produced. The row added is "Lariat 173 9 0": 173 files walked, 9 candidates, 0 ambiguous-test demotions, measured by `certify --repo --dry-run --top 5` from this branch's corral on a depth-1 clone at be0c5fdc9e046b529bff2b588bf4cc2c32a2ff8a. No other row changed: the nine existing rows are byte-identical to the previous commit's, and the sweep passes with all ten rows matching. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…, make any workspace pool one tree when git does not ignore a declared build directory, and say what each tree builds for itself on the pool's own disclosure, because the first cut lost parallelism for packages with nothing to resolve, copied an unignored .build into every tree, and put a fact about the pool in the Swift runner's scan line. SwiftPM 6.3.2 wrote no Package.resolved for a package with no dependencies or only path: ones (built in the swift:6.3.2 container), so a missing file there means nothing to resolve. Lockfiler gains ManifestPins, the language's reading of whether its manifest declares a dependency a lockfile would pin. It is a method, not a func field: as a field, gosec's taint analysis traced the manifest's text into every func(string) bool in the package and failed the security gate. Swift's reading counts any .package(...) without path: and any manifest it cannot read. The build-directory rule is shared and reads the existing BuildDirer declarations. A file git lists under a declared build directory (one whose marker sits beside it) sends the pool down its existing one-tree path with a note naming the directory. This changes Rust for an unignored target/ beside a Cargo.toml, which is intended: copied build output is not a tree's own build. Leaving the directory out of the copy instead would need reposcan.TreeDigest to change in lockstep, and is not done here. When the pool keeps its trees, its note now names the build directories each tree builds for itself from scratch, for Rust as for Swift, and Probe restates it. The Swift row's Disclose keeps only the branch-pin line. The language-support page gains a lockfile row: Swift has it; Rust needs it but its Cargo.lock sits at a workspace root the lookup does not find yet; Ruby was not measured; Python, JavaScript, TypeScript and PHP link their dependency directory into every tree; Go keeps modules outside the checkout. The manifest reader is one walker in swift_manifest.go, which now also reads Package.Dependency.package(...), and skipSpaces moved to codescan.go. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ng step, because bash ignores `set -e` inside a subshell whose status is tested by `||`, so the `( set -e; ... ) || echo` shape ran every step after a failure: a rustup-init whose sha256 did not match was still executed as root, a nextest tarball that failed its check was still unpacked into /usr/local/cargo/bin, and a Swift unpack that failed partway was still linked onto PATH. Each block now runs as a plain subshell and its status is read on the next line, where `set -e` applies, and the script's header states the rule and why. Only those two blocks had the shape; the TypeScript block chains its steps with && and the others are single commands. The Swift block now unpacks into /usr/local/swift-6.3.2.partial, which its exit trap removes, checks that swift and swiftc are present, moves the directory into place, and links last, removing both links if either fails, so a failed run leaves no swift of its own on PATH; the comment says exactly that, and no longer lists the stock command's preflight check among the tests the install serves, since that check skips for Swift with or without a toolchain. In clean ubuntu:24.04 containers: the success path installs Swift 6.3.2 and Rust 1.92.0 with cargo-nextest 0.9.148 as before; a tarball with one byte appended is refused with BAD signature and nothing is installed; a disk that fills during the Swift unpack ends the block with tar's exit 2, leaves /usr/local empty and swift absent; and a tampered rustup-init fails its checksum and is not run, where the previous block ran it and installed the toolchain. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…Score asks (adequacy.CapFloorApplies), because the jail branch read the warmed cache at cleanup whatever --test-timeout said: a Go file run with an explicit 60 s timeout signed "run-cache warming run" in a measured field for a floor that never reached its cap, since the dev pass still warms the cache. Score's two explicit-timeout checks and both recorders now share that decision, and the row records nothing when the operator's timeout set the cap. A run cache that was shared and never warmed was an expected floor source that gave none, so it now records "none: never warmed (<why>)", from the same wording RunCache's "unshared: never warmed (<why>)" comes from, instead of an empty value that read as "no floor applies". The tier note is rewritten so it is true for every value the field can hold, including a file the probe could not change, where no run was made, and record-fields is regenerated. CHANGELOG gains the Swift rebuild run and the CapFloor field. The Go note on the language-support page now says what its sandbox rule is, three times the run that warmed the cache under the five-minute ceiling, rather than "the same rule". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…er it needs Package.resolved, and apply the build-directory rule and note only to the audited language's own build directories, because the first rule kept trees for a root whose local package names a remote dependency, and the second cost a Python file in a repository with a Rust extension its parallelism for a target/ its tests never build. SwiftPM records a local package's remote dependencies in the root's Package.resolved (its documented behaviour; it could not be run offline), so a root that names only path: packages can still have pins. Lockfiler.ManifestPins now takes the manifest's directory, so the language reads what it must, and the lookup and pool stay language-neutral. Swift reads each path: package's manifest through an os.Root on the package, and counts as pinning anything it cannot follow: a cycle, a path that is not a plain literal, is absolute or leaves the package, or a package with no readable manifest. The pool takes the audited language's build directories through WithBuildDirs, shaped like WithLockfile; a pool given none applies neither the one-tree rule nor the own-build note, which is the answer for every language that declares no build directory, so Python, Go, JavaScript, TypeScript, Ruby and PHP see no change from this branch and only Rust and Swift do. A Python test that itself runs cargo is not covered, as it was not before. The doc comments on Concurrency and on each copy of Trees and ConcurrencyNote now say the note also speaks for a pool of more than one tree, and the CHANGELOG states the scope. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…again, because CapFloorApplies was inserted between mutantTimeoutCap's long comment ("the ONE place a cap is derived from a baseline") and the function, so that comment read as documenting CapFloorApplies and mutantTimeoutCap had none. CapFloorApplies and its comment now sit above mutantTimeoutCap's comment; no text changed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…g the sandbox when that language never runs in it, because a Swift repository on a host without a working bwrap was told by certify --repo (a real run and --dry-run --evidence), corral tests map and corral doctor --code to install bubblewrap, load the AppArmor profile or use --jail container, and every one of those leads only to Swift's JailPreflight refusal. The free acceptance run on taplin/Lariat hit this at all three doors, and none of them named --substrate workspace, the one substrate Swift runs on. The decision is the plugin's own JailPreflight answer, not its name: Swift's refusal is now lang.ErrSandboxUnsupported (its text unchanged), and lang.RefusesEverySandbox hands back only that kind, so Rust's user-home toolchain refusal and PHP's interpreter probe, which a host can fix, keep the existing advice. One function, sandboxAdviceFor in cmd/corral/jail.go, decides what every door says: the door's advice when no language in play refuses outright, the refusals in its place when every one does, both when only some do. bwrapUnavailableError now keeps its advice apart from its cause (sandboxStartError, same text as before) so sandboxFailureFor can replace it; localExecutor.preflight takes the scan's sources, whose languages decide. The refusal printed is the plugin's, so the remedy and its scratch-clone caveat are worded once. A Go repository's message is byte-identical, which a test pins. doctor has no --substrate flag and still does not rehearse the workspace substrate. It now says so: on a failed sandbox check, on the toolchain check of a language the sandbox never runs, after a full pass and in its usage text, that it checks a jailed run only and cannot check certify --repo --substrate workspace; without --code it says to pass one so it can answer for a language. The CLI reference is regenerated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…a file to the audit, and give that capability a row on the language-support page, because a Swift unit pass ended on a bare "evidence-paired 0" that reads as "the evidence found nothing more to audit": on taplin/Lariat its units executed 40 files under Sources/LassoParser, one of them paired by name, and none was added, since reposcan.UnitTestFile has no Swift case. Rust adds nothing either, for a different reason (a source with no separate test file lands its test on itself and is excluded before pairing), and only the evidence-pairing page said so. Building Swift's landing was considered and not done here. It is a small case (a target <X>Tests landing for Sources/<X>/ sources on a file under Tests/<X>Tests/), but the grading of a file it promotes has never run, and widening would re-rank a --top run onto such files. So the absence is made explicit instead, from one judge: reposcan.PromotesByEvidence runs the code promotion uses on a sample per language, the source's landing check (lang.CheckTestLanding) and the unit landing (UnitTestFile), and a per-test evidence language promotes onto the test it measured. The new parity row "Add a file with no paired test to the audit when the evidence shows a test executes it" is judged by it, with exemptions for Rust and Swift that say why; a test pins that each gap is where its exemption says. reposcan imports lang, so it installs the judge from its init (lang.SetEvidencePromotionJudge); a reader of Capabilities without reposcan linked panics naming the import rather than reporting every language as lacking it, and lang's tests and scripts/langsupport link it. The count line's note comes from evidencePromotionNote, which asks the same judge, so it is empty for Go, Python, JavaScript, TypeScript, Ruby and PHP and their output is unchanged. No count changes and nothing about which files are audited changes. The evidence-pairing page gains the Lariat run, before and after. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rintf with %v, because the printed-metrics gate (TestEveryPrintedNumberIsRecordedOrExempt) reads a %v verb as a possibly printed number and failed the suite on the new Error method; the message is the bwrap cause's own text and the advice, with no number of corral's in it, and the text is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…and run, and no more, because the branch adds a language that no audit with models has yet run on: the reader must learn that Swift audits run only on certify --repo --substrate workspace, what the fixtures and the free taplin/Lariat runs did and did not exercise, and that the pool and rebuild-run disclosures have been seen only in tests. The CHANGELOG gains the Swift entry, the Rust coverage reducer's truncation refusal and the CI rustup-init fail-open fix, which earlier entries did not cover, names the new lockfile row, and stops saying a Swift .build "used to be" copied, since Swift is new. ROADMAP marks Swift not yet proven and lists what is still ahead for it. AGENTS.md's plugin list now names rust.go and swift.go, the compile-check rule says how Swift scopes it and that the mutant gate checks the developer's test with a fallback, the cap-floor sentence names WarmDurationJail, and the Swift traps that cost runs here are written down with their reasons. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…file a test unit ran but evidence cannot add under its own reason, declare both language facts in lang instead of computing them through a startup hook, and stop doctor passing a Swift file it cannot check, because review of the first fix found four holes in it. The advice was decided from every enumerated source, so one script with no test (a Swift package plus scripts/release.py, `-- swift test`) brought back the whole AppArmor and --jail container block for a .py the run could never grade. certify --repo now passes the audit candidates' languages (candidateLangs) and tests map its one language. When a run would grade files in both kinds of language, the message keeps the advice and says which files it is for, then which files the sandbox never runs. The count line said why Swift added nothing, but the --json inventory and the signed rows still listed each such file as plain no-paired-test, the bare zero the line was fixed for. IndexFromUnits now keeps the sources a green unit executed and no unit could land (EvidenceIndex.ExecutedWithoutLanding), and WidenCandidacyByEvidence excludes them as reposcan.ReasonEvidencePairingNotBuilt when their language's evidence cannot add a file. Recorded rows carry it with evidence "coverage", and the not-audited list says what it means. It is a new reason, not test-landing-not-built: a Swift source's own landing is built, and what is missing is the unit's. Languages that promote keep no-paired-test for a file they executed but could not land (a Go file run only by another package's tests), so no shipped language's rows change; Rust sources without a separate test stay test-landing-not-built, excluded before pairing. Every reader that asked for no-paired-test now asks reposcan.IsNoPairedTest, the gate included, so the new reason is treated as the old one everywhere else. The foreign sweep's dry run runs no evidence pass, so its golden file is unchanged. On Lariat the reason now covers 55 files and 4 remain no-paired-test. Promotion was judged at runtime by sample repositories run through reposcan, which reposcan installed into lang from an init() with a panic when it was not linked. That shipped synthetic fixtures in the binary and a global for the next reader to trip on. It is now a declaration, lang.EvidencePromoter, implemented by Go, Python, JavaScript, TypeScript, Ruby and PHP and read by the support page's row and the count line. A reposcan test, TestEvidencePromotionDeclarationMatchesTheLandingCode, runs the real landing code for every registered plugin, Python's through its per-test index, and fails when a declaration drifts. The outright sandbox refusal is likewise a declaration, lang.SandboxRefuser, which Swift's JailPreflight returns, so no door has to run PHP's sandbox probe to ask it; ErrSandboxUnsupported is gone. doctor --code X.swift with a sandbox that starts and no test command printed "All checks passed", because the toolchain check returned "skipped" before asking anything, and certify then refused the file. It now fails that check with Swift's refusal whatever the command. That is doctor's existing non-fatal FAIL, the state for a check that did not pass, since it has no could-not-check state that holds back the all-passed line, so the remaining checks still print and doctor exits 1. doctor's sandbox comes through doctorResolveSandbox so the test can hand it one that starts. The workspace note now says that only the sandbox and toolchain checks rehearse a jailed run while the seat, credential and pairing checks apply to a workspace run too, and on a full pass it follows the not-checked list rather than splitting it. The usage text says the same, and the CLI reference and language-support page are regenerated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…o say about a sandbox that will not start, because the evidence pass runs over every enumerated source, files with no paired test included, so a Swift package whose only test is named for behaviour (Sources/A/B.swift with Tests/ATests/BehaviourTests.swift) has no candidate, still runs Swift in the sandbox, and was handed the whole bwrap and --jail container block again with no Swift refusal. localExecutor.sandboxLangs is now the candidates' languages plus the language resolveSelectionPlugin resolves over the enumerated sources, the same call the evidence pass makes, and both the dry run with --evidence and the real run pass it. A release script with no test is still neither, so that probe keeps only Swift's refusal; the mixed test and a Go repository's byte-identical message are unchanged. The other doors already speak for what they run: tests map for its one language, doctor for its --code file, and a plain dry run builds no sandbox. With no candidate and no evidence language the door gives its advice unchanged, a stated choice a test now pins. Where a --diff-base run will skip the evidence pass its language is still counted, so the advice can name a language the run would not reach but never leaves out one it would. EvidencePromoter's comment now says its test checks the declaration against sample repositories only and that a run's promotion does not read it, so nothing catches a drift that shows only on a real tree. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…D, a committed fixture or a recorded run supports, because a claims review found twenty sentences that overstated it: the CHANGELOG headline said a SwiftPM package "can be audited" while no audit with models has run, CI was said to provision Swift though the block has run only in clean ubuntu:24.04 containers, and the rebuild run, its scan line and its refusal were described without saying they have been seen only in tests. The sandbox-advice entry described Swift behaviour that never shipped as a change ("used to") and named lang.ErrSandboxUnsupported and reposcan.PromotesByEvidence, both gone; its content now sits in the Swift entry in the present tense, worded for HEAD's sandboxLangs (the audit candidates' languages and the evidence pass's), with lang.SandboxRefuser, lang.EvidencePromoter, the evidence-pairing-not-built reason and doctor's toolchain-check failure, and the change doctor makes for every language is its own Changed entry. Entries about other languages now separate measurement from construction: oxlint 1.87.0 run by hand is the one compile-gate rejection measured, and the PHP writer's class name was found by reading the code. The Swift run-cache exemption on the language-support page cited a 142.5 s cold build and a 13.6 s rebuild that no committed record holds and that the recorded runs on the same project contradict; it now gives the reason and the one committed Swift timing, attributed to its run, and the swift runner note says plainly that corral's sandbox never runs Swift and a Swift audit runs only on certify --repo --substrate workspace. AGENTS.md states the warm-build-moved failure as the single undiagnosed run it was, says WorkspacePool implements WarmDurationJail rather than being embedded, and describes the leading-comment probe by what relinked. The evidence-pairing page says which binary printed which jail-run message and how the Lariat run was timed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ight even when the sandbox starts, time the rebuild run on a tree the baseline-stability runs warmed, and stop a file whose rebuild run hits the runner's timeout, because the final branch review found that each of the three let a Swift run cost or record something false. With a working bwrap, localExecutor.preflight asked the languages only when the sandbox failed to start, so a Swift-only repository on the default substrate ran the unit evidence pass in a sandbox Swift cannot use, paid for a goal per file, and only then refused each file. preflight now asks the same declaration for a sandbox that started (sandboxRefusalWith, sharing sandboxRefusalsFor with sandboxAdviceFor, so there is still one decision): every language refusing refuses the run with the languages' own refusals, a mixed run prints which files the sandbox never runs, and the workspace substrate is untouched. certify --repo (real run and --dry-run --evidence) and tests map share the door. The rebuild run was made where the job's pool is built, which on a one-tree pool made it the job's first ordinary run of the command: the probe runs nothing on one tree and the evidence pass builds into .build/corral-coverage, so a cold build was recorded as the floor in CapFloor. Execute now arms the run (workspacePool.armRebuild) after the baseline-stability runs pass, and the audit's wiring makes it. That adds no run, where a discarded warm-up run before it would add one to every file, including files whose tree an earlier file had warmed; a file whose baseline is not stably green now pays for no rebuild run at all. A pool no box holds (no verb builds one on this substrate) is still measured where it is built. MeasureRebuild returned a run cut off at the runner's timeout as an ordinary failure, so the file was graded with no floor and every mutant's relink could be cut off the same way and read as a kill. It is now ErrRebuildOverCeiling (and still ErrTestTimeout): the file is not graded, with the reason. A rebuild run that fails for another reason keeps its behaviour (disclosed, no floor), which is a founder decision. Only Swift declares PerRunBuilder or SandboxRefuser, so no shipped language's verdict can change. The CHANGELOG's Swift entry says all three. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…es and one for handing back the proven tests as one file, with written exemptions for what Swift gets instead, and make the Swift writer's prompt stop promising a signature surface it is never sent, because the final review found two capabilities every other language was assumed to have that Swift lacks and that no page, CHANGELOG line or gate mentioned. Neither capability is built for Swift; both are now visible and gated by TestEveryLanguageHasEveryCapabilityOrSaysWhy. "signatures" is a declaration, lang.SignatureReader, because the reader lives in internal/repoindex, which imports lang: repoindex's TestSignatureDeclarationMatchesTheReader runs ExtractSignatures on a one-function, one-branch sample for every registered language and fails when a declaration disagrees, the way reposcan checks lang.EvidencePromoter. Go, Python, Ruby, JavaScript, TypeScript, PHP and Rust declare it and the reader confirms each. "merge" is judged by doing it: two sample proven tests per language go through ConcatAuthored, the fold every caller uses. Checking every language's cell against that behaviour found PHP lacking it too (PHPUnit 10 and 11 load one class per file, so PHP's ConcatTests merges nothing past the first part), so PHP gets an exemption that says so rather than an assumed tick. Swift's ExtractSignatures fails, so its writer is sent an empty SIGNATURE SURFACE while its system prompt said it was given one. The prompt now says the surface is empty and to read the API from the file. TestTheWriterPromptPromisesASignatureSurfaceOnlyWhereOneIsRead pins every language's prompt to its declaration in both directions. The shared mutant-generator prompt still names a signature surface for every language; it is not changed here. The language-support page is regenerated by its script; CHANGELOG and ROADMAP each gain the sentence the review asked for. No verdict of a shipped language changes: only the Swift prompt text changed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…CHANGELOG, correct four claims that said more than was run, date every hand-timed figure and record the commands behind them, make four stale comments true, and ask the no-paired-test question through its one helper, because the final review found each of these left a reader with something false or incomplete. CHANGELOG [Unreleased] gains three Changed lines, each checked against the code and the first and third on a dry run of a small Python repository: .build and .swiftpm directories are now never walked, read, reviewed or listed in any repository (as node_modules is; treedirs.Unaccounted), so a tracked file under one leaves the record with no row; a capital Tests/ is a test directory for every language, so a binary file there is seeded into the sandbox and a change there is a possible test under --diff-base; and .swift files in another language's repository are Swift sources, which with no `--` test command makes the repository span two languages and skips the evidence pass, so every file is graded by the whole suite. Claims: the swift runner note says no audit with models has run; the Swift run-cache exemption says "the one Swift timing taken", since a dry run writes no record; the CHANGELOG says the unit evidence pass "would grade"; and generation.go's "49" comment names only oxlint 1.87.0 as measured. Every hand-timed figure the branch states (the rebuild probe, the whole-run timings, the coverage eviction, the reducer, the Rust rebuild figures, the Lariat dry runs and their 40, 55 and 4) now carries 2026-11-19 and what it ran on, in the form the dated exemptions use, and runners/PROVENANCE.txt gains a separate section giving the commands the day's notes show, saying their raw output is not committed and naming the two places the notes give no command. No figure was added. Comments: Swift's CompileCheck now says the source target is also built alone when the mutant gate falls back; WorkspaceRunEnv says Swift runs only on the substrate where staleness is unmeasured; the signed ConcurrencyNote's comment says it also carries the own-build note for more than one tree; and the #nosec on reading Package.swift says the branch-pinned url literals are printed. UnauditableChangedSource and BuildLanguageProfile ask IsNoPairedTest (and the first IsUncovered) instead of listing the reasons, with identical behaviour; exclusionEvidence keeps its list, because it files the two no-paired-test reasons under different evidence. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…executor's notes, naming the file and the reason, because the CHANGELOG said the scan says so on one line while the only line that said it went to the per-file stdout that auditInputFor discards, so on the one verb Swift runs on the operator never saw it and only the row's CapFloor held it. The line is rendered by one helper, capFloorNoneLine beside runCacheUnsharedLine, from the row's value after fileCapFloor, so it fires for any source of "none:" (a rebuild run that gave no floor, a shebang file the probe cannot change, a shared Go run cache never warmed) and never for an ungraded file, a measured floor or no floor. The never-warmed case printed nothing on --repo before this: the "build cache: not shared" line there reads the baseline wiring's decision ("shared"), not the final record, so the operator is told once. rebuildFloor no longer writes to stdout and no longer takes it: only certify --repo builds a workspace pool, so that write reached io.Discard on every verb, and keeping it would have left two wordings of one fact. certify --local makes no rebuild run and prints no such line, which the CHANGELOG now says, and its Swift entry quotes the line as printed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… out records "none:", because since the rebuild run moved behind the baseline a run that does not finish in time stops the file: its row says it could not be audited, with the reason, and carries no floor. The record-fields page is public and described a value the code no longer writes for that case. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ommand that names another, because under swiftbuild the llvm-cov export SwiftPM writes leaves files out and corral read every missing file as never run. Swift 6.4 made swiftbuild the default, so CI's first run on the ubuntu-26.04 runner (Swift 6.4.2 preinstalled) reported no line of the XCTest target. Measured 2026-11-20 in Docker on the coverage fixture and on a copy of it with a library target only the XCTest target depends on: under swiftbuild each test target is its own test product and the export covered one of them, so on 6.4.2 the XCTest target's file and that library were absent though their tests ran, and on 6.3.2 with --build-system swiftbuild the export held none of the project's files; under native both versions exported every file with the same counts, and a failing test or a failed build wrote no export on either. Swift 6.4.2 warns that native is deprecated; a toolchain without it fails --show-codecov-path and the report is disclosed as unavailable with that reason rather than read from the other build system. The capture script's coverage run now passes the same flag, so it stays what the plugin runs; recaptured on 6.3.2 and 6.4.2 its export has the committed file list and line counts, so the committed fixture stands. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…n through awk's environment instead of -v, because awk processes escape sequences in a -v value and gawk, the awk of GitHub's ubuntu-latest runner, turned the pattern's `\.` into `.`: a project directory such as Xbuild/ was then skipped as if it were .build/ and left out of the report under gawk and not under mawk, with only a warning on stderr ("escape sequence `\.' treated as plain `.'", seen in CI's failing run). Both awks use an ENVIRON value as it is. The new test runs the whole coverage script with awk on PATH being each variant the machine has; it failed under gawk before this change. Rust reduces its export with the same program, so the fix is shared.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… and fail the job when swift is anything else, because GitHub's ubuntu-latest became Ubuntu 26.04 with a Swift 6.4.2 of its own: the provisioning script refused the release (it provisioned 24.04 only), printed that the tests would skip, and they ran instead on the runner's Swift, a version nothing on this branch had measured. swift.org's release index lists Ubuntu 26.04 from 6.4.0 on and no 6.3.x for it (download.swift.org redirects the 6.3.2 26.04 tarball's URL to its 404 page), so 24.04 keeps 6.3.2 and 26.04 gets 6.4.2, with the same signature check and swift.org's dependency list for each release. The pinned version is exported as CORRALAI_CI_SWIFT_VERSION before the install and the toolchain's bin directory is added to GITHUB_PATH, so a failed install still leaves the new deploy.yml step knowing what it must find; that step fails unless swift resolves into /usr/local/swift-<version> and reports that version. Run on 2026-11-20 in clean containers with a stand-in swift before or after the pinned one on PATH: a good 6.4.2 download on ubuntu:26.04 and a good 6.3.2 one on ubuntu:24.04 passed the check, and a tampered 6.4.2 download (bad signature, nothing unpacked) and ubuntu:22.04 (no pin) failed it. The CHANGELOG, ROADMAP, AGENTS.md and both PROVENANCE files now say which Swift ran what: the committed captures are 6.3.2's, and the three real-toolchain tests also passed on 6.4.2 in swift:6.4.2-resolute. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…n CI, not the toolchain's whole bin directory, because that directory also holds an llvm-profdata and an llvm-cov and first on PATH they stood in for the ones Rust's coverage finds there: CI's second run on this branch (2026-11-20) passed every Swift test and failed the three real-toolchain Rust coverage tests with "raw profile version mismatch: Profile uses raw profile format version = 11; expected version = 10" and "no profile can be merged". The links live in corral-links inside the pinned toolchain, made relative before the move into place, so the deploy.yml check still sees swift resolve into the pinned directory; in a swift:6.4.2-resolute container a swift reached through such a link resolved to the toolchain's swift-driver and reported 6.4.2 while llvm-profdata on PATH stayed the system's. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Swift as a language. Not yet proven:
certify --repo --substrate workspaceaccepts a SwiftPM package's sources, and no audit with models has been run on one.What was run
internal/lang/testdata/runners/.be0c5fd: Swift detected, 9 files paired by name, 0 by evidence, 5 of 5 units ran.ubuntu:24.04containers (good, tampered and disk-full downloads). It has not yet run in CI; this PR is its first run there.What it builds
swift testrunner row; scoped compile check; authored test lands as a new file in the developer's test directory.--substrate workspace. The default sandbox refuses it at preflight, before the evidence pass or any goal is paid for; a dry run is not refused..build/corral-coverage.CapFloor.Package.resolvedwould not be in the trees and something would be pinned, or when the audited language's build directory would be copied.Lariat 173 9 0, no other row changed.Changes that reach other languages
target/; a tree-cost note with more than one tree; the coverage reducer refuses a truncated export.rustup-initafter a failed checksum.set -ewas inert inside( … ) || …; this is live on main today.CapFloor; new exclusion reasonevidence-pairing-not-built; doctor and sandbox-advice wording..buildand.swiftpmare never walked in any repository; a capitalTests/joins the shared test tree;.swiftfiles in another language's repo count as Swift sources.Not covered
evidence-pairing-not-built).🤖 Generated with Claude Code