test(codec-url): gate consumer-archetype acceptance spec - #749
Conversation
Roadmap 000 M3 gate evidence (consumer-derived, per the cross-cutting rule that milestone items don't pass on unit tests alone). Archetypes from .agents/references/privateaim-hub.md: - gateway controller (analysis-node-log): express req.query decoded against an allow-list schema (alias mapping, maxLimit clamp), a server condition pinned with per-field-replace merge() and re-encoded flat; plus undisplaceable filters.and() scoping carried downstream via the expression codec with the registry's in-band codec stamp — both legs meet in the same Query AST, no casts - vue list-kit merge: component defaults, parent query prop and live pagination state composed as defineQuery fragments via mergeQueries (left-priority, per-property pagination), sort introspection as a plain AST property read Marks the M3 gate as passed in the roadmap.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
Adds an acceptance-level test suite for @rapiq/codec-url that demonstrates “consumer-derived evidence” for the M3 gate by exercising two real-world archetypes (hub gateway forwarding + Vue list query composition) against the URL codec family and registry.
Changes:
- Introduces a new acceptance spec covering schema-bound decode → server-side pin/wrap → re-encode → downstream decode equivalence.
- Validates codec-registry stamping/dispatch for the expression dialect (
codec=url-expression) and its ability to carry nested filter compounds. - Adds a Vue “list-kit merge” archetype asserting
mergeQueriescomposition and encoding output without casts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The acceptance spec models a real consumer, which would import URL_EXPRESSION_CODEC rather than repeat the string. The expected wire output deliberately stays a literal — the stamped identifier is a public wire contract, and deriving the expectation from the same constant would hide a rename.
Closes out the M3 gate (roadmap 000). The round-trip half of the gate landed with #748; this adds the missing consumer-derived evidence — per the cross-cutting rule that milestone items don't pass on unit tests alone — as
packages/codec-url/test/unit/acceptance.spec.ts, mirroring how the M2 gate lives inpackages/typeorm/test/unit/acceptance.spec.ts.Archetypes lifted from
.agents/references/privateaim-hub.md:Gateway controller (analysis-node-log)
Hub's core service proxies log queries to the telemetry service: parse the client query against an allow-list, transform field names, pin server-side conditions, emit a new query for the downstream rapiq-speaking service. v1 made this awkward (
ParseOutput ≠ BuildInput); in v2 both legs meet in the sameQueryAST:req.query(aliased key, disallowed key, oversized limit) →URLDecoder.decodewith schema (mapping + drop + maxLimit clamp) → server condition pinned via per-field-replacemerge()(a client-sentnode_idcan never win) → re-encoded with the simple codec → downstream decode yields the exact AST the gateway built.filters.and()wraps the client tree, so the injected condition can't be displaced — the wrapped tree is a nested compound only the expression dialect can carry over a URL, and theURLCodecRegistrystampscodec=url-expressionso the downstream service knows how to decode it.Vue list-kit merge (client-vue list composable)
Component defaults, the parent's query prop and live pagination state composed as plain
defineQuery<User>()fragments viamergeQueries(left-priority, per-property pagination) — nosmob.createMerger, noas any. TheisQuerySortedDescByDatearchetype becomes a plain AST property read.No production code changes; 13 tests green in the package, full monorepo build/test/lint pass.