diff --git a/ABI-FFI-README.md b/ABI-FFI-README.adoc similarity index 74% rename from ABI-FFI-README.md rename to ABI-FFI-README.adoc index 1c83bcd..97c2683 100644 --- a/ABI-FFI-README.md +++ b/ABI-FFI-README.adoc @@ -1,19 +1,22 @@ -{{~ Aditionally delete this line and fill out the template below ~}} +\{\{~ Aditionally delete this line and fill out the template below ~}} -# {{PROJECT}} ABI/FFI Documentation +== \{\{PROJECT}} 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/ │ @@ -45,11 +48,11 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: │ Any Language via C ABI │ │ - Rust, AffineScript, Julia, Python, etc. │ └─────────────────────────────────────────────┘ -``` +.... -## Directory Structure +=== Directory Structure -``` +.... {{project}}/ ├── src/ │ ├── abi/ # ABI definitions (Idris2) @@ -77,15 +80,17 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design: ├── rust/ ├── 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 @@ -97,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 @@ -111,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 @@ -125,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 { @@ -140,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 @@ -215,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() { @@ -237,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 {{PROJECT}}.ABI.Foreign main : IO () @@ -259,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; @@ -282,11 +302,12 @@ fn main() { {{project}}_free(handle); } } -``` +---- -### From Julia +==== From Julia -```julia +[source,julia] +---- const lib{{project}} = "lib{{project}}" function init() @@ -312,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 @@ -342,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 CC-BY-SA-4.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..bd2a83c --- /dev/null +++ b/CODE_OF_CONDUCT.adoc @@ -0,0 +1,24 @@ +== Contributor Covenant Code of Conduct + +=== Our Pledge + +We pledge to make participation a harassment-free experience for +everyone. + +=== Our Standards + +*Positive behavior:* * Using welcoming language * Being respectful of +differing viewpoints * Accepting constructive criticism * Focusing on +what is best for the community + +*Unacceptable behavior:* * Harassment, trolling, or personal attacks * +Publishing private information without permission + +=== Enforcement + +Report issues to the maintainers. All complaints will be reviewed. + +=== Attribution + +Adapted from https://www.contributor-covenant.org/[Contributor Covenant] +v2.1. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index caeda1c..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,27 +0,0 @@ - -# Contributor Covenant Code of Conduct - -## Our Pledge - -We pledge to make participation a harassment-free experience for everyone. - -## Our Standards - -**Positive behavior:** -* Using welcoming language -* Being respectful of differing viewpoints -* Accepting constructive criticism -* Focusing on what is best for the community - -**Unacceptable behavior:** -* Harassment, trolling, or personal attacks -* Publishing private information without permission - -## Enforcement - -Report issues to the maintainers. All complaints will be reviewed. - -## Attribution - -Adapted from [Contributor Covenant](https://www.contributor-covenant.org/) v2.1. - diff --git a/SECURITY.adoc b/SECURITY.adoc new file mode 100644 index 0000000..b0574df --- /dev/null +++ b/SECURITY.adoc @@ -0,0 +1,24 @@ +== Security Policy + +=== Supported Versions + +[cols=",",options="header",] +|=== +|Version |Supported +|main |:white_check_mark: +|< main |:x: +|=== + +=== Reporting a Vulnerability + +Please report security vulnerabilities through GitHub private +vulnerability reporting: 1. Go to the *Security* tab 2. Click *Report a +vulnerability* 3. Fill out the form + +We respond within 48 hours. + +=== Security Measures + +* Dependabot for dependency updates +* CodeQL for code scanning +* Secret scanning and push protection diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 159a0b7..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| main | :white_check_mark: | -| < main | :x: | - -## Reporting a Vulnerability - -Please report security vulnerabilities through GitHub private vulnerability reporting: -1. Go to the **Security** tab -2. Click **Report a vulnerability** -3. Fill out the form - -We respond within 48 hours. - -## Security Measures - -- Dependabot for dependency updates -- CodeQL for code scanning -- Secret scanning and push protection - diff --git a/integrations/gittyup/README.adoc b/integrations/gittyup/README.adoc new file mode 100644 index 0000000..9d1cffc --- /dev/null +++ b/integrations/gittyup/README.adoc @@ -0,0 +1,67 @@ +== SPDX-License-Identifier: MPL-2.0-or-later + +image:https://img.shields.io/badge/License-MPL_2.0-blue.svg[MPL-2.0-or-later,link="`https://opensource.org/licenses/MPL-2.0`"] + +== Gittyup Integration for bitfuckit + +https://github.com/Murmele/Gittyup[Gittyup] is a Qt-based Git GUI. + +=== Current Status + +Gittyup doesn’t have a formal plugin API yet, but we can integrate via: + +[arabic] +. *Custom Tools Menu* - Add external tool definitions +. *Git Hooks* - Triggered on Git operations + +=== Custom Tools Setup + +Gittyup uses `+~/.config/gittyup/tools.json+` for custom tools: + +[source,json] +---- +{ + "tools": [ + { + "name": "Bitbucket: Create PR", + "command": "bitfuckit", + "arguments": ["pr", "create", "--branch", "$BRANCH"], + "workdir": "$REPO_PATH" + }, + { + "name": "Bitbucket: List PRs", + "command": "bitfuckit", + "arguments": ["pr", "list"], + "workdir": "$REPO_PATH" + }, + { + "name": "Bitbucket: Mirror", + "command": "bitfuckit", + "arguments": ["mirror"], + "workdir": "$REPO_PATH" + }, + { + "name": "Bitbucket: Pipeline Status", + "command": "bitfuckit", + "arguments": ["pipeline", "status"], + "workdir": "$REPO_PATH" + } + ] +} +---- + +=== Installation + +[source,bash] +---- +mkdir -p ~/.config/gittyup +cp tools.json ~/.config/gittyup/ +---- + +=== Future + +We’re tracking the Gittyup project for proper plugin API support. + +When available, a full Qt plugin will be developed providing: - Native +UI integration - Real-time pipeline status - PR review inline - Issue +linking diff --git a/integrations/gittyup/README.md b/integrations/gittyup/README.md deleted file mode 100644 index 432141f..0000000 --- a/integrations/gittyup/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# SPDX-License-Identifier: MPL-2.0-or-later -image:https://img.shields.io/badge/License-MPL_2.0-blue.svg[MPL-2.0-or-later,link="https://opensource.org/licenses/MPL-2.0"] - - - -# Gittyup Integration for bitfuckit - -[Gittyup](https://github.com/Murmele/Gittyup) is a Qt-based Git GUI. - -## Current Status - -Gittyup doesn't have a formal plugin API yet, but we can integrate via: - -1. **Custom Tools Menu** - Add external tool definitions -2. **Git Hooks** - Triggered on Git operations - -## Custom Tools Setup - -Gittyup uses `~/.config/gittyup/tools.json` for custom tools: - -```json -{ - "tools": [ - { - "name": "Bitbucket: Create PR", - "command": "bitfuckit", - "arguments": ["pr", "create", "--branch", "$BRANCH"], - "workdir": "$REPO_PATH" - }, - { - "name": "Bitbucket: List PRs", - "command": "bitfuckit", - "arguments": ["pr", "list"], - "workdir": "$REPO_PATH" - }, - { - "name": "Bitbucket: Mirror", - "command": "bitfuckit", - "arguments": ["mirror"], - "workdir": "$REPO_PATH" - }, - { - "name": "Bitbucket: Pipeline Status", - "command": "bitfuckit", - "arguments": ["pipeline", "status"], - "workdir": "$REPO_PATH" - } - ] -} -``` - -## Installation - -```bash -mkdir -p ~/.config/gittyup -cp tools.json ~/.config/gittyup/ -``` - -## Future - -We're tracking the Gittyup project for proper plugin API support. - -When available, a full Qt plugin will be developed providing: -- Native UI integration -- Real-time pipeline status -- PR review inline -- Issue linking diff --git a/scripts/git-private-farm/README.md b/scripts/git-private-farm/README.adoc similarity index 79% rename from scripts/git-private-farm/README.md rename to scripts/git-private-farm/README.adoc index a2f9a9f..9345345 100644 --- a/scripts/git-private-farm/README.md +++ b/scripts/git-private-farm/README.adoc @@ -1,13 +1,12 @@ -# .git-private-farm -image:https://img.shields.io/badge/License-MPL_2.0-blue.svg[MPL-2.0-or-later,link="https://opensource.org/licenses/MPL-2.0"] - +== .git-private-farm +image:https://img.shields.io/badge/License-MPL_2.0-blue.svg[MPL-2.0-or-later,link="`https://opensource.org/licenses/MPL-2.0`"] Private orchestration hub for rapid multi-forge propagation. -## Architecture +=== Architecture -``` +.... ┌──────────────────────────────────────────────────────────────────┐ │ .git-private-farm (GitHub Private) │ │ ┌────────────────────────────────────────────────────────────┐ │ @@ -32,53 +31,60 @@ Private orchestration hub for rapid multi-forge propagation. └───────────────────────┴───────────────────────┘ All run in parallel (~5-10 seconds total) -``` +.... + +=== Rapid Propagation Modes -## Rapid Propagation Modes +==== 1. Instant Push (All Forges) -### 1. Instant Push (All Forges) Triggered on every push to a repo. Propagates to all configured forges. -```bash +[source,bash] +---- # From any repo with the webhook configured git push origin main # Automatically triggers propagation -``` +---- + +==== 2. Selective Push (Specific Forges) -### 2. Selective Push (Specific Forges) Use workflow dispatch to push to specific forges only. -```bash +[source,bash] +---- gh workflow run propagate.yml \ -f repo=bitfuckit \ -f forges="gitlab,codeberg" \ --repo hyperpolymath/.git-private-farm -``` +---- + +==== 3. Batch Push (All Repos) -### 3. Batch Push (All Repos) Propagate all repos to all forges at once. -```bash +[source,bash] +---- gh workflow run batch-propagate.yml \ --repo hyperpolymath/.git-private-farm -``` - -## Setup - -1. Create the private repo: - ```bash - gh repo create .git-private-farm --private - ``` - -2. Add secrets for each forge: - - `GITLAB_SSH_KEY` - - `SOURCEHUT_SSH_KEY` - - `CODEBERG_SSH_KEY` - - `BITBUCKET_SSH_KEY` - -3. Configure webhooks on source repos to trigger `repository_dispatch` - -## Security - -- This repo is PRIVATE - contains SSH keys and forge credentials -- Uses encrypted secrets, never commits raw keys -- Audit log tracks all propagation events +---- + +=== Setup + +[arabic] +. Create the private repo: ++ +[source,bash] +---- +gh repo create .git-private-farm --private +---- +. Add secrets for each forge: +* `+GITLAB_SSH_KEY+` +* `+SOURCEHUT_SSH_KEY+` +* `+CODEBERG_SSH_KEY+` +* `+BITBUCKET_SSH_KEY+` +. Configure webhooks on source repos to trigger `+repository_dispatch+` + +=== Security + +* This repo is PRIVATE - contains SSH keys and forge credentials +* Uses encrypted secrets, never commits raw keys +* Audit log tracks all propagation events