Skip to content

fix: instantiate bitfuckit from the RSR template - #22

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/instantiate-template
Jul 27, 2026
Merged

fix: instantiate bitfuckit from the RSR template#22
hyperpolymath merged 1 commit into
mainfrom
fix/instantiate-template

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

bitfuckit was scaffolded from rsr-template-repo and never instantiated: literal {{PLACEHOLDER}} tokens survived throughout, including in the .zig FFI sources — which meant the Zig genuinely did not parse (export fn {{project}}_init() etc.). This PR cures it for real, not just papers over it with packaging.

Identity used throughout comes from the repo's actual registration in reposystem/config/tools.ncl: role = utility, summary = "Ada/SPARK repository auditor (health, compliance, security posture)", status = extracted. No features beyond that description were invented.

What changed

  • ~80 files had RSR identity placeholders substituted: README, governance/security/conduct docs, .github/ community health files, .machine_readable/ state and contractile files, container/ packaging, .devcontainer/, docs/onboarding+status+attribution, examples/, Justfile top variables.
  • Left untouched by design: docs-template/, ADR/audit *-TEMPLATE.adoc copy-per-instance files, self-validating/examples/ and template-{hunt,kennel,yard}.k9.ncl (generic reusable scaffolding), machine-readable-design/ (describes the RSR standard generically, not this repo).
  • Zig FFI (src/interface/ffi/): {{PROJECT}}/{{project}}bitfuckit in main.zig, build.zig, integration_test.zig. Also fixed three real pre-existing bugs the placeholder text had been masking:
    • Handle was declared opaque but had fields (illegal in Zig) → changed to a plain struct
    • std.heap.c_allocator needs explicit libc linking that build.zig never wired up → switched to page_allocator (safe: this library only ever frees through its own bitfuckit_free/bitfuckit_free_string)
    • callconv(.C) is stale syntax under Zig 0.16 → callconv(.c)
    • Verified with the real toolchain (zig 0.16.0): zig fmt --check src/interface/ffi → exit 0, zig build → exit 0, zig test src/main.zig → exit 0 (3/3 tests), zig test test/integration_test.zig → exit 0 (1/1)
  • Justfile: top project/REPO vars fixed; every echo "TODO" stub recipe either replaced with a real, verified command or deleted outright where nothing exists to back it (run, run-verbose, install — no build target exists yet; bench, readiness — no harness exists). Mirrored into .machine_readable/contractiles/Justfile, which a Dustfile invariant expects to match the root Justfile but had drifted even further out of sync.
  • .machine_readable/6a2/{STATE,ECOSYSTEM}.a2ml and the contractiles/*file.a2ml family previously asserted "this repository IS rsr-template-repo, the canonical template" — rewritten to describe bitfuckit's actual, honest state (ABI/FFI seam compiles and passes its own tests; no Ada/SPARK audit logic exists yet). Where inherited body content still describes the template's own concerns, it's flagged in-file rather than fabricated into fictional bitfuckit-specific content.
  • Removed template machinery that tested the substitution mechanism itself, now moot post-instantiation: scripts/validate-template.sh, tests/e2e/template_instantiation_test.sh, benches/template_bench.sh, .machine_readable/ai/PLACEHOLDERS.adoc. Verified none are invoked from workflows/Justfile/build/just/*.just before deleting.
  • .github/settings.yml landmine fixed: unsubstituted name: "{{REPO}}" would have made probot/settings try to rename the repo to the literal string {{REPO}} on the next push to main.
  • PGP placeholders removed (not fabricated) from SECURITY.md / .well-known/security.txt — no PGP key is actually published for this project.

Test plan

  • zig fmt --check src/interface/ffi → exit 0
  • zig build (in src/interface/ffi) → exit 0
  • zig test src/main.zig → exit 0, 3/3 passing
  • zig test test/integration_test.zig → exit 0, 1/1 passing
  • just build, just test, just fmt-check, just deps all run the intended real commands and pass
  • All 27 .github/workflows/*.yml files still parse as valid YAML
  • Grep-verified no disease {{[A-Z_]+}} / {{project}} / {{PROJECT}} tokens remain outside the deliberately-excluded generic template files
  • Owner review of the honest STATE.a2ml/ECOSYSTEM.a2ml rewrite and the removed Justfile recipes

Note: just aspect (now wired to the real tests/aspect_tests.sh) currently fails on two pre-existing, unrelated issues documented in docs/status/TEST-NEEDS.adoc: a gitignored .zig-cache build artifact getting swept into the SPDX-header scan, and doc-prose substring matches for "sorry"/"Admitted" in verification/proofs/. Not fixed here — out of scope for an instantiation pass, and real script bugs rather than identity placeholders.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

bitfuckit was scaffolded from rsr-template-repo but never instantiated:
literal {{PLACEHOLDER}} tokens survived throughout, including in the .zig
FFI sources, so the Zig genuinely did not parse (export fn {{project}}_init()
etc.). This cures it for real.

Identity substituted across ~80 files (README, governance/security/conduct
docs, .github/ community health files, .machine_readable/ state+contractile
files, container/ packaging, .devcontainer/, docs/onboarding+status+
attribution, examples, Justfile top variables) using the repo's actual
registration in reposystem/config/tools.ncl: role=utility,
summary="Ada/SPARK repository auditor (health, compliance, security
posture)", status=extracted. Left untouched: docs-template/, ADR/audit
*-TEMPLATE.adoc copy-per-instance files, self-validating/examples and
template-{hunt,kennel,yard}.k9.ncl (generic reusable scaffolding by design),
and machine-readable-design/ (describes the RSR standard generically).

Zig FFI (src/interface/ffi/):
- {{PROJECT}}/{{project}} -> bitfuckit in main.zig, build.zig, integration_test.zig
- fixed three real pre-existing bugs the placeholder text had been masking:
  Handle was `opaque` with fields (illegal in Zig), std.heap.c_allocator
  needs libc linking build.zig never wired up (switched to page_allocator,
  self-consistent since alloc/free are always paired through this library's
  own functions), and callconv(.C) is stale syntax under Zig 0.16 (-> .c)
- verified with the real toolchain (zig 0.16.0): `zig fmt --check
  src/interface/ffi` exit 0, `zig build` exit 0, `zig test src/main.zig`
  exit 0 (3/3 tests), `zig test test/integration_test.zig` exit 0 (1/1)

Justfile: top `project`/`REPO` vars fixed; every `echo "TODO"` stub recipe
either replaced with a real, verified command (build/test -> zig
build/test, fmt/fmt-check -> zig fmt, lint -> idris2 --typecheck abi.ipkg,
e2e/aspect -> the real test scripts, deps -> real zig/idris2 presence
checks) or deleted outright where nothing exists to back it (run,
run-verbose, install: build.zig defines no executable/library target yet;
bench, readiness: no benchmark or readiness-test harness exists). Mirrored
the same fixes into .machine_readable/contractiles/Justfile, which a Dustfile
invariant expects to match the root Justfile but had drifted further out of
sync than the root copy.

.machine_readable/6a2/{STATE,ECOSYSTEM}.a2ml and the contractiles/
(Must|Trust|Intent|Adjust|Bust|Dust)file.a2ml family previously asserted
"this repository is rsr-template-repo, the canonical template" — rewritten
to describe bitfuckit's real, honest state (ABI/FFI seam compiles and passes
its own tests; no Ada/SPARK audit logic exists yet) rather than silently
carrying that false identity forward. Where inherited body content (intents,
failure-mode probes) still describes the template's own concerns rather than
bitfuckit's, it is flagged in-file rather than fabricated into fictional
bitfuckit-specific content.

Removed template machinery that tests the *substitution mechanism itself*,
now moot post-instantiation: scripts/validate-template.sh,
tests/e2e/template_instantiation_test.sh, benches/template_bench.sh, and
.machine_readable/ai/PLACEHOLDERS.adoc. Verified none are invoked from
.github/workflows/, Justfile, or build/just/*.just before deleting; all 27
workflow YAML files still parse after the changes.

.github/settings.yml's `name: "{{REPO}}"` is fixed to "bitfuckit" — left
unsubstituted it would have made probot/settings try to rename the repo to
the literal string "{{REPO}}" on the next push to main.

Removed PGP-key placeholders from SECURITY.md and .well-known/security.txt
instead of fabricating a fake fingerprint/URL: no PGP key is actually
published for this project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review July 27, 2026 18:25
@hyperpolymath
hyperpolymath merged commit 7dc6a95 into main Jul 27, 2026
41 of 43 checks passed
@hyperpolymath
hyperpolymath deleted the fix/instantiate-template branch July 27, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant