15 Commits

Author SHA1 Message Date
687ee01d5b fix(gateway): reject Transfer-Encoding requests instead of silently dropping the body
read_request() in the Rust gateway's HTTP transport only ever looked at
Content-Length to size the request body. A chunked request (Transfer-Encoding:
chunked, no Content-Length) made content_length default to 0, so the body was
silently truncated to empty and forwarded to the backend while the real chunked
bytes were left unread on the connection — desynchronizing the next request
parsed from that same socket (request smuggling), or just silently dropping a
real client's upload with no error at all.

The sibling Python prototype (lawsynth_gateway/app.py) already rejects any
Transfer-Encoding header with 400 unsupported_transfer_encoding; the Rust
rewrite dropped that check. Add it back as a new ReadOutcome variant handled
in server.rs, with a regression test.
2026-10-20 18:32:59 +03:00
ac68067b17 fix(release): correct crates.io repository URL and gate internal crates from publish
The workspace repository metadata pointed at a 404 (lawsynth/lawsynth instead
of caelum0x/lawsynth). RELEASE.md documents 12 crates plus all services/apps
as explicitly internal for v0.1 (not part of the published surface), but only
lawsynth-integration actually carried `publish = false` — add the missing
flag to the other 16 internal crates/services/apps so a future `cargo
publish` run can't accidentally ship them.

Also fix the two cargo clippy -D warnings failures blocking CI on main since
the 2026-10-12 release-cut merge: lawsynth-information-diffusion's forecast()
needlessly indexes `totals` by a range-loop variable (needless_range_loop)
and exceeds clippy's argument-count lint (too_many_arguments, same pattern
already used elsewhere in the workspace for fixed simulation-contract
surfaces). Verified: cargo fmt --check, cargo clippy --workspace --all-targets
-- -D warnings, and cargo test --workspace (388 suites, 0 failures) all pass
clean; cargo build --locked --release -p lawsynth-cli succeeds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-15 16:53:00 +03:00
7a06febeb6 chore(release): inherit repository metadata on all crates
Crates inherited version/license/edition from [workspace.package] but not
`repository`, so every crate published without a repository link. Add
`repository.workspace = true` uniformly, completing the
description+version+license+repository metadata `cargo publish` and crates.io
expect. No build impact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:08:47 +03:00
fb38900c67 chore(release): add version to internal path deps for publishability
Every intra-workspace dependency was declared path-only
(`{ path = "../lawsynth-X" }`), which makes `cargo publish` fail with
"all dependencies must have a version specified when publishing". Add the
uniform workspace version (`version = "0.1.0"`) alongside each `lawsynth-*`
path dep across all workspace members so each crate can be published with a
single `cargo publish`. Path is retained, so local offline builds are
unchanged (cargo prefers the path for workspace builds); this only supplies
the version metadata the registry requires. Publishing itself stays owner-
gated via release-plz (publish=false).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:06:43 +03:00
e3068ed15c feat: MPC + forecast uncertainty + CLI analysis commands + platform analysis job
Batch 9 of expansion-v2. Makes the analysis layer user-reachable, adds two
model-use capabilities, and threads an analysis job through the hosted platform.
Deterministic/offline/std-only.

crates/lawsynth-mpc (new): successive-linearization LQR-MPC. Relinearizes each
step (analytic A=∂f/∂x, B=∂f/∂u), solves a local LQR (lawsynth-feedback),
applies the first clamped move, advances the nonlinear plant by RK4. Regulates a
forced pendulum to <1e-3, respects saturation, stabilizes a Van der Pol limit
cycle; per-step gain bit-identical to direct LQR on a linear plant. Honest that
it's LQR-MPC, not constrained QP-MPC. 18 tests.

crates/lawsynth-propagate (new): coefficient→forecast uncertainty. Delta method
Cov(x(t))≈S·Cov(θ)·Sᵀ via forward sensitivities, plus seeded Monte-Carlo over the
bootstrap ensemble. Delta matches the (t·x0·e^-θt)²·s² closed form to <1e-9;
delta≈MC at small σ and honestly diverges (asymmetric MC band) at large σ.
covariance_from_ensemble closes the bootstrap→bands pipeline. 34 tests.

crates/lawsynth-cli: new analysis subcommands bifurcation/sensitivity/estimate/
reduce (shared linearize-at-fixed-point helper derives A/C/B from a world), with
honest guardrails (bifurcation needs a parameterized law; reduce needs a Hurwitz
point; estimate pole placement is single-output). 115 lib + 7 integration tests.

services/worker + scheduler: Job::AnalyzeStability + JobOutput::Stability threaded
through every worker match site (job/execute/artifacts/errors/http_error) and
proven first-class in the scheduler via an end-to-end submit→lease→execute test.
Gateway HTTP→Job decode noted as an honest follow-up. Worker 64 + scheduler tests.

specs/{model-predictive-control,forecast-uncertainty}: boundary specs.
2026-08-18 16:58:56 +03:00
12af3b956c feat(P6/P7): collaboration workspaces + streaming online discovery
Completing the next-phase specs (P6-P10 now all coded):

P6 Collaboration (specs/collaboration) — project roles owner/editor/viewer
enforced server-side at every mutation (viewer 403, owner-only membership +
approval); immutable world revision lineage (content hash + derivation
discovered/edited/composed/imported + monotonic number, retrievable);
annotations + review state machine (draft->in_review->approved|rejected, audit
events to the bus); deterministic index merge that returns conflicts rather than
overwriting. +15 API tests (168 pass native-absent).

P7 Streaming discovery (specs/streaming-discovery) — CLI lawsynth stream + SDK
Study.stream/stream_discover: explicit window policy (sliding/growing, time
units, bounded memory), sustained-drift-triggered re-discovery (distinguishes
outlier from regime change), change records with per-law term diffs, byte-for-
byte replay determinism. Honestly documented as batched re-discovery, not
incremental. Regime switch at t=8 detected with exact differing terms. +CLI/SDK
tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-18 01:50:26 +03:00
29fe90834c feat(P8/P9/P10): plugin marketplace, model governance, hosted-platform tenancy
Implementing the next-phase boundary specs as real, tested code:

P8 Plugin marketplace (specs/plugin-marketplace) — .lsplugin packages (checksum
manifest + package hash), mirrorable TSV registry, honest keyed-HMAC signing
(documented as symmetric MAC, not public-key), capability grants enforced at a
single seam (declared AND granted), non-destructive install; CLI plugin
pack/install/list/verify/remove/registry. pack->sign->install->verify->tamper-
fails demonstrated.

P9 Governance (specs/model-governance) — model cards (Rust render_model_card +
SDK Study.model_card orchestrating explain/validate/backtest/ensemble, honest
'Not measured' omissions), content-addressed lineage with verify_reproducible(),
tamper-evident hash-chained audit log (content ordinals, no clock). Added
Study.validate() holdout.

P10 Hosted platform (specs/hosted-platform) — per-tenant isolation tests on every
resource + FIXED a real artifact cross-tenant download leak (owner check);
per-tenant quota -> 429 + append-only metering log + GET /v1/usage; honest HMAC
SSO seam at the gateway (tenant token exchange, rejects forged/cross-tenant).

Rust workspace green (60 plugin/report tests); API 153 pass native-absent (+22);
gateway 14 (+7); SDK governance 16.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-18 01:27:37 +03:00
035cebdcf1 feat(product): discovery-as-a-service — run workflow + Python service Client
Wave 7 — the backend ties together into one working loop:
API — POST /v1/runs executes a real discovery run state machine (queued ->
running -> succeeded|failed) via the native engine on a worker thread, stores the
discovered world, computes a real result summary (mse/complexity/#laws), and
emits RunQueued/Started/Succeeded/Failed to the event bus (streamed by
/v1/events). GET /v1/runs/{id} (status+summary) and /v1/runs/{id}/world flow
straight into the existing explain/report endpoints. Honest 503 when native
absent; bearer-auth + tenant-scoped + idempotent.

SDK — lawsynth.Client (stdlib urllib) drives the loop: submit_discovery -> wait
-> world -> explain/forecast/report, with a real HTTP transport and an in-process
WSGI transport so it runs fully offline. Demonstrated end to end.

API 98 -> 134 tests (native absent); client 18 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 22:30:54 +03:00
8c4bee8e2f feat(product): export/templates/validate CLI, HTTP product endpoints, web onboarding
Wave 2 product depth:
CLI — export (world -> runnable Python/NumPy module + LaTeX + JSON; the exported
Python reproduces the engine to ~11 digits), new/templates (onboarding catalog:
lorenz, lotka-volterra, pendulum, van-der-pol, sir with synthetic-data
generation), validate (holdout forecast-skill diagnostic: RMSE/MAE/R2/skill vs
persistence, honest STRONG/FAIR verdicts).

Services — /v1/worlds explain, forecast, report (HTML), compare over HTTP,
backed by the real domain + native engine, honest 503/404/422 boundaries;
reuses the SDK HTML report generator. 98 -> 120 API tests.

Web — docs-site getting-started flow + 5-system examples gallery + concepts;
playground interactive pick-world -> tune-params -> simulate via a local
Euler integrator over world-schema. Both apps typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 21:19:13 +03:00
13d696183d feat(product): ship report/explain/compare/forecast, Study SDK, Studio screens
Product depth across all three surfaces (PRODUCT.md captures the vision):

CLI — new lawsynth-report crate (self-contained HTML reports with inline SVG
trajectory + phase-portrait charts) and five product commands: report, explain
(plain-language laws), compare (world diff), forecast (what-if interventions),
library (local world index). Demonstrated end-to-end on a damped oscillator.

SDK — high-level Study workflow (from_csv -> discover -> explain -> simulate/
forecast -> report -> save/load), stdlib HTML report generator, and notebook
rich _repr_html_ display. Quickstart example recovers the oscillator exactly
(R2=1.0) and writes a 30KB report.

Studio — 5 interactive screens (discovery canvas, equation explorer, regime
timeline, uncertainty lens, world lab) composing the shared TS packages through
a reactive state-store; typecheck-clean.

Also: benchmark execution deepened 9 -> 18 real cases (causal + regime families
now scored against ground truth); cross-service integration tests (gateway->
artifact proxy, scheduler<->worker lifecycle over real sockets).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 21:05:39 +03:00
bd58228c14 feat: complete manifest services layer — decomposed modules + Rust gateway
Build the manifest's full decomposed services architecture as real, tested code:
- scheduler: 16 modules (queue/pool/policy/quota/placement/recovery + metrics/
  events/backoff/health/fairness/shutdown + honest nats seam) — 130 tests
- worker: 16 modules (execute/lease/resources/limits + heartbeat/events/telemetry/
  sandbox/recovery/cleanup/upload/artifacts + honest plugins seam) — 52 tests
- api: 20 modules (auth/authz/middleware + per-resource handlers + telemetry/
  facades), app.py now a thin composition root — 98 tests
- gateway: new std-only Rust reverse-proxy crate (proxy/routing/auth/cors/
  rate_limit/retry/timeouts/health/metrics/events/tracing + honest tls seam) — 110 tests

Every one of the 3,161 manifest files now exists. Extractions are behavior-
preserving (all prior tests green); new modules add real capability; nats/tls/
plugins/sandbox are honest documented seams, not fakes.

Rust workspace 352->605 tests; API 35->98. clippy -D warnings + fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 19:55:26 +03:00
b011dce423 test+config: connector test suite + service config/docs (manifest files)
Connectors: 22 real pytest modules (186 pass / 7 optional-dep skips) exercising
every connector's dependency-free surface + missing-driver degradation; SSRF
guard verified; errors_connector.py as a thin re-export (no forked taxonomy).
Services: config/{dev,staging,prod,test,limits,logging}.yaml + docs/*.md for
api/gateway/scheduler/worker, mapped to the real config structs; gateway/scheduler
Dockerfiles + scheduler .env/README. All YAML validated.

Closes 66 manifest files (gap 175->109). No source behavior changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-17 19:23:14 +03:00
ac66c5c8f1 batgod 2026-08-17 13:40:09 +03:00
9a25989a70 f life 2026-08-16 23:40:41 +03:00
6a9ce627e0 asdoruyu 2026-08-16 20:29:23 +03:00