Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Nothing yet.
- Nothing yet.
[0.7.0] - 2026-11-23
Section titled “[0.7.0] - 2026-11-23”WriteFuncWithPerm(path, fn, perm)— streaming atomic writes with an explicit file permission.WriteFuncalways inherited the existing file’s mode (or the 0o644 default for new files), so streamed exports like a PII journal dump could only land 0644 unless callers chmod’d after the fact (racy, or leaves a visible wrong-mode window). The variant creates the staged temp file with the requested mode, so the final file appears atomically with the correct permissions — mirroring whatWriteWithPermdoes for byte-slice writes. Parameter order follows the package convention of putting the distinguishing argument last (WriteFuncVerified(path, fn, fp),WriteWithPerm(path, data, perm)).- Website docs now cover the
*Permvariants —WriteWithPermshipped in v0.5.0 but was absent from the API reference; both permission variants are now documented (sections, decision table, API summary). - Deterministic collision test for the temp-path contract —
randomSuffixbecame an injectable seam so the uniqueness guarantee is pinned from both sides: 512 concurrent real writers derive distinct, correctly-shaped temp paths, and a fixed injected suffix reproduces the collision precondition and the wrapped suffix-failure path deterministically (previously only a statistical 200-writer test existed). - Landing redesign: “the commit ledger” — the hero code window is now a first-class, always-dark editor artifact in both themes (the pale light-theme code window was the page’s weakest surface), the decorative glow is gone, the stats row is a ruled ledger, FAQ and use cases drop the identical-card kit for ruled rows, the mismatch callout is the page’s one bold dark block, and the light theme is warm paper against green-tinted ink instead of near-white on near-white. Six gates pass unchanged (contrast AA, hero parity, smoke, Lighthouse budgets, brand mirror, links), and the smoke suite grows keyboard tab-order and theme first-paint asserts.
- Sitemap postbuild gate —
check-sitemap.mjs(wired intopostbuildafterverify-build) asserts the sitemap index resolves, lists ≥ 10 urls, and carries real<lastmod>dates, with four negative tests in the script suite; the lighthouse:deployed “collection gap” was root-caused as a cwd-relativeoutputDir, not a missing reports bug.
- Missing parent directories are created on write — every write entrypoint now runs
MkdirAllon the target’s parent directory before staging, so a first write into a fresh cache or config directory succeeds instead of failing withno such file or directoryat temp-file creation. Found via mr-sync: two on-disk caches (sizes.json,github-listings.json) silently ENOENT’d on every save for weeks because the NixOS unit pre-created the dir but bare machines did not. ConcurrentMkdirAllon the same directory is safe (TestTempPathsNeverCollidenow exercises 200 concurrent writers through the real path). fleet-bump.shvendor sync ordering — the vendor directory was resynced at the end of each consumer bump, after the after-build/after-test hooks ran; consumers that build with-mod=vendorsaw a stale vendor tree mid-bump. The sync now runs directly aftergo mod tidy, before any build or test step.- Website CI lockfile drift recovery — daemon-committed manifest changes without their
pnpm-lock.yamlcounterpart brokepnpm install --frozen-lockfilerepeatedly; the drift-guard job now fails fast on a missing lockfile update, and lockfiles are regenerated in the same change as any manifest edit.
[0.6.2] - 2026-11-04
Section titled “[0.6.2] - 2026-11-04”Added (website)
Section titled “Added (website)”- Declarative copy buttons — a
CopyButton.astrocomponent now backs both landing-page copy actions; the displayed code and the copied payload derive from one source, a single delegated listener (/js/copy-code.js) serves every[data-copy]element and rebinds across client-side navigations, and success/failure is announced through a polite live region. - PNG raster pipeline —
pnpm run brand:pngrasterizes the generated SVGs intofavicon.ico, the 1200×630 OG card, PWA icons (180/192/512), andapple-touch-icon.pngvia ImageMagick (quantized where file size matters). Brand colors now live inassets/brand/brand-tokens.jsonas the single source, and the generator’s check mode fails if the SVG mirrors drift from those tokens or if any emitted SVG has unbalanced tags. - “When not to use” guide + FAQ page — the docs tree gains an honest anti-recommendations page (situations where go-atomic-write is the wrong tool) and a full FAQ (ported from the landing section), both wired into the docs sidebar.
- Brand raster pipeline + usage rules —
pnpm run brand:pngnow also writes the five brand compositions as 2× PNG rasters (assets/brand/png/) for SVG-less slots, the GitHub social preview card (assets/brand/social-preview.png, 1280×640, owner uploads once via repo Settings — no API exists), and a labeledcontact-sheet.pngoverview grid. The brand README documents usage rules: clear space (25% of mark height), minimum sizes (16/150/170 px), composition-by-slot selection, tokenized colors only, and background-matched variants.
Added (CI)
Section titled “Added (CI)”- Source + dist gates wired into the Website workflow —
pnpm run check:hero(source-level hero parity) andpnpm run audit:contrast(WCAG AA over the full palette, both themes) now run in CI’s build job after the build, next topnpm run validate; the new gates can no longer regress locally-only. The Lighthouse budget job (added with the 2026-11-04 budget tightening) runs the full 10-page assertion suite on every push. - gitleaks secret scanning — SHA-pinned gitleaks action over full git history runs on every push and PR; verified clean on first run.
- Build-script regression tests —
pnpm run test:scripts(node --test) covers the CSP hasher’s quoting and idempotency, the changelog sync’s escaping, and the link checker’s negative paths; the negative-first tests caught real bugs before they shipped. - Internal link checker —
pnpm run check:linkscrawlsdist/, resolves#fragmentsagainst target headings and README references, and fails the Website workflow on broken links or fragments. - Playwright smoke suite + PR preview channels — a four-test smoke suite (copy payloads, FAQ count, 320px overflow, animation binding) runs against the production build in a new Website CI job, and every non-fork PR deploys an ephemeral Firebase preview channel (
pr-<number>) so reviewers see the rendered site before merge.
Changed (website)
Section titled “Changed (website)”- SEO hygiene batch — the sitemap emits real
lastmoddates (must be aDateobject, not an ISO string — Astro rejects strings), pages gainog:image:type,og:image:site_name, andtwitter:image:alt,theme-colorships as a light/dark media pair, and the website declaresengines.node >= 24. - Config-reloader use case — a fourth use case (“Never publish a half-written config”) joins the landing grid (4-up on desktop), and the HowItWorks section drops its misleading concurrent-race branch in favor of the fingerprint-mismatch reality.
Changed (docs)
Section titled “Changed (docs)”- CONTRIBUTING gains release + deploy runbooks — the release checklist (lint gate, CI green before tag, version trio, no re-tags) and the Firebase deploy recipes are written down where contributors look.
- Deploy-secret posture decided —
docs/deploy-secret-posture.mdcompares Workload Identity Federation (Option A, concrete OIDC commands) against key rotation (Option B) and documents the stalefirebase-adminsdkkey cleanup; CI keeps the sharedgithub-website-deployservice account key until WIF lands. - Fleet npm sweep tracker — the recurring devDep-bump behavior is documented as ad-hoc fleet sessions (not a scheduler), alongside the guards that self-heal its known fallout (
typescript@>=7override,*.out.cssgitignore, CI drift guard).
Fixed (website)
Section titled “Fixed (website)”- CSP hash sources were invalid for 3.5 months — every allow-listed inline script was silently blocked —
fix-csp.mjsemitted hash sources bare (sha256-…), but the CSP grammar requires single quotes ('sha256-…'); browsers parsed every hash as an invalid source and ignored it, so since v0.4.0 (2026-07-26) Starlight’s theme pickers, sidebar state, search shortcut, and Astro-inlined modules never executed on any page. Masked for months because the site’s behavioral JS lives in external/js/*files, and “verification” fetched HTML instead of reading a browser console. Hashes are now quoted,frame-ancestorswas dropped from the meta CSP (browsers ignore it there;X-Frame-Options: DENYalready ships as a header), andverify-build.mjsnow asserts every inline script is covered by a quoted hash so this incident class cannot silently return. Verified: zero CSP console violations on landing + docs pages. - Mobile layout overflow fixed — the hero code block’s min-content width propagated through the flex container, pushing the landing page’s scrollWidth to 527 px at 320 px viewport; the newsletter input+button row overflowed and stats labels clipped. The hero container now drops its min-width floor (
min-w-0 w-full), the newsletter stacks vertically on small screens, and the stats grid wraps 2×2. Verified:scrollWidth 310 == clientWidth 310at 320 px, zero uncontained elements. - Light-mode color audit: every text/background pair now meets WCAG AA — the audit script (
pnpm run audit:contrast, kept in-repo) computes real contrast ratios for all 11 foreground tokens against all backgrounds in both themes. Fixes: the hero code snippet’s import string and amber strings were near-invisible in light mode (accent-hover2.43:1,amber~1.6:1 on near-white), light accent as text sat at 3.61:1, and code comments missed 4.5:1 in both themes. Light mode now uses the deeper emerald (#047857) with white button text; success/danger stay as icons (WCAG 1.4.11 graphics threshold, passing). - Newsletter form worked again — the hash-based CSP declared
form-action 'self', which silently blocked the footer form’s POST tohttps://buttondown.emailon every page since the CSP shipped (v0.4.0); clicking Subscribe did nothing. The CSP now allowsform-action 'self' https://buttondown.email(the only cross-origin form target on the site). - OG card voice aligned with the landing page — the generated social-share card still said “TOCTOU-safe” (the pre-September mechanism voice) and pointed at the GitHub URL on every Slack/X/Facebook preview. The brand generator now emits “No lost updates” (consequence voice) and the pkg.go.dev URL;
og-image.svg/png, the lockups, andfavicon.icowere regenerated from the same geometry (brand:checkgates the SVGs).
0.6.1 - 2026-11-04
Section titled “0.6.1 - 2026-11-04”Changed (Go module)
Section titled “Changed (Go module)”- Source split into focused files — the single
atomicwrite.gohad grown past BuildFlow’s 350-line file budget (391 lines) while mixing four concerns. Same flat single package, now four files:atomicwrite.go(public write API),fingerprint.go(xxhash64 fingerprinting),commit.go(verification + locking + rename commit),stage.go(temp-file staging + fsync). Test files split to mirror them. No API or behavior change; all 31 tests moved verbatim.
Fixed (Go module)
Section titled “Fixed (Go module)”- Temp file leaked when the final rename failed — every public writer returned the rename error without removing the staged
.<random>.tmpfile (reachable when the target path is a directory, or on renameENOSPC/EIO). All rename sites now route throughcommitRename, which removes the staging file when the rename fails, so a failed write never leaves.tmpresidue next to the target.
Added (website)
Section titled “Added (website)”- Brand identity: “the atomic swap” logo — an emerald squircle holding two opposing arrows (new bytes in, old bytes out), generated from a single geometry in
scripts/generate-brand-assets.mjsinto every surface: favicon (SVG + ICO), site header/footer logo, Starlight docs header, the OG card (SVG + PNG), the README hero lockup (dark/light variants), and standalone marks inassets/brand/. The old identity was a squircle with the letter “A”, hand-copied (and drifted) across the favicon, the logo component and the OG image.pnpm run brand:check(wired into both CI workflows) fails if any generated artifact drifts from the generator.
Removed (website)
Section titled “Removed (website)”website/src/styles/global.out.css— a 44 KB generated Tailwind output with no references anywhere in the build; a leftover from an older CLI workflow. Fleet sweeps kept regenerating it (twice on 2026-11-03); it is now deleted again ANDsrc/styles/*.out.cssis gitignored so it can never be committed again.- Root
package.jsonstub — a straynpm init -ydefault stub (no deps, no lockfile, no scripts) was auto-committed 2026-09-22 (commit 5a6302f) and made thenpm directory: /Dependabot job fail on every run since. The stub is deleted and that Dependabot entry removed; only the healthy/websitenpm ecosystem remains.
Security (website)
Section titled “Security (website)”- npm dependency sweep —
pnpm-lock.yamlfully regenerated with pnpm 11.20.0: open advisories went from 62 (1 critical, 28 high) to 1 moderate (minimatch@3.1.5via the dev-only chrome-launcher chain; forcing it to 11 breaks glob@7’s CJS API at runtime — tracked BLOCKED inTODO_LIST.md). Enabled byoverridesinpnpm-workspace.yaml(pnpm 11 silently ignoresoverridesinpackage.json— same class as theallowBuildsincident, so the previous brace-expansion override had been inert):fast-uri^3.1.9,brace-expansion^5.0.12 (previous pin 5.0.6 sat six advisories behind),glob@>=13 <14^14.0.2,minimatch@>=10 <11^11.0.1,basic-ftp^6.2.1 (get-uri declares ^5 but 6.2.5 verified CJS-loadable, 2026-11-03).
Fixed (CI)
Section titled “Fixed (CI)”astro checkrequires TypeScript 6.x —websitepinnedtypescript^7.0.2→^6.0.3(and regeneratedpnpm-lock.yaml). TS7’s native compiler dropped the programmatic API thatastro checkdepends on. Shipped in the v0.5.2 tag but missed from its changelog section. Re-fixed 2026-11-03 with a self-healing guard: the fleet npm sweep re-bumped the manifest to^7.0.2twice more; atypescript@>=7 → ^6.0.3override inpnpm-workspace.yamlnow resolves any future major bump back to 6.x automatically.- golangci-lint GitHub Action upgraded v6 → v7 (SHA-pinned,
version: v2.13.2explicit) — action v6 cannot install golangci-lint v2, andversion: latestresolves to the ancient v1.x line. Shipped in the v0.5.2 tag but missed from its changelog section. - golangci-lint pin bumped
v2.13.2→v2.14.0— the v2.13.2 binary is built with go1.26 and cannot typecheck the Go 1.27 stdlib (export data version 5 > maximum supported 4), so master CI failed at lint while build/test passed. Lesson recorded: the pinned lint binary must be built with the repo’s Go generation; bump the pin when the toolchain minor rises.
Added (CI)
Section titled “Added (CI)”- Cross-compile job — builds
windows/amd64,darwin/amd64,darwin/arm64on every push/PR. The v0.5.1 Windows compile break class is now caught by CI before a tag can ship it. govulncheckjob —golang/govulncheck-actionv1.1.0 (SHA-pinned) scanning./....- Drift-guard job —
go mod tidy -diff, a version-trio check (go.modvs.golangci.ymlrun.govsAGENTS.md; the error names the drifted file), andpnpm install --frozen-lockfileinwebsite/. Auto-commit-daemon manifest drift (CI breaks 09-09/09-13/09-15/09-17 and another four-package drift on 11-03) now fails fast with a named message. GOTOOLCHAIN: localat the workflow level — a rogue toolchain download can no longer silently pick a different Go than the one setup-go installed.pnpm run lighthouse:deployed— Lighthouse CI against the live site (lighthouserc.deployed.json, same budgets, filesystem upload) as a repeatable post-deploy check.- README benchmarks re-measured on Go 1.27.0 as min–max ranges over 3 runs, with the load-sensitivity of the memory-bound xxhash64 documented (previous: single Go 1.26.3 numbers); website throughput claims updated ~27 → ~23 GB/s to match.
0.6.0 - 2026-09-22
Section titled “0.6.0 - 2026-09-22”Changed (Go module)
Section titled “Changed (Go module)”godirective is nowgo 1.27(fleet minor policy, ADR-0001 in go-version-auto-configure) — raised from the patch-formgo 1.26.7that v0.5.2 published. Environments must provide a Go 1.27 toolchain; the directive is major.minor only, so any 1.27.x toolchain satisfies it andGOTOOLCHAIN=autopicks one up automatically. (This section was reconstructed on 2026-11-03: the v0.6.0 tag was cut without moving[Unreleased]content; everything below shipped between v0.5.2 and this tag.)
Changed (website)
Section titled “Changed (website)”- Landing page leads with the consequence instead of the mechanism — the hero subheadline now names the failure mode (“if two processes write the same file, one silently loses data”) rather than listing four mechanisms, and the primary hero action is the copyable
go getcommand. Feature titles state outcomes (“No silent overwrites”, “Survives power loss”) instead of implementation names. - Meta description rewritten for search results and social previews: crash-safe framing instead of a TOCTOU and fsync mechanism list.
- Module path is now a single constant (
siteConfig.modulePath) — the hero snippet, the copyablego getcommand, the GitHub link, the pkg.go.dev link, and the Starlight docs meta description all derive from it. The module path was previously rebuilt by string-replacingsiteConfig.githubin two separate files, a smaller copy of the same split-brain bug. - Remaining corporate-register copy replaced — the feature grid subtitle now describes what the library does instead of “every decision optimized for…”, and the README lead names the three concrete failure modes rather than a mechanism list.
Added (website)
Section titled “Added (website)”- Landing page FAQ — answers “why not a temp file plus rename?”, “what does a write cost?”, “what happens when two writers race?”, and “when should I not use this?”.
- Build-time verification gate (
website/scripts/verify-build.mjs, run frompostbuild) — asserts the hero code shown indist/index.htmlis byte-identical to the code its copy button copies, that the install command matches thego.modmodule path, and that every[data-copy]button carries a non-empty payload. A regression of the hero split brain now fails the build. pnpm run validate— runshtml-validateon the built landing page; wired into the Website CI workflow.- i18n content collection (
src/content/i18n/en.json, intentionally empty) — silences theThe collection "i18n" does not exist or is emptywarning Starlight emitted on every build.
Fixed (website)
Section titled “Fixed (website)”- Landing page hero sample did not compile — the rendered snippet called
atomicwrite.Write(path, newData, fp), butWritetakes only(path, data); the copy button copied the correctWriteVerifiedcall, so the visible code and the copied code disagreed. Both now derive from a single token list inwebsite/src/data/hero-code.ts, so they cannot drift again. - README attributed
ErrConcurrentModificationto the wrong function — it claimedWritereturns it on fingerprint mismatch, butWritetakes no fingerprint. Corrected toWriteVerified. - Copy buttons survive navigation and announce success —
copy-code.jsnow installs one delegated click listener instead of binding per element, so it cannot double-bind across ClientRouter navigations, and it writes “Copied to clipboard” into arole="status"live region for screen readers.
Fixed (CI)
Section titled “Fixed (CI)”- Website deploys unblocked — the
FIREBASE_SERVICE_ACCOUNT_LARS_SOFTWARErepository secret was missing, so every CI deploy failed at the final step and the live site was frozen at the 0.4.0 content since 2026-07-26. A key for the sharedgithub-website-deploy@lars-softwareservice account is now registered, and the site is live again with current content. The Firebase deploy action was also pointed atwebsite/and manual dispatches now deploy.
Added (CI)
Section titled “Added (CI)”workflow_dispatchtrigger on the Website workflow so deploys can be run manually without pushing awebsite/**change.
0.5.2 - 2026-09-17
Section titled “0.5.2 - 2026-09-17”Changed
Section titled “Changed”- Toolchain: Go 1.26.5 → 1.26.7 —
go.modand.golangci.ymlaligned. No language or API changes; a toolchain maintenance/security bump only. - Dependency bumps —
gofrs/flockv0.13.0 → v0.13.1 andgolang.org/x/sys(indirect) v0.47.0 → v0.48.0. No API changes. golangci-lintconfig realigned to the v2.x schema — the gating check had drifted from the installed linter versions; findings from linters that no longer match this codebase’s patterns are silenced, and the now-unnecessary//nolint:goseccomments were removed (no behavior change).
Fixed (website & CI)
Section titled “Fixed (website & CI)”- Website HTML cache rule never matched cleanUrls pages — the
**/*.htmlrule missed directory-style URLs, so HTML fell back to Firebase’s defaultmax-age=3600(the same stale-content bug class behind the 2026-09-03 go-output outage).Cache-Control: public, max-age=0, must-revalidatemoved into the**catch-all, which Firebase applies last per header. - Website deploy pipeline repaired — pnpm is enabled via corepack before
setup-node(itscache: pnpmneeds the binary, which runners don’t preinstall),pnpm execreplacespnpm dlx(which ran unpinned latest tooling and crashedastro check), andfirebase-toolsinstalls vianpm i -gso its bin is onPATH.
Added (CI)
Section titled “Added (CI)”- Dependabot config — weekly grouped minor/patch updates for Go modules, GitHub Actions, and npm, capped at 5 open PRs per ecosystem.
0.5.1 - 2026-08-15
Section titled “0.5.1 - 2026-08-15”- Windows builds now compile (
rename_windows.go) —isRetryableRenamereferencedsyscall.ERROR_SHARING_VIOLATION, which Go’s stdlibsyscallpackage does not define on windows (it only exports a small errno subset). EveryGOOS=windowsbuild of this library — direct or transitive — failed withundefined: syscall.ERROR_SHARING_VIOLATION. The constant is now defined locally by value (syscall.Errno(32), the WinAPIERROR_SHARING_VIOLATIONcode), preserving the intended retry-on-sharing-violation behavior.
0.5.0 - 2026-08-14
Section titled “0.5.0 - 2026-08-14”WriteWithPerm(path, data, perm)— atomic write with explicit file permissions (0.4.0’s API always used 0o644).
Changed
Section titled “Changed”- Test hygiene: zero-length
maketo satisfy themakezerolinter.
0.4.0 - 2026-07-26
Section titled “0.4.0 - 2026-07-26”WriteIfChanged(path, data) (changed bool, err error)— writes only if content differs from disk. Returnschanged=truewhen the file was written,falsewhen skipped (identical content). This is the idiomatic primitive for config-file writers and code generators that must not produce spurious diffs on re-runs: no content change means no file mutation, no mtime bump, no file-watcher trigger. ComposesFingerprintFile+WriteVerified; first-write uses plainWrite(no prior content to protect).
Changed
Section titled “Changed”- BREAKING:
Write/WriteFuncAPI split (atomicwrite.go) — the previousWrite(path, data, fingerprint)mixed two distinct intents behind a zero-valueFingerprint{}, which silently skipped TOCTOU verification (a footgun). The API is now split by intent:Write(path, data)/WriteFunc(path, fn)— plain atomic write, no TOCTOU check (the common case).WriteVerified(path, data, fingerprint)/WriteFuncVerified(path, fn, fingerprint)— atomic write WITH fingerprint verification. A zero-value fingerprint here means “the file must NOT already exist” — a concurrent creation is treated as a conflict and fails, rather than being silently ignored.
- This is a source-incompatible change: every call site passing
Fingerprint{}to skip verification migrates toWrite/WriteFunc; every call site passing a real fingerprint migrates to the*Verifiedvariant. All in-repo consumers were updated.
Migration
Section titled “Migration”| Before | After |
|---|---|
Write(path, data, Fingerprint{}) |
Write(path, data) |
Write(path, data, fp) (real fingerprint) |
WriteVerified(path, data, fp) |
WriteFunc(path, fn, Fingerprint{}) |
WriteFunc(path, fn) |
WriteFunc(path, fn, fp) (real fingerprint) |
WriteFuncVerified(path, fn, fp) |
Fixed (website & docs)
Section titled “Fixed (website & docs)”- Website docs taught the removed API —
api-reference.mdx,getting-started/quick-start.mdx(4 examples),getting-started/installation.mdx,guides/error-handling.mdx, the landing-page hero code (hero-code.ts), and the “How it works” steps (sections.ts) all used the removedWrite(path, data, fingerprint)3-arg signature. Rewritten to the currentWrite/WriteVerified/WriteIfChanged/WriteFunc/WriteFuncVerifiedsplit. - Dual changelog split brain —
website/src/content/docs/changelog.mdxduplicated rootCHANGELOG.mdand had already diverged (no[Unreleased], old signatures). The website page is now generated from the root file bywebsite/scripts/sync-changelog.mjs(single source of truth, wired intoprebuild/predev). docs/DOMAIN_LANGUAGE.mddocumented the removed.bakpattern as a value object and event. Corrected to reflect single-rename atomicity and the full write-API split.pulse-dotanimation ignoredprefers-reduced-motion— the reduced-motion media query only targeted[data-animate]. Now disables.animate-pulse-dottoo (accessibility: vestibular disorders).
Added (website & CI)
Section titled “Added (website & CI)”- Hash-based Content Security Policy —
website/scripts/fix-csp.mjspost-build patcher injects a per-file CSP<meta>into every built HTML page. Inline scripts are allow-listed by SHA-256 hash (no'unsafe-inline'forscript-src);style-src 'unsafe-inline'is retained for Tailwind’s inlined critical CSS. - CI/CD pipelines —
.github/workflows/ci.yml(Govet+build+test -race+golangci-lint) and.github/workflows/website.yml(typecheck+buildon every change; deploy to Firebase Hostinglivechannel onmaster). - Changelog sync hook —
pnpm run sync:changelogand automaticprebuild/predevgeneration of the website changelog page.
Changed (website & docs)
Section titled “Changed (website & docs)”CONTRIBUTING.md— added awebsite/section (build/dev/deploy commands, the generated-changelog note), corrected the stale “No flake.nix” claim (the website has one), and documentedgolangci-lintas the gating check.
Removed (website)
Section titled “Removed (website)”- Dead website code — unused
comparisonsarray (sections.ts), unusedComparisonIteminterface (types.ts), and the unusedfade-in-upkeyframe + theme variable (global.css).comparisonMatrix(which IS rendered) is retained.
Added (website accessibility & social)
Section titled “Added (website accessibility & social)”- OG / social-share image — static 1200×630
og-image.png(generated fromog-image.svgsource) withog:image,twitter:image, andtwitter:card=summary_large_imagemeta tags on both the landing page and all Starlight docs pages. favicon.ico— multi-resolution (16/32/48/64px) ICO generated fromfavicon.svg, referenced via<link rel="alternate icon">for legacy browsers that only request.ico.- Lighthouse CI —
website/lighthouserc.jsonwith performance/accessibility/SEO budgets (desktop preset),@lhci/clidevDependency,pnpm run lighthousescript, andchromiumin the Nix devShell (CHROME_PATHset). Verified: Performance 100, Accessibility 100, Best-Practices 96, SEO 100. website/.editorconfig— standalone editor config for the website subtree (2-space indent for all web files,root = trueto decouple from the Go tab-based root config).
Fixed (website accessibility)
Section titled “Fixed (website accessibility)”- WCAG AA contrast failure —
--color-text-mutedwas#78716c(4.08:1 on the dark#0a0908background, below the 4.5:1 AA minimum). Dark mode lightened to#8b827a(5.28:1); light mode darkened to#6e6762(5.32:1) for comfortable margin. - Comparison matrix screen-reader inaccessible — check/X icons in
ComparisonSection.astrohad no text alternative. Each data cell now has a descriptivearia-label(e.g., “TOCTOU-safe, go-atomic-write: Yes”); feature-name cells changed to<th scope="row">; the~partial symbol markedaria-hidden="true".
Changed (website infra)
Section titled “Changed (website infra)”website/flake.nixpinned Node 24 — replacedpkgs.nodejs(Node 22 on unstable) withpkgs.nodejs_24across all apps and devShell, matching the.node-versionfile and AGENTS.md requirement.website/flake.nixapp metadata — addedmeta.descriptionandmeta.mainProgramto everymkApp(dev, build, preview, deploy);nix flake checkno longer warns about missing attributes.
0.3.0 - 2026-07-23
Section titled “0.3.0 - 2026-07-23”WriteFunc(path, fn, fingerprint)— streaming atomic writes via a callback. The callback receives abufio.Writer(64KB buffer) so callers can stream large or incrementally-produced content (JSON encoders, diagram renderers, etc.) without holding the full payload in memory. The temp file is fsync’d before atomic rename, and TOCTOU fingerprint verification works identically toWrite.- Comprehensive
WriteFunctests — first run, overwrite, large stream (400KB across 100 chunks), callback error cleanup, permission preservation, and no-leftover-files verification
Changed
Section titled “Changed”- Benchmark data generation extracted into a shared
benchDatahelper — eliminates duplicatedmake([]byte, size)+ fill-by-index across 4 benchmark functions .gitattributesadded for cross-platform line-ending normalization- Full marketing website launched with Astro + Starlight + Tailwind v4 at atomicwrite.lars.software
0.2.0 - 2026-06-28
Section titled “0.2.0 - 2026-06-28”- Removed
.baktwo-rename pattern — the oldatomicRenamedidpath→.bakthentmp→path, opening a window where the target didn’t exist. A concurrent reader could seeENOENT, and a crash between the two renames left the target missing. The library named “atomic-write” was not atomic. Now a singleos.Rename(tmp, path)is one atomic syscall on POSIX and atomically replaces on Windows viaMoveFileEx. - Concurrent writer corruption —
tmpPathwas computed before the lock (path + ".tmp"), so two concurrentWrite()calls to the same target both truncated and wrote the same staging file, interleaving bytes. Now each writer gets a unique temp file viacrypto/randsuffix (path + "." + randomHex + ".tmp"). - Concurrency test couldn’t catch the bug —
TestConcurrentWriteRACEused identical content from all writers, so byte interleaving was undetectable. Rewritten with 10 writers using divergent content (writer-0throughwriter-9) plus an integrity check verifying the final file is exactly one writer’s payload. - “Crash safety” doc claim was false — no
fsyncwas called anywhere. NowwriteAndSync()opens the temp file, writes data, callsfile.Sync(), and closes (with cleanup on error). On POSIX, the target directory is alsofsync’d after rename viasyncDir(). The package doc now says “atomic rename, and fsync for crash durability” — and means it.
fsyncfor crash durability — temp file is fsync’d before rename; target directory is fsync’d after rename (POSIX only; Windows has no equivalent directory sync)- Unique temp file names —
crypto/rand4-byte hex suffix prevents concurrent writer staging-file corruption - Platform-specific rename — split into
rename_unix.go(singlerename(2)+ directoryfsync) andrename_windows.go(retry loop onERROR_ACCESS_DENIED/ERROR_SHARING_VIOLATION, 5 retries with exponential backoff 1–16ms, matching Go’s owncmd/gofix for issue 36568) writeAndSync()— opens temp file, writes data, fsyncs, closes; cleans up temp file on any errorrandomSuffix()— generates random hex suffix for unique temp file namessyncDir()— opens and fsyncs the target directory after rename (POSIX only)TestWriteLeavesNoLeftoverFiles— verifies no.bakand no.tmpfiles remain after a successful write- Status report — full HTML dashboard at
docs/status/2026-06-28_03-32_atomicity-durability-overhaul.html
Changed
Section titled “Changed”- Package doc: “atomic rename for crash safety” → “atomic rename, and fsync for crash durability”
Write()now stages to a unique temp file instead of a sharedpath + ".tmp"atomicRename()no longer creates.bakfiles — singleos.Renamereplaces atomicallyTestConcurrentWriteRACErewritten: 10 writers, divergent content, integrity checkTestTempFileCleanedUpOnErrorusesfilepath.Globinstead of hardcoded temp path- AGENTS.md, README.md updated: new architecture, data flow, file structure, platform-specific behavior, removed all
.bakreferences go.sumtidied — removed stale testify/go-spew/go-difflib/yaml.v3 checksums
Removed
Section titled “Removed”TestWriteCreatesBackup— tested the.bakpattern as a feature; the pattern was a bug.bakfile creation — no longer created alongside the target
Caveats
Section titled “Caveats”- Windows rename retry loop and
FlushFileBufferscompile via build tags but are untested on real Windows hardware - No POSIX-equivalent directory fsync on Windows — the directory entry after rename may not be durable after a crash
- No stale temp file cleanup — crashed writes leave
.tmpfiles (unique names prevent interference but don’t self-clean)
0.1.1 - 2026-06-03
Section titled “0.1.1 - 2026-06-03”Changed
Section titled “Changed”- LICENSE changed from PROPRIETARY to MIT — the README already stated MIT; the LICENSE file now matches
.golangci.ymlnow permitsgithub.com/cespare/xxhash/v2andgithub.com/gofrs/flockin thedepguardallow list (both are intentional runtime dependencies, not candidates for replacement)- Tests use
//nolint:gosecannotations with rationale foros.ReadFile/os.WriteFilecalls that operate exclusively ont.TempDir()paths TestConcurrentWriteRACEnow callst.Parallel()to satisfyparalleltestand to actually run in parallel with other tests- Benchmark helpers call
b.Helper()so failures are attributed to the caller - Variable names lengthened for
varnamelencompliance:fp→fingerprint,wg→waitGroup,h→hasher,mb→megabyte - Inline
if err := …; err != nil { … }blocks in tests refactored to plain assignment plusiffornoinlineerrcompliance - Documentation formatting and accuracy fixes across README, CHANGELOG, CONTRIBUTING, DOMAIN_LANGUAGE, and AGENTS.md
errcheck:h.Writereturn value is now explicitly discarded (_, _ = hasher.Write(…)) in the streaming benchmark*.bakadded to.gitignore— backup files from atomic writes were showing as untracked
0.1.0 - 2026-06-03
Section titled “0.1.0 - 2026-06-03”- TOCTOU-safe file writes via xxhash64 fingerprint verification
- Cross-platform file locking (
flockon Unix,LockFileExon Windows) viagofrs/flock - Atomic rename with
.bakbackup of previous content Fingerprinttype ([8]byte) withIsZero()andMatches()methodsFingerprintFile— computes fingerprint from file path (zero-value for nonexistent files)FingerprintFromBytes— computes fingerprint from raw bytesWrite(path, data, fingerprint)— main API with TOCTOU protectionErrConcurrentModificationsentinel error for fingerprint mismatch detection- File permission preservation from existing file (defaults to
0644for new files) - xxhash64 vs SHA-256 benchmarks demonstrating ~11× speed advantage
- Unit tests, permission preservation tests, and concurrent writer contention test