Skip to content

fix(doctor): recognize embedded bd Dolt JSON output#1

Open
onliner10 wants to merge 1 commit into
oodaris:mainfrom
onliner10:fix-bd-embedded-json-mode
Open

fix(doctor): recognize embedded bd Dolt JSON output#1
onliner10 wants to merge 1 commit into
oodaris:mainfrom
onliner10:fix-bd-embedded-json-mode

Conversation

@onliner10
Copy link
Copy Markdown

Summary

This fixes doctor.bd-dolt / autocodex harness preflight --strict compatibility with newer Beads (bd) embedded Dolt JSON output.

Issue

With bd version 1.0.3, a healthy embedded Dolt workspace can report:

{
  "backend": "dolt",
  "data_dir": "/path/to/.beads/embeddeddolt",
  "database": "weather_agent",
  "embedded": true,
  "schema_version": 1
}

Autocodex currently expects bd dolt show --json to expose an explicit mode field, for example:

{
  "backend": "dolt",
  "mode": "embedded"
}

When mode is absent, the doctor cannot determine Dolt mode and strict harness preflight reports:

doctor.bd-dolt ERROR backend=dolt database=weather_agent (unable to determine dolt mode)

Root Cause

assessBDDoltShowJSON only treats embedded Dolt as healthy when mode == "embedded".

Current Beads embedded-mode JSON may encode the same state as embedded: true without a mode field. The text/status/context commands still identify embedded mode, but the JSON parser path used by Autocodex does not infer mode from that boolean.

Fix

  • Read the embedded boolean from bd dolt show --json.
  • Treat JSON with no mode and embedded: true as embedded mode.
  • Include inferred mode=embedded in the summarized doctor details so preflight output remains clear.
  • Add regression coverage for the embedded: true / no mode JSON shape.

After this change, the same healthy workspace is reported as:

doctor.bd-dolt OK backend=dolt mode=embedded database=weather_agent (embedded mode)

Verification

Ran:

go test ./cmd/autocodex -run TestAssessBDDoltShowOutput
go test ./...

Also verified the patched binary against the original failing workspace with:

autocodex harness preflight --strict

Contributing Checklist

Followed CONTRIBUTING.md:

  • Fork-based branch: onliner10:fix-bd-embedded-json-mode
  • Small scoped change in doctor/preflight parsing only
  • Conventional commit: fix(doctor): recognize embedded bd Dolt JSON output
  • Behavior change includes regression test coverage
  • gofmt applied to touched Go files
  • go test ./... passes
  • No docs update needed because this is compatibility behavior for an existing doctor check, not a new workflow

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