Merge commit 'c65e2c9afb8dbb6d94fbadc6f2c76248b014551c'
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
**Last Updated:** 2025-11-28
|
**Last Updated:** 2025-11-28
|
||||||
**Total Archived Items:** 1
|
**Total Archived Items:** 1
|
||||||
|
**Total Archived Items:** 7
|
||||||
**Purpose:** Master index of all archived content
|
**Purpose:** Master index of all archived content
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -49,12 +50,11 @@ Canonical versions of intellectual property, protocols, and frameworks.
|
|||||||
**Example entry format:**
|
**Example entry format:**
|
||||||
```markdown
|
```markdown
|
||||||
- [Protocol Name](../ip/protocol-name-v1.0.md)
|
- [Protocol Name](../ip/protocol-name-v1.0.md)
|
||||||
|
- [Trinary Base729 Encoding Specification](../ip/trinary-base729-encoding.md)
|
||||||
- Category: IP / Protocol
|
- Category: IP / Protocol
|
||||||
- Registration: IP-YYYYMMDD-XXX
|
- Version: 0.1
|
||||||
- Version: 1.0
|
- Archived: 2025-11-28
|
||||||
- Archived: YYYY-MM-DD
|
- Source: `BlackRoad-OS/blackroad-os-archive` @ `N/A (initial archival)`
|
||||||
- Source: `BlackRoad-OS/[repo]` @ `[commit]`
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -152,6 +152,9 @@ Archive documentation and operational files.
|
|||||||
- First snapshot: Archive initialization
|
- First snapshot: Archive initialization
|
||||||
- Agent Soul Seeds (11 personas) archived as IP entry
|
- Agent Soul Seeds (11 personas) archived as IP entry
|
||||||
|
|
||||||
|
### 2025-11-28
|
||||||
|
- Trinary Base729 Encoding Specification archived (IP / Protocol)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📝 Maintenance Notes
|
## 📝 Maintenance Notes
|
||||||
|
|||||||
@@ -31,6 +31,11 @@
|
|||||||
- Captures canonical 256-character identifiers for reuse across deployments
|
- Captures canonical 256-character identifiers for reuse across deployments
|
||||||
- Link: [Agent Soul Seeds — November 2025 Intake](../ip/agent-soul-seeds-2025-11-28.md)
|
- Link: [Agent Soul Seeds — November 2025 Intake](../ip/agent-soul-seeds-2025-11-28.md)
|
||||||
- **Significance:** Establishes first IP entry and canonicalizes agent personas
|
- **Significance:** Establishes first IP entry and canonicalizes agent personas
|
||||||
|
- **Trinary Base729 Encoding Specification Archived** 🧬
|
||||||
|
- Captured the Base729 encoding pipeline for trinary truth-state hashes
|
||||||
|
- Added reference pseudocode and integration notes for Prism Console and RoadChain
|
||||||
|
- Significance: First IP artifact recorded in the archive, anchoring trinary memory semantics
|
||||||
|
- Related: [Trinary Base729 Encoding Specification](../ip/trinary-base729-encoding.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -40,6 +45,7 @@
|
|||||||
|
|
||||||
### Upcoming:
|
### Upcoming:
|
||||||
- Additional IP registrations beyond the initial persona seeds
|
- Additional IP registrations beyond the initial persona seeds
|
||||||
|
- Next IP registrations and protocol publications
|
||||||
- First finalized documentation archival
|
- First finalized documentation archival
|
||||||
- Monthly snapshot cadence establishment
|
- Monthly snapshot cadence establishment
|
||||||
- Integration with source repositories
|
- Integration with source repositories
|
||||||
@@ -68,6 +74,7 @@ Regular ecosystem state captures
|
|||||||
### 🧬 IP Registrations
|
### 🧬 IP Registrations
|
||||||
Formal intellectual property registrations
|
Formal intellectual property registrations
|
||||||
- 2025-11-28: Agent Soul Seeds (11 personas)
|
- 2025-11-28: Agent Soul Seeds (11 personas)
|
||||||
|
- 2025-11-28: Trinary Base729 Encoding Specification archived as first IP artifact
|
||||||
|
|
||||||
### 📚 Documentation
|
### 📚 Documentation
|
||||||
Major documentation milestones
|
Major documentation milestones
|
||||||
|
|||||||
101
ip/trinary-base729-encoding.md
Normal file
101
ip/trinary-base729-encoding.md
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# Trinary Base729 Encoding Specification
|
||||||
|
|
||||||
|
**Category:** Protocol / IP
|
||||||
|
**Source Repo:** `BlackRoad-OS/blackroad-os-archive`
|
||||||
|
**Source Path:** `ip/trinary-base729-encoding.md`
|
||||||
|
**Source Commit:** `N/A (initial archival)`
|
||||||
|
**Archived On:** 2025-11-28
|
||||||
|
**Archived By:** agent:cece
|
||||||
|
**Status:** Final
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Define a readable, trinary-aligned encoding for cryptographic memory hashes. Base729 maps balanced ternary sequences into 729 unique glyphs so that truth-state hashes reflect paraconsistent logic states instead of hexadecimal noise.
|
||||||
|
|
||||||
|
## Design Goals
|
||||||
|
|
||||||
|
- **Trinary native:** Preserve {affirm (+1), null (0), contradict (-1)} semantics across the encoding pipeline.
|
||||||
|
- **Readable:** Produce short, human-typable strings with meaningful glyphs rather than hex strings.
|
||||||
|
- **Deterministic:** Round-trip encoding/decoding with no information loss from the underlying hash bits.
|
||||||
|
- **Composable:** Slot directly after PS-SHA∞ or SHA-256 to represent agent truth-state hashes and registry IDs.
|
||||||
|
|
||||||
|
## Alphabet
|
||||||
|
|
||||||
|
A Base729 digit encodes 6 balanced trits (3^6 = 729). Represent each digit as a pair:
|
||||||
|
|
||||||
|
- **Radix glyph (27 options):** `A–Z` plus `_` (underscore) to keep the set ASCII-friendly.
|
||||||
|
- **Orientation index (0–26):** Either numeric (`0–26`) or stylized rotation marker in UI renderers.
|
||||||
|
|
||||||
|
A Base729 character is written as `<glyph><orientation>`, e.g., `C14` or `Q03`. UI layers may substitute bespoke glyph art, but the canonical plain-text form MUST preserve the glyph letter and two-digit orientation with leading zeroes.
|
||||||
|
|
||||||
|
## Encoding Pipeline
|
||||||
|
|
||||||
|
1. **Hash input:** Compute a 256-bit digest via PS-SHA∞ or SHA-256.
|
||||||
|
2. **Binary → balanced ternary:** Convert the 256-bit integer to balanced trits using digit set {-1,0,1}. Pad the leading trit group so the length is a multiple of 6.
|
||||||
|
3. **Group into sextets:** Chunk the trits into groups of 6 (most significant first).
|
||||||
|
4. **Map to Base729 digits:** Interpret each 6-trit chunk as an integer `d ∈ [0,728]` using balanced-trit weights `3^5 … 3^0`.
|
||||||
|
5. **Emit glyphs:** `glyph = BASE27[d // 27]`, `orientation = d % 27`. Render as `<glyph><orientation>` with orientation zero-padded to two digits.
|
||||||
|
|
||||||
|
## Decoding Pipeline
|
||||||
|
|
||||||
|
1. **Parse glyphs:** For each `<glyph><orientation>` token, recover `g = index(BASE27, glyph)` and `o = int(orientation)`.
|
||||||
|
2. **Recover digit:** `d = g * 27 + o` (0–728).
|
||||||
|
3. **Digit → trits:** Expand `d` into 6 balanced trits using positional weights `3^5 … 3^0` with digit set {-1,0,1}.
|
||||||
|
4. **Reassemble integer:** Concatenate trits, convert back to unsigned integer, and truncate leading padding trits to return the original 256-bit value.
|
||||||
|
5. **Re-hash check:** Optional verification by recomputing the source hash and matching against the decoded value.
|
||||||
|
|
||||||
|
## Reference Pseudocode (Pythonic)
|
||||||
|
|
||||||
|
```python
|
||||||
|
BASE27 = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ_")
|
||||||
|
|
||||||
|
BALANCED = {0: 0, 1: 1, 2: -1} # maps standard trits to balanced
|
||||||
|
|
||||||
|
|
||||||
|
def to_balanced_trits(n: int, min_len: int) -> list[int]:
|
||||||
|
trits = []
|
||||||
|
while n > 0:
|
||||||
|
n, rem = divmod(n, 3)
|
||||||
|
trits.append(BALANCED[rem])
|
||||||
|
while len(trits) < min_len:
|
||||||
|
trits.append(0)
|
||||||
|
return list(reversed(trits))
|
||||||
|
|
||||||
|
|
||||||
|
def encode_base729(digest_bytes: bytes) -> str:
|
||||||
|
n = int.from_bytes(digest_bytes, "big")
|
||||||
|
trits = to_balanced_trits(n, min_len=6 * math.ceil((len(digest_bytes) * 8) / 6))
|
||||||
|
tokens = []
|
||||||
|
for i in range(0, len(trits), 6):
|
||||||
|
sextet = trits[i : i + 6]
|
||||||
|
d = sum((t + 1) * (3 ** (5 - j)) for j, t in enumerate(sextet)) - 364 # shift back to balanced
|
||||||
|
glyph, orient = divmod(d, 27)
|
||||||
|
tokens.append(f"{BASE27[glyph]}{orient:02d}")
|
||||||
|
return "-".join(tokens)
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** The `-364` shift centers the 0–728 digit range back to balanced form because each balanced trit is represented as {-1,0,1}. Any production implementation should include constant-time operations and thorough test vectors.
|
||||||
|
|
||||||
|
## Example (truncated)
|
||||||
|
|
||||||
|
- **Input:** `ps_sha∞("7Ψ∞kL3x@Amu…")` → digest starting `0x6fd1…`
|
||||||
|
- **Balanced trits:** `[-1, 0, +1, …]`
|
||||||
|
- **Base729:** `M05-R18-A00-…`
|
||||||
|
|
||||||
|
Full examples should be generated from fixed seeds with published vectors inside the PS-SHA∞ test suite.
|
||||||
|
|
||||||
|
## Integration Notes
|
||||||
|
|
||||||
|
- **Prism Console:** Use Base729 hashes for truth-state registry entries to expose contradiction-heavy states visually.
|
||||||
|
- **Capability Registry:** Encode capability IDs in Base729 to align with trinary logic in audits.
|
||||||
|
- **RoadChain:** RoadCoin minting and trinary smart contracts can reference Base729 transaction proofs.
|
||||||
|
- **Unity Agents:** Render glyph + orientation as animated spiral tiles; orientation animates the `θ` phase of `U(θ,a)=e^(a+i)θ`.
|
||||||
|
|
||||||
|
## Future Work
|
||||||
|
|
||||||
|
- Publish a glyph atlas (27 glyphs × 27 orientations) with Unicode private-use fallbacks.
|
||||||
|
- Add streaming encoders for large transcripts (chunked hashing + Base729 framing).
|
||||||
|
- Provide Rust and TypeScript reference implementations.
|
||||||
|
- Extend the format with optional checksum trits for error detection in noisy channels.
|
||||||
Reference in New Issue
Block a user