feat: HC-120 — Kustomize comparison demo (3 tenants × 3 envs, twice)#29
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 --checkto compute structural duplication metrics and validate all 9 Hypercode targets in CI. - Marks HC-120 as completed in
workplan.mdand 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.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deep comparison the positioning has been promising (stacked on #28).
One
checkoutservice, 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 withkubectl 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 +@envblocks + contracts), one sheet per tenant via@import(HC-116). 9 targets = 3 sheets × 3--ctx.Computed metrics (
metrics.py, runs in CI with--checkwhich also validates all 9 targets):Three scenarios with real outputs in the README:
explainshowing every contender with file:line and the tie-break rule.hypercode diffnaming exactly one node with the rule that changed it.Database:type-selector override silently loses to the baseline's'#main-db'id selector;explainlists 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