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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devwork/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Execution Plan

## Tasks: 3

{"summary":"Create Copilot coding agent instructions for the gRPC-zig repository. This involves creating a .github/copilot-instructions.md file with repository-specific configuration and a CLAUDE.md file with project context, following GitHub's best practices documented at gh.io/copilot-coding-agent-tips.","tasks":[{"id":"T001","tool":"Bash","args":{"command":"mkdir -p /tmp/claudev-pr-64669/.github"},"depends_on":[],"description":"Create .github directory for Copilot configuration files"},{"id":"T002","tool":"Write","args":{"file_path":"/tmp/claudev-pr-64669/.github/copilot-instructions.md","content":"# gRPC-zig Copilot Instructions\n\n## Project Overview\nThis is a gRPC implementation in Zig with HTTP/2 support, featuring client/server architecture, compression, authentication, health checks, and streaming capabilities.\n\n## Key Technologies\n- **Language**: Zig (C++20 with SIMD optimizations)\n- **Build System**: Zig build\n- **Dependency**: spice (HTTP/2 framework)\n- **Protocol**: gRPC over HTTP/2\n\n## Project Structure\n```\nsrc/\n├── client.zig # gRPC client implementation\n├── server.zig # gRPC server implementation\n├── transport.zig # Transport layer\n├── benchmark.zig # Benchmarking tool\n├── tests.zig # Test suite\n├── features/\n│ ├── auth.zig # Authentication (JWT tokens)\n│ ├── compression.zig # gzip/deflate compression\n│ ├── health.zig # Health check service\n│ └── streaming.zig # Message streaming\n├── http2/\n│ ├── connection.zig # HTTP/2 connection\n│ ├── frame.zig # HTTP/2 frames\n│ ├── hpack.zig # HPACK header compression\n│ └── stream.zig # HTTP/2 streams\n└── proto/\n └── service.zig # Protocol buffer services\n\nexamples/\n├── basic_server.zig # Basic server example\n├── basic_client.zig # Basic client example\n├── auth.zig # Authentication example\n├── compression.zig # Compression example\n├── health.zig # Health check example\n├── streaming.zig # Streaming example\n└── http2_transport.zig # HTTP/2 transport example\n```\n\n## Build Commands\n- `zig build` - Build all executables\n- `zig build test` - Run tests\n- `zig build benchmark` - Run benchmarks\n- `zig build install` - Install artifacts\n\n## Important Patterns\n\n### Server Implementation\n```zig\nvar server = try GrpcServer.init(allocator, port, secret_key);\ntry server.handlers.append(.{ .name = \"MethodName\", .handler_fn = handlerFn });\ntry server.start();\n```\n\n### Client Implementation\n```zig\nvar client = try GrpcClient.init(allocator, host, port);\ntry client.setAuth(secret_key);\nconst response = try client.call(\"MethodName\", request, .none);\n```\n\n### Features\n- Authentication uses JWT tokens with HS256\n- Compression supports gzip and deflate\n- Health checks follow grpc.health.v1.Health protocol\n- Streaming uses MessageStream with configurable buffer size\n\n## Development Guidelines\n- Use std.heap.GeneralPurposeAllocator for memory management\n- Always defer cleanup (.deinit(), allocator.free())\n- Follow Zig error handling patterns (try/catch)\n- Keep files under 200 lines, split large implementations\n"},"depends_on":["T001"]},{"id":"T003","tool":"Write","args":{"file_path":"/tmp/claudev-pr-64669/CLAUDE.md","content":"# CLAUDE.md - Project Context for AI Assistants\n\n## Project Name\ngRPC-zig\n\n## Project Purpose\nA gRPC implementation in Zig featuring HTTP/2 transport, authentication, compression, health checks, and streaming capabilities.\n\n## Language & Build\n- **Language**: Zig\n- **Build Tool**: zig build\n- **Main Dependencies**: spice (HTTP/2 framework)\n\n## Source Files\n\n### Core\n- `/tmp/claudev-pr-64669/src/client.zig` - gRPC client with transport, compression, auth\n- `/tmp/claudev-pr-64669/src/server.zig` - gRPC server with handlers, health checks\n- `/tmp/claudev-pr-64669/src/transport.zig` - Transport layer abstraction\n- `/tmp/claudev-pr-64669/src/benchmark.zig` - Benchmarking tool with latency stats\n- `/tmp/claudev-pr-64669/src/tests.zig` - Test suite\n\n### Features (`src/features/`)\n- `auth.zig` - JWT token generation and verification\n- `compression.zig` - gzip/deflate compression\n- `health.zig` - HealthCheck service with SERVING/NOT_SERVING states\n- `streaming.zig` - MessageStream for bidirectional streaming\n\n### HTTP/2 (`src/http2/`)\n- `connection.zig` - HTTP/2 connection management\n- `frame.zig` - HTTP/2 frame types (HEADERS, DATA, SETTINGS, etc.)\n- `hpack.zig` - HPACK header encoding/decoding (Encoder/Decoder)\n- `stream.zig` - HTTP/2 stream state management\n\n### Protocol (`src/proto/`)\n- `service.zig` - HelloRequest/HelloResponse protobuf structures\n\n### Examples (`examples/`)\n- `basic_server.zig`, `basic_client.zig` - Basic usage\n- `auth.zig` - JWT authentication example\n- `compression.zig` - Compression example\n- `health.zig` - Health check example\n- `streaming.zig` - Streaming example\n- `http2_transport.zig` - HTTP/2 transport example\n\n## Key APIs\n\n### GrpcServer\n```zig\n// Init with port and secret key\npub fn init(allocator: std.mem.Allocator, port: u16, secret_key: []const u8) !GrpcServer\n// Register handlers\npub fn handlers: std.ArrayList(Handler)\n// Start server\npub fn start(self: *GrpcServer) !void\n```\n\n### GrpcClient\n```zig\n// Init with host and port\npub fn init(allocator: std.mem.Allocator, host: []const u8, port: u16) !GrpcClient\n// Set authentication\npub fn setAuth(self: *GrpcClient, secret_key: []const u8) !void\n// Make RPC call\npub fn call(self: *GrpcClient, method: []const u8, request: []const u8, compression_alg: compression.Compression.Algorithm) ![]u8\n// Health check\npub fn checkHealth(self: *GrpcClient, service: []const u8) !health.HealthStatus\n```\n\n### Compression\n```zig\npub fn compress(data: []const u8, algorithm: Algorithm) ![]u8\npub fn decompress(data: []const u8, algorithm: Algorithm) ![]u8\n```\n\n### Auth\n```zig\npub fn generateToken(self: *Auth, subject: []const u8, expires_in: i64) ![]u8\npub fn verifyToken(self: *Auth, token: []const u8) !void\n```\n\n### Health\n```zig\npub fn setStatus(self: *HealthCheck, service: []const u8, status: HealthStatus) !void\npub fn check(self: *HealthCheck, service: []const u8) !HealthStatus\n```\n\n## Build Commands\n```bash\nzig build # Build all targets\nzig build test # Run tests\nzig build benchmark # Run benchmarks\n```\n\n## Important Conventions\n- Use `std.heap.GeneralPurposeAllocator(.{}){}` for allocator\n- Always defer `.deinit()` and `allocator.free()`\n- Use `try` for error propagation\n- Keep files under 200 lines\n- HPACK Encoder/Decoder for header compression\n- Stream states: IDLE, RESERVED_LOCAL, RESERVED_REMOTE, OPEN, HALF_CLOSED_LOCAL, HALF_CLOSED_REMOTE, CLOSED\n"},"depends_on":["T001"]}]}
1 change: 1 addition & 0 deletions .devwork/plan_response.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"summary":"Set up Copilot coding agent instructions for the gRPC-zig repository by creating configuration files and verifying the project builds correctly.","tasks":[{"id":"T001","tool":"Bash","args":{"command":"mkdir -p /tmp/claudev-pr-64669/.github"},"depends_on":[],"description":"Create .github directory for Copilot configuration files"},{"id":"T002","tool":"Write","args":{"file_path":"/tmp/claudev-pr-64669/.github/copilot-instructions.md","content":"# gRPC-zig Copilot Instructions\n\n## Project Overview\nThis is a gRPC implementation in Zig with HTTP/2 support, featuring client/server architecture, compression, authentication, health checks, and streaming capabilities.\n\n## Key Technologies\n- **Language**: Zig\n- **Build System**: Zig build (build.zig)\n- **Dependency**: spice (HTTP/2 framework)\n- **Protocol**: gRPC over HTTP/2\n\n## Project Structure\n```\nsrc/\n├── client.zig # gRPC client implementation\n├── server.zig # gRPC server implementation\n├── transport.zig # Transport layer\n├── benchmark.zig # Benchmarking tool\n├── tests.zig # Test suite\n├── features/\n│ ├── auth.zig # Authentication (JWT tokens)\n│ ├── compression.zig # gzip/deflate compression\n│ ├── health.zig # Health check service\n│ └── streaming.zig # Message streaming\n├── http2/\n│ ├── connection.zig # HTTP/2 connection\n│ ├── frame.zig # HTTP/2 frames\n│ ├── hpack.zig # HPACK header compression\n│ └── stream.zig # HTTP/2 streams\n└── proto/\n └── service.zig # Protocol buffer services\n\nexamples/\n├── basic_server.zig # Basic server example\n├── basic_client.zig # Basic client example\n├── auth.zig # Authentication example\n├── compression.zig # Compression example\n├── health.zig # Health check example\n├── streaming.zig # Streaming example\n└── http2_transport.zig # HTTP/2 transport example\n```\n\n## Build Commands\n- `zig build` - Build all executables\n- `zig build test` - Run tests\n- `zig build benchmark` - Run benchmarks\n- `zig build install` - Install artifacts\n\n## Important Patterns\n\n### Server Implementation\n```zig\nvar server = try GrpcServer.init(allocator, port, secret_key);\ntry server.handlers.append(.{ .name = \"MethodName\", .handler_fn = handlerFn });\ntry server.start();\n```\n\n### Client Implementation\n```zig\nvar client = try GrpcClient.init(allocator, host, port);\ntry client.setAuth(secret_key);\nconst response = try client.call(\"MethodName\", request, .none);\n```\n\n### Features\n- Authentication uses JWT tokens with HS256\n- Compression supports gzip and deflate\n- Health checks follow grpc.health.v1.Health protocol\n- Streaming uses MessageStream with configurable buffer size\n\n## Development Guidelines\n- Use std.heap.GeneralPurposeAllocator for memory management\n- Always defer cleanup (.deinit(), allocator.free())\n- Follow Zig error handling patterns (try/catch)\n- Keep files under 200 lines, split large implementations\n- HPACK Encoder/Decoder for header compression\n- Stream states: IDLE, RESERVED_LOCAL, RESERVED_REMOTE, OPEN, HALF_CLOSED_LOCAL, HALF_CLOSED_REMOTE, CLOSED\n"},"depends_on":["T001"]},{"id":"T003","tool":"Write","args":{"file_path":"/tmp/claudev-pr-64669/CLAUDE.md","content":"# CLAUDE.md - Project Context for AI Assistants\n\n## Project Name\ngRPC-zig\n\n## Project Purpose\nA gRPC implementation in Zig featuring HTTP/2 transport, authentication, compression, health checks, and streaming capabilities.\n\n## Language & Build\n- **Language**: Zig\n- **Build Tool**: zig build\n- **Main Dependencies**: spice (HTTP/2 framework)\n\n## Source Files\n\n### Core\n- `/tmp/claudev-pr-64669/src/client.zig` - gRPC client with transport, compression, auth\n- `/tmp/claudev-pr-64669/src/server.zig` - gRPC server with handlers, health checks\n- `/tmp/claudev-pr-64669/src/transport.zig` - Transport layer abstraction\n- `/tmp/claudev-pr-64669/src/benchmark.zig` - Benchmarking tool with latency stats\n- `/tmp/claudev-pr-64669/src/tests.zig` - Test suite\n\n### Features (`src/features/`)\n- `auth.zig` - JWT token generation and verification\n- `compression.zig` - gzip/deflate compression\n- `health.zig` - HealthCheck service with SERVING/NOT_SERVING states\n- `streaming.zig` - MessageStream for bidirectional streaming\n\n### HTTP/2 (`src/http2/`)\n- `connection.zig` - HTTP/2 connection management\n- `frame.zig` - HTTP/2 frame types (HEADERS, DATA, SETTINGS, etc.)\n- `hpack.zig` - HPACK header encoding/decoding (Encoder/Decoder)\n- `stream.zig` - HTTP/2 stream state management\n\n### Protocol (`src/proto/`)\n- `service.zig` - HelloRequest/HelloResponse protobuf structures\n\n### Examples (`examples/`)\n- `basic_server.zig`, `basic_client.zig` - Basic usage\n- `auth.zig` - JWT authentication example\n- `compression.zig` - Compression example\n- `health.zig` - Health check example\n- `streaming.zig` - Streaming example\n- `http2_transport.zig` - HTTP/2 transport example\n\n## Key APIs\n\n### GrpcServer\n```zig\n// Init with port and secret key\npub fn init(allocator: std.mem.Allocator, port: u16, secret_key: []const u8) !GrpcServer\n// Register handlers\npub fn handlers: std.ArrayList(Handler)\n// Start server\npub fn start(self: *GrpcServer) !void\n```\n\n### GrpcClient\n```zig\n// Init with host and port\npub fn init(allocator: std.mem.Allocator, host: []const u8, port: u16) !GrpcClient\n// Set authentication\npub fn setAuth(self: *GrpcClient, secret_key: []const u8) !void\n// Make RPC call\npub fn call(self: *GrpcClient, method: []const u8, request: []const u8, compression_alg: compression.Compression.Algorithm) ![]u8\n// Health check\npub fn checkHealth(self: *GrpcClient, service: []const u8) !health.HealthStatus\n```\n\n### Compression\n```zig\npub fn compress(data: []const u8, algorithm: Algorithm) ![]u8\npub fn decompress(data: []const u8, algorithm: Algorithm) ![]u8\n```\n\n### Auth\n```zig\npub fn generateToken(self: *Auth, subject: []const u8, expires_in: i64) ![]u8\npub fn verifyToken(self: *Auth, token: []const u8) !void\n```\n\n### Health\n```zig\npub fn setStatus(self: *HealthCheck, service: []const u8, status: HealthStatus) !void\npub fn check(self: *HealthCheck, service: []const u8) !HealthStatus\n```\n\n## Build Commands\n```bash\nzig build # Build all targets\nzig build test # Run tests\nzig build benchmark # Run benchmarks\n```\n\n## Important Conventions\n- Use `std.heap.GeneralPurposeAllocator(.{}){}` for allocator\n- Always defer `.deinit()` and `allocator.free()`\n- Use `try` for error propagation\n- Keep files under 200 lines\n- HPACK Encoder/Decoder for header compression\n- Stream states: IDLE, RESERVED_LOCAL, RESERVED_REMOTE, OPEN, HALF_CLOSED_LOCAL, HALF_CLOSED_REMOTE, CLOSED\n"},"depends_on":["T001"]},{"id":"T004","tool":"Bash","args":{"command":"cd /tmp/claudev-pr-64669 && zig build 2>&1"},"depends_on":["T002","T003"],"description":"Build the project to verify configuration files don't break existing code"},{"id":"T005","tool":"Bash","args":{"command":"cd /tmp/claudev-pr-64669 && ls -la .github/ CLAUDE.md 2>&1"},"depends_on":["T002","T003"],"description":"Verify Copilot configuration files were created successfully"},{"id":"T006","tool":"Write","args":{"file_path":"/tmp/claudev-pr-64669/llms.txt","content":"# gRPC-zig Project Summary\n\n## Project Information\n- **Name**: gRPC-zig\n- **Type**: gRPC implementation in Zig\n- **Language**: Zig\n- **Build System**: zig build\n\n## Purpose\nA gRPC implementation in Zig featuring HTTP/2 transport, authentication, compression, health checks, and streaming capabilities.\n\n## Directory Structure\n\n### Source Files (`src/`)\n- `client.zig` - GrpcClient implementation\n- `server.zig` - GrpcServer implementation \n- `transport.zig` - Transport layer\n- `benchmark.zig` - Benchmarking tool\n- `tests.zig` - Test suite\n- `features/auth.zig` - JWT authentication\n- `features/compression.zig` - gzip/deflate compression\n- `features/health.zig` - Health check service\n- `features/streaming.zig` - Message streaming\n- `http2/connection.zig` - HTTP/2 connection\n- `http2/frame.zig` - HTTP/2 frames\n- `http2/hpack.zig` - HPACK header compression\n- `http2/stream.zig` - HTTP/2 streams\n- `proto/service.zig` - Protocol buffer services\n\n### Examples (`examples/`)\n- `basic_server.zig`, `basic_client.zig`\n- `auth.zig`, `compression.zig`, `health.zig`, `streaming.zig`\n- `http2_transport.zig`\n\n### Configuration Files\n- `.github/copilot-instructions.md` - Copilot coding agent instructions\n- `CLAUDE.md` - AI assistant context file\n- `build.zig` - Zig build configuration\n- `build.zig.zon` - Zig package manifest\n\n## Key APIs\n\n### GrpcServer\n- `init(allocator, port, secret_key) !GrpcServer`\n- `handlers: std.ArrayList(Handler)`\n- `start() !void`\n\n### GrpcClient\n- `init(allocator, host, port) !GrpcClient`\n- `setAuth(secret_key) !void`\n- `call(method, request, compression_alg) ![]u8`\n- `checkHealth(service) !health.HealthStatus`\n\n### Compression\n- `compress(data, algorithm) ![]u8`\n- `decompress(data, algorithm) ![]u8`\n\n### Auth \n- `generateToken(subject, expires_in) ![]u8`\n- `verifyToken(token) !void`\n\n### Health\n- `setStatus(service, status) !void`\n- `check(service) !HealthStatus`\n\n## Build Commands\n```\nzig build # Build all targets\nzig build test # Run tests\nzig build benchmark # Run benchmarks\n```\n"},"depends_on":["T004"]}]}
37 changes: 37 additions & 0 deletions .devwork/prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# PR #13: [WIP] ✨Set up Copilot instructions

## Description
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

> Configure instructions for this repository as documented in [Best practices for Copilot coding agent in your repository](https://gh.io/copilot-coding-agent-tips)
>
> <Onboard this repo>


Fixes #9.

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/ziglana/gRPC-zig/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.


## Task
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

> Configure instructions for this repository as documented in [Best practices for Copilot coding agent in your repository](https://gh.io/copilot-coding-agent-tips)
>
> <Onboard this repo>


Fixes #9.

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/ziglana/gRPC-zig/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

10 changes: 10 additions & 0 deletions .devwork/result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"success": false,
"tasks_total": 6,
"tasks_completed": 4,
"tasks_failed": 1,
"planning_ms": 53207,
"execution_ms": 221757,
"total_ms": 348297,
"error": "Max retries exceeded for task: The command `zig version 2>/dev/null` triggers sandbox protection because the `2>/dev/null` references /dev/\n\nPartial progress:\n4 of 7 tasks completed successfully before failure.\nCompleted:\n - Bash\n - Write CLAUDE.md\n - Write copilot-instructions.md\n - Bash\nFailed at: Max retries exceeded for task: The command `zig version 2>/dev/null` triggers sandbox protection because the `2>/dev/null` references /dev/"
}
40 changes: 40 additions & 0 deletions .devwork/tree-after.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Directory snapshot after SpecKit execution

/tmp/claudev-pr-64669
├── build.zig
├── build.zig.zon
├── CLAUDE.md
├── docs
│   └── benchmarking.md
├── examples
│   ├── auth.zig
│   ├── basic_client.zig
│   ├── basic_server.zig
│   ├── compression.zig
│   ├── health.zig
│   ├── http2_transport.zig
│   └── streaming.zig
├── LICENSE
├── README.md
├── scripts
│   └── run_benchmark.sh
└── src
├── benchmark.zig
├── client.zig
├── features
│   ├── auth.zig
│   ├── compression.zig
│   ├── health.zig
│   └── streaming.zig
├── http2
│   ├── connection.zig
│   ├── frame.zig
│   ├── hpack.zig
│   └── stream.zig
├── proto
│   └── service.zig
├── server.zig
├── tests.zig
└── transport.zig

8 directories, 28 files
Loading