diff --git a/.machine_readable/6a2/PLAYBOOK.a2ml b/.machine_readable/6a2/PLAYBOOK.a2ml index 676ec4c..cdaebfd 100644 --- a/.machine_readable/6a2/PLAYBOOK.a2ml +++ b/.machine_readable/6a2/PLAYBOOK.a2ml @@ -63,7 +63,7 @@ enforcement-workflow = ".github/workflows/estate-rules.yml" # .github/ CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, workflows/ # .machine_readable/ AI manifests (0.1-AI-MANIFEST.a2ml), 6a2/ checkpoints, # contractiles/, configs/, anchors/, policies/, scripts/, svc/ -# build/ contractile.just, flake.nix, guix.scm, Containerfile, +# build/ contractile.just, flake.guix, guix.scm, Containerfile, # just/*.just (Justfile section imports) # docs/ onboarding/, status/, architecture/, governance/ (all .adoc) # session/ dispatch.sh, custom-checks.k9, local-hooks.sh @@ -103,7 +103,7 @@ enforcement-workflow = ".github/workflows/estate-rules.yml" # build/just/groove.just Groove protocol setup (after zig removed) # # Daily-use recipes (BUILD, TEST, LINT, RUN, DEPS, DOCS, CONTAINER, CI, -# SECURITY, STATE, GUIX/NIX, MATRIX, VERSION CONTROL, UTILITIES, SESSION) +# SECURITY, STATE, GUIX/GUIX, MATRIX, VERSION CONTROL, UTILITIES, SESSION) # stay in the root Justfile where users expect to find them. # === 5-PR cleanup pattern === diff --git a/.machine_readable/ROADMAP.a2ml b/.machine_readable/ROADMAP.a2ml index ab4b2fa..044adff 100644 --- a/.machine_readable/ROADMAP.a2ml +++ b/.machine_readable/ROADMAP.a2ml @@ -78,7 +78,7 @@ migrated-from = "ROADMAP.scm" # - Production release # - ) # - All 6 modules complete with formal proofs -# - Cross-language verification examples (ReScript, Gleam, Elixir) +# - Cross-language verification examples (AffineScript, Gleam, Elixir) # - Comprehensive documentation # - Performance benchmarks vs other implementations # - Julia General registry registration @@ -112,7 +112,7 @@ migrated-from = "ROADMAP.scm" # - ) # - Equivalence checking design # - ) -# - ReScript/Gleam/Elixir verification examples +# - AffineScript/Gleam/Elixir verification examples # - )))) # - Performance # - ) diff --git a/ABI-FFI-README.md b/ABI-FFI-README.adoc similarity index 73% rename from ABI-FFI-README.md rename to ABI-FFI-README.adoc index fc196a2..efef79a 100644 --- a/ABI-FFI-README.md +++ b/ABI-FFI-README.adoc @@ -1,23 +1,22 @@ - -{{~ Aditionally delete this line and fill out the template below ~}} +\{\{~ Aditionally delete this line and fill out the template below ~}} -# POLYGLOTFORMALISMS_JL ABI/FFI Documentation +== POLYGLOTFORMALISMS_JL ABI/FFI Documentation -## Overview +=== Overview -This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: +This library follows the *Hyperpolymath RSR Standard* for ABI and FFI +design: -- **ABI (Application Binary Interface)** defined in **Idris2** with formal proofs -- **FFI (Foreign Function Interface)** implemented in **Zig** for C compatibility -- **Generated C headers** bridge Idris2 ABI to Zig FFI -- **Any language** can call through standard C ABI +* *ABI (Application Binary Interface)* defined in *Idris2* with formal +proofs +* *FFI (Foreign Function Interface)* implemented in *Zig* for C +compatibility +* *Generated C headers* bridge Idris2 ABI to Zig FFI +* *Any language* can call through standard C ABI -## Architecture +=== Architecture -``` +.... ┌─────────────────────────────────────────────┐ │ ABI Definitions (Idris2) │ │ src/abi/ │ @@ -47,13 +46,13 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: ▼ ┌─────────────────────────────────────────────┐ │ Any Language via C ABI │ -│ - Rust, ReScript, Julia, Python, etc. │ +│ - Rust, AffineScript, Julia, Python, etc. │ └─────────────────────────────────────────────┘ -``` +.... -## Directory Structure +=== Directory Structure -``` +.... {{project}}/ ├── src/ │ ├── abi/ # ABI definitions (Idris2) @@ -79,17 +78,19 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ └── bindings/ # Language-specific wrappers (optional) ├── rust/ - ├── rescript/ + ├── affinescript/ └── julia/ -``` +.... -## Why Idris2 for ABI? +=== Why Idris2 for ABI? -### 1. **Formal Verification** +==== 1. *Formal Verification* -Idris2's dependent types allow proving properties about the ABI at compile-time: +Idris2’s dependent types allow proving properties about the ABI at +compile-time: -```idris +[source,idris] +---- -- Prove struct size is correct public export exampleStructSize : HasSize ExampleStruct 16 @@ -101,13 +102,14 @@ fieldAligned : Divides 8 (offsetOf ExampleStruct.field) -- Prove ABI is platform-compatible public export abiCompatible : Compatible (ABI 1) (ABI 2) -``` +---- -### 2. **Type Safety** +==== 2. *Type Safety* Encode invariants that C/Zig cannot express: -```idris +[source,idris] +---- -- Non-null pointer guaranteed at type level data Handle : Type where MkHandle : (ptr : Bits64) -> {auto 0 nonNull : So (ptr /= 0)} -> Handle @@ -115,13 +117,14 @@ data Handle : Type where -- Array with length proof data Buffer : (n : Nat) -> Type where MkBuffer : Vect n Byte -> Buffer n -``` +---- -### 3. **Platform Abstraction** +==== 3. *Platform Abstraction* Platform-specific types with compile-time selection: -```idris +[source,idris] +---- CInt : Platform -> Type CInt Linux = Bits32 CInt Windows = Bits32 @@ -129,13 +132,14 @@ CInt Windows = Bits32 CSize : Platform -> Type CSize Linux = Bits64 CSize Windows = Bits64 -``` +---- -### 4. **Safe Evolution** +==== 4. *Safe Evolution* Prove that new ABI versions are backward-compatible: -```idris +[source,idris] +---- -- Compiler enforces compatibility abiUpgrade : ABI 1 -> ABI 2 abiUpgrade old = MkABI2 { @@ -144,71 +148,78 @@ abiUpgrade old = MkABI2 { -- Can add new fields new_features = defaults } -``` +---- -## Why Zig for FFI? +=== Why Zig for FFI? -### 1. **C ABI Compatibility** +==== 1. *C ABI Compatibility* Zig exports C-compatible functions naturally: -```zig +[source,zig] +---- export fn library_function(param: i32) i32 { return param * 2; } -``` +---- -### 2. **Memory Safety** +==== 2. *Memory Safety* Compile-time safety without runtime overhead: -```zig +[source,zig] +---- // Null check enforced at compile time const handle = init() orelse return error.InitFailed; defer free(handle); -``` +---- -### 3. **Cross-Compilation** +==== 3. *Cross-Compilation* Built-in cross-compilation to any platform: -```bash +[source,bash] +---- zig build -Dtarget=x86_64-linux zig build -Dtarget=aarch64-macos zig build -Dtarget=x86_64-windows -``` +---- -### 4. **Zero Dependencies** +==== 4. *Zero Dependencies* No runtime, no libc required (unless explicitly needed): -```zig +[source,zig] +---- // Minimal binary size pub const lib = @import("std"); // Only includes what you use -``` +---- -## Building +=== Building -### Build FFI Library +==== Build FFI Library -```bash +[source,bash] +---- cd ffi/zig zig build # Build debug zig build -Doptimize=ReleaseFast # Build optimized zig build test # Run tests -``` +---- -### Generate C Header from Idris2 ABI +==== Generate C Header from Idris2 ABI -```bash +[source,bash] +---- cd src/abi idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}}.h -``` +---- -### Cross-Compile +==== Cross-Compile -```bash +[source,bash] +---- cd ffi/zig # Linux x86_64 @@ -219,13 +230,14 @@ zig build -Dtarget=aarch64-macos # Windows x86_64 zig build -Dtarget=x86_64-windows -``` +---- -## Usage +=== Usage -### From C +==== From C -```c +[source,c] +---- #include "{{project}}.h" int main() { @@ -241,16 +253,19 @@ int main() { {{project}}_free(handle); return 0; } -``` +---- Compile with: -```bash + +[source,bash] +---- gcc -o example example.c -l{{project}} -L./zig-out/lib -``` +---- -### From Idris2 +==== From Idris2 -```idris +[source,idris] +---- import POLYGLOTFORMALISMS_JL.ABI.Foreign main : IO () @@ -263,11 +278,12 @@ main = do free handle putStrLn "Success" -``` +---- -### From Rust +==== From Rust -```rust +[source,rust] +---- #[link(name = "{{project}}")] extern "C" { fn {{project}}_init() -> *mut std::ffi::c_void; @@ -286,11 +302,12 @@ fn main() { {{project}}_free(handle); } } -``` +---- -### From Julia +==== From Julia -```julia +[source,julia] +---- const lib{{project}} = "lib{{project}}" function init() @@ -316,27 +333,30 @@ try finally cleanup(handle) end -``` +---- -## Testing +=== Testing -### Unit Tests (Zig) +==== Unit Tests (Zig) -```bash +[source,bash] +---- cd ffi/zig zig build test -``` +---- -### Integration Tests +==== Integration Tests -```bash +[source,bash] +---- cd ffi/zig zig build test-integration -``` +---- -### ABI Verification (Idris2) +==== ABI Verification (Idris2) -```idris +[source,idris] +---- -- Compile-time verification %runElab verifyABI @@ -346,44 +366,44 @@ main = do verifyLayoutsCorrect verifyAlignmentsCorrect putStrLn "ABI verification passed" -``` +---- -## Contributing +=== Contributing When modifying the ABI/FFI: -1. **Update ABI first** (`src/abi/*.idr`) - - Modify type definitions - - Update proofs - - Ensure backward compatibility - -2. **Generate C header** - ```bash - idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}}.h - ``` - -3. **Update FFI implementation** (`ffi/zig/src/main.zig`) - - Implement new functions - - Match ABI types exactly - -4. **Add tests** - - Unit tests in Zig - - Integration tests - - ABI verification tests - -5. **Update documentation** - - Function signatures - - Usage examples - - Migration guide (if breaking changes) - -## License +[arabic] +. *Update ABI first* (`+src/abi/*.idr+`) +* Modify type definitions +* Update proofs +* Ensure backward compatibility +. *Generate C header* ++ +[source,bash] +---- +idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}}.h +---- +. *Update FFI implementation* (`+ffi/zig/src/main.zig+`) +* Implement new functions +* Match ABI types exactly +. *Add tests* +* Unit tests in Zig +* Integration tests +* ABI verification tests +. *Update documentation* +* Function signatures +* Usage examples +* Migration guide (if breaking changes) + +=== License MPL-2.0 -## See Also +=== See Also -- [Idris2 Documentation](https://idris2.readthedocs.io) -- [Zig Documentation](https://ziglang.org/documentation/master/) -- [Rhodium Standard Repositories](https://github.com/hyperpolymath/rhodium-standard-repositories) -- [FFI Migration Guide](../ffi-migration-guide.md) -- [ABI Migration Guide](../abi-migration-guide.md) +* https://idris2.readthedocs.io[Idris2 Documentation] +* https://ziglang.org/documentation/master/[Zig Documentation] +* https://github.com/hyperpolymath/rhodium-standard-repositories[Rhodium +Standard Repositories] +* link:../ffi-migration-guide.md[FFI Migration Guide] +* link:../abi-migration-guide.md[ABI Migration Guide] diff --git a/CODE_OF_CONDUCT.adoc b/CODE_OF_CONDUCT.adoc new file mode 100644 index 0000000..5b7c09e --- /dev/null +++ b/CODE_OF_CONDUCT.adoc @@ -0,0 +1,340 @@ +== Code of Conduct + +=== Our Pledge + +We as members, contributors, and leaders pledge to make participation in +PolyglotFormalisms.Jl a harassment-free experience for everyone, +regardless of age, body size, visible or invisible disability, +ethnicity, sex characteristics, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal +appearance, race, caste, colour, religion, or sexual identity and +orientation. + +We pledge to act and interact in ways that contribute to an open, +welcoming, diverse, inclusive, and healthy community. + +We recognise that a thriving open source community requires +*psychological safety* — an environment where people can contribute, ask +questions, make mistakes, and learn without fear of ridicule or +retaliation. + +''''' + +=== Our Standards + +==== Expected Behaviour + +The following behaviours contribute to a positive environment: + +*Communication* - Using welcoming and inclusive language - Being +respectful of differing viewpoints and experiences - Giving and +gracefully accepting constructive feedback - Assuming good intent while +addressing impact - Communicating clearly and patiently, especially with +newcomers + +*Collaboration* - Focusing on what is best for the community - Showing +empathy and kindness toward other community members - Being +collaborative rather than competitive - Mentoring and supporting less +experienced contributors - Celebrating others’ contributions and +successes + +*Professionalism* - Accepting responsibility and apologising to those +affected by our mistakes - Learning from the experience and avoiding +repetition - Respecting others’ time and attention - Staying on topic in +project spaces - Following project guidelines and conventions + +*Accessibility* - Using plain language and avoiding unnecessary jargon - +Providing alt text for images and transcripts for audio/video - Being +patient with those using assistive technologies - Accommodating +different communication styles and needs - Recognising that not everyone +communicates the same way + +==== Unacceptable Behaviour + +The following behaviours are considered harassment and are unacceptable: + +*Harassment* - The use of sexualised language or imagery, and sexual +attention or advances of any kind - Trolling, insulting or derogatory +comments, and personal or political attacks - Public or private +harassment - Deliberate intimidation, stalking, or following (online or +in-person) - Unwelcome physical contact or simulated physical contact +(e.g., emoji) - Sustained disruption of talks, events, or online +discussions + +*Discrimination* - Discriminatory jokes and language - Posting or +threatening to post others’ personally identifying information +("`doxing`") - Advocating for, or encouraging, any of the above +behaviour - Microaggressions — subtle, often unintentional, +discriminatory comments or actions + +*Professional Misconduct* - Publishing others’ private information +without explicit permission - Misrepresenting affiliation or +contributions - Plagiarism or claiming credit for others’ work - +Retaliating against anyone who reports a Code of Conduct violation - +Other conduct which could reasonably be considered inappropriate in a +professional setting + +==== Grey Areas + +Some situations require judgement. When uncertain: + +* *Intent vs Impact*: Good intentions do not excuse harmful impact. +Focus on making things right. +* *Power Dynamics*: Those with more power (maintainers, employers, +experienced contributors) must be especially mindful of their impact. +* *Cultural Differences*: What’s acceptable varies by culture. When in +doubt, err on the side of caution and ask. +* *Humour*: Jokes at others’ expense are rarely funny to everyone. Punch +up, not down. + +''''' + +=== Scope + +This Code of Conduct applies within all community spaces, including: + +*Online Spaces* - Repository discussions, issues, and pull/merge +requests - Project chat channels (Matrix, Discord, Slack, IRC) - Mailing +lists and forums - Social media when representing the project - Video +calls and virtual meetings + +*In-Person Spaces* - Conferences, meetups, and events - Workshops and +training sessions - Any gathering where you represent the project + +*Representation* This Code of Conduct also applies when an individual is +officially representing the community in public spaces. Examples +include: + +* Using an official project email address +* Posting via an official social media account +* Acting as an appointed representative at an event +* Speaking on behalf of the project + +''''' + +=== Enforcement + +==== Reporting + +If you experience or witness unacceptable behaviour, or have any other +concerns, please report it as soon as possible. + +*How to Report* + +[width="99%",cols="30%,33%,37%",options="header",] +|=== +|Method |Details |Best For +|*Email* |j.d.a.jewell@open.ac.uk |Detailed reports, sensitive matters + +|*Private Message* |Contact any maintainer directly |Quick questions, +minor issues + +|*Anonymous Form* |[Link to form if available] |When you need anonymity +|=== + +*What to Include* + +* Your contact information (unless anonymous) +* Names/usernames of those involved +* Description of what happened +* When and where it occurred +* Any witnesses +* Any supporting evidence (screenshots, links) +* How you would like us to respond (if you have a preference) + +*What Happens Next* + +[arabic] +. You will receive acknowledgment within *\{\{RESPONSE_TIME}}* +. The \{\{CONDUCT_TEAM}} will review the report +. We may ask for additional information +. We will determine appropriate action +. We will inform you of the outcome (respecting others’ privacy) + +==== Confidentiality + +All reports will be handled with discretion: + +* Reporter identity is protected by default +* Details are shared only with those who need to know +* We will ask before naming you in any communication +* Anonymous reports are accepted and investigated + +==== Conflicts of Interest + +If a \{\{CONDUCT_TEAM}} member is involved in an incident: + +* They will recuse themselves from the process +* Another maintainer or external party will handle the report +* We will disclose any potential conflicts + +''''' + +=== Enforcement Guidelines + +The \{\{CONDUCT_TEAM}} will follow these guidelines in determining +consequences: + +==== 1. Correction + +*Community Impact*: Use of inappropriate language or other behaviour +deemed unprofessional or unwelcome. + +*Consequence*: A private, written warning providing clarity around the +nature of the violation and an explanation of why the behaviour was +inappropriate. A public apology may be requested. + +*Duration*: Immediate + +==== 2. Warning + +*Community Impact*: A violation through a single incident or series of +actions. + +*Consequence*: A warning with consequences for continued behaviour. No +interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, for a specified period. This +includes avoiding interactions in community spaces as well as external +channels like social media. Violating these terms may lead to a +temporary or permanent ban. + +*Duration*: 1-4 weeks + +==== 3. Temporary Ban + +*Community Impact*: A serious violation of community standards, +including sustained inappropriate behaviour. + +*Consequence*: A temporary ban from any sort of interaction or public +communication with the community for a specified period. No public or +private interaction with the people involved, including unsolicited +interaction with those enforcing the Code of Conduct, is allowed during +this period. Violating these terms may lead to a permanent ban. + +*Duration*: 1-6 months + +==== 4. Permanent Ban + +*Community Impact*: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behaviour, harassment of an +individual, or aggression toward or disparagement of classes of +individuals. + +*Consequence*: A permanent ban from any sort of public interaction +within the community. + +*Duration*: Permanent (with appeal rights after 12 months) + +==== Enforcement Across Perimeters + +For contributors with elevated access (Perimeter 2 or 1): + +[cols=",",options="header",] +|=== +|Level |Additional Consequence +|Correction |Noted in contributor record +|Warning |Access privileges may be temporarily reduced +|Temporary Ban |Access reduced to Perimeter 3 for ban duration +|Permanent Ban |All access revoked +|=== + +''''' + +=== Appeals + +If you believe an enforcement decision was made in error: + +[arabic] +. *Wait 7 days* after the decision (cooling-off period) +. *Email* j.d.a.jewell@open.ac.uk with subject line "`Appeal: [Original +Report ID]`" +. *Explain* why you believe the decision should be reconsidered +. *Provide* any new information not previously available + +*Appeals Process* + +* Appeals are reviewed by a different \{\{CONDUCT_TEAM}} member than the +original +* You will receive a response within 14 days +* The appeals decision is final +* You may only appeal once per incident + +*Grounds for Appeal* + +* Procedural errors in the original investigation +* New evidence not previously available +* Disproportionate response to the violation +* Misunderstanding of facts + +''''' + +=== Supporting Those Who Report + +We are committed to supporting those who report violations: + +*We Will* - Believe and take all reports seriously - Respect your +privacy and confidentiality preferences - Keep you informed of progress +(if you wish) - Take steps to protect you from retaliation - Provide +resources if you need support + +*We Will Not* - Require you to confront the person directly - Dismiss +reports without investigation - Reveal your identity without consent - +Tolerate retaliation against reporters - Rush you to make decisions + +''''' + +=== Prevention + +Beyond enforcement, we actively work to prevent issues: + +*Onboarding* - All contributors are expected to read this Code of +Conduct - Perimeter 2 applicants must confirm they’ve read and +understood it - Maintainers receive additional training on enforcement + +*Culture* - We model the behaviour we expect - We intervene early when +we see potential issues - We thank people for positive contributions - +We create opportunities for diverse voices + +*Review* - This Code of Conduct is reviewed annually - Community +feedback is welcomed - Changes are communicated clearly + +''''' + +=== Acknowledgments + +This Code of Conduct is adapted from: + +* https://www.contributor-covenant.org/[Contributor Covenant], version +2.1 +* https://www.djangoproject.com/conduct/[Django Code of Conduct] +* https://www.rust-lang.org/policies/code-of-conduct[Rust Code of +Conduct] +* https://www.python.org/psf/conduct/[Python Community Code of Conduct] + +We thank these communities for their leadership in creating welcoming +spaces. + +''''' + +=== Questions? + +If you have questions about this Code of Conduct: + +* Open a +https://github.com/hyperpolymath/PolyglotFormalisms.jl/discussions[Discussion] +(for general questions) +* Email j.d.a.jewell@open.ac.uk (for private questions) +* Contact any maintainer directly + +''''' + +=== Summary + +*Be kind. Be respectful. Be collaborative.* + +We’re all here because we care about this project. Let’s make it a place +where everyone can do their best work. + +''''' + +Last updated: 2026 · Based on Contributor Covenant 2.1 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 64d4712..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,331 +0,0 @@ - -# Code of Conduct - - - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in PolyglotFormalisms.Jl a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, colour, religion, or sexual identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. - -We recognise that a thriving open source community requires **psychological safety** — an environment where people can contribute, ask questions, make mistakes, and learn without fear of ridicule or retaliation. - ---- - -## Our Standards - -### Expected Behaviour - -The following behaviours contribute to a positive environment: - -**Communication** -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Giving and gracefully accepting constructive feedback -- Assuming good intent while addressing impact -- Communicating clearly and patiently, especially with newcomers - -**Collaboration** -- Focusing on what is best for the community -- Showing empathy and kindness toward other community members -- Being collaborative rather than competitive -- Mentoring and supporting less experienced contributors -- Celebrating others' contributions and successes - -**Professionalism** -- Accepting responsibility and apologising to those affected by our mistakes -- Learning from the experience and avoiding repetition -- Respecting others' time and attention -- Staying on topic in project spaces -- Following project guidelines and conventions - -**Accessibility** -- Using plain language and avoiding unnecessary jargon -- Providing alt text for images and transcripts for audio/video -- Being patient with those using assistive technologies -- Accommodating different communication styles and needs -- Recognising that not everyone communicates the same way - -### Unacceptable Behaviour - -The following behaviours are considered harassment and are unacceptable: - -**Harassment** -- The use of sexualised language or imagery, and sexual attention or advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Deliberate intimidation, stalking, or following (online or in-person) -- Unwelcome physical contact or simulated physical contact (e.g., emoji) -- Sustained disruption of talks, events, or online discussions - -**Discrimination** -- Discriminatory jokes and language -- Posting or threatening to post others' personally identifying information ("doxing") -- Advocating for, or encouraging, any of the above behaviour -- Microaggressions — subtle, often unintentional, discriminatory comments or actions - -**Professional Misconduct** -- Publishing others' private information without explicit permission -- Misrepresenting affiliation or contributions -- Plagiarism or claiming credit for others' work -- Retaliating against anyone who reports a Code of Conduct violation -- Other conduct which could reasonably be considered inappropriate in a professional setting - -### Grey Areas - -Some situations require judgement. When uncertain: - -- **Intent vs Impact**: Good intentions do not excuse harmful impact. Focus on making things right. -- **Power Dynamics**: Those with more power (maintainers, employers, experienced contributors) must be especially mindful of their impact. -- **Cultural Differences**: What's acceptable varies by culture. When in doubt, err on the side of caution and ask. -- **Humour**: Jokes at others' expense are rarely funny to everyone. Punch up, not down. - ---- - -## Scope - -This Code of Conduct applies within all community spaces, including: - -**Online Spaces** -- Repository discussions, issues, and pull/merge requests -- Project chat channels (Matrix, Discord, Slack, IRC) -- Mailing lists and forums -- Social media when representing the project -- Video calls and virtual meetings - -**In-Person Spaces** -- Conferences, meetups, and events -- Workshops and training sessions -- Any gathering where you represent the project - -**Representation** -This Code of Conduct also applies when an individual is officially representing the community in public spaces. Examples include: - -- Using an official project email address -- Posting via an official social media account -- Acting as an appointed representative at an event -- Speaking on behalf of the project - ---- - -## Enforcement - -### Reporting - -If you experience or witness unacceptable behaviour, or have any other concerns, please report it as soon as possible. - -**How to Report** - -| Method | Details | Best For | -|--------|---------|----------| -| **Email** | j.d.a.jewell@open.ac.uk | Detailed reports, sensitive matters | -| **Private Message** | Contact any maintainer directly | Quick questions, minor issues | -| **Anonymous Form** | [Link to form if available] | When you need anonymity | - -**What to Include** - -- Your contact information (unless anonymous) -- Names/usernames of those involved -- Description of what happened -- When and where it occurred -- Any witnesses -- Any supporting evidence (screenshots, links) -- How you would like us to respond (if you have a preference) - -**What Happens Next** - -1. You will receive acknowledgment within **{{RESPONSE_TIME}}** -2. The {{CONDUCT_TEAM}} will review the report -3. We may ask for additional information -4. We will determine appropriate action -5. We will inform you of the outcome (respecting others' privacy) - -### Confidentiality - -All reports will be handled with discretion: - -- Reporter identity is protected by default -- Details are shared only with those who need to know -- We will ask before naming you in any communication -- Anonymous reports are accepted and investigated - -### Conflicts of Interest - -If a {{CONDUCT_TEAM}} member is involved in an incident: - -- They will recuse themselves from the process -- Another maintainer or external party will handle the report -- We will disclose any potential conflicts - ---- - -## Enforcement Guidelines - -The {{CONDUCT_TEAM}} will follow these guidelines in determining consequences: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behaviour deemed unprofessional or unwelcome. - -**Consequence**: A private, written warning providing clarity around the nature of the violation and an explanation of why the behaviour was inappropriate. A public apology may be requested. - -**Duration**: Immediate - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of actions. - -**Consequence**: A warning with consequences for continued behaviour. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. - -**Duration**: 1-4 weeks - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including sustained inappropriate behaviour. - -**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. - -**Duration**: 1-6 months - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behaviour, harassment of an individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the community. - -**Duration**: Permanent (with appeal rights after 12 months) - -### Enforcement Across Perimeters - -For contributors with elevated access (Perimeter 2 or 1): - -| Level | Additional Consequence | -|-------|----------------------| -| Correction | Noted in contributor record | -| Warning | Access privileges may be temporarily reduced | -| Temporary Ban | Access reduced to Perimeter 3 for ban duration | -| Permanent Ban | All access revoked | - ---- - -## Appeals - -If you believe an enforcement decision was made in error: - -1. **Wait 7 days** after the decision (cooling-off period) -2. **Email** j.d.a.jewell@open.ac.uk with subject line "Appeal: [Original Report ID]" -3. **Explain** why you believe the decision should be reconsidered -4. **Provide** any new information not previously available - -**Appeals Process** - -- Appeals are reviewed by a different {{CONDUCT_TEAM}} member than the original -- You will receive a response within 14 days -- The appeals decision is final -- You may only appeal once per incident - -**Grounds for Appeal** - -- Procedural errors in the original investigation -- New evidence not previously available -- Disproportionate response to the violation -- Misunderstanding of facts - ---- - -## Supporting Those Who Report - -We are committed to supporting those who report violations: - -**We Will** -- Believe and take all reports seriously -- Respect your privacy and confidentiality preferences -- Keep you informed of progress (if you wish) -- Take steps to protect you from retaliation -- Provide resources if you need support - -**We Will Not** -- Require you to confront the person directly -- Dismiss reports without investigation -- Reveal your identity without consent -- Tolerate retaliation against reporters -- Rush you to make decisions - ---- - -## Prevention - -Beyond enforcement, we actively work to prevent issues: - -**Onboarding** -- All contributors are expected to read this Code of Conduct -- Perimeter 2 applicants must confirm they've read and understood it -- Maintainers receive additional training on enforcement - -**Culture** -- We model the behaviour we expect -- We intervene early when we see potential issues -- We thank people for positive contributions -- We create opportunities for diverse voices - -**Review** -- This Code of Conduct is reviewed annually -- Community feedback is welcomed -- Changes are communicated clearly - ---- - -## Acknowledgments - -This Code of Conduct is adapted from: - -- [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1 -- [Django Code of Conduct](https://www.djangoproject.com/conduct/) -- [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) -- [Python Community Code of Conduct](https://www.python.org/psf/conduct/) - -We thank these communities for their leadership in creating welcoming spaces. - ---- - -## Questions? - -If you have questions about this Code of Conduct: - -- Open a [Discussion](https://github.com/hyperpolymath/PolyglotFormalisms.jl/discussions) (for general questions) -- Email j.d.a.jewell@open.ac.uk (for private questions) -- Contact any maintainer directly - ---- - -## Summary - -**Be kind. Be respectful. Be collaborative.** - -We're all here because we care about this project. Let's make it a place where everyone can do their best work. - ---- - -Last updated: 2026 · Based on Contributor Covenant 2.1 diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc new file mode 100644 index 0000000..84cc9e8 --- /dev/null +++ b/CONTRIBUTING.adoc @@ -0,0 +1,58 @@ +== Contributing to PolyglotFormalisms.jl + +Thank you for your interest in contributing to PolyglotFormalisms.jl! + +=== How to Contribute + +[arabic] +. *Report Issues*: Found a bug or have a feature request? Open an issue +on GitHub. +. *Submit Pull Requests*: +* Fork the repository +* Create a feature branch +* Make your changes +* Ensure all tests pass: +`+julia --project=. -e 'using Pkg; Pkg.test()'+` +* Submit a pull request + +=== Guidelines + +==== Implementation Requirements + +[arabic] +. *Match aLib Specifications*: All implementations must exactly match +the +https://github.com/hyperpolymath/aggregate-library[aggregate-library] +specifications. +. *Include Tests*: Every function must have conformance tests matching +the aLib spec test cases. +. *Document Properties*: Document all mathematical properties +(commutativity, associativity, etc.) in docstrings. +. *Formal Verification*: When Axiom.jl integration is complete, +properties should be proven with `+@prove+` macros. + +==== Code Style + +* Follow standard Julia style conventions +* Use descriptive variable names +* Include SPDX license headers +* Write clear docstrings with examples + +==== Testing + +All tests must pass before merging: + +[source,bash] +---- +julia --project=. -e 'using Pkg; Pkg.test()' +---- + +==== Commit Messages + +Use conventional commits format: - `+feat:+` for new features - `+fix:+` +for bug fixes - `+docs:+` for documentation changes - `+test:+` for test +additions/modifications + +=== Questions? + +Open a GitHub issue or discussion for any questions about contributing. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 58e1e10..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,57 +0,0 @@ - -# Contributing to PolyglotFormalisms.jl - -Thank you for your interest in contributing to PolyglotFormalisms.jl! - -## How to Contribute - -1. **Report Issues**: Found a bug or have a feature request? Open an issue on GitHub. - -2. **Submit Pull Requests**: - - Fork the repository - - Create a feature branch - - Make your changes - - Ensure all tests pass: `julia --project=. -e 'using Pkg; Pkg.test()'` - - Submit a pull request - -## Guidelines - -### Implementation Requirements - -1. **Match aLib Specifications**: All implementations must exactly match the [aggregate-library](https://github.com/hyperpolymath/aggregate-library) specifications. - -2. **Include Tests**: Every function must have conformance tests matching the aLib spec test cases. - -3. **Document Properties**: Document all mathematical properties (commutativity, associativity, etc.) in docstrings. - -4. **Formal Verification**: When Axiom.jl integration is complete, properties should be proven with `@prove` macros. - -### Code Style - -- Follow standard Julia style conventions -- Use descriptive variable names -- Include SPDX license headers -- Write clear docstrings with examples - -### Testing - -All tests must pass before merging: - -```bash -julia --project=. -e 'using Pkg; Pkg.test()' -``` - -### Commit Messages - -Use conventional commits format: -- `feat:` for new features -- `fix:` for bug fixes -- `docs:` for documentation changes -- `test:` for test additions/modifications - -## Questions? - -Open a GitHub issue or discussion for any questions about contributing. diff --git a/GOVERNANCE.adoc b/GOVERNANCE.adoc index e41020d..9b836fb 100644 --- a/GOVERNANCE.adoc +++ b/GOVERNANCE.adoc @@ -1,162 +1,60 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -= Governance Model -:toc: preamble +== Governance -This document describes the governance model for this repository. +=== Overview -== Overview +This project is governed by the following principles and structures to +ensure transparent, inclusive, and effective decision-making. -This repository follows a **Sole Maintainer Governance Model**: +=== Roles and Responsibilities -* Single maintainer (@hyperpolymath) has full authority over the project -* All contributions are welcome and reviewed by the maintainer -* Decisions are made transparently through GitHub issues and discussions -* The project adheres to the hyperpolymath estate policies where applicable +==== Maintainers -== Core Principles +Maintainers are responsible for: - Reviewing and merging pull requests - +Managing releases and versioning - Ensuring code quality and standards - +Triaging issues and bug reports - Community engagement and support -[cols="1,2"] -|=== -| Principle | Description +==== Contributors -| **Benevolent Dictatorship** | Maintainer has final decision authority but seeks community input +Contributors are expected to: - Follow the code of conduct - Submit +well-documented pull requests - Write tests for new functionality - +Maintain existing tests - Update documentation as needed -| **Meritocracy** | Contributions are judged on technical merit, not contributor identity +=== Decision Making -| **Transparency** | All significant decisions are documented publicly +==== Minor Changes -| **Consensus-Seeking** | Maintainer prefers consensus but will decide when necessary +* Can be made by any maintainer +* Include bug fixes, documentation updates, dependency updates -| **Open Contribution** | Anyone can contribute via fork and pull request +==== Major Changes -|=== +* Require discussion in issues or pull requests +* Include new features, architectural changes, API changes +* Need approval from at least 2 maintainers -== Roles and Permissions +==== Breaking Changes -[cols="1,2,2"] -|=== -| Role | Permissions | Assignment +* Require RFC (Request for Comments) process +* Need approval from majority of maintainers +* Must include migration guide -| **Maintainer** | Write access, merge rights, admin | @hyperpolymath -| **Contributors** | Read access, fork, submit PRs | All GitHub users -| **Users** | Use the software, report issues | All GitHub users +=== Code of Conduct -|=== +All participants are expected to follow our Code of Conduct. Violations +can be reported to the maintainers. -== Decision Making Framework +=== Communication -=== Routine Decisions +* *Issues*: For bug reports and feature requests +* *Discussions*: For questions and general discussion +* *Pull Requests*: For code contributions -* Bug fixes -* Documentation improvements -* Minor feature additions -* Dependency updates +=== Licensing -**Process**: Maintainer reviews and merges PRs that meet quality standards. +All contributions are made under the terms of the repository’s LICENSE +file. By submitting a pull request, you agree to license your +contributions accordingly. -=== Significant Changes +''''' -* New major features -* API changes -* Architecture modifications -* Breaking changes - -**Process**: -. Open issue describing the change -. Discuss with community (minimum 72 hours) -. Maintainer makes final decision -. Document rationale in issue/PR - -=== Structural Decisions - -* Repository purpose/renaming -* License changes -* Ownership transfer -* Deprecation/archival - -**Process**: -. Extended discussion (minimum 1 week) -. Maintainer makes final decision -. Document in CHANGELOG and governance docs - -== Contribution Lifecycle - -[cols="1,2"] -|=== -| Stage | Process - -| **Ideation** | Open issue, discuss feasibility - -| **Development** | Fork, implement, test thoroughly - -| **Review** | Submit PR, maintainer reviews within 7 days - -| **Merge** | Maintainer merges or requests changes - -| **Release** | Maintainer publishes according to project conventions - -|=== - -== Conflict Resolution - -In case of disagreements: - -. Discuss in the relevant GitHub issue or PR -. Provide technical justification for positions -. Maintainer mediates and makes final decision -. Decision is documented and can be revisited later - -== Project Policies - -This repository adheres to hyperpolymath estate-wide policies: - -* **License**: MPL-2.0 for code, CC-BY-SA-4.0 for prose (per standards/LICENCE-POLICY.adoc) -* **Code of Conduct**: Follows hyperpolymath CODE_OF_CONDUCT.md -* **Security**: Follows hyperpolymath SECURITY.md -* **Contributing**: Follows hyperpolymath CONTRIBUTING.adoc conventions - -== Repository-Specific Conventions - -[cols="1,2"] -|=== -| Convention | Description - -| **Signing** | All commits must be signed (SSH or GPG) - -| **SPDX Headers** | All source files must have SPDX license identifiers - -| **Contractiles** | Mustfile, Trustfile, Intendfile, Adjustfile in root - -| **Machine Readable** | META.a2ml in .machine_readable/6a2/ - -| **CI/CD** | GitHub Actions workflows in .github/workflows/ - -|=== - -== Governance Evolution - -As the project grows, this governance model may evolve: - -* **Adding Co-Maintainers**: When contribution volume warrants it -* **Forming a Team**: For complex multi-maintainer projects -* **Adopting TPCF**: For large, multi-repository projects (see rhodium-standard-repositories) - -Changes to this document require the same process as Significant Changes above. - -== See Also - -* link:MAINTAINERS.adoc[Maintainers] -* link:CODE_OF_CONDUCT.md[Code of Conduct] -* link:CONTRIBUTING.adoc[Contributing Guide] -* link:https://github.com/hyperpolymath/standards/blob/main/LICENCE-POLICY.adoc[Estate License Policy] -* link:https://github.com/hyperpolymath/standards[rhodium-standard-repositories (TPCF)] - -== Changelog - -[cols="1,1,1"] -|=== -| Date | Change | By - -| 2026-06-07 | Initial governance model established | @hyperpolymath -|=== +_Last updated: 2026-07-18_ diff --git a/GOVERNANCE.md b/GOVERNANCE.md deleted file mode 100644 index e27364c..0000000 --- a/GOVERNANCE.md +++ /dev/null @@ -1,60 +0,0 @@ -# Governance - -## Overview - -This project is governed by the following principles and structures to ensure transparent, inclusive, and effective decision-making. - -## Roles and Responsibilities - -### Maintainers - -Maintainers are responsible for: -- Reviewing and merging pull requests -- Managing releases and versioning -- Ensuring code quality and standards -- Triaging issues and bug reports -- Community engagement and support - -### Contributors - -Contributors are expected to: -- Follow the code of conduct -- Submit well-documented pull requests -- Write tests for new functionality -- Maintain existing tests -- Update documentation as needed - -## Decision Making - -### Minor Changes -- Can be made by any maintainer -- Include bug fixes, documentation updates, dependency updates - -### Major Changes -- Require discussion in issues or pull requests -- Include new features, architectural changes, API changes -- Need approval from at least 2 maintainers - -### Breaking Changes -- Require RFC (Request for Comments) process -- Need approval from majority of maintainers -- Must include migration guide - -## Code of Conduct - -All participants are expected to follow our Code of Conduct. Violations can be reported to the maintainers. - -## Communication - -- **Issues**: For bug reports and feature requests -- **Discussions**: For questions and general discussion -- **Pull Requests**: For code contributions - -## Licensing - -All contributions are made under the terms of the repository's LICENSE file. -By submitting a pull request, you agree to license your contributions accordingly. - ---- - -*Last updated: 2026-07-18* diff --git a/PROOF-NEEDS.adoc b/PROOF-NEEDS.adoc new file mode 100644 index 0000000..06eaedd --- /dev/null +++ b/PROOF-NEEDS.adoc @@ -0,0 +1,13 @@ +== PROOF-NEEDS.md + +=== Template ABI Cleanup (2026-03-29) + +Template ABI removed – was creating false impression of formal +verification. The removed files (Types.idr, Layout.idr, Foreign.idr) +contained only RSR template scaffolding with unresolved +POLYGLOTFORMALISMS_JL/Jonathan D.A. Jewell placeholders and no +domain-specific proofs. + +When this project needs formal ABI verification, create domain-specific +Idris2 proofs following the pattern in repos like `+typed-wasm+`, +`+proven+`, `+echidna+`, or `+boj-server+`. diff --git a/PROOF-NEEDS.md b/PROOF-NEEDS.md deleted file mode 100644 index b105bc3..0000000 --- a/PROOF-NEEDS.md +++ /dev/null @@ -1,14 +0,0 @@ - -# PROOF-NEEDS.md - -## Template ABI Cleanup (2026-03-29) - -Template ABI removed -- was creating false impression of formal verification. -The removed files (Types.idr, Layout.idr, Foreign.idr) contained only RSR template -scaffolding with unresolved POLYGLOTFORMALISMS_JL/Jonathan D.A. Jewell placeholders and no domain-specific proofs. - -When this project needs formal ABI verification, create domain-specific Idris2 proofs -following the pattern in repos like `typed-wasm`, `proven`, `echidna`, or `boj-server`. diff --git a/README.adoc b/README.adoc index 6cbb91b..7c674cf 100644 --- a/README.adoc +++ b/README.adoc @@ -25,7 +25,7 @@ The aggregate-library defines a minimal intersection of functionality across rad . *Formal Verification* — Mathematical properties are proven using Axiom.jl's `@prove` macro (planned) . *Reference Implementation* — Serves as a semantically verified baseline for other language implementations . *Conformance Testing* — Test suite exactly matches PolyglotFormalisms specifications -. *Cross-Language Bridge* — Enables verification that ReScript, Gleam, Elixir implementations satisfy the same properties +. *Cross-Language Bridge* — Enables verification that AffineScript, Gleam, Elixir implementations satisfy the same properties == Installation @@ -223,7 +223,7 @@ This enables: PolyglotFormalisms.jl serves as a formally verified reference for semantic equivalence checking: -. Implement in target language (ReScript, Gleam, Elixir) +. Implement in target language (AffineScript, Gleam, Elixir) . Run PolyglotFormalisms conformance tests in both languages . Use Axiom.jl + SMTLib.jl to prove semantic equivalence . Generate verification certificate @@ -234,7 +234,7 @@ using PolyglotFormalisms using Axiom using SMTLib -# Verify ReScript implementation semantically equivalent to Julia +# Verify AffineScript implementation semantically equivalent to Julia verify_equivalence( julia_impl = Arithmetic.add, rescript_impl = RescriptFFI.add, @@ -283,7 +283,7 @@ See link:TOPOLOGY.md[TOPOLOGY.md] for a visual architecture map and completion d == Related Projects * https://github.com/hyperpolymath/aggregate-library[aggregate-library] — PolyglotFormalisms specification -* https://github.com/hyperpolymath/alib-for-rescript[alib-for-rescript] — ReScript implementation +* https://github.com/hyperpolymath/alib-for-affinescript[alib-for-affinescript] — AffineScript implementation * https://github.com/hyperpolymath/polyglot-formalisms-gleam[polyglot-formalisms-gleam] — Gleam implementation * https://github.com/hyperpolymath/polyglot-formalisms-elixir[polyglot-formalisms-elixir] — Elixir implementation * https://github.com/hyperpolymath/Axiom.jl[Axiom.jl] — Formal verification for ML models diff --git a/REQUIRES_INITIALISATION.adoc b/REQUIRES_INITIALISATION.adoc new file mode 100644 index 0000000..daa2126 --- /dev/null +++ b/REQUIRES_INITIALISATION.adoc @@ -0,0 +1,75 @@ +== REQUIRES INITIALISATION + +*This repository is not finished being set up.* 3 substitution token(s) +across 2 file(s) still have no value. + +=== Why this is not already done + +This repo was created from `+hyperpolymath/rsr-template-repo+`. The mint +(`+just repo-init+`) fills every token that has a single mechanical +answer — owner, repo, author, dates, licence, branch — and it has done +so here. + +The tokens below are the ones it _deliberately cannot_ answer. They need +a decision or a fact that exists only in your head: what this project is +for, what command builds it, which port the service listens on, whether +a PGP key is held at all. The template’s own token vocabulary says as +much — you cannot sensibly answer "`required invariants`" in a +thirty-second bootstrap. + +They were left *visibly unfilled on purpose*. The alternatives were both +worse: inventing plausible values would put confident falsehoods into a +security policy and an architecture document, and silently deleting the +sections would hide the fact that a decision is owed. A visible gap is +honest; a fabricated answer is not. + +=== Do not delete this file until every item below is resolved + +This file is the only marker that the work is outstanding. Deleting it +early does not finish the setup, it just conceals it — and the next +person or agent to arrive will reasonably assume the repo is complete. + +* *If you are a person:* delete this file yourself once the last item is +done. +* *If you are an agent:* resolve what you legitimately can, leave the +rest, and delete this file only when no token below remains anywhere in +the tree. Do not delete it to make a gate go green. + +Re-running the estate top-up tool will remove this file automatically +once nothing is outstanding, so the safest way to finish is to fix the +tokens and let the check confirm it. + +=== What is needed, and where it goes + +==== `+{{CONDUCT_TEAM}}+` + +Name of the conduct body. If there is no committee, rewrite the sentence +rather than substituting a plural noun into '`a \{\{CONDUCT_TEAM}} +member`'. + +Appears in: + +* `+CODE_OF_CONDUCT.md+` + +==== `+{{PROJECT_UNIQUE_STRENGTH}}+` + +What this does that its alternatives do not. + +Appears in: + +* `+.machine_readable/bot_directives/methodology.a2ml+` + +==== `+{{RESPONSE_TIME}}+` + +Initial-response SLA for a security or conduct report. Promise only what +a solo maintainer can actually meet. + +Appears in: + +* `+CODE_OF_CONDUCT.md+` + +''''' + +Generated by the estate top-up pass. Rationale and the governing rulings +are in `+hyperpolymath/standards+`; the token vocabulary is +`+.machine_readable/ai/PLACEHOLDERS.adoc+` in `+rsr-template-repo+`. diff --git a/REQUIRES_INITIALISATION.md b/REQUIRES_INITIALISATION.md deleted file mode 100644 index f40db95..0000000 --- a/REQUIRES_INITIALISATION.md +++ /dev/null @@ -1,70 +0,0 @@ - - -# REQUIRES INITIALISATION - -**This repository is not finished being set up.** 3 substitution token(s) across 2 file(s) still have no value. - -## Why this is not already done - -This repo was created from `hyperpolymath/rsr-template-repo`. The mint -(`just repo-init`) fills every token that has a single mechanical answer — -owner, repo, author, dates, licence, branch — and it has done so here. - -The tokens below are the ones it *deliberately cannot* answer. They need a -decision or a fact that exists only in your head: what this project is for, -what command builds it, which port the service listens on, whether a PGP key -is held at all. The template's own token vocabulary says as much — you cannot -sensibly answer "required invariants" in a thirty-second bootstrap. - -They were left **visibly unfilled on purpose**. The alternatives were both -worse: inventing plausible values would put confident falsehoods into a -security policy and an architecture document, and silently deleting the -sections would hide the fact that a decision is owed. A visible gap is -honest; a fabricated answer is not. - -## Do not delete this file until every item below is resolved - -This file is the only marker that the work is outstanding. Deleting it early -does not finish the setup, it just conceals it — and the next person or agent -to arrive will reasonably assume the repo is complete. - -- **If you are a person:** delete this file yourself once the last item is done. -- **If you are an agent:** resolve what you legitimately can, leave the rest, - and delete this file only when no token below remains anywhere in the tree. - Do not delete it to make a gate go green. - -Re-running the estate top-up tool will remove this file automatically once -nothing is outstanding, so the safest way to finish is to fix the tokens and -let the check confirm it. - -## What is needed, and where it goes - -### `{{CONDUCT_TEAM}}` - -Name of the conduct body. If there is no committee, rewrite the sentence rather than substituting a plural noun into 'a {{CONDUCT_TEAM}} member'. - -Appears in: - -- `CODE_OF_CONDUCT.md` - -### `{{PROJECT_UNIQUE_STRENGTH}}` - -What this does that its alternatives do not. - -Appears in: - -- `.machine_readable/bot_directives/methodology.a2ml` - -### `{{RESPONSE_TIME}}` - -Initial-response SLA for a security or conduct report. Promise only what a solo maintainer can actually meet. - -Appears in: - -- `CODE_OF_CONDUCT.md` - ---- - -Generated by the estate top-up pass. Rationale and the governing rulings are -in `hyperpolymath/standards`; the token vocabulary is -`.machine_readable/ai/PLACEHOLDERS.adoc` in `rsr-template-repo`. diff --git a/ROADMAP.adoc b/ROADMAP.adoc index 8cac2b9..bf58e5e 100644 --- a/ROADMAP.adoc +++ b/ROADMAP.adoc @@ -1,37 +1,97 @@ -// SPDX-License-Identifier: CC-BY-SA-4.0 -// Copyright (c) Jonathan D.A. Jewell -= Roadmap -:revdate: 2026-02-17 - -== Release Baseline (Must) -- Package installs from a clean Julia environment (`Pkg.add`). -- Precompile, build, test, and module load smoke are gated in CI. -- Versioning stays semver and aligned with release refs/tags. - -== V2 Backlog (Should) -- Expand CI matrix (OS + Julia versions + optional dependency modes). -- Add performance baselines and regression checks. -- Improve machine-readable evidence and release artifact metadata. - -== V2 Backlog (Could) -- Add deeper formal verification evidence exports. -- Add optional accelerator/hardware strategy tracks where relevant. -- Add richer diagnostics and fault-recovery instrumentation. - -== Future Horizons (v2.0+) - -=== Automated Semantic Equivalence -* [ ] **Cross-Language Proof Runner**: A unified dashboard that visualizes proof status across all `aggregate-library` implementations (Julia, ReScript, Elixir, etc.). -* [ ] **Implementation Synthesis**: Automatically generate "correct-by-construction" code in multiple languages from a single PolyglotFormalisms specification. - -=== Hardware-Level Formalisms -* [ ] **Instruction Set Alignment**: Formally verify that `Arithmetic` operations are correctly lowered to specific hardware (e.g., RISC-V) without introducing overflow or precision errors. -* [ ] **Formal Memory Models**: Define and prove cross-language memory consistency models for concurrent operations. - -=== Recursive Formalism -* [ ] **Verified Compiler Gates**: Use PolyglotFormalisms to verify the translation logic between different language IRs (Intermediate Representations). -* [ ] **Self-Verifying Registry**: A package registry where every implementation must provide a PolyglotFormalisms proof of compliance before acceptance. - -=== AI & Reasoning Formalisms -* [ ] **Neural Property Formalism**: Standardized, formally verified properties for describing neural network behavior (e.g., "Non-increasing monotonicity"). -* [ ] **Axiomatic Agent Logic**: Formal definitions for agent intent, value alignment, and safety boundaries (linking to `Axiology.jl`). +== PolyglotFormalisms.jl Development Roadmap + +=== Current State (v1.0) + +Formally verified Julia reference implementation of the +https://github.com/hyperpolymath/aggregate-library[aggregate-library] +common specification: - Core modules: Arithmetic, Comparison, Logical, +StringOps, Collection, Conditional. - 422+ passing conformance tests +matching the cross-language spec. - Semantic alignment with +AffineScript, Gleam, and Elixir implementations. + +*Status:* Stable core implementation. High test coverage. Ready for +formal proof integration. + +''''' + +=== v1.1 - Formal Proof Integration (3-6 months) + +*MUST:* - [ ] *Axiom.jl Core Integration*: Add `+Axiom.jl+` as a +dependency and implement `+@prove+` blocks for all `+Arithmetic+` and +`+Comparison+` properties. - [ ] *Algebraic Property Verification*: +Formally prove commutativity, associativity, and identity laws for all +supported types. - [ ] *String Invariant Proofs*: Prove properties like +length non-negativity and split/join roundtrip consistency. + +*SHOULD:* - [ ] *SMT-LIB Evidence Export*: Generate machine-readable +SMT-LIB 2.0 proof obligations for each module. - [ ] *Proof Certificate +Generation*: Integrate with `+Axiom.jl+` to export signed verification +certificates for each release. - [ ] *Boundary Condition Verification*: +Formally verify behavior for edge cases (NaN, Inf, empty collections, +UTF-8 normalization). + +*COULD:* - [ ] *Collection Universality Proofs*: Prove the "`Free +Theorems`" for map/filter/fold operations using parametricity. - [ ] +*Equivalence Checking Bridge*: Tooling to run semantic equivalence +checks between Julia and AffineScript/Elixir implementations via a +shared SMT backend. + +''''' + +=== v1.2 - Domain Expansion (6-12 months) + +*MUST:* - [ ] *Probabilistic Operations*: Add verified modules for +probabilistic arithmetic (linking to `+ZeroProb.jl+`). - [ ] *Causal +Logic Extension*: Add formalisms for causal necessity and sufficiency +(linking to `+Causals.jl+`). - [ ] *Error Handling Formalism*: Implement +a verified `+Result/Either+` type system that works consistently across +languages. + +*SHOULD:* - [ ] *DateTime Formalism*: A cross-language, formally +verified date and time manipulation module. - [ ] *JSON/Binary Schema +Verification*: Formally verified serialization and deserialization +against shared schemas. - [ ] *Network Protocol Formalism*: Verified +state machine definitions for common protocol headers. + +*COULD:* - [ ] *Graph/Topology Formalism*: Verified graph operations and +knot-theoretic invariants (linking to `+KnotTheory.jl+`). - [ ] +*Physics/Units Formalism*: Formally verified unit conversion and +dimensional analysis. + +''''' + +=== Future Horizons (v2.0+) + +==== Automated Semantic Equivalence + +* [ ] *Cross-Language Proof Runner*: A unified dashboard that visualizes +proof status across all `+aggregate-library+` implementations (Julia, +AffineScript, Elixir, etc.). +* [ ] *Implementation Synthesis*: Automatically generate +"`correct-by-construction`" code in multiple languages from a single +PolyglotFormalisms specification. + +==== Hardware-Level Formalisms + +* [ ] *Instruction Set Alignment*: Formally verify that `+Arithmetic+` +operations are correctly lowered to specific hardware (e.g., RISC-V) +without introducing overflow or precision errors. +* [ ] *Formal Memory Models*: Define and prove cross-language memory +consistency models for concurrent operations. + +==== Recursive Formalism + +* [ ] *Verified Compiler Gates*: Use PolyglotFormalisms to verify the +translation logic between different language IRs (Intermediate +Representations). +* [ ] *Self-Verifying Registry*: A package registry where every +implementation must provide a PolyglotFormalisms proof of compliance +before acceptance. + +==== AI & Reasoning Formalisms + +* [ ] *Neural Property Formalism*: Standardized, formally verified +properties for describing neural network behavior (e.g., +"`Non-increasing monotonicity`"). +* [ ] *Axiomatic Agent Logic*: Formal definitions for agent intent, +value alignment, and safety boundaries (linking to `+Axiology.jl+`). diff --git a/ROADMAP.md b/ROADMAP.md deleted file mode 100644 index 9530e50..0000000 --- a/ROADMAP.md +++ /dev/null @@ -1,70 +0,0 @@ - -# PolyglotFormalisms.jl Development Roadmap - -## Current State (v1.0) - -Formally verified Julia reference implementation of the [aggregate-library](https://github.com/hyperpolymath/aggregate-library) common specification: -- Core modules: Arithmetic, Comparison, Logical, StringOps, Collection, Conditional. -- 422+ passing conformance tests matching the cross-language spec. -- Semantic alignment with ReScript, Gleam, and Elixir implementations. - -**Status:** Stable core implementation. High test coverage. Ready for formal proof integration. - ---- - -## v1.1 - Formal Proof Integration (3-6 months) - -**MUST:** -- [ ] **Axiom.jl Core Integration**: Add `Axiom.jl` as a dependency and implement `@prove` blocks for all `Arithmetic` and `Comparison` properties. -- [ ] **Algebraic Property Verification**: Formally prove commutativity, associativity, and identity laws for all supported types. -- [ ] **String Invariant Proofs**: Prove properties like length non-negativity and split/join roundtrip consistency. - -**SHOULD:** -- [ ] **SMT-LIB Evidence Export**: Generate machine-readable SMT-LIB 2.0 proof obligations for each module. -- [ ] **Proof Certificate Generation**: Integrate with `Axiom.jl` to export signed verification certificates for each release. -- [ ] **Boundary Condition Verification**: Formally verify behavior for edge cases (NaN, Inf, empty collections, UTF-8 normalization). - -**COULD:** -- [ ] **Collection Universality Proofs**: Prove the "Free Theorems" for map/filter/fold operations using parametricity. -- [ ] **Equivalence Checking Bridge**: Tooling to run semantic equivalence checks between Julia and ReScript/Elixir implementations via a shared SMT backend. - ---- - -## v1.2 - Domain Expansion (6-12 months) - -**MUST:** -- [ ] **Probabilistic Operations**: Add verified modules for probabilistic arithmetic (linking to `ZeroProb.jl`). -- [ ] **Causal Logic Extension**: Add formalisms for causal necessity and sufficiency (linking to `Causals.jl`). -- [ ] **Error Handling Formalism**: Implement a verified `Result/Either` type system that works consistently across languages. - -**SHOULD:** -- [ ] **DateTime Formalism**: A cross-language, formally verified date and time manipulation module. -- [ ] **JSON/Binary Schema Verification**: Formally verified serialization and deserialization against shared schemas. -- [ ] **Network Protocol Formalism**: Verified state machine definitions for common protocol headers. - -**COULD:** -- [ ] **Graph/Topology Formalism**: Verified graph operations and knot-theoretic invariants (linking to `KnotTheory.jl`). -- [ ] **Physics/Units Formalism**: Formally verified unit conversion and dimensional analysis. - ---- - -## Future Horizons (v2.0+) - -### Automated Semantic Equivalence -- [ ] **Cross-Language Proof Runner**: A unified dashboard that visualizes proof status across all `aggregate-library` implementations (Julia, ReScript, Elixir, etc.). -- [ ] **Implementation Synthesis**: Automatically generate "correct-by-construction" code in multiple languages from a single PolyglotFormalisms specification. - -### Hardware-Level Formalisms -- [ ] **Instruction Set Alignment**: Formally verify that `Arithmetic` operations are correctly lowered to specific hardware (e.g., RISC-V) without introducing overflow or precision errors. -- [ ] **Formal Memory Models**: Define and prove cross-language memory consistency models for concurrent operations. - -### Recursive Formalism -- [ ] **Verified Compiler Gates**: Use PolyglotFormalisms to verify the translation logic between different language IRs (Intermediate Representations). -- [ ] **Self-Verifying Registry**: A package registry where every implementation must provide a PolyglotFormalisms proof of compliance before acceptance. - -### AI & Reasoning Formalisms -- [ ] **Neural Property Formalism**: Standardized, formally verified properties for describing neural network behavior (e.g., "Non-increasing monotonicity"). -- [ ] **Axiomatic Agent Logic**: Formal definitions for agent intent, value alignment, and safety boundaries (linking to `Axiology.jl`). diff --git a/RSR_OUTLINE.adoc b/RSR_OUTLINE.adoc index 78bed59..0537aeb 100644 --- a/RSR_OUTLINE.adoc +++ b/RSR_OUTLINE.adoc @@ -148,8 +148,8 @@ project/ === Language Tiers -* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, ReScript -* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Nix +* **Tier 1** (Gold): Rust, Elixir, Zig, Ada, Haskell, AffineScript +* **Tier 2** (Silver): Nickel, Racket, Guile Scheme, Guix * **Infrastructure**: Guix channels, derivations === Required Files @@ -163,12 +163,12 @@ project/ * `.well-known/security.txt` * `.well-known/ai.txt` * `.well-known/humans.txt` -* `guix.scm` OR `flake.nix` +* `guix.scm` OR `flake.guix` === Prohibited * Python outside `salt/` directory -* TypeScript/JavaScript (use ReScript) +* TypeScript/JavaScript (use AffineScript) * CUE (use Guile/Nickel) * `Dockerfile` (use `Containerfile`) diff --git a/SECURITY.adoc b/SECURITY.adoc new file mode 100644 index 0000000..0569a23 --- /dev/null +++ b/SECURITY.adoc @@ -0,0 +1,31 @@ +== Security Policy + +=== Supported Versions + +[cols=",",options="header",] +|=== +|Version |Supported +|0.1.x |:white_check_mark: +|=== + +=== Reporting a Vulnerability + +If you discover a security vulnerability in PolyglotFormalisms.jl, +please report it by: + +[arabic] +. *Email*: j.d.a.jewell@open.ac.uk +. *GitHub Security Advisory*: Use the "`Security`" tab to report +privately + +Please include: - Description of the vulnerability - Steps to reproduce +- Potential impact - Suggested fix (if any) + +We aim to respond to security reports within 48 hours. + +=== Security Practices + +* All GitHub Actions are SHA-pinned to prevent supply chain attacks +* Dependencies are minimal (Test stdlib only) +* OpenSSF Scorecard runs weekly +* CodeQL analysis enabled diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 7abf5a6..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| 0.1.x | :white_check_mark: | - -## Reporting a Vulnerability - -If you discover a security vulnerability in PolyglotFormalisms.jl, please report it by: - -1. **Email**: j.d.a.jewell@open.ac.uk -2. **GitHub Security Advisory**: Use the "Security" tab to report privately - -Please include: -- Description of the vulnerability -- Steps to reproduce -- Potential impact -- Suggested fix (if any) - -We aim to respond to security reports within 48 hours. - -## Security Practices - -- All GitHub Actions are SHA-pinned to prevent supply chain attacks -- Dependencies are minimal (Test stdlib only) -- OpenSSF Scorecard runs weekly -- CodeQL analysis enabled diff --git a/TEST-NEEDS.adoc b/TEST-NEEDS.adoc new file mode 100644 index 0000000..ff48a48 --- /dev/null +++ b/TEST-NEEDS.adoc @@ -0,0 +1,52 @@ +== TEST-NEEDS: PolyglotFormalisms.jl + +=== CRG Grade: C — ACHIEVED 2026-04-04 + +=== Current State + +[cols=",,",options="header",] +|=== +|Category |Count |Details +|*Source modules* |17 |2,943 lines +|*Test files* |7 |1,292 lines, 635 @test/@testset +|*Benchmarks* |0 |None +|*E2E tests* |0 |None +|=== + +=== What’s Missing + +==== E2E Tests + +* [ ] No end-to-end formalism translation/verification test + +==== Aspect Tests + +* [ ] *Performance*: No benchmarks for formalism operations +* [ ] *Error handling*: No tests for malformed formalisms, type +mismatches across paradigms + +==== Benchmarks Needed + +* [ ] Formalism translation throughput +* [ ] Cross-paradigm verification time + +==== Self-Tests + +* [ ] No self-consistency check + +=== FLAGGED ISSUES + +* *635 tests across 7 files* – excellent coverage +* *17 modules with 635 tests = 37 tests/module* – strong ratio +* *0 benchmarks* – gap for a computation library +* *7 test files* – best test file organization among Julia packages + +=== Priority: P3 (LOW) – well tested, needs benchmarks + +=== FAKE-FUZZ ALERT + +* `+tests/fuzz/placeholder.txt+` is a scorecard placeholder inherited +from rsr-template-repo — it does NOT provide real fuzz testing +* Replace with an actual fuzz harness (see +rsr-template-repo/tests/fuzz/README.adoc) or remove the file +* Priority: P2 — creates false impression of fuzz coverage diff --git a/TEST-NEEDS.md b/TEST-NEEDS.md deleted file mode 100644 index fff9954..0000000 --- a/TEST-NEEDS.md +++ /dev/null @@ -1,46 +0,0 @@ - -# TEST-NEEDS: PolyglotFormalisms.jl - -## CRG Grade: C — ACHIEVED 2026-04-04 - -## Current State - -| Category | Count | Details | -|----------|-------|---------| -| **Source modules** | 17 | 2,943 lines | -| **Test files** | 7 | 1,292 lines, 635 @test/@testset | -| **Benchmarks** | 0 | None | -| **E2E tests** | 0 | None | - -## What's Missing - -### E2E Tests -- [ ] No end-to-end formalism translation/verification test - -### Aspect Tests -- [ ] **Performance**: No benchmarks for formalism operations -- [ ] **Error handling**: No tests for malformed formalisms, type mismatches across paradigms - -### Benchmarks Needed -- [ ] Formalism translation throughput -- [ ] Cross-paradigm verification time - -### Self-Tests -- [ ] No self-consistency check - -## FLAGGED ISSUES -- **635 tests across 7 files** -- excellent coverage -- **17 modules with 635 tests = 37 tests/module** -- strong ratio -- **0 benchmarks** -- gap for a computation library -- **7 test files** -- best test file organization among Julia packages - -## Priority: P3 (LOW) -- well tested, needs benchmarks - -## FAKE-FUZZ ALERT - -- `tests/fuzz/placeholder.txt` is a scorecard placeholder inherited from rsr-template-repo — it does NOT provide real fuzz testing -- Replace with an actual fuzz harness (see rsr-template-repo/tests/fuzz/README.adoc) or remove the file -- Priority: P2 — creates false impression of fuzz coverage diff --git a/TOPOLOGY.md b/TOPOLOGY.adoc similarity index 88% rename from TOPOLOGY.md rename to TOPOLOGY.adoc index f1a471e..56fc872 100644 --- a/TOPOLOGY.md +++ b/TOPOLOGY.adoc @@ -1,15 +1,8 @@ - - - +== PolyglotFormalisms.jl — Project Topology -# PolyglotFormalisms.jl — Project Topology +=== System Architecture -## System Architecture - -``` +.... ┌─────────────────────────────────────────┐ │ EXTERNALS / ECOSYSTEM │ ├─────────────────────────────────────────┤ @@ -46,11 +39,11 @@ Copyright (c) Jonathan D.A. Jewell │ .github/workflows/ (RSR Gate) │ │ Project.toml │ └─────────────────────────────────────────┘ -``` +.... -## Completion Dashboard +=== Completion Dashboard -``` +.... COMPONENT STATUS NOTES ───────────────────────────────── ────────────────── ───────────────────────────────── COMMON MODULES @@ -72,26 +65,27 @@ REPO INFRASTRUCTURE ───────────────────────────────────────────────────────────────────────────── OVERALL: ██████████ 100% Module Feature Complete -``` +.... -## Key Dependencies +=== Key Dependencies -``` +.... Arithmetic ─────────► Comparison ─────────► Logical │ StringOps ──────────► Collection ─────────► Conditional │ Conformance Tests ────► Axiom Integration ──► COMPLETE -``` +.... -## Update Protocol +=== Update Protocol This file is maintained by both humans and AI agents. When updating: -1. **After completing a component**: Change its bar and percentage -2. **After adding a component**: Add a new row in the appropriate section -3. **After architectural changes**: Update the ASCII diagram -4. **Date**: Update the `Last updated` comment at the top of this file +[arabic] +. *After completing a component*: Change its bar and percentage +. *After adding a component*: Add a new row in the appropriate section +. *After architectural changes*: Update the ASCII diagram +. *Date*: Update the `+Last updated+` comment at the top of this file -Progress bars use: `█` (filled) and `░` (empty), 10 characters wide. -Percentages: 0%, 10%, 20%, ... 100% (in 10% increments). +Progress bars use: `+█+` (filled) and `+░+` (empty), 10 characters wide. +Percentages: 0%, 10%, 20%, … 100% (in 10% increments). diff --git a/docs/CrossLanguageStatus.adoc b/docs/CrossLanguageStatus.adoc new file mode 100644 index 0000000..6473360 --- /dev/null +++ b/docs/CrossLanguageStatus.adoc @@ -0,0 +1,297 @@ +== Cross-Language Implementation Status + +This document tracks the implementation status of PolyglotFormalisms +Common Library operations across multiple programming languages. + +=== Implementation Summary + +[width="99%",cols="21%,21%,17%,15%,13%,13%",options="header",] +|=== +|Language |Repository |Version |Status |Tests |Notes +|*Julia* +|https://github.com/hyperpolymath/PolyglotFormalisms.jl[PolyglotFormalisms.jl] +|0.3.0 |✅ Complete |287/287 |Reference implementation + +|*AffineScript* +|https://github.com/hyperpolymath/alib-for-affinescript[alib-for-affinescript] +|0.3.0 |✅ Complete |Full coverage |packages/common/ + +|*Gleam* +|https://github.com/hyperpolymath/polyglot_formalisms_gleam[polyglot_formalisms_gleam] +|0.3.0 |✅ Complete |131/131 |BEAM runtime, gleeunit tests + +|*Elixir* +|https://github.com/hyperpolymath/polyglot_formalisms_elixir[polyglot_formalisms_elixir] +|0.3.0 |✅ Complete |253/253 |120 doctests + 133 unit tests +|=== + +=== Module Completion Status + +==== Arithmetic Module + +[cols=",,,,,",options="header",] +|=== +|Operation |Julia |AffineScript |Gleam |Elixir |Notes +|`+add+` |✅ |✅ |✅ |✅ |Float operation +|`+subtract+` |✅ |✅ |✅ |✅ |Float operation +|`+multiply+` |✅ |✅ |✅ |✅ |Float operation +|`+divide+` |✅ |✅ |✅ |✅ |Float operation +|`+modulo+` |✅ |✅ |✅ |✅ |Integer operation +|=== + +==== Comparison Module + +[cols=",,,,,",options="header",] +|=== +|Operation |Julia |AffineScript |Gleam |Elixir |Notes +|`+less_than+` |✅ |✅ |✅ |✅ |Float comparison +|`+greater_than+` |✅ |✅ |✅ |✅ |Float comparison +|`+equal+` |✅ |✅ |✅ |✅ |Float comparison +|`+not_equal+` |✅ |✅ |✅ |✅ |Float comparison +|`+less_equal+` |✅ |✅ |✅ |✅ |Float comparison +|`+greater_equal+` |✅ |✅ |✅ |✅ |Float comparison +|=== + +==== Logical Module + +[width="100%",cols="22%,14%,20%,14%,16%,14%",options="header",] +|=== +|Operation |Julia |AffineScript |Gleam |Elixir |Notes +|`+and+` |✅ |✅ |✅ |✅ `+logical_and+` |Elixir renamed due to keyword +conflict + +|`+or+` |✅ |✅ |✅ |✅ `+logical_or+` |Elixir renamed due to keyword +conflict + +|`+not+` |✅ |✅ |✅ |✅ `+logical_not+` |Elixir renamed due to keyword +conflict +|=== + +==== String Module + +[width="100%",cols="22%,14%,20%,14%,16%,14%",options="header",] +|=== +|Operation |Julia |AffineScript |Gleam |Elixir |Notes +|`+concat+` |✅ |✅ |✅ |✅ |String concatenation + +|`+length+` |✅ |✅ |✅ |✅ `+string_length+` |Elixir renamed to avoid +stdlib conflict + +|`+substring+` |✅ |✅ |✅ |✅ |Julia/Elixir: 1-based; +AffineScript/Gleam: 0-based + +|`+index_of+` |✅ |✅ |✅ |✅ |Julia/Elixir: returns 0 when not found; +AffineScript/Gleam: returns -1 + +|`+contains+` |✅ |✅ |✅ |✅ `+string_contains+` |Elixir renamed to +avoid stdlib conflict + +|`+starts_with+` |✅ |✅ |✅ |✅ |Prefix check + +|`+ends_with+` |✅ |✅ |✅ |✅ |Suffix check + +|`+to_uppercase+` |✅ |✅ |✅ |✅ |Unicode-aware + +|`+to_lowercase+` |✅ |✅ |✅ |✅ |Unicode-aware + +|`+trim+` |✅ |✅ |✅ |✅ `+string_trim+` |Elixir renamed to avoid +stdlib conflict + +|`+split+` |✅ |✅ |✅ |✅ `+string_split+` |Elixir renamed to avoid +stdlib conflict + +|`+join+` |✅ |✅ |✅ |✅ `+string_join+` |Elixir renamed to avoid +stdlib conflict + +|`+replace+` |✅ |✅ |✅ |✅ `+string_replace+` |Elixir renamed to avoid +stdlib conflict + +|`+is_empty+` |✅ |✅ |✅ |✅ |Boolean check +|=== + +=== Language-Specific Implementation Notes + +==== Julia (Reference Implementation) + +* *File locations*: `+src/arithmetic.jl+`, `+src/comparison.jl+`, +`+src/logical.jl+`, `+src/string.jl+` +* *Test locations*: `+test/arithmetic_tests.jl+`, +`+test/comparison_tests.jl+`, `+test/logical_tests.jl+`, +`+test/string_tests.jl+` +* *Operators*: Standard Julia operators (`+++`, `+-+`, `+*+`, `+/+`, +`+mod+`, `+<+`, `+>+`, `+==+`, `+&&+`, `+||+`, `+!+`) +* *Type system*: Generic `+Number+` and `+Bool+` types, +`+AbstractString+` for strings +* *Test framework*: Test.jl with `+@testset+` and `+@test+` macros +* *Total tests*: 287 (59 arithmetic + 98 comparison + 41 logical + 89 +string) +* *String indexing*: 1-based (Julia convention) + +==== AffineScript + +* *File locations*: `+packages/common/Arithmetic.res+`, +`+packages/common/Comparison.res+`, `+packages/common/Logical.res+`, +`+packages/common/String.res+` +* *Test locations*: `+tests/Arithmetic_test.res+`, +`+tests/Comparison_test.res+`, `+tests/Logical_test.res+`, +`+tests/String_test.res+` +* *Operators*: Float-specific operators (`++.+`, `+-.+`, `+*.+`, `+/.+`, +standard comparison, `+&&+`, `+||+`, `+!+`) +* *Type system*: Explicit `+float+`, `+bool+`, and `+string+` types +* *Test framework*: RescriptMocha +* *Modulo*: Uses `+mod_float+` for float modulo operation +* *String indexing*: 0-based (JavaScript/AffineScript convention) +* *String operators*: Uses `++++` for concatenation, standard String +module functions + +==== Gleam + +* *File locations*: `+src/arithmetic.gleam+`, `+src/comparison.gleam+`, +`+src/logical.gleam+`, `+src/string_ops.gleam+` +* *Test locations*: `+test/arithmetic_test.gleam+`, +`+test/comparison_test.gleam+`, `+test/logical_test.gleam+`, +`+test/string_ops_test.gleam+` +* *Operators*: +** Arithmetic: `++.+`, `+-.+`, `+*.+`, `+/.+` (dot required for floats) +** Ordering: `+<.+`, `+>.+`, `+<=.+`, `+>=.+` (dot required for floats) +** Equality: `+==+`, `+!=+` (no dot, works for all types) +** Logical: `+&&+`, `+||+`, `+!+` +** String: `+<>+` for concatenation +* *Type system*: Separate `+Float+`, `+Int+`, `+Bool+`, and `+String+` +types +* *Runtime*: BEAM (Erlang VM) or JavaScript +* *Modulo*: Integer operation using `+%+` +* *Test framework*: Gleeunit +* *Total tests*: 131 (28 arithmetic + 35 comparison + 22 logical + 7 +property tests + 39 string) +* *String indexing*: 0-based (Gleam convention) +* *String graphemes*: Uses grapheme-aware length and splitting + +==== Elixir + +* *File locations*: `+lib/arithmetic.ex+`, `+lib/comparison.ex+`, +`+lib/logical.ex+`, `+lib/string_ops.ex+` +* *Test locations*: `+test/arithmetic_test.exs+`, +`+test/comparison_test.exs+`, `+test/logical_test.exs+`, +`+test/string_ops_test.exs+` +* *Operators*: Standard Elixir operators (automatically promoted to +float for division), `+<>+` for string concatenation +* *Type system*: Dynamic with guards and `+@spec+` annotations +* *Runtime*: BEAM (Erlang VM) +* *Modulo*: Uses `+rem+` for remainder (Erlang semantics) +* *Test framework*: ExUnit with doctests +* *Total tests*: 253 (120 doctests + 133 unit tests) +* *Naming exceptions*: +** Logical: `+logical_and+`, `+logical_or+`, `+logical_not+` (to avoid +Kernel keyword conflicts) +** String: `+string_length+`, `+string_contains+`, `+string_trim+`, +`+string_split+`, `+string_join+`, `+string_replace+` (to avoid stdlib +conflicts) +* *String indexing*: 1-based (matching Julia for cross-language +consistency) +* *String graphemes*: Uses grapheme-aware operations + +=== Operator Comparison Table + +[cols=",,,,",options="header",] +|=== +|Operation |Julia |AffineScript |Gleam |Elixir +|Float addition |`+++` |`++.+` |`++.+` |`+++` +|Float subtraction |`+-+` |`+-.+` |`+-.+` |`+-+` +|Float multiplication |`+*+` |`+*.+` |`+*.+` |`+*+` +|Float division |`+/+` |`+/.+` |`+/.+` |`+/+` +|Integer modulo |`+mod+` |`+mod+` |`+%+` |`+rem+` +|Less than (float) |`+<+` |`+<+` |`+<.+` |`+<+` +|Greater than (float) |`+>+` |`+>+` |`+>.+` |`+>+` +|Equal (any type) |`+==+` |`+==+` |`+==+` |`+==+` +|Not equal (any type) |`+!=+` |`+!=+` |`+!=+` |`+!=+` +|Less or equal (float) |`+<=+` |`+<=+` |`+<=.+` |`+<=+` +|Greater or equal (float) |`+>=+` |`+>=+` |`+>=.+` |`+>=+` +|Logical AND |`+&&+` |`+&&+` |`+&&+` |`+and+` +|Logical OR |`+\|\|+` |`+\|\|+` |`+\|\|+` |`+or+` +|Logical NOT |`+!+` |`+!+` |`+!+` |`+not+` +|=== + +*Note:* Gleam uses dotted operators (`++.+`, `+<.+`, etc.) only for +arithmetic and float ordering comparisons, but not for equality (`+==+`, +`+!=+`), which works for all types. + +=== Semantic Equivalence + +All implementations maintain semantic equivalence across languages: + +==== Behavioral Consistency + +[arabic] +. *Mathematical properties preserved*: +* Commutativity, associativity, distributivity (where applicable) +* Identity elements and annihilators +* Transitivity, reflexivity, symmetry (for comparisons) +* Boolean algebra laws (De Morgan’s, excluded middle, non-contradiction) +. *IEEE 754 floating-point semantics*: +* Division by zero behavior +* NaN propagation +* Infinity handling +* Signed zeros +. *Edge cases handled consistently*: +* All languages follow their runtime’s floating-point model +* Integer operations respect overflow/underflow behavior +* Modulo follows BEAM `+rem+` semantics (Gleam/Elixir) or +language-specific + +==== Verification Strategy + +Cross-language verification is achieved through: + +[arabic] +. *Property-based testing*: All implementations test the same +mathematical properties +. *Canonical test suite*: Test cases match across all languages +. *Edge case coverage*: Identical edge case handling (NaN, Inf, signed +zeros) +. *Documentation*: All implementations document the same behavioral +semantics + +=== Future Work + +==== Pending Implementations + +* *Python* (planned) +* *Rust* (planned) +* *Haskell* (planned) +* *OCaml* (planned) + +==== Pending Tasks + +[arabic] +. Create Gleam test suite (gleeunit) +. Formal verification proofs (using Isabelle/HOL or Coq) +. Property-based tests using QuickCheck-style frameworks +. Cross-language fuzzing for edge case discovery +. Performance benchmarks across implementations +. Automated semantic equivalence verification + +=== License + +All implementations use MPL-2.0 (Palimpsest Meta-Public License). + +=== Contributing + +When adding a new language implementation: + +[arabic] +. Create a new repository following naming convention: +`+polyglot_formalisms_{language}+` +. Implement all three modules (Arithmetic, Comparison, Logical) +. Maintain semantic equivalence with reference implementation +. Include comprehensive test suite (unit tests + property tests) +. Document language-specific considerations +. Update this status document + +=== References + +* https://github.com/hyperpolymath/PolyglotFormalisms.jl[PolyglotFormalisms +Specification] +* https://ieeexplore.ieee.org/document/8766229[IEEE 754 Floating-Point +Standard] +* https://en.wikipedia.org/wiki/Boolean_algebra[Boolean Algebra] diff --git a/docs/CrossLanguageStatus.md b/docs/CrossLanguageStatus.md deleted file mode 100644 index 9f6097a..0000000 --- a/docs/CrossLanguageStatus.md +++ /dev/null @@ -1,208 +0,0 @@ - -# Cross-Language Implementation Status - -This document tracks the implementation status of PolyglotFormalisms Common Library operations across multiple programming languages. - -## Implementation Summary - -| Language | Repository | Version | Status | Tests | Notes | -|----------|-----------|---------|--------|-------|-------| -| **Julia** | [PolyglotFormalisms.jl](https://github.com/hyperpolymath/PolyglotFormalisms.jl) | 0.3.0 | ✅ Complete | 287/287 | Reference implementation | -| **ReScript** | [alib-for-rescript](https://github.com/hyperpolymath/alib-for-rescript) | 0.3.0 | ✅ Complete | Full coverage | packages/common/ | -| **Gleam** | [polyglot_formalisms_gleam](https://github.com/hyperpolymath/polyglot_formalisms_gleam) | 0.3.0 | ✅ Complete | 131/131 | BEAM runtime, gleeunit tests | -| **Elixir** | [polyglot_formalisms_elixir](https://github.com/hyperpolymath/polyglot_formalisms_elixir) | 0.3.0 | ✅ Complete | 253/253 | 120 doctests + 133 unit tests | - -## Module Completion Status - -### Arithmetic Module - -| Operation | Julia | ReScript | Gleam | Elixir | Notes | -|-----------|-------|----------|-------|--------|-------| -| `add` | ✅ | ✅ | ✅ | ✅ | Float operation | -| `subtract` | ✅ | ✅ | ✅ | ✅ | Float operation | -| `multiply` | ✅ | ✅ | ✅ | ✅ | Float operation | -| `divide` | ✅ | ✅ | ✅ | ✅ | Float operation | -| `modulo` | ✅ | ✅ | ✅ | ✅ | Integer operation | - -### Comparison Module - -| Operation | Julia | ReScript | Gleam | Elixir | Notes | -|-----------|-------|----------|-------|--------|-------| -| `less_than` | ✅ | ✅ | ✅ | ✅ | Float comparison | -| `greater_than` | ✅ | ✅ | ✅ | ✅ | Float comparison | -| `equal` | ✅ | ✅ | ✅ | ✅ | Float comparison | -| `not_equal` | ✅ | ✅ | ✅ | ✅ | Float comparison | -| `less_equal` | ✅ | ✅ | ✅ | ✅ | Float comparison | -| `greater_equal` | ✅ | ✅ | ✅ | ✅ | Float comparison | - -### Logical Module - -| Operation | Julia | ReScript | Gleam | Elixir | Notes | -|-----------|-------|----------|-------|--------|-------| -| `and` | ✅ | ✅ | ✅ | ✅ `logical_and` | Elixir renamed due to keyword conflict | -| `or` | ✅ | ✅ | ✅ | ✅ `logical_or` | Elixir renamed due to keyword conflict | -| `not` | ✅ | ✅ | ✅ | ✅ `logical_not` | Elixir renamed due to keyword conflict | - -### String Module - -| Operation | Julia | ReScript | Gleam | Elixir | Notes | -|-----------|-------|----------|-------|--------|-------| -| `concat` | ✅ | ✅ | ✅ | ✅ | String concatenation | -| `length` | ✅ | ✅ | ✅ | ✅ `string_length` | Elixir renamed to avoid stdlib conflict | -| `substring` | ✅ | ✅ | ✅ | ✅ | Julia/Elixir: 1-based; ReScript/Gleam: 0-based | -| `index_of` | ✅ | ✅ | ✅ | ✅ | Julia/Elixir: returns 0 when not found; ReScript/Gleam: returns -1 | -| `contains` | ✅ | ✅ | ✅ | ✅ `string_contains` | Elixir renamed to avoid stdlib conflict | -| `starts_with` | ✅ | ✅ | ✅ | ✅ | Prefix check | -| `ends_with` | ✅ | ✅ | ✅ | ✅ | Suffix check | -| `to_uppercase` | ✅ | ✅ | ✅ | ✅ | Unicode-aware | -| `to_lowercase` | ✅ | ✅ | ✅ | ✅ | Unicode-aware | -| `trim` | ✅ | ✅ | ✅ | ✅ `string_trim` | Elixir renamed to avoid stdlib conflict | -| `split` | ✅ | ✅ | ✅ | ✅ `string_split` | Elixir renamed to avoid stdlib conflict | -| `join` | ✅ | ✅ | ✅ | ✅ `string_join` | Elixir renamed to avoid stdlib conflict | -| `replace` | ✅ | ✅ | ✅ | ✅ `string_replace` | Elixir renamed to avoid stdlib conflict | -| `is_empty` | ✅ | ✅ | ✅ | ✅ | Boolean check | - -## Language-Specific Implementation Notes - -### Julia (Reference Implementation) -- **File locations**: `src/arithmetic.jl`, `src/comparison.jl`, `src/logical.jl`, `src/string.jl` -- **Test locations**: `test/arithmetic_tests.jl`, `test/comparison_tests.jl`, `test/logical_tests.jl`, `test/string_tests.jl` -- **Operators**: Standard Julia operators (`+`, `-`, `*`, `/`, `mod`, `<`, `>`, `==`, `&&`, `||`, `!`) -- **Type system**: Generic `Number` and `Bool` types, `AbstractString` for strings -- **Test framework**: Test.jl with `@testset` and `@test` macros -- **Total tests**: 287 (59 arithmetic + 98 comparison + 41 logical + 89 string) -- **String indexing**: 1-based (Julia convention) - -### ReScript -- **File locations**: `packages/common/Arithmetic.res`, `packages/common/Comparison.res`, `packages/common/Logical.res`, `packages/common/String.res` -- **Test locations**: `tests/Arithmetic_test.res`, `tests/Comparison_test.res`, `tests/Logical_test.res`, `tests/String_test.res` -- **Operators**: Float-specific operators (`+.`, `-.`, `*.`, `/.`, standard comparison, `&&`, `||`, `!`) -- **Type system**: Explicit `float`, `bool`, and `string` types -- **Test framework**: RescriptMocha -- **Modulo**: Uses `mod_float` for float modulo operation -- **String indexing**: 0-based (JavaScript/ReScript convention) -- **String operators**: Uses `++` for concatenation, standard String module functions - -### Gleam -- **File locations**: `src/arithmetic.gleam`, `src/comparison.gleam`, `src/logical.gleam`, `src/string_ops.gleam` -- **Test locations**: `test/arithmetic_test.gleam`, `test/comparison_test.gleam`, `test/logical_test.gleam`, `test/string_ops_test.gleam` -- **Operators**: - - Arithmetic: `+.`, `-.`, `*.`, `/.` (dot required for floats) - - Ordering: `<.`, `>.`, `<=.`, `>=.` (dot required for floats) - - Equality: `==`, `!=` (no dot, works for all types) - - Logical: `&&`, `||`, `!` - - String: `<>` for concatenation -- **Type system**: Separate `Float`, `Int`, `Bool`, and `String` types -- **Runtime**: BEAM (Erlang VM) or JavaScript -- **Modulo**: Integer operation using `%` -- **Test framework**: Gleeunit -- **Total tests**: 131 (28 arithmetic + 35 comparison + 22 logical + 7 property tests + 39 string) -- **String indexing**: 0-based (Gleam convention) -- **String graphemes**: Uses grapheme-aware length and splitting - -### Elixir -- **File locations**: `lib/arithmetic.ex`, `lib/comparison.ex`, `lib/logical.ex`, `lib/string_ops.ex` -- **Test locations**: `test/arithmetic_test.exs`, `test/comparison_test.exs`, `test/logical_test.exs`, `test/string_ops_test.exs` -- **Operators**: Standard Elixir operators (automatically promoted to float for division), `<>` for string concatenation -- **Type system**: Dynamic with guards and `@spec` annotations -- **Runtime**: BEAM (Erlang VM) -- **Modulo**: Uses `rem` for remainder (Erlang semantics) -- **Test framework**: ExUnit with doctests -- **Total tests**: 253 (120 doctests + 133 unit tests) -- **Naming exceptions**: - - Logical: `logical_and`, `logical_or`, `logical_not` (to avoid Kernel keyword conflicts) - - String: `string_length`, `string_contains`, `string_trim`, `string_split`, `string_join`, `string_replace` (to avoid stdlib conflicts) -- **String indexing**: 1-based (matching Julia for cross-language consistency) -- **String graphemes**: Uses grapheme-aware operations - -## Operator Comparison Table - -| Operation | Julia | ReScript | Gleam | Elixir | -|-----------|-------|----------|-------|--------| -| Float addition | `+` | `+.` | `+.` | `+` | -| Float subtraction | `-` | `-.` | `-.` | `-` | -| Float multiplication | `*` | `*.` | `*.` | `*` | -| Float division | `/` | `/.` | `/.` | `/` | -| Integer modulo | `mod` | `mod` | `%` | `rem` | -| Less than (float) | `<` | `<` | `<.` | `<` | -| Greater than (float) | `>` | `>` | `>.` | `>` | -| Equal (any type) | `==` | `==` | `==` | `==` | -| Not equal (any type) | `!=` | `!=` | `!=` | `!=` | -| Less or equal (float) | `<=` | `<=` | `<=.` | `<=` | -| Greater or equal (float) | `>=` | `>=` | `>=.` | `>=` | -| Logical AND | `&&` | `&&` | `&&` | `and` | -| Logical OR | `\|\|` | `\|\|` | `\|\|` | `or` | -| Logical NOT | `!` | `!` | `!` | `not` | - -**Note:** Gleam uses dotted operators (`+.`, `<.`, etc.) only for arithmetic and float ordering comparisons, but not for equality (`==`, `!=`), which works for all types. - -## Semantic Equivalence - -All implementations maintain semantic equivalence across languages: - -### Behavioral Consistency -1. **Mathematical properties preserved**: - - Commutativity, associativity, distributivity (where applicable) - - Identity elements and annihilators - - Transitivity, reflexivity, symmetry (for comparisons) - - Boolean algebra laws (De Morgan's, excluded middle, non-contradiction) - -2. **IEEE 754 floating-point semantics**: - - Division by zero behavior - - NaN propagation - - Infinity handling - - Signed zeros - -3. **Edge cases handled consistently**: - - All languages follow their runtime's floating-point model - - Integer operations respect overflow/underflow behavior - - Modulo follows BEAM `rem` semantics (Gleam/Elixir) or language-specific - -### Verification Strategy - -Cross-language verification is achieved through: - -1. **Property-based testing**: All implementations test the same mathematical properties -2. **Canonical test suite**: Test cases match across all languages -3. **Edge case coverage**: Identical edge case handling (NaN, Inf, signed zeros) -4. **Documentation**: All implementations document the same behavioral semantics - -## Future Work - -### Pending Implementations -- **Python** (planned) -- **Rust** (planned) -- **Haskell** (planned) -- **OCaml** (planned) - -### Pending Tasks -1. Create Gleam test suite (gleeunit) -2. Formal verification proofs (using Isabelle/HOL or Coq) -3. Property-based tests using QuickCheck-style frameworks -4. Cross-language fuzzing for edge case discovery -5. Performance benchmarks across implementations -6. Automated semantic equivalence verification - -## License - -All implementations use MPL-2.0 (Palimpsest Meta-Public License). - -## Contributing - -When adding a new language implementation: - -1. Create a new repository following naming convention: `polyglot_formalisms_{language}` -2. Implement all three modules (Arithmetic, Comparison, Logical) -3. Maintain semantic equivalence with reference implementation -4. Include comprehensive test suite (unit tests + property tests) -5. Document language-specific considerations -6. Update this status document - -## References - -- [PolyglotFormalisms Specification](https://github.com/hyperpolymath/PolyglotFormalisms.jl) -- [IEEE 754 Floating-Point Standard](https://ieeexplore.ieee.org/document/8766229) -- [Boolean Algebra](https://en.wikipedia.org/wiki/Boolean_algebra) diff --git a/llm-warmup-dev.adoc b/llm-warmup-dev.adoc new file mode 100644 index 0000000..5dbc684 --- /dev/null +++ b/llm-warmup-dev.adoc @@ -0,0 +1,19 @@ +== LLM Warmup — PolyglotFormalisms.jl (Developer) + +=== What is PolyglotFormalisms.jl? + +See README.adoc for overview. + +=== Key Commands + +* `+just setup+` — set up development environment +* `+just build+` — build the project +* `+just test+` — run tests +* `+just doctor+` — diagnose issues +* `+just heal+` — attempt auto-repair + +=== Quick Context + +* License: MPL-2.0 +* Part of hyperpolymath ecosystem +* See EXPLAINME.adoc for architecture diff --git a/llm-warmup-dev.md b/llm-warmup-dev.md deleted file mode 100644 index 94a2ec4..0000000 --- a/llm-warmup-dev.md +++ /dev/null @@ -1,20 +0,0 @@ - -# LLM Warmup — PolyglotFormalisms.jl (Developer) - -## What is PolyglotFormalisms.jl? -See README.adoc for overview. - -## Key Commands -- `just setup` — set up development environment -- `just build` — build the project -- `just test` — run tests -- `just doctor` — diagnose issues -- `just heal` — attempt auto-repair - -## Quick Context -- License: MPL-2.0 -- Part of hyperpolymath ecosystem -- See EXPLAINME.adoc for architecture diff --git a/llm-warmup-user.adoc b/llm-warmup-user.adoc new file mode 100644 index 0000000..ba9203a --- /dev/null +++ b/llm-warmup-user.adoc @@ -0,0 +1,19 @@ +== LLM Warmup — PolyglotFormalisms.jl (User) + +=== What is PolyglotFormalisms.jl? + +See README.adoc for overview. + +=== Key Commands + +* `+just setup+` — set up development environment +* `+just build+` — build the project +* `+just test+` — run tests +* `+just doctor+` — diagnose issues +* `+just heal+` — attempt auto-repair + +=== Quick Context + +* License: MPL-2.0 +* Part of hyperpolymath ecosystem +* See EXPLAINME.adoc for architecture diff --git a/llm-warmup-user.md b/llm-warmup-user.md deleted file mode 100644 index 73fa278..0000000 --- a/llm-warmup-user.md +++ /dev/null @@ -1,20 +0,0 @@ - -# LLM Warmup — PolyglotFormalisms.jl (User) - -## What is PolyglotFormalisms.jl? -See README.adoc for overview. - -## Key Commands -- `just setup` — set up development environment -- `just build` — build the project -- `just test` — run tests -- `just doctor` — diagnose issues -- `just heal` — attempt auto-repair - -## Quick Context -- License: MPL-2.0 -- Part of hyperpolymath ecosystem -- See EXPLAINME.adoc for architecture