Repository navigation
docs: design note for a defineProduct primitive (suggested AIP-55) - #1135
Conversation
There was a problem hiding this comment.
Summary
This PR introduces a design proposal for a new defineProduct primitive (suggested AIP-53) to model sellable products with pricing information. The proposal thoroughly surveys existing packages, argues for a new AIP instead of extending existing ones, and provides a concrete TypeScript shape with realistic examples.
Changeset
No changeset needed — this is a design documentation file, not a published package change.
Findings
Research & rationale
- Survey is thorough and accurate. The grep across
price|pricing|billing|product|...confirms no existing product/pricing primitive in the repo. The spot-check against wallet (AIP-49, already ownsdefineAsset), app-kit (category is shelf-label only), pack (distribution, not commerce), and model-catalog (model pricing, not product) all hold up. - Design decision is sound. The rejection of AIP-18 collection, AIP-40 extension, and the case for a new AIP are well-argued. Discriminated unions at the type level prevent ×100 unit bugs and enable billing code generation; this can't be expressed in flat collection fields.
- AIP-53 numbering is reasonable. AIP-52 (pack) is the highest in
specs/resources/; 51 and 50 are gaps. Suggesting 53 (not 51) is appropriately conservative, and the note "Flagged as a suggestion, not a claim of authority" shows proper humility.
TypeScript shape
- Discriminated unions are correct.
ProductPricediscriminates onmodel;BillingRailonrail. Minor-unit amounts everywhere (following AIP-49 wallet'sdecimalspattern) structurally prevents off-by-100 bugs. - Cross-field validation acknowledged. The proposal notes that kind consistency (outer
kindvs.target.kind) must be enforced invalidate(), following the established "cross-field rules live in validate" AIP pattern. No type-level discriminator is expected here. - Extensibility is baked in. String unions with
(string & {})allow newProductKindvalues and new billing rails without AIP updates — good forward-compat stance.
Examples
- Three real use cases (pay-per-call repo, prepaid-pool private bundle, one-time app) are realistic and stress-test the shape. All discriminators align correctly.
Scope
- The proposal appropriately excludes entitlements/enforcement (AIP-49 + restriction lattice already own ledger-side), subscription periods (no second shape in use yet), and tax/coupons (Stripe's job via rail config). This shows good restraint.
Verdict
LGTM ✅ — This is a well-researched design proposal that identifies a real gap and proposes a sound, extensible shape grounded in AIP conventions. The TypeScript sketch is correct, examples are compelling, and scope is appropriately bounded. Ready to move to spec draft and implementation if the team agrees on AIP-53 as the number.
🤖 @agentproto-bot — review · session sess_75e3f27f (agent-step:claude-sdk) · claude-sdk / subscription · e2b ilao8jtc9bepr0a9yeggw · run 33796236763 · sha 1fe1b55329b3799d69ec78bb107ef08e5afea273
There was a problem hiding this comment.
Summary
The increment moves AIP-53 from a design proposal to a draft specification with a complete JSON Schema and implementation sketch. A dogfooding effort (scratch test suite driving real app-kit, wallet, pack, and registry code) surfaced six findings; the draft spec incorporates fixes for three critical/high issues and documents three residual risks explicitly. The schema is well-structured, the cross-field validation is clearly specified, and examples are correct.
Changeset
No changeset — all changes are documentation (specs/resources/, packages/) and design artifacts, not published package changes.
Findings
Schema & Validation ✅
- Discriminated unions are correct. Price (one-time | prepaid-pool | pay-per-call), target (content | repo | app | pack | knowledge-pack | vendor), and billing rail (stripe | autumn | tbd | vendor) all use
oneOfwith proper mutual exclusivity via discriminator fields. Each variant enforces its required fields:amountMinorfor one-time,unitPriceMinor + grantUnitsfor prepaid-pool,unitPriceMinor + meterfor pay-per-call. - Critical fix F1 properly incorporated:
appRef(string id) replaces the original inlineapp: AppHandlethat serialized the whole bundle. Spec correctly documents that anonymous apps withoutidcannot be sold. - High-priority fix F2 properly incorporated: Explicit
packtarget kind withpackRef(the pack'sname, notid) addresses the registry mismatch. Spec correctly documents that product price is authoritative if pack carries competingpricingblock. - Medium fix F3 properly incorporated: Stripe rail schema includes
meterIdfield; implementation sketch validates that pay-per-call on stripe MUST have meterId. Spec documents that Stripe's prepaid-pool has no native primitive (pool state is host-side). - Minor units are normative throughout (
amountMinor/unitPriceMinor), following AIP-49'sdecimalspattern to prevent ×100 bugs. Currency is ISO-4217 lowercase;minimum: 0for prices,minimum: 1for grant units.
Cross-field Validation ✅
- Kind consistency rule:
kindMUST equaltarget.kindwhen target is present. Correctly left to thevalidate()function (JSON Schema cannot express this cleanly). Implementation sketch shows the check. - Pay-per-call on Stripe rule: Implementation sketch validates: if
price.model === "pay-per-call"ANDbillingRail?.rail === "stripe", thenmeterIdis required. Documented in the schema as normative, enforced in validate. - Optional fields handled correctly:
billingRail,target,title,version,metadataall properly optional; product can be priced without a target (e.g., pure pool top-up).
Composability & Residual Risks ✅
- F4 (namespace collisions) documented as residual. Vendor kinds and rails use open vocabulary with guidance ("SHOULD be namespaced") but no enforceability. COMPOSABILITY-FINDINGS.md clearly states hosts cannot enforce SHOULD. Appropriate.
- F5 (attach interaction) resolved by appRef design. No field collision, no bundle duplication. Clearly explained.
- Compose fine cases all acknowledged (content, one-time+Stripe, prepaid-pool+AIP-49, both metered+Autumn). Spec avoids overclaiming — e.g., "prepaid-pool has NO native Stripe primitive" is explicit rather than implying leakless composition.
Implementation Sketch ✅
- Pseudocode clearly shows
createDoctypeusage pattern consistent with other AIPs. - Two validation rules are explicit and sufficient for the normative schema.
- Build function properly freezes the handle and adds
schema: "product/v1".
Documentation Quality ✅
- Spec structure is clean: filesystem layout, manifest shape with working example, normative fields table, billing rails section, targets section, implementation sketch, composability findings summary.
- Example is valid per schema: all field names match (e.g.,
unitPriceMinorfor pay-per-call, notamountMinor), all values conform to patterns (kebab-case id, semver version, ISO currency, stripe rail), discriminators align. - Dogfooding findings document real bugs: COMPOSABILITY-FINDINGS.md cites specific test cases (scratch-dogfood.test.ts:96-115, etc.), verified misbehaviors (AppHandle serializes whole bundle, PackHandle lacks id), and explains why each fix was adopted. High evidentiary standard.
Minor Observations
- Spec status is "Draft": Appropriate. Implementation will follow; the spec is ready for team review and potential AIP adoption, but not yet normative.
- Scratch test suite is uncommitted: Correctly noted; it's a validation artifact, not a requirement for the repo.
- Vendor rail additionalProperties: Stripe/autumn/tbd variants use
additionalProperties: false(strict), while vendor rails useadditionalProperties: true(open). Correct — unknown vendor rails must be tolerated.
Verdict
LGTM ✅ — This draft spec is well-researched, grounded in real dogfooding, and fixes all the critical issues the proposal's early design overlooked. The schema is correct, cross-field validation is explicit, and all three residual risks are documented with their limitations clearly stated. The spec is ready for team review and potential AIP-53 adoption. The implementation sketch provides clear TS guidance for the next phase.
🤖 @agentproto-bot — review · session sess_337ec701 (agent-step:claude-sdk) · claude-sdk / subscription · e2b ifl3q1mkkre9z0nup9x1u · run 33802486439 · sha 55e13907ccd3b240f38ee0a7692fae10acfb242b
…ent, selective AIP-40
|
New commit (dedf26c): composable-primitives redesign — Jeremy's "so weird, not composable" reaction taken as the design brief. The diagnosis: AIP-18 refs / AIP-40 extensions / AIP-53 products each reinvent referencing + composition; AIP-53 needing bespoke
Honest residuals (documented in §4): handles lack AIP-53 collapses to the pricing capability payload + |
There was a problem hiding this comment.
Summary
The increment adds a pre-implementation design note proposing a generalized architecture for references and capability attachment across AIPs. It introduces three primitives: (1) typed artifact references (AIP-54), (2) capability attachment, and (3) AIP-40 v2 selective composition. Core architecture is sound and validated against real packages via [driven] testing; however, AIP-53 integration details are underspecified.
Findings
1. AIP-53 field mapping incomplete
Location: §5 (line 226-247)
Issue: When claiming "AIP-53 draft collapses from...to..." the proposal doesn't specify what happens to AIP-53's optional fields (title, version, metadata) in the new capability-based design. The example (lines 242-246) only shows the target→on transform, leaving these fields unaddressed.
Prior review (commit 55e1390) confirmed AIP-53 has these as optional fields. If AIP-53 is being refactored as a capability, either:
- Show the complete field transformation (where does each field move?), or
- Explicitly defer AIP-53 refactoring to the implementation phase and mark this proposal as architecture-only
Recommendation: Clarify intent—are you describing a complete product refactor (then detail all fields) or just the reference architecture (then note AIP-53 changes are deferred)?
2. URI serialization format incomplete
Location: Line 44-45
Issue: The proposed URI format aip://<aip>/<id>[@version] is mentioned but not validated ([driven] tests don't cover this) and lacks design for:
- Escaping if
idcontains/or special characters - Parsing rules (how is
[@version]optional version detected?) - Backwards compatibility with existing URI schemes (ws://, http://, etc.)
Recommendation: Either specify escaping/encoding rules or mark URI serialization as TBD for implementation.
3. [Driven] validation cannot be verified
Location: Line 7-11, throughout document
Issue: Companion dogfood suite (scratch-composable.test.ts) is uncommitted. Claims marked [driven] cannot be verified against real test code. This is acknowledged as appropriate for a design note, but implementation will need verification.
Recommendation: Confirm all [driven] tests pass when implemented; this is acceptable as deferred validation.
Observations
✅ Typed reference design (AIP-54) is well-motivated. Unifying six disparate ref mechanisms (AIP-18 refKind, AIP-42 AnyRef, app-kit DoctypeHandle, AIP-52 $resolver, ws:// URIs, bespoke union types) into {aip, id, version?} is elegant and type-safe.
✅ Capability attachment elegantly inverts AIP-53's design: instead of "product contains target", use "capability attaches to artifact". The [driven] proof that the same attachPricing call works on apps, packs, tools, and hypothetical sandboxes is compelling evidence this generalizes.
✅ AIP-40 v2 selective composition is well-thought-out:
- Guards (can't remove parent required fields, enforced away silently) match AIP-18's own rules
- Per-aspect
inheritselection +remove_fieldsis backward-compatible (omitted = current behavior) - Jeremy's [driven] scenario ("keeps identity, drops agents, adds price") validates the need
✅ Residuals (§4) are honest: Identifies real gaps (handles don't self-describe, registry key divergence for packs, AIP-52 pricing drift) and proposes reasonable fixes (add schema to createDoctype, own keyBy in RefCatalog).
✅ Scope is appropriate: Marked "pre-implementation", not claiming to finalize AIP-53; defers many details to implementation.
Verdict
REQUEST_CHANGES — Core architecture is sound and well-validated, but AIP-53 integration requires clarification. Either provide the complete field transformation (showing where title, version, metadata move in the new design) or explicitly note that AIP-53 refactoring is deferred and this proposal defines reference/capability architecture only. Additionally, note that URI serialization format details must be designed before implementation. Once these gaps are clarified, the proposal is ready for adoption.
🤖 @agentproto-bot — review · session sess_458cbfb0 (agent-step:claude-sdk) · claude-sdk / subscription · e2b idsr21zugq4ngzi90e7t2 · run 33804487767 · sha dedf26c135c994c4e90e298d8a1b4c56ec870d41
There was a problem hiding this comment.
Summary
The increment successfully addresses all three prior findings through well-targeted clarifications. AIP-53 field mapping is now explicit (complete table), URI serialization is marked TBD for implementation, and [driven] validation constraints are clearly documented. Core architecture remains sound; scope is appropriately deferred to implementation phase.
Findings
None — all prior concerns have been resolved.
Prior finding 1: AIP-53 field mapping
Resolved. §5 now includes a table (lines 282–288) mapping all five AIP-53 draft fields with clear status:
target→ replaced byon: ArtifactRef(version moves to ref)price/billingRail→ unchanged, become capability payloadid→ unchanged, becomes CapabilityDefinition.idtitle,metadata→ deferred (not dropped), stay as optional passthrough
Text (lines 290–297) explicitly notes "full AIP-53-as-capability field mapping, including where title/metadata finally live, is implementation work for AIP-53 itself, not settled here." This is the right scope for a design note.
Prior finding 2: URI serialization format
Resolved. New section (lines 57–84) explicitly marks aip:// serialization as "TBD for implementation, not [driven]" and specifies three design items before shipping:
- Escaping/encoding of
id(character restrictions or percent-encoding) - Parsing rule for optional
@version(last unescaped@split) - Backwards compatibility with existing schemes (
ws://,http://,$resolver)
Clarifies that the object form (ArtifactRef) is what's driven-tested; URI format deferred to AIP-54 implementation with "explicit grammar and test coverage."
Prior finding 3: [Driven] validation cannot be verified
Resolved. New verification note (lines 13–20) explicitly documents that:
- Scratch suite is uncommitted (appropriate for a design note)
- [driven] claims cannot be re-run from diff alone
- Nothing marked [driven] "should be treated as settled until" follow-up PRs commit tests
- Full validation required at implementation phase
This is the correct expectation-setting for a pre-implementation design note.
Verdict
LGTM ✅ — The increment addresses all feedback constructively without introducing new concerns. Maintains appropriate scope (architecture-only, pre-implementation), clarifies deferred vs. settled design, and sets clear expectations for implementation PRs. Ready to merge.
🤖 @agentproto-bot — review · session sess_a0ece4de (agent-step:claude-sdk) · claude-sdk / subscription · e2b ib7d04poxrn1l14nhlhop · run 33805082192 · sha 4f31b696682a8e89bb614da1432fc00ad82e121b
…rded) + per-aspect inherit
|
Implementation commits (40f2281 → 2686083):
Spec-only vs implementation: everything above is real, exported, documented code with committed regression suites (the scratch scenarios from the proposal are now permanent tests). Spec-only remaining: the Gate: check-types exit 0; the only full-gate reds are a live-network e2e (fails on clean main too) and one load-sensitive timeout that passes on re-run (195/195). Not merged per instruction. |
There was a problem hiding this comment.
Summary
The increment delivers the implementation of the already-approved AIP-54 (ref-catalog), AIP-53 (product pricing capability), and AIP-40 v2 (selective composition) designs. All new code is well-structured, properly validated, comprehensively tested, and correctly implements the specified behavior.
Changeset
| Package | Bump | Reason |
|---|---|---|
| @agentproto/product | minor | New AIP-53 pricing-capability package + implementation |
| @agentproto/ref-catalog | minor | New AIP-54 cross-AIP reference implementation |
| @agentproto/extension | minor | AIP-40 v2 selective composition + backward-compat tests |
(Changesets already present in .changeset/pr-1135-agentic.md)
Findings
None — the increment successfully implements the approved design:
Package quality
- ref-catalog: Clean, minimal API (RefCatalog, refFor, refToUri/refFromUri). Validation is thorough (integer aip, non-empty id, typed error classes). Registry pattern matches AIP-43 conventions.
- product: Cross-field validation is complete (kebab-case id, minor-unit currency validation, rail-specific rules for Stripe/Autumn). The
attachPricingandcollectPricedutilities follow established patterns. - extension: AIP-40 v2 guards work correctly (remove_fields rejects parent-required fields, inherit aspects default true for v1 compatibility). The type fix (commit 2686083) shows strict TypeScript passing.
Test coverage
- 250 lines: product tests (pricing models, rail validation, billingRail rules, collectPriced join)
- 153 lines: ref-catalog tests (resolution across families, strict/permissive modes, URI round-trip)
- 188 lines: extension v2 tests (remove_fields guard, per-aspect inherit, backward-compat verification)
Schema alignment
- AIP-54 schema correctly requires
aip(positive integer discriminator) andid(registry key), optionalversion - AIP-53 schema properly references AIP-54 (
$ref: "https://agentproto.sh/schemas/aip-54/REF.schema.json"), replaces target union withon: ref/v1 - AIP-40 schema updated:
remove_fields(guarded),inherit(per-aspect), both omitted-defaults for backward-compat
Spec documentation
- AIP-54 REF.md: clear normative rules, migration notes, worked examples using real families (app/42, pack/52, sandbox/61, tool/14)
- AIP-53 PRODUCT.md: capability framing is clear, residual risks documented (Stripe pool leak, AIP-52 legacy pricing), Agentik vertical examples match dogfood
Verdict
LGTM ✅ — The increment is a faithful, well-tested implementation of approved design. All three packages are production-ready: type-safe, properly validated, backward-compatible, and aligned with AIP conventions. Ready to merge.
🤖 @agentproto-bot — review · session sess_9f617043 (agent-step:claude-sdk) · claude-sdk / subscription · e2b i269lbjdcn89ez34ijggm · run 33811276064 · sha f1dbbf4d9e6f1ab01d39b8a46b6b33c5411b7863
…sion; AIP-54 REF unchanged)
|
Numbering correction filed (commit cb31c52):
|
There was a problem hiding this comment.
Summary
The increment delivers a mechanical renumbering of the product capability from AIP-53 → AIP-55 due to a canonical registry collision (the separate agentproto/agentproto registry already assigns AIP-53 to APP.md). All references are consistently updated; no functional changes or test adjustments needed.
Changeset
| Package | Bump | Reason |
|---|---|---|
| @agentproto/product | (no bump) | Renumbering only — spec ref updated, no API change |
| @agentproto/ref-catalog | (no bump) | Updated cross-reference only — no API change |
| @agentproto/extension | (no bump) | Unaffected — no API change |
(Changeset .changeset/pr-1135-agentic.md text updated to reflect AIP-55)
Findings
None — the renumbering is complete and consistent:
Scope verification
- ✅ Product package: description, keywords, homepage, all source files updated
- ✅ ref-catalog: package.json and types.ts cross-references updated
- ✅ Schema files:
aip-53/→aip-55/directory move,$idfields updated,$refpointers correct - ✅ Specs: PRODUCT.md and PRODUCT.schema.json moved and updated
- ✅ Proposal documents: Added explanatory notes documenting the renumbering history
- ✅ Tests: No AIP-53 hardcoded strings in test files
Architecture impact
- AIP-54 (ref-catalog) unchanged — AIP-55 product capability still correctly references it via
$ref: "https://agentproto.sh/schemas/aip-54/REF.schema.json" - Capability attachment mechanism unaffected
- AIP-40 v2 selective composition unaffected
Verdict
LGTM ✅ — Renumbering is complete, consistent, and safe. All references updated; no functional changes. Approved to merge.
🤖 @agentproto-bot — review · session sess_0b4826dc (agent-step:claude-sdk) · claude-sdk / subscription · e2b iepadkq15ccmep04s43r7 · run 33815256529 · sha cb31c5205b73338586c5064651117e17b4b5c565
…urces/aip-54 + aip-55 and the canonical registration
… folded from removed findings doc
There was a problem hiding this comment.
Summary
The increment delivers documentation cleanup and spec updates. Two new commits remove temporary proposal/findings documents that served their purpose during design, and fold key insights into the canonical AIP-54 spec. However, a pre-existing issue remains: the changeset file still references AIP-53 instead of AIP-55.
Changeset
No new packages affected by this increment; same as prior commits:
| Package | Status | Note |
|---|---|---|
| @agentproto/product | (minor) | Renumbered AIP-53 → AIP-55 in prior commit; changeset text not yet updated |
| @agentproto/ref-catalog | (minor) | Spec conventions added |
| @agentproto/extension | (minor) | No changes in increment |
Findings
Changeset text still references outdated AIP-53
File: .changeset/pr-1135-agentic.md
Issue: The changeset file contains two outdated references to AIP-53 that were not updated when the product capability was renumbered to AIP-55 in commit cb31c52:
- Line 7:
"AIP-53 pricing capability"should be"AIP-55 pricing capability" - Line 7:
specs/resources/aip-53/draft/should bespecs/resources/aip-55/draft/
Context: The directory specs/resources/aip-53/ no longer exists (correctly renamed to aip-55/), but the changeset changelog text was not synchronized during renumbering. The package.json already correctly references AIP-55 everywhere.
Resolution: Update .changeset/pr-1135-agentic.md to replace both AIP-53 references with AIP-55 before merge.
Increment Quality
✅ Commit c6adb8c (chore: remove loose proposal/findings docs) — Correctly removes three temporary design documents (COMPOSABILITY-FINDINGS.md, PROPOSAL-composable-primitives.md, PROPOSAL-product-primitive.md) that have been superseded by the canonical specs in specs/resources/aip-54/ and aip-55/draft/. No other files reference these documents.
✅ Commit d7ce6ab (docs(aip-54): handle-convention notes) — Correctly folds critical insights from the removed findings doc into the normative REF.md spec:
- Handles SHOULD carry
schema: "<doctype>/vN"for self-description - Family keys are the family's choice (most use
id, but packs usename)
Both conventions are accurate reflections of the dogfooding findings and properly positioned as normative guidance in the spec.
Verdict
✅ Changes needed (one fix) — The increment itself is good; the documentation cleanup and spec updates are sound. However, .changeset/pr-1135-agentic.md must be updated to replace AIP-53 references with AIP-55 before merge, to keep the changelog text consistent with the actual spec numbering.
There was a problem hiding this comment.
Summary
Adds two new packages — @agentproto/ref-catalog (AIP-54: typed cross-AIP ArtifactRef + aip:// URI (de)serialization, resolved through per-family AIP-43 registries via RefCatalog) and @agentproto/product (AIP-55: a pricing capability — one-time/prepaid-pool/pay-per-call price union + billingRail — attached to any artifact via an AIP-54 ref, replacing the earlier bespoke-target-union AIP-53 draft) — and extends @agentproto/extension with AIP-40 v2 selective composition (remove_fields, guarded; per-aspect inherit). Extensive design-note history is included and cleaned up along the way.
Changeset
| package | bump | reason |
|---|---|---|
@agentproto/ref-catalog |
minor | new package, new public API |
@agentproto/product |
minor | new package, new public API |
@agentproto/extension |
minor | new backward-compatible fields (remove_fields, inherit) |
A changeset (pr-1135-agentic.md) already exists with the correct packages/bumps, but its prose references specs/resources/aip-53/draft/ — that directory no longer exists (renamed to aip-55 per cb31c52). I'll replace it with corrected text.
Findings
Correctness / Packaging
packages/product/package.jsonis missing adependenciesentry for@agentproto/ref-catalog.src/types.tsdoesimport type { ArtifactRef } from "@agentproto/ref-catalog"andArtifactRefflows into the publicly exportedProductDefinition.on(and thusProductHandle,defineProduct,attachPricing).@agentproto/ref-catalogis currently only adevDependencyofproduct. Compare with@agentproto/extension, which correctly lists@agentproto/manifest/@agentproto/define-doctypeunderdependenciesfor the same reason. As shipped, a consumer installing@agentproto/productalone won't get@agentproto/ref-catalog's type declarations transitively, breaking downstreamtsc. Please move it todependencies.
Docs / Changeset accuracy
- The pre-written changeset text says "Specs: …
specs/resources/aip-53/draft/(rewritten to the capability shape)" — this is stale after the AIP-53→AIP-55 renumber; the real path isspecs/resources/aip-55/draft/. Minor but worth fixing before publish since changeset prose ships in the CHANGELOG verbatim.
AIP alignment / Design
- The ref-catalog / product split is a real improvement over the original AIP-53 draft (per the PR's own dogfooding findings, F1/F2): targets are now typed refs resolved through AIP-43 registries rather than embedded handles, and pack/app naming collisions (
namevsidkeying) are handled via per-familykeyByrather than assumed. Good use of the repo's own composability findings to drive the redesign. AIP-40 v2'sremove_fieldsguard (parent-required fields refuse removal) and per-aspectinheritcorrectly default totrue/wholesale, preserving v1 behavior byte-for-bit — confirmed by the "v1 back-compat" test assertingspec.parse === appParentSpec.parseetc.verifyTighteningis explicitly self-consistency-only (documented limitation, not full parent-schema monotonicity) — acceptable since it's flagged in comments and the doc-comment, not silently weaker than advertised.
Tests
- Good coverage across all three packages:
ref-catalog.test.tscovers resolution, strict-mode errors, re-registration/hot-reload,refFordefault keyBy precedence, and URI round-tripping;define-product.test.tscovers cross-artifact pricing, validation invariants, and rail-specific rules (Stripe pay-per-call meterId requirement);spec-from-extension-v2.test.tscoversremove_fieldsenforcement + guard, and all fourinheritaspects plus the v1 back-compat case. No gaps spotted.
Nits
packages/product's tsup banner saysv0.1.0-alphaandindex.tsexportsSPEC_VERSION = "1.0.0-alpha", whilepackage.jsonversion is0.1.0— three different version strings for the same package. Not blocking, but worth reconciling before first publish.- The included
PROPOSAL-*.md/COMPOSABILITY-FINDINGS.mddesign docs are added and then deleted within the same PR (per the diff) — fine as working history, just confirm nothing outsidepackages/still links to them.
Simplify (ponytail lens)
Nothing over-engineered found — the ref/product split removes complexity relative to the superseded AIP-53 draft (one reference mechanism instead of per-kind appRef/packRef/knowledge-pack fields), and the inherit/remove_fields additions are opt-in with sensible defaults rather than speculative flexibility. net: -0 lines possible.
Verdict
Changes needed ❌ — the missing dependencies entry for @agentproto/ref-catalog in @agentproto/product's package.json is a real packaging defect (its type is part of the public API surface) and should be fixed before merge. Everything else — design, tests, spec sync, extension back-compat — looks solid.
There was a problem hiding this comment.
Summary
The increment directly addresses the prior review feedback by correcting both AIP-53 references to AIP-55 in the changeset file. The changeset text now correctly reflects the spec numbering established in earlier commits. ✅
Changeset
No additional packages; same as prior commits:
| Package | Bump | Reason |
|---|---|---|
| @agentproto/product | minor | Pricing capability (AIP-55) |
| @agentproto/ref-catalog | minor | Cross-AIP artifact references (AIP-54) |
| @agentproto/extension | minor | AIP-40 v2 selective composition |
Findings
Changeset ✅ FIXED
The issue identified in the prior review—changeset text referencing outdated AIP-53—has been resolved:
"AIP-53 pricing capability"→"AIP-55 pricing capability"✓specs/resources/aip-53/draft/→specs/resources/aip-55/draft/✓
Verdict
✅ LGTM — The increment correctly addresses the prior changeset feedback. All spec references now align with the product renumbering (AIP-55). The PR is ready to merge.
There was a problem hiding this comment.
Summary
The increment promotes @agentproto/ref-catalog from devDependencies to dependencies in the product package. This is correct: since the product package's public API types (ProductDefinition, ProductHandle) depend on ArtifactRef from ref-catalog, consumers need access to those type definitions at build time. The change ensures proper TypeScript module resolution and successful DTS (declaration) builds.
Changeset
Already present (.changeset/pr-1135-agentic.md):
| Package | Bump | Reason |
|---|---|---|
| @agentproto/product | minor | AIP-55 pricing capability + ref-catalog as runtime type dependency |
| @agentproto/ref-catalog | minor | AIP-54 artifact references (cross-AIP refs) |
| @agentproto/extension | minor | AIP-40 v2 selective composition |
Findings
Dependency promotion ✅ Justified
Moving @agentproto/ref-catalog from devDependencies to dependencies is appropriate because:
ProductDefinitioninterface usesArtifactRefin its public type definition (packages/product/src/types.tsline 50)ProductDefinitionis exported from the product package's public API- TypeScript DTS (declaration) builds require access to ref-catalog types at compile time
- Consumers installing the product package from npm will need ref-catalog available for proper type resolution
- Build verification: tsup ESM and DTS builds now complete successfully ✓
Verdict
✅ LGTM — The increment correctly addresses the underlying dependency issue. Promoting ref-catalog to a runtime dependency ensures consumers can properly resolve types exported from the product package. All builds succeed, and the changeset is accurately documented.
🤖 @agentproto-bot — review · session sess_93b98279 (agent-step:claude-sdk) · claude-sdk / subscription · e2b iqqnchftf6vw5djftmvw2 · run 33818260317 · sha ef8eb64db8de37345afaaf7e4ad2d594841381b5
Status: REAL IMPLEMENTATION (docs → spec → code → canonical registration)
Three deliverables on this branch, plus three canonical registration PRs in
agentproto/agentproto(the authoritative AIP registry — separate repo).1. AIP-54 — typed cross-AIP reference primitive (
packages/ref-catalog, new)ArtifactRef={aip, id, version?},aip://URI serialization (refToUri/refFromUri),RefCatalogjoining per-family AIP-43 registries,refForderiving refs from real handles (family keyBy enforced — ref id and registry key can't drift), typedRefFamilyError/RefUnresolvableError.specs/resources/aip-54/draft/; canonical spec in AIP-54: REF — ref/v1 (typed cross-AIP artifact reference) agentproto#20.2. AIP-55 — pricing capability (
packages/product, new; depends on ref-catalog)defineProduct/attachPricing: price union (one-time | prepaid-pool | pay-per-call, minor units normative) + billingRail (stripe w/ requiredmeterIdfor pay-per-call; autumn native for both metered shapes; open vendor rails).on: ref/v1replaces the bespoketargetunion; local resources atspecs/resources/aip-55/draft/(renamed from aip-53); canonical spec in AIP-55: PRODUCT — product/v1 (pricing capability attached via AIP-54 ref) agentproto#21.3. AIP-40 v2 — selective extension composition (
packages/extension, modified)remove_fields(guarded: parent-required fields refuse removal; removed fields enforced away) + per-aspectinherit: {schema, defaults, parse, path}. Empty config = v1 byte-for-byte (pre-existing tests pass unchanged; 9 new v2 tests).specs/resources/aip-40/draft/EXTENSION.schema.jsonmirrors the v2 schema.Gate (real exit codes)
pnpm check-typesexit 0.pnpm buildexit 0. All packages in this diff green (ref-catalog 12, product 13, extension 18).adapters/claude-sdkmoonshot live e2e (fails on clean main too — network-dependent), onepackages/worktreegc timeout (passes on re-run, 195/195).Known gaps (documented)
parentRequiredpassed by hosts (manifest schema not introspectable fromspec-from-extension— same limitation astightenverification).AppHandlelacksschema(self-describingcreateDoctypebuild() convention) — follow-up.pricingblock: product price authoritative; deprecation path follow-up.Not merging anything — PR #1135 here, and PRs #20/#21/#22 in agentproto/agentproto, all await Jeremy.