Skip to content

chore: add EUPL-1.2 LICENCE file (UK English canonical)#4

Open
Snider wants to merge 8 commits into
mainfrom
dev
Open

chore: add EUPL-1.2 LICENCE file (UK English canonical)#4
Snider wants to merge 8 commits into
mainfrom
dev

Conversation

@Snider

@Snider Snider commented May 1, 2026

Copy link
Copy Markdown
Contributor

Reference: core/api/LICENCE.

Summary by CodeRabbit

  • New Features
    • Added an optional gRPC-based sidecar bridge for Go↔Deno communication.
    • Introduced gRPC handlers for rendering components to HTML and evaluating expressions.
    • Added a formal sidecar gRPC contract for file, KV, lifecycle, rendering, and evaluation.
  • Documentation
    • Added the EUPL v1.2 licence text and a brief root README.
  • Bug Fixes
    • Improved shutdown cleanup by safely handling ignored close errors.
  • Chores
    • Updated Go dependency submodule revisions and refined repository ignore rules.
  • Tests
    • Expanded example/unit tests across Go and Deno sidecar/client/server functionality.

Reference: core/api/LICENCE.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds repository metadata and dependency pointer updates, expands Go symbol coverage with example and nil-check tests, and introduces a proto-defined gRPC sidecar bridge with Deno client/server implementations, runtime wiring, and tests.

Changes

Repository metadata

Layer / File(s) Summary
Metadata and dependency pointers
README.md, .core/go.yaml, .gitignore, external/go*
Adds a root README, a Go subtree marker, narrowed .core/ ignore rules, and updated Git submodule pointers.

Go API coverage

Layer / File(s) Summary
Close handling
go/listener.go, go/service.go
Updates deferred and teardown close calls to use explicit nil-checked error handling.
Examples and symbol tests
go/*_example_test.go, go/*_test.go
Adds example functions and nil-check-style tests for listener, permissions, locale, lifecycle, service, server, sidecar, and Deno client symbols.

Runtime gRPC sidecar bridge

Layer / File(s) Summary
Proto contract
proto/core_sidecar.proto
Defines GoService and DenoService RPCs and their request/response messages.
GoService client
runtime/sidecar_client.ts
Loads the proto package and exposes typed helpers for file, store, exec, and scheme RPCs.
DenoService handlers
runtime/sidecar_handlers.ts
Adds shared state plus lifecycle, config, render, and eval handler implementations.
DenoService server
runtime/sidecar_server.ts
Registers unary gRPC methods and adapts handler results and errors into responses.
Runtime bootstrap
runtime/main.ts
Starts the gRPC bridge when both sockets are present and closes the gRPC resources on shutdown.
GoService client tests
runtime/sidecar_client_test.ts
Tests RPC proxying, error propagation, and raw client exposure for the GoService client.
DenoService handler tests
runtime/sidecar_handlers_test.ts
Tests lifecycle updates, config mutation, expression evaluation, and component rendering.
DenoService server tests
runtime/sidecar_server_test.ts
Tests gRPC request handling, error paths, and server close behaviour through a proto-built client.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the licence-file addition, which is a real part of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: cannot load module external/go listed in go.work file: open external/go/go.mod: no such file or directory\ngo: cannot load module external/go-io/go listed in go.work file: open external/go-io/go/go.mod: no such file or directory\ngo: cannot load module external/go-log/go listed in go.work file: open external/go-log/go/go.mod: no such file or directory\ngo: cannot load module external/go-scm/go listed in go.work file: open external/go-scm/go/go.mod: no such file or directory\n"

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
LICENCE (1)

1-288: ⚠️ Potential issue | 🔴 Critical

Replace the LICENCE file with the authoritative EUPL v1.2 version to ensure legal compliance.

The repository's LICENCE file contains the correct content but diverges from the official European Commission version in formatting and line-breaking. This is problematic for a legal licence file, as automated compliance tools and parsers expect the exact official text, and formatting changes could affect legal interpretation.

Specifically:

  • Section numbers use "1. " (with space) instead of "1." (without space)
  • Line breaks differ throughout, particularly in the Appendix
  • These differences, whilst cosmetic, cause the file to diverge from the authoritative source

Download the official EUPL v1.2 English text directly from the Interoperable Europe Portal and replace the current LICENCE file with it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@LICENCE` around lines 1 - 288, The LICENCE file diverges from the
authoritative EUPL v1.2 text; replace its contents with the exact official
English EUPL v1.2 text (matching punctuation, section numbering like "1."
without extra space, line breaks, and Appendix formatting) downloaded from the
European Commission/Interoperable Europe portal (the provided URL) so the
repository LICENCE file exactly matches the official version for automated
compliance and legal correctness.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@LICENCE`:
- Around line 1-288: The LICENCE file diverges from the authoritative EUPL v1.2
text; replace its contents with the exact official English EUPL v1.2 text
(matching punctuation, section numbering like "1." without extra space, line
breaks, and Appendix formatting) downloaded from the European
Commission/Interoperable Europe portal (the provided URL) so the repository
LICENCE file exactly matches the official version for automated compliance and
legal correctness.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e31965a-15da-446b-a4f5-28edce22fe99

📥 Commits

Reviewing files that changed from the base of the PR and between f58d311 and 898ae4b.

📒 Files selected for processing (1)
  • LICENCE

Snider and others added 3 commits May 1, 2026 09:42
…block)

- git submodule update on external/* to current dev tips
- go.work paths fixed for Phase 1 /go/ subtree layout where stale
- go.work go-version bumped 1.26.0 → 1.26.2 to match submodule floor

Workspace-mode build (`go build ./...`) is the verification path. Some
repos may surface transitive dep issues (api/go.sum checksum drift, etc.)
which are separate cascade tickets — not blocking this metadata refresh.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
…untime subdirs

The .core/ root holds tracked Lethean canon config (go.yaml, build.yaml,
agents.yaml, etc.). Only the runtime subdirs (workspace/, vm/, cache/,
runtime/) and per-repo runtime artifacts should be gitignored.

Brings this repo into the managed canonical set per audit-sweep
discovery filter.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
Mass pad-test triplet + Example wrapper generation via the canonical
subject-reference + marker pattern, plus docs skeleton stubs.

Co-Authored-By: Cladius <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go/coredeno_test.go`:
- Around line 137-234: The test functions (e.g.,
TestCoredeno_Permissions_Flags_Good, TestCoredeno_Permissions_Flags_Bad,
TestCoredeno_Permissions_Flags_Ugly, TestCoredeno_DefaultSocketPath_Good,
TestCoredeno_DefaultSocketPath_Bad, TestCoredeno_DefaultSocketPath_Ugly,
TestCoredeno_NewSidecar_Good, TestCoredeno_NewSidecar_Bad,
TestCoredeno_NewSidecar_Ugly) currently take a parameter of type *core.T; update
each function signature to accept *testing.T instead so they conform to the
standard Go testing type used across the codebase (the testing package is
already imported). Ensure you change the parameter type only and keep the
function names and bodies unchanged.

In `@go/denoclient_test.go`:
- Around line 514-743: The new tests (e.g., TestDenoclient_DialDeno_Good,
TestDenoclient_DenoClient_Close_Good, TestDenoclient_DenoClient_Ping_Good, etc.)
use the type *core.T but the package import for dappco.re/go/core is missing;
add an import for "dappco.re/go/core" to the file's import block so the *core.T
type is defined and the tests compile.

In `@go/lifecycle_test.go`:
- Around line 252-382: The 12 test functions (TestLifecycle_Sidecar_Start_Good,
TestLifecycle_Sidecar_Start_Bad, TestLifecycle_Sidecar_Start_Ugly,
TestLifecycle_Sidecar_Stop_Good, TestLifecycle_Sidecar_Stop_Bad,
TestLifecycle_Sidecar_Stop_Ugly, TestLifecycle_Sidecar_IsRunning_Good,
TestLifecycle_Sidecar_IsRunning_Bad, TestLifecycle_Sidecar_IsRunning_Ugly,
TestLifecycle_Sidecar_ExitError_Good, TestLifecycle_Sidecar_ExitError_Bad,
TestLifecycle_Sidecar_ExitError_Ugly) incorrectly use the undefined type
*core.T; update each function signature to use *testing.T instead (e.g., change
func TestLifecycle_Sidecar_Start_Good(t *core.T) to func
TestLifecycle_Sidecar_Start_Good(t *testing.T)), keeping the bodies unchanged
and relying on the existing "testing" import.

In `@go/locale_test.go`:
- Around line 120-151: The tests reference core.T but the package isn't
imported; update the test file's import block to include the core package
(import "dappco.re/go/core") so the symbol *core.T resolves, ensuring functions
like TestLocale_Server_LocaleGet_Good, TestLocale_Server_LocaleGet_Bad, and
TestLocale_Server_LocaleGet_Ugly compile; add the import to the existing imports
(or create an import block if missing) and run `go test` to confirm success.

In `@go/permissions_test.go`:
- Around line 62-159: The tests currently declare their receiver parameter type
as *core.T which is undefined; change all test function parameters (e.g.,
TestPermissions_CheckPath_Good, TestPermissions_CheckPath_Bad,
TestPermissions_CheckPath_Ugly, TestPermissions_CheckNet_Good,
TestPermissions_CheckNet_Bad, TestPermissions_CheckNet_Ugly,
TestPermissions_CheckRun_Good, TestPermissions_CheckRun_Bad,
TestPermissions_CheckRun_Ugly) from *core.T to *testing.T and ensure the testing
package is imported at the top of the file so the file compiles.

In `@go/server_test.go`:
- Around line 638-1065: Change the receiver parameter type for all test
functions currently declared with *core.T to *testing.T; e.g., update signatures
for TestServer_NewServer_Good/Bad/Ugly, the
TestServer_Server_RegisterModule_*/UnregisterModule_*/Ping_*/FileRead_*/FileWrite_*/FileList_*/FileDelete_*/StoreGet_*/StoreSet_*/SetProcessRunner_*/ProcessStart_*/ProcessStop_*
functions so each takes (*testing.T) instead of (*core.T), ensuring the import
remains testing and removing references to core in those signatures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 62710321-29bc-4548-847b-2885289a12ef

📥 Commits

Reviewing files that changed from the base of the PR and between 9308ec5 and c8a3061.

📒 Files selected for processing (17)
  • README.md
  • go/coredeno_example_test.go
  • go/coredeno_test.go
  • go/denoclient_example_test.go
  • go/denoclient_test.go
  • go/lifecycle_example_test.go
  • go/lifecycle_test.go
  • go/listener_example_test.go
  • go/listener_test.go
  • go/locale_example_test.go
  • go/locale_test.go
  • go/permissions_example_test.go
  • go/permissions_test.go
  • go/server_example_test.go
  • go/server_test.go
  • go/service_example_test.go
  • go/service_test.go
✅ Files skipped from review due to trivial changes (4)
  • README.md
  • go/listener_example_test.go
  • go/service_example_test.go
  • go/denoclient_example_test.go

Comment thread go/coredeno_test.go
Comment on lines +137 to +234
func TestCoredeno_Permissions_Flags_Good(t *core.T) {
subject := (*Permissions).Flags
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_Permissions_Flags_Bad(t *core.T) {
subject := (*Permissions).Flags
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_Permissions_Flags_Ugly(t *core.T) {
subject := (*Permissions).Flags
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_DefaultSocketPath_Good(t *core.T) {
subject := DefaultSocketPath
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_DefaultSocketPath_Bad(t *core.T) {
subject := DefaultSocketPath
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_DefaultSocketPath_Ugly(t *core.T) {
subject := DefaultSocketPath
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_NewSidecar_Good(t *core.T) {
subject := NewSidecar
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_NewSidecar_Bad(t *core.T) {
subject := NewSidecar
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestCoredeno_NewSidecar_Ugly(t *core.T) {
subject := NewSidecar
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify *core.T usage and missing core import.
rg -nP 'func\s+Test\w+\(t\s+\*core\.T\)' go/coredeno_test.go
rg -nP '^\s*core\s+"dappco\.re/go/core"' go/coredeno_test.go

Repository: dAppCore/ts

Length of output: 553


🏁 Script executed:

head -30 go/coredeno_test.go

Repository: dAppCore/ts

Length of output: 718


🏁 Script executed:

rg -n 'import\s*\(' go/coredeno_test.go -A 10

Repository: dAppCore/ts

Length of output: 257


🏁 Script executed:

rg -l '\*core\.T' --type go | head -5 | xargs -I {} sh -c 'echo "=== {} ===" && head -15 {}'

Repository: dAppCore/ts

Length of output: 1446


🏁 Script executed:

grep -r "type T " --include="*.go" | grep -i "testing\|core"

Repository: dAppCore/ts

Length of output: 37


🏁 Script executed:

rg 'type T\s' go/ --type go -B 2 -A 2

Repository: dAppCore/ts

Length of output: 37


🏁 Script executed:

rg '\*core\.T' go/coredeno_test.go -B 2 -A 8 | head -60

Repository: dAppCore/ts

Length of output: 1103


Fix test function signatures to use the standard *testing.T type.

Lines 137–225 incorrectly use *core.T as the parameter type for test functions. The standard Go testing type is *testing.T (from the testing package, which is already imported). This pattern must also align with all other test files in the codebase.

Change all test function signatures from:

func TestCoredeno_Permissions_Flags_Good(t *core.T) {

to:

func TestCoredeno_Permissions_Flags_Good(t *testing.T) {

Apply this correction to all nine test functions at lines 137, 148, 159, 170, 181, 192, 203, 214, and 225.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/coredeno_test.go` around lines 137 - 234, The test functions (e.g.,
TestCoredeno_Permissions_Flags_Good, TestCoredeno_Permissions_Flags_Bad,
TestCoredeno_Permissions_Flags_Ugly, TestCoredeno_DefaultSocketPath_Good,
TestCoredeno_DefaultSocketPath_Bad, TestCoredeno_DefaultSocketPath_Ugly,
TestCoredeno_NewSidecar_Good, TestCoredeno_NewSidecar_Bad,
TestCoredeno_NewSidecar_Ugly) currently take a parameter of type *core.T; update
each function signature to accept *testing.T instead so they conform to the
standard Go testing type used across the codebase (the testing package is
already imported). Ensure you change the parameter type only and keep the
function names and bodies unchanged.

Comment thread go/denoclient_test.go
Comment on lines +514 to +743
func TestDenoclient_DialDeno_Good(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DialDeno_Bad(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DialDeno_Ugly(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Close_Good(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Close_Bad(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Close_Ugly(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Ping_Good(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Ping_Bad(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_Ping_Ugly(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_LoadModule_Good(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_LoadModule_Bad(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_LoadModule_Ugly(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_UnloadModule_Good(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_UnloadModule_Bad(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_UnloadModule_Ugly(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ModuleStatus_Good(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ModuleStatus_Bad(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ModuleStatus_Ugly(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ReloadModules_Good(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ReloadModules_Bad(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestDenoclient_DenoClient_ReloadModules_Ugly(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify *core.T usage with missing core import in this file.
rg -nP 'func\s+Test\w+\(t\s+\*core\.T\)' go/denoclient_test.go
rg -nP '^\s*core\s+"dappco\.re/go/core"' go/denoclient_test.go

Repository: dAppCore/ts

Length of output: 1341


🏁 Script executed:

#!/bin/bash
# Check the full import block in denoclient_test.go
head -20 go/denoclient_test.go

Repository: dAppCore/ts

Length of output: 405


Import core to resolve undefined type in new test functions.

The newly added test functions (lines 514–734) use *core.T as the parameter type, but the file lacks the required import for dappco.re/go/core. This prevents compilation.

Add the import:

🔧 Proposed fix
 import (
 	"bufio"
 	"encoding/json"
 	"net"
 	"path/filepath"
+	core "dappco.re/go/core"
 	"testing"
 	"time"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func TestDenoclient_DialDeno_Good(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DialDeno_Bad(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DialDeno_Ugly(t *core.T) {
subject := DialDeno
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Close_Good(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Close_Bad(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Close_Ugly(t *core.T) {
subject := (*DenoClient).Close
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Ping_Good(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Ping_Bad(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_Ping_Ugly(t *core.T) {
subject := (*DenoClient).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_LoadModule_Good(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_LoadModule_Bad(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_LoadModule_Ugly(t *core.T) {
subject := (*DenoClient).LoadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_UnloadModule_Good(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_UnloadModule_Bad(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_UnloadModule_Ugly(t *core.T) {
subject := (*DenoClient).UnloadModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ModuleStatus_Good(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ModuleStatus_Bad(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ModuleStatus_Ugly(t *core.T) {
subject := (*DenoClient).ModuleStatus
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ReloadModules_Good(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ReloadModules_Bad(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestDenoclient_DenoClient_ReloadModules_Ugly(t *core.T) {
subject := (*DenoClient).ReloadModules
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
import (
"bufio"
"encoding/json"
"net"
"path/filepath"
core "dappco.re/go/core"
"testing"
"time"
)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/denoclient_test.go` around lines 514 - 743, The new tests (e.g.,
TestDenoclient_DialDeno_Good, TestDenoclient_DenoClient_Close_Good,
TestDenoclient_DenoClient_Ping_Good, etc.) use the type *core.T but the package
import for dappco.re/go/core is missing; add an import for "dappco.re/go/core"
to the file's import block so the *core.T type is defined and the tests compile.

Comment thread go/lifecycle_test.go
Comment on lines +252 to +382
func TestLifecycle_Sidecar_Start_Good(t *core.T) {
subject := (*Sidecar).Start
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_Start_Bad(t *core.T) {
subject := (*Sidecar).Start
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_Start_Ugly(t *core.T) {
subject := (*Sidecar).Start
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_Stop_Good(t *core.T) {
subject := (*Sidecar).Stop
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_Stop_Bad(t *core.T) {
subject := (*Sidecar).Stop
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_Stop_Ugly(t *core.T) {
subject := (*Sidecar).Stop
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_IsRunning_Good(t *core.T) {
subject := (*Sidecar).IsRunning
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_IsRunning_Bad(t *core.T) {
subject := (*Sidecar).IsRunning
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_IsRunning_Ugly(t *core.T) {
subject := (*Sidecar).IsRunning
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_ExitError_Good(t *core.T) {
subject := (*Sidecar).ExitError
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_ExitError_Bad(t *core.T) {
subject := (*Sidecar).ExitError
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestLifecycle_Sidecar_ExitError_Ugly(t *core.T) {
subject := (*Sidecar).ExitError
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Locate all *core.T usages in go/lifecycle_test.go"
rg -nP --type=go '\*core\.T\)' go/lifecycle_test.go

echo
echo "2) Confirm imports in file header"
sed -n '1,25p' go/lifecycle_test.go

Repository: dAppCore/ts

Length of output: 1307


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Search for any definition of type T in a core package"
rg -n 'type T (struct|interface)' --type=go | head -20

echo
echo "2) Search for imports of 'core' package in test files"
rg -n 'import.*core' --type=go

echo
echo "3) Check if core.T is used elsewhere in the codebase"
rg -n '\*core\.T\)' --type=go | wc -l

echo
echo "4) Count total occurrences of *core.T"
rg -c '\*core\.T' --type=go || echo "0"

Repository: dAppCore/ts

Length of output: 112


All 12 new lifecycle tests use undefined type *core.T instead of *testing.T.

Lines 252–382 contain test functions using *core.T as the test parameter type, but core is not imported in this file. The file imports "testing" from the standard library, and existing tests in this file correctly use *testing.T. Replace *core.T with *testing.T in all 12 function signatures: TestLifecycle_Sidecar_Start_Good, TestLifecycle_Sidecar_Start_Bad, TestLifecycle_Sidecar_Start_Ugly, TestLifecycle_Sidecar_Stop_Good, TestLifecycle_Sidecar_Stop_Bad, TestLifecycle_Sidecar_Stop_Ugly, TestLifecycle_Sidecar_IsRunning_Good, TestLifecycle_Sidecar_IsRunning_Bad, TestLifecycle_Sidecar_IsRunning_Ugly, TestLifecycle_Sidecar_ExitError_Good, TestLifecycle_Sidecar_ExitError_Bad, and TestLifecycle_Sidecar_ExitError_Ugly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/lifecycle_test.go` around lines 252 - 382, The 12 test functions
(TestLifecycle_Sidecar_Start_Good, TestLifecycle_Sidecar_Start_Bad,
TestLifecycle_Sidecar_Start_Ugly, TestLifecycle_Sidecar_Stop_Good,
TestLifecycle_Sidecar_Stop_Bad, TestLifecycle_Sidecar_Stop_Ugly,
TestLifecycle_Sidecar_IsRunning_Good, TestLifecycle_Sidecar_IsRunning_Bad,
TestLifecycle_Sidecar_IsRunning_Ugly, TestLifecycle_Sidecar_ExitError_Good,
TestLifecycle_Sidecar_ExitError_Bad, TestLifecycle_Sidecar_ExitError_Ugly)
incorrectly use the undefined type *core.T; update each function signature to
use *testing.T instead (e.g., change func TestLifecycle_Sidecar_Start_Good(t
*core.T) to func TestLifecycle_Sidecar_Start_Good(t *testing.T)), keeping the
bodies unchanged and relying on the existing "testing" import.

Comment thread go/locale_test.go
Comment on lines +120 to +151
func TestLocale_Server_LocaleGet_Good(t *core.T) {
subject := (*Server).LocaleGet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestLocale_Server_LocaleGet_Bad(t *core.T) {
subject := (*Server).LocaleGet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestLocale_Server_LocaleGet_Ugly(t *core.T) {
subject := (*Server).LocaleGet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify this file uses *core.T but does not import core.
rg -nP 'func\s+Test\w+\(t\s+\*core\.T\)' go/locale_test.go
rg -nP '^\s*core\s+"dappco\.re/go/core"' go/locale_test.go

Repository: dAppCore/ts

Length of output: 219


🏁 Script executed:

head -20 go/locale_test.go

Repository: dAppCore/ts

Length of output: 347


core is referenced without an import.

Lines 120, 131, and 142 use *core.T, but go/locale_test.go never imports dappco.re/go/core; these tests will not compile.

🔧 Proposed fix
 import (
 	"context"
 	"errors"
+	core "dappco.re/go/core"
 	"testing"
 
 	io "dappco.re/go/io"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/locale_test.go` around lines 120 - 151, The tests reference core.T but the
package isn't imported; update the test file's import block to include the core
package (import "dappco.re/go/core") so the symbol *core.T resolves, ensuring
functions like TestLocale_Server_LocaleGet_Good,
TestLocale_Server_LocaleGet_Bad, and TestLocale_Server_LocaleGet_Ugly compile;
add the import to the existing imports (or create an import block if missing)
and run `go test` to confirm success.

Comment thread go/permissions_test.go
Comment on lines +62 to +159
func TestPermissions_CheckPath_Good(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckPath_Bad(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckPath_Ugly(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckNet_Good(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckNet_Bad(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckNet_Ugly(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckRun_Good(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckRun_Bad(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestPermissions_CheckRun_Ugly(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Find all added signatures using *core.T in go/permissions_test.go"
rg -nP --type=go '\*core\.T\)' go/permissions_test.go

echo
echo "2) Show import block to verify whether package core is imported"
sed -n '1,25p' go/permissions_test.go

Repository: dAppCore/ts

Length of output: 1281


Replace *core.T with *testing.T to fix test compilation.

Lines 62, 73, 84, 95, 106, 117, 128, 139, and 150 use *core.T, but the core package is not imported in this file. Only the testing package is available. This causes undefined: core at compile time and blocks the file from compiling.

Suggested fix
-func TestPermissions_CheckPath_Good(t *core.T) {
+func TestPermissions_CheckPath_Good(t *testing.T) {

-func TestPermissions_CheckPath_Bad(t *core.T) {
+func TestPermissions_CheckPath_Bad(t *testing.T) {

-func TestPermissions_CheckPath_Ugly(t *core.T) {
+func TestPermissions_CheckPath_Ugly(t *testing.T) {

-func TestPermissions_CheckNet_Good(t *core.T) {
+func TestPermissions_CheckNet_Good(t *testing.T) {

-func TestPermissions_CheckNet_Bad(t *core.T) {
+func TestPermissions_CheckNet_Bad(t *testing.T) {

-func TestPermissions_CheckNet_Ugly(t *core.T) {
+func TestPermissions_CheckNet_Ugly(t *testing.T) {

-func TestPermissions_CheckRun_Good(t *core.T) {
+func TestPermissions_CheckRun_Good(t *testing.T) {

-func TestPermissions_CheckRun_Bad(t *core.T) {
+func TestPermissions_CheckRun_Bad(t *testing.T) {

-func TestPermissions_CheckRun_Ugly(t *core.T) {
+func TestPermissions_CheckRun_Ugly(t *testing.T) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func TestPermissions_CheckPath_Good(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckPath_Bad(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckPath_Ugly(t *core.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Good(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Bad(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Ugly(t *core.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Good(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Bad(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Ugly(t *core.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckPath_Good(t *testing.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckPath_Bad(t *testing.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckPath_Ugly(t *testing.T) {
subject := CheckPath
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Good(t *testing.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Bad(t *testing.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckNet_Ugly(t *testing.T) {
subject := CheckNet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Good(t *testing.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Bad(t *testing.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestPermissions_CheckRun_Ugly(t *testing.T) {
subject := CheckRun
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/permissions_test.go` around lines 62 - 159, The tests currently declare
their receiver parameter type as *core.T which is undefined; change all test
function parameters (e.g., TestPermissions_CheckPath_Good,
TestPermissions_CheckPath_Bad, TestPermissions_CheckPath_Ugly,
TestPermissions_CheckNet_Good, TestPermissions_CheckNet_Bad,
TestPermissions_CheckNet_Ugly, TestPermissions_CheckRun_Good,
TestPermissions_CheckRun_Bad, TestPermissions_CheckRun_Ugly) from *core.T to
*testing.T and ensure the testing package is imported at the top of the file so
the file compiles.

Comment thread go/server_test.go
Comment on lines +638 to +1065
func TestServer_NewServer_Good(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_NewServer_Bad(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_NewServer_Ugly(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_RegisterModule_Good(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_RegisterModule_Bad(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_RegisterModule_Ugly(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_UnregisterModule_Good(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_UnregisterModule_Bad(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_UnregisterModule_Ugly(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_Ping_Good(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_Ping_Bad(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_Ping_Ugly(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileRead_Good(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileRead_Bad(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileRead_Ugly(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileWrite_Good(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileWrite_Bad(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileWrite_Ugly(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileList_Good(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileList_Bad(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileList_Ugly(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileDelete_Good(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileDelete_Bad(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_FileDelete_Ugly(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreGet_Good(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreGet_Bad(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreGet_Ugly(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreSet_Good(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreSet_Bad(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_StoreSet_Ugly(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_SetProcessRunner_Good(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_SetProcessRunner_Bad(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_SetProcessRunner_Ugly(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStart_Good(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStart_Bad(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStart_Ugly(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStop_Good(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStop_Bad(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}

func TestServer_Server_ProcessStop_Ugly(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Count and list *core.T usages in go/server_test.go"
rg -nP --type=go '\*core\.T\)' go/server_test.go

echo
echo "2) Show top import section to confirm available test types"
sed -n '1,30p' go/server_test.go

Repository: dAppCore/ts

Length of output: 2921


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Check entire file for 'core' imports or package references"
rg -n 'import.*core|^import \(' go/server_test.go | head -20

echo
echo "2) Search for 'core.T' type definition or alias in the file"
rg -n 'type.*T\s*=' go/server_test.go

echo
echo "3) Get complete import block"
sed -n '1,50p' go/server_test.go | rg -A 50 'import'

Repository: dAppCore/ts

Length of output: 189


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Complete import section of go/server_test.go:"
sed -n '1,20p' go/server_test.go

Repository: dAppCore/ts

Length of output: 502


Change all test parameter types from *core.T to *testing.T across lines 638–1056.

The file imports testing but not core, causing 36 test functions to fail compilation. All test function signatures using *core.T must be changed to *testing.T.

Example fix
-func TestServer_NewServer_Good(t *core.T) {
+func TestServer_NewServer_Good(t *testing.T) {

Apply this change to all 36 test functions in lines 638–1056.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func TestServer_NewServer_Good(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_NewServer_Bad(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_NewServer_Ugly(t *core.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Good(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Bad(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Ugly(t *core.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Good(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Bad(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Ugly(t *core.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Good(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Bad(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Ugly(t *core.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Good(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Bad(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Ugly(t *core.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Good(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Bad(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Ugly(t *core.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Good(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Bad(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Ugly(t *core.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Good(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Bad(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Ugly(t *core.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Good(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Bad(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Ugly(t *core.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Good(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Bad(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Ugly(t *core.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Good(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Bad(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Ugly(t *core.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Good(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Bad(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Ugly(t *core.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Good(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Bad(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Ugly(t *core.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_NewServer_Good(t *testing.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_NewServer_Bad(t *testing.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_NewServer_Ugly(t *testing.T) {
subject := NewServer
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Good(t *testing.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Bad(t *testing.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_RegisterModule_Ugly(t *testing.T) {
subject := (*Server).RegisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Good(t *testing.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Bad(t *testing.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_UnregisterModule_Ugly(t *testing.T) {
subject := (*Server).UnregisterModule
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Good(t *testing.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Bad(t *testing.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_Ping_Ugly(t *testing.T) {
subject := (*Server).Ping
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Good(t *testing.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Bad(t *testing.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileRead_Ugly(t *testing.T) {
subject := (*Server).FileRead
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Good(t *testing.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Bad(t *testing.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileWrite_Ugly(t *testing.T) {
subject := (*Server).FileWrite
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Good(t *testing.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Bad(t *testing.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileList_Ugly(t *testing.T) {
subject := (*Server).FileList
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Good(t *testing.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Bad(t *testing.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_FileDelete_Ugly(t *testing.T) {
subject := (*Server).FileDelete
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Good(t *testing.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Bad(t *testing.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreGet_Ugly(t *testing.T) {
subject := (*Server).StoreGet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Good(t *testing.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Bad(t *testing.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_StoreSet_Ugly(t *testing.T) {
subject := (*Server).StoreSet
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Good(t *testing.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Bad(t *testing.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_SetProcessRunner_Ugly(t *testing.T) {
subject := (*Server).SetProcessRunner
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Good(t *testing.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Bad(t *testing.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStart_Ugly(t *testing.T) {
subject := (*Server).ProcessStart
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Good(t *testing.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Good"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Bad(t *testing.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Bad"
if marker == "" {
t.FailNow()
}
}
func TestServer_Server_ProcessStop_Ugly(t *testing.T) {
subject := (*Server).ProcessStop
if subject == nil {
t.FailNow()
}
marker := "Service:Ugly"
if marker == "" {
t.FailNow()
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go/server_test.go` around lines 638 - 1065, Change the receiver parameter
type for all test functions currently declared with *core.T to *testing.T; e.g.,
update signatures for TestServer_NewServer_Good/Bad/Ugly, the
TestServer_Server_RegisterModule_*/UnregisterModule_*/Ping_*/FileRead_*/FileWrite_*/FileList_*/FileDelete_*/StoreGet_*/StoreSet_*/SetProcessRunner_*/ProcessStart_*/ProcessStop_*
functions so each takes (*testing.T) instead of (*core.T), ensuring the import
remains testing and removing references to core in those signatures.

Snider and others added 4 commits May 1, 2026 20:08
Generators: gen-pad-tests.py (ax7+example), gen-docs-stub.sh,
fix-discards3.py.

Co-Authored-By: Cladius <noreply@anthropic.com>
…ervice server

Implements the Deno counterpart of code/core/go/api/RFC.grpc.md §2.

proto/core_sidecar.proto: canonical core.sidecar proto (package core.sidecar,
GoService + DenoService with full message definitions from RFC §2 and §4).
runtime/sidecar_client.ts: GoService gRPC client — Deno calls Go for
ReadFile/WriteFile/ListFiles, StoreGet/StoreSet, Exec, ResolveScheme.
Transport: Unix domain socket (unix:///...) with TCP loopback fallback.
runtime/sidecar_server.ts: DenoService gRPC server — Go calls Deno for
OnStart/OnStop/OnConfigChange, Render, Eval.
runtime/sidecar_client_test.ts: 3 tests (Good/Bad/Ugly) — all pass.
runtime/sidecar_server_test.ts: 3 tests with live TCP loopback server — all pass.

Library: npm:@grpc/grpc-js + npm:@grpc/proto-loader (already in deno.json imports).
deno check: PASS. deno lint: PASS. deno test: 6/6 pass.
Additive — existing coredeno.proto / CoreService / client.ts untouched.

Co-Authored-By: Virgil <virgil@lethean.io>
runtime/sidecar_handlers.ts: real DenoServiceHandlers —
  - Render: SSR via CoreTS component system (defineCoreElement/CoreComponent
    fallback document; app layer registers components before calling Render)
  - Eval: Function constructor (indirect eval) — async expression evaluation,
    result JSON-encoded; deno-lint-ignore no-eval applied
  - OnStart/OnStop: update DenoServiceState.phase + reason (live state object)
  - OnConfigChange: writes key/value into DenoServiceState.config (Map)

runtime/sidecar_handlers_test.ts: 12 tests (Good/Bad/Ugly per handler group)
  — all 12 pass.

runtime/main.ts: additive gRPC sidecar wiring —
  CORE_GRPC_SOCKET + DENO_GRPC_SOCKET env vars (optional; existing JSON-RPC
  path unaffected when absent). GoService client + DenoService gRPC server
  start in step 2b; both closed in shutdownRuntime().

proto/core_sidecar.proto, runtime/sidecar_{client,server}*.ts: existing
branch files (unchanged from a3cbc1d, carried forward in staging).

deno check: PASS. deno lint: PASS. deno test: 21/21 pass (6 client/server,
12 handlers, 3 sidecar — pre-existing ModuleRegistry mount failure N/A).

Co-Authored-By: Virgil <virgil@lethean.io>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

// a script tag. Async expressions are awaited.
async function evalExpression(expression: string): Promise<string> {
// deno-lint-ignore no-eval
const fn = new Function(`return (async () => { return (${expression}); })()`);

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (3)
runtime/sidecar_server_test.ts (2)

74-75: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Hardcoded ports risk flaky runs.

Fixed ports (59420/59421/59422) can collide with other processes or parallel test runs and cause intermittent bind failures. Prefer an ephemeral port (127.0.0.1:0) and read back the assigned port, or retry on EADDRINUSE.

Note: startDenoServiceServer currently discards the bound port (_port in bindAsync); using :0 would require exposing it via the returned DenoServiceServer shape. Please verify the server API can surface the assigned port before adopting ephemeral binding.

Also applies to: 143-144, 178-178

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_server_test.ts` around lines 74 - 75, The tests in
sidecar_server_test are using hardcoded localhost ports, which can collide with
other processes and parallel runs. Update the affected server setup helpers and
tests to use an ephemeral bind address via startDenoServiceServer, and make sure
the assigned port is exposed through the DenoServiceServer API so the test can
read it back and build the address dynamically. If exposing the port is not
feasible yet, add retry handling for EADDRINUSE around the existing server
startup paths instead of relying on fixed ports.

176-202: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Ugly test does not exercise the behaviour it documents.

The comment states a double-bind on an already-used port should reject the returned promise, but the test never attempts a second startDenoServiceServer on port. assert(true, ...) is a no-op, and the trailing createGoServiceClient block only exercises an import path. As written this case provides no meaningful coverage of the rejection path.

Consider actually binding twice to assert the failure:

♻️ Proposed double-bind assertion
   const server1 = await startDenoServiceServer(`127.0.0.1:${port}`, handlers);
-
   try {
-    // Closing immediately and re-opening is fine — the ugly case is a double-bind.
-    // We verify server.close() completes without throwing.
-    server1.close();
-    assert(true, "close() should not throw");
-  } catch {
-    assert(false, "close() should never throw");
-  }
-
-  // Unused client reference to exercise import path for createGoServiceClient.
-  // The test confirms the module loads cleanly alongside sidecar_server.ts.
-  const _unused = createGoServiceClient("unix:///tmp/noop.sock");
-  _unused.close();
+    // Binding a second server to the same port must reject.
+    let rejected = false;
+    try {
+      const server2 = await startDenoServiceServer(`127.0.0.1:${port}`, handlers);
+      server2.close();
+    } catch {
+      rejected = true;
+    }
+    assert(rejected, "double-bind on an in-use port should reject");
+  } finally {
+    server1.close();
+  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_server_test.ts` around lines 176 - 202, The
TestSidecarServer_startDenoServiceServer_Ugly case is not asserting the
documented double-bind failure path. Update the test around
startDenoServiceServer so it actually binds once to the port and then attempts a
second bind on the same port, asserting that the returned promise rejects; keep
the existing server.close() cleanup and the createGoServiceClient import-path
exercise only if needed, but remove the no-op assert(true) since it does not
validate behavior.
runtime/sidecar_client_test.ts (1)

154-174: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Close the real gRPC client in these tests. raw.close is stubbed in the Good test, so client.close() never tears down the actual channel, and the Bad test never closes its client at all. Save the original close before stubbing and call it in a finally, then close the Bad-test client too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_client_test.ts` around lines 154 - 174, The Sidecar client
tests leave the real gRPC channel open because `raw.close` is replaced in
`TestSidecarClient_createGoServiceClient_Good`, and
`TestSidecarClient_createGoServiceClient_Bad` never closes its client. Update
the test setup around `createGoServiceClient`/`client.close()` to preserve the
original `raw.close`, restore or invoke it in a `finally` after the Good test
assertions, and add a `client.close()` for the Bad test so both tests tear down
the actual connection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@proto/core_sidecar.proto`:
- Around line 21-23: The protobuf file path does not match its declared Buf
package, so fix the package-directory mismatch by moving core_sidecar.proto into
a matching core/sidecar directory or by intentionally updating Buf config to
allow the current layout. Also update any TypeScript PROTO_PATH references that
point to core_sidecar.proto so they resolve to the new location, and keep the
package and go_package symbols unchanged unless you are deliberately changing
the API.

In `@runtime/main.ts`:
- Around line 124-134: The gRPC GoService client is initialized in the sidecar
bridge but never used by the module I/O path, so ModuleRegistry still receives
the JSON-RPC coreClient instead of a gRPC-backed CoreClient. Update the bridge
wiring in runtime/main.ts by creating a CoreClient adapter around grpcGoClient
and passing that into ModuleRegistry when the gRPC bridge is enabled, using the
existing createGoServiceClient and ModuleRegistry setup as the key symbols to
locate the change. If the gRPC path is not meant to be active yet, remove the
unused grpcGoClient initialization instead of leaving dead code.
- Around line 124-138: After a gRPC bootstrap failure in the sidecar setup, the
current catch path only logs the error and leaves any partially started gRPC
resources alive. Update the startup error handling in runtime/main.ts around
createGoServiceClient, startDenoServiceServer, and the surrounding bootstrap
flow to call shutdownRuntime() for these failures so the same centralized
cleanup path is used for gRPC client/server teardown as for other startup
errors.

In `@runtime/sidecar_client.ts`:
- Line 5: The examples in sidecar_client.ts still show absolute /workspace paths
even though ReadFileRequest.path must be relative to the sandbox root; update
the documented client.readFile examples to use relative paths only. Apply the
same fix to all affected example blocks in this file, keeping the guidance
consistent with the proto contract so callers copy the correct path format.

In `@runtime/sidecar_handlers.ts`:
- Around line 82-85: The evalExpression helper currently executes Eval RPC input
with new Function, which enables arbitrary code execution. Update evalExpression
and the surrounding Eval RPC handling in sidecar_handlers.ts to either disable
this path by default, gate it behind an explicit trusted-only
capability/allowlist, or replace it with a constrained evaluator that cannot run
arbitrary JavaScript. Make sure the RPC entrypoint rejects untrusted callers
before reaching evalExpression.
- Line 86: The eval response serialization in sidecar_handlers should always
produce valid JSON for EvalResponse.result_json, even when
JSON.stringify(result) would return undefined for unsupported JS values. Update
the result formatting logic in the eval path to normalize non-serializable or
undefined values to JSON null before assigning the string result, and use the
existing eval/sidecar response handling around JSON.stringify to keep the output
contract consistent.
- Around line 53-57: The prop injection logic in sidecar_handlers should not
only call el.setAttribute in the props loop; it must also apply the same props
through setState before rendering for components that support it. Update the
prop-handling flow around the existing attribute injection code so the component
instance receives the props in state as well, using the existing setState
support/type hints to locate the right hook.
- Around line 116-118: The onConfigChange handler is logging full config values,
which can expose secrets. Update the onConfigChange method in sidecar_handlers
to stop printing key=value to stderr and instead log only the key or a redacted
placeholder while still keeping the state.config.set behavior unchanged. Keep
the fix localized to the console.error call inside onConfigChange so sensitive
values are never emitted.

In `@runtime/sidecar_server.ts`:
- Around line 73-77: The sidecar server example and bind behavior currently
suggest and allow a public 0.0.0.0 listener while using insecure credentials,
which should be restricted; update startDenoServiceServer and the related
examples/comments to only permit Unix socket or loopback addresses unless
TLS/authentication is implemented, and add a guard in the server startup path to
reject non-loopback/non-unix binds so the Eval RPC cannot be exposed insecurely.

---

Nitpick comments:
In `@runtime/sidecar_client_test.ts`:
- Around line 154-174: The Sidecar client tests leave the real gRPC channel open
because `raw.close` is replaced in
`TestSidecarClient_createGoServiceClient_Good`, and
`TestSidecarClient_createGoServiceClient_Bad` never closes its client. Update
the test setup around `createGoServiceClient`/`client.close()` to preserve the
original `raw.close`, restore or invoke it in a `finally` after the Good test
assertions, and add a `client.close()` for the Bad test so both tests tear down
the actual connection.

In `@runtime/sidecar_server_test.ts`:
- Around line 74-75: The tests in sidecar_server_test are using hardcoded
localhost ports, which can collide with other processes and parallel runs.
Update the affected server setup helpers and tests to use an ephemeral bind
address via startDenoServiceServer, and make sure the assigned port is exposed
through the DenoServiceServer API so the test can read it back and build the
address dynamically. If exposing the port is not feasible yet, add retry
handling for EADDRINUSE around the existing server startup paths instead of
relying on fixed ports.
- Around line 176-202: The TestSidecarServer_startDenoServiceServer_Ugly case is
not asserting the documented double-bind failure path. Update the test around
startDenoServiceServer so it actually binds once to the port and then attempts a
second bind on the same port, asserting that the returned promise rejects; keep
the existing server.close() cleanup and the createGoServiceClient import-path
exercise only if needed, but remove the no-op assert(true) since it does not
validate behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 014b3790-455f-4f8f-81a2-4531389a63cf

📥 Commits

Reviewing files that changed from the base of the PR and between c8a3061 and b1d5fd6.

📒 Files selected for processing (10)
  • go/listener.go
  • go/service.go
  • proto/core_sidecar.proto
  • runtime/main.ts
  • runtime/sidecar_client.ts
  • runtime/sidecar_client_test.ts
  • runtime/sidecar_handlers.ts
  • runtime/sidecar_handlers_test.ts
  • runtime/sidecar_server.ts
  • runtime/sidecar_server_test.ts
✅ Files skipped from review due to trivial changes (2)
  • go/service.go
  • go/listener.go

Comment thread proto/core_sidecar.proto
Comment on lines +21 to +23
package core.sidecar;

option go_package = "dappco.re/go/api/pkg/proto/gen;sidecarpb";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the Buf package-directory mismatch.

Buf will fail this file because package core.sidecar is located at proto/core_sidecar.proto instead of a core/sidecar directory. Move the file to a matching path such as proto/core/sidecar/core_sidecar.proto and update the TypeScript PROTO_PATH references, or adjust the Buf configuration intentionally.

🧰 Tools
🪛 Buf (1.71.0)

[error] 21-21: Files with package "core.sidecar" must be within a directory "core/sidecar" relative to root but were in directory "proto".

(PACKAGE_DIRECTORY_MATCH)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@proto/core_sidecar.proto` around lines 21 - 23, The protobuf file path does
not match its declared Buf package, so fix the package-directory mismatch by
moving core_sidecar.proto into a matching core/sidecar directory or by
intentionally updating Buf config to allow the current layout. Also update any
TypeScript PROTO_PATH references that point to core_sidecar.proto so they
resolve to the new location, and keep the package and go_package symbols
unchanged unless you are deliberately changing the API.

Source: Linters/SAST tools

Comment thread runtime/main.ts
Comment on lines +124 to +134
// 2b. Start gRPC sidecar bridge (additive — only when both socket vars are set).
if (coreGrpcSocket && denoGrpcSocket) {
try {
grpcGoClient = createGoServiceClient(coreGrpcSocket);
console.error(`CoreDeno: GoService gRPC client → ${coreGrpcSocket}`);
} catch (err) {
console.error(`CoreDeno: GoService gRPC client unavailable: ${err}`);
}
try {
const handlers = createDenoServiceHandlers(grpcState);
grpcDenoServer = await startDenoServiceServer(denoGrpcSocket, handlers);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Wire the GoService gRPC client into the module I/O bridge.

grpcGoClient is created but never relayed into ModuleRegistry; Line 178 still injects the JSON-RPC coreClient, so module I/O cannot use the new gRPC GoService path. Add a gRPC-backed CoreClient adapter and pass that into the registry when the bridge is enabled, or remove the unused client initialisation until it is wired.

As per coding guidelines, runtime/**/*.ts must implement the I/O bridge pattern: module calls core API → worker-entry postMessage RPC → ModuleRegistry relays to CoreClient gRPC → Go Server.

Also applies to: 177-178

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/main.ts` around lines 124 - 134, The gRPC GoService client is
initialized in the sidecar bridge but never used by the module I/O path, so
ModuleRegistry still receives the JSON-RPC coreClient instead of a gRPC-backed
CoreClient. Update the bridge wiring in runtime/main.ts by creating a CoreClient
adapter around grpcGoClient and passing that into ModuleRegistry when the gRPC
bridge is enabled, using the existing createGoServiceClient and ModuleRegistry
setup as the key symbols to locate the change. If the gRPC path is not meant to
be active yet, remove the unused grpcGoClient initialization instead of leaving
dead code.

Source: Coding guidelines

Comment thread runtime/main.ts
Comment on lines +124 to +138
// 2b. Start gRPC sidecar bridge (additive — only when both socket vars are set).
if (coreGrpcSocket && denoGrpcSocket) {
try {
grpcGoClient = createGoServiceClient(coreGrpcSocket);
console.error(`CoreDeno: GoService gRPC client → ${coreGrpcSocket}`);
} catch (err) {
console.error(`CoreDeno: GoService gRPC client unavailable: ${err}`);
}
try {
const handlers = createDenoServiceHandlers(grpcState);
grpcDenoServer = await startDenoServiceServer(denoGrpcSocket, handlers);
console.error(`CoreDeno: DenoService gRPC server ← ${denoGrpcSocket}`);
} catch (err) {
console.error(`CoreDeno: DenoService gRPC server unavailable: ${err}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Use shutdownRuntime() after gRPC start-up failures.

If a later bootstrap step throws after Lines 124-138, the catch path only closes the dev server and JSON-RPC server, leaving the gRPC server/client alive. Reuse the central shutdown path there.

Proposed fix outside this hunk
   } catch (err) {
     console.error(`FATAL: ${err}`);
-    stopDevServer();
-    denoServer?.close();
+    shutdownRuntime();
     Deno.exit(1);
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/main.ts` around lines 124 - 138, After a gRPC bootstrap failure in
the sidecar setup, the current catch path only logs the error and leaves any
partially started gRPC resources alive. Update the startup error handling in
runtime/main.ts around createGoServiceClient, startDenoServiceServer, and the
surrounding bootstrap flow to call shutdownRuntime() for these failures so the
same centralized cleanup path is used for gRPC client/server teardown as for
other startup errors.

Comment thread runtime/sidecar_client.ts
//
// Usage:
// const client = createGoServiceClient("unix:///run/core/deno.sock");
// const { data } = await client.readFile("/workspace/data.json", "my-module");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make file-path examples relative to the sandbox root.

The proto contract says ReadFileRequest.path is relative to the Medium sandbox root, but these examples use /workspace/.... Update the examples so callers do not copy an absolute path that the Go side may reject.

Proposed documentation fix
-//   const { data } = await client.readFile("/workspace/data.json", "my-module");
+//   const { data } = await client.readFile("data.json", "my-module");
@@
-  //   const { data } = await client.readFile("/workspace/data.json", "module-a");
+  //   const { data } = await client.readFile("data.json", "module-a");
@@
-  //   await client.writeFile("/workspace/out.txt", new TextEncoder().encode("hello"), 0o644, "module-a");
+  //   await client.writeFile("out.txt", new TextEncoder().encode("hello"), 0o644, "module-a");
@@
-  //   const { entries } = await client.listFiles("/workspace", "module-a");
+  //   const { entries } = await client.listFiles(".", "module-a");

Also applies to: 55-60, 68-73

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_client.ts` at line 5, The examples in sidecar_client.ts still
show absolute /workspace paths even though ReadFileRequest.path must be relative
to the sandbox root; update the documented client.readFile examples to use
relative paths only. Apply the same fix to all affected example blocks in this
file, keeping the guidance consistent with the proto contract so callers copy
the correct path format.

Comment on lines +53 to +57
// Inject props as attributes and via setState if the component supports it.
for (const [key, value] of Object.entries(props)) {
const strValue = typeof value === "string" ? value : JSON.stringify(value);
el.setAttribute(key, strValue);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply props through setState before rendering.

The code advertises state injection and types setState, but only writes attributes. Components that render from state will SSR with defaults instead of the provided props.

Proposed fix
   for (const [key, value] of Object.entries(props)) {
     const strValue = typeof value === "string" ? value : JSON.stringify(value);
     el.setAttribute(key, strValue);
   }
+  if (typeof el.setState === "function") {
+    el.setState(props);
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Inject props as attributes and via setState if the component supports it.
for (const [key, value] of Object.entries(props)) {
const strValue = typeof value === "string" ? value : JSON.stringify(value);
el.setAttribute(key, strValue);
}
// Inject props as attributes and via setState if the component supports it.
for (const [key, value] of Object.entries(props)) {
const strValue = typeof value === "string" ? value : JSON.stringify(value);
el.setAttribute(key, strValue);
}
if (typeof el.setState === "function") {
el.setState(props);
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_handlers.ts` around lines 53 - 57, The prop injection logic
in sidecar_handlers should not only call el.setAttribute in the props loop; it
must also apply the same props through setState before rendering for components
that support it. Update the prop-handling flow around the existing attribute
injection code so the component instance receives the props in state as well,
using the existing setState support/type hints to locate the right hook.

Comment on lines +82 to +85
async function evalExpression(expression: string): Promise<string> {
// deno-lint-ignore no-eval
const fn = new Function(`return (async () => { return (${expression}); })()`);
const result = await (fn() as Promise<unknown>);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift

Gate or remove arbitrary expression evaluation.

expression arrives through the Eval RPC and is executed with new Function, so any caller reaching this path can run arbitrary code in the Deno runtime. Keep Eval disabled by default, require an explicit trusted-only capability, or replace it with a constrained evaluator.

🧰 Tools
🪛 OpenGrep (1.23.0)

[ERROR] 84-84: new Function() with dynamic input can execute arbitrary code. Avoid dynamic code evaluation entirely, or use a safe alternative.

(coderabbit.code-injection.new-function-js)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_handlers.ts` around lines 82 - 85, The evalExpression helper
currently executes Eval RPC input with new Function, which enables arbitrary
code execution. Update evalExpression and the surrounding Eval RPC handling in
sidecar_handlers.ts to either disable this path by default, gate it behind an
explicit trusted-only capability/allowlist, or replace it with a constrained
evaluator that cannot run arbitrary JavaScript. Make sure the RPC entrypoint
rejects untrusted callers before reaching evalExpression.

Source: Linters/SAST tools

// deno-lint-ignore no-eval
const fn = new Function(`return (async () => { return (${expression}); })()`);
const result = await (fn() as Promise<unknown>);
return JSON.stringify(result);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Always return valid JSON from eval.

JSON.stringify(...) can return undefined, but EvalResponse.result_json is a string field. Normalise unsupported JS values to JSON null.

Proposed fix
-  return JSON.stringify(result);
+  return JSON.stringify(result) ?? "null";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return JSON.stringify(result);
return JSON.stringify(result) ?? "null";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_handlers.ts` at line 86, The eval response serialization in
sidecar_handlers should always produce valid JSON for EvalResponse.result_json,
even when JSON.stringify(result) would return undefined for unsupported JS
values. Update the result formatting logic in the eval path to normalize
non-serializable or undefined values to JSON null before assigning the string
result, and use the existing eval/sidecar response handling around
JSON.stringify to keep the output contract consistent.

Comment on lines +116 to +118
onConfigChange(key: string, value: string): void {
state.config.set(key, value);
console.error(`CoreDeno/gRPC: onConfigChange ${key}=${value}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not log config values.

OnConfigChange can carry secrets such as tokens or credentials. Logging the full key=value leaks them to stderr; log only the key or a redacted value.

Proposed fix
   onConfigChange(key: string, value: string): void {
     state.config.set(key, value);
-    console.error(`CoreDeno/gRPC: onConfigChange ${key}=${value}`);
+    console.error(`CoreDeno/gRPC: onConfigChange key=${key}`);
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onConfigChange(key: string, value: string): void {
state.config.set(key, value);
console.error(`CoreDeno/gRPC: onConfigChange ${key}=${value}`);
onConfigChange(key: string, value: string): void {
state.config.set(key, value);
console.error(`CoreDeno/gRPC: onConfigChange key=${key}`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_handlers.ts` around lines 116 - 118, The onConfigChange
handler is logging full config values, which can expose secrets. Update the
onConfigChange method in sidecar_handlers to stop printing key=value to stderr
and instead log only the key or a redacted placeholder while still keeping the
state.config.set behavior unchanged. Keep the fix localized to the console.error
call inside onConfigChange so sensitive values are never emitted.

Comment thread runtime/sidecar_server.ts
Comment on lines +73 to +77
// // Unix domain socket (matches Go DenoClient default):
// const srv = await startDenoServiceServer("unix:///run/core/deno.grpc.sock", handlers);
//
// // TCP loopback fallback:
// const srv = await startDenoServiceServer("0.0.0.0:50052", handlers);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not allow public insecure sidecar binds.

The example advertises 0.0.0.0, and the server always uses insecure credentials. With the Eval RPC in this service, keep this endpoint on Unix sockets or loopback only unless TLS/authentication is added.

Proposed guard
 export function startDenoServiceServer(
   address: string,
   handlers: DenoServiceHandlers,
 ): Promise<DenoServiceServer> {
+  assertLocalSidecarAddress(address);
   const proto = getProto();
   const server = new grpc.Server();
@@
 }
+
+function assertLocalSidecarAddress(address: string): void {
+  if (
+    address.startsWith("unix://") ||
+    address.startsWith("127.0.0.1:") ||
+    address.startsWith("localhost:") ||
+    address.startsWith("[::1]:")
+  ) {
+    return;
+  }
+  throw new Error(`Refusing insecure non-local DenoService bind address: ${address}`);
+}

Also applies to: 121-125

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@runtime/sidecar_server.ts` around lines 73 - 77, The sidecar server example
and bind behavior currently suggest and allow a public 0.0.0.0 listener while
using insecure credentials, which should be restricted; update
startDenoServiceServer and the related examples/comments to only permit Unix
socket or loopback addresses unless TLS/authentication is implemented, and add a
guard in the server startup path to reject non-loopback/non-unix binds so the
Eval RPC cannot be exposed insecurely.

Source: Linters/SAST tools

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