Skip to content

Commit 27c1047

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 aff525a commit 27c1047

8 files changed

Lines changed: 114 additions & 115 deletions

File tree

.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}}", "VERISIMDB", "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 & 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+
# VERISIMDB 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/verisimdb.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 libverisimdb.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+
verisimdb/
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+
│ └── verisimdb.h # C header (optional, can be generated)
7170
7271
├── generated/ # Auto-generated files
7372
│ └── abi/
74-
│ └── {{project}}.h # Generated from Idris2 ABI
73+
│ └── verisimdb.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/verisimdb.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 "verisimdb.h"
226225

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

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

237-
{{project}}_free(handle);
236+
verisimdb_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 -lverisimdb -L./zig-out/lib
245244
```
246245

247246
### From Idris2
248247

249248
```idris
250-
import {{PROJECT}}.ABI.Foreign
249+
import VERISIMDB.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 = "verisimdb")]
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 verisimdb_init() -> *mut std::ffi::c_void;
269+
fn verisimdb_free(handle: *mut std::ffi::c_void);
270+
fn verisimdb_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 = verisimdb_init();
277276
assert!(!handle.is_null());
278277

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

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

287286
### From Julia
288287

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

292291
function init()
293-
handle = ccall((:{{project}}_init, lib{{project}}), Ptr{Cvoid}, ())
292+
handle = ccall((:verisimdb_init, libverisimdb), 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((:verisimdb_process, libverisimdb), 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((:verisimdb_free, libverisimdb), 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/verisimdb.h
359358
```
360359

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

debugger/src/abi/Foreign.idr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
||| All functions are declared here with type signatures and safety proofs.
77
||| Implementations live in ffi/zig/
88

9-
module {{PROJECT}}.ABI.Foreign
9+
module VERISIMDB.ABI.Foreign
1010

11-
import {{PROJECT}}.ABI.Types
12-
import {{PROJECT}}.ABI.Layout
11+
import VERISIMDB.ABI.Types
12+
import VERISIMDB.ABI.Layout
1313

1414
%default total
1515

@@ -20,7 +20,7 @@ import {{PROJECT}}.ABI.Layout
2020
||| Initialize the library
2121
||| Returns a handle to the library instance, or Nothing on failure
2222
export
23-
%foreign "C:{{project}}_init, lib{{project}}"
23+
%foreign "C:verisimdb_init, libverisimdb"
2424
prim__init : PrimIO Bits64
2525

2626
||| Safe wrapper for library initialization
@@ -32,7 +32,7 @@ init = do
3232

3333
||| Clean up library resources
3434
export
35-
%foreign "C:{{project}}_free, lib{{project}}"
35+
%foreign "C:verisimdb_free, libverisimdb"
3636
prim__free : Bits64 -> PrimIO ()
3737

3838
||| Safe wrapper for cleanup
@@ -46,7 +46,7 @@ free h = primIO (prim__free (handlePtr h))
4646

4747
||| Example operation: process data
4848
export
49-
%foreign "C:{{project}}_process, lib{{project}}"
49+
%foreign "C:verisimdb_process, libverisimdb"
5050
prim__process : Bits64 -> Bits32 -> PrimIO Bits32
5151

5252
||| Safe wrapper with error handling
@@ -69,12 +69,12 @@ prim__getString : Bits64 -> String
6969

7070
||| Free C string
7171
export
72-
%foreign "C:{{project}}_free_string, lib{{project}}"
72+
%foreign "C:verisimdb_free_string, libverisimdb"
7373
prim__freeString : Bits64 -> PrimIO ()
7474

7575
||| Get string result from library
7676
export
77-
%foreign "C:{{project}}_get_string, lib{{project}}"
77+
%foreign "C:verisimdb_get_string, libverisimdb"
7878
prim__getResult : Bits64 -> PrimIO Bits64
7979

8080
||| Safe string getter
@@ -95,7 +95,7 @@ getString h = do
9595

9696
||| Process array data
9797
export
98-
%foreign "C:{{project}}_process_array, lib{{project}}"
98+
%foreign "C:verisimdb_process_array, libverisimdb"
9999
prim__processArray : Bits64 -> Bits64 -> Bits32 -> PrimIO Bits32
100100

101101
||| Safe array processor
@@ -122,7 +122,7 @@ processArray h buf len = do
122122

123123
||| Get last error message
124124
export
125-
%foreign "C:{{project}}_last_error, lib{{project}}"
125+
%foreign "C:verisimdb_last_error, libverisimdb"
126126
prim__lastError : PrimIO Bits64
127127

128128
||| Retrieve last error as string
@@ -149,7 +149,7 @@ errorDescription NullPointer = "Null pointer"
149149

150150
||| Get library version
151151
export
152-
%foreign "C:{{project}}_version, lib{{project}}"
152+
%foreign "C:verisimdb_version, libverisimdb"
153153
prim__version : PrimIO Bits64
154154

155155
||| Get version as string
@@ -161,7 +161,7 @@ version = do
161161

162162
||| Get library build info
163163
export
164-
%foreign "C:{{project}}_build_info, lib{{project}}"
164+
%foreign "C:verisimdb_build_info, libverisimdb"
165165
prim__buildInfo : PrimIO Bits64
166166

167167
||| Get build information
@@ -182,7 +182,7 @@ Callback = Bits64 -> Bits32 -> Bits32
182182

183183
||| Register a callback — FFI declaration typed to accept callback directly
184184
export
185-
%foreign "C:{{project}}_register_callback, lib{{project}}"
185+
%foreign "C:verisimdb_register_callback, libverisimdb"
186186
prim__registerCallback : Bits64 -> (Bits64 -> Bits32 -> Bits32) -> PrimIO Bits32
187187

188188
||| Safe callback registration (no cast — callback type matches FFI declaration)
@@ -205,7 +205,7 @@ registerCallback h cb = do
205205

206206
||| Check if library is initialized
207207
export
208-
%foreign "C:{{project}}_is_initialized, lib{{project}}"
208+
%foreign "C:verisimdb_is_initialized, libverisimdb"
209209
prim__isInitialized : Bits64 -> PrimIO Bits32
210210

211211
||| Check initialization status

debugger/src/abi/Layout.idr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
|||
66
||| @see https://en.wikipedia.org/wiki/Data_structure_alignment
77

8-
module {{PROJECT}}.ABI.Layout
8+
module VERISIMDB.ABI.Layout
99

10-
import {{PROJECT}}.ABI.Types
10+
import VERISIMDB.ABI.Types
1111
import Data.Vect
1212
import Data.So
1313

debugger/src/abi/Types.idr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
||| This module defines the Application Binary Interface (ABI) for this library.
44
||| All type definitions include formal proofs of correctness.
55
|||
6-
||| Replace {{PROJECT}} with your project name.
6+
||| Replace VERISIMDB with your project name.
77
||| Replace {{TYPES}} with your actual type definitions.
88
|||
99
||| @see https://idris2.readthedocs.io for Idris2 documentation
1010

11-
module {{PROJECT}}.ABI.Types
11+
module VERISIMDB.ABI.Types
1212

1313
import Data.Bits
1414
import Data.So

ffi/zig/build.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// {{PROJECT}} FFI Build Configuration
1+
// VERISIMDB FFI Build Configuration
22
// SPDX-License-Identifier: PMPL-1.0-or-later
33

44
const std = @import("std");
@@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
99

1010
// Shared library (.so, .dylib, .dll)
1111
const lib = b.addSharedLibrary(.{
12-
.name = "{{project}}",
12+
.name = "verisimdb",
1313
.root_source_file = b.path("src/main.zig"),
1414
.target = target,
1515
.optimize = optimize,
@@ -20,7 +20,7 @@ pub fn build(b: *std.Build) void {
2020

2121
// Static library (.a)
2222
const lib_static = b.addStaticLibrary(.{
23-
.name = "{{project}}",
23+
.name = "verisimdb",
2424
.root_source_file = b.path("src/main.zig"),
2525
.target = target,
2626
.optimize = optimize,
@@ -32,8 +32,8 @@ pub fn build(b: *std.Build) void {
3232

3333
// Generate header file for C compatibility
3434
const header = b.addInstallHeader(
35-
b.path("include/{{project}}.h"),
36-
"{{project}}.h",
35+
b.path("include/verisimdb.h"),
36+
"verisimdb.h",
3737
);
3838
b.getInstallStep().dependOn(&header.step);
3939

@@ -79,7 +79,7 @@ pub fn build(b: *std.Build) void {
7979

8080
// Benchmark (if needed)
8181
const bench = b.addExecutable(.{
82-
.name = "{{project}}-bench",
82+
.name = "verisimdb-bench",
8383
.root_source_file = b.path("bench/bench.zig"),
8484
.target = target,
8585
.optimize = .ReleaseFast,

0 commit comments

Comments
 (0)