7 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6a4b4aa14e |
fix(hooks): identify the index context behind tracked-file refusals (#6457)
* fix(worktree): scrub inherited Git routing state Establish CWD as the worktree repository boundary before discovery can consume inherited Git routing. Fence the startup config probe, clear routing in-process before root pre-run discovery, and retain command-owned subprocess scrubbing as defense in depth without changing PID or signal semantics. Fixes #5531 Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell * refactor(worktree): explain owned filtering and remove an unused shim Document why filtering the fresh routing slice in place is safe and call the shared routing-key classifier directly from tests. Retain the two forwarders used by production worktree subprocess/removal paths. Review: https://github.com/gastownhall/beads/pull/5623#pullrequestreview-5098421671 Bead: saa-cgh.23 Agent-Signature: unknown-model/unknown-reasoning * fix(config): isolate identity and tracked-file Git probes from routing Reuse the worktree routing owner for GetIdentity and isGitTracked so explicit cwd/path selection is not displaced by inherited repository, index or injected config state. Preserve identity precedence and the tracked-secret refusal contract, with real target/decoy regressions. Follow-up: https://github.com/gastownhall/beads/issues/6222 Dependency: https://github.com/gastownhall/beads/pull/5623 Reported-by: bee-ghosttrack Bead: saa-cgh.93 Agent-Signature: unknown-model/unknown-reasoning * fix(config): share subprocess key identity for Git routing (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(exec): match Windows environment key identity (#5618) Centralize os/exec-compatible environment-key comparison and use it for credential, metrics, Git-hook, trace, and repro subprocess filters. Preserve exact Unix semantics and Unicode near-collisions. Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> * test(execenv): exercise every environment operation under both host rules Thread the host choice through narrow private helpers behind the existing exported functions. Keep one normalization owner and retain native wrapper tests; the additional table covers both host branches for equality, prefix matching, last-wins lookup, filtering and input preservation. Review: https://github.com/gastownhall/beads/pull/5672#pullrequestreview-5096948965 Bead: saa-cgh.78 Agent-Signature: unknown-model/unknown-reasoning * test(execenv): exercise exported host policy wiring (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(worktree): explain startup Git environment scope (saa-cgh.23) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): isolate role commands from Git routing (saa-cgh.99) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6357. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(env): exercise shared key helpers on native Windows (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitenv): share key parsing and normalize routing membership once (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(config): explain role command routing policy (saa-cgh.99) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(git): isolate domain role configuration from inherited routing (saa-cgh.109.5) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): probe the selected repository before configuring roles (saa-cgh.109.8) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(init): explain role probe discovery ceiling behavior (saa-cgh.109.8) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): bind proxied tail Git operations to selected directory (saa-cgh.109.14) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): preserve CRLF when appending project rules (saa-cgh.96) Reported by bee-ghosttrack in gastownhall/beads#6343. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(gitignore): pin detector edge cases and clarify append behavior (saa-cgh.96) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): preserve line endings in Git exclude appends (saa-cgh.104) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(gitignore): clarify exclude fixture path variable (saa-cgh.104) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): refuse exclude writes after read errors (saa-cgh.110) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitignore): share append byte composition (saa-cgh.105) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(gitignore): explain append aliasing and trailing CR completion (saa-cgh.105) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitignore): use shared composition for exclude rules (saa-cgh.111) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): omit the empty exclude leading separator (saa-cgh.112) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): bind exclude writers to the selected Git directory (saa-cgh.109.16) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): isolate tracked-file guard from Git routing (saa-cgh.98) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6356. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): retain legitimate inherited tracking context (saa-cgh.98) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(hooks): isolate trusted global configuration fixture (saa-cgh.98) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(hooks): explain conservative tracked-file guard (saa-cgh.98) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(git): resolve hooks paths in an explicit read-only context (saa-cgh.109.17.1) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * Bind init hook operations to the selected repository (saa-cgh.109.17) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * Give the hooks tail fixture an explicit remote context (saa-cgh.109.17) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(git): canonicalize the hooks fixture repository root (saa-cgh.109.17.1) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): complete selected hook options and alias handling (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Clarify hooks resolver ownership and preserve work-tree diagnostics (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Explain restoration of absent routing variables in selected exclude tests (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Keep init role operations on the captured selected Git context (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Align selected-tail fixtures with captured role authority (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Identify the Git index behind tracked-hook refusals (saa-cgh.120.13) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(review): repair work-tree-less hook install and the fail-open secret guard Maintainer adoption-review fixes for #6457 (iterations 1 and 2). Blocking: - cmd/bd, internal/git: `bd init` in a repository with no work tree stopped installing hooks and printed "Failed to resolve git hooks". git.ResolveHooksContext requires a work tree and deliberately errors without one, so routing the selected-init path through it lost a capability base had via beads.FindBeadsDir(). Add git.ResolveWorkTreelessHooksContext as the explicit counterpart (empty RepoRoot/MainRepoRoot, relative core.hooksPath anchored to the common directory) and fall back to it, so the install keeps the selected, scrubbed context rather than the inherited one. It keys on "the common directory resolved but the work tree did not", so it covers a bare repository and a cwd inside a repository's own .git alike, and still refuses non-repositories and directories inside a work tree. The `bare` and `git_dir_cwd` rows in the hooks table test pin both shapes and assert the install lands in the selected storage and configures the selected repository. - internal/config: isGitTracked scrubbed Git routing with no fallback, so in a checkout reachable only through legitimate GIT_DIR/GIT_WORK_TREE routing the probe found no repository at all, the guard concluded "untracked", and `bd config set <secret-key>` wrote the credential into a git-tracked config.yaml where base refused. Give it the same two-probe shape as hooks.gitTrackedFileContextWithEnv, with a legitimate-routing test. - internal/config, internal/gitenv, docs: state the GIT_CEILING_DIRECTORIES widening plainly rather than pairing it with a containment clause that is false at every live call site. `-C`/cmd.Dir fixes where discovery starts, not where it stops, so with the ceiling scrubbed the walk can reach a containing repository above cwd; all three gitDirsForRepo call sites pass the process working directory, which need not be a repository root. This mirrors the wording init_proxied_server.go already had, so the tree no longer holds contradictory statements about the same primitive. - cmd/bd/config.go: the policy comment claimed all role commands ignore inherited Git routing. Name the scrubbed paths without asserting a closed set -- `bd config set/get/unset/set-many beads.role`, and the proxied-init role tail, which goes through domain.GitUseCase.BeadsRole/SetBeadsRole and is scrubbed on both of that repository's constructor arms -- and say that a path which does not scrub still goes through the inherited environment: such readers include internal/routing.roleFromGitConfig, RepoContext.Role, doctor.CheckBeadsRole, `bd config show` and init.getBeadsRole; such writers include init.setBeadsRole, `bd init --contributor` and `bd hooks --uninstall`. The earlier wording framed the exception as role *resolution* only, which reads as isolating the write plane when it is not isolated; a quantifier over "every other" reader and writer goes stale in the opposite direction, since set-many and the proxied-init tail are scrubbed, so neither list is exhaustive here. Non-blocking: - Scope the worktrees.md paragraph to the one startup probe that is scrubbed. - Replace normalizeWorktreeGitEnvKey's ToUpper fold with execenv.KeyEqualForOS so one subprocess key identity survives the PR. - Compare beads.role against domain.BeadsRoleConfigKey with strings.ToLower rather than strings.EqualFold, matching execenv.keyIdentityForWindows and git's ASCII-only key folding, and pin it with Beads.Role/BEADS.ROLE rows through GetConfig/SetConfig. - Share the HooksContext workDir anchoring and symlink/case normalization between both resolvers, so no producer of that type emits a spelling the others do not. - Branch the tracked-hook remediation hint on the proof label, so the inherited case points at the routing rather than at `git rm --cached`. - Restore the hook-status gate on the pure-JJ alias hint (base parity). - Note that the boolean tracked-file wrappers are test-only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(review): reconcile the beads.role scrub with base #6477 on the refreshed base Refreshing onto main |
||
|
|
cefcabb1e3 |
fix(gitenv): retain explicit null config suppression (#6461)
* fix(exec): match Windows environment key identity (#5618)
Centralize os/exec-compatible environment-key comparison and use it for credential, metrics, Git-hook, trace, and repro subprocess filters. Preserve exact Unix semantics and Unicode near-collisions.
Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell
Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com>
* fix(worktree): scrub inherited Git routing state
Establish CWD as the worktree repository boundary before discovery can consume inherited Git routing. Fence the startup config probe, clear routing in-process before root pre-run discovery, and retain command-owned subprocess scrubbing as defense in depth without changing PID or signal semantics.
Fixes #5531
Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell
* refactor(worktree): explain owned filtering and remove an unused shim
Document why filtering the fresh routing slice in place is safe and call
the shared routing-key classifier directly from tests. Retain the two
forwarders used by production worktree subprocess/removal paths.
Review: https://github.com/gastownhall/beads/pull/5623#pullrequestreview-5098421671
Bead: saa-cgh.23
Agent-Signature: unknown-model/unknown-reasoning
* fix(config): isolate identity and tracked-file Git probes from routing
Reuse the worktree routing owner for GetIdentity and isGitTracked so
explicit cwd/path selection is not displaced by inherited repository,
index or injected config state. Preserve identity precedence and the
tracked-secret refusal contract, with real target/decoy regressions.
Follow-up: https://github.com/gastownhall/beads/issues/6222
Dependency: https://github.com/gastownhall/beads/pull/5623
Reported-by: bee-ghosttrack
Bead: saa-cgh.93
Agent-Signature: unknown-model/unknown-reasoning
* test(execenv): exercise every environment operation under both host rules
Thread the host choice through narrow private helpers behind the existing
exported functions. Keep one normalization owner and retain native wrapper
tests; the additional table covers both host branches for equality, prefix
matching, last-wins lookup, filtering and input preservation.
Review: https://github.com/gastownhall/beads/pull/5672#pullrequestreview-5096948965
Bead: saa-cgh.78
Agent-Signature: unknown-model/unknown-reasoning
* docs(worktree): explain startup Git environment scope (saa-cgh.23)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(execenv): exercise exported host policy wiring (saa-cgh.78)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(config): share subprocess key identity for Git routing (saa-cgh.93)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(config): isolate role commands from Git routing (saa-cgh.99)
Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6357.
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(env): exercise shared key helpers on native Windows (saa-cgh.78)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* refactor(gitenv): share key parsing and normalize routing membership once (saa-cgh.93)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* docs(config): explain role command routing policy (saa-cgh.99)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(config): isolate role readers from inherited Git routing (saa-cgh.109.1)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(doctor): isolate role lookups from inherited Git routing (saa-cgh.109.2)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(git): isolate domain role configuration from inherited routing (saa-cgh.109.5)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(doctor): isolate explicit-path worktree fallback from Git routing (saa-cgh.109.6)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(init): probe the selected repository before configuring roles (saa-cgh.109.8)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(beads): cover common-directory role routing (saa-cgh.109.1)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(git): explain system config routing flags (saa-cgh.109.6)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* docs(init): explain role probe discovery ceiling behavior (saa-cgh.109.8)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(beads): scope stable worktree probes to selected path (saa-cgh.109.13)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(init): bind proxied tail Git operations to selected directory (saa-cgh.109.14)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* Clarify selected discovery probes and cover separate routing vectors (saa-cgh.120)
Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell
* Keep init role operations on the captured selected Git context (saa-cgh.120)
Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell
* Observe inline Git configuration directly in linked-worktree fixture (saa-cgh.120)
Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell
* Align selected-tail fixtures with captured role authority (saa-cgh.120)
Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell
* fix(beads): select explicit directory discovery context (GH#6384) (saa-cgh.120.6)
Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell
* fix(gitenv): retain explicit Git config suppression (saa-cgh.120.7)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* test(config): pin identity under null config suppression (saa-cgh.120.7)
Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
* fix(gitenv): keep role authority off inherited config suppression
Maintainer review fixes for PR #6461 (adopt-pr iterations 1-2). Addresses the
three major findings raised against the contributor branch, plus the major,
three minors and nit that iteration 2 raised against the first fixup; each fix
is pinned by a test that was mutation-proved against the pre-fix source.
F1 (major, security) — the leaf exempts GIT_CONFIG_GLOBAL=/dev/null,
GIT_CONFIG_SYSTEM=/dev/null and GIT_CONFIG_NOSYSTEM from ScrubRouting. Null
suppression cannot redirect a read, but it can blind one, and DetectUserRole
answers a missed read with detectFromURL, whose no-remote and SSH arms both
return Maintainer. Reproduced on this branch: a global beads.role=contributor
with GIT_CONFIG_GLOBAL=/dev/null resolved to maintainer, where the leaf's
parent
|
||
|
|
70a12ba664 |
fix(init): write embedded excludes in the selected project (#6462)
* fix(worktree): scrub inherited Git routing state Establish CWD as the worktree repository boundary before discovery can consume inherited Git routing. Fence the startup config probe, clear routing in-process before root pre-run discovery, and retain command-owned subprocess scrubbing as defense in depth without changing PID or signal semantics. Fixes #5531 Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell * refactor(worktree): explain owned filtering and remove an unused shim Document why filtering the fresh routing slice in place is safe and call the shared routing-key classifier directly from tests. Retain the two forwarders used by production worktree subprocess/removal paths. Review: https://github.com/gastownhall/beads/pull/5623#pullrequestreview-5098421671 Bead: saa-cgh.23 Agent-Signature: unknown-model/unknown-reasoning * fix(config): isolate identity and tracked-file Git probes from routing Reuse the worktree routing owner for GetIdentity and isGitTracked so explicit cwd/path selection is not displaced by inherited repository, index or injected config state. Preserve identity precedence and the tracked-secret refusal contract, with real target/decoy regressions. Follow-up: https://github.com/gastownhall/beads/issues/6222 Dependency: https://github.com/gastownhall/beads/pull/5623 Reported-by: bee-ghosttrack Bead: saa-cgh.93 Agent-Signature: unknown-model/unknown-reasoning * fix(config): share subprocess key identity for Git routing (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(exec): match Windows environment key identity (#5618) Centralize os/exec-compatible environment-key comparison and use it for credential, metrics, Git-hook, trace, and repro subprocess filters. Preserve exact Unix semantics and Unicode near-collisions. Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> * test(execenv): exercise every environment operation under both host rules Thread the host choice through narrow private helpers behind the existing exported functions. Keep one normalization owner and retain native wrapper tests; the additional table covers both host branches for equality, prefix matching, last-wins lookup, filtering and input preservation. Review: https://github.com/gastownhall/beads/pull/5672#pullrequestreview-5096948965 Bead: saa-cgh.78 Agent-Signature: unknown-model/unknown-reasoning * test(execenv): exercise exported host policy wiring (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(worktree): explain startup Git environment scope (saa-cgh.23) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): isolate role commands from Git routing (saa-cgh.99) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6357. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(env): exercise shared key helpers on native Windows (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitenv): share key parsing and normalize routing membership once (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(config): explain role command routing policy (saa-cgh.99) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): isolate role configuration from inherited Git routing (saa-cgh.109.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): use the selected origin in contributor setup (saa-cgh.109.7) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): isolate Git writes in planning repositories (saa-cgh.109.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): retain inherited planning commit author (saa-cgh.109.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): align embedded role gates with selected Git context (saa-cgh.109.12) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): scope embedded artifact Git operations to selected directory (saa-cgh.109.15) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): cover selected optional artifacts and explain refused commits (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Honor role-probe cancellation and exercise actual fork planning (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(init): warn when automatic contributor role write fails (saa-cgh.109.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): cover successful nonquiet contributor role writes (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Assert the automatic contributor setup banner alongside warnings (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * test(init): read persisted role routing from the store (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(git): isolate domain role configuration from inherited routing (saa-cgh.109.5) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): probe the selected repository before configuring roles (saa-cgh.109.8) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(init): explain role probe discovery ceiling behavior (saa-cgh.109.8) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): bind proxied tail Git operations to selected directory (saa-cgh.109.14) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): preserve CRLF when appending project rules (saa-cgh.96) Reported by bee-ghosttrack in gastownhall/beads#6343. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(gitignore): pin detector edge cases and clarify append behavior (saa-cgh.96) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): preserve line endings in Git exclude appends (saa-cgh.104) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(gitignore): clarify exclude fixture path variable (saa-cgh.104) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): refuse exclude writes after read errors (saa-cgh.110) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitignore): share append byte composition (saa-cgh.105) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(gitignore): explain append aliasing and trailing CR completion (saa-cgh.105) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitignore): use shared composition for exclude rules (saa-cgh.111) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(gitignore): omit the empty exclude leading separator (saa-cgh.112) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): bind exclude writers to the selected Git directory (saa-cgh.109.16) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * Explain restoration of absent routing variables in selected exclude tests (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Keep init role operations on the captured selected Git context (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Align selected-tail fixtures with captured role authority (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(init): write embedded excludes in the selected project (saa-cgh.120.11) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): scrub the fork auto-detect gate; scope the startup-scrub claims Maintainer review fixup for PR #6462 (adoption review iterations 1-2). Gating major — hardened startup probe with an unhardened twin ------------------------------------------------------------ config.gitDirsForRepo (internal/config/config.go:419-424) is scrubbed by this stack, but its byte-identical database-path twin beads.worktreeFallbackBeadsDirForRepo (internal/beads/beads.go:1054-1058) runs the same `git -C <repoPath> rev-parse --git-dir --git-common-dir` for the same purpose and is not. Two claims added in this range asserted the boundary was universal: - docs/reference/worktrees.md:15 "Startup Git discovery probes for every `bd` command scrub inherited Git routing variables" (false universal) - cmd/bd/worktree_cmd.go:712 "Startup config discovery applies the same boundary to its one pre-hook Git probe" (false singular) Both are narrowed here to name only the plane that is actually scrubbed, and to state that the `.beads` database-discovery probes still honor inherited routing. The review offered a code arm (scrub beads.gitOutput, beads.worktreeFallbackBeadsDirForRepo, and internal/git/gitdir.go:32) as the alternative. That arm is DECLINED for this leaf, measured rather than assumed: - Open sibling PR #6461 already carries it. At refs/pull/6461/head, internal/beads/beads.go:293 routes gitOutput through gitOutputEnv(gitenv.ScrubRouting(os.Environ())) and :1069 sets cmd.Env = gitenv.ScrubRouting(os.Environ()) in the ResolveBeadsDirForRepo twin, with internal/beads/{beads,context}_test.go coverage. Our head has zero gitenv references under internal/beads (grep control). - internal/git/gitdir.go is restructured wholesale by open sibling PR #6464 (loadGitContext/ResolveHooksContext), which documents "Routing variables are honored, not filtered" as a deliberate choice. - internal/beads/ and internal/git/ are not among this PR's 47 files, so the code arm would rewrite two functions an open, non-ancestor sibling is already rewriting in files this PR does not otherwise touch. The twin is filed as bd-p4che with the failure scenario, the three unhardened sites, the required decoy test, and the #6461 merge-order note, so the work is tracked whether or not #6461 lands. Minor — fork auto-detect gate left on inherited routing ------------------------------------------------------ cmd/bd/init.go:2002 gated the fork auto-detect block on the unscrubbed isGitRepo() while the same single hunk hardened three setupForkExcludeAt(cwd, …) call sites around it, and five sibling role gates in this PR already use the scrubbed isInitRoleGitRepo(ctx). Under the invalid inherited GIT_DIR this PR's own matrix uses, that gate returns false in a real fork clone and silently suppresses the whole block — prompt, non-interactive auto-configure, and the hardened writer at :2007/:2019. Switched to isInitRoleGitRepo(ctx) (same argv, plus the scrub). Pinned by a new fork_auto_invalid row in TestEmbeddedInitSelectedExcludeRouting: it drops --setup-exclude so the exclude write is reachable only through the gate, adds an upstream remote so the already-scrubbed detectForkSetup reports a fork, and keeps --role=maintainer so autoConfigureForkContributor stays an early return and the gate is the only path that can add the pattern. The row carries the same fixture guard the sibling role test uses, asserting the inherited probe really is refused. Mutation-proved: with the gate reverted to isGitRepo() and the row in place, only fork_auto_invalid fails ("selected exclude = "# owned project exclude\nkeep-me/\n"; want ... "**/RECOVERY*.md"") while all six incumbent subtests stay green — so the row adds coverage rather than duplicating an existing fixture. Not taken (non-gating, recorded so the next pass grades the call rather than re-filing it) ---------------------------------------------------------------------------- - per-key `beads.role` scrub inside the generic accessor (internal/storage/domain/git/git.go:110,133): the constructor contract it straddles is owned by the parent legs; #6464 also edits this file. - splitting gitenv.routingKeys into redirect vs fence sets (internal/gitenv/routing.go): the class was filed on the parent PRs and the set is shared by the whole family; changing it here would fork a primitive five open branches consume. - deleting the three zero-caller wrappers in cmd/bd/init_stealth.go: cmd/bd/init_stealth.go is concurrently rewritten by open sibling #6461, which does not carry this leg's setupStealthModeAt/setupGitExcludeAt split (base |
||
|
|
ac1ec5dc4c |
fix(init): bootstrap Git in the selected project directory (#6459)
* fix(worktree): scrub inherited Git routing state Establish CWD as the worktree repository boundary before discovery can consume inherited Git routing. Fence the startup config probe, clear routing in-process before root pre-run discovery, and retain command-owned subprocess scrubbing as defense in depth without changing PID or signal semantics. Fixes #5531 Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell * refactor(worktree): explain owned filtering and remove an unused shim Document why filtering the fresh routing slice in place is safe and call the shared routing-key classifier directly from tests. Retain the two forwarders used by production worktree subprocess/removal paths. Review: https://github.com/gastownhall/beads/pull/5623#pullrequestreview-5098421671 Bead: saa-cgh.23 Agent-Signature: unknown-model/unknown-reasoning * fix(config): isolate identity and tracked-file Git probes from routing Reuse the worktree routing owner for GetIdentity and isGitTracked so explicit cwd/path selection is not displaced by inherited repository, index or injected config state. Preserve identity precedence and the tracked-secret refusal contract, with real target/decoy regressions. Follow-up: https://github.com/gastownhall/beads/issues/6222 Dependency: https://github.com/gastownhall/beads/pull/5623 Reported-by: bee-ghosttrack Bead: saa-cgh.93 Agent-Signature: unknown-model/unknown-reasoning * fix(config): share subprocess key identity for Git routing (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(exec): match Windows environment key identity (#5618) Centralize os/exec-compatible environment-key comparison and use it for credential, metrics, Git-hook, trace, and repro subprocess filters. Preserve exact Unix semantics and Unicode near-collisions. Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> * test(execenv): exercise every environment operation under both host rules Thread the host choice through narrow private helpers behind the existing exported functions. Keep one normalization owner and retain native wrapper tests; the additional table covers both host branches for equality, prefix matching, last-wins lookup, filtering and input preservation. Review: https://github.com/gastownhall/beads/pull/5672#pullrequestreview-5096948965 Bead: saa-cgh.78 Agent-Signature: unknown-model/unknown-reasoning * test(execenv): exercise exported host policy wiring (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(worktree): explain startup Git environment scope (saa-cgh.23) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): isolate role commands from Git routing (saa-cgh.99) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6357. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(env): exercise shared key helpers on native Windows (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitenv): share key parsing and normalize routing membership once (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(config): explain role command routing policy (saa-cgh.99) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): isolate role configuration from inherited Git routing (saa-cgh.109.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): use the selected origin in contributor setup (saa-cgh.109.7) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): isolate Git writes in planning repositories (saa-cgh.109.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): retain inherited planning commit author (saa-cgh.109.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): align embedded role gates with selected Git context (saa-cgh.109.12) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init): scope embedded artifact Git operations to selected directory (saa-cgh.109.15) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): cover selected optional artifacts and explain refused commits (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Honor role-probe cancellation and exercise actual fork planning (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(init): warn when automatic contributor role write fails (saa-cgh.109.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(init): cover successful nonquiet contributor role writes (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Assert the automatic contributor setup banner alongside warnings (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * test(init): read persisted role routing from the store (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Bind early embedded Git bootstrap to the selected project (saa-cgh.120.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * Create the owned separate-storage parent in the bootstrap fixture (saa-cgh.120.9) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(init,gitenv,config): maintainer fixup for #6459 Review iteration 1, blocking: - cmd/bd/init_stealth.go: scope the fork exclude writer the way this PR scoped the fork detector. detectForkSetup now scrubs inherited Git routing, but resolveGitExcludePath still ran `git rev-parse --git-common-dir` with no Dir and no Env, so with GIT_DIR inherited toward another repository bd detected the fork in the selected repo and then appended `.beads/`, `**/RECOVERY*.md` and `**/SESSION*.md` to the *inherited* repository's .git/info/exclude - automatically, with no prompt, in non-interactive mode. At base the two halves agreed (both saw the inherited repo, found no upstream, wrote nothing), so the PR is what creates the disagreement. Scrubbing the probe is the whole remedy: no cmd/bd caller chdirs, so `repoPath == ""` already means the selected project directory once inherited routing is gone. The new test asserts both halves - the selected repo is written, the inherited one is byte-unchanged - and reverting the scrub reds it while every existing exclude test stays green. - cmd/bd/config.go: the new comment claimed "All role commands ignore inherited Git routing". Only bd config's own role paths were hardened - routing.DetectUserRole, `bd config show`, `bd doctor` and `bd hooks uninstall` still resolve beads.role through the inherited environment, and beads.RepoContext.Role pins GIT_DIR/GIT_WORK_TREE last-wins but still inherits GIT_CONFIG_*. So `bd config get beads.role` and `bd config show` can disagree in one shell, and `bd config unset beads.role` and `bd hooks uninstall` can target different repositories. Narrow the comment to the command set it covers; widening the boundary to the deciders is a separate, permissions-adjacent change. The same root cause is filed on #6460 and #6464, where it is broader - fix it once, on whichever merges first. Review iteration 1, non-blocking: - docs/reference/worktrees.md: the new prose claimed startup Git discovery probes for every bd command scrub inherited routing. Only internal/config's gitDirsForRepo does; internal/git's process-cached context does not. Narrow the sentence to config discovery and name both sides. - internal/gitenv/routing.go: say in the contract comment why GIT_CEILING_DIRECTORIES is a routing key even though it narrows rather than redirects, and disclose that removing it widens the upward search. Pin the membership with a ceiling entry in the existing scrub table. - cmd/bd/worktree_cmd.go: route the removal pass's key identity through execenv.KeyIdentityForOS instead of the last hand-rolled fold. ToUpper is the opposite direction from the shared primitive and provably non-equivalent: on Windows it collapsed GıT_OPTIONAL_LOCKS (U+0131) onto GIT_OPTIONAL_LOCKS and stripped an unrelated variable that gitenv.ScrubRoutingForOS, one line earlier, keeps. Validation: go build ./..., go vet, CGO_ENABLED=0 vet and GOOS=windows CGO_ENABLED=0 vet all clean; internal/gitenv green; cmd/bd filtered run green except TestGetNotionConfigReadsDBPathWhenStoreUnset and TestConfigValidateReadOnlyIsHermetic, which fail identically at the unmodified head. All three new pins mutation-proved. Review iteration 2, non-blocking: - internal/config/worktree_config_test.go, cmd/bd/init_git_bootstrap_routing_test.go: finish the conditional half of iteration 1's GIT_CEILING_DIRECTORIES item. That item offered "drop the key" or "keep it and say so - and if kept, add a legitimate-ceiling case to the two cited tests". The docs arm was taken but only one of the two tests got a case, and the half left unpinned is the widening the new contract comment now promises. Both new cases set a *legitimate* ceiling - an operator fencing off an ancestor - and assert the scrub widens past it: startup config discovery still resolves the main repository's shared config, and `bd init`'s bootstrap probe still resolves the containing repository. Each carries a control that fails the test if the ceiling did not bite, so neither can pass vacuously. Dropping GIT_CEILING_DIRECTORIES from routingKeys reds both new pins while TestWorktreeFallbackConfigPathIgnoresInheritedGitRouting and TestSetupForkExcludeIgnoresInheritedGitRouting stay green, so they cover an arm the poisoned-routing pins do not. The review prescribed this assertion in the inverted direction ("a fenced-off ancestor does not suppress the fresh git init"). Measured against git 2.43.0: a ceiling at a repository root does fence off a probe run from a subdirectory, so scrubbing it makes the ancestor visible and the fresh `git init` is suppressed. The tests pin the measured direction. - cmd/bd/init_stealth.go: the scrub makes resolveGitExcludePath's "not a git repository" newly reachable from `bd init --setup-exclude` exactly where the cause is interesting, but the probe's error was discarded. Thread git's own reason through, reusing firstNonEmptyLine from sync_git.go, which already exists for this failure shape. exec.ExitError.Error() is only "exit status 128", so a bare %w would have added nothing readable. The "not a git repository" prefix is load-bearing - setupStealthMode matches it with strings.Contains to treat this as a skip - and is preserved. Rendered: Warning: failed to configure git exclude: not a git repository (inherited Git routing is ignored here): fatal: not a git repository (or any of the parent directories): .git Validation (iteration 2): gofmt clean; go build ./...; go vet, CGO_ENABLED=0 go vet and GOOS=windows CGO_ENABLED=0 go vet clean on cmd/bd and internal/config. Both new pins green and mutation-proved as described; the nine existing cmd/bd exclude/routing/fold pins, the internal/config worktree-fallback set, and the internal/gitenv and internal/execenv suites all stay green. No production behavior change beyond the error text. --------- Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com> Co-authored-by: Julian Knutsen <julian@example.com> |
||
|
|
79631656c0 |
fix(config): pin role writes to a fresh common-config context (#6454)
* fix(exec): match Windows environment key identity (#5618) Centralize os/exec-compatible environment-key comparison and use it for credential, metrics, Git-hook, trace, and repro subprocess filters. Preserve exact Unix semantics and Unicode near-collisions. Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> * fix(worktree): scrub inherited Git routing state Establish CWD as the worktree repository boundary before discovery can consume inherited Git routing. Fence the startup config probe, clear routing in-process before root pre-run discovery, and retain command-owned subprocess scrubbing as defense in depth without changing PID or signal semantics. Fixes #5531 Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell * refactor(worktree): explain owned filtering and remove an unused shim Document why filtering the fresh routing slice in place is safe and call the shared routing-key classifier directly from tests. Retain the two forwarders used by production worktree subprocess/removal paths. Review: https://github.com/gastownhall/beads/pull/5623#pullrequestreview-5098421671 Bead: saa-cgh.23 Agent-Signature: unknown-model/unknown-reasoning * fix(config): isolate identity and tracked-file Git probes from routing Reuse the worktree routing owner for GetIdentity and isGitTracked so explicit cwd/path selection is not displaced by inherited repository, index or injected config state. Preserve identity precedence and the tracked-secret refusal contract, with real target/decoy regressions. Follow-up: https://github.com/gastownhall/beads/issues/6222 Dependency: https://github.com/gastownhall/beads/pull/5623 Reported-by: bee-ghosttrack Bead: saa-cgh.93 Agent-Signature: unknown-model/unknown-reasoning * test(execenv): exercise every environment operation under both host rules Thread the host choice through narrow private helpers behind the existing exported functions. Keep one normalization owner and retain native wrapper tests; the additional table covers both host branches for equality, prefix matching, last-wins lookup, filtering and input preservation. Review: https://github.com/gastownhall/beads/pull/5672#pullrequestreview-5096948965 Bead: saa-cgh.78 Agent-Signature: unknown-model/unknown-reasoning * docs(worktree): explain startup Git environment scope (saa-cgh.23) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(execenv): exercise exported host policy wiring (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): share subprocess key identity for Git routing (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): isolate tracked-file guard from Git routing (saa-cgh.98) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6356. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): isolate role commands from Git routing (saa-cgh.99) Follow-up to bee-ghosttrack's review of gastownhall/beads#6322; refs #6357. Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(env): exercise shared key helpers on native Windows (saa-cgh.78) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * refactor(gitenv): share key parsing and normalize routing membership once (saa-cgh.93) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * docs(config): explain role command routing policy (saa-cgh.99) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): retain legitimate inherited tracking context (saa-cgh.98) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(hooks): isolate trusted global configuration fixture (saa-cgh.98) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): isolate role cleanup in the selected repository (saa-cgh.109.4) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): reset only common local role configuration (saa-cgh.109.10) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): scope hooks-path cleanup to selected common config (saa-cgh.109.11) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(hooks): make worktree role preservation independent (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * Report selected config read failures during hook reset (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(hooks): keep successful config stdout separate from diagnostics (saa-cgh.120) Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell * fix(config): pin role writes to fresh common context (GH#6384) (saa-cgh.120.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config): retain Git diagnostics from role writes (saa-cgh.120.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * test(config): assert the actual Git lock diagnostic (saa-cgh.120.3) Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell * fix(config,hooks): restore the inherited-tracking fallback in the secret guard Maintainer review fixes for PR #6454 (adopt-pr iteration 1). The scorecard approved at 913/1000 with no blocker or major surviving synthesis; these are the non-gating findings that were cheap to close while the fixup was open. Finding 1 (minor, security) is the only in-range regression in the report. The range switched internal/config.isGitTracked from the inherited environment to gitenv.ScrubRouting only, so a config.yaml tracked solely through legitimate routing -- a bare repository whose work tree is named by GIT_DIR/GIT_WORK_TREE -- reported untracked, and a secret-key write that upstream-base refused was silently allowed. Restores the scrubbed-then-inherited union the same stack already gave cmd/bd.isGitTrackedFile. Finding 4 (nit) composes with it rather than conflicting, so both land as one change: the inherited probe now runs only when the scrubbed probe failed for a configuration reason. git's exit codes discriminate exactly -- 0 tracked, 1 repository reached but path untracked (final), 128 no reachable repository -- so the ordinary untracked-hook miss no longer spawns a second `git ls-files` while the bare-work-tree fallback is preserved. Finding 2 (minor). scrubWorktreeRemovalGitEnvForOS keyed its stricter no-optional-locks policy on strings.ToUpper while the rest of the PR uses execenv key identity. The two disagree in both directions on Windows: GIT_OPTIONAL_LOCKS with a dotted capital I (U+0130) survived the scrub although Git honors it, and GIT_OPTIONAL_LOCK with a long s (U+017F) was dropped although os/exec keeps it distinct. normalizeWorktreeGitEnvKey is deleted in favour of execenv.KeyEqualForOS. Base applied ToUpper on all platforms, so this is a consistency fix in newly rewritten code, not a regression. Finding 5 (nit). The comment above resetHooksPathIfBeadsManaged's probe asserted that repoRoot and commonDir share the cached Git context. Probed false: with cwd A and GIT_DIR=B/.git, `git rev-parse --git-common-dir --show-toplevel` prints B/.git and A. Restated as intent. Finding 3 (scrubGitHookEnv is a fifth, strictly weaker routing scrubber) is deliberately not taken here: cmd/bd/export_auto.go is untouched by this range, so the hazard is byte-identical at base, and the synthesis scoped it to a follow-up bead rather than growing this stack. Each fix is mutation-proved. Reverting isGitTracked reds only the new TestSecretGitTrackingHonorsInheritedBareWorkTree -- including "refusal = <nil>", the actual security consequence -- while the incumbent decoy test stays green, so the pin adds coverage rather than duplicating it. Restoring ToUpper reds only the new Windows row, showing both directions at once. TestGuardHookWritePathHonorsInheritedRepository gains a fixture guard asserting its scrubbed probe fails for a configuration reason rather than exit 1, so a future fixture change cannot silently make the fallback unreachable. scrubWorktreeRemovalGitEnvForOS had no test at all before this. Green locally: ./internal/config, ./internal/execenv, ./internal/gitenv, ./internal/githooksenv, ./internal/gittraceenv, ./internal/metrics, ./scripts, ./internal/beads (the GIT_CONFIG_GLOBAL blast radius neither reviewer ran), and a blast-radius cmd/bd run over the hooks, worktree, role and uninstall suites. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Signed-off-by: Ewen Cuthiell <ewencuthiell@gmail.com> Co-authored-by: Bee <bee@ghosttrack.com> Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local> Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
69e33099b8 |
docs: apply PR #4722 review feedback to user docs
- FAQ: fix bulk migration/export commands (tracker pull/push need explicit IDs; bulk lives on sync --pull-only / --pull / --push-only / --push) and correct the cross-project isolation claim (hydration + external targets) - quickstart: replace the broken DOLT.md blob URL with site links - installation: Quick Install Script heading matches its macOS/Linux/FreeBSD body - rewrite 33 stale SCREAMING_CASE link labels to the target pages' titles - add description frontmatter to the 55 authored pages missing it - docs.json: wildcard redirects for the old /next/ and version-prefixed route spaces (1.0.0, 1.0.4, 1.0.5) |
||
|
|
a86a2c5dfc |
docs: port user docs into the Mintlify site tree under docs/
Port the website's current (non-versioned) authored pages into docs/ as
Mintlify pages: frontmatter title as H1 (body H1s removed), Docusaurus
admonitions converted to Mintlify components, root-relative extensionless
links, mermaid fences kept as-is. website/docs/** is untouched and keeps
serving the Docusaurus site until cutover.
git-mv the user-facing docs/ originals with no website twin into the new
IA (core-concepts/, architecture/, workflows/, recovery/, multi-agent/,
integrations/, reference/), converted to Mintlify form. The six files
previously mirrored by sync-website-docs.sh now live once in the site.
ERROR_HANDLING.md and CONTRIBUTOR_NAMESPACE_ISOLATION.md move to engdocs/
(contributor pattern guide and design doc per content review).
Pointer stubs remain at docs/{DOLT,STORAGE-BACKENDS,PLUGIN,RECOVERY,
JSON_SCHEMA}.md because released bd binaries print those paths; QUICKSTART
and DOLT-BACKEND stay as existing pointer stubs.
Corrected while porting: the intro's storage diagram claimed data lives at
.beads/dolt/; embedded mode (the default) uses .beads/embeddeddolt/
(internal/storage/embeddeddolt/store.go), server mode uses .beads/dolt/.
|
Renamed from docs/WORKTREES.md (Browse further)