[codex] Convert client signals to monorepo#1
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Convert client-signals into a shared-contract monorepo, with spec/ fixtures defining cross-language behavior and new library implementations for Go, JavaScript, Python, and Elixir (with Go moved under go/ and a new import path).
Changes:
- Introduced
spec/JSON fixtures for markers, sanitization, parent classification, and header/User-Agent behavior, and updated docs to describe the shared contract. - Added new JavaScript, Python, and Elixir library implementations plus fixture-driven test suites to keep behavior aligned.
- Moved the Go module into
go/, updated its module path, and updated CI to run per-language test jobs in the monorepo layout.
Reviewed changes
Copilot reviewed 34 out of 53 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/sanitize-fixtures.json | Adds shared sanitization fixtures for self-declared agent values. |
| spec/README.md | Documents the purpose and intended usage of shared spec fixtures. |
| spec/parent-fixtures.json | Adds shared fixtures for parent process name bucketing. |
| spec/markers.json | Defines the shared known agent-marker table used across languages. |
| spec/header-fixtures.json | Adds shared fixtures for emitted headers and UA suffix behavior. |
| README.md | Updates root documentation for monorepo layout and shared contract. |
| python/test_client_signals.py | Adds Python unittest coverage, including fixture alignment checks. |
| python/README.md | Documents Python package usage and API surface. |
| python/pyproject.toml | Adds Python package metadata for the monorepo layout. |
| python/client_signals/core.py | Implements Python detection + header/UA helpers per shared contract. |
| python/client_signals/init.py | Exposes the Python public API surface. |
| python/AGENTS.md | Adds Python package agent/dev constraints and commands. |
| javascript/test/index.test.js | Adds Node test coverage, including shared fixture checks. |
| javascript/src/index.js | Implements JavaScript detection + header/UA helpers per shared contract. |
| javascript/README.md | Documents JavaScript package usage and API surface. |
| javascript/package.json | Adds JavaScript package metadata and test script. |
| javascript/AGENTS.md | Adds JavaScript package agent/dev constraints and commands. |
| go/transport.go | Adds Go header helpers and RoundTripper wrapper for attaching signals. |
| go/transport_test.go | Adds Go tests for transport/header/UA behavior. |
| go/spec_contract_test.go | Adds Go fixture-driven contract tests against spec/. |
| go/signals.go | Adds Go Signals, Detect, and DetectOnce implementation under go/. |
| go/signals_test.go | Adds Go tests for signal composition and caching behavior. |
| go/README.md | Documents Go module import path change and updated API usage. |
| go/parent.go | Adds Go parent process classification helpers. |
| go/parent_windows.go | Adds Windows parent process lookup via Toolhelp32 snapshot. |
| go/parent_test.go | Adds Go tests for parent classification and smoke-test lookup. |
| go/parent_other.go | Adds fallback parent lookup behavior for unsupported platforms. |
| go/parent_linux.go | Adds Linux parent process lookup via /proc/<ppid>/comm. |
| go/parent_darwin.go | Adds macOS parent process lookup via sysctl. |
| go/markers.go | Adds Go mirror of the shared known marker table. |
| go/interactive.go | Adds Go stdout “interactive” detection helper. |
| go/interactive_test.go | Adds Go test for interactive detection behavior. |
| go/go.sum | Adds Go dependency sums (x/sys). |
| go/go.mod | Moves Go module path under go/. |
| go/cmd/main.go | Updates CLI to import the new Go module path. |
| go/ci.go | Adds Go CI detection helper. |
| go/ci_test.go | Adds Go tests for CI detection semantics. |
| go/AGENTS.md | Adds Go package agent/dev constraints and commands. |
| go/agent.go | Adds Go agent detection + invoked-by sanitization. |
| go/agent_test.go | Adds Go tests for agent detection precedence and sanitization. |
| go/.golangci.yml | Updates Go lint config for the new module path. |
| elixir/test/test_helper.exs | Adds ExUnit bootstrap for Elixir tests. |
| elixir/test/client_signals_test.exs | Adds Elixir tests, including shared fixture checks. |
| elixir/README.md | Documents Elixir package usage and API surface. |
| elixir/mix.exs | Adds Elixir project/package metadata. |
| elixir/lib/client_signals.ex | Implements Elixir detection + header/UA helpers per shared contract. |
| elixir/AGENTS.md | Adds Elixir package agent/dev constraints and commands. |
| elixir/.formatter.exs | Adds Elixir formatter configuration. |
| docs/signals.md | Updates shared signal rationale docs for multi-language context. |
| docs/markers.md | Updates marker rationale docs to reference shared spec/ source of truth. |
| AGENTS.md | Updates repository-wide agent guidance for monorepo structure. |
| .gitignore | Ignores language-specific build/test artifacts (node/python/elixir). |
| .github/workflows/checks.yml | Updates CI workflow for monorepo layout and per-language test jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+206
to
+223
| defp parent_bucket do | ||
| self() | ||
| |> Process.info(:dictionary) | ||
| |> elem(1) | ||
| |> Keyword.get(:"$ancestors", []) | ||
| |> List.first() | ||
| |> parent_name() | ||
| |> classify_parent_name() | ||
| end | ||
|
|
||
| defp parent_name(_) do | ||
| ppid = :os.getpid() |> to_string() |> parent_pid() | ||
|
|
||
| case File.read("/proc/#{ppid}/comm") do | ||
| {:ok, name} -> String.trim(name) | ||
| {:error, _} -> "" | ||
| end | ||
| end |
Comment on lines
+225
to
+235
| defp parent_pid(pid) do | ||
| case File.read("/proc/#{pid}/stat") do | ||
| {:ok, stat} -> | ||
| stat | ||
| |> String.split() | ||
| |> Enum.at(3, "") | ||
|
|
||
| {:error, _} -> | ||
| "" | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert
client-signalsfrom a Go-only repository into a shared-contract monorepo with language packages for Go, JavaScript, Python, and Elixir.What changed
go/and updated its module path togithub.com/superfly/client-signals/go.spec/for markers, sanitization, parent classification, headers, and User-Agent suffixes.README.mdandAGENTS.mdfiles, keeping root docs language-neutral.Impact
This intentionally changes the Go import path. Existing Go consumers must update from
github.com/superfly/client-signalstogithub.com/superfly/client-signals/go.Package publishing for npm, PyPI, and Hex is documented but not automated in this PR.
Validation
(cd go && go test ./...)(cd javascript && npm test)(cd python && python3 -m unittest)(cd elixir && mix test)(cd go && GOOS=linux GOARCH=amd64 go build ./...)(cd go && GOOS=darwin GOARCH=arm64 go build ./...)(cd go && GOOS=windows GOARCH=amd64 go build ./...)