Skip to content

fix(beads): harden worktree identity checks#1460

Merged
christso merged 6 commits into
mainfrom
av-21i-beads-workmux-hardening
Jun 22, 2026
Merged

fix(beads): harden worktree identity checks#1460
christso merged 6 commits into
mainfrom
av-21i-beads-workmux-hardening

Conversation

@christso

@christso christso commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

AgentV no longer tracks checkout-local Beads identity or live Beads config. The repo keeps only the Beads template (.beads/config.yaml.example) and .beads/.gitignore, while .beads/config.yaml, .beads/metadata.json, and runtime state stay local.

This also removes the stale AgentV workflow note that treated .beads/metadata.json as intentionally tracked. Developer-specific Beads workflow guidance now lives in the shared Beads skill.

Verification

  • git diff --check
  • bd --readonly config get federation.remote reports git+https://github.com/EntityProcess/agentv-beads.git from the local config
  • git ls-files .beads reports only .beads/.gitignore and .beads/config.yaml.example

Post-Deploy Monitoring & Validation

No additional production monitoring required. This is repo coordination config only. After merge, copy .beads/config.yaml.example to .beads/config.yaml in a local checkout, then validate with git ls-files .beads and bd --readonly config get federation.remote.


Compound Engineering
Codex GPT-5

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cd9a3c
Status: ✅  Deploy successful!
Preview URL: https://e5bb5511.agentv.pages.dev
Branch Preview URL: https://av-21i-beads-workmux-hardeni.agentv.pages.dev

View logs

@christso

Copy link
Copy Markdown
Collaborator Author

Review/dogfood update: PR #1460 is not merge-ready as-is. The focused dogfood pass for the current checkout passed, but the stricter review found two P1 Beads identity/bootstrap regressions:

  1. Removing .beads/metadata.json strands existing embedded Dolt data under the wrong database identity. Without metadata, bd falls back to database beads; bd --readonly list returns no issues. Restoring metadata resolves database av and returns real av-* issues.
  2. bd bootstrap keys off sync.remote, not federation.remote. Because EntityProcess/agentv still advertises refs/dolt/data, fresh bootstrap can choose the code repo instead of EntityProcess/agentv-beads.

I pushed a stacked draft fix PR here: #1461

That branch adds sync.remote and restores the stable metadata identity behavior; its net diff against origin/main is only .beads/config.yaml adding sync.remote. Verification covered fresh bootstrap, existing embedded-Dolt data, red check without metadata, and diff checks.

@christso

Copy link
Copy Markdown
Collaborator Author

Blocking review result for current head b089848a.

I re-checked the two earlier P1s and they are still present in #1460:

  1. .beads/metadata.json is still deleted and .beads/.gitignore now ignores metadata.json. That removes the tracked embedded Dolt identity (dolt_database: av, project_id: a7aea826-...) rather than preserving/recovering it, so existing embedded Dolt data can still fall back to database beads / zero issues.
  2. .beads/config.yaml.example only sets federation.remote. It still does not set sync.remote, and bd bootstrap explicitly keys off sync.remote first. In a disposable fresh fixture using this PR template, bd bootstrap --dry-run --json planned:
    • database: "beads"
    • sync_remote: "git+https://github.com/EntityProcess/agentv.git"
    • reason: found Dolt data on git origin, so it would clone from the code repo.

The av-21i acceptance criteria are therefore not met yet: no PR-local change/runbook covers the code-repo vs beads-repo split and recovery path, and no metadata/db mismatch guard with an actionable fix is included in this diff.

Checks run:

  • git diff --check origin/main...refs/review/pr-1460-head passed.
  • git ls-tree -r --name-only refs/review/pr-1460-head .beads shows only .beads/.gitignore and .beads/config.yaml.example.
  • Disposable /tmp bootstrap dry-run reproduced the sync.remote/code-repo selection issue above.

CI is green and the PR remains draft, but this is not merge-ready.

@christso

Copy link
Copy Markdown
Collaborator Author

Implementation follow-up for av-21i.2 is pushed at head 59be3180.

Changes:

  • Restored tracked .beads/metadata.json with AgentV embedded Dolt identity (dolt_database: av, project a7aea826-0087-45fc-93f5-9084e9924e8b).
  • Removed metadata.json from .beads/.gitignore while keeping checkout-local .beads/config.yaml ignored.
  • Added sync.remote to .beads/config.yaml.example so bootstrap templates select git+https://github.com/EntityProcess/agentv-beads.git instead of the public code repo.
  • Added scripts/check-beads-context.ts, bun run beads:check, and docs/runbooks/beads-worktree-recovery.md with the code-repo vs Beads-repo split, recovery steps, and metadata/bootstrap mismatch fix hints.

Verification run:

  • git diff --check
  • git diff --check origin/main...HEAD
  • bun run beads:check -- --skip-bd
  • bun run beads:check -- --fixture (disposable fresh-bootstrap fixture resolved database av and bootstrap sync_remote to EntityProcess/agentv-beads)
  • bun run beads:check (passed with one expected warning that this worktree uses the primary checkout Beads dir)
  • bun run lint

Relevant-suite search: I did not find an existing Beads/workmux test suite beyond this guard/script path.

Remaining status: PR #1460 is still draft and should remain draft until independent re-review. Refreshed GitHub checks have started and were still pending when checked after push.

@christso

Copy link
Copy Markdown
Collaborator Author

CI update for head 59be3180: refreshed GitHub checks are green.

Passed checks:

  • CI: Build, Typecheck, Lint, Test, Check Links, Validate Marketplace, Validate Evals
  • Dependency Audit: Audit dependencies, Check Bun lockfile
  • Cloudflare Pages

PR remains draft pending independent re-review; not merging.

@christso

Copy link
Copy Markdown
Collaborator Author

Independent post-fix review for av-21i.3 at 59be3180e7c89996955556b85bc39aae3524c15f: no blockers found.

Acceptance verification:

  • Local HEAD, tracking branch origin/av-21i-beads-workmux-hardening, and GitHub PR head all resolve to 59be3180e7c89996955556b85bc39aae3524c15f.
  • .beads/metadata.json is tracked, is not ignored by .beads/.gitignore, and preserves the AgentV embedded Dolt identity: database av, project a7aea826-0087-45fc-93f5-9084e9924e8b.
  • .beads/config.yaml.example now pins both sync.remote and federation.remote to git+https://github.com/EntityProcess/agentv-beads.git, while checkout-local .beads/config.yaml is ignored and not tracked.
  • docs/runbooks/beads-worktree-recovery.md documents the EntityProcess/agentv code repo vs EntityProcess/agentv-beads coordination repo split, fresh worktree bootstrap steps, and recovery steps for metadata/context/remote mismatches.
  • scripts/check-beads-context.ts surfaces actionable fixes for metadata identity mismatch, current bd context mismatch, and bootstrap sync_remote mismatch.

Focused checks run:

  • bun run beads:check -- --fixture passed: disposable fixture reported database av and bootstrap dry-run from EntityProcess/agentv-beads.
  • bun run beads:check -- --skip-bd passed: static checks reported 0 errors and the expected warning that local .beads/config.yaml is missing in this review checkout.
  • bun run beads:check passed: current checkout reported 0 errors, with expected warnings for missing local config and shared primary-checkout Beads context.
  • git diff --check origin/main...HEAD passed.

GitHub CI status checked after review: all current checks are passing on 59be3180 (Build, Typecheck, Lint, Test, Check Links, Validate Marketplace, Validate Evals, Dependency Audit checks, and Cloudflare Pages).

I left PR #1460 draft and unmerged.

@christso christso force-pushed the av-21i-beads-workmux-hardening branch from 59be318 to 4cd9a3c Compare June 22, 2026 03:29
@christso christso marked this pull request as ready for review June 22, 2026 03:32
@christso christso merged commit 670af9b into main Jun 22, 2026
10 checks passed
@christso christso deleted the av-21i-beads-workmux-hardening branch June 22, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant