* fix(update): fence unforced --notes overwrites behind --force across all surfaces bd update --notes silently replaced existing notes, destroying handoff history. The contract now refuses an unforced overwrite of non-empty notes with ErrNotesOverwrite (409 notes_overwrite_refused over HTTP, force_notes_overwrite to override), enforced inside the mutation transaction on both the dolt and uow backends, for single updates and batch apply alike. CAS guards keep precedence: a stale --if-assignee/--if-status still surfaces as the exit-13 mismatch, on both backends, before the fence speaks. CLI: --force and --if-assignee are no longer mutually exclusive (that exclusion made overwriting under a guard impossible); both update routes translate the fence's sentinel into the same actionable advice (--force to overwrite, --append-notes to preserve history), and the post---force warning is worded as an audit statement. The shipped plugin skill docs and bd note help now prescribe --append-notes for handoffs instead of the newly fenced bare --notes. The fence is the single enforcement point: no client-side pre-read copies of the rule. Conformance contracts, unit tests for AuthorizeNotesOverwrite, and embedded/proxied/httpapi regression coverage included. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MAFpn9pUw8WKMfymteZHbh * fix(update): exempt explicit clears from the notes fence; share its predicate CI surfaced three gaps in the fence's reach: - Clearing notes (--notes "" / patch.notes: "") was refused, diverging from every sibling text field's clear and from the backend behavior contracts. The fence now targets only its actual footgun — replacing non-empty notes with different non-empty content — via a single shared predicate, issueops.NotesReplacement, used by both the contract's AuthorizeNotesOverwrite and the CLI's warning path, so the two can no longer drift. Prose updated to match everywhere the rule is stated (ErrNotesOverwrite, ForceNotesOverwrite, OpenAPI spec + regenerated types). - The revision-CAS integration tests' incidental concurrent writes now patch design instead of notes, so they no longer depend on notes-fence semantics at all. - The historical-upgrade harness deliberately replaces fixture notes and asserts the new value; its two bd update --notes calls now pass --force. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MAFpn9pUw8WKMfymteZHbh * fix(update): address review — changelog BREAKING entry, problem.go doc block, close-policy-under-guard test Review follow-ups on #5946 (bee-ghosttrack, MERGE-AFTER-FIXES): - CHANGELOG: BREAKING entry under [Unreleased] ### Changed for the notes fence on both wires (CLI exit 1, HTTP 409 notes_overwrite_refused), with the --force / --append-notes migration line. It also names the two deliberate edges: the explicit-clear exemption, and --force widening to the close-policy half under --if-assignee now that the flag pair is legal. - problem.go: CodeNotesOverwrite's comment had landed inside CodeDependencyCycle's doc block; each const now sits under its own docs. - assign_fence_embedded_test.go: pin the previously untested close-policy half of --force under --if-assignee (refused unforced, authorized forced). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JyuQ6Tjv3D7tpNqeb2WDED * test(update): align TestWarnNotesReplacement with the post-fence warning copy The test landed on main after this branch was cut and pins the pre-fence wording, where the warning fired on any unforced overwrite. Since the fence, an unforced overwrite is refused outright and warnNotesReplacement fires only after a forced one — the audit trail for a habitual --force — so the copy it pins is now '--force replaced existing notes'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JyuQ6Tjv3D7tpNqeb2WDED * docs(import): record bd import's notes-fence exemption as by-design (GH#6190) Import consults none of the per-field live-state fences — notes overwrite, live-claim reassign, close policy — and that is the intended shape, not an omission: its contract is wholesale row replacement, guarded by its own staleness check (only strictly-newer rows rewrite local state, --allow-stale is the single deliberate-overwrite opt-in) and reported field-by-field in updated_issues. Named in AuthorizeNotesOverwrite's enforcement-boundary comment and in bd import's help; the published CLI docs pick the help text up at the next release pin bump. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JyuQ6Tjv3D7tpNqeb2WDED * fix(update): refuse --notes "" and add --clear-notes; stop --notes help reading as additive GH#6021: an empty --notes wiped the whole notes field at exit 0 behind the same ✓ Updated receipt as a successful write — and the empty string is exactly what a dead command substitution collapses to. The empty value is now refused on both CLI routes (the accident and the deliberate clear are the same bytes at the flag layer), and the deliberate clear gets its own verb, --clear-notes, mutually exclusive with --notes/--append-notes. A verb rather than the proposed --allow-empty-notes opt-in: what needs authorizing is an intent, not an input path — --allow-empty-description unblocks stdin/file plumbing, which notes does not have — and an opt-in passed habitually would silently disarm the guard while a habitual --clear-notes fails loudly. --force does not bypass the refusal; the fence's clear exemption stands, so the verb alone authorizes the erase. The HTTP API is unchanged: patch.notes "" still clears. GH#6272: bd update --help called --notes "Additional notes" and the prime text said "Add supplementary notes" — both read as appending, so agents following the injected guidance faithfully clobbered prior context. The update help now names the operation with the --append-notes contrast at the point of use, the shared/create help is field-named like --description and --design, and the prime line points at bd update --append-notes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JyuQ6Tjv3D7tpNqeb2WDED * fix(bazel): enumerate the PR-new files in cmd/bd and issueops srcs The base added cmd/bd/BUILD.bazel and internal/storage/issueops/BUILD.bazel with EXPLICIT srcs lists after this branch was cut, so the three files this PR adds were never enumerated: cmd/bd/update_notes_guard.go (go_library bd_lib) cmd/bd/update_notes_guard_test.go (go_test bd_test) internal/storage/issueops/aggregate_authorize_notes_test.go (go_test) The go_library omission is a hard build break, not a silent skip: update.go:215,220 and update_input.go:106,111 are enumerated and call validateNotesUpdate / clearNotesRequested, so //cmd/bd:bd_lib compiles the callers without the callee. bazel.yml arms unconditionally for fork PRs (head.repo.fork == true) and builds //cmd/bd:bd + //cmd/bd:bd_test, so this reds the lane. make bazel-sync-check cannot see it -- go_srcs.py only validates the glob-based go_srcs filegroup, never the rule srcs lists. Generated by make bazel-sync (gazelle), not hand-edited, so the workflow's own BUILD-files-in-sync drift step agrees byte-for-byte. * fix(notes): name --clear-notes in bd note's rm guidance, correct the fence boundary comment, pin both request-shape rules Takes all three non-gating minors from the review. No behavior change: two prose fixes and two test cases. 1. cmd/bd/note.go's rm|remove|delete branch advised `bd update <id> --notes "text" --force` under "To change or clear notes", but clearing through --notes is exactly what this PR made impossible -- validateNotesUpdate refuses an empty value unconditionally and --force does not reach it. The branch now names both verbs separately: --notes --force to replace, --clear-notes to clear. The edit and update branches speak only of replacing and were already correct, so they are untouched. 2. aggregate.go's enforcement-boundary comment claimed the UpdateIssueInTx funnel's "one notes-replacing caller is bd edit". Under this PR's own NotesReplacement predicate there are at least four more (bd note's read-combine-write, bd defer --reason, bd rename and delete-tombstoning's mechanical ID rewrites, bd compact's clears). The exemption is still sound -- every funnel writer derives its new value from the current notes -- so the comment now names those CLASSES instead of a single caller, which is the claim that is actually true and that a future fence auditor can check. 3. Both branches this PR adds to ValidateUpdateRequest were uncovered: the batch apply leg reaches them here and nowhere else, while the single-issue HTTP handler's own pre-check returns before storage. Added a sibling table (the existing one varies only the patch; these two rules are properties of the REQUEST) with a case each. Mutation-checked, disjoint: neutralizing the force-without-notes branch reds only the first case, neutralizing the notes+append branch reds only the second, and the pre-existing canonical-fields table stays green under both. Not an amend of 5ffcc9c16c: that commit's message states it was generated by make bazel-sync and not hand-edited, so folding hand-written Go into it would falsify the claim its own BUILD-files-in-sync argument rests on. No new files, so the srcs lists it repaired stay correct. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local> |
||
|---|---|---|
| .. | ||
| bench-ready-indexes | ||
| checkworkflowtags | ||
| ci | ||
| gitattributespolicy | ||
| hooks | ||
| internal/testbash | ||
| migration-test | ||
| pr-lint | ||
| prlintmake | ||
| repro-be-1he-slow-path | ||
| repro-dolt-hang | ||
| repro-dolt-prod-timeouts | ||
| workflowtags | ||
| bazel-autofix-push.sh | ||
| bazel_autofix_push_test.go | ||
| bazel_farm_workflow_test.go | ||
| bazel_policy_test.go | ||
| build-examples.sh | ||
| BUILD.bazel | ||
| bump-version.sh | ||
| check-build-tags.sh | ||
| check-cli-docs-drift.sh | ||
| check-doc-flags.sh | ||
| check-doc-freshness.sh | ||
| check-go-install-guidance.sh | ||
| check-migration-hygiene.sh | ||
| check-testing-short.sh | ||
| check-versions.sh | ||
| check-winget-portable-alias.sh | ||
| check_build_tags_test.go | ||
| check_doc_freshness_test.go | ||
| check_testing_short_test.go | ||
| check_winget_portable_alias_test.go | ||
| ci_capability_selector_test.go | ||
| ci_workflow_apt_get_timeout_test.go | ||
| ci_workflow_test.go | ||
| clean-test-tmp.sh | ||
| complexity_script_test.go | ||
| conformance.sh | ||
| conformance_script_test.go | ||
| cross-version-smoke-test.sh | ||
| docs-autofix-push.sh | ||
| docs.md | ||
| gen-winres.sh | ||
| generate-cli-docs.sh | ||
| generate-newsletter.py | ||
| generate-newsletter_README.md | ||
| gh-body-lint | ||
| host_tools_test.go | ||
| install-hooks.sh | ||
| install.sh | ||
| install_dolt_test.go | ||
| migrate-jsonl-to-dolt.sh | ||
| migrate-legacy-to-current.sh | ||
| mutation-equivalence.sh | ||
| pr-preflight.sh | ||
| pr_preflight_test.go | ||
| pr_risk_bazel_coverage_test.go | ||
| pull_dolt_image_test.go | ||
| README.md | ||
| release.sh | ||
| release_script_test.go | ||
| required_suite_test.go | ||
| resolve-docs-bd.sh | ||
| sign-windows.sh | ||
| test-cgo.sh | ||
| test-git-remote.sh | ||
| test-icu-path.sh | ||
| test.sh | ||
| test_script_test.go | ||
| update-nix-vendorhash.sh | ||
| update-versions.sh | ||
| update-winget.sh | ||
| upgrade-smoke-test.sh | ||
| upgrade_smoke_loop_test.go | ||
| verify-cgo.sh | ||
Beads Scripts
Utility scripts for maintaining the beads project.
ci/
Repository-owned CI command wrappers. These scripts are the source of truth for the target CI tiers; Make targets are aliases for local discoverability.
make ci-pr-core
make ci-pr-policy
make ci-pr-lint
make ci-package-mcp
make ci-package-npm
Each wrapper auto-detects the repository root, sources .buildflags when it
invokes Go in the default build mode, and records per-command timing through
scripts/ci/lib/timing.sh.
ci-pr-lint keeps its supported Bash/Make entrypoint but delegates native and
Windows/non-CGO target selection to the checkout-owned scripts/pr-lint Go
driver. This is the same shell-free lint authority used by bd preflight in a
Beads source checkout.
Broad Go test wrappers also source scripts/ci/lib/test-env.sh, which creates a
temporary HOME/XDG/Dolt root, isolates Git global/system config, clears runtime
Beads/Dolt environment variables, and sets BEADS_TEST_SKIP=dolt before tests
run. This keeps local make test and make ci-pr-core results comparable to
the fast PR-core contract even on shared agent hosts. Set
BEADS_TEST_ENV_RUN_DOLT=1 only when intentionally running the Dolt-dependent
tests through these broad wrappers, or BEADS_TEST_ENV_DISABLE=1 when debugging
against your real local configuration.
The broad Go wrappers also cap package and test parallelism to 4 by default
(GO_TEST_PKG_PARALLEL and GO_TEST_PARALLEL). This avoids turning high-core
shared hosts into a different test topology than GitHub Actions.
make ci-pr-policy includes scripts/check-testing-short.sh, which enforces
that testing.Short() is only used for runtime, stress, or large-fixture skips.
Use build tags, environment checks, or named wrappers for integration/e2e/API
boundaries.
Package gate wrappers validate publishable/package-adjacent surfaces:
make ci-package-mcpbuilds or consumes abdbinary, puts it onPATHasbd, then runs locked MCP packageuv sync, Ruff, mypy, pytest, and build checks.make ci-package-npmbuilds or consumes the native binary expected bynpm-package/bin/bd, runs the npm package test suite, and checksnpm pack --dry-run.
Set BEADS_TEST_BD_BINARY=/path/to/bd for MCP and npm package gates to reuse a
prebuilt candidate binary instead of rebuilding it inside the wrapper.
pr-preflight.sh
Read-only PR safety check for agents and maintainers.
# Before implementing or opening a related PR
./scripts/pr-preflight.sh --search "topic keywords" --repo gastownhall/beads
# Before changing, closing, or merging an existing PR
./scripts/pr-preflight.sh 123 --repo gastownhall/beads
It reports contributor/fork status, draft/review/merge/check state, risky diff
signals such as .beads/ changes or missing tests, and the required
contributor-protection next steps. It does not replace code review or local
validation.
Base-branch health is supplemented by a warn-only PR-gate sample: the last 60
completed pull_request-event runs, grouped per workflow. A single workflow
whose decisive runs (>= 5, across >= 3 distinct head branches) are all
failure-class is reported as a broken PR gate — the case where a job that
exists only in the PR workflow is red for every PR while the base branch shows
green. This detector never blocks (deliberately: automation classifies
unrecognized [block] lines as genuine merge blockers and would park merge
lanes on a false positive); it is skipped entirely while the base branch is
red.
gh-body-lint
Lint Markdown files before posting them with gh ... --body-file.
./scripts/gh-body-lint body.md
./scripts/gh-body-lint --fix body.md
The lint catches literal \n sequences, which render poorly on GitHub, and
GH#123 references, which do not auto-link like #123 or owner/repo#123.
release.sh (⭐ The Easy Button)
One-command release from version bump to local installation.
Usage
# Full release (does everything)
./scripts/release.sh 0.9.3
# Preview what would happen
./scripts/release.sh 0.9.3 --dry-run
What It Does
This master script automates the entire release process:
- ✅ Stops running Dolt servers (avoids version conflicts)
- ✅ Runs tests and linting
- ✅ Bumps version in all files
- ✅ Commits and pushes version bump
- ✅ Creates and pushes git tag
- ✅ Verifies or opens the Homebrew core formula PR
- ✅ Upgrades local Homebrew installation
- ✅ Verifies everything works
After this script completes, your system is running the new version!
Examples
# Release version 0.9.3
./scripts/release.sh 0.9.3
# Preview a release (no changes made)
./scripts/release.sh 1.0.0 --dry-run
Prerequisites
- Clean git working directory
- All changes committed
- golangci-lint installed
- Homebrew installed (for local upgrade)
- Push access to gastownhall/beads
Output
The script provides colorful, step-by-step progress output:
- 🟨 Yellow: Current step
- 🟩 Green: Step completed
- 🟥 Red: Errors
- 🟦 Blue: Section headers
What Happens Next
After the script finishes:
- GitHub Actions builds binaries for all platforms (~5 minutes)
- PyPI package is published automatically
- Homebrew core formula is verified or tracked through its canonical PR
- Users can
brew upgrade beadsto get the new version after Homebrew merges - GitHub Release is created with binaries and changelog
bump-version.sh
Bumps the version number across all beads components in a single command.
Usage
# Show usage
./scripts/bump-version.sh
# Update versions (shows diff, no commit)
./scripts/bump-version.sh 0.9.3
# Update versions and auto-commit
./scripts/bump-version.sh 0.9.3 --commit
What It Does
Updates version in all these files:
cmd/bd/version.go- bd CLI version constantplugins/beads/.claude-plugin/plugin.json- Claude plugin versionplugins/beads/.codex-plugin/plugin.json- Codex plugin version.claude-plugin/marketplace.json- Claude marketplace plugin versionintegrations/beads-mcp/pyproject.toml- MCP server versionREADME.md- Alpha status versionPLUGIN.md- Version requirements
Features
- Validates semantic versioning format (MAJOR.MINOR.PATCH)
- Verifies all versions match after update
- Shows git diff of changes
- Auto-commits with standardized message (optional)
- Cross-platform compatible (macOS and Linux)
Examples
# Bump to 0.9.3 and review changes
./scripts/bump-version.sh 0.9.3
# Review the diff, then manually commit
# Bump to 1.0.0 and auto-commit
./scripts/bump-version.sh 1.0.0 --commit
git push origin main
Why This Script Exists
Previously, version bumps only updated cmd/bd/version.go, leaving other components out of sync. This script ensures all version numbers stay consistent across the project.
Safety
- Checks for uncommitted changes before proceeding
- Refuses to auto-commit if there are existing uncommitted changes
- Validates version format before making any changes
- Verifies all versions match after update
- Shows diff for review before commit
sign-windows.sh
Signs Windows executables with an Authenticode certificate using osslsigncode.
Usage
# Sign a Windows executable
./scripts/sign-windows.sh path/to/bd.exe
# Environment variables required for signing:
export WINDOWS_SIGNING_CERT_PFX_BASE64="<base64-encoded-pfx>"
export WINDOWS_SIGNING_CERT_PASSWORD="<certificate-password>"
What It Does
This script is called automatically by GoReleaser during the release process:
- Decodes the PFX certificate from base64
- Signs the Windows executable using osslsigncode
- Timestamps the signature using DigiCert's RFC3161 server
- Replaces the original binary with the signed version
- Verifies the signature was applied correctly
Prerequisites
osslsigncodeinstalled (apt install osslsigncodeorbrew install osslsigncode)- EV code signing certificate exported as PFX file
- GitHub secrets configured:
WINDOWS_SIGNING_CERT_PFX_BASE64- base64-encoded PFX fileWINDOWS_SIGNING_CERT_PASSWORD- certificate password
Graceful Degradation
If the signing secrets are not configured:
- The script prints a warning and exits successfully
- GoReleaser continues without signing
- The release proceeds with unsigned Windows binaries
This allows releases to work before a certificate is acquired.
Why This Script Exists
Windows code signing helps reduce antivirus false positives that affect Go binaries.
Kaspersky and other AV software commonly flag unsigned Go executables as potentially
malicious due to heuristic detection. See docs/reference/antivirus.md for details.
Future Scripts
Additional maintenance scripts may be added here as needed.