Skip to content

Omit redundant and placeholder values from generated config #1057

Open

Description

@ChristianPavilonis

Context

ts audit generate <url> starts a draft from the entire trusted-server.example.toml template (EXAMPLE_CONFIG) and replaces selected publisher and detected-integration values. This carries unrelated sample entries and values into the generated draft. The original #1057 report calls out safe-default settings, standard integration URLs, disabled sections, and example.com placeholders.

Desired outcome

The generated TOML should contain values required to make the draft valid, values derived from the audited target, and detected candidate configuration clearly marked for review. Safe defaults should be left to Rust defaults. Disabled integrations should not carry unrelated sample configuration, and fictional example placeholders should not appear as if they were target-specific findings.

Scoped work

  • Define the minimum valid generated structure and distinguish required values from optional findings. Keep the existing manual-review and candidate mechanisms where they convey evidence.
  • Replace whole-template seeding in build_draft_config_with_generator with generation of only the needed sections and keys, or a narrowly scoped equivalent.
  • Confirm that resulting TOML validates with the same settings parser and that generated detected integrations retain their necessary values.
  • Preserve clear comments for candidates that are intentionally disabled pending operator review; do not infer missing values from unrelated examples.

Done when

  • A sparse audit produces valid TOML without unrelated disabled sections, standard default URLs, or example.com placeholders.
  • A detected integration produces only its required and evidence-backed keys, with unresolved fields called out for manual review.
  • Tests cover sparse and detected-integration cases and parse the generated TOML through the real configuration loader.
  • Existing command output and review notes remain usable for an operator.

Affected area

crates/trusted-server-cli/src/commands/audit/generate/mod.rs and generation tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions