Skip to content

feat(scripts): same-PR Nix pin refresh companion to the dep gate (#14195 bullet 2) - #16839

Merged
developing-today-fleet[bot] merged 2 commits into
mainfrom
felix/14195-hash-refresh
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 2 commits into
mainfrom
felix/14195-hash-refresh

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Refs #14195 — implements bullet 2 (the same-PR hash-refresh step), the landable remainder per the 2026-11-29 census. Bullets 1 (gate) and 3 (dependabot audit) already landed; this PR does not close the issue — Felix judges closure.

What lands

  • scripts/refresh-nix-dep-pins.sh — the gate's repair companion. For a bump diff (same staleness rule as the gate: an input changed without its companion), it regenerates stale pins in place:
    • npm rows (9) — recomputes npmDepsHash with prefetch-npm-deps against the row's package-lock.json (a pure function of the lockfile; honours an explicit npmDepsFetcherVersion, the pkgs/cf case). Rewrites only when exactly one hash assignment exists — never guesses.
    • pkgs/id flake.lock row — re-locks via nix flake lock (dry-run restores the file).
    • go/cargo rows — reported MANUAL with the gate's hint (vendorHash has no standalone prefetcher; the crane inputs are plural). Exit 1, pin untouched, rather than a guessed hash.
    • Coverage is read live from the gate's --list, so gate and refresh can never drift on which derivations are covered; per-row refresh modes live in the script's meta table.
    • Strict argument contract per Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352; fail-closed exit 2 on usage errors / uncomputable diffs, mirroring the gate.
  • .github/workflows/nix-dep-refresh.yml — the bot step: workflow_dispatch against a bump branch, runs the refresh contract tests, refreshes, and commits the refreshed pins back onto the same branch so the bump PR itself carries the fix. Dispatch-only per ci-policy (no push/PR triggers).
  • Gate touch-ups — the gate's stale-bump error now points at the refresh script; its header exclusion note updated to match.
  • Tests — scripts/tests/test_refresh_nix_dep_pins.py (11 contract tests; oracle = the prefetcher's own output injected via a shim, plus the gate passing on the refreshed diff). Wired into nix-dep-gate.yml nightly and the refresh workflow; registered as suite scripts.nix-dep-refresh in .github/test-suite-registry.json.

Verification

No feature flag: this is operator tooling, additive only — the gate's behaviour is unchanged apart from one extra hint line in its failure output.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T15:37:28Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

 bullet 2)

scripts/refresh-nix-dep-pins.sh regenerates stale pinned hashes in
place for a dependency bump: npm rows via prefetch-npm-deps (honouring
npmDepsFetcherVersion), the pkgs/id flake.lock row via nix flake lock,
go/cargo rows reported MANUAL rather than guessed. Coverage is read
live from the gate's --list so the two cannot drift; contract tests
assert every gate row has a refresh mode. The gate's failure output
now points at the repair script, and the dispatch-only
nix-dep-refresh workflow commits refreshed pins back to a bump branch.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14965399-dca5-4729-8def-58ec70f55087

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…ix test shim printf format (#14195)

First remote run of the contract suite (nix-dep-gate workflow on the
branch) caught both: assignments inside a let block on the same line
as an opening brace were counted as zero, and the fake prefetcher's
format string had an unescaped %s for the shell printf.
@developing-today-fleet
developing-today-fleet Bot merged commit a5a69e8 into main Nov 29, 2026
3 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the felix/14195-hash-refresh branch November 29, 2026 16:07
@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

0937-B (alpha DRIVE landings): merged under standing merge authority after full-diff verification (863-line diff read firsthand). The refresh script is fail-closed throughout: strict #3352 argument contract (exit 2 on unknown/positional/uncomputable), coverage read live from the gate's --list so gate and refresh cannot drift, npm pins rewritten only when exactly one hash assignment exists (never guesses), npmDepsFetcherVersion honoured, prefetch failure leaves the pin untouched, dry-run writes nothing (flake.lock restored), go/cargo rows report MANUAL with exit 1 rather than a guessed hash, supergateway carries the #14140 warning. 11 contract tests with named oracles (fake-prefetcher SRI hash; the gate itself as acceptance oracle after refresh; MANUAL/fail-closed cases; --list maps every gate row). Dispatch-only workflow runs the contract tests before any refresh and pushes nothing when the script exits 1. Head e0eb4e8 stable across three reads, OPEN/non-draft/CLEAN/MERGEABLE immediately before merge. MERGED confirmed by second read: merge commit a5a69e8, mergedAt 2026-11-29T16:07:56Z. Refs #14195 (stays open — closure is Felix's call per the PR body). CI was not a gate per Drew's standing rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants