Skip to content

fix(doctor): remove config check, report every telemetry-suppressing gate - #37

Draft
simonkrol wants to merge 1 commit into
release/v1.1.0from
dev/simonkrol/doctor_telemetry_check
Draft

simonkrol wants to merge 1 commit into
release/v1.1.0from
dev/simonkrol/doctor_telemetry_check

Conversation

@simonkrol

@simonkrol simonkrol commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Description

Removes doctor's config check. It validated the full .konductor/config.yml schema, which belongs to the hidden config command. The starter config now holds only version and telemetry.enabled, so the check had nothing left to catch.

Extends telemetry_state to report every gate that can suppress telemetry. It used to check only the per-target install record and machine consent, so it could say reporting was on while KONDUCTOR_TELEMETRY=off or telemetry.enabled: false turned it off. Doctor and the send path now share one predicate in report.rs, so their answers can't diverge. These opt-outs are reported at Info severity. doctor --all evaluates config.yml per target. Telemetry sending behaviour is unchanged.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • Documentation update

Testing

  • cargo build --release, and cargo test --release with 1723 unit and 44 integration tests passing.
  • cargo clippy --release --all-targets: no new warnings.
  • check-guide-facts.py: one failure, also present on main (WITHDRAWN_COMMANDS).
  • Ran the binary with each gate off in turn and with all gates on, and ran --all across two targets.
  • New tests cover each gate and the all-gates-on case, using temp HOME and target dirs and a shared env lock.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Notes

  • Destination is a v1.1.0 release branch, another PR will address regenerating the HTML user-guide rather than each PR managing that themselves.

@simonkrol
simonkrol changed the base branch from main to release/v1.1.0 October 5, 2026 20:39
@simonkrol
simonkrol force-pushed the dev/simonkrol/doctor_telemetry_check branch from 8fd40d7 to 4008a48 Compare October 5, 2026 22:03
…gate

doctor's config check validated the full config.yml schema, which belongs
to the hidden config command. The starter config now holds only version
and telemetry.enabled, so the check caught nothing real. Removed it.

telemetry_state checked only the per-target install-info opt-out and
machine consent, so it could say reporting was on while
KONDUCTOR_TELEMETRY=off or a target's own telemetry.enabled: false
actually suppressed it. telemetry_state now reports all four gates,
sharing one predicate with report.rs's own send-time gate so the two
can never drift. doctor --all evaluates the config.yml gate per
target, since it reads each target's own config.yml.

Updated every doc listing or counting doctor's checks, and the Data
Collection section describing what telemetry_state reports.
@simonkrol
simonkrol force-pushed the dev/simonkrol/doctor_telemetry_check branch from 4008a48 to e5c47a2 Compare October 9, 2026 15:34
@knihit

knihit commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Adversarial review notes (security, data integrity, schema/contract). No security or data-integrity issues found. Four schema/contract items:

Important

  1. doctor --json drops the config check with no deprecation path (cli/konductor-rs/src/cli/doctor.rs, run_checks). Scripts that run jq '.checks[] | select(.name=="config")' or count checks will silently change behavior. Suggest keeping an info stub for one release, or listing the removal as a breaking change in CHANGELOG.

  2. A malformed .konductor/config.yml fails open on gate 4 (cli/konductor-rs/src/cli/telemetry/report.rs, read_telemetry_config / gate4_suppression_from). Read and parse errors both collapse to None, which is treated the same as "no telemetry section." A typo such as enabled: flase silently drops the opt-out, and doctor reports telemetry as on. Gates 2 and 3 already split not-found from broken; gate 4 could do the same and report a malformed section as Warn with the config path.

Suggestions

  1. telemetry_state can now be info instead of ok on an otherwise healthy install. That's the intended fix, but a one-line note in the doctor section of cli/README.md would help --json consumers that check for ok.

  2. CHANGELOG says the starter config now holds only version and telemetry.enabled. cli/gate-config/config.yml still has six fields and no telemetry section, and telemetry.enabled is read separately in report.rs. Worth rewording so it doesn't imply the preset shrank.

Comment thread CHANGELOG.md

- `konductor metrics`. It was a stub that printed "not yet implemented"; the CLI now exits `64`
for it like any other unrecognized subcommand.
- `doctor`'s `config` check. It validated the full config schema, which belongs to the hidden

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.

to confirm, we are not versioning this change. I also dont see a VERSION file.

/// Gate 4, env var: `KONDUCTOR_TELEMETRY=off` suppresses reporting
/// even though gates 2 and 3 both allow, and the check names the
/// specific reason at `Info` severity.
#[test]

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.

not in scope of this CR, but we should consider refactoring this file. It has grown over a period of time.

check_source(&resolved_source),
check_runtime(destination),
check_manifest(destination),
check_config_with_home(&resolved_source, home_dir.as_deref()),

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.

would this lead to any backward compatibility issues on installs where config exists?

/// `gate4_suppression` so a caller that has already read
/// `.konductor/config.yml` for another reason doesn't have to read it
/// again just for this check.
fn gate4_suppression_from(raw: &Option<RawTelemetrySection>) -> Option<Gate4Reason> {

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.

during this check in general, have we validated config.yml? what if it is malformed.

This branch has not been deployed

No deployments
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.

2 participants