feat(coding-agent): generate stripAnsi via fluessig#322
Conversation
Swap the hand-written `#[napi] stripAnsi` (coding-agent utils/ansi.ts: remove ANSI escape sequences (OSC + CSI)) to the fluessig-generated path: author its op in schema/api.json, add `strip_ansi` to core_impl.rs (the engine seam), regenerate src/generated.rs, and delete the hand-written export from lib.rs. stripAnsi is the plainest string->string bucket-A export: `(value: string) -> string`, infallible. The `core_impl` method delegates to the same underlying `pidgin_coding::utils::ansi::strip_ansi` the hand-written export called, so behavior is byte-for-byte unchanged. The shim keeps pi's non-string `TypeError` guard in TS (the Rust type system guarantees a `&str`), unchanged by this swap. Verified: the 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 their file position moves into the generated cluster). cargo build/fmt/clippy clean; codespell 0; straitjacket 0 errors; the ansi-utils oracle slice (coding-agent/test/ansi-utils.test.ts, 5 tests) passes 5/5 against the locally-built generated addon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
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/1293 (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 |
Swap the hand-written
#[napi] stripAnsi(coding-agentutils/ansi.ts) to the fluessig-generated path.Module 11 of the pidgin-napi → fluessig campaign (module 1 of this stacked batch of 3). Stacked on
napi-fluessig/parse-git-url-core.What changed
stripAnsiop inschema/api.json((value: string) -> string, infallible, bucket-A string→string).strip_ansitocore_impl.rsdelegating to the samepidgin_coding::utils::ansi::strip_ansithe hand-written export called — behavior byte-for-byte unchanged.src/generated.rs; delete the hand-written export fromlib.rs.TypeErrorguard in TS (unchanged).Gates
stripAnsi's.d.tsJSDoc+signature block,.jsmodule.exportsline, and nativeBinding destructure entry are byte-identical (only file position moves into the generated cluster).cargo build -p pidgin-napi,cargo fmt --all --check,cargo clippy -p pidgin-napi --all-targets -- -D warningsclean; codespell 0.coding-agent/test/ansi-utils.test.ts: 5/5 pass against the locally-built generated addon.🤖 Generated with Claude Code
https://claude.ai/code/session_017xL2W7dkhPsTSRuXQNCDeY
Generated by Claude Code