Skip to main content

Curvature

The right path is free fall.

gate PyPI Python Coverage floor License

Spiral is project spacetime

Spiral is on by default. Every directory is a local body: its substantial source files occupy surface, and the surface-to-volume law determines how much room a healthy leaf has to grow.

For a sphere of radius r,

$$ A(r)=4\pi r^2,\qquad V(r)=\frac{4}{3}\pi r^3,\qquad \frac{V(r)}{A(r)}=\frac{r}{3}. $$

Curvature normalizes each direct source file f by its language's base ceiling B_τ(f), then measures the occupied surface of directory D:

$$ m_f=\frac{\mathrm{lines}(f)}{B_{\tau(f)}},\qquad A_D=\sum_{f\in\mathrm{direct}(D)}\min(1,m_f),\qquad R_D=\max(1,\sqrt{A_D}). $$

The effective ceiling is the ratcheted base multiplied by that local radius:

$$ C_f=\mathrm{round}(B_fR_D). $$

A lone Python leaf therefore begins at 300 lines and cannot buy room by becoming oversized. Two substantial neighboring leaves have radius √2 and a 424-line Python ceiling; three have 520, five have 671, and eight have 849. Child directories form their own bodies, so distant project mass cannot inflate a local file. At thirteen meaningful neighbors the twelve-neighbor coordination bound fires and the directory must branch. The gate also prunes hollow branches that retain only cache archaeology or missing tracked leaves. The derivation and adoption controls live in The Spiral law.

A web framework for code that agents maintain. Live, dynamic web apps in pure Python — single-page feel, pages that update themselves in real time, zero ordinary application JavaScript — and a gate that makes the maintainable path the only path that builds. (Not a static-site generator: state lives on the server, and open pages stay current over a live stream.)

Curvature's design center is the maintainer nobody watches: the coding agent in its forty-third session, at 2 a.m., doing whatever the shape of the code suggests. Frameworks built for humans enforce their discipline through culture. Curvature's discipline is machine-checked — every invariant in SPEC.md names the check that enforces it, and violations are reported by curvature check as anomalies — regions where the geometry failed to steer. The canonical documentation is AGENTS.md; this README is the courtesy translation. The argument for all of it is the MANIFESTO.

The shape of it

from curvature import Element, Props, redirect, respond
from curvature import html as h


class LapProps(Props):
    title: str
    done: bool


def lap(props: LapProps) -> Element:
    return h.li(props.title, class_="lap done" if props.done else "lap", id="lap")
  • Components are functions of frozen, closed pydantic props. The UI is just Python: typed by pyright, measured by coverage, tested by pytest without a browser in sight.
  • The ordinary app works with JavaScript off. Reads render full pages; writes are POST → redirect → GET through real forms. Your test suite drives it with httpx — which executes no JS — so the degraded path is the tested path, permanently. An Event Horizon is an explicit exception for behavior that cannot tolerate a round trip; it does not replace this baseline.
  • Pages keep themselves current. Live (SSE) pushes updates into every open browser by swapping server-rendered fragments declared by the application, with zero ordinary application JavaScript.
  • The client layer is closed and chartered. curvature.js remains the stable, sole consumer-facing include. It boosts working links and GET forms into fragment swaps; its package-owned live.js branch manages only server-declared EventSource streams. Mutating forms stay native, native submitter overrides remain native semantics, and enhanced submissions expose aria-busy and data-curvature-pending while intent is in flight. Same-page fragment links and their history stay browser-native; cross-page boosts preserve and scroll to their fragment after swapping. Ordinary applications write no JavaScript. A product-owned Event Horizon may write only the exact entrypoint allowed by a valid Curvature manifest; see Event Horizons.
  • The ratchet only tightens; healthy trees Spiral. Base file ceilings fall, the coverage floor rises, and curvature ratchet is the only hand on the mechanism. Local occupied surface lets related leaves grow by radius, while a twelve-neighbor coordination bound keeps branches navigable. The 10,000-line dumping ground and the 160-file trunk remain anomalies.

Drafting belongs to native controls: text, selection, and open details stay in the browser while the operator edits. Server-derived or persisted state earns a round trip and an identified fragment replacement. Pending attributes bridge those two moments without pretending the server has already accepted anything.

Event Horizons are exceptional enclaves for latency-critical product behavior, not a second general-purpose application runtime. Their manifest is a second charter registry under the same Curvature law: the schema fixes the available capabilities, the gate checks the fence, and consumer tests keep the server contract and JavaScript-off path honest.

Start from nothing

One prerequisite, one line (uv):

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Then:

uvx curvature new app pitstop     # no venv, no Python even — uv brings it
cd pitstop
./gate.sh                      # green before you write a line
./run.sh                       # http://127.0.0.1:8000

Only have pip? pip install curvature && python -m curvature new app pitstop — the python -m form dodges PATH entirely; the poured README carries the rest of the old ritual.

Onboarding an agent takes zero steps: the scaffold poured AGENTS.md, the gate, and one example component as the pattern. Point your agent at the directory and ask for a feature — the repo is the prompt.

Develop the framework

The repository is the framework itself. Clone it, sync the locked development environment, and run the same gate CI runs:

git clone https://github.com/siliconsociety/Curvature && cd Curvature
uv sync && ./gate.sh

Updating an app

Curvature has two ownership classes. The installed package owns the runtime, including curvature.js, live.js, response helpers, and the gate. Update that runtime deliberately, review the lockfile, and run the app's gate:

uv lock --upgrade-package curvature
uv sync
./gate.sh

The app owns everything the scaffold or a satellite pour copied into its repository. Package upgrades never overwrite those files. When a release requires an app-source migration, its upgrade note names the files and the owner applies the diff like any other code change. See docs/UPGRADING.md for the complete contract and release-specific notes; Event Horizon consumers should also read docs/EVENT_HORIZONS.md.

Status

Alpha. The contract, runtime, gate, browser-level boost tests, and a fresh-pour Auth integration suite are real and exercised by the repository's test and package proofs. Production readiness is earned by the gate and deployment checks, not asserted by the version label. The spec is versioned and arguable; argue by issue.

MIT.

Metadata

Release files for curvature 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curvature 0.4.4
File Size Uploaded
curvature-0.4.4.tar.gz 58.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curvature 0.4.4
File Interpreter ABI Platform
curvature-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 140.0 kB

Release files / curvature-0.4.4.tar.gz

Download URL curvature-0.4.4.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f41362c4dd70d3007633a1e592c854b7c7a0f73ef10493aa69f7b4c42cc0028e
BLAKE2b-256 checksum
How to use checksums
b1c860a2330fb94d7808d27d7cc37aff9c09db5d0c15cd092c42b9420a97928a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / curvature-0.4.4-py3-none-any.whl

Download URL curvature-0.4.4-py3-none-any.whl
Size 81.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81a51a69257d629287ffb34b2c6bec85950bf6ae0a4ecc0402f70a0247ca3e82
BLAKE2b-256 checksum
How to use checksums
c6abab75ac537574e8f5b777fade02d4cf32dd82c7d6d9b64e2f2f8358413c4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.1

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page