Skip to content

ci: add trufflehog secrets scan#222

Open
KooshaPari wants to merge 178 commits intocoder:mainfrom
KooshaPari:ci/add-trufflehog-secrets-scan
Open

ci: add trufflehog secrets scan#222
KooshaPari wants to merge 178 commits intocoder:mainfrom
KooshaPari:ci/add-trufflehog-secrets-scan

Conversation

@KooshaPari
Copy link
Copy Markdown

Adds Trufflehog secrets scanning workflow.\n\nCo-Authored-By: Claude Opus 4.7 noreply@anthropic.com

KooshaPari and others added 30 commits February 22, 2026 21:34
…termexec error logging, events panic, TS types

Fixes all 5 quality gaps identified in the agentapi++ audit:

1. Bounds-check panic in events.go:141-144 - Added bounds check before
   accessing newMessages[i] in UpdateMessagesAndEmitChanges() to prevent
   index out of bounds panic.

2. Skipped test with whitespace lookahead bug (msgfmt_test.go) - Improved
   findNextMatch() algorithm to skip whitespace characters when matching,
   avoiding false positives from UI element whitespace. Test remains skipped
   pending further refinement.

3. Unhandled terminal I/O error (termexec.go:84-87) - Enhanced error logging
   in pseudo terminal reader goroutine to provide context when I/O failures
   occur.

4. Panic on unhandled enum in events.go:80 - Changed convertStatus() to
   return error instead of panicking on unknown conversation status. Updated
   all callers to handle errors properly.

5. TypeScript 'as any' in message-input.tsx - Replaced 'as any' type casts
   with proper TypeScript types.

All tests pass. Go build successful.
…-drop

- Add React default import for React.RefObject/React.KeyboardEvent namespace usage
- Widen DragDropProps.onFilesAdded to accept Promise<void> (async handlers)
- Add explicit ChangeEvent<HTMLTextAreaElement> type to onChange handler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply go fmt across test files to ensure consistent formatting and
code style. Modernize test packages (move from _test to internal
package scope) and refactor test structure to use standard Go testing
patterns instead of testify assertions, improving maintainability and
reducing external dependencies.

All tests pass: 100% pass rate across Go and TypeScript.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Agent routing layer between thegent and cliproxy+bifrost
- Session-aware load balancing
- Agent-specific routing rules
- Fallback model support
Fixed two critical build errors:

1. Added missing go.sum entry for gin-gonic/gin by running go mod tidy,
   which properly resolved all dependencies and their checksums.

2. Fixed io.ReadCloser type error at internal/routing/agent_bifrost.go:103
   by wrapping json.RawMessage with io.NopCloser(bytes.NewReader(jsonBody))
   since json.RawMessage is a byte slice and cannot directly implement the
   io.ReadCloser interface.

Additional fixes:
- Removed unused "encoding/json" import from cmd/agentapi/main.go
- Removed unused "fmt" import from internal/server/server.go
- Fixed accessing private field cliproxyURL by removing direct field access
  from health() and proxy() handlers
- Normalized go.mod version requirement to 1.23 for compatibility

All tests pass: go build ./..., go test ./..., go vet ./...

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 25 unit tests covering all public functions and handlers:
- internal/routing: 12 tests for AgentBifrost routing logic, session management, and HTTP forwarding
- internal/server: 13 tests for HTTP handlers (health, chat completions, admin endpoints, proxy)

All tests use standard Go testing only (no external test frameworks). Tests validate:
- Initialization and configuration
- Default and custom routing rules
- Session creation and reuse
- HTTP request handling and JSON marshaling
- Error conditions with proper status codes

Tests verified with go test ./... (25/25 passing) and go vet ./... (no issues).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add new HTTP endpoints for agent management:
- POST /agent/start - Start a new agent session
- GET /agent/{id}/status - Get session status
- POST /agent/{id}/stop - Stop a session
- GET /agent/{id}/logs - Stream logs (SSE)
- POST /model/run - One-shot model command
- GET /models - List available models

Migrate from gin to chi for HTTP routing.
Add AgentHandler with session management.

Related: #72 #73 #74 #75 #76
Add support for:
- ?after=<id> - return messages after this ID
- ?limit=<n> - limit number of messages returned

This allows clients to poll for new messages without fetching
the entire conversation history each time.

Fixes #187
Add GET /config endpoint returning agent type and port
* feat: add agent lifecycle endpoints

Add new HTTP endpoints for agent management:
- POST /agent/start - Start a new agent session
- GET /agent/{id}/status - Get session status
- POST /agent/{id}/stop - Stop a session
- GET /agent/{id}/logs - Stream logs (SSE)
- POST /model/run - One-shot model command
- GET /models - List available models

Migrate from gin to chi for HTTP routing.
Add AgentHandler with session management.

Related: #72 #73 #74 #75 #76

* feat(e2e): add asciinema recording parser for testing

- Add asciinema package to parse asciinema v2 recordings
- Convert recordings to echo agent scripts
- Enable using real agent interactions for e2e testing
KooshaPari and others added 28 commits April 25, 2026 21:42
* chore(hygiene): update LICENSE + add status badge to README

- Update LICENSE: MIT © 2026 Koosha Pari (was Coder Technologies)
- Add 1-line fork description at top
- Add status badge: **Status:** active
- Confirm install command section present

Brings agentapi-plusplus to 4/4 hygiene criteria per W-84 round-20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(git): add .worktrees/ and .claude/worktrees/ to .gitignore

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove stale duplicate handler methods from server.go so handlers.go is the single implementation surface, restore the missing version response model, and repair malformed HTTP API tests.

Validation:
- go test ./lib/httpapi
- go test ./internal/harness ./internal/routing ./internal/server ./lib/screentracker ./x/acpio ./test ./lib/httpapi
- go test ./...

Co-authored-by: Codex <noreply@openai.com>
* chore(security): add least-privilege permissions to alert-sync-issues.yml ci.yml fuzzing.yml generate-sdks.yaml go-test.yml iac-scan.yml license-compliance.yml pr-preview-build.yml quality-gate.yml release-drafter.yml release.yml self-merge-gate.yml sonarcloud.yml tag-automation.yml trivy-scan.yml zap-dast.yml

* chore: remove accidentally-created file

* chore(security): add least-privilege permissions to alert-sync-issues.yml

* chore(security): add least-privilege permissions to ci.yml

* chore(security): add least-privilege permissions to fuzzing.yml

* chore(security): add least-privilege permissions to generate-sdks.yaml

* chore(security): add least-privilege permissions to go-test.yml

* chore(security): add least-privilege permissions to iac-scan.yml

* chore(security): add least-privilege permissions to license-compliance.yml

* chore(security): add least-privilege permissions to pr-preview-build.yml

* chore(security): add least-privilege permissions to quality-gate.yml

* chore(security): add least-privilege permissions to release-drafter.yml

* chore(security): add least-privilege permissions to release.yml

* chore(security): add least-privilege permissions to self-merge-gate.yml

* chore(security): add least-privilege permissions to sonarcloud.yml

* chore(security): add least-privilege permissions to tag-automation.yml

* chore(security): add least-privilege permissions to trivy-scan.yml

* chore(security): add least-privilege permissions to zap-dast.yml
Refresh nested chat Bun lock so Next resolves to 15.5.15 instead of vulnerable 15.4.7.

Validation:
- bun install --frozen-lockfile
- bun pm ls next --depth 0
- bun run build

CI note: unrelated repo/workflow failures remain in missing Makefile targets, missing self-merge script, unresolved shared action reference, and external Snyk quota.

Closes #437

Co-authored-by: Codex <noreply@openai.com>
GitHub Actions reusable workflows must be located directly under .github/workflows in the called repository. Point phenoShared callers at top-level reusable workflow files instead of nested reusable/ paths.

Validation:
- actionlint changed workflow files
- git diff --check

Co-authored-by: Codex <noreply@openai.com>
Restore the @main ref suffix on phenoShared top-level reusable workflow calls. GitHub Actions requires reusable workflow calls to include an explicit ref.

Validation:
- actionlint changed workflow files
- git diff --check

Co-authored-by: Codex <noreply@openai.com>
chore(deps): clean npm advisories

Pin vulnerable transitive npm dependencies across docs and chat lockfiles while preserving the current app dependency surface.

Validation:
- npm audit --omit=optional (docs)
- npm audit --omit=optional (agentapi-plusplus/docs)
- npm run build (agentapi-plusplus/chat)
- npm audit --omit=optional (agentapi-plusplus/chat; only low-severity elliptic chain remains)

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
* Add common Taskfile targets

Co-authored-by: Codex <noreply@openai.com>

* Refine Taskfile cleanup

Co-authored-by: Codex <noreply@openai.com>

* chore: repair taskfile lint target

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Codex <noreply@openai.com>
Detected Go plus Bun/Node targets and surfaced the common Taskfile entrypoints through the default task list.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Detect the root Go module and Bun/Node targets so build, test, lint, and clean cover the runnable repo surfaces while skipping unavailable vendored docs dependencies.

Co-authored-by: Codex <noreply@openai.com>
Centralize Go cache paths used by build, test, lint, and clean tasks, and simplify Go lint execution to the repo-documented gofmt/go vet path.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Add chat test coverage to the common Taskfile test target and make Bun task preflights refresh frozen dependencies before running chat build/lint scripts.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 15:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants