Skip to content

Commit bd729db

Browse files
hyperpolymathclaude
andcommitted
chore: replace {{project}}/{{PROJECT}} template placeholders with actual names
Customized ABI-FFI-README.md, Idris2 ABI stubs, Zig FFI stubs, QUICKSTART docs, Justfiles, and methodology files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c3b9fb3 commit bd729db

107 files changed

Lines changed: 1577 additions & 1586 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.machine_readable/agent_instructions/methodology.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ constraints = [
101101
# These rules detect corrupt/template/stale state files.
102102

103103
[methodology.state-validation]
104-
reject-if-contains = ["{{PLACEHOLDER}}", "{{PROJECT}}", "rsr-template-repo"]
104+
reject-if-contains = ["{{PLACEHOLDER}}", "AMBIENTOPS", "rsr-template-repo"]
105105
reject-if-project-name-mismatch = true
106106
staleness-threshold-days = 90
107107
fallback-files = ["TODO.md", "TODO.adoc", "ROADMAP.adoc", "README.adoc"]

ABI-FFI-README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{~ Aditionally delete this line and fill out the template below ~}}
22

3-
# {{PROJECT}} ABI/FFI Documentation
3+
# AMBIENTOPS ABI/FFI Documentation
44

55
## Overview
66

@@ -26,7 +26,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
2626
2727
┌─────────────────────────────────────────────┐
2828
│ C Headers (auto-generated) │
29-
│ generated/abi/{{project}}.h │
29+
│ generated/abi/ambientops.h │
3030
└─────────────────┬───────────────────────────┘
3131
3232
│ imported by
@@ -39,7 +39,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
3939
│ - Memory-safe by default │
4040
└─────────────────┬───────────────────────────┘
4141
42-
│ compiled to lib{{project}}.so/.a
42+
│ compiled to libambientops.so/.a
4343
4444
┌─────────────────────────────────────────────┐
4545
│ Any Language via C ABI │
@@ -50,7 +50,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
5050
## Directory Structure
5151

5252
```
53-
{{project}}/
53+
ambientops/
5454
├── src/
5555
│ ├── abi/ # ABI definitions (Idris2)
5656
│ │ ├── Types.idr # Core type definitions with proofs
@@ -67,11 +67,11 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
6767
│ ├── test/
6868
│ │ └── integration_test.zig
6969
│ └── include/
70-
│ └── {{project}}.h # C header (optional, can be generated)
70+
│ └── ambientops.h # C header (optional, can be generated)
7171
7272
├── generated/ # Auto-generated files
7373
│ └── abi/
74-
│ └── {{project}}.h # Generated from Idris2 ABI
74+
│ └── ambientops.h # Generated from Idris2 ABI
7575
7676
└── bindings/ # Language-specific wrappers (optional)
7777
├── rust/
@@ -199,7 +199,7 @@ zig build test # Run tests
199199

200200
```bash
201201
cd src/abi
202-
idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}}.h
202+
idris2 --cg c-header Types.idr -o ../../generated/abi/ambientops.h
203203
```
204204

205205
### Cross-Compile
@@ -222,32 +222,32 @@ zig build -Dtarget=x86_64-windows
222222
### From C
223223

224224
```c
225-
#include "{{project}}.h"
225+
#include "ambientops.h"
226226

227227
int main() {
228-
void* handle = {{project}}_init();
228+
void* handle = ambientops_init();
229229
if (!handle) return 1;
230230

231-
int result = {{project}}_process(handle, 42);
231+
int result = ambientops_process(handle, 42);
232232
if (result != 0) {
233-
const char* err = {{project}}_last_error();
233+
const char* err = ambientops_last_error();
234234
fprintf(stderr, "Error: %s\n", err);
235235
}
236236

237-
{{project}}_free(handle);
237+
ambientops_free(handle);
238238
return 0;
239239
}
240240
```
241241

242242
Compile with:
243243
```bash
244-
gcc -o example example.c -l{{project}} -L./zig-out/lib
244+
gcc -o example example.c -lambientops -L./zig-out/lib
245245
```
246246

247247
### From Idris2
248248

249249
```idris
250-
import {{PROJECT}}.ABI.Foreign
250+
import AMBIENTOPS.ABI.Foreign
251251
252252
main : IO ()
253253
main = do
@@ -264,44 +264,44 @@ main = do
264264
### From Rust
265265

266266
```rust
267-
#[link(name = "{{project}}")]
267+
#[link(name = "ambientops")]
268268
extern "C" {
269-
fn {{project}}_init() -> *mut std::ffi::c_void;
270-
fn {{project}}_free(handle: *mut std::ffi::c_void);
271-
fn {{project}}_process(handle: *mut std::ffi::c_void, input: u32) -> i32;
269+
fn ambientops_init() -> *mut std::ffi::c_void;
270+
fn ambientops_free(handle: *mut std::ffi::c_void);
271+
fn ambientops_process(handle: *mut std::ffi::c_void, input: u32) -> i32;
272272
}
273273

274274
fn main() {
275275
unsafe {
276-
let handle = {{project}}_init();
276+
let handle = ambientops_init();
277277
assert!(!handle.is_null());
278278

279-
let result = {{project}}_process(handle, 42);
279+
let result = ambientops_process(handle, 42);
280280
assert_eq!(result, 0);
281281

282-
{{project}}_free(handle);
282+
ambientops_free(handle);
283283
}
284284
}
285285
```
286286

287287
### From Julia
288288

289289
```julia
290-
const lib{{project}} = "lib{{project}}"
290+
const libambientops = "libambientops"
291291

292292
function init()
293-
handle = ccall((:{{project}}_init, lib{{project}}), Ptr{Cvoid}, ())
293+
handle = ccall((:ambientops_init, libambientops), Ptr{Cvoid}, ())
294294
handle == C_NULL && error("Failed to initialize")
295295
handle
296296
end
297297

298298
function process(handle, input)
299-
result = ccall((:{{project}}_process, lib{{project}}), Cint, (Ptr{Cvoid}, UInt32), handle, input)
299+
result = ccall((:ambientops_process, libambientops), Cint, (Ptr{Cvoid}, UInt32), handle, input)
300300
result
301301
end
302302

303303
function cleanup(handle)
304-
ccall((:{{project}}_free, lib{{project}}), Cvoid, (Ptr{Cvoid},), handle)
304+
ccall((:ambientops_free, libambientops), Cvoid, (Ptr{Cvoid},), handle)
305305
end
306306

307307
# Usage
@@ -355,7 +355,7 @@ When modifying the ABI/FFI:
355355

356356
2. **Generate C header**
357357
```bash
358-
idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}}.h
358+
idris2 --cg c-header src/abi/Types.idr -o generated/abi/ambientops.h
359359
```
360360

361361
3. **Update FFI implementation** (`ffi/zig/src/main.zig`)

_pathroot/ABI-FFI-README.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{{~ Aditionally delete this line and fill out the template below ~}}
21

3-
# {{PROJECT}} ABI/FFI Documentation
2+
# _PATHROOT ABI/FFI Documentation
43

54
## Overview
65

@@ -26,7 +25,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
2625
2726
┌─────────────────────────────────────────────┐
2827
│ C Headers (auto-generated) │
29-
│ generated/abi/{{project}}.h │
28+
│ generated/abi/_pathroot.h │
3029
└─────────────────┬───────────────────────────┘
3130
3231
│ imported by
@@ -39,7 +38,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
3938
│ - Memory-safe by default │
4039
└─────────────────┬───────────────────────────┘
4140
42-
│ compiled to lib{{project}}.so/.a
41+
│ compiled to lib_pathroot.so/.a
4342
4443
┌─────────────────────────────────────────────┐
4544
│ Any Language via C ABI │
@@ -50,7 +49,7 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
5049
## Directory Structure
5150

5251
```
53-
{{project}}/
52+
_pathroot/
5453
├── src/
5554
│ ├── abi/ # ABI definitions (Idris2)
5655
│ │ ├── Types.idr # Core type definitions with proofs
@@ -67,11 +66,11 @@ This library follows the **Hyperpolymath RSR Standard** for ABI and FFI design:
6766
│ ├── test/
6867
│ │ └── integration_test.zig
6968
│ └── include/
70-
│ └── {{project}}.h # C header (optional, can be generated)
69+
│ └── _pathroot.h # C header (optional, can be generated)
7170
7271
├── generated/ # Auto-generated files
7372
│ └── abi/
74-
│ └── {{project}}.h # Generated from Idris2 ABI
73+
│ └── _pathroot.h # Generated from Idris2 ABI
7574
7675
└── bindings/ # Language-specific wrappers (optional)
7776
├── rust/
@@ -199,7 +198,7 @@ zig build test # Run tests
199198

200199
```bash
201200
cd src/abi
202-
idris2 --cg c-header Types.idr -o ../../generated/abi/{{project}}.h
201+
idris2 --cg c-header Types.idr -o ../../generated/abi/_pathroot.h
203202
```
204203

205204
### Cross-Compile
@@ -222,32 +221,32 @@ zig build -Dtarget=x86_64-windows
222221
### From C
223222

224223
```c
225-
#include "{{project}}.h"
224+
#include "_pathroot.h"
226225

227226
int main() {
228-
void* handle = {{project}}_init();
227+
void* handle = _pathroot_init();
229228
if (!handle) return 1;
230229

231-
int result = {{project}}_process(handle, 42);
230+
int result = _pathroot_process(handle, 42);
232231
if (result != 0) {
233-
const char* err = {{project}}_last_error();
232+
const char* err = _pathroot_last_error();
234233
fprintf(stderr, "Error: %s\n", err);
235234
}
236235

237-
{{project}}_free(handle);
236+
_pathroot_free(handle);
238237
return 0;
239238
}
240239
```
241240

242241
Compile with:
243242
```bash
244-
gcc -o example example.c -l{{project}} -L./zig-out/lib
243+
gcc -o example example.c -l_pathroot -L./zig-out/lib
245244
```
246245

247246
### From Idris2
248247

249248
```idris
250-
import {{PROJECT}}.ABI.Foreign
249+
import _PATHROOT.ABI.Foreign
251250
252251
main : IO ()
253252
main = do
@@ -264,44 +263,44 @@ main = do
264263
### From Rust
265264

266265
```rust
267-
#[link(name = "{{project}}")]
266+
#[link(name = "_pathroot")]
268267
extern "C" {
269-
fn {{project}}_init() -> *mut std::ffi::c_void;
270-
fn {{project}}_free(handle: *mut std::ffi::c_void);
271-
fn {{project}}_process(handle: *mut std::ffi::c_void, input: u32) -> i32;
268+
fn _pathroot_init() -> *mut std::ffi::c_void;
269+
fn _pathroot_free(handle: *mut std::ffi::c_void);
270+
fn _pathroot_process(handle: *mut std::ffi::c_void, input: u32) -> i32;
272271
}
273272

274273
fn main() {
275274
unsafe {
276-
let handle = {{project}}_init();
275+
let handle = _pathroot_init();
277276
assert!(!handle.is_null());
278277

279-
let result = {{project}}_process(handle, 42);
278+
let result = _pathroot_process(handle, 42);
280279
assert_eq!(result, 0);
281280

282-
{{project}}_free(handle);
281+
_pathroot_free(handle);
283282
}
284283
}
285284
```
286285

287286
### From Julia
288287

289288
```julia
290-
const lib{{project}} = "lib{{project}}"
289+
const lib_pathroot = "lib_pathroot"
291290

292291
function init()
293-
handle = ccall((:{{project}}_init, lib{{project}}), Ptr{Cvoid}, ())
292+
handle = ccall((:_pathroot_init, lib_pathroot), Ptr{Cvoid}, ())
294293
handle == C_NULL && error("Failed to initialize")
295294
handle
296295
end
297296

298297
function process(handle, input)
299-
result = ccall((:{{project}}_process, lib{{project}}), Cint, (Ptr{Cvoid}, UInt32), handle, input)
298+
result = ccall((:_pathroot_process, lib_pathroot), Cint, (Ptr{Cvoid}, UInt32), handle, input)
300299
result
301300
end
302301

303302
function cleanup(handle)
304-
ccall((:{{project}}_free, lib{{project}}), Cvoid, (Ptr{Cvoid},), handle)
303+
ccall((:_pathroot_free, lib_pathroot), Cvoid, (Ptr{Cvoid},), handle)
305304
end
306305

307306
# Usage
@@ -355,7 +354,7 @@ When modifying the ABI/FFI:
355354

356355
2. **Generate C header**
357356
```bash
358-
idris2 --cg c-header src/abi/Types.idr -o generated/abi/{{project}}.h
357+
idris2 --cg c-header src/abi/Types.idr -o generated/abi/_pathroot.h
359358
```
360359

361360
3. **Update FFI implementation** (`ffi/zig/src/main.zig`)

0 commit comments

Comments
 (0)