feat(coding): generate trust-manager bindings via fluessig#329
Conversation
Swap the two pure hand-written `#[napi]` helpers from coding-agent core/trust-manager.ts to the fluessig-generated path: author the ops in schema/api.json, add the `core_impl` delegations, regenerate src/generated.rs, and delete the hand-written exports from src/lib.rs. `getProjectTrustParentPath(cwd: string) -> string | null` (nullable string) and `hasTrustRequiringProjectResources(cwd: string, homeDir: string) -> boolean` (bool) both delegate straight into `pidgin_coding::core::trust_manager` — the same functions the hand-written exports called (the latter via the `_with_home` seam), so JS-visible behavior is byte-for-byte unchanged. The module's stateful / JSON-envelope exports (getProjectTrustOptions, trustStoreGetEntry, trustStoreSetMany) stay hand-written for now and remain in the addon surface alongside the two generated ops. 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 (module 3). cargo build/fmt/clippy clean; codespell 0; straitjacket 0 errors; the trust-manager oracle slice (coding-agent/test/trust-manager.test.ts, 2 tests) passes 2/2 against the locally-built generated addon (exercising both the two generated ops and the still-hand-written trust exports).
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
Two pure exports of the
trust-managermodule were hand-written#[napi]wrappers insrc/lib.rs:getProjectTrustParentPath(cwd) → string | null(nullable string)hasTrustRequiringProjectResources(cwd, homeDir) → boolAfter
Both exports are now generated by fluessig instead of being hand-written, byte-identical to the previous build (2/2 identical:
.d.tsblocks,.jsmodule.exportslines,nativeBindingmembership). They delegate straight through (the_with_homeseam for the second). The stateful / JSON-envelope exports (getProjectTrustOptions,trustStoreGetEntry,trustStoreSetMany) stay hand-written and remain in the addon — generated and hand-written coexist.How
schema/api.json(catalog.json unchanged).core_impldelegations to the same core fns the hand-written exports called.src/generated.rs, then deleted the hand-written#[napi]exports fromsrc/lib.rs.Stacked on
napi-fluessig/version-check.Generated by Claude Code