feat(runtime-host): expose effective pricing projection - #2073
Merged
Conversation
Astro-Han
approved these changes
Aug 4, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
Approve. Two test gaps to close before merge:
- The offset-invalid path (usage-pricing-coordinator.ts:217) is untested:
continuepast the last entry must returninvalid_request, but no test exercises it, so an off-by-one would pass CI. - Delete of a missing override is untested. Deleting a key with no override (including a builtin row never overridden) must return
{ kind: 'unchanged' }without bumping revision; a regression that bumps the revision or errors would pass CI.
Also on record, non-blocking: the restart test asserts counts and revision but not custom value fidelity; nothing pins the no-production-consumer caveat (a protocol test asserting the oldoverridesshape is rejected would); the composition is duplicated betweenbuildPricingLookupandprojectEffectivePricingEntries.
me2seeks
force-pushed
the
feat/2015-pricing-projection
branch
from
August 4, 2026 06:23
d8199ce to
acbdfd6
Compare
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.
English
Summary
pricing.queryfrom override-only pages into a revision-consistent effective pricing projection.restore_builtinorbecome_unpriced.Why
The existing query exposed only persisted overrides. A future Desktop adapter would otherwise need to copy the bundled pricing table and infer what deleting an override means, creating a second pricing read model outside the Host.
This keeps effective-value composition and provenance behind the existing Host interface, so clients only assemble and present authoritative pages.
Contract
revisioncontinues to pin the persisted override snapshot; the bundled table is fixed for the running Host build and Host epoch.pricing.querypage replacesoverrideswithentries; there is no production consumer of the old response.Validation
npm run build:testnpm --workspace @maka/runtime-host run test:dist— 629 passednpm run lintnpm run format:checkgit diff --check origin/main...HEADPart of #2015.
中文
概要
pricing.query从只返回 override 的分页,演进为 revision 一致的生效价格 projection。restore_builtin或become_unpriced。背景
现有 query 只暴露持久化 overrides。未来 Desktop adapter 若直接消费它,就必须复制内置价格表并自行推断删除 override 的后果,从而在 Host 外形成第二套 Pricing read model。
本次将生效价格合成与来源判断保留在现有 Host interface 后面,Client 只负责组装并展示权威分页。
契约
revision继续固定持久化 override snapshot;内置表由当前 Host build 与 Host epoch 固定。pricing.query分页以entries替换overrides;旧响应当前没有生产消费者。验证
npm run build:testnpm --workspace @maka/runtime-host run test:dist— 629 项通过npm run lintnpm run format:checkgit diff --check origin/main...HEAD属于 #2015 的一部分。