Skip to content

docs: design note for a defineProduct primitive (suggested AIP-55) - #1135

Merged
agentiknet merged 15 commits into
mainfrom
proposal/product-primitive
Sep 3, 2026
Merged

agentiknet merged 15 commits into
mainfrom
proposal/product-primitive

Conversation

@agentiknet

@agentiknet agentiknet commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

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).

Numbering correction (2026-09-04): the pricing capability was originally mis-numbered AIP-53 by scanning this repo's local specs/resources/ — wrong source of truth. Canonical 53 is APP.md (app/v1), . Final numbers: AIP-54 = REF (unchanged), AIP-55 = PRODUCT (renumbered; commit cb31c520). Canonical registration PRs:

1. AIP-54 — typed cross-AIP reference primitive (packages/ref-catalog, new)

  • ArtifactRef = {aip, id, version?}, aip:// URI serialization (refToUri/refFromUri), RefCatalog joining per-family AIP-43 registries, refFor deriving refs from real handles (family keyBy enforced — ref id and registry key can't drift), typed RefFamilyError/RefUnresolvableError.
  • Local resources mirrored at specs/resources/aip-54/draft/; canonical spec in AIP-54: REF — ref/v1 (typed cross-AIP artifact reference) agentproto#20.
  • 12 committed tests.

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/ required meterId for pay-per-call; autumn native for both metered shapes; open vendor rails).
  • Spec rewritten to the collapsed capability shape: on: ref/v1 replaces the bespoke target union; local resources at specs/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.
  • 13 committed tests — incl. one pricing call covering app (AIP-42), pack (AIP-52), tool (AIP-14), hypothetical sandbox (AIP-61) through the SAME mechanism.

3. AIP-40 v2 — selective extension composition (packages/extension, modified)

Gate (real exit codes)

  • pnpm check-types exit 0. pnpm build exit 0. All packages in this diff green (ref-catalog 12, product 13, extension 18).
  • Full-gate failures verified pre-existing/unrelated: adapters/claude-sdk moonshot live e2e (fails on clean main too — network-dependent), one packages/worktree gc timeout (passes on re-run, 195/195).

Known gaps (documented)

  • parentRequired passed by hosts (manifest schema not introspectable from spec-from-extension — same limitation as tighten verification).
  • AppHandle lacks schema (self-describing createDoctype build() convention) — follow-up.
  • AIP-52 legacy pricing block: product price authoritative; deprecation path follow-up.

Not merging anything — PR #1135 here, and PRs #20/#21/#22 in agentproto/agentproto, all await Jeremy.

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 owns defineAsset), 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. ProductPrice discriminates on model; BillingRail on rail. Minor-unit amounts everywhere (following AIP-49 wallet's decimals pattern) structurally prevents off-by-100 bugs.
  • Cross-field validation acknowledged. The proposal notes that kind consistency (outer kind vs. target.kind) must be enforced in validate(), 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 new ProductKind values 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

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 oneOf with proper mutual exclusivity via discriminator fields. Each variant enforces its required fields: amountMinor for one-time, unitPriceMinor + grantUnits for prepaid-pool, unitPriceMinor + meter for pay-per-call.
  • Critical fix F1 properly incorporated: appRef (string id) replaces the original inline app: AppHandle that serialized the whole bundle. Spec correctly documents that anonymous apps without id cannot be sold.
  • High-priority fix F2 properly incorporated: Explicit pack target kind with packRef (the pack's name, not id) addresses the registry mismatch. Spec correctly documents that product price is authoritative if pack carries competing pricing block.
  • Medium fix F3 properly incorporated: Stripe rail schema includes meterId field; 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's decimals pattern to prevent ×100 bugs. Currency is ISO-4217 lowercase; minimum: 0 for prices, minimum: 1 for grant units.

Cross-field Validation ✅

  • Kind consistency rule: kind MUST equal target.kind when target is present. Correctly left to the validate() 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" AND billingRail?.rail === "stripe", then meterId is required. Documented in the schema as normative, enforced in validate.
  • Optional fields handled correctly: billingRail, target, title, version, metadata all 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 createDoctype usage 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., unitPriceMinor for pay-per-call, not amountMinor), 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 use additionalProperties: 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

@agentiknet

Copy link
Copy Markdown
Contributor Author

New commit (dedf26c): composable-primitives redesign — packages/PROPOSAL-composable-primitives.md

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 appRef/packRef per target kind was the tell. Three primitives proposed and dogfooded for real (scratch vitest suite driving app-kit/pack/registry/tool dists — 7 tests, all passing):

  1. Typed artifact reference (suggested AIP-54, ref/v1) — {aip, id, version} + optional aip:// URI, over AIP-43 registries joined by a 20-line RefCatalog. Driven: derives refs from real AppHandle/PackHandle/AIP-14 ToolHandle/sandbox, resolves all four back to the same object identity through one catalog.
  2. Capability attachment — defineCapability({kind: "pricing", on: ArtifactRef, payload}). The AIP-53 inversion: pricing attaches TO anything. Driven: the same call priced a real app, real pack, real AIP-14 tool, and a hypothetical sandbox — zero per-kind fields, sandbox AIP unchanged.
  3. AIP-40 v2 selective composition — remove_fields (guarded: parent-required fields refuse removal, mirroring AIP-18's inherited-status rule) + per-aspect inherit: {schema, defaults, parse, path}, back-compatible. Driven: "keep app identity, drop agents/workflows, add price" now composes, with the guard enforced.

Honest residuals (documented in §4): handles lack schema (can't self-describe into refs — needs a cheap createDoctype build() convention), pack keys on name (RefCatalog must own the family keyBy table), AIP-52 legacy pricing still drifts, tighten verification still best-effort.

AIP-53 collapses to the pricing capability payload + on: aip://… — all its commerce thought (price union, billing rails, Stripe meterId) carries over verbatim.

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 id contains / 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 inherit selection + remove_fields is 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

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by on: ArtifactRef (version moves to ref)
  • price/billingRail → unchanged, become capability payload
  • id → unchanged, becomes CapabilityDefinition.id
  • title, 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:

  1. Escaping/encoding of id (character restrictions or percent-encoding)
  2. Parsing rule for optional @version (last unescaped @ split)
  3. 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

@agentiknet

Copy link
Copy Markdown
Contributor Author

Implementation commits (40f2281 → 2686083):

Piece Package Tests Spec
AIP-54 typed refs packages/ref-catalog (new) 12 specs/resources/aip-54/draft/ (REF.schema.json + REF.md)
AIP-53 pricing capability packages/product (new, dep: ref-catalog) 13 specs/resources/aip-53/draft/ rewritten to on: ref/v1 capability shape
AIP-40 v2 selective composition packages/extension (modified in place) 18 (9 pre-existing pass unchanged = back-compat, 9 new) EXTENSION.schema.json + zod + README updated

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 aip:// migration of AIP-18 refKind/AIP-42 AnyRef/AIP-52 `` (documented in REF.md's migration table, not wired into those packages — deliberately out of scope here), and the createDoctype self-describing `schema` convention (AppHandle gap).

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.

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 attachPricing and collectPriced utilities 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) and id (registry key), optional version
  • AIP-53 schema properly references AIP-54 ($ref: "https://agentproto.sh/schemas/aip-54/REF.schema.json"), replaces target union with on: 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

@agentiknet

Copy link
Copy Markdown
Contributor Author

Numbering correction filed (commit cb31c52):

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, $id fields updated, $ref pointers 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

@ponytail-coder ponytail-coder Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 be specs/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 use name)

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.


@ponytail-coder ponytail-coder Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json is missing a dependencies entry for @agentproto/ref-catalog. src/types.ts does import type { ArtifactRef } from "@agentproto/ref-catalog" and ArtifactRef flows into the publicly exported ProductDefinition.on (and thus ProductHandle, defineProduct, attachPricing). @agentproto/ref-catalog is currently only a devDependency of product. Compare with @agentproto/extension, which correctly lists @agentproto/manifest/@agentproto/define-doctype under dependencies for the same reason. As shipped, a consumer installing @agentproto/product alone won't get @agentproto/ref-catalog's type declarations transitively, breaking downstream tsc. Please move it to dependencies.

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 is specs/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 (name vs id keying) are handled via per-family keyBy rather than assumed. Good use of the repo's own composability findings to drive the redesign.
  • AIP-40 v2's remove_fields guard (parent-required fields refuse removal) and per-aspect inherit correctly default to true/wholesale, preserving v1 behavior byte-for-bit — confirmed by the "v1 back-compat" test asserting spec.parse === appParentSpec.parse etc.
  • verifyTightening is 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.ts covers resolution, strict-mode errors, re-registration/hot-reload, refFor default keyBy precedence, and URI round-tripping; define-product.test.ts covers cross-artifact pricing, validation invariants, and rail-specific rules (Stripe pay-per-call meterId requirement); spec-from-extension-v2.test.ts covers remove_fields enforcement + guard, and all four inherit aspects plus the v1 back-compat case. No gaps spotted.

Nits

  • packages/product's tsup banner says v0.1.0-alpha and index.ts exports SPEC_VERSION = "1.0.0-alpha", while package.json version is 0.1.0 — three different version strings for the same package. Not blocking, but worth reconciling before first publish.
  • The included PROPOSAL-*.md / COMPOSABILITY-FINDINGS.md design docs are added and then deleted within the same PR (per the diff) — fine as working history, just confirm nothing outside packages/ 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.

@ponytail-coder ponytail-coder Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ponytail-coder ponytail-coder Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • ProductDefinition interface uses ArtifactRef in its public type definition (packages/product/src/types.ts line 50)
  • ProductDefinition is 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

@agentiknet agentiknet changed the title docs: design note for a defineProduct primitive (suggested AIP-53) docs: design note for a defineProduct primitive (suggested AIP-55) Sep 3, 2026
@agentiknet
agentiknet merged commit 89f6662 into main Sep 3, 2026
11 checks passed
@agentiknet
agentiknet deleted the proposal/product-primitive branch September 3, 2026 23:51
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.

1 participant