C, C# and JavaScript implementations of the line #4

Merged
merge-queue merged 1 commit from logline-c-dotnet-js into main 2026-11-26 12:18:41 -08:00
Owner

at-tmux (C), spirelens (C#) and the Node services can now write the estate's standard line. Each new implementation has the Go package's API in its own language's idiom and runs testdata/golden.json and testdata/redact.json.

Added

  • c/: logline.h / logline.c, C99 with no dependencies (Windows API on Windows, POSIX elsewhere; local time with zone offset and milliseconds on both). It covers logline_format, logline_parse, a file logger (open-append-close per line, 1 MiB rotation to .old, %LOCALAPPDATA%\<app>\<app>.log or an override variable), a stream logger and logline_redact. It installs as a CMake package (logline::logline) so at-tmux can take it through a vcpkg overlay port the way it takes at-protocol. Its test reads both JSON files itself. Redact's credential shapes are hand-written matchers, because C has no regular expressions.
  • dotnet/: RomaineLife.Logline (.NET 9, no packages): LogLine.Format/Parse/TryParse/Redact, Logger.Open/OpenFile, new Logger(TextWriter). xunit tests are in the root logline.sln.
  • js/ and the root package.json: @romaine-life/logline, an ES module with no dependencies (format, parse, redact, Logger.open/file/stream), tested with node --test. The release publishes it to Forgejo's npm registry, and services take it with an .npmrc and an exact pin.
  • Root CMakeLists.txt and CMakePresets.json (the ci preset) for the cmake suite. README: usage and how each is consumed.

Left alone: the Go package, the Rust crate and both case files.

CI: pipeline-templates PR 234 (merged) put the cmake (Linux and Windows), dotnet (Windows) and web-app suites on logline, so this PR runs every language's tests. Before pushing, each suite's own test script passed locally with those topics (cmake/test.mjs under MSVC /W4 /WX, dotnet/test.mjs with locked restore and dotnet format, web-app/test.mjs), and ci-check passed. The C's POSIX branch was compiled for the first time by the cmake suite's Linux job (GCC, -Werror).

Checked against Go beyond the golden files: I compared each implementation with the Go package on 200,000 random redact inputs, 200,000 format inputs and 400,000 parse inputs, all built from credential words, quotes, control characters and non-ASCII text. They agree except in two places:

  • Inside a quoted value, Go's strconv.Quote also escapes non-printing characters that aren't control characters (U+00A0, U+200B, U+2028). C, C# and JS write these characters unescaped, as the Rust crate already does. Every parser reads both forms back to the same value.
  • JS and C# strings can't hold bytes that aren't valid UTF-8.

Work package: https://openproject.home.romaine.life/wp/AHT-204

🤖 Generated with Claude Code

at-tmux (C), spirelens (C#) and the Node services can now write the estate's standard line. Each new implementation has the Go package's API in its own language's idiom and runs `testdata/golden.json` and `testdata/redact.json`. **Added** - `c/`: `logline.h` / `logline.c`, C99 with no dependencies (Windows API on Windows, POSIX elsewhere; local time with zone offset and milliseconds on both). It covers `logline_format`, `logline_parse`, a file logger (open-append-close per line, 1 MiB rotation to `.old`, `%LOCALAPPDATA%\<app>\<app>.log` or an override variable), a stream logger and `logline_redact`. It installs as a CMake package (`logline::logline`) so at-tmux can take it through a vcpkg overlay port the way it takes at-protocol. Its test reads both JSON files itself. Redact's credential shapes are hand-written matchers, because C has no regular expressions. - `dotnet/`: `RomaineLife.Logline` (.NET 9, no packages): `LogLine.Format/Parse/TryParse/Redact`, `Logger.Open/OpenFile`, `new Logger(TextWriter)`. xunit tests are in the root `logline.sln`. - `js/` and the root `package.json`: `@romaine-life/logline`, an ES module with no dependencies (`format`, `parse`, `redact`, `Logger.open/file/stream`), tested with `node --test`. The release publishes it to Forgejo's npm registry, and services take it with an `.npmrc` and an exact pin. - Root `CMakeLists.txt` and `CMakePresets.json` (the `ci` preset) for the cmake suite. README: usage and how each is consumed. **Left alone:** the Go package, the Rust crate and both case files. **CI:** [pipeline-templates PR 234](https://forgejo.romaine.life/romaine-life/pipeline-templates/pulls/234) (merged) put the cmake (Linux and Windows), dotnet (Windows) and web-app suites on logline, so this PR runs every language's tests. Before pushing, each suite's own test script passed locally with those topics (`cmake/test.mjs` under MSVC `/W4 /WX`, `dotnet/test.mjs` with locked restore and `dotnet format`, `web-app/test.mjs`), and `ci-check` passed. The C's POSIX branch was compiled for the first time by the cmake suite's Linux job (GCC, `-Werror`). **Checked against Go beyond the golden files:** I compared each implementation with the Go package on 200,000 random redact inputs, 200,000 format inputs and 400,000 parse inputs, all built from credential words, quotes, control characters and non-ASCII text. They agree except in two places: - Inside a quoted value, Go's `strconv.Quote` also escapes non-printing characters that aren't control characters (U+00A0, U+200B, U+2028). C, C# and JS write these characters unescaped, as the Rust crate already does. Every parser reads both forms back to the same value. - JS and C# strings can't hold bytes that aren't valid UTF-8. Work package: https://openproject.home.romaine.life/wp/AHT-204 🤖 Generated with [Claude Code](https://claude.com/claude-code)
C, C# and JavaScript implementations of the line (AHT-204)
All checks were successful
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite rust / check-services (pull_request) Has been skipped
Suite rust / check-audit (pull_request) Has been skipped
Suite cmake / reused-checks (pull_request) Successful in 7s
Suite rust / reused-checks (pull_request) Successful in 5s
Suite release / check-package (pull_request) Has been skipped
Suite rust / check-machete (pull_request) Has been skipped
Suite default / reused-checks (pull_request) Successful in 5s
Suite cmake / check-test-linux (pull_request) Successful in 7s
Suite web-app / reused-checks (pull_request) Successful in 6s
Suite rust / check-test-windows (pull_request) Successful in 44s
Suite go / reused-checks (pull_request) Successful in 7s
Suite dotnet / check-test-windows (pull_request) Successful in 1m0s
merge-queue landed on main
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite rust / check-format (pull_request) Has been skipped
Suite rust / check-test-linux (pull_request) Has been skipped
Suite rust / check-typos (pull_request) Has been skipped
Suite go / check-test-windows (pull_request) Successful in 41s
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / dispatch (pull_request) Has been skipped
Suite web-app / check-test (.) (pull_request) Successful in 8s
Suite cmake / check-test-windows (pull_request) Successful in 46s
Suite dotnet / reused-checks (pull_request) Successful in 3s
0d116ca7a2
at-tmux (C), spirelens (C#) and the Node services can now write the
estate's standard line. Each implementation has the Go package's API in
its language's idiom (format, parse, a file logger with 1 MiB rotation
to .old and the %LOCALAPPDATA% default or override variable, a stream
logger, redact) and runs testdata/golden.json and testdata/redact.json.

- c/: C99, no dependencies; Windows API and POSIX. A CMake package
  (logline::logline) for a vcpkg port, built and tested from the root
  CMakeLists.txt; the test reads the JSON cases itself. Redact's shapes
  are hand-written matchers, since C has no regular expressions.
- dotnet/: RomaineLife.Logline (.NET 9, no packages) and xunit tests,
  in the root logline.sln.
- js/: an ES module with no dependencies; the root package.json is
  @romaine-life/logline, which the release publishes to Forgejo's npm
  registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
merge-queue deleted branch logline-c-dotnet-js 2026-11-26 12:18:41 -08:00
Sign in to join this conversation.
No reviewers
No labels
queue
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/logline!4
No description provided.