Repository navigation
🐛 fix(ci): clear govulncheck, golangci-lint and touch fuzz failures on next - #12
Merged
Merged
Conversation
govulncheck in CI fails on GO-2026-6809 (crypto/x509), reached through the atomic writer's temp-file naming (fsutil.createTemp -> rand.Read). The fix ships in go1.26.10; bump every workflow pin and go.mod together, as the 1.26.9 bump did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- confine.go: wrap the underlying cause with %w beside ErrEscapesRoot, so errors.Is still matches ErrEscapesRoot and now also sees the cause. - confine.go: trim leading separators with TrimLeftFunc; on Unix the cutset `string(filepath.Separator)+"/"` repeated '/' (SA1024). - tagfold.go: apply De Morgan to the double-s guard (QF1001); same logic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An explicit empty key (`? `) is a null key, which a map decode drops. The `modified` refresh round-trips the block through yaml.v3, whose encoder writes that empty plain scalar back as a quoted empty string, so the touched node gained a "" key it never had. FuzzTouchModifiedRoundTrip caught it in CI (`touch added keys: [] -> [ modified]`). Rewrite such keys as `~` before encoding, at every depth. A key that already is a quoted empty string is real data and keeps its quotes (negative control). The failing input joins the fuzz seeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fix The index guide and the changelog describe the link form index build writes since the merge of #11, how an older index migrates, and the empty-null-key fix in this PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decoding into a yaml.Node skips map-level checks such as a duplicate key, so the modified refresh rewrote an invalid block (`ype: 0` then `ype:`) instead of refusing it and leaving the file byte-identical. FuzzTouchModifiedRoundTrip caught it in CI on #12. Run the frontmatter parser first and return its error; the input joins the fuzz seeds. Co-Authored-By: Claude Opus 5.5 <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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Turns CI on
nextgreen again by clearing the three checks that failed on LGuichet/okfctl#11, none of which that PR caused: a stdlib vulnerability, golangci-lint findings, and a real round-trip bug the touch fuzzer found.build-test (govulncheck)
crypto/x509, reached through the atomic writer's temp-file naming (fsutil.createTemp→rand.Read). It is pinned in every workflow and ingo.mod, the same way the 1.26.9 bump was done.lint (golangci-lint v2.12.2)
ResolveInRootnow wraps the underlying cause with%wbesideErrEscapesRoot.errors.Is(err, ErrEscapesRoot)still holds, and no caller tests these errors for not-exist.TrimLeftFunc, since on Unix the old cutset repeated/(SA1024). The behaviour is unchanged.fuzz (
FuzzTouchModifiedRoundTrip)okfctltouch no longer invents a key: a frontmatter key written as an empty explicit key (?) is a null key, which a map decode drops. Themodifiedrefresh round-trips the block through yaml.v3, and its encoder wrote that key back as a quoted empty string, so the refreshed node gained a""key it never had. Such keys are now written as~(the same null), at every depth.ype: 0thenype:), the parser rejects the block, but the yaml.Node round-trip skips that check, so the touch rewrote the invalid block instead of refusing it. The touch now runs the frontmatter parser first, returns its error, and leaves the file byte-identical, as the fuzz contract requires.CI pins (
.github/workflows/)ci.yml,codeql.yml,govulncheck.yml,release.yml: Go 1.26.10go.mod:go 1.26.10CHANGELOG.md: Build entry for the bump, plus a Changed entry for ✨ feat(index): link subdirectories to their index.md, not the bare directory #11'sdir/index.mdlinks and a Fixed entry for the touch fixDocs (
docs/guides/)index-and-freshness.md: documents thedir/index.mdlink form ✨ feat(index): link subdirectories to their index.md, not the bare directory #11 introduced, and that an older index reads as stale once untilindex buildrewrites itLint fixes (
internal/)fsutil/confine.go:%wwrapping and the separator trimokf/tagfold.go: De Morgan rewriteTouch round-trip (
internal/okf/)frontmatter_edit.go: the parser runs first and an invalid block is refused, thenkeepEmptyNullKeysNullruns before the frontmatter is re-encodedfrontmatter_edit_test.goaddsTestTouchModifiedFileKeepsEmptyNullKeyNull, with positive controls (a top-level and a nested?key stay null) and a negative control (a real'': xkey keeps its quotes).writepath_fuzz_test.goseeds both failing inputs (?and the duplicate key). The duplicate-key seed went red (touched frontmatter does not parse) and then green.Evidence
GO-2026-6809 … Fixed in: crypto/x509@go1.26.10), lint reports four issues inconfine.go/tagfold.go, and fuzz fails withtouch added keys: [] -> [ modified](the blank is the""key).After: CI on this PR.
The touch fix went red to green locally:
After the fix, every
TestTouchModified*test andFuzzTouchModifiedRoundTrip(seed corpus) pass.gofmt -l .is empty,go vet ./...is clean, and the spec-conformance suite passes. All packages pass apart from the tests that fail identically onnexton this Windows host (plugin and editor exec,truemissing from PATH, CRLF git clones).-raceand golangci-lint were not run locally (no C compiler, no golangci-lint on the host), so CI covers both.Merge Danger
Door: two-way
Blast Radius: CI toolchain
okfctl node touchand every edit that refreshesmodifiednow write an empty null key as~:instead of'':. Before, that changed the node's data, so this is a correction. A node without such a key is byte-identical.go.modminimum). Go downloads that toolchain automatically under the defaultGOTOOLCHAIN=auto.ResolveInRooterrors now also wrap their cause, and their message text is unchanged.Not in this PR: the dated design records, and any change to how a node with a non-string key (
!!int : 1) parses. Those already fail to parse, and the fuzz test skips them.🤖 Generated with Claude Code