Skip to content

Commit 72d75fd

Browse files
martex-devclaude
andcommitted
M0: the platform
Aurelis is a corporation of AI agents that researches markets. This is the foundation the company will run on -- persistence, an auditable record, budgets, work dispatch, scheduling and model access -- plus the CLI that proves it works end to end. No agents, departments or meetings yet. Those start at M1. What M0 ships ------------- core/ identity (UUIDv7 keys + human reference codes), an injected clock, canonical encoding, configuration, shared vocabularies platform/ schema and invariant triggers, the hash-chained event ledger, the content-addressed artifact store, hierarchical budgets, the durable task queue, the scheduler, model access cli/ aurelis db init | doctor | ledger verify | ledger tail | demo Four decisions worth stating ---------------------------- Invariants are database triggers, not conventions. UPDATE and DELETE are refused on events, artifacts, cost_entries and model_calls, and the tests assert it through raw SQL rather than through the ORM. A record is only auditable if it is auditable by someone who does not trust the code that wrote it. The rule caught its own author during this milestone: the ledger originally inserted an event and then updated its chain hash, which its own trigger correctly refused. Sequence numbers are now allocated before the insert so the row arrives complete. The ledger is tamper-evident, not tamper-proof, and says so. Editing a payload, rewriting an actor, deleting a middle event, truncating the leading events, or forging one event's hash and leaving its successor's prev_hash stale are all detected at a named sequence number. Anyone with database access can still alter it; they cannot do so unnoticed. Tests cover all five attacks. Floats cannot enter a hash. canonical_json refuses them outright. 0.1 + 0.2 does not round-trip and platform repr has changed across releases, so a metric that hashed differently on two machines would destroy the only mechanism that makes a result citable. Money and metrics are Decimal. The whole system runs free. The mock provider is offline and deterministic, every test and all of CI use it, and switching to the Claude subscription or a metered API is a config change. Money and tokens are budgeted separately because they are separately scarce -- under a subscription the dollar figure is zero and the token allowance binds. Budgets are checked at dispatch and a refusal names the innermost level that bound it, so the message says which knob to turn. Acceptance ---------- aurelis db init && aurelis doctor && aurelis demo demo runs a scripted exchange end to end: budget checked at dispatch, tasks queued and claimed, model calls recorded, outputs stored as content-addressed artifacts, every step chained, chain verified afterwards. The second round is identical to the first and is served entirely from cache -- asserted, because it is the most important cost property in the system. 137 tests, ruff clean, mypy strict, CI on Linux and Windows across 3.12/3.13. Alembic is deliberately absent. Schema changes use create_all until the schema first has to change under a live workspace; a migration tool with one revision and no history is ceremony. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 parents  commit 72d75fd

71 files changed

Lines changed: 12103 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.png binary
3+
*.jpg binary

‎.github/workflows/ci.yml‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, windows-latest]
20+
python-version: ["3.12", "3.13"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: astral-sh/setup-uv@v5
26+
with:
27+
enable-cache: true
28+
29+
- name: Install
30+
run: uv pip install --system -e ".[dev]"
31+
32+
- name: Lint
33+
run: ruff check .
34+
35+
- name: Type check
36+
run: mypy
37+
38+
# The whole suite runs against the mock provider: no credentials, no
39+
# network, no cost. That is a deliberate property of the architecture —
40+
# a company of a hundred agents has to be free to test.
41+
- name: Test
42+
run: pytest -q
43+
44+
- name: End-to-end acceptance
45+
shell: bash
46+
run: |
47+
mkdir -p /tmp/aurelis-ci
48+
aurelis db init -w /tmp/aurelis-ci
49+
aurelis doctor -w /tmp/aurelis-ci
50+
aurelis demo -w /tmp/aurelis-ci
51+
aurelis ledger verify -w /tmp/aurelis-ci

‎.gitignore‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
__pycache__/
2+
*.py[cod]
3+
.venv/
4+
venv/
5+
*.egg-info/
6+
dist/
7+
build/
8+
.pytest_cache/
9+
.ruff_cache/
10+
.mypy_cache/
11+
.coverage
12+
htmlcov/
13+
14+
# Aurelis runtime state — never committed
15+
aurelis.db
16+
*.db
17+
*.db-journal
18+
*.db-wal
19+
*.db-shm
20+
objects/
21+
var/
22+
site/
23+
24+
# Secrets
25+
.env
26+
.env.*
27+
!.env.example
28+
*.key
29+
*.pem
30+
secrets/
31+
32+
# Editors / OS
33+
.vscode/
34+
.idea/
35+
.DS_Store
36+
Thumbs.db

0 commit comments

Comments
 (0)