Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
],
"deny": []
}
}
}
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ LANGFUSE_HOST=http://localhost:3000
# LOG_LEVEL=info

# Environment: development, production (default: production)
# NODE_ENV=production
# NODE_ENV=production

# Offline fallback file path (default: ~/.claude/telemetry-fallback.jsonl)
# When Langfuse is unreachable, session references are saved here as JSONL
# FALLBACK_FILE=~/.claude/telemetry-fallback.jsonl
15 changes: 9 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
},
"rules": {
"comma-dangle": ["error", "always-multiline"],
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}]
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
]
}
}
}
24 changes: 24 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Pre-commit quality gate — fast local checks only; tests run in CI
set -e

REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$REPO_ROOT"

echo "==> lint"
npm run lint --silent

echo "==> format:check"
npm run format:check --silent

echo "==> secret scan (staged files)"
STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -v '^node_modules/' | grep -v '^\.git/' || true)
if [ -n "$STAGED" ]; then
if echo "$STAGED" | xargs git show HEAD: 2>/dev/null | \
grep -qE '(api[_-]?key|api[_-]?secret|auth[_-]?token|private[_-]?key|secret[_-]?key)\s*[:=]\s*[A-Za-z0-9+/]{20,}'; then
echo "ERROR: potential secret detected in staged files — commit blocked"
exit 1
fi
fi

echo "==> pre-commit passed"
19 changes: 11 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: '[BUG] '
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Start the telemetry bridge with '...'
2. Configure Claude with '...'
3. Run command '...'
Expand All @@ -25,20 +25,23 @@ What actually happened instead.

**Logs**
If applicable, add logs to help explain your problem.

```
# Paste relevant logs here
```

**Environment (please complete the following information):**
- OS: [e.g. macOS 14.0, Ubuntu 22.04]
- Node.js version: [e.g. 18.17.0]
- Docker version: [e.g. 24.0.7]
- Claude Code version: [run `claude --version`]
- Telemetry Bridge version: [e.g. 3.0.0]
- Langfuse version: [if self-hosted]

- OS: [e.g. macOS 14.0, Ubuntu 22.04]
- Node.js version: [e.g. 18.17.0]
- Docker version: [e.g. 24.0.7]
- Claude Code version: [run `claude --version`]
- Telemetry Bridge version: [e.g. 3.0.0]
- Langfuse version: [if self-hosted]

**Configuration**
Relevant environment variables (redact sensitive values):

```bash
OTEL_EXPORTER_OTLP_ENDPOINT=
LANGFUSE_HOST=
Expand All @@ -49,4 +52,4 @@ LANGFUSE_HOST=
Add any other context about the problem here.

**Possible solution**
If you have an idea how to fix the issue, please describe it.
If you have an idea how to fix the issue, please describe it.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand All @@ -21,6 +20,7 @@ Explain how this feature would be used and who would benefit from it.

**Example**
If applicable, provide an example of how this feature would work:

```javascript
// Example code or configuration
```
Expand All @@ -29,4 +29,4 @@ If applicable, provide an example of how this feature would work:
Add any other context, mockups, or screenshots about the feature request here.

**Are you willing to submit a PR?**
Let us know if you'd like to contribute this feature!
Let us know if you'd like to contribute this feature!
9 changes: 5 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Please describe the tests that you ran to verify your changes. Provide instructi
- [ ] Linting passes (`npm run lint`)

**Test Configuration**:
* Node.js version:
* OS:
* Claude Code version:
* Langfuse version (if applicable):

- Node.js version:
- OS:
- Claude Code version:
- Langfuse version (if applicable):

## Checklist:

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
49 changes: 49 additions & 0 deletions .quality/guardrails-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
schema_version: 1
task_id: 'guardrails-baseline'
requires_split_authorship: false
na_controls:
- control: 'parseable_handoff_artifact'
reason: 'Repo does not require split test/implementation authorship.'
- control: 'typescript_type_checking'
reason: 'Repo is JavaScript-only; no TypeScript layer.'
blockers: []
---

# Guardrails Report — claude-code-telemetry

Generated: 2026-04-03

## Policy vs Enforcement Matrix

| Control | Policy source | Enforcement | Status | Notes |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Code doc naming (AGENTS.md) | skill:claudecode-conventions | `AGENTS.md` created; `CLAUDE.md` replaced with `@AGENTS.md` | **enforced** | Was blocker before this PR |
| Pinned toolchain manifest | node-ts reference | `.nvmrc` (Node 22); `engines` in `package.json`; lockfile checked in | **partial** | `engines` uses range `>=18`, not exact pin. `.nvmrc` pins 22. No `packageManager` field yet. |
| Local hook wiring | node-ts reference | `.githooks/pre-commit`; `scripts/install-hooks.sh`; `npm run hooks:install` | **enforced** | Developer must run `npm run hooks:install` once after clone |
| Local quality gate | node-ts reference | `scripts/ci/run_quality_gates.sh`; `npm run quality` | **enforced** | Runs format:check + lint + unit tests offline |
| Local security review entrypoint | node-ts reference | `scripts/ci/run_security_review.sh`; `npm run security` | **partial** | `npm audit` requires live network; docker step skips gracefully if no docker; secret scan is local |
| Dependency vulnerability audit | `.github/workflows/security.yml` | CI: `npm audit --audit-level=high`; local: `npm run security` | **partial** | Network-dependent; no local advisory mirror |
| Secret scanning | `.github/workflows/security.yml` | CI: git grep regex; local: pre-commit hook + `npm run security` | **enforced** locally, **partial** in CI | CI scan excludes test/ and \*.json; local hook scans staged files |
| Docker / runtime checks | `Dockerfile`; `.github/workflows/ci.yml` | Non-root user, healthcheck, prod-only deps in Dockerfile; Trivy in CI; local docker build in security script | **partial** | Trivy is CI-only + network; local build smoke check added |
| GitNexus / code intelligence | skill:gitnexus reference | Not installed | **policy-only** | Bootstrap: `npx gitnexus analyze` from repo root. Required before editing shared modules (`sessionHandler.js`, `requestHandlers.js`). |
| TypeScript type checking | N/A | N/A | **N/A** | JavaScript-only repo |
| Parseable handoff artifact | N/A | N/A | **N/A** | No split authorship requirement |

## Manual Review Obligations

The following require human review and cannot be automated:

| Area | Location | Why manual |
| ---------------------------- | ------------------------ | ----------------------------------------------------------------------------- |
| API key auth middleware | `src/server.js` | Must verify request validation is correct for the threat model |
| Outbound HTTP to Langfuse | `src/sessionHandler.js` | Verify no sensitive data leaks beyond what is intentional |
| `FALLBACK_FILE` path | `src/offlineFallback.js` | Env var controls fs write path — verify no path traversal risk |
| `OTLP_RECEIVER_HOST` binding | `src/serverHelpers.js` | Defaults to 127.0.0.1 in dev, 0.0.0.0 in Docker — review for network exposure |

## Remaining Gaps (not blockers)

1. **GitNexus not installed** — run `npx gitnexus analyze` to bootstrap code-intelligence index. Required before making changes to widely-used modules.
2. **`engines` range is not exact** — `>=18.0.0` allows drift; `.nvmrc` mitigates for local dev but CI tests across 18/20/22.
3. **`npm audit` is network-dependent** — no local advisory mirror. Acceptable for this project size; mark as `partial`.
4. **`packageManager` field absent** — consider adding `"packageManager": "npm@10.x.x"` to lock the package manager version.
Loading