Skip to content

feat: HC-120 — Kustomize comparison demo (3 tenants × 3 envs, twice)#29

Merged
SoundBlaster merged 4 commits into
mainfrom
feat/hc-120-kustomize-demo
Jun 12, 2026
Merged

feat: HC-120 — Kustomize comparison demo (3 tenants × 3 envs, twice)#29
SoundBlaster merged 4 commits into
mainfrom
feat/hc-120-kustomize-demo

Conversation

@SoundBlaster

Copy link
Copy Markdown
Member

The deep comparison the positioning has been promising (stacked on #28).

One checkout service, 9 build targets (3 tenants × 3 envs), maintained twice:

  • kustomize/ — deliberately not a straw man: shared base, reusable tenant/env components, 9 leaf overlays; every target builds with kubectl kustomize (verified). The structural finding: tenant×env knobs (Acme's prod DB endpoint/pool) fit neither component and leak into leaf overlays — one directory per combination.
  • hypercode/ — a 5-line .hc, base.hcs (defaults + @env blocks + contracts), one sheet per tenant via @import (HC-116). 9 targets = 3 sheets × 3 --ctx.

Computed metrics (metrics.py, runs in CI with --check which also validates all 9 targets):

kustomize hypercode
files 28 5
meaningful lines 278 57
duplicated lines 240 (86%) 17 (30%)

Three scenarios with real outputs in the README:

  1. "Why is pool_size 80 in Acme prod?" — grep finds 3 files, the winner is implied by merge-order knowledge vs one explain showing every contender with file:line and the tie-break rule.
  2. One-line change → blast radius — rebuild 9 targets and diff YAML vs hypercode diff naming exactly one node with the rule that changed it.
  3. Hypercode's own failure mode (workplan requirement): specificity beats source order — a tenant's Database: type-selector override silently loses to the baseline's '#main-db' id selector; explain lists the loser with the reason it lost. The honest claim is not "no override complexity" but "every override is explainable and contract-gated".

Train: #27 (HC-116) → #28 (HC-114) → this → HC-121.

🤖 Generated with Claude Code

The same checkout service maintained in two source trees:

- kustomize/: idiomatic — shared base, reusable tenant and env
  components, 9 leaf overlays; every overlay builds with
  'kubectl kustomize'. Tenant×env knobs (Acme's prod DB endpoint and
  pool) have no home in either component and leak into leaf overlays —
  the place N×M trees rot.
- hypercode/: one 5-line .hc topology, base.hcs with @env blocks and
  contracts, one sheet per tenant via @import (HC-116).

metrics.py computes what humans maintain (28 files / 278 lines / 86%
duplicated-structure share vs 5 / 57 / 30%) and with --check validates
all 9 tenant×env targets through the binary; wired into CI.

README walks three scenarios with real outputs: provenance
archaeology ('why is pool_size 80?' — grep three files and replay merge
order vs one explain), affected-target precision (rebuild 9 and diff
YAML vs 'hypercode diff' naming one node), and — per the workplan
requirement — Hypercode's own failure mode: specificity beats source
order, a tenant's type-selector override silently loses to the
baseline's id selector, diagnosed by the same explain command.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Adds an HC-120 “Kustomize vs Hypercode” comparison example to support the project’s positioning/validation narrative, including CI-checked metrics and reproducible demo inputs.

Changes:

  • Introduces Examples/kustomize-comparison/ with parallel Kustomize and Hypercode source trees for 3 tenants × 3 envs, plus a README with three walkthrough scenarios.
  • Adds metrics.py --check to compute structural duplication metrics and validate all 9 Hypercode targets in CI.
  • Marks HC-120 as completed in workplan.md and wires the check into the Swift CI workflow.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workplan.md Marks HC-120 as completed with a summary of deliverables.
Examples/kustomize-comparison/README.md Documents the comparison, scenarios, and reproduction steps.
Examples/kustomize-comparison/metrics.py Computes metrics and (optionally) validates all tenant×env Hypercode targets.
Examples/kustomize-comparison/kustomize/base/kustomization.yaml Defines shared Kustomize base resources.
Examples/kustomize-comparison/kustomize/base/deployment.yaml Base Deployment manifest for the demo app.
Examples/kustomize-comparison/kustomize/base/service.yaml Base Service manifest for the demo app.
Examples/kustomize-comparison/kustomize/base/configmap.yaml Base Branding ConfigMap manifest for the demo app.
Examples/kustomize-comparison/kustomize/components/envs/dev/kustomization.yaml Env “dev” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/envs/dev/patch-env.yaml Env “dev” patch (replicas/log level).
Examples/kustomize-comparison/kustomize/components/envs/staging/kustomization.yaml Env “staging” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/envs/staging/patch-env.yaml Env “staging” patch (replicas/log level).
Examples/kustomize-comparison/kustomize/components/envs/prod/kustomization.yaml Env “prod” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/envs/prod/patch-env.yaml Env “prod” patch (replicas/log level/pool size).
Examples/kustomize-comparison/kustomize/components/tenants/acme/kustomization.yaml Tenant “acme” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/tenants/acme/patch-branding.yaml Tenant “acme” branding patch.
Examples/kustomize-comparison/kustomize/components/tenants/globex/kustomization.yaml Tenant “globex” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/tenants/globex/patch-branding.yaml Tenant “globex” branding patch.
Examples/kustomize-comparison/kustomize/components/tenants/initech/kustomization.yaml Tenant “initech” component wiring for Kustomize.
Examples/kustomize-comparison/kustomize/components/tenants/initech/patch-branding.yaml Tenant “initech” branding patch.
Examples/kustomize-comparison/kustomize/overlays/acme-dev/kustomization.yaml Leaf overlay for acme/dev target.
Examples/kustomize-comparison/kustomize/overlays/acme-staging/kustomization.yaml Leaf overlay for acme/staging target.
Examples/kustomize-comparison/kustomize/overlays/acme-prod/kustomization.yaml Leaf overlay for acme/prod target (includes DB patch).
Examples/kustomize-comparison/kustomize/overlays/acme-prod/patch-db.yaml acme/prod DB host + pool size patch illustrating leaf leakage.
Examples/kustomize-comparison/kustomize/overlays/globex-dev/kustomization.yaml Leaf overlay for globex/dev target.
Examples/kustomize-comparison/kustomize/overlays/globex-staging/kustomization.yaml Leaf overlay for globex/staging target.
Examples/kustomize-comparison/kustomize/overlays/globex-prod/kustomization.yaml Leaf overlay for globex/prod target (includes DB patch).
Examples/kustomize-comparison/kustomize/overlays/globex-prod/patch-db.yaml globex/prod DB host patch illustrating leaf leakage.
Examples/kustomize-comparison/kustomize/overlays/initech-dev/kustomization.yaml Leaf overlay for initech/dev target.
Examples/kustomize-comparison/kustomize/overlays/initech-staging/kustomization.yaml Leaf overlay for initech/staging target.
Examples/kustomize-comparison/kustomize/overlays/initech-prod/kustomization.yaml Leaf overlay for initech/prod target (includes DB patch).
Examples/kustomize-comparison/kustomize/overlays/initech-prod/patch-db.yaml initech/prod DB host patch illustrating leaf leakage.
Examples/kustomize-comparison/hypercode/checkout.hc Hypercode topology for the demo app.
Examples/kustomize-comparison/hypercode/base.hcs Shared baseline defaults, env blocks, and contracts.
Examples/kustomize-comparison/hypercode/tenants/acme.hcs Tenant sheet (imports baseline, adds prod overrides).
Examples/kustomize-comparison/hypercode/tenants/globex.hcs Tenant sheet (imports baseline, adds prod overrides).
Examples/kustomize-comparison/hypercode/tenants/initech.hcs Tenant sheet (imports baseline, adds prod overrides).
.github/workflows/swift.yml Runs the comparison metrics + validation check in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Examples/kustomize-comparison/metrics.py
@SoundBlaster SoundBlaster changed the base branch from feat/hc-114-runtime-boundary to main June 12, 2026 22:04
@SoundBlaster SoundBlaster merged commit 9e5ef92 into main Jun 12, 2026
5 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.

2 participants