Darwin-only code is never compiled, linted, or tested by CI, including both hardware-backed unlockers #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A structural blind spot rather than a single defect. It came up as a caveat in every one of the 1.0 surveys and in the PR #29 review, which explicitly could not verify behavior preservation for these files.
Problem
CI runs on Linux. Every Darwin-gated file is therefore invisible to it — not compiled, not vetted, not linted, not tested:
internal/secret/keychainunlocker.go(583 lines)internal/secret/seunlocker_darwin.go(385 lines)internal/secret/helpers_darwin.gointernal/macse/macse_darwin.goplus its.hand.msourcesThat is roughly a thousand lines of Go plus Objective-C, covering both hardware-backed unlockers — Keychain and Secure Enclave — which the README presents as headline features and which are the ones users are most likely to trust with a long-term vault key.
The practical consequences are already visible across this milestone:
CreateKeychainUnlocker(136 lines) andCreateSecureEnclaveUnlocker(101 lines), live here and are exempt fromfunlen,cyclop, and everything else.TODO.mdalready records that these files contain lines over the 88-column limit that will surface the moment lint runs on macOS — meaning the tree is known-not-lint-clean and CI cannot say so.The gap is widest exactly where the security stakes are highest:
keychainunlocker.gois the file in #36 that holds a vault-key passphrase as a plain string, and it is the file no automated check has ever examined.Definition of done
Something in CI type-checks and lints the Darwin sources on every push. In rough order of preference:
GOOS=darwincross-compile check plus agolangci-lintrun configured for the Darwin build tags, both from a Linux runner. This catches compile errors, vet failures, and lint violations without needing a Mac. Cgo is the complication —internal/macselinks against Objective-C and Apple frameworks — so this may cover the pure-Go Darwin files whileinternal/macsestays excluded. Partial coverage is a real improvement and is an acceptable outcome, provided what remains uncovered is stated explicitly rather than left implicit.REPO_POLICIES.mdor the README.Also required:
maketarget orscript/entrypoint wraps whatever check is chosen, so contributors can run it locally the same way CI does. Policy: the Makefile is the single source of truth for how operations are run.script/checkor the CI workflow so it cannot be skipped by forgetting.TODO.mdupdated in the same commit; its existing note about unlinted Darwin files is resolved or narrowed to whatever genuinely remains uncovered.Implementation requirements
CGO_ENABLED=0will not buildinternal/macse. Establish what is achievable before designing the gate, and report the finding on this issue if the answer is "less than hoped" — an honest partial gate beats a broken full one.