Naming unifications and fixes backport#2
Draft
noise64 wants to merge 5 commits into
Draft
Conversation
…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.
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.
No description provided.