Skip to content

Pareto#89

Merged
langdal merged 14 commits into
mainfrom
pareto
May 30, 2026
Merged

Pareto#89
langdal merged 14 commits into
mainfrom
pareto

Conversation

@langdal

@langdal langdal commented May 30, 2026

Copy link
Copy Markdown
Member

No description provided.

langdal and others added 11 commits May 30, 2026 10:29
Replace requirements*.txt with a standard pyproject.toml, target Python
3.13 (matching Pyodide 0.29.x), and add mise.toml plus uv-based dev loop.
Updates Dockerfile, pytest.ini, and .gitignore accordingly.
…le-plot emission

Add ProcessOptimizer-backed multi-objective optimization with pareto
plots and per-dimension JSON single plots, and extract plot emission into
a dedicated plot_emitters module. Includes the optimizer refactors that
split process_result into focused helpers.
Add the pickled_state module with request fingerprinting and
pack/unpack-if-valid round-trip, wire the handler to consume a pickled
model cache (surfacing pickledUsed) and a selectedPoint override with
fall-through warnings, and document both in the OpenAPI extras schema.
Use secrets.compare_digest for API-key comparison, stop logging raw
access tokens to stdout, and refuse the default AUTH_API_KEY='none' in
production.
Replace print() with central logging configuration, and add a types
module with TypedDicts for the request, response, and cache payloads
behind a permissive mypy baseline.
Add an end-to-end pareto HTTP suite plus unit coverage for auth,
pickled_state, plot_emitters, and types; introduce a conftest with a
stable PICKLE_KEY; enforce no print() under optimizerapi/; expand the
optimizer tests; and add sample curl scripts. Drops the dead
tests/context.py module.
Add AGENTS.md (with CLAUDE.md pointing to it) as the canonical setup,
workflow, and style reference; add an end-to-end API usage guide and
current-context handoff notes; refresh the README; and capture the
5-phase audit and pareto-extras redesign plans/spec under docs/.
Establish ADRs under docs/adr/ as the only durable design doc kept on
main, and add a vendor-neutral branch-finalize workflow.

- docs/adr/: Nygard-style template, index/README, and two records — 0001
  (pickled model as an advisory, fingerprint-validated cache hint, distilled
  from the pareto-extras redesign) and 0002 (the ADR / branch-only
  agent-docs convention itself, with the alternatives weighed).
- AGENTS.md: vendor-neutral 'Decisions and finishing a branch' section —
  ADR policy plus the advisory branch-finalize flow (distil a decision into
  an ADR, keep plans/specs through review, remove them in a cleanup commit
  before merge). Surfaced by the agent, not mechanically enforced.
- CLAUDE.md: points at the finish-branch skill and the new AGENTS section.
- .claude/skills/finish-branch: encodes the flow, adapted to this repo's
  pytest/flake8/mypy checks; .gitignore narrowed to track skills while
  keeping local Claude settings ignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The workflow pinned Python 3.9 and installed deps from requirements-freeze.txt,
which the pyproject migration removed — so runtime deps (rq, cryptography,
numpy, ProcessOptimizer) never installed and optimizerapi/types.py failed to
import (NotRequired needs 3.11+). Replace setup-python with jdx/mise-action so
CI provisions the same Python 3.13 + uv as local dev (mise.toml) and installs
the project via 'uv pip install -e .[dev]'. Add a mypy step (now matches the
AGENTS.md claim) and a .flake8 config excluding the local .venv/env so
'flake8 .' lints only project sources in CI and locally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The image still targeted python:3.9-bullseye while pyproject now requires
>=3.13, and the builder copied only pyproject.toml — so 'pip install .' could
neither run on 3.9 nor build the project (setuptools needs README.md and the
optimizerapi/ source). Rebuild the Dockerfile on python:3.13-slim-bookworm,
install with uv (matching dev/CI), and copy the metadata + source the build
actually needs, with a uv cache mount so the ProcessOptimizer git dependency
isn't re-fetched each build.

Workflow: build linux/amd64 only (arm64 was emulated under QEMU and dominated
build time), add GHA layer caching (cache-from/to: type=gha), and bump the
docker/* and checkout actions to current major versions. Add a .dockerignore
so the local .venv (multi-GB) and other cruft stay out of the build context.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
torch arrives transitively via ProcessOptimizer and, from PyPI, drags in the
full NVIDIA CUDA stack (~5 GB: cublas, cudnn, nccl, cusolver, ...). The API
only does CPU inference, so this was pure build-time and image-size cost.

Pin torch to PyTorch's CPU index via [tool.uv.index] + [tool.uv.sources].
uv source pins apply only to *direct* dependencies, so torch is also declared
explicitly in [project.dependencies]. Resolution now yields torch==2.12.0+cpu
with zero CUDA packages (88 -> 69 packages).

Verified by building the image and booting it: GET /v1.0/health -> 200,
/v1.0/ui/ -> 200, image 1.42 GB (was ~6 GB+), torch-2.12.0+cpu installed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
langdal and others added 3 commits May 30, 2026 20:23
current-context.md was a temporary design-checkpoint handoff (2026-05-18)
that self-documented 'Delete after the brainstorm produces an updated plan'.
That brainstorm happened (docs/superpowers/.../pareto-extras-redesign*), the
work landed, and the durable decision is now captured in ADR 0001. The doc
also referenced things that no longer exist (.sisyphus/, result.json) and
stale facts (29 tests, untracked CLAUDE.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per the ADR convention (ADR 0002 / AGENTS.md), agent-generated plans and specs
are branch-only working artifacts kept through review and removed before merge.
The durable decision from the pareto-extras redesign is captured in ADR 0001;
the 5-phase audit plans' outcomes live in the code and commit history. Content
remains recoverable from git history.

Removed:
- docs/superpowers/plans/2026-05-18-audit-{overview,phase-1..5}.md
- docs/superpowers/plans/2026-05-18-pareto-extras-redesign.md
- docs/superpowers/specs/2026-05-18-pareto-extras-redesign-design.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@langdal
langdal merged commit 9df9ab5 into main May 30, 2026
2 checks passed
@langdal
langdal deleted the pareto branch May 30, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant