Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
git clone https://github.com/hyperpolymath/eclexiaiser.git
cd eclexiaiser

# Using Nix (recommended for reproducibility)
nix develop
# Using Guix (recommended for reproducibility)
guix develop

# Or using toolbox/distrobox
toolbox create eclexiaiser-dev
Expand Down Expand Up @@ -45,7 +45,7 @@ eclexiaiser/
├── MAINTAINERS.md
├── README.adoc
├── SECURITY.md
├── flake.nix # Nix flake — fallback (Perimeter 1)
├── flake.guix # Guix flake — fallback (Perimeter 1)
├── guix.scm # Guix package — primary (Perimeter 1)
└── Justfile # Task runner (Perimeter 1)
```
Expand Down
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

## Banned Languages

- No TypeScript (use ReScript)
- No TypeScript (use AffineScript)
- No Node.js / npm / bun (use Deno)
- No Go (use Rust)
- No Python (use Julia or Rust)
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ updates:
schedule:
interval: "weekly"

# Nix flakes
- package-ecosystem: "nix"
# Guix flakes
- package-ecosystem: "guix"
directory: "/"
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions .machine_readable/ai/PLACEHOLDERS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ sed -i "s/{{CURRENT_DATE}}/$(date +%Y-%m-%d)/g" $(grep -rl '{{CURRENT_DATE}}' .)

| Placeholder | Description | Example | Files |
|---|---|---|---|
| `{{PROJECT_NAME}}` | Human-readable project name | `My Project` | SECURITY.md, CODE_OF_CONDUCT.md, TOPOLOGY.md, STATE.a2ml, Justfile, GOVERNANCE.md, MAINTAINERS.md, flake.nix, devcontainer.json |
| `{{PROJECT_DESCRIPTION}}` | One-line description | `A tool for X` | flake.nix |
| `{{PROJECT_NAME}}` | Human-readable project name | `My Project` | SECURITY.md, CODE_OF_CONDUCT.md, TOPOLOGY.md, STATE.a2ml, Justfile, GOVERNANCE.md, MAINTAINERS.md, flake.guix, devcontainer.json |
| `{{PROJECT_DESCRIPTION}}` | One-line description | `A tool for X` | flake.guix |
| `{{PROJECT}}` | Uppercase identifier (for Idris2 modules, C macros) | `MY_PROJECT` | ABI-FFI-README.md, src/interface/abi/*.idr, src/interface/ffi/*.zig |
| `{{project}}` | Lowercase identifier (for C symbols, filenames) | `my_project` | ABI-FFI-README.md, src/interface/ffi/*.zig |
| `eclexiaiser` | Repository name (slug) | `my-project` | CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, cliff.toml |
Expand Down Expand Up @@ -133,7 +133,7 @@ After replacing all placeholders, verify none remain:
```bash
grep -rn '{{' . --include='*.md' --include='*.adoc' --include='*.a2ml' \
--include='*.scm' --include='*.idr' --include='*.zig' --include='*.res' \
--include='Justfile' --include='*.nix' --include='*.toml' --include='*.yml' \
--include='Justfile' --include='*.guix' --include='*.toml' --include='*.yml' \
--include='*.yaml' --include='*.hs' --include='*.ncl' --include='*.txt' \
--include='*.json' --include='Containerfile' --include='dep5' \
| grep -v 'PLACEHOLDERS.md' | grep -v 'node_modules'
Expand Down
2 changes: 1 addition & 1 deletion .machine_readable/contractiles/lust/Intentfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ design philosophy — not current state, but target state.

### reproducible-builds
- description: Builds should be bit-for-bit reproducible
- target: Guix + Nix + Containerfile
- target: Guix + Guix + Containerfile
- status: aspiration

### zero-dangerous-patterns
Expand Down
2 changes: 1 addition & 1 deletion .machine_readable/policies/MAINTENANCE-CHECKLIST.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ compliance-seams-check = true
exception-register-required = true
exception-bounded-scope-required = true
policy-drift-contamination-check = true
example-drift-risk = "single TypeScript exception causing broad ReScript->TypeScript migration"
example-drift-risk = "single TypeScript exception causing broad AffineScript->TypeScript migration"
compliance-tooling = "panic-attack"
effects-tooling = "ecological checking with sustainabot guidance"

Expand Down
24 changes: 24 additions & 0 deletions CODE_OF_CONDUCT.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
== Contributor Covenant Code of Conduct

=== Our Pledge

We pledge to make participation a harassment-free experience for
everyone.

=== Our Standards

*Positive behavior:* * Using welcoming language * Being respectful of
differing viewpoints * Accepting constructive criticism * Focusing on
what is best for the community

*Unacceptable behavior:* * Harassment, trolling, or personal attacks *
Publishing private information without permission

=== Enforcement

Report issues to the maintainers. All complaints will be reviewed.

=== Attribution

Adapted from https://www.contributor-covenant.org/[Contributor Covenant]
v2.1.
27 changes: 0 additions & 27 deletions CODE_OF_CONDUCT.md

This file was deleted.

71 changes: 71 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
== Contributing

Thank you for your interest in contributing! We follow a "`Dual-Track`"
architecture where human-readable documentation lives in the root and
machine-readable policies live in `+.machine_readable/+`.

=== How to Contribute

We welcome contributions in many forms:

* *Code:* Improving the core stack or extensions
* *Documentation:* Enhancing docs or AI manifests
* *Testing:* Adding property-based tests or formal proofs
* *Bug reports:* Filing clear, reproducible issues

=== Getting Started

[arabic]
. *Read the AI Manifest:* Start with `+0-AI-MANIFEST.a2ml+` (if present)
to understand the repository structure.
. *Environment:* Use `+guix develop+` or `+direnv allow+` to set up your
tools.
. *Task Runner:* Use `+just+` to see available commands
(`+just --list+`).

=== Development Workflow

==== Branch Naming

....
docs/short-description # Documentation
test/what-added # Test additions
feat/short-description # New features
fix/issue-number-description # Bug fixes
refactor/what-changed # Code improvements
security/what-fixed # Security fixes
....

==== Commit Messages

We follow https://www.conventionalcommits.org/[Conventional Commits]:

....
<type>(<scope>): <description>

[optional body]

[optional footer]
....

Types: `+feat+`, `+fix+`, `+docs+`, `+test+`, `+refactor+`, `+ci+`,
`+chore+`, `+security+`

=== Reporting Bugs

Before reporting: 1. Search existing issues 2. Check if it’s already
fixed in `+main+`

When reporting, include: - Clear, descriptive title - Environment
details (OS, versions, toolchain) - Steps to reproduce - Expected vs
actual behaviour

=== Code of Conduct

All contributors are expected to adhere to our
link:CODE_OF_CONDUCT.md[Code of Conduct].

=== License

By contributing, you agree that your contributions will be licensed
under the same license as the project (see LICENSE).
66 changes: 0 additions & 66 deletions CONTRIBUTING.md

This file was deleted.

121 changes: 121 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
== What Is This?

Eclexiaiser instruments existing code with *energy, carbon, and
resource-cost tracking* — making the environmental cost of computation a
first-class concern.

https://github.com/hyperpolymath/eclexia[Eclexia] is one of
hyperpolymath’s nextgen languages focused on sustainability. It tracks
resource consumption as a type-level constraint, so developers can write
carbon-aware software that provably stays within energy budgets.
Eclexiaiser brings this to any codebase without requiring the developer
to learn Eclexia directly.

== How It Works

[arabic]
. *Manifest* (`+eclexiaiser.toml+`) — define your functions and their
energy budgets, carbon intensity limits, and resource bounds.
. *Source instrumentation* — eclexiaiser analyses your code and inserts
energy measurement hooks at function boundaries.
. *Eclexia annotation codegen* — generates Eclexia constraint files with
joule annotations (`+@requires+` `+energy+` `+<+` `+5kWh+`), carbon
intensity bounds, and renewable-aware scheduling hints.
. *Idris2 ABI proofs* — the generated resource bounds are formally
verified using dependent types. The Idris2 layer proves that your energy
budget is satisfiable and that carbon intensity limits compose correctly
across call chains.
. *Zig FFI bridge* — high-performance energy measurement via RAPL
(Running Average Power Limit), IPMI, or external APIs. Zero-overhead
C-ABI interface for reading hardware energy counters and querying carbon
intensity services.
. *Enforcement and reporting* — violations are caught at compile time
where possible, and at runtime otherwise. Generates sustainability
reports compatible with the EU Corporate Sustainability Reporting
Directive (CSRD).

== Key Value

* *Know the carbon cost of every function call* — joule annotations make
energy consumption visible and enforceable at the type level
* *Enforce energy budgets* — set per-function and per-module energy
limits that are checked at compile time via Idris2 dependent type proofs
* *Generate sustainability reports* — produce CSRD-compatible reports
showing energy consumption, carbon emissions, and renewable energy
utilisation
* *Carbon intensity API integration* — connect to WattTime or
Electricity Maps to schedule heavy computation when the grid is cleanest
* *Renewable-aware scheduling* — defer energy-intensive work to periods
of high renewable generation
* *Energy type system* — Eclexia’s `+@requires+`/`+@provides+`
constraints make resource costs explicit and optimisable across the
entire call graph

== Architecture

Follows the hyperpolymath -iser pattern:

....
eclexiaiser.toml (manifest: functions, budgets, carbon limits)
|
v
Source instrumentation (insert energy measurement hooks)
|
v
Eclexia annotation codegen (@requires energy, @provides carbon_report)
|
v
Idris2 ABI (proves resource bounds compose, budgets are satisfiable)
|
v
Zig FFI (RAPL/IPMI energy measurement, WattTime/Electricity Maps API)
|
v
Sustainability report + enforcement violations
....

Part of the https://github.com/hyperpolymath/iseriser[-iser family].

=== Key Types (Idris2 ABI)

* `+EnergyBudget+` — per-function energy limit in joules, proven
satisfiable
* `+CarbonIntensity+` — grams CO2 per kilowatt-hour, sourced from grid
API
* `+JouleAnnotation+` — type-level energy annotation for a function
* `+ResourceBound+` — composite bound (energy + carbon + time + memory)
* `+SustainabilityReport+` — aggregated metrics with CSRD field mapping

=== Zig FFI Operations

* `+eclexiaiser_measure_energy+` — read hardware energy counters
(RAPL/IPMI)
* `+eclexiaiser_query_carbon+` — fetch current carbon intensity from
grid API
* `+eclexiaiser_enforce_budget+` — check a measurement against a proven
bound
* `+eclexiaiser_generate_report+` — produce a sustainability report
struct

== Use Cases

* *Green computing* — annotate hotspots, set budgets, prove compliance
* *Data centre optimisation* — measure per-function energy, identify
waste
* *Carbon-aware CI/CD* — skip heavy builds when the grid is dirty;
schedule nightly jobs when renewables peak
* *EU CSRD compliance* — generate the energy and emissions data required
by the Corporate Sustainability Reporting Directive
* *Cloud cost prediction* — estimate energy costs before deployment
using the proven energy bounds

== Status

*Codebase in progress.* Scaffold complete (CLI, manifest parser,
directory structure, CI/CD). Codegen stubs in place. Idris2 ABI and Zig
FFI templates present — domain-specific types and energy measurement
logic pending.

== License

SPDX-License-Identifier: CC-BY-SA-4.0
Loading
Loading