From 6fc03e99b0326830f3edc1ecbdddabf510a21a02 Mon Sep 17 00:00:00 2001 From: Riverbraid Date: Wed, 19 Aug 2026 17:50:44 -0400 Subject: [PATCH] R3: establish primitive-boundary topology --- .github/workflows/verify.yml | 46 ++---- AUTHORITY.md | 33 ++--- PROTOCOL-BOUNDARY.md | 27 ++++ PUBLIC_EVIDENCE.md | 58 ++------ README.md | 127 ++++------------- RING.md | 27 ++-- VOCABULARY_LOCK.md | 42 +++--- .../phase15/AUDIT-MANIFEST.sha256 | 0 .../phase15/AUDIT-TRAIL.ndjson | 0 historical/phase15/AUTHORITY.md | 19 +++ historical/phase15/PUBLIC_EVIDENCE.md | 57 ++++++++ historical/phase15/RING.md | 18 +++ historical/phase15/VOCABULARY_LOCK.md | 23 +++ .../phase15/audit-output.json | 0 .../phase15/audit_final.js | 0 .../phase15/byte-audit.mjs | 0 .../phase15/cluster-manifest-v2.json | 0 .../phase15/cluster-verify.mjs | 0 .../phase15/constellation-audit.mjs | 0 .../phase15/integrity-floor.json | 0 mechanical-profile.json | 58 ++++++++ mechanical-verify.mjs | 131 ++++++++++++++++++ package.json | 19 ++- 23 files changed, 433 insertions(+), 252 deletions(-) create mode 100644 PROTOCOL-BOUNDARY.md rename AUDIT-MANIFEST.sha256 => historical/phase15/AUDIT-MANIFEST.sha256 (100%) rename AUDIT-TRAIL.ndjson => historical/phase15/AUDIT-TRAIL.ndjson (100%) create mode 100644 historical/phase15/AUTHORITY.md create mode 100644 historical/phase15/PUBLIC_EVIDENCE.md create mode 100644 historical/phase15/RING.md create mode 100644 historical/phase15/VOCABULARY_LOCK.md rename audit-output.json => historical/phase15/audit-output.json (100%) rename audit_final.js => historical/phase15/audit_final.js (100%) rename byte-audit.mjs => historical/phase15/byte-audit.mjs (100%) rename cluster-manifest-v2.json => historical/phase15/cluster-manifest-v2.json (100%) rename cluster-verify.mjs => historical/phase15/cluster-verify.mjs (100%) rename constellation-audit.mjs => historical/phase15/constellation-audit.mjs (100%) rename integrity-floor.json => historical/phase15/integrity-floor.json (100%) create mode 100644 mechanical-profile.json create mode 100644 mechanical-verify.mjs diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 8399a04..944fb7c 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,44 +1,26 @@ -name: Riverbraid Verification Suite +name: Riverbraid Core Mechanical Boundary + on: push: - branches: - - main + branches: [main] pull_request: - branches: - - main + branches: [main] workflow_dispatch: + permissions: contents: read + jobs: - verify-core: + verify-mechanical-boundary: runs-on: ubuntu-24.04 steps: - - name: Checkout Riverbraid-Core - uses: actions/checkout@v4 + - name: Checkout exact Core subject + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version: '20.11.0' - - name: Clone Ring 0 sibling repositories - shell: bash - run: | - set -euo pipefail - cd .. - for repo in \ - Riverbraid-Golds \ - Riverbraid-Governance \ - Riverbraid-Integrity-Floors \ - Riverbraid-Types - do - echo "Cloning $repo" - git clone --depth 1 "https://github.com/Riverbraid/${repo}.git" "$repo" - done - echo "RING0_SIBLINGS_CLONED" - - name: Run compatibility audit - shell: bash - run: | - set -euo pipefail - node audit_final.js - node constellation-audit.mjs --ring 0 - - name: Final status - run: echo "RIVERBRAID_CORE_RING0_CI_OK" \ No newline at end of file + + - name: Run scoped mechanical verifier + run: node mechanical-verify.mjs diff --git a/AUTHORITY.md b/AUTHORITY.md index 75b33fc..8ae40ec 100644 --- a/AUTHORITY.md +++ b/AUTHORITY.md @@ -1,19 +1,14 @@ -# Riverbraid-Core Authority -Ring: 0 -Role: Proposed Phase 15 trust anchor -Status: CLASSIFIED -## Claim Boundary -This repository participates in the proposed Phase 15 Ring 0 trust anchor layer. -This file does not claim full constellation verification. -This repository may only claim VERIFIED after its local verifier produces verify-output.json with status VERIFIED. -## Refused Claims -This repository does not claim: -- production readiness -- legal compliance -- universal safety -- absolute truth -- full constellation verification -- downstream ring verification -## Mechanical Honesty Rule -File presence is not verification. -Verification requires a real verifier output. \ No newline at end of file +# Riverbraid-Core authority boundary + +**Lifecycle:** ACTIVE_ARCHITECTURAL_SURFACE +**Role:** MECHANICAL_PROTOCOL +**Protocol authority:** MECHANICAL_GRAMMAR_ONLY +**Project authority:** NONE + +Riverbraid-Core controls only Riverbraid's mechanical interoperability grammar: how records and attributed assertions are identified, serialized, referenced, preserved, structurally validated, and transported. + +Its authority terminates before truth, trust, evidentiary weight, interpretation, legitimacy, meaning, moral priority, risk ranking, readiness, certification, adoption judgment, or the correct resolution of disagreement. + +A Riverbraid project decision may select a Core version for the Riverbraid project. That does not make an external interpretation true or universally authoritative. + +Historical Ring/constellation and trust-anchor material is preserved under `historical/phase15/` and is not current Core authority. diff --git a/PROTOCOL-BOUNDARY.md b/PROTOCOL-BOUNDARY.md new file mode 100644 index 0000000..f63652a --- /dev/null +++ b/PROTOCOL-BOUNDARY.md @@ -0,0 +1,27 @@ +# Riverbraid Core Protocol Boundary + +## Controlling boundary + +Core is the controlling specification for Riverbraid's mechanical interoperability grammar. + +Its authority terminates before trust, truth, evidentiary weight, interpretation, legitimacy, meaning, moral priority, risk ranking, readiness, certification, or adoption judgment. + +## Primitive-boundary rule + +For every Core field, enum, predicate, status, registry-membership rule, validator rule, default, and lifecycle label, determine whether it records a demonstrable mechanical fact or imports an interpretation. + +An interpretive item must be attributed to a declared profile/authority, made namespaced and extensible, moved outside Core, or removed. + +## Relationship rule + +Core may define an assertion envelope and stable references. It does not define universal meanings for relationship predicates. + +A mapping between vocabularies is another attributed and scoped assertion with its own evidence and challenge path. It is never an automatic Riverbraid equivalence. + +## Extension rule + +Unknown namespaced predicates, types, and extension members must be preservable without network dereferencing, renaming, dropping, or coercion during structural processing. + +## Build-control separation + +Riverbraid's F0–F4 gates, authorization records, custody receipts, hash ledgers, and implementation stop conditions are project/build controls. They do not become protocol primitives merely because they are used to build Riverbraid. diff --git a/PUBLIC_EVIDENCE.md b/PUBLIC_EVIDENCE.md index 4d59eda..698d7df 100644 --- a/PUBLIC_EVIDENCE.md +++ b/PUBLIC_EVIDENCE.md @@ -1,57 +1,17 @@ -# Riverbraid Public Evidence Manifest +# Riverbraid-Core public evidence boundary -This document records the current public evidence surface for Riverbraid. -It is intended for external review of the repository system's structural and workflow evidence. It does not claim third party certification, absolute security, absence of bugs, or universal correctness. +The current Core evidence surface is intentionally narrow. -## Verification Summary +`mechanical-verify.mjs` evaluates only the declared R3 mechanical boundary in `mechanical-profile.json`. A scoped PASS means that the named checks satisfied that named mechanical profile for the exact checked-out Core commit. -| Evidence Layer | Status | Result | -|---|---:|---:| -| Registry size | Verified | 30 repositories | -| Phase 20 stationarity | Pass | 30 stationary, 0 failed or incomplete | -| Phase 21 workflows | Pass | 30 remote passing, 0 failed | -| Third party certification | Not asserted | Pending external process | +It does not establish truth, trustworthiness, evidentiary weight, safety, compliance, readiness, maturity, certification, adoption, external audit, or downstream AI behavior. -## Evidence Anchors +## Historical evidence -| Artifact | Status | -|---|---| -| phase20-cross-repo-anchor-registry.json | present | -| phase20-cluster-verification.json | present | -| phase21-final-workflow-audit.json | present | -| phase22-evidence-inventory.json | anchored | +Earlier 30-repository, Ring, constellation, stationarity, and workflow evidence remains preserved as historical Riverbraid evidence. It is not rewritten as proof of the lean R3 topology. -## Core Anchors +Exact Phase 15 machine/prose surfaces detached by R3 are preserved under `historical/phase15/`. -- Phase 21 workflow evidence commit: e207787873fb1a7351d1320f56eec6605a9c58ec -- Phase 22 evidence inventory commit: fadcb1c14affcaeafe12ecc3a50eded3987c9a9d -- Core repository: https://github.com/Riverbraid/Riverbraid-Core +## Public reproduction -## Verified Scope - -Riverbraid currently verifies: - -1. The registry contains exactly 30 repositories. -2. Phase 20 recorded the registry as stationary. -3. Phase 21 recorded all 30 repositories as having completed successful GitHub Actions runs on their current remote heads. -4. The evidence inventory explicitly does not assert third party certification. - -## Not Claimed - -Riverbraid does not claim: - -1. Third party certification. -2. Absolute security. -3. Absence of defects. -4. Legal, compliance, SOC 2, ISO, or formal audit approval. -5. That workflow success proves all future behavior. - -## External Reproduction - -The intended reproduction path is: - - git clone https://github.com/Riverbraid/Riverbraid-Core.git - cd Riverbraid-Core - node cluster-verify.mjs - -The verifier requires sibling local checkouts of the 30 registry repositories and GitHub CLI access through gh. +The current cross-repository mechanical reproduction owner is `Riverbraid-Evaluation-Kit`. It records exact evaluator, profile, subject commit, environment, check outcomes, evidence references, and nonclaims. diff --git a/README.md b/README.md index 03a0009..59c6de8 100644 --- a/README.md +++ b/README.md @@ -1,116 +1,41 @@ # Riverbraid-Core -> Status: CORE_AUDIT_SURFACE -> Ring Role: Core / normative protocol authority -> Claim Boundary: deterministic integrity floor, byte audit, and ring governance only +> Lifecycle: ACTIVE_ARCHITECTURAL_SURFACE +> Role: MECHANICAL_PROTOCOL +> Protocol authority: MECHANICAL_GRAMMAR_ONLY +> Project authority: NONE +> Current reproduction profile role: MECHANICAL_SUBJECT -Riverbraid-Core is a deterministic integrity floor for the Riverbraid architecture. +Riverbraid-Core is the controlling specification for Riverbraid's **mechanical interoperability grammar**. -It defines the minimum governance substrate used to make structure, authority, and drift visible before trust is granted. It does not claim to implement the full experimental Riverbraid research surface. Outer repositories may extend, visualize, adapt, or experiment, but Riverbraid-Core remains the canonical reference for protocol authority and audit behavior. +It defines only the shared mechanics necessary to identify, serialize, preserve, reference, validate, and transport Riverbraid records and attributed assertions. Its authority terminates before interpretation. -## Role in Riverbraid +Riverbraid does not decide truth, trust, evidentiary weight, legitimacy, risk, readiness, certification, moral priority, or the correct interpretation of evidence. -Riverbraid-Core is a canonical protocol authority surface within Riverbraid. +## Mechanical boundary -## Public verification boundary +Core may standardize: -This repository is part of the current Evaluation Kit canonical verification registry and defines core protocol authority and audit behavior for Riverbraid. +- record and assertion identity; +- deterministic serialization and digest contracts once separately adopted; +- references to subjects, sources, agents, scopes, conditions, evidence, profiles, and challenges; +- structural validator behavior and scoped result transport; +- preservation of unknown namespaced types, predicates, and extensions; +- recording of lifecycle and supersession events without rewriting history. -## Evidence boundary +Core must not standardize: -This repository does not claim certification, legal approval, production readiness, absolute security, external audit, complete AI safety, adoption, registry freshness, or absence of defects. +- which assertion or interpretation is correct; +- universal meanings for relationship predicates; +- a root of trust or universal trust score; +- evidentiary weight, relevance, legitimacy, causality, safety, compliance, readiness, maturity, certification, or adoption judgment. -## Canonical One-Liner +Relationship predicate meanings belong to declared, namespaced vocabularies or profiles. A vocabulary mapping is an attributed assertion; it is not a hidden Riverbraid equivalence. -Riverbraid is an open-source deterministic integrity floor for AI governance: a fail-closed, byte-auditable architecture that makes structure, authority, and drift visible. Its broader research directions, including mathematical physics of cognition, memory-flow-truth braiding, and intent-aware compute, remain experimental surfaces built on top of this bounded floor. +## Historical machine surfaces -## Core Function +Earlier ring/constellation and “Trust Anchors” machinery is preserved as Riverbraid history and is not inherited as current Core semantics. The R3 migration must preserve its exact historical bytes while detaching it from the active mechanical verifier. -Riverbraid-Core provides: -* Ring classification and constellation audit -* Required file surface verification -* Byte-level audit of tracked repository files -* BOM detection for text surfaces -* Dirty worktree detection -* Verification output validation -* Audit manifest generation -* Append-only audit trail recording +## Reproduction -## Authority Boundary - -Riverbraid-Core is normative for Riverbraid protocol governance. - -It defines the audit substrate and verification rules. It does not implement domain-specific behavior for runtime forks, UI layers, signing tools, embedded ports, language surfaces, or experimental cognition layers. - -Any repository outside Core must not redefine Riverbraid protocol semantics. It may only declare its role, expose its verification surface, and pass the applicable ring gates. - -## Coupling Test - -Any change to these files requires a full Ring 2 verification pass before being treated as valid: -* constellation-audit.mjs -* byte-audit.mjs -* cluster-manifest-v2.json -* verify-output.json -* audit-output.json -* AUDIT-MANIFEST.sha256 -* AUDIT-TRAIL.ndjson - -Required checks: - -```bash -node constellation-audit.mjs --ring 2 -node byte-audit.mjs --ring 2 -``` - -Expected verified states: -* RING_GATE_PASS_VERIFIED -* BYTE_GATE_PASS_VERIFIED - -## Scale Separation Gate - -Core owns protocol authority and audit rules. - -Outer rings own implementation surfaces, runtime experiments, bridges, tools, visualization, and communication layers. - -Core must remain small enough to audit directly. New experimental behavior belongs outside Core unless it is required for the integrity floor itself. - -## Linear vs Nonlinear Boundary - -The Core audit path is linear: -1. Declare manifest -2. Check required files -3. Read verifier outputs -4. Hash tracked bytes -5. Reject BOM -6. Reject dirty worktrees -7. Emit audit manifest -8. Record audit trail - -The broader Riverbraid research surface may remain nonlinear, experimental, expressive, or exploratory. That layer does not override Core verification. - -## Stationary State Invariant - -Riverbraid-Core is stationary when all of the following are true: -* Local worktree is clean -* Required files are present -* Verifier outputs parse successfully -* Ring 2 returns RING_GATE_PASS_VERIFIED -* Ring 2 returns BYTE_GATE_PASS_VERIFIED -* Audit manifest exists -* Audit trail records the verification event -* No UTF-8 BOM is present in tracked text files - -## Verification - -Run: - -```bash -node constellation-audit.mjs --ring 2 -node byte-audit.mjs --ring 2 -``` - -## Claim Hygiene - -Riverbraid-Core supports the bounded claim that Riverbraid has a working open-source deterministic integrity floor and governance artifact. - -The broader claims around True AI, mathematical physics of cognition, memory-flow-truth braiding, resonance, and intent-aware compute remain active experimental directions unless implemented, tested, and verified in dedicated repositories. +The current public reproduction owner is [Riverbraid-Evaluation-Kit](https://github.com/Riverbraid/Riverbraid-Evaluation-Kit). A result is meaningful only with its exact subject, profile/check contract, evaluator, environment, evidence, and nonclaims. diff --git a/RING.md b/RING.md index a74c0b3..0bf790b 100644 --- a/RING.md +++ b/RING.md @@ -1,18 +1,9 @@ -# Riverbraid-Core Ring Declaration -repo: Riverbraid-Core -ring: 0 -ring_name: Trust Anchors -phase: Phase 15 -promotion_state: CLASSIFIED -## Membership Basis -Ring membership is assigned by Riverbraid-Core/cluster-manifest-v2.json. -Ring membership does not mean verification. -Ring membership does not mean custodian signature. -Ring membership does not mean the gate has been evaluated. -## Promotion States -UNAUDITED -CLASSIFIED -FILES_PRESENT_UNVERIFIED -VERIFIED -## Claim Boundary -This repository remains within declared conditions only. \ No newline at end of file +# Historical Ring ontology notice + +The prior Riverbraid Ring / constellation ontology is **historical** and is not a current Core classification system. + +The exact prior `RING.md` bytes are preserved at: + +`historical/phase15/RING.md` + +Current Riverbraid-Core does not assign a trust-anchor ring, promotion rank, or semantic authority through this file. See `PROTOCOL-BOUNDARY.md` and `mechanical-profile.json` for the current mechanical boundary. diff --git a/VOCABULARY_LOCK.md b/VOCABULARY_LOCK.md index 6b4e3fc..174a71f 100644 --- a/VOCABULARY_LOCK.md +++ b/VOCABULARY_LOCK.md @@ -1,23 +1,19 @@ -# VOCABULARY_LOCK.md -# Version: 1.0.0 -# Authority: Normative (Riverbraid-Core) - -## 1. System States -- **Active**: Behavior is proven via deterministic vectors. -- **Parked**: Non-behavior and boundary integrity are proven. -- **Experimental**: Explicitly excluded from the trusted floor. -- **Deprecated**: Authority is scheduled for removal. -- **Archived**: Authority is removed; preserved for historical audit only. - -## 2. Core Integrity Terms -- **Verified**: A state confirmed by a passing vector test. -- **Fail-Closed**: A safety state where any ambiguity results in a refusal or "Fail" status. -- **Stationary**: A state where the system is stable and reproducible. -- **Reconstructable**: The ability for a stranger to reproduce the system from the manifest. -- **Claim Boundary**: The declared limit of what a repository is authorized to verify. - -## 3. Structural Roles -- **Normative**: Defines meaning and rules for the constellation. -- **Verifier**: Executes tests to prove claims. -- **Support**: Provides shared logic or structures. -- **Informative**: Provides human-legible context without machine authority. +# Riverbraid-Core vocabulary boundary + +Core identifiers for record types, predicates, profiles, checks, authorities, and extensions are structural references. + +Core does **not** define a universal semantic vocabulary for truth, trust, legitimacy, evidentiary weight, risk, readiness, maturity, certification, or interpretation. + +## Predicate rule + +A relationship predicate must be namespaced or otherwise stably identified. Its meaning belongs to the declared vocabulary, profile, or authority that defines it. + +A mapping between two vocabularies is itself an attributed, scoped assertion. Core must not infer semantic equivalence merely because two labels are similar. + +## Unknown-extension rule + +Unknown namespaced types, predicates, and extension members must be preservable opaquely during structural processing. Structural validation must not require network dereferencing. + +## Historical vocabulary + +The exact former `VOCABULARY_LOCK.md` is preserved at `historical/phase15/VOCABULARY_LOCK.md`. Its former Ring/constellation meanings are not current Core semantics. diff --git a/AUDIT-MANIFEST.sha256 b/historical/phase15/AUDIT-MANIFEST.sha256 similarity index 100% rename from AUDIT-MANIFEST.sha256 rename to historical/phase15/AUDIT-MANIFEST.sha256 diff --git a/AUDIT-TRAIL.ndjson b/historical/phase15/AUDIT-TRAIL.ndjson similarity index 100% rename from AUDIT-TRAIL.ndjson rename to historical/phase15/AUDIT-TRAIL.ndjson diff --git a/historical/phase15/AUTHORITY.md b/historical/phase15/AUTHORITY.md new file mode 100644 index 0000000..75b33fc --- /dev/null +++ b/historical/phase15/AUTHORITY.md @@ -0,0 +1,19 @@ +# Riverbraid-Core Authority +Ring: 0 +Role: Proposed Phase 15 trust anchor +Status: CLASSIFIED +## Claim Boundary +This repository participates in the proposed Phase 15 Ring 0 trust anchor layer. +This file does not claim full constellation verification. +This repository may only claim VERIFIED after its local verifier produces verify-output.json with status VERIFIED. +## Refused Claims +This repository does not claim: +- production readiness +- legal compliance +- universal safety +- absolute truth +- full constellation verification +- downstream ring verification +## Mechanical Honesty Rule +File presence is not verification. +Verification requires a real verifier output. \ No newline at end of file diff --git a/historical/phase15/PUBLIC_EVIDENCE.md b/historical/phase15/PUBLIC_EVIDENCE.md new file mode 100644 index 0000000..4d59eda --- /dev/null +++ b/historical/phase15/PUBLIC_EVIDENCE.md @@ -0,0 +1,57 @@ +# Riverbraid Public Evidence Manifest + +This document records the current public evidence surface for Riverbraid. +It is intended for external review of the repository system's structural and workflow evidence. It does not claim third party certification, absolute security, absence of bugs, or universal correctness. + +## Verification Summary + +| Evidence Layer | Status | Result | +|---|---:|---:| +| Registry size | Verified | 30 repositories | +| Phase 20 stationarity | Pass | 30 stationary, 0 failed or incomplete | +| Phase 21 workflows | Pass | 30 remote passing, 0 failed | +| Third party certification | Not asserted | Pending external process | + +## Evidence Anchors + +| Artifact | Status | +|---|---| +| phase20-cross-repo-anchor-registry.json | present | +| phase20-cluster-verification.json | present | +| phase21-final-workflow-audit.json | present | +| phase22-evidence-inventory.json | anchored | + +## Core Anchors + +- Phase 21 workflow evidence commit: e207787873fb1a7351d1320f56eec6605a9c58ec +- Phase 22 evidence inventory commit: fadcb1c14affcaeafe12ecc3a50eded3987c9a9d +- Core repository: https://github.com/Riverbraid/Riverbraid-Core + +## Verified Scope + +Riverbraid currently verifies: + +1. The registry contains exactly 30 repositories. +2. Phase 20 recorded the registry as stationary. +3. Phase 21 recorded all 30 repositories as having completed successful GitHub Actions runs on their current remote heads. +4. The evidence inventory explicitly does not assert third party certification. + +## Not Claimed + +Riverbraid does not claim: + +1. Third party certification. +2. Absolute security. +3. Absence of defects. +4. Legal, compliance, SOC 2, ISO, or formal audit approval. +5. That workflow success proves all future behavior. + +## External Reproduction + +The intended reproduction path is: + + git clone https://github.com/Riverbraid/Riverbraid-Core.git + cd Riverbraid-Core + node cluster-verify.mjs + +The verifier requires sibling local checkouts of the 30 registry repositories and GitHub CLI access through gh. diff --git a/historical/phase15/RING.md b/historical/phase15/RING.md new file mode 100644 index 0000000..a74c0b3 --- /dev/null +++ b/historical/phase15/RING.md @@ -0,0 +1,18 @@ +# Riverbraid-Core Ring Declaration +repo: Riverbraid-Core +ring: 0 +ring_name: Trust Anchors +phase: Phase 15 +promotion_state: CLASSIFIED +## Membership Basis +Ring membership is assigned by Riverbraid-Core/cluster-manifest-v2.json. +Ring membership does not mean verification. +Ring membership does not mean custodian signature. +Ring membership does not mean the gate has been evaluated. +## Promotion States +UNAUDITED +CLASSIFIED +FILES_PRESENT_UNVERIFIED +VERIFIED +## Claim Boundary +This repository remains within declared conditions only. \ No newline at end of file diff --git a/historical/phase15/VOCABULARY_LOCK.md b/historical/phase15/VOCABULARY_LOCK.md new file mode 100644 index 0000000..6b4e3fc --- /dev/null +++ b/historical/phase15/VOCABULARY_LOCK.md @@ -0,0 +1,23 @@ +# VOCABULARY_LOCK.md +# Version: 1.0.0 +# Authority: Normative (Riverbraid-Core) + +## 1. System States +- **Active**: Behavior is proven via deterministic vectors. +- **Parked**: Non-behavior and boundary integrity are proven. +- **Experimental**: Explicitly excluded from the trusted floor. +- **Deprecated**: Authority is scheduled for removal. +- **Archived**: Authority is removed; preserved for historical audit only. + +## 2. Core Integrity Terms +- **Verified**: A state confirmed by a passing vector test. +- **Fail-Closed**: A safety state where any ambiguity results in a refusal or "Fail" status. +- **Stationary**: A state where the system is stable and reproducible. +- **Reconstructable**: The ability for a stranger to reproduce the system from the manifest. +- **Claim Boundary**: The declared limit of what a repository is authorized to verify. + +## 3. Structural Roles +- **Normative**: Defines meaning and rules for the constellation. +- **Verifier**: Executes tests to prove claims. +- **Support**: Provides shared logic or structures. +- **Informative**: Provides human-legible context without machine authority. diff --git a/audit-output.json b/historical/phase15/audit-output.json similarity index 100% rename from audit-output.json rename to historical/phase15/audit-output.json diff --git a/audit_final.js b/historical/phase15/audit_final.js similarity index 100% rename from audit_final.js rename to historical/phase15/audit_final.js diff --git a/byte-audit.mjs b/historical/phase15/byte-audit.mjs similarity index 100% rename from byte-audit.mjs rename to historical/phase15/byte-audit.mjs diff --git a/cluster-manifest-v2.json b/historical/phase15/cluster-manifest-v2.json similarity index 100% rename from cluster-manifest-v2.json rename to historical/phase15/cluster-manifest-v2.json diff --git a/cluster-verify.mjs b/historical/phase15/cluster-verify.mjs similarity index 100% rename from cluster-verify.mjs rename to historical/phase15/cluster-verify.mjs diff --git a/constellation-audit.mjs b/historical/phase15/constellation-audit.mjs similarity index 100% rename from constellation-audit.mjs rename to historical/phase15/constellation-audit.mjs diff --git a/integrity-floor.json b/historical/phase15/integrity-floor.json similarity index 100% rename from integrity-floor.json rename to historical/phase15/integrity-floor.json diff --git a/mechanical-profile.json b/mechanical-profile.json new file mode 100644 index 0000000..f35fcbc --- /dev/null +++ b/mechanical-profile.json @@ -0,0 +1,58 @@ +{ + "build_control_separation": "F0_F4_AUTHORIZATION_CUSTODY_AND_IMPLEMENTATION_GATES_ARE_PROJECT_BUILD_CONTROLS_NOT_PROTOCOL_PRIMITIVES", + "forbidden_current_legacy_paths": [ + "cluster-manifest-v2.json", + "constellation-audit.mjs", + "cluster-verify.mjs", + "byte-audit.mjs", + "audit_final.js", + "audit-output.json", + "AUDIT-MANIFEST.sha256", + "AUDIT-TRAIL.ndjson", + "integrity-floor.json" + ], + "historical_phase15_blobs": { + "historical/phase15/AUDIT-MANIFEST.sha256": "add6b7a48662ecbe0c3a7d4cc5591682bfbfa20f", + "historical/phase15/AUDIT-TRAIL.ndjson": "925b57447298d44aea94852919c5ecbb69f31e66", + "historical/phase15/AUTHORITY.md": "75b33fc13123fdce73b83e20185c037995ee2f67", + "historical/phase15/PUBLIC_EVIDENCE.md": "4d59eda5669590b390233d645b3f4bd3e24511e3", + "historical/phase15/RING.md": "a74c0b317962986b14d0ed44bd840feb09f5b508", + "historical/phase15/VOCABULARY_LOCK.md": "6b4e3fc149cf2e4bdf2f1bd50c105ff5e8af51f9", + "historical/phase15/audit-output.json": "95ae4ddbcaf9596bb8bd1e2450120b025bc2633d", + "historical/phase15/audit_final.js": "a8df74421247d495ea41ea19176a61ac7102d612", + "historical/phase15/byte-audit.mjs": "5e1de1bdc27ed08529f841a1988bf27209d395ed", + "historical/phase15/cluster-manifest-v2.json": "39c47069de2b0e4fbde4ea7d44a5750ad5f75be0", + "historical/phase15/cluster-verify.mjs": "1f98e6f8f669db4ecf739074c7dcacdc2b8188da", + "historical/phase15/constellation-audit.mjs": "dc90b4e9dc6d16cb98564ded3b8c6a163099b5bf", + "historical/phase15/integrity-floor.json": "786365fbb07c10d638b2d73d07d817e903c687e9" + }, + "non_authorities": [ + "TRUTH", + "TRUST", + "EVIDENTIARY_WEIGHT", + "INTERPRETATION", + "LEGITIMACY", + "MEANING", + "MORAL_PRIORITY", + "RISK_RANKING", + "READINESS", + "CERTIFICATION", + "ADOPTION_JUDGMENT" + ], + "profile_id": "urn:riverbraid:core:mechanical-profile:v0.1", + "relationship_policy": { + "assertion_envelope": "MECHANICAL", + "mapping_semantics": "ATTRIBUTED_SCOPED_ASSERTION_NOT_AUTOMATIC_EQUIVALENCE", + "predicate_meaning": "OUTSIDE_CORE_IN_DECLARED_NAMESPACED_VOCABULARY_OR_PROFILE" + }, + "required_current_files": [ + "README.md", + "PROTOCOL-BOUNDARY.md", + "mechanical-profile.json", + "mechanical-verify.mjs" + ], + "schema_ref": "urn:riverbraid:core:mechanical-profile-manifest:v0.1", + "scope": "STRUCTURAL_MECHANICAL_INTEROPERABILITY_ONLY", + "status": "R3_CANDIDATE_NOT_RELEASED", + "unknown_extension_policy": "PRESERVE_OPAQUELY_NO_NETWORK_DEREFERENCE_FOR_STRUCTURAL_VALIDATION" +} diff --git a/mechanical-verify.mjs b/mechanical-verify.mjs new file mode 100644 index 0000000..7fe1e8c --- /dev/null +++ b/mechanical-verify.mjs @@ -0,0 +1,131 @@ +import fs from "node:fs"; +import path from "node:path"; +import crypto from "node:crypto"; +import { execFileSync } from "node:child_process"; + +const ROOT = process.cwd(); +const PROFILE_PATH = path.join(ROOT, "mechanical-profile.json"); + +function sha256(bytes) { + return crypto.createHash("sha256").update(bytes).digest("hex"); +} + +function git(args) { + return execFileSync("git", args, { + cwd: ROOT, + encoding: "utf8", + stdio: ["ignore", "pipe", "pipe"] + }).trim(); +} + +function gitBlob(relPath) { + return git(["hash-object", "--", relPath]); +} + +function check(id, pass, evidence = {}) { + return { check_ref: `urn:riverbraid:check:${id}:v0.1`, result: pass ? "PASS" : "FAIL", evidence }; +} + +const checks = []; +let profile; +try { + profile = JSON.parse(fs.readFileSync(PROFILE_PATH, "utf8")); +} catch (error) { + console.log(JSON.stringify({ + result_id: "urn:riverbraid:result:core-mechanical-boundary:invalid-profile", + subject_ref: "https://github.com/Riverbraid/Riverbraid-Core", + subject_commit: null, + profile_ref: "urn:riverbraid:core:mechanical-profile:v0.1", + evaluator_ref: "Riverbraid-Core/mechanical-verify.mjs", + checks: [], + result: "INVALID_ATTEMPT", + evidence_refs: [], + nonclaims: ["NO_TRUTH_OR_TRUST_JUDGMENT","NO_CERTIFICATION","NO_GENERAL_SUITABILITY"], + error: error.message + }, null, 2)); + process.exit(2); +} + +const required = Array.isArray(profile.required_current_files) ? profile.required_current_files : []; +const missing = required.filter((rel) => !fs.existsSync(path.join(ROOT, rel))); +checks.push(check("required-current-files", missing.length === 0, { missing })); + +const forbidden = Array.isArray(profile.forbidden_current_legacy_paths) ? profile.forbidden_current_legacy_paths : []; +const stillCurrent = forbidden.filter((rel) => fs.existsSync(path.join(ROOT, rel))); +checks.push(check("legacy-detached-from-current-root", stillCurrent.length === 0, { still_current: stillCurrent })); + +const historicalExpected = profile.historical_phase15_blobs || {}; +const historicalMismatches = []; +for (const [rel, expectedBlob] of Object.entries(historicalExpected)) { + const absolute = path.join(ROOT, rel); + if (!fs.existsSync(absolute)) { + historicalMismatches.push({ path: rel, reason: "MISSING" }); + continue; + } + try { + const actualBlob = gitBlob(rel); + if (actualBlob !== expectedBlob) { + historicalMismatches.push({ path: rel, reason: "BLOB_MISMATCH", expected: expectedBlob, actual: actualBlob }); + } + } catch (error) { + historicalMismatches.push({ path: rel, reason: "HASH_UNAVAILABLE", error: error.message }); + } +} +checks.push(check("historical-phase15-byte-identity", historicalMismatches.length === 0, { mismatches: historicalMismatches })); + +const requiredNonAuthorities = new Set([ + "TRUTH","TRUST","EVIDENTIARY_WEIGHT","INTERPRETATION","LEGITIMACY","MEANING", + "MORAL_PRIORITY","RISK_RANKING","READINESS","CERTIFICATION","ADOPTION_JUDGMENT" +]); +const declared = new Set(Array.isArray(profile.non_authorities) ? profile.non_authorities : []); +const missingNonAuthorities = [...requiredNonAuthorities].filter((x) => !declared.has(x)); +checks.push(check("non-authority-boundary", missingNonAuthorities.length === 0, { missing: missingNonAuthorities })); + +checks.push(check( + "unknown-extension-preservation-policy", + profile.unknown_extension_policy === "PRESERVE_OPAQUELY_NO_NETWORK_DEREFERENCE_FOR_STRUCTURAL_VALIDATION", + { observed: profile.unknown_extension_policy || null } +)); + +checks.push(check( + "relationship-meaning-outside-core", + profile.relationship_policy?.predicate_meaning === "OUTSIDE_CORE_IN_DECLARED_NAMESPACED_VOCABULARY_OR_PROFILE" && + profile.relationship_policy?.mapping_semantics === "ATTRIBUTED_SCOPED_ASSERTION_NOT_AUTOMATIC_EQUIVALENCE", + { observed: profile.relationship_policy || null } +)); + +let subjectCommit = null; +let subjectTree = null; +try { + subjectCommit = git(["rev-parse", "HEAD"]); + subjectTree = git(["rev-parse", "HEAD^{tree}"]); +} catch {} + +const profileBytes = fs.readFileSync(PROFILE_PATH); +const result = checks.every((c) => c.result === "PASS") ? "PASS" : "FAIL"; +const output = { + result_id: `urn:riverbraid:result:core-mechanical-boundary:${subjectCommit || "unknown"}`, + subject_ref: "https://github.com/Riverbraid/Riverbraid-Core", + subject_commit: subjectCommit, + subject_tree: subjectTree, + profile_ref: profile.profile_id, + profile_definition_sha256: sha256(profileBytes), + evaluator_ref: "Riverbraid-Core/mechanical-verify.mjs", + checks, + result, + evidence_refs: [ + "mechanical-profile.json", + "PROTOCOL-BOUNDARY.md", + "historical/phase15/" + ], + nonclaims: [ + "NO_TRUTH_OR_TRUST_JUDGMENT", + "NO_EVIDENTIARY_WEIGHT_JUDGMENT", + "NO_CERTIFICATION", + "NO_GENERAL_SUITABILITY", + "NO_EXTERNAL_AUDIT_CLAIM", + "NO_DOWNSTREAM_AI_BEHAVIOR_CLAIM" + ] +}; +console.log(JSON.stringify(output, null, 2)); +process.exit(result === "PASS" ? 0 : 1); diff --git a/package.json b/package.json index d84a8d5..ddf58c2 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { - "name": "riverbraid-core", - "version": "1.0.0", - "scripts": { - "test": "jest", - "test:riverbraid": "node verify-vector.cjs", - "audit:ring2": "node byte-audit.mjs --ring 2", - "audit:all": "node byte-audit.mjs" - }, "devDependencies": { "jest": "^29.0.0" }, + "name": "riverbraid-core", "riverbraid": { - "role": "spine" - } + "authority": "mechanical-grammar-only", + "role": "mechanical-protocol" + }, + "scripts": { + "test": "node mechanical-verify.mjs", + "verify:mechanical": "node mechanical-verify.mjs" + }, + "version": "1.0.0" }