Metadata-Version: 2.4
Name: AssayFluxScientificSystems
Version: 0.1.1
Summary: A unified scientific programming ecosystem with the AssayFlux language, 34-language interoperability, scientific Python tools, AssayFluxOS, and Gradle-powered Android builds.
Author: AssayFlux Contributors
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lark<2,>=1.1.9
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

# AssayFlux Unified

A unified scientific programming ecosystem with the AssayFlux language, 34-language interoperability, scientific Python tools, AssayFluxOS, and Gradle-powered Android builds.


**Status: early development foundation, not a security-certified language or production compiler.**

This repository consolidates the language, developer-tooling, and OS-shell prototypes into one canonical Python package. Python is the implementation language and an interoperability target; AssayFlux has its own grammar and runtime.

## Design principles

- Safe-by-default language semantics; no raw memory operations in the initial language.
- Explicit, reviewed Python interoperability rather than arbitrary `eval`/`exec` of user strings.
- Lark grammar, structured AST, functions/lambdas, collections and comprehensions, bounded matrix operations, restricted exception handling, semantic checks, runtime budgets, and stable diagnostics.
- Checkpoints at source, parse, AST, semantic, capability, runtime, and output boundaries.
- Local-first bug reports; source text and environment secrets are not attached by default.
- Optional runtimes are capability-gated. Missing optional tools do not break interpreter-only use.
- Preserve original prototypes under `legacy_sources/` as migration references; they are not implicitly trusted or loaded by the new runtime.

## Install (Python 3.11+)

```bash
python -m venv .venv
. .venv/bin/activate        # Windows: .venv\\Scripts\\activate
python -m pip install -e '.[dev]'
python -m pytest
assayflux doctor
assayflux check examples/hello.assayflux
assayflux audit . --json-out audit-report.json
assayflux run examples/hello.assayflux
assayflux run examples/modules/main.assayflux --allow-project-imports
assayflux build examples/native.cpp --output build/native
```

On Android/Termux, install Python and a compatible `lark` release with pip. Native C++ compilation is optional and requires a separately installed compiler. The Android builder is integrated, but APK/AAB output still requires a compatible JDK, Android SDK/platform/build-tools, licenses, Gradle/Android Gradle Plugin, and (for release builds) signing credentials. An APK/AAB has not been verified in this source-only environment.

## Example

```text
app "Hello AssayFlux"
let name = "AssayFlux"
let count = 6 * 7
show "Hello, " + name
show count
```

For trusted NumPy use, explicitly enable the module, callable, and capabilities rather than giving every source file unrestricted Python access:

```bash
assayflux run examples/python_numpy.assayflux \
  --grant python.call --grant python.module:numpy \
  --allow-python-module numpy \
  --allow-python-call numpy.array --allow-python-call numpy.mean
```

## Unified integrations (0.1.0 integration build)

The canonical distribution now packages these existing source components together:

- `assayflux`: custom Lark-based language, parser, semantic checks, interpreter, diagnostics, security limits, SQLite helper, and native C++ build helper.
- `assayflux.interop`: 34 registered language/asset targets: Bash, C, C++, C#, COBOL, Crystal, D, Dart, Elixir, Erlang, Fortran, F#, Go, Haskell, Java, JavaScript, Julia, Kotlin, Lua, Nim, OCaml, Perl, PHP, Python, R, Ruby, Rust, Scala, SQL, Swift, TypeScript, Zig, HTML, and CSS. Toolchain availability is detected separately; each executable language needs its compiler/runtime installed.
- `assayflux.generator`: the original HTML, CSS, JavaScript, Python, and SQL generator APIs.
- `assayfluxos`: the separate AssayFluxOS shell, workspace filesystem, configuration, and plugin prototype.
- `assayflux_python`: the portable scientific/research Python core (analytics, microscopy/IDR, database, scientific utilities, research services, and security services).
- Gradle Android starter and builder commands for project initialization, wrapper generation, APK builds, and AAB builds.

Interop is runtime execution/asset handling, not a claim that every one of the 34 languages can be translated to every other language. Likewise, the existing SQLite helper is not yet a first-class SQL block syntax, and the C++ command compiles supplied trusted C++ rather than compiling arbitrary AssayFlux programs to C++.

## Commands

- `assayflux check FILE` — parse and perform static checks without running code.
- `assayflux run FILE` — validate then interpret with runtime limits. Python modules and project imports require explicit capability grants; trusted project imports use `--allow-project-imports`.
- `assayflux audit PATH --json-out report.json` — statically audit one file or a project tree without executing it.
- `assayflux doctor` — report interpreter/package/dependency/tool health.
- `assayflux interop list` — list registered targets and detect which runtimes are installed.
- `assayflux generate website spec.json --output build` — generate an HTML/CSS/JavaScript/Python/SQL website scaffold.
- `assayflux interop run python script.py` — run a source file through a named external-language adapter (trusted code only).
- `assayflux android init ./MyAndroidApp` — copy the bundled Android starter project.
- `assayflux android wrapper ./MyAndroidApp --gradle-version 8.9` — generate Gradle wrapper files using installed Gradle.
- `assayflux android build ./MyAndroidApp --variant debug` — build an APK; add `--bundle` to build an AAB.
- `assayflux-builder new MyProject --root .` — create a multi-target project workspace using the Professional toolkit.
- `assayflux-builder runtimes --json` — inspect detected external runtimes and build tools.
- `assayflux build FILE.cpp` — compile trusted generated C++ with time and path limits; does not run the binary.
- `assayflux report list|show|export` — inspect local diagnostic reports.

## Security boundary

No programming language can promise that all future programs are automatically bug-free or impossible to compromise. Sentinel catches defined classes of problems; tests and static analysis find only defects covered by their rules. Python libraries and native extensions may execute arbitrary native code. For untrusted programs, use a separately restricted OS process/container, least-privilege account, filesystem/network restrictions, and resource limits. Do not treat this in-process interpreter as a sandbox.

See `docs/INTEGRATION_AUDIT_0.1.0.md` for source consolidation decisions and verification limits. See `grammar.md` / `docs/GRAMMAR.md` (preserved canonical specification), `docs/IMPLEMENTATION_STATUS.md`, `docs/SECURITY_MODEL.md`, `docs/ARCHITECTURE.md`, and `docs/ROADMAP.md`.
