feat(coding): generate resolve-config-value bindings via fluessig#326
feat(coding): generate resolve-config-value bindings via fluessig#326zmaril wants to merge 1 commit into
Conversation
…ia fluessig Swap four hand-written `#[napi]` exports from coding-agent core/resolve-config-value.ts to the fluessig-generated path: author the ops in schema/api.json, add the matching `core_impl` delegations, regenerate src/generated.rs, and delete the hand-written exports from src/lib.rs. The four ops are proven primitive shapes: `getConfigValueEnvVarName(config) -> string | null` (nullable string), `getConfigValueEnvVarNames(config) -> Array<string>` (list), `isCommandConfigValue(config) -> boolean` (bool), and `clearConfigValueCache() -> void` (void, no params). Each `core_impl` method reaches the SAME `pidgin_coding::core::resolve_config_value` function the hand-written export called, so JS-visible behavior is byte-for-byte unchanged. The module's other exports (resolveConfigValue*, resolveHeaders*, the env-JSON helpers) stay hand-written for now. Verified: each swapped symbol's generated `.d.ts` JSDoc+signature block, its `.js` `module.exports` line, and its nativeBinding destructure entry are byte-identical to a pre-swap build of the base (only file position moves into the generated cluster). cargo build/fmt/clippy clean; codespell 0; straitjacket 0 errors; the resolve-config-value oracle slice (coding-agent/test/resolve-config-value.test.ts, 10 tests) passes 10/10 against the locally-built generated addon.
Conformance smoke: agent + ai + tui
Headline is rust-backed: passing cases in files whose module-under-test is a native (Rust addon) module. Raw all-pass is shown secondary — it is inflated by unflipped TypeScript that passes without touching any Rust.
agent: 55/180 (30.6%) · ai: 74/1295 (5.7%) · tui: 375/678 (55.3%) rust-backed = passing / total tests run, per the manifest's per-native-row AttributionA pi test file is rust-backed iff the module it primarily exercises — its module-under-test — is Per-file decisions (from each native manifest row's
CLI conformance (black-box, against the pidgin binary)
The four repointed coding-agent CLI test files spawn the compiled pidgin binary via |
Before
Four exports of the
resolve-config-valuemodule were hand-written#[napi]wrappers insrc/lib.rs:getConfigValueEnvVarName(string → nullable string)getConfigValueEnvVarNames(→ list string)isCommandConfigValue(→ bool)clearConfigValueCache(→ void)After
The same four exports are now generated by fluessig instead of being hand-written. The generated JS surface is byte-identical to the previous build: each symbol's
.d.tssignature/JSDoc block, its.jsmodule.exportsline, and itsnativeBindingdestructure membership match the pre-swap addon (4/4 identical). napi binds by name, so the shared destructure megaline reordering as symbols move into the generated cluster is benign.The module's other exports (
resolveConfigValue*,resolveHeaders*, env-JSON helpers) intentionally stay hand-written; the addon exports both sets.How
schema/api.json(all-primitive query surface; catalog.json unchanged — no new DTOs).core_impldelegations routing each op to the samepidgin_coding::core::resolve_config_value::*fn the hand-written export called.src/generated.rs, then deleted the hand-written#[napi]exports fromsrc/lib.rs(keptpub mod generated;).Stacked on
napi-fluessig/prompt-templates(#324).Generated by Claude Code