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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# ── Rust contracts: test, build wasm, lint ──────────────────────────
contracts:
name: Contracts (Rust)
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts
steps:
- uses: actions/checkout@v4

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy

- name: Cache cargo registry & target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
contracts/target
key: contracts-${{ runner.os }}-cargo-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
contracts-${{ runner.os }}-cargo-

- name: Run tests
run: cargo test --workspace

- name: Build wasm
run: cargo build --release --target wasm32-unknown-unknown --workspace

- name: Clippy
run: cargo clippy --workspace -- -D warnings

# ── TypeScript agents: typecheck ────────────────────────────────────
agents:
name: Agents (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install agents/ dependencies
working-directory: agents
run: npm ci

- name: Typecheck agents/
working-directory: agents
run: npx tsc --noEmit

- name: Install agent-002-governance-analyst/ dependencies
working-directory: agent-002-governance-analyst
run: npm ci

- name: Typecheck agent-002-governance-analyst/
working-directory: agent-002-governance-analyst
run: npx tsc --noEmit

# ── Spec verification: schemas, reference impls, datasets ───────────
verify-specs:
name: Verify Specs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install root dependencies
run: npm ci

- name: Run verify script
run: node scripts/verify.mjs
103 changes: 103 additions & 0 deletions .github/workflows/wasm-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: WASM Size Report

on:
pull_request:
branches: [main]
paths:
- "contracts/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
wasm-size:
name: Report WASM Binary Sizes
runs-on: ubuntu-latest
permissions:
pull-requests: write
defaults:
run:
working-directory: contracts
steps:
- uses: actions/checkout@v4

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache cargo registry & target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
contracts/target
key: wasm-size-${{ runner.os }}-cargo-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
wasm-size-${{ runner.os }}-cargo-

- name: Build wasm release
run: cargo build --release --target wasm32-unknown-unknown --workspace

- name: Collect binary sizes
id: sizes
run: |
WASM_DIR="target/wasm32-unknown-unknown/release"
{
echo "report<<WASM_EOF"
echo "| Contract | Size |"
echo "|----------|------|"
for wasm in "$WASM_DIR"/*.wasm; do
[ -f "$wasm" ] || continue
name="$(basename "$wasm" .wasm)"
# Skip build-script and dep artifacts (contain hyphens followed by hex)
echo "$name" | grep -qE '^[a-f0-9]{16}' && continue
size_bytes="$(wc -c < "$wasm")"
if [ "$size_bytes" -ge 1048576 ]; then
size="$(awk "BEGIN {printf \"%.2f MiB\", $size_bytes/1048576}")"
else
size="$(awk "BEGIN {printf \"%.1f KiB\", $size_bytes/1024}")"
fi
echo "| \`$name\` | $size |"
done
echo "WASM_EOF"
} >> "$GITHUB_OUTPUT"

- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const marker = '<!-- wasm-size-report -->';
const body = [
marker,
'## WASM Binary Sizes',
'',
'${{ steps.sizes.outputs.report }}',
'',
`_Built from \`${context.sha.slice(0, 8)}\` on \`${context.ref.replace('refs/heads/', '')}\`_`,
].join('\n');

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const existing = comments.find(c => c.body?.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
.DS_Store
node_modules/

# Rust build artifacts
target/
Cargo.lock

# Local-only context (LLM analyses, workspace archives, private notes)
.local/

# Claude Code
.claude/
CLAUDE.local.md

# Agent data
*.sqlite
data/
17 changes: 17 additions & 0 deletions agent-001-registry-reviewer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Regen LCD endpoint (Cosmos REST)
REGEN_LCD_URL=https://regen.api.chandrastation.com

# Anthropic API key (required)
ANTHROPIC_API_KEY=sk-ant-...

# Model (default: claude-sonnet-4-5-20250929)
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929

# Discord webhook for output (optional)
DISCORD_WEBHOOK_URL=

# KOI MCP endpoint (optional, for future knowledge graph integration)
KOI_MCP_URL=

# Polling interval in seconds (default: 300 = 5 minutes)
POLL_INTERVAL_SECONDS=300
Loading