Skip to content

Arena/aspect weave - #89

Merged
hyperpolymath merged 4 commits into
mainfrom
arena/aspect-weave
Sep 24, 2026
Merged

hyperpolymath merged 4 commits into
mainfrom
arena/aspect-weave

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Changes

RSR Quality Checklist

Required

  • Tests pass (just test or equivalent)
  • Code is formatted (just fmt or equivalent)
  • Linter is clean (no new warnings or errors)
  • No banned language patterns (no , no npm/bun, no Go/Python)
  • No unsafe blocks without // SAFETY: comments
  • No banned functions (believe_me, unsafeCoerce, Obj.magic, Admitted, sorry)
  • SPDX license headers present on all new/modified source files
  • No secrets, credentials, or .env files included

As Applicable

  • .machine_readable/descriptiles/STATE.a2ml updated (if project state changed)
  • .machine_readable/descriptiles/ECOSYSTEM.a2ml updated (if integrations changed)
  • .machine_readable/descriptiles/META.a2ml updated (if architectural decisions changed)
  • Documentation updated for user-facing changes
  • TOPOLOGY.md updated (if architecture changed)
  • CHANGELOG or release notes updated
  • New dependencies reviewed for license compatibility (MPL-2.0 / MPL-2.0)
  • ABI/FFI changes validated (src/interface/abi/ and src/interface/ffi/ consistent)

Testing

Screenshots

arena-ai-coding-agent Bot and others added 4 commits September 24, 2026 04:30
Owner decision 2026-09-24: aspects are implemented once, in the
canonical Zig gateway. The twin could not compile (rand 0.10 API
drift; CI red on main) and duplicated every cross-cutting concern.

Drops: src/api/rust/, root Cargo workspace, rust-ci.yml, .gitlab-ci.yml
cargo stages, MIGRATION.adoc, mise/.tool-versions rust pins, and rust
entries in manifests/docs. Estate law unchanged: ABI = Idris2,
FFI/API = Zig. Future Rust, if any, must be Creusot-verified.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The gateway could not build publicly: libzig_api came from
developer-ecosystem (hardcoded /var/mnt/eclipse paths), whose own build
needs libproven_ffi from the private verification-ecosystem repo.

Implement the uapi surface in-repo (estate law: FFI = Zig), declared
ABI-first in src/abi/Gnosis.idr and asserted against zig_api.h in
tests. GnosisRequestV2 is the aerie extension that carries the query
string and headers — v1 strips both, so the deployed policy gate never
saw X-Api-Key and resolvers never saw ?target= params.

Verified: zig build ReleaseSafe + zig build test green; gateway serves
/api/v1/health, degrades gracefully with probes down, clean shutdown.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Design accepted (docs/design/forensic-stack.adoc): the Zig relational
engine is outside the trust boundary — it emits candidate attack paths
as RawStep derivations; the Idris2 kernel checks each against the
evidence (de Bruijn criterion). A solver bug can only lose answers.

src/abi/Forensics.idr: Retention (echo-types thin poset, port-and-
reprove), evidence-indexed Lateral/Reach, checkReach signature,
CertificateCheck + non-factive Warrant (epistemic-types surfaces).
ffi/zig/src/kanren.zig: evidence table, depth-bounded search over the
kanren_* C ABI; budgeted no-answer is distinct from no-answer-exists
(tropical budget seam). Agda/Lean repos cited as authority.

Not yet type-checked in Idris2 (no toolchain here; CI is the witness).

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The weave's skeleton: kyaml.zig (strict KEP-5295 subset, rule Y-3),
config.zig (defaults < KYAML < env; only getenv reader), ctx.zig
(per-request context, globals and the shared static buffer gone),
errors.zig (one statusOf), router.zig (THE route table: paths, verbs,
modules, resolvers; boundary-guarded), respond.zig (single write
path). main.zig: 756 inline lines -> lifecycle + the V2 handler.

GnosisRequestV2 gains resp_scratch: per-connection response storage
owned by the server. The weave exposed a real lifetime bug — bodies
must outlive the handler call (the socket write happens after
return); the old code survived only via the never-freed static.
Verified: ?target= params work (dead since single-port), real 400s,
verb enforcement, deterministic across runs.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c8f14e5a-c532-47e4-a859-249894f0cb46

📥 Commits

Reviewing files that changed from the base of the PR and between bf8c86b and bf41108.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (49)
  • .claude/CLAUDE.md
  • .gitattributes
  • .github/workflows/governance.yml
  • .github/workflows/rust-ci.yml
  • .gitignore
  • .gitlab-ci.yml
  • .tool-versions
  • ABI-FFI-README.md
  • ARCHITECTURE.md
  • CHANGELOG.adoc
  • Cargo.toml
  • Containerfile
  • Justfile
  • MIGRATION.adoc
  • ROADMAP.adoc
  • build.zig
  • configs/aerie.kyaml
  • docs/REPO-SETTINGS.adoc
  • docs/design/forensic-stack.adoc
  • ffi/README.md
  • ffi/zig/build.zig
  • ffi/zig/include/zig_api.h
  • ffi/zig/src/aerie.zig
  • ffi/zig/src/connector.zig
  • ffi/zig/src/core.zig
  • ffi/zig/src/gnosis.zig
  • ffi/zig/src/kanren.zig
  • ffi/zig/src/lib.zig
  • mise.toml
  • src/abi/0.1-AI-MANIFEST
  • src/abi/Forensics.idr
  • src/abi/Gnosis.idr
  • src/api/0.1-AI-MANIFEST
  • src/api/rust/Cargo.toml
  • src/api/rust/src/backends.rs
  • src/api/rust/src/main.rs
  • src/api/rust/src/policy.rs
  • src/api/rust/src/proof.rs
  • src/api/rust/src/redis_client.rs
  • src/api/rust/src/resolvers.rs
  • src/api/rust/src/verb_governance.rs
  • src/api/zig/config.zig
  • src/api/zig/ctx.zig
  • src/api/zig/errors.zig
  • src/api/zig/kyaml.zig
  • src/api/zig/main.zig
  • src/api/zig/respond.zig
  • src/api/zig/router.zig
  • src/api/zig/verb_governance.zig
 ____________________________________________________________________________________________________________________________________________________
< There are no final decisions. No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change. >
 ----------------------------------------------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath merged commit 00816ec into main Sep 24, 2026
25 of 29 checks passed
@hyperpolymath
hyperpolymath deleted the arena/aspect-weave branch September 24, 2026 14:05
Comment thread ffi/zig/src/connector.zig
@@ -0,0 +1,311 @@
// SPDX-License-Identifier: MPL-2.0
Comment thread ffi/zig/src/gnosis.zig
@@ -0,0 +1,572 @@
// SPDX-License-Identifier: MPL-2.0
Comment thread src/api/zig/respond.zig
@@ -0,0 +1,79 @@
// SPDX-License-Identifier: MPL-2.0
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.

2 participants