1.9 KiB
1.9 KiB
Agents
Intentional design decisions (not bugs)
ConvTypeonly convertsfloat64 -> int: Other type mismatches are caught byreflect.Callpanic, which is recovered and reported as an error. No additional type validation is needed inConvType.handleCallassumes last return value iserror: All API methods must returnerroras their last return value. This is enforced by the code generator (kitcom). The runtime does not re-validate this — registering a struct with non-conforming exported methods is a usage error.Function.lengthused for arg count validation in TS: API methods must not use default parameters or rest parameters. This is a constraint of the IPC interface — all parameters are always sent explicitly over the wire.- Blob serialization is asymmetric between Go and TS: Go wraps blobs as
{"t":"blob","d":"<base64>"}, TS sends bare base64 strings. This is handled by the generated code on each side (base64.DecodeStringin Go templates,Buffer.fromin TS templates). DirectCall()with blob args across languages requires matching the target's expected format. ConvTypesilently passes through non-integer floats: If a float64 doesn't fit cleanly in int (e.g.1.5, overflow), the original float64 is returned andreflect.Callpanics. The panic is recovered and reported. No separate error path is needed.- Only first error is captured in Go
errCh: The channel has buffer size 1 andraiseErrdoes a non-blocking send. Subsequent errors are dropped. The first error is sufficient for diagnosing failures — capturing all errors would add complexity without meaningful benefit. NewChildcallsflag.Parse()on the global flagset: This is intentional. The child process is expected to be a dedicated IPC child where kitten-ipc owns the flag parsing. Host applications needing custom flags should coordinate accordingly.