Repository navigation
feat(examples): compare native, full and spec sources with measurements - #67
Merged
sunib merged 2 commits intoOct 6, 2026
Merged
Conversation
One host (gateway/kube/examples/comparison) serves the same Widgets and Secrets from one origin through a credential-holding /k8s native proxy and four gateway routes (krm-full/v1 and krm-spec/v1, unshared and shared), with projected save endpoints, a session check on every path, a refused session, deterministic workloads (quiet, burst, churn, forced-disconnect), forced downstream disconnects and low-cardinality counters, including a counting Backend wrapper per route instead of cluster-wide API-server gauges. examples/comparison adds a side-by-side page that edits through the existing native and conditional editors and keep-local recipe on both entry points, and measure.ts, which drives the real connectors and stores from a configurable library build, gates every run on convergence with the cluster and writes JSON and markdown. measure.sh runs it against a fresh host, and with --baseline-ref builds an earlier library for a native before/after. Tasks: build-compare-page, compare, compare-measure, compare-native-baseline. docs/facts/comparison-2026-10-05.md records the baseline run and leaves the native AFTER section for the resumable connector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (31)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review fixes for the comparison example. The page skipped re-rendering a focused input, so when another writer changed a focused, unedited field the input kept the old text and the next keystroke saved it over the newer value, with no conflict. fields.ts now follows the store's draft in a focused input too, keeping the caret, and rewrites an input only when the draft moved, so half-typed numbers survive. measure.ts never checked the workload outcome: a run whose writes all failed matched the unchanged cluster and was reported as a measurement. The workload gate now rejects any run with errors or with fewer done steps than planned. A projected Secret store that missed a rotation kept the same redacted key and passed; the host now reports each Secret's last successful rotation version and the correctness gate requires it. Regressions: fields.test.ts and gates.test.ts (task test-compare, part of task test, with the page and driver typecheck), a Go workload test, and task compare-browser, which runs the focused-field case in Chromium against the real host on both entry points (6/6 pass; 6/6 fail with the old render rule). The matrix and the native before/after were rerun under both gates (72/72 passed) and the report updated. Co-Authored-By: Claude Opus 5.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.
Summary
This PR adds a focused comparison example, not a dashboard or a benchmark framework. It runs native access,
krm-full/v1andkrm-spec/v1side by side, with unshared and shared gateway watches, on identical objects, subscriber counts and workloads.gateway/kube/examples/comparison) serves everything from one origin, with a session check on every path:/k8sproxy. It forwards GET and a conditional merge PATCH validated byValidateNativeMergePatch, and only for its scratch namespace's Widgets and Secrets.FORBIDDENand is never followed by a native request.examples/comparison):nativeEditor, conditional editor and keep-local recipe. That includes later typing during a save, conflicts and recovery.?entry=index|bundle.measure.ts) runs the real connectors and stores under quiet, burst, churn and forced-disconnect schedules. A run counts only if its workload did everything it planned and every store converged with the cluster, with projected Secret stores holding each Secret's final rotation version. It counts:task compare,task compare-measure,task compare-native-baseline BASELINE_REF=<sha>.docs/facts/comparison-2026-10-05.md. The delivery plan, field report, CONTRIBUTING and examples index are updated.docs/saving.mdnow notes that typing in the same field during its own save makes the echo a conflict.Measurements (real API, k3d v1.36.4+k3s1; 3 repetitions × 20 s per workload)
Native before/after resumption (baseline
d259394, 48/48 runs passed both gates):The same writes were delivered in both runs. Expiry still re-lists by design and was not part of these workloads.
Sources compared (matrix with this branch's library, all 24 runs passed both gates):
modifiedevents, churn N=1Authorization. Authorizer calls are made per subscriber, whether the watch is shared or not: 100 per route at N=10.
Not measured:
These figures come from one disposable cluster on one shared machine; they are not capacity claims.
Review fixes (
fix(examples): …)fields.ts). Half-typed numbers are still left alone.task test-compare(intask test):fields.test.ts,gates.test.ts, and a typecheck of the page and drivertask compare-browser: Chromium against the real host on both entry points, for native, full and spec. 6/6 pass; 6/6 fail with the old render rule.Validation
task lintandtask test-kube. The new package has a unit test that needs no cluster: schedules, proxy policy and counters, and the gateway route's refusal.task compareon both entry points, all passing:🤖 Generated with Claude Code