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
4 changes: 2 additions & 2 deletions .github/actions/setup-ci-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ runs:
steps:
- name: Set up Python
if: inputs.python-version != ''
uses: actions/setup-python@v6
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ inputs.python-version }}

- name: Cache Python virtualenv
if: inputs.python-version != '' && inputs.python-packages != ''
uses: actions/cache@v6
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: .venv/ci
key: ${{ runner.os }}-py${{ inputs.python-version }}-venv-${{ hashFiles('.github/actions/setup-ci-tools/action.yml', '.github/workflows/*.yml') }}
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.11", "3.14"]
include:
- os: ubuntu-latest
python: "3.12"
- os: ubuntu-latest
python: "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
version: "0.12.17"
python-version: ${{ matrix.python }}
enable-cache: true
- run: make ci
- name: Report equivalent-work and total adoption overhead
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
run: make benchmark
collector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
version: "0.12.17"
python-version: "3.11"
- run: make dev
- run: docker compose -f examples/demo/compose.yaml up -d
- name: Wait for collector and verify both sessions
run: |
for _ in $(seq 1 30); do
if curl --silent --output /dev/null http://127.0.0.1:4319/v1/traces; then break; fi
sleep 1
done
uv run --locked python scripts/demo_session.py --collector http://127.0.0.1:4319/v1/traces --watch-host 0.0.0.0 --watch-port 4318
- if: always()
run: docker compose -f examples/demo/compose.yaml logs
- if: always()
run: docker compose -f examples/demo/compose.yaml down
71 changes: 71 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Publish Python package
on:
workflow_dispatch:
inputs:
tag:
description: Existing validated release tag (for example v0.1.0)
required: true
type: string
registry:
description: Destination with a configured trusted publisher
required: true
default: testpypi
type: choice
options: [testpypi, pypi]
permissions:
contents: read
concurrency:
group: publish-${{ inputs.registry }}
cancel-in-progress: false
jobs:
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Validate tag input
env:
RELEASE_TAG: ${{ inputs.tag }}
run: '[[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]'
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
- name: Verify release provenance and version
env:
RELEASE_TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
test "$RELEASE_TAG" = "v$(cat VERSION)"
git merge-base --is-ancestor HEAD origin/main
test "$(gh release view "$RELEASE_TAG" --json isDraft --jq .isDraft)" = false
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
version: "0.12.17"
python-version: "3.11"
- run: make ci
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: python-distributions
path: dist/
if-no-files-found: error
retention-days: 7
publish:
needs: build
runs-on: ubuntu-latest
environment: ${{ inputs.registry }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: python-distributions
path: dist/
- name: Publish to TestPyPI
if: inputs.registry == 'testpypi'
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: inputs.registry == 'pypi'
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
65 changes: 29 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,51 @@
name: Release

# Merge-side release: on push to main, if VERSION has no matching v* tag yet,
# create the annotated tag and publish a GitHub Release with auto-assembled notes.
#
# Hardening: every action is pinned to an immutable commit SHA (tag in a trailing
# comment), not a movable @vN tag.

on:
push:
branches: [main]
paths:
- "VERSION"
- "CHANGELOG.md"

paths: [VERSION, CHANGELOG.md]
workflow_dispatch:
permissions:
contents: write

contents: read
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up cached CI tools
uses: ./.github/actions/setup-ci-tools

- name: Tag & release when VERSION has no tag
- uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
with:
version: "0.12.17"
python-version: "3.11"
- name: Validate and build before tagging
run: make ci
- name: Tag and publish validated GitHub artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name "github-actions[bot]"
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

ver="$(tr -d '[:space:]' < VERSION)"
[ -n "$ver" ] || { echo "::error::VERSION is empty"; exit 1; }
[[ "$ver" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo 'Invalid VERSION'; exit 1; }
tag="v$ver"

if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then
echo "$tag already exists — nothing to release."
exit 0
fi

prev="$(git tag --list 'v*' | sort -V | tail -1)"
echo "Releasing $tag (previous: ${prev:-none})"
if [ -n "$prev" ]; then
python3 release/_lib/release_notes.py "$ver" --prev-tag "$prev" > notes.md
if gh release view "$tag" >/dev/null 2>&1; then
echo "$tag already released"
exit 0
fi
test "$(git rev-list -n 1 "$tag")" = "$GITHUB_SHA" || { echo 'Existing tag does not identify this build'; exit 1; }
else
python3 release/_lib/release_notes.py "$ver" > notes.md
uv run --locked python release/_lib/version_check.py --strict
git tag -a "$tag" -m "$tag"
git push origin "$tag"
fi

git tag -a "$tag" -m "v$ver"
git push origin "$tag"
gh release create "$tag" --title "v$ver" --notes-file notes.md
echo "::notice::Released $tag"
uv run --locked python release/_lib/release_notes.py "$ver" > notes.md
gh release create "$tag" --verify-tag --prerelease --title "$tag (alpha)" --notes-file notes.md dist/*
2 changes: 1 addition & 1 deletion .github/workflows/version-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
set -e

- name: Post guard result
if: steps.changed.outputs.changed == 'true' && always()
if: steps.changed.outputs.changed == 'true' && always() && github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ENV/
.claude/settings.local.json
.cursor/settings.local.json
.mcp.local.json
.melampus/

# macOS
.DS_Store
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: uv run --locked ruff check --fix --exit-non-zero-on-fix
language: system
types: [python]
- id: ruff-format
name: ruff format
entry: uv run --locked ruff format
language: system
types: [python]
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.0] - 2026-09-28

### Added

- Local AI coding-session supervisor, reviewed SDK Contract objects, fresh-process
scenario execution, required-check coverage, and revision-bound repair evidence.
- Agent-neutral gate and synchronous Claude Code hooks that restrict progression
and completion during drift/incomplete evidence while permitting scoped repair.
- Runnable generation/drift/repair example and setup guide; local coding is the
first-release focus, with broader service monitoring reserved for expansion.
- Experimental `code_artifact` schema, generated constants and compatibility fixtures.
- OTel API-only `instrumented` decorator for synchronous and async functions.
- Hash-only declarations, predicate results, deterministic check sampling, shared
per-process execution limits, and runtime path disabling.
- Optional OTLP/HTTP protobuf watcher with finite sessions, bounded ingestion,
duplicate suppression and explicit incomplete-evidence exit codes.
- Direct and stock collector demos, test suite, typing, package checks, CI, and
separate Trusted Publishing workflow for TestPyPI/PyPI.
- Apache-2.0 license, quickstart, contribution and release documentation.

### Known limitations

- Alpha wire/API stability; no content capture, gRPC/JSON receiver, or durable backend.
- Local sessions support macOS/Linux and reviewed executable claims on exercised
inputs; they do not infer arbitrary intent or detect all generated-code defects.
- The founding spec's <3% overhead target remains unmet; see docs/RELEASE.md.

## [0.0.0] - 2026-08-22

### Added
Expand Down
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing

Use Python 3.11+ and uv. Work on a branch in a dedicated worktree; see CLAUDE.md.

```sh
uv sync --locked --all-extras
uv run --locked pre-commit install
make ci
```

`make format` changes formatting; `make lint` is read-only. `uv.lock` pins developer
tools; CI runs the same Make targets. Run `make test` for a focused functional check,
`make cov` for coverage, and `make benchmark` for overhead measurements.
`make demo` exercises the local coding-session protocol and repair cycle without
an LLM request; `make demo-otlp` exercises the optional tracing foundation.
Subprocess coverage is enabled so disposable scenario runners are measured too.

Wire names originate in `semconv/code_artifact.yaml`. After a reviewed wire change:

```sh
uv run --locked python scripts/generate_semconv.py
make semconv
```

The generator validates against the vendored upstream Weaver JSON Schema and
checks generated names/docs. Update fixtures and both producer/consumer tests.
Do not add raw data to telemetry or interpret suppressed checks as passes.

Pull requests should explain the behavior change and show relevant verification.
Add regression tests for bugs and exercise the installed wheel for packaging changes.
Keep source compatibility for sync/async calls and avoid configuring global OTel
providers or exporters inside the library. Licensing follows Apache-2.0.

Version changes go through VERSION and CHANGELOG.md. Never create release tags
manually; see [release operations](docs/RELEASE.md).
Loading
Loading