Skip to content

test(codec-url): gate consumer-archetype acceptance spec - #749

Merged
tada5hi merged 2 commits into
masterfrom
test/m3-gate-acceptance
Jul 7, 2026
Merged

tada5hi merged 2 commits into
masterfrom
test/m3-gate-acceptance

Conversation

@tada5hi

@tada5hi tada5hi commented Jul 7, 2026

Copy link
Copy Markdown
Owner

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 in packages/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 same Query AST:

  • Flat forward: express-style req.query (aliased key, disallowed key, oversized limit) → URLDecoder.decode with schema (mapping + drop + maxLimit clamp) → server condition pinned via per-field-replace merge() (a client-sent node_id can never win) → re-encoded with the simple codec → downstream decode yields the exact AST the gateway built.
  • Undisplaceable scoping via the registry: 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 the URLCodecRegistry stamps codec=url-expression so 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 via mergeQueries (left-priority, per-property pagination) — no smob.createMerger, no as any. The isQuerySortedDescByDate archetype becomes a plain AST property read.

No production code changes; 13 tests green in the package, full monorepo build/test/lint pass.

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.
Copilot AI review requested due to automatic review settings July 7, 2026 17:06
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tada5hi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 336df910-2f0b-402a-a39a-80e144c0eae6

📥 Commits

Reviewing files that changed from the base of the PR and between ad38e04 and baac0ee.

📒 Files selected for processing (1)
  • packages/codec-url/test/unit/acceptance.spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/m3-gate-acceptance

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

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 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 mergeQueries composition and encoding output without casts.

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

Comment thread packages/codec-url/test/unit/acceptance.spec.ts
Comment thread packages/codec-url/test/unit/acceptance.spec.ts Outdated
@tada5hi tada5hi changed the title test(codec-url): M3 gate consumer-archetype acceptance spec test(codec-url): gate consumer-archetype acceptance spec Jul 7, 2026
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.
@tada5hi
tada5hi merged commit 6289f6a into master Jul 7, 2026
7 checks passed
@tada5hi
tada5hi deleted the test/m3-gate-acceptance branch July 27, 2026 07:53
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