Skip to content

docs(book): a Conformity Checks chapter teaches the reference language step by step - #431

Merged
bmscomp merged 2 commits into
mainfrom
docs/book-conformity
Oct 20, 2026
Merged

bmscomp merged 2 commits into
mainfrom
docs/book-conformity

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 20, 2026

Copy link
Copy Markdown
Owner

A new Guide chapter, Conformity Checks (docs/book/conformity.md), in Part V after the Deployment Guide. It follows the book's running example: the architecture the payments workload needs from krafter.

How it reads, easiest first

  1. Your First Reference. minimal.yaml (3 rules), linted and checked.
  2. Why Conformity. Drift between the design, the config and the running cluster. A table places conformity next to cluster check, detect, security audit and scenario gates. A Mermaid figure shows how a check runs, then statuses, the overall result and exit codes.
  3. Writing Constraints. Bare vs map form, value kinds and quoted versions. Sizing the brokers, with a real FAIL and the fix.
  4. Placement. zones, skew, perNode, antiAffinity and dedicated, with a real FAIL. Lint's cross-rule checks (even quorum, zones that can't be reached).
  5. Kafka Settings and Monitoring. rackAwareness, authorization, listeners and config, kafka.source cr vs brokers, and per-topic rules.
  6. When the Cluster Falls Short. Waivers vs severity: warn, the waiver lifecycle, and the complete payments-krafter.yaml.
  7. Running It in a Pipeline. fmt --check, lint, check --output-junit, and -o json with jq.
  8. The Language at a Glance and Limits.

Captured, not invented. Every check result was captured on panda. A throwaway harness, not committed, ran ConformityCheck against krafter the way ConformityLiveTest does, and the real CLI rendered each report through a local stub. Lint and fmt output come from the real CLI. The lab has no Kates API deployed, so a live kates conformity check wasn't possible. The two real gaps panda showed became the chapter's teaching cases: broker anti-affinity is preferred, and Kafka Exporter is off on Kind.

The final reference is a tested example. cli/examples/conformity/payments-krafter.yaml is picked up by the schema, lint, fmt and strict-reader example tests, so it can't drift.

Wiring

  • _quarto.yml order, the Part V page bullets and counts, and the Deployment Guide's handoff.
  • The book README.
  • A CONCEPTS registry row, and the payments-krafter.yaml name in the Names table.
  • Glossary entries for Conformity Check, KafkaReference and Waiver, plus the conformity exit codes under Exit Code.

Reference fixes found while researching

  • The CLI Reference's family table had no Conformity row.
  • The Conformity section said "two examples" (there are four now).
  • The API's read scope row left out POST /api/conformity/check.

Checked locally

  • scripts/check-book-style.sh: style and ratchet OK, and the new page is at 0 on every count.
  • book_metrics.py: 0 of 152 sentences are over 40 words.
  • prepare-book-render.sh + quarto render --to html in a scratch copy: 40 chapters. check-book-fragments.py: all 7,736 fragment links land.
  • check-mermaid.sh: 157 diagrams parse.
  • Go example tests (TestConformityExamplesMatchTheirSchema, TestExamplesAreFormatted, TestExamplesCompileClean, TestFormatIsIdempotentAndKeepsTheMeaning) and Java KafkaReferenceExamplesTest (5/5) pass.

Not checked: lychee (not installed locally; CI runs it), the PDF render, and the page's look in a browser.

Commands documented are in cli/cmd/conformity.go and cli/cmd/conformity_lint.go. The endpoint is kates/src/main/java/com/bmscomp/kates/api/ConformityResource.java.

…e step by step

A new Guide chapter in Part V, after the Deployment Guide, starts from
the smallest reference file (minimal.yaml), explains why conformity
matters next to health, security and performance checks, then builds a
reference for the payments workload level by level: constraints and
sizing, placement across zones and nodes, Kafka settings, listeners,
topics and monitoring, waivers against severity warn, and the check in a
pipeline (fmt --check, lint, check --output-junit, -o json). It ends with
the language at a glance and its limits.

Every check result in the chapter was captured on panda: the check's own
code (ConformityCheck, as ConformityLiveTest runs it) read krafter, and
the real CLI rendered the reports. Lint output is the real CLI's. The
final reference ships as cli/examples/conformity/payments-krafter.yaml,
so the schema, lint, fmt and strict-reader example tests hold it.

Wiring: _quarto.yml order, the Part V page, the Deployment Guide's
handoff, the book README, a Concept Registry row and the
payments-krafter.yaml name, Glossary entries for Conformity Check,
KafkaReference and Waiver, and the conformity exit codes under Exit Code.
Three reference fixes: the CLI Reference's family table gets a
Conformity row and no longer counts the examples, and the read scope
lists POST /api/conformity/check.
Four figures, each for something the text explains less well alone:
where drift comes from (design, values, running cluster, and the changes
that skip the design), how a rule gets its status (read, hold, severity,
then waivers), what the placement rules count on panda (one node per
zone, one broker and one controller per node, drawn from krafter's real
pods), and a waiver's lifecycle as a state diagram, which replaces the
situation table.

The prose now says what each rule protects against: the cost of drift
(two brokers on one node refuse acks=all writes when it fails), a
reference against a values file (requirements with bounds, like a test
suite), why a constraint's form is the requirement, a placement table
column on the failure each rule guards against, the acks=all, RF,
min.insync.replicas and unclean-election chain, why waivers carry an end
date, and when to run a check (pull request, deploy, schedule). A Try it
callout follows the first reference.

Checked: style ratchet, every Mermaid diagram parses, a full render with
all fragment links landing, and each figure viewed in the rendered page
at the text column's width.
@bmscomp
bmscomp merged commit ef52a63 into main Oct 20, 2026
56 checks passed
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