Repository navigation
Conversation
…nix out-links (#467) The `bump-flake-vendorhash` bot committed a build artifact into its own PR. #450 changed two things: the legitimate `vendorHash` bump, and a NEW `result` symlink pointing at `/nix/store/kkfnywjq…-civitai-4e35eaa-dirty`. All 13 CI checks were green on it — nothing in this repo detects the artifact. Mechanism, in `.github/workflows/bump-flake-vendorhash.yml`: - the two validate steps run `nix build .#default` and `./result/bin/civitai version`, and a SUCCESSFUL `nix build` drops a `result` out-link symlink into the invocation cwd (the repo root); - `result` is not in `.gitignore`; - the `open PR if vendorHash changed` step uses peter-evans/create-pull-request without `add-paths`, and that action runs `git add -A` in that case (verified in the action's own `create-or-update-branch.ts` at the pinned SHA c5a7806) — so it stages every change in the tree, untracked files included. The ordering is why this hid: `detect changes` runs BEFORE the validate steps, so its `git status --porcelain` gate never sees `result` and the changed=true/false decision is unaffected. The symlink exists only in the window between validation and the PR step. Two independent guards: 1. `add-paths: flake.nix` on the create-pull-request step — the authoritative fix. It stages exactly the file the workflow is allowed to change, so no future artifact can ride along regardless of what a later step leaves in the workspace. Audited against every step that writes to the working tree: the recompute step's two `sed -i`s and its `git checkout --` restore touch flake.nix and nothing else, and its nix log goes to `$RUNNER_TEMP`. flake.nix is the complete write set. 2. `/result` + `/result-*` in `.gitignore` — defence in depth, covering nix's numbered/named out-link variants. Anchored to the repo root so a legitimately named file deeper in the tree is unaffected. Also applies the vendorHash bump itself (#450's legitimate half), independently re-derived here rather than copied: with `vendorHash` set to the workflow's own fake, `nix build .#default` reported `got: sha256-l0RyxhS7+tdL9FngitiUhrciQbZfyDmTp5tP3Kd6NGQ=`, matching #450 exactly. `go.mod`/`go.sum` are byte-identical between #450's head and `main`. With the real hash written back, `nix build .#default` succeeds and `./result/bin/civitai version` runs. The two sibling drift-bots that share this token and this action — `bump-scaffold-pins` and `revendor-canonical-schema` — were audited for the same defect and do NOT have it, so they keep `git add -A` and gain only a comment recording the audit and what would change that. Neither writes anything into the workspace except the file it means to commit: `bump-pins` writes only under its `--dir` (default `internal/scaffold`), the re-vendor script `cp`s to one path and downloads via `mktemp`, `go test` writes nothing, and the scaffold build validation deliberately runs in `$RUNNER_TEMP`. Measured, not just read: `git status --porcelain` was clean of artifacts after the full test suite and after a `civitai app init --dir "$RUNNER_TEMP/…"`. Supersedes #450, which should not be merged as-is.
|
Superseded by #467, now on That PR carries this one's entire payload — the identical What this PR revealed: alongside the hash bump it also committed #467 pins Closing rather than fixing in place: |
…fix rounds broke things at the rate implementations did (#478) Replaces a doc that still said "Nothing is in flight, main @ 01d6692" while six PRs, three filed issues and a release had landed on top of it. Records the arc: #458 drop-messaging, #460 antipattern consolidation, #461 root-scoped allow-list, #467 the vendorHash bot's nix out-link, #468 depth-aware exclusion, #470 the credential warning. #464/#465/#466 closed, #450 superseded, #435 left open on Row B alone (bloat and VCS plumbing, not credentials). The part worth carrying forward is not the feature list. Every audit round after the first found a defect the previous round had certified clean, and each was CREATED by the fix for the previous finding — a re-approved golden contradicting the PR's own test, an 830x quadratic scan, a threshold tolerating a 1024x change, and a hostname-substring hole silencing real credentials. That is the argument for resetting the verification gate on every fix instead of trusting it. Also records three instrument traps that each returned a confident wrong answer in one session despite being documented rules: mutating the first of two identically-shaped functions, a -run filter that excluded the killing test, and `go build | head && echo OK` reporting success on a compile failure. The cure that held every time was a build gate before any verdict, no -run filter, and counted output rather than exit codes. And the standing gate on any future detector change: 244 project dirs / 3,917 packaged files / 1 firing = 0.41%, re-measured every time — a URL pattern once took it to 5.33% on a single starter-template README line.
Automated by the
bump-flake-vendorhashworkflow.The Nix flake's
vendorHashis a fixed-output hash derived fromgo.sum. It drifted from the currentgo.mod/go.sum(a dep wasadded or bumped), which makes the
flakeCI build fail and silentlybreaks
nix run github:civitai/cli. This PR recomputes the correcthash via the
lib.fakeHashdance (write a fake hash →nix build→parse the real
got: sha256-…→ write it back) and updatesflake.nix.Validated in-job before opening this PR:
nix build .#defaultsucceeds with the new hash and
./result/bin/civitai versionruns.CI note: this PR is opened with the scoped fine-grained token
(
secrets.BUMP_SCAFFOLD_PINS_TOKEN, Contents + Pull requests RW onthis repo only), not the default
GITHUB_TOKEN— so the repo'sflakecheck re-runs the build on it as an independent confirmation.