Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# The sdk team owns the SDK; OpenShell maintainers review as a fallback.
* @ai-openshell/sdk @ai-openshell/maintainers
Comment thread
SDAChess marked this conversation as resolved.
Resolved

# CI and the scripts it runs with the bot token need an infra review.
/.github/ @ai-openshell/infra
/hack/automation/ @ai-openshell/infra
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
Comment thread
rhuss marked this conversation as resolved.
Resolved

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
groups:
go-minor-and-patch:
update-types: ["minor", "patch"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 7
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,22 @@ jobs:
# buf fetches proto/ from NVIDIA/OpenShell at the pinned tag (public, no credentials).
- name: Run CI pipeline
run: mise run ci

workflows:
name: workflows
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
install: false

- name: Install tools
run: mise install --locked actionlint shellcheck zizmor

- name: Lint workflows
run: mise run workflows:check
50 changes: 50 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

name: CodeQL

on:
pull_request:
push:
branches: [main]
schedule:
- cron: "29 5 * * 1"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: codeql-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
analyze:
name: CodeQL (go)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod

- name: Initialize CodeQL
uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
with:
languages: go
build-mode: manual

- name: Build
run: go build ./...

- name: Analyze
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
with:
category: /language:go
60 changes: 60 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

name: docs

on:
pull_request:
paths: ["docs/**", "mise.toml", "mise.lock", ".github/workflows/docs.yml"]
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
install: false

- name: Install mdbook
run: mise install --locked mdbook

- name: Build
run: mise run docs:build

- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/book

deploy:
name: deploy
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
28 changes: 28 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Agent Instructions

The OpenShell Go SDK: module `github.com/ai-openshell/sdk-go`, a client for the
OpenShell gateway. See [CONTRIBUTING.md](CONTRIBUTING.md) for tasks and the
release model.

## Commands

- `mise run ci` runs the full pipeline (format check, lint, build, test, proto
check, conformance check, docs check).
- `mise run proto:gen` regenerates `proto/` from core at the tag pinned in
`buf.gen.yaml`. Never edit generated files by hand.

## Code conventions

- Domain types in `openshell/v1/types/` must not import proto packages.
- Converters in `openshell/v1/internal/converter/` deep-copy slices and maps at
boundaries.
- Tests use bufconn for in-process gRPC and testify for assertions.
- Test fixtures live in the `testdata/` directory of the package that reads
them. Never read files outside the module.

## Commits

- Use Conventional Commits and sign off every commit (`--signoff`).
- Never mention Claude or any AI agent in commits, pull request descriptions, or
issues (no author attribution, no Co-Authored-By, no "Generated with"
footers).
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing to the OpenShell Go SDK

## Setup

Install [mise](https://mise.jdx.dev/), then install the pinned tools:

```shell
mise install --locked
```

`mise tasks` lists every task. The ones you need most:

| Task | What it does |
|------|--------------|
| `mise run ci` | Everything CI runs: format check, lint, build, tests, proto check, conformance check, docs check |
| `mise run fmt` | Format the code |
| `mise run test` | Unit tests with the race detector |
| `mise run proto:gen` | Regenerate the bindings from core at the pinned tag |
| `mise run core:version` | Print the pinned core version |
| `mise run workflows:check` | Lint the GitHub workflows |
| `mise run docs:build` | Build the docs into `docs/book` |

## Commits and pull requests

- Use [Conventional Commits](https://www.conventionalcommits.org/):
`<type>(<scope>): <description>`.
- Sign off every commit (`git commit --signoff`) for the [Developer Certificate
of Origin](https://developercertificate.org/).
- Every change goes through a pull request with an approval from a code owner
who did not push last.

## Bindings and core versions

The bindings in `proto/` are generated from core's `proto/` at one core release
tag, the `tag:` line in `buf.gen.yaml`. Don't edit generated files; change the
pin and run `mise run proto:gen`. `mise run proto:check` fails when the
committed bindings don't match the pin.

Shared test fixtures come from core's `sdk/conformance/` and are vendored next
to the tests that read them. `mise run conformance:check` compares them with
core at the pinned tag.

SDK releases follow core releases: SDK `vX.Y.Z` is built from core `vX.Y.Z`, and
there are no SDK-only releases.

## Core bumps and drift

Automation watches core for new tags and opens a pull request that moves the
pin, labeled `core-bump` plus `stable` or `prerelease`. If a bump needs SDK
changes, push them to the same branch. Merging a bump to a stable tag tags the
SDK release.

A nightly job checks core's `main` for breaking proto changes and RPCs the SDK
doesn't cover yet, and keeps one issue labeled `core-drift` up to date.
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Reporting a vulnerability

Report vulnerabilities in the OpenShell Go SDK privately through
[NVIDIA/OpenShell's private reporting
form](https://github.com/NVIDIA/OpenShell/security/advisories/new) and name
`ai-openshell/sdk-go` as the affected component. Do not disclose vulnerabilities
in public issues, discussions, or pull requests.

The OpenShell security policy applies to this repository: the [report template,
review process, and coordinated
disclosure](https://github.com/NVIDIA/OpenShell/blob/main/SECURITY.md) are the
same. Private reporting directly on this repository will be enabled once its
process is set up; until then, use the form above.
81 changes: 81 additions & 0 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ yq = "4.53.6"
"go:google.golang.org/protobuf/cmd/protoc-gen-go" = "1.36.11"
"go:google.golang.org/grpc/cmd/protoc-gen-go-grpc" = "1.6.2"
"go:golang.org/x/tools/cmd/goimports" = "0.48.0"
actionlint = "1.7.12"
shellcheck = "0.11.0"
zizmor = "1.32.0"
mdbook = "0.5.4"

[tasks.test]
description = "Run unit tests with coverage"
Expand Down Expand Up @@ -224,3 +228,14 @@ fi

echo "Proto check passed: generated files match core $(yq -r '.inputs[0].tag' buf.gen.yaml)."
"""

[tasks."workflows:check"]
description = "Lint GitHub workflows with actionlint (with shellcheck) and zizmor"
run = [
"actionlint",
"zizmor --offline --min-severity medium .github",
]

[tasks."docs:build"]
description = "Build the mdbook docs into docs/book"
run = "mdbook build docs"
Loading