Skip to content

feat: add synthesis layer diagnostics to dewey doctor - #107

Merged
yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/doctor-synthesis-diagnostics
Aug 21, 2026
Merged

feat: add synthesis layer diagnostics to dewey doctor#107
yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:opsx/doctor-synthesis-diagnostics

Conversation

@yvonnedevlinrh

Copy link
Copy Markdown
Contributor

Summary

Adds a Synthesis Layer section to dewey doctor output, closing the diagnostics gap where synthesis provider configuration had no visibility. This mirrors the existing Embedding Layer section and reports provider type, resolved endpoint, model, connectivity, and model availability.

Closes #102

What Changed

Production code (cli.go)

  • New Synthesis Layer section in runDoctorChecks() between Embedding Layer and MCP Server sections (+63 lines)
  • Three provider paths:
    • Ollama: connectivity via ensureOllama() + model availability via OllamaSynthesizer.Available()
    • Vertex: config completeness validation via NewSynthesizerFromConfig() (no live API calls, no GCP credentials required)
    • Unconfigured: PASS with "not configured (optional)" — respects Composability First

Tests (cli_test.go, main_test.go)

  • TestDoctorCmd_SynthesisUnconfigured — unconfigured provider reports PASS
  • TestRunDoctorChecks_SynthesisOllamaProvider — dual-endpoint independence (separate mock servers for embedding and synthesis)
  • TestRunDoctorChecks_SynthesisOllamaUnreachable — unreachable endpoint skips model check
  • TestDoctorCmd_SynthesisVertexConfigured — Vertex reports config status + token safety negative assertions
  • TestDoctorCmd_SynthesisVertexMisconfigured — missing project field reports FAIL
  • TestDoctorCmd_SynthesisUnknownProvider — unknown provider reports FAIL with supported list

Documentation

  • README.md updated to include synthesis layer in dewey doctor description

Provenance

CI Gates

Gate Result
go build ./... PASS
go vet ./... PASS
go test -race -count=1 ./... PASS
CRAPload 41/48 (PASS)
GazeCRAPload 37/45 (PASS)

Review Council

Reviewer Verdict
Adversary APPROVE
Architect APPROVE
Guard APPROVE
SRE APPROVE
Tester APPROVE (after addressing 1 HIGH + 2 MEDIUM findings)

Constitution Alignment

Principle Status
I. Composability First PASS — unconfigured = optional
II. Autonomous Collaboration N/A — no MCP tool changes
III. Observable Quality PASS — closes synthesis diagnostics gap
IV. Testability PASS — no external services in tests

@yvonnedevlinrh yvonnedevlinrh self-assigned this Aug 20, 2026
@yvonnedevlinrh
yvonnedevlinrh requested a review from a team August 20, 2026 12:56
@yvonnedevlinrh yvonnedevlinrh moved this to Ready for Review 👀 in Unbound Force Planning Aug 20, 2026

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: #107 — feat: add synthesis layer diagnostics to dewey doctor

Summary

Well-scoped, structurally sound implementation that mirrors the existing Embedding Layer pattern. All five issue #102 acceptance criteria are covered (resolved endpoint, provider type, model, connectivity, model availability). Code is correct, tests cover all provider paths (Ollama, Vertex, unconfigured), and CI passes. Token safety is verified by negative assertions.

Findings

[MEDIUM] Website Documentation Sync issue not filed

The constitution (§Development Workflow) and AGENTS.md both require a gh issue create --repo unbound-force/website issue documenting new user-facing behavior. The dewey doctor synthesis section adds new user-visible output. No matching issue was found in unbound-force/website.

[LOW] Test isolation hardening

TestDoctorCmd_SynthesisUnconfigured and the Vertex tests in cli_test.go do not set XDG_CONFIG_HOME to redirect global config reads. A developer's ~/.config/dewey/config.yaml with a synthesis section could cause unexpected test behavior. Adding t.Setenv("XDG_CONFIG_HOME", t.TempDir()) would fully harden these tests. This matches a pre-existing gap in the embedding tests and is non-blocking.

Verdict

COMMENT — The implementation is correct and well-tested. The MEDIUM finding is a process tracking gap (missing website issue), not a code defect. The LOW finding is an optional quality improvement. The code itself is ready for approval once the website issue is filed.


This review was generated by /uf.review-pr (AI-assisted).

Add a Synthesis Layer section to dewey doctor output between the
existing Embedding Layer and MCP Server sections. Reports provider
type, resolved endpoint, model, connectivity, and model availability
for all three provider states (Ollama, Vertex, unconfigured).

- Ollama: connectivity via ensureOllama + model availability check
- Vertex: config completeness validation (no live API calls)
- Unconfigured: PASS with 'not configured (optional)'

Tests cover all provider states including Ollama unreachable,
dual-endpoint independence, unknown provider, Vertex misconfigured,
and token safety negative assertions.

Closes unbound-force#102
@yvonnedevlinrh

Copy link
Copy Markdown
Contributor Author

Thanks for the review @em-redhat — both findings addressed:

[MEDIUM] Website Documentation Sync: The website issue content has been prepared and will be filed in unbound-force/website.

[LOW] Test isolation (XDG_CONFIG_HOME): Addressed in the latest push (41d3846). All 6 synthesis tests now include t.Setenv("XDG_CONFIG_HOME", t.TempDir()) to isolate from developer global config.

@yvonnedevlinrh yvonnedevlinrh added the next-release Targeted for inclusion in next release but can be deferred if needed label Aug 20, 2026

@em-redhat em-redhat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-Review: APPROVE

Both findings from the first review are fully resolved:

Finding Severity Status
Website Documentation Sync issue not filed MEDIUM RESOLVED — Issue #249 filed in unbound-force/website
Test isolation hardening (XDG_CONFIG_HOME) LOW RESOLVED — All 6 new tests set t.Setenv("XDG_CONFIG_HOME", t.TempDir())

All five acceptance criteria from #102 are covered. CI passes clean (build-and-test + MegaLinter). No security, alignment, or constitution compliance findings.

This review was generated by /uf.review-pr (AI-assisted).

@yvonnedevlinrh
yvonnedevlinrh merged commit b75611b into unbound-force:main Aug 21, 2026
2 checks passed
@yvonnedevlinrh
yvonnedevlinrh deleted the opsx/doctor-synthesis-diagnostics branch August 21, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-release Targeted for inclusion in next release but can be deferred if needed

Projects

Status: Ready for Review 👀

Development

Successfully merging this pull request may close these issues.

feat: add synthesis layer diagnostics to dewey doctor

3 participants