Skip to content

Commit b627f85

Browse files
committed
feat: initial commit — agentic-contract sister repo
4-crate Rust workspace (core, MCP, CLI, FFI), Python bindings, npm/WASM package, paper, canonical docs, CI/CD workflows, and full sister kit compliance.
0 parents  commit b627f85

99 files changed

Lines changed: 19860 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Canonical Sister Guardrails
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
guardrails:
11+
name: Canonical Sister Checks
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Clone agentic-sdk (sibling dependency)
16+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
17+
- uses: dtolnay/rust-toolchain@stable
18+
- name: Run canonical sister guardrails
19+
run: bash scripts/check-canonical-sister.sh

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUSTFLAGS: -D warnings
12+
13+
jobs:
14+
rust:
15+
name: Rust (${{ matrix.os }})
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Clone agentic-sdk (sibling dependency)
23+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
24+
- uses: dtolnay/rust-toolchain@stable
25+
with:
26+
components: clippy, rustfmt
27+
- uses: Swatinem/rust-cache@v2
28+
29+
- name: Check formatting
30+
run: cargo fmt --all -- --check
31+
32+
- name: Clippy
33+
run: cargo clippy --workspace --all-targets -- -D warnings
34+
35+
- name: Test
36+
run: cargo test --workspace
37+
38+
- name: Build release
39+
run: cargo build --workspace --release
40+
41+
python-sdk-tests:
42+
name: Python SDK Tests
43+
runs-on: ${{ matrix.os }}
44+
strategy:
45+
matrix:
46+
os: [ubuntu-latest, macos-latest]
47+
python-version: ["3.10", "3.11", "3.12"]
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Clone agentic-sdk (sibling dependency)
51+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
52+
53+
- name: Install Rust (for acon binary)
54+
uses: dtolnay/rust-toolchain@stable
55+
56+
- name: Build acon binary
57+
run: cargo build --release
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: ${{ matrix.python-version }}
63+
64+
- name: Install Python SDK
65+
working-directory: python
66+
run: |
67+
pip install ".[dev]"
68+
69+
- name: Run Python SDK tests
70+
working-directory: python
71+
run: |
72+
PATH="${GITHUB_WORKSPACE}/target/release:$PATH" pytest tests/ -v --cov=agentic_contract
73+
74+
guardrails:
75+
name: Guardrails
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- name: Clone agentic-sdk (sibling dependency)
80+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
81+
- name: Install command guardrails
82+
run: bash scripts/check-install-commands.sh
83+
- name: Canonical sister guardrails
84+
run: bash scripts/check-canonical-sister.sh
85+
- name: Runtime hardening guardrails
86+
run: bash scripts/check-runtime-hardening.sh
87+
- name: Primary problem regression
88+
run: bash scripts/test-primary-problems.sh
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Install Command Guardrails
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- scripts/install.sh
8+
- .github/workflows/install-command-guardrails.yml
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- scripts/install.sh
13+
- .github/workflows/install-command-guardrails.yml
14+
15+
jobs:
16+
guardrails:
17+
name: Install Command Checks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Run install command guardrails
22+
run: bash scripts/check-install-commands.sh
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Primary Problem Regression
2+
3+
on:
4+
push:
5+
paths:
6+
- "scripts/test-primary-problems.sh"
7+
- "docs/public/primary-problem-coverage.md"
8+
- "docs/public/initial-problem-coverage.md"
9+
- "crates/**"
10+
- "Cargo.toml"
11+
- "Cargo.lock"
12+
- ".github/workflows/primary-problem-regression.yml"
13+
pull_request:
14+
paths:
15+
- "scripts/test-primary-problems.sh"
16+
- "docs/public/primary-problem-coverage.md"
17+
- "docs/public/initial-problem-coverage.md"
18+
- "crates/**"
19+
- "Cargo.toml"
20+
- "Cargo.lock"
21+
- ".github/workflows/primary-problem-regression.yml"
22+
23+
jobs:
24+
validate-primary-problems:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Clone agentic-sdk (sibling dependency)
29+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
30+
- uses: dtolnay/rust-toolchain@stable
31+
- uses: Swatinem/rust-cache@v2
32+
- name: Run primary-problem regression
33+
run: ./scripts/test-primary-problems.sh

.github/workflows/release.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
name: Build (${{ matrix.target }})
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
target: x86_64-unknown-linux-gnu
22+
artifact_name: agentic-contract-mcp
23+
- os: ubuntu-latest
24+
target: aarch64-unknown-linux-gnu
25+
artifact_name: agentic-contract-mcp
26+
- os: macos-latest
27+
target: x86_64-apple-darwin
28+
artifact_name: agentic-contract-mcp
29+
- os: macos-latest
30+
target: aarch64-apple-darwin
31+
artifact_name: agentic-contract-mcp
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Clone agentic-sdk (sibling dependency)
35+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
36+
- uses: dtolnay/rust-toolchain@stable
37+
with:
38+
targets: ${{ matrix.target }}
39+
40+
- name: Install cross-compilation tools
41+
if: matrix.target == 'aarch64-unknown-linux-gnu'
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y gcc-aarch64-linux-gnu
45+
46+
- name: Build
47+
run: cargo build --release --target ${{ matrix.target }}
48+
env:
49+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
50+
51+
- name: Package
52+
run: |
53+
cd target/${{ matrix.target }}/release
54+
tar czf ../../../${{ matrix.artifact_name }}-${{ matrix.target }}.tar.gz ${{ matrix.artifact_name }} acon
55+
continue-on-error: false
56+
57+
- name: Upload artifacts
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: ${{ matrix.artifact_name }}-${{ matrix.target }}
61+
path: "*.tar.gz"
62+
63+
release:
64+
name: Publish Release
65+
needs: build
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- uses: actions/download-artifact@v4
70+
with:
71+
merge-multiple: true
72+
- name: Create Release
73+
uses: softprops/action-gh-release@v2
74+
with:
75+
files: "*.tar.gz"
76+
generate_release_notes: true
77+
78+
publish-crate:
79+
name: Publish to crates.io (core + ffi + mcp + cli)
80+
needs: release
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v4
84+
- name: Clone agentic-sdk (sibling dependency)
85+
run: git clone --depth 1 https://github.com/agentralabs/agentic-sdk.git ../agentic-sdk
86+
- uses: dtolnay/rust-toolchain@stable
87+
- name: Publish crates in canonical order
88+
shell: bash
89+
run: |
90+
set -euo pipefail
91+
92+
publish_crate() {
93+
local pkg="$1"
94+
local retries="${2:-12}"
95+
local attempt
96+
local output
97+
98+
for attempt in $(seq 1 "$retries"); do
99+
echo "Publish attempt ${attempt}/${retries} for ${pkg}..."
100+
if output="$(cargo publish -p "${pkg}" --token "${{ secrets.CARGO_REGISTRY_TOKEN }}" 2>&1)"; then
101+
echo "$output"
102+
return 0
103+
fi
104+
105+
echo "$output"
106+
if echo "$output" | grep -Eqi "already uploaded|already exists on crates\\.io index"; then
107+
echo "${pkg} already published for this version; continuing."
108+
return 0
109+
fi
110+
if echo "$output" | grep -Eqi "failed to select a version for the requirement|no matching package named|could not find .* in registry"; then
111+
echo "Dependency index propagation not ready yet; waiting before retry..."
112+
sleep 20
113+
continue
114+
fi
115+
return 1
116+
done
117+
118+
echo "Timed out waiting for crates.io index propagation for ${pkg}."
119+
return 1
120+
}
121+
122+
publish_crate "agentic-contract"
123+
publish_crate "agentic-contract-ffi"
124+
publish_crate "agentic-contract-mcp"
125+
publish_crate "agentic-contract-cli"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Runtime Hardening Guardrails
2+
3+
on:
4+
push:
5+
paths:
6+
- "scripts/install.sh"
7+
- "scripts/check-runtime-hardening.sh"
8+
- "docs/ecosystem/CANONICAL_SISTER_KIT.md"
9+
- "docs/public/ecosystem/CANONICAL_SISTER_KIT.md"
10+
- "crates/**"
11+
- "Cargo.toml"
12+
- "Cargo.lock"
13+
- ".github/workflows/runtime-hardening-guardrails.yml"
14+
pull_request:
15+
paths:
16+
- "scripts/install.sh"
17+
- "scripts/check-runtime-hardening.sh"
18+
- "docs/ecosystem/CANONICAL_SISTER_KIT.md"
19+
- "docs/public/ecosystem/CANONICAL_SISTER_KIT.md"
20+
- "crates/**"
21+
- "Cargo.toml"
22+
- "Cargo.lock"
23+
- ".github/workflows/runtime-hardening-guardrails.yml"
24+
25+
jobs:
26+
validate-runtime-hardening:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Runtime hardening guardrails
31+
run: ./scripts/check-runtime-hardening.sh

0 commit comments

Comments
 (0)