Skip to content

Commit 62d20f9

Browse files
hyperpolymathclaude
andcommitted
docs: bespoke architecture, roadmap, topology, and ABI definitions for eclexiaiser
Replace template placeholders with eclexiaiser-specific content across all documentation and interface files: - README.adoc: full description of energy/carbon instrumentation pipeline, Eclexia annotation codegen, use cases (CSRD, data centres, carbon-aware CI) - ROADMAP.adoc: 7-phase roadmap from scaffold through CSRD reporting - TOPOLOGY.md: module map, data flow diagram, domain type reference - Idris2 ABI: EnergyBudget, CarbonIntensity, JouleAnnotation, ResourceBound, SustainabilityReport types with composition and satisfiability proofs; energy measurement struct layouts (32/24/40 byte C-compatible) - Zig FFI: RAPL/IPMI energy counter framework, WattTime/Electricity Maps carbon API stubs, budget enforcement, report generation, static fallback data for 6 grid zones - Integration tests: budget enforcement, carbon intensity queries, reporting - Machine-readable: bespoke STATE, META, ECOSYSTEM, AGENTIC, NEUROSYM, PLAYBOOK - AI manifest: eclexiaiser identity, domain invariants (microjoule units) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 69dccf2 commit 62d20f9

16 files changed

Lines changed: 1566 additions & 490 deletions

File tree

.machine_readable/6a2/AGENTIC.a2ml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# AGENTIC.a2ml — AI agent constraints and capabilities
4+
# AGENTIC.a2ml — AI agent constraints and capabilities for eclexiaiser
55
# Defines what AI agents can and cannot do in this repository.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[agent-permissions]
1212
can-edit-source = true
@@ -18,10 +18,19 @@ can-create-files = true
1818
[agent-constraints]
1919
# What AI agents must NOT do:
2020
# - Never use banned language patterns (believe_me, unsafeCoerce, etc.)
21-
# - Never commit secrets or credentials
21+
# - Never commit secrets or credentials (especially API keys for WattTime/Electricity Maps)
2222
# - Never use banned languages (TypeScript, Python, Go, etc.)
2323
# - Never place state files in repository root (must be in .machine_readable/)
2424
# - Never use AGPL license (use PMPL-1.0-or-later)
25+
# - Never use floating-point at the FFI boundary (microjoules and mg CO2/kWh are integers)
26+
# - Never hardcode carbon intensity values in Idris2 ABI (use Zig FFI for runtime data)
27+
28+
[domain-rules]
29+
# Energy units: microjoules (uJ) at ABI boundary
30+
# Carbon units: milligrams CO2 per kWh at ABI boundary
31+
# Time units: microseconds (us) at ABI boundary
32+
# Memory units: bytes at ABI boundary
33+
# Renewable percentage: basis points (0-10000 = 0.00%-100.00%)
2534

2635
[maintenance-integrity]
2736
fail-closed = true

.machine_readable/6a2/ECOSYSTEM.a2ml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
(version "0.1.0")
77
(name "eclexiaiser")
88
(type "tool")
9-
(purpose "Add energy/carbon/resource-cost awareness via Eclexia")
9+
(purpose "Add energy, carbon, and resource-cost awareness to existing software via Eclexia economics-as-code")
1010

1111
(position-in-ecosystem
1212
(family "-iser acceleration frameworks")
1313
(meta-framework "iseriser")
1414
(relationship "sibling")
15+
(domain "sustainability, green computing, carbon-aware software")
1516
(top-3 ("typedqliser" "chapeliser" "verisimiser")))
1617

1718
(related-projects
1819
(project "iseriser"
1920
(relationship "meta-framework")
2021
(description "Generates new -iser project scaffolding"))
22+
(project "eclexia"
23+
(relationship "target-language")
24+
(description "Economics-as-code language with @requires/@provides resource constraints"))
2125
(project "typedqliser"
2226
(relationship "sibling-priority-1")
2327
(description "Formal type safety for any query language"))
@@ -27,12 +31,18 @@
2731
(project "verisimiser"
2832
(relationship "sibling-priority-3")
2933
(description "VeriSimDB octad database augmentation"))
30-
(project "squeakwell"
31-
(relationship "sibling")
32-
(description "Database recovery via constraint propagation"))
3334
(project "proven"
3435
(relationship "dependency")
35-
(description "Shared Idris2 verified library"))
36+
(description "Shared Idris2 verified library — resource bound proofs will use proven primitives"))
3637
(project "typell"
3738
(relationship "dependency")
38-
(description "Type theory engine"))))
39+
(description "Type theory engine — used for constraint solving on resource bounds"))
40+
(project "panll"
41+
(relationship "consumer")
42+
(description "Panel system — eclexiaiser provides real-time energy dashboard panel"))
43+
(project "boj-server"
44+
(relationship "consumer")
45+
(description "BoJ cartridge for remote energy analysis"))
46+
(project "verisimdb"
47+
(relationship "consumer")
48+
(description "Historical energy measurement storage"))))

.machine_readable/6a2/META.a2ml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,58 @@
44

55
(meta
66
(version "0.1.0")
7-
(last-updated "2026-03-20")
7+
(last-updated "2026-03-21")
88

99
(architecture-decisions
1010
(adr "001-iser-pattern"
1111
(status "accepted")
12-
(context "Need to make powerful languages accessible without steep learning curves")
13-
(decision "Use manifest-driven code generation: user describes WHAT, tool generates HOW")
14-
(consequences "Users write zero target language code; all complexity in the -iser"))
12+
(context "Need to make Eclexia sustainability features accessible without learning a new language")
13+
(decision "Use manifest-driven code generation: user describes energy budgets in TOML, tool generates Eclexia constraints and measurement hooks")
14+
(consequences "Users write zero Eclexia code; all complexity in eclexiaiser"))
1515

1616
(adr "002-abi-ffi-standard"
1717
(status "accepted")
18-
(context "Need verified interop between Rust CLI, target language, and user code")
19-
(decision "Idris2 ABI for formal proofs, Zig FFI for C-ABI bridge")
20-
(consequences "Compile-time correctness guarantees; zero runtime overhead from proofs"))
18+
(context "Need verified interop between Rust CLI, energy measurement hardware, and carbon APIs")
19+
(decision "Idris2 ABI for formal proofs of resource bounds, Zig FFI for hardware counter access and C-ABI bridge")
20+
(consequences "Compile-time correctness guarantees for energy budgets; zero runtime overhead from proofs"))
2121

22-
(adr "003-rsr-template"
22+
(adr "003-microjoule-units"
23+
(status "accepted")
24+
(context "Floating-point energy values cause rounding errors that compound across call chains")
25+
(decision "Use microjoules (uJ) as the canonical unit at the ABI boundary; milligrams CO2/kWh for carbon")
26+
(consequences "Integer arithmetic throughout the measurement and enforcement path; no floating-point at FFI boundary"))
27+
28+
(adr "004-carbon-api-providers"
29+
(status "accepted")
30+
(context "Need real-time carbon intensity data for renewable-aware scheduling")
31+
(decision "Support WattTime, Electricity Maps, and static data as carbon API providers; configurable per zone in manifest")
32+
(consequences "Caching layer needed to avoid API rate limits; static fallback for offline/CI use"))
33+
34+
(adr "005-csrd-reporting"
35+
(status "accepted")
36+
(context "EU Corporate Sustainability Reporting Directive requires energy and emissions data from software operations")
37+
(decision "Generate sustainability reports with CSRD-compatible field mapping from accumulated measurements")
38+
(consequences "Report struct must include: total energy, total carbon, renewable percentage, measurement count"))
39+
40+
(adr "006-rsr-template"
2341
(status "accepted")
2442
(context "Need consistent project structure across 29+ -iser repos")
2543
(decision "All repos cloned from rsr-template-repo with full CI/CD and governance")
2644
(consequences "17 workflows, SECURITY.md, CONTRIBUTING, bot directives from day one")))
2745

2846
(development-practices
29-
(language "Rust" (purpose "CLI and orchestration"))
30-
(language "Idris2" (purpose "ABI formal proofs"))
31-
(language "Zig" (purpose "FFI C-ABI bridge"))
47+
(language "Rust" (purpose "CLI orchestration, manifest parsing, codegen"))
48+
(language "Idris2" (purpose "ABI formal proofs of energy budget satisfiability and composition"))
49+
(language "Zig" (purpose "FFI C-ABI bridge for RAPL/IPMI energy counters and carbon API"))
3250
(build-tool "cargo")
3351
(ci "GitHub Actions (17 workflows)"))
3452

3553
(design-rationale
3654
(principle "Manifest-driven"
37-
(explanation "User intent captured in TOML; all generation is deterministic and reproducible"))
38-
(principle "Formally verified bridges"
39-
(explanation "Idris2 dependent types prove interface correctness at compile time"))
40-
(principle "Zero target language exposure"
41-
(explanation "Users never write Chapel/Julia/Futhark/etc. — the -iser handles everything"))))
55+
(explanation "User describes energy budgets and carbon limits in eclexiaiser.toml; tool generates all measurement and enforcement code"))
56+
(principle "Formally verified resource bounds"
57+
(explanation "Idris2 dependent types prove energy budgets compose correctly across call chains and are satisfiable"))
58+
(principle "Hardware-level measurement"
59+
(explanation "Zig FFI reads RAPL/IPMI hardware counters for accurate energy data; software estimation as fallback"))
60+
(principle "Carbon-aware by default"
61+
(explanation "Every energy measurement is paired with grid carbon intensity data, enabling renewable-aware scheduling"))))
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# NEUROSYM.a2ml — Neurosymbolic integration metadata
4+
# NEUROSYM.a2ml — Neurosymbolic integration metadata for eclexiaiser
55
# Configuration for Hypatia scanning and symbolic reasoning.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[hypatia-config]
1212
scan-enabled = true
1313
scan-depth = "standard" # quick | standard | deep
1414
report-format = "logtalk"
1515

1616
[symbolic-rules]
17-
# Custom symbolic rules for this project
17+
# Custom symbolic rules for eclexiaiser
1818
# - { name = "no-unsafe-ffi", pattern = "believe_me|unsafeCoerce", severity = "critical" }
19+
# - { name = "no-float-at-boundary", pattern = "Double.*foreign|foreign.*Double", severity = "warning" }
20+
# - { name = "energy-unit-consistency", pattern = "joules(?!.*micro)", severity = "info" }
1921

2022
[neural-config]
2123
# Neural pattern detection settings
2224
# confidence-threshold = 0.85
2325
# model = "hypatia-v2"
26+
# domain-hints = ["energy-measurement", "carbon-tracking", "sustainability-reporting"]
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# PLAYBOOK.a2ml — Operational playbook
4+
# PLAYBOOK.a2ml — Operational playbook for eclexiaiser
55
# Runbooks, incident response, deployment procedures.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[deployment]
12-
# method = "gitops" # gitops | manual | ci-triggered
13-
# target = "container" # container | binary | library | wasm
12+
method = "ci-triggered"
13+
target = "binary" # Rust CLI binary + Zig shared library
14+
# Secondary targets: container (for CI/CD integration), library (for embedding)
1415

1516
[incident-response]
16-
# 1. Check .machine_readable/STATE.a2ml for current status
17+
# 1. Check .machine_readable/6a2/STATE.a2ml for current status
1718
# 2. Review recent commits and CI results
1819
# 3. Run `just validate` to check compliance
1920
# 4. Run `just security` to audit for vulnerabilities
21+
# 5. Check energy measurement accuracy: compare RAPL vs IPMI vs estimates
2022

2123
[release-process]
22-
# 1. Update version in STATE.a2ml, META.a2ml, Justfile
24+
# 1. Update version in STATE.a2ml, META.a2ml, Cargo.toml, Justfile
2325
# 2. Run `just release-preflight` (validate + quality + security + maint-hard-pass)
24-
# 3. Optional local permission hardening: `just perms-snapshot && just perms-lock`
25-
# 4. Tag and push
26-
# 5. Restore local permissions if needed: `just perms-restore`
27-
# 6. Run `just container-push` if applicable
26+
# 3. Verify Zig FFI struct sizes match Idris2 ABI Layout.idr
27+
# 4. Run `zig build test` in src/interface/ffi/
28+
# 5. Run `cargo test` for Rust CLI
29+
# 6. Tag and push
30+
# 7. Run `just container-push` if applicable
2831

2932
[maintenance-operations]
3033
# Baseline audit:
@@ -33,3 +36,5 @@ last-updated = "{{CURRENT_DATE}}"
3336
# just maint-hard-pass
3437
# Permission audit:
3538
# just perms-audit
39+
# ABI compliance check:
40+
# Compare struct sizes in Zig tests vs Idris2 Layout.idr comments

.machine_readable/6a2/STATE.a2ml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@
55
(state
66
(metadata
77
(version "0.1.0")
8-
(last-updated "2026-03-20")
8+
(last-updated "2026-03-21")
99
(author "Jonathan D.A. Jewell"))
1010

1111
(project-context
1212
(name "eclexiaiser")
13-
(description "Add energy/carbon/resource-cost awareness via Eclexia")
14-
(status "scaffold")
13+
(description "Add energy, carbon, and resource-cost awareness to existing software via Eclexia economics-as-code")
14+
(status "scaffold — architecture defined, bespoke ABI types in place")
1515
(priority "—")
1616
(ecosystem "-iser family (https://github.com/hyperpolymath/iseriser)"))
1717

1818
(current-position
19-
(phase "initial-scaffold")
20-
(completion-percentage 5)
21-
(milestone "Architecture defined, CLI scaffolded, RSR template complete"))
19+
(phase "scaffold-complete")
20+
(completion-percentage 15)
21+
(milestone "Bespoke Idris2 ABI types (EnergyBudget, CarbonIntensity, JouleAnnotation, ResourceBound, SustainabilityReport), Zig FFI with energy measurement stubs, budget enforcement, and carbon API framework"))
2222

2323
(route-to-mvp
24-
(step 1 "Replace codegen stubs with target-language-specific generation")
25-
(step 2 "Implement Idris2 ABI proofs for core invariants")
26-
(step 3 "Build Zig FFI bridge")
27-
(step 4 "Integration tests with real-world examples")
28-
(step 5 "Documentation and examples"))
24+
(step 1 "Implement source instrumentation for Rust/ReScript/Gleam targets")
25+
(step 2 "Generate Eclexia annotation files from manifest budgets")
26+
(step 3 "Implement RAPL energy counter reading in Zig FFI")
27+
(step 4 "Integrate WattTime and Electricity Maps carbon APIs")
28+
(step 5 "Complete Idris2 proofs of resource bound composition and satisfiability")
29+
(step 6 "Generate CSRD-compatible sustainability reports")
30+
(step 7 "Integration tests with real energy measurements"))
2931

3032
(blockers-and-issues
31-
(none "Project is in scaffold phase — no blockers yet"))
33+
(none "Project is in scaffold phase — no blockers yet. RAPL access requires kernel permissions (powercap sysfs)."))
3234

3335
(critical-next-actions
34-
(action "Implement codegen for primary use case")
35-
(action "Write first working example end-to-end")))
36+
(action "Implement source instrumentation for function boundary detection")
37+
(action "Implement RAPL energy counter reading in Zig FFI")
38+
(action "Write first working example: annotate a Rust function with energy budget, measure, enforce")))

0 commit comments

Comments
 (0)