Skip to content

Naming unifications and fixes backport#2

Draft
noise64 wants to merge 5 commits into
mainfrom
main-naming-backport
Draft

Naming unifications and fixes backport#2
noise64 wants to merge 5 commits into
mainfrom
main-naming-backport

Conversation

@noise64

@noise64 noise64 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

noise64 added 5 commits July 6, 2026 22:17
…cess

Backport of the fluent-alignment DSL renames from golem-1.6 to the 1.5.x
(pre-schema) line. Wire-safe — pure source-API renames, no change to the
emitted agent-type schema/WIT.

- defineAgent: constructorParams -> id, snapshot -> snapshotting
  (+ id-concept internal sweep: canonicalId, idFieldNames,
  stringBindableIdFields, generic C -> Id)
- method: params -> input (+ input-concept sweep: generic Params -> Input,
  stringBindableInputs)
- Kept `success` (did NOT rename to `returns`): an effect handler returns
  Effect<A, E, R>, so `success`/`error` name the two channels and pair with
  the sibling `error:` key (canonical Effect/Result vocabulary). fluent keeps
  `returns` because it returns a value directly with no `error:` sibling.
- Excludes Item 7 numeric enforcement (a runtime feature, not a naming change;
  its wire half can't target 1.5.0's WIT).
The SDK naming backport (906adc8) didn't touch the in-repo integration-test app
(it's e2e, not part of `npm test`), so it still used the old keys. Update it so it
compiles against the renamed API: constructorParams -> id, params -> input,
snapshot -> snapshotting. `success` kept (effect's channel model).

Verified: golem 1.5.4 `golem build` compiles all 15 agents + injects the SDK
bundle into agent_guest.wasm [OK].
The agent guest (QuickJS via wasm-rquickjs — both the 1.5.x pin 0.3.4 and the
1.6 pin 0.3.6 are built without ICU) throws on `new TextDecoder("utf-8",
{ fatal: true })` at construction, which crashed agent-type extraction at deploy.
Add `internal/textDecoder.ts::strictTextDecoder()` (fatal decoder with a lenient
fallback) and route the 4 eager module-scope decoders through it
(Blobstore/KeyValue/Webhook/snapshotEnvelope).

Backport of golem-1.6's fa32b90 (golem-1.6 already carries this). A runtime-compat
prerequisite, kept separate from the naming backport.

Verified end-to-end on golem 1.5.4: golem build + deploy + invoke Counter
(increment/add, durable) and Lookup (success {ok:7} + error {NotFoundError}) [OK].
Add a `readOnly?: boolean | ReadOnlyOption` option to `method(...)` /
`MethodSpec` plus a `withReadOnly` combinator, for source parity with the
2.0.0 line. FLAG: the `golem:agent/common@1.5.0` `agent-method` record targeted
by this branch has no `read-only` field, so the option is carried on the SDK
method surface but is not emitted into the discovered agent metadata on the
1.5.0 wire model.
Add `Principal.PrincipalSchema`, an Effect Schema whose WitCodec lowers to the
WIT `golem:agent/common` `principal` variant (oidc/agent/golem-user/anonymous),
letting a Principal travel as ordinary data in a method param/return (not just
the Principal capability service). Annotated with a new
`witPrincipalAnnotationKey`; the WitCodec Declaration walker recognises it and
builds the variant WitType graph + a host-Principal round-trip WitValueTree
pair, adapted to this branch's witTree wire model.
@noise64 noise64 changed the title Naming unifications backport Naming unifications and fixes backport Jul 7, 2026
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