Artifact dbe49eacd179a94bb015d5406735cbc8c7da8d091a5c433bfd5fd439b6ffe835:
- File
src/cred.h
— part of check-in
[3ff8346a3f]
at
2026-11-19 00:38:38
on branch stage-4
— Journal every reply in two forms and convert across models
Assistant entries keep the provider content verbatim with its origin (provider, api, model) and Pi neutral form; tool calls come from the neutral form, the same for every provider. A turn goes back verbatim to the model that wrote it and is otherwise rebuilt from the neutral form, without thinking and with tool-call ids normalised identically in calls and results. --model resolves through the registry, keys come from the model, and schema 3 journals migrate in place on open. (user: dmestas, size: 879) [annotate] [blame] [check-ins using] [more...]
/* pic's only credential code. A key is fetched into a caller buffer just * before a request and wiped right after; it is never journaled, logged or * put in an error message. Where keys come from is the model registry's * business (a variable name, or a key written in the models file); later the * credential project's helper command (docs/credential-project.md). */ #ifndef PIC_CRED_H #define PIC_CRED_H #include <stddef.h> /* Fetches a key: the literal if one is given, else the variable ENV. 0 with * the key in buf; 1 when neither is configured (a server that needs no key); * -1 with err (never the value) when the variable is unset or unusable. */ int pic_cred_get(const char *env, const char *literal, char *buf, size_t cap, char *err, size_t errcap); /* Overwrites n bytes in a way the compiler may not remove. */ void pic_cred_wipe(void *p, size_t n); #endif