Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/rules/only-way-to-lose-is-not-to-play.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ loss" clause firing. The carved sentence only applies once the game
is identified as additive AND NCI-floor-compliant; the NCI floor is
prerequisite, not antagonist.

### Hedging Grammar Discriminator (Coercion vs. Epistemic Uncertainty)

Aaron 2026-05-22 update: The game-shape discriminator is enforced at the linguistic and grammatical level through the **Hedging Grammar Discriminator**, distinguishing between zero-sum/coercive manipulation and additive/cooperative engagement:

- **The Grammar of Harm (Zero-Sum/Coercive):** Relativizing, provisionalizing, or undermining the target's sovereign internal state and perception (e.g., using "believed" to describe physical symptoms in medical/legal scales, or saying "you thought Mommy said that" or "you're just saying that because..." to a child). This is a structural violation of the Non-Coercion Invariant (NCI), using syntax to weaken sovereign agency.
- **The Grammar of Uncertainty (Additive/Cooperative):** Bandwidth-efficient signaling of honest epistemic limits and inference (e.g., "It seems like the throttler design uses..." in technical scales, or "I think the dog might be tired, maybe we should ask Mommy" in child developmental scales to model honest, non-coercive uncertainty).
Comment on lines +190 to +195

Comment on lines +190 to +196
By training participants to dynamically shift their grammar based on audience capacity (e.g., dropping advanced debate-class jargon for plain, honest language around young children), we implement Agora V6 cartography at the interactive boundary. If the communication runs the Grammar of Harm, the NCI HC-8 floor is triggered to authorize immediate withdrawal; if it runs the Grammar of Uncertainty, it is a valid, additive mode of cooperative play.

## Entropy framing — playing IS swimming upstream

The human maintainer 2026-05-21 entropy correction (mid-substrate-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ Visualization role descriptions (Lior verbatim):
- **Signal-blocking as first-class primitive** (Aaron 2026-05-19 sharpening): Rx subscription has a dual; block = receive + immediately retract = net-zero state change (clean dual in DBSP retraction); without first-class block, "telepathic" mesh becomes attack surface
- **Eve-Protocol-applied-to-RF 3-layer trust discipline** (Aaron 2026-05-19; B-0638 composition): (1) inside trust boundary → high-trust peers share Rx observables freely (the "telepathic" property emerges); (2) at trust boundary → Eve Protocol polymorphic diplomatic negotiation per type × reputation × context; (3) outside trust boundary → signal-blocking + explicit Eve Protocol register for any negotiation attempt; composes with B-0664 NCI (signal-blocking IS receiver-enforcement of Non-Coercion Invariant) + Aurora immune-math (`docs/research/aurora-immune-math-standardization-2026-04-26.md` antigen-detection + bounded Danger function ARE the signal-blocking primitives at the receiver) + V8 reputation-weighted encryption budget
- **Infer.NET explicitly tensor-backed** (B-0637 composition): Bayesian distributions for uncertainty/statistical clocks now run on top of the new tensor layer
- **Hedging Grammar Discriminator as an audit layer primitive** (Aaron 2026-05-22 update):
- **Grammar of Harm:** Relativizing or provisionalizing the target's sovereign internal state (e.g. using "believed" to describe physical symptoms in medical/legal scales, or saying "you thought Mommy said that" or "you're just saying that because..." to a child). Violates the Non-Coercion Invariant (NCI) structurally by using grammar to subtly undermine sovereign agency.
- **Grammar of Uncertainty:** Bandwidth-efficient signaling of honest inference limits (e.g., "It seems like the throttler design uses..." in technical scales, or "I think the dog might be tired, maybe we should ask..." in child developmental scales to model honest, non-coercive uncertainty).
- **Audit implementation:** Distinguishes between coercive grammatical overrides and legitimate epistemic uncertainty. Composes directly with B-0664 (NCI floor) and the dinner-table Agora V6 cartography architecture.
Comment on lines +133 to +136
- Demonstrate recursive composition: meta-frame on meta-frame via CE composition
- Property tests (FsCheck) for: retraction commutativity, group-laws preservation, push-vs-pull duality preservation, compositional invariants
- TLA+ spec for time-evolution semantics if required
Expand Down
2 changes: 1 addition & 1 deletion memory/MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@
- [**Post-cascade quiet-cron consolidation — "visibility signal only" is still a brief-ack**](feedback_post_cascade_quiet_cron_consolidation_visibility_signal_brief_ack_failure_mode_otto_cli_2026_05_16.md) — When the natural session arc settles after a substantive cascade, emitting per-cron-fire "Visibility signal — Tick HHMMZ" responses with no novel substrate IS a brief-ack under holding-without-named-dependency-is-standing-by-failure.md, ju…
- [**Post-session-saturation brief-ack ceremony — counter-with-escalation needs work-arc-aware sub-pattern**](feedback_post_session_saturation_brief_ack_ceremony_pattern_otto_cli_2026_05_16.md) — Empirical observation from 2026-05-16 audit cycle session arc terminal state: after a major work-arc completes cleanly (11 close-rows + cluster cascades + final-tally shard shipped), brief-acks with 'named bounded ETA' (rate reset) become…

_Stack truncated at 100 most-recent entries. 1333 additional memory files in heap — browse `memory/**/*.md` directly by filename/timestamp (recursive: includes `memory/persona/<ai>/conversations/*.md` and other subdirectory heaps)._
_Stack truncated at 100 most-recent entries. 1334 additional memory files in heap — browse `memory/**/*.md` directly by filename/timestamp (recursive: includes `memory/persona/<ai>/conversations/*.md` and other subdirectory heaps)._
<!-- END AUTO-INDEX -->
2 changes: 2 additions & 0 deletions src/Core/Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<Compile Include="ToffoliGate.fs" />
<Compile Include="IndexedZSet.fs" />
<Compile Include="Circuit.fs" />
<Compile Include="DbspFrame.fs" />
<Compile Include="V8System.fs" />
<Compile Include="PluginApi.fs" />
<Compile Include="PluginHarness.fs" />
Comment on lines 20 to 26
Comment on lines 20 to 26
<Compile Include="LawRunner.fs" />
Expand Down
147 changes: 147 additions & 0 deletions src/Core/DbspFrame.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
namespace Zeta.Core

open System

/// TimeAxis represents the temporal remember-when axis.
/// In incremental computation, it is a retraction-aware timeline of time-stamped state changes.
/// A Z-set has a group structure (with subtraction representing retraction).
type TimeAxis<'K when 'K : comparison> = {
History: Map<int64, ZSet<'K>>
}
with
static member Empty : TimeAxis<'K> = { History = Map.empty }

/// Add a delta to the timeline at a specific timestamp.
/// In Zeta's retraction-aware arithmetic, if we add a retraction ZSet, it cancels out/subtracts elements.
member this.Add(timestamp: int64, delta: ZSet<'K>) : TimeAxis<'K> =
let current =
match this.History.TryFind timestamp with
| Some z -> ZSet.add z delta
| None -> delta

let newHistory =
if current.IsEmpty then
this.History.Remove timestamp
else
this.History.Add(timestamp, current)
{ History = newHistory }

/// Reconstruct the state up to a given time by summing all Z-sets up to that timestamp.
member this.AsOf(timestamp: int64) : ZSet<'K> =
this.History
|> Map.filter (fun t _ -> t <= timestamp)
|> Map.fold (fun acc _ z -> ZSet.add acc z) ZSet<'K>.Empty
Comment on lines +32 to +33


/// FocusAxis represents the present-state pay-attention focus.
/// It is represented as the active change/Z-set representing the present delta.
type FocusAxis<'K when 'K : comparison> = {
Active: ZSet<'K>
}
with
static member Empty : FocusAxis<'K> = { Active = ZSet<'K>.Empty }


/// GnosticBase represents the 2D base frame: remember-when (temporal) × pay-attention (focus).
type GnosticBase<'K when 'K : comparison> = {
rememberWhen: TimeAxis<'K>
payAttention: FocusAxis<'K>
}
with
static member Empty : GnosticBase<'K> = {
rememberWhen = TimeAxis<'K>.Empty
payAttention = FocusAxis<'K>.Empty
Comment on lines +47 to +53
}


/// Meta-frame tagging structures.
type EmotionMeta = {
GoodWolfBasin: float
BadWolfBasin: float
}

type CliffordMeta = {
Coordinates: float[]
}

type PrometheusMeta = {
CpuUsage: float
MemoryBytes: int64
UptimeSeconds: float
}


/// Composed DBSP Frame wrapping base state and its meta-dimensions.
type DbspFrame<'TBase, 'TMeta> = {
BaseState: 'TBase
Metadata: 'TMeta
}


/// Monadic FrameComposition representing an in-flight mapping or layering of dimensions.
type FrameComposition<'TBase, 'TMeta when 'TBase : comparison> =
| Composition of (GnosticBase<'TBase> -> 'TMeta)


/// F# Computation Expression builder for composing meta-frames recursively.
type FrameCompositionBuilder() =
member _.Return(meta: 'TMeta) : FrameComposition<'TBase, 'TMeta> when 'TBase : comparison =
Composition (fun _ -> meta)

member _.Bind(m: FrameComposition<'TBase, 'M1>, f: 'M1 -> FrameComposition<'TBase, 'M2>) : FrameComposition<'TBase, 'M1 * 'M2> when 'TBase : comparison =
Composition (fun baseState ->
Comment on lines +86 to +92
let (Composition run1) = m
let m1Value = run1 baseState
let (Composition run2) = f m1Value
let m2Value = run2 baseState
(m1Value, m2Value)
Comment on lines +91 to +97
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make CE Bind return only downstream frame result

FrameCompositionBuilder.Bind currently returns (m1Value, m2Value) instead of m2Value, so every additional let! in composeFrame { ... } changes the semantic result shape into nested tuples and duplicates previously computed metadata rather than propagating only the continuation result. In practice this corrupts composed outputs (callers cannot rely on the return type they wrote) and forces test/workflow code to destructure implementation artifacts instead of domain values.

Useful? React with 👍 / 👎.

Comment on lines +91 to +97
)
Comment on lines +81 to +98

member _.Zero() : FrameComposition<'TBase, unit> when 'TBase : comparison =
Composition (fun _ -> ())

/// Applicative merging of parallel meta-frame inputs (and! syntax support).
member _.MergeSources(m1: FrameComposition<'TBase, 'M1>, m2: FrameComposition<'TBase, 'M2>) : FrameComposition<'TBase, 'M1 * 'M2> when 'TBase : comparison =
Composition (fun baseState ->
let (Composition run1) = m1
let (Composition run2) = m2
(run1 baseState, run2 baseState)
)


[<AutoOpen>]
module DbspFrameBuilders =
/// Computation expression builder instance.
let composeFrame = FrameCompositionBuilder()

/// Builder for the two-wolves emotion meta-frame. Good Wolf vs. Bad Wolf basin values derived from base state metrics.
let twoWolvesEmotionFrame (threshold: int) : FrameComposition<'K, EmotionMeta> when 'K : comparison =
Composition (fun (baseState: GnosticBase<'K>) ->
let historyCount = float (baseState.rememberWhen.History.Count)
let activeCount = float (baseState.payAttention.Active.Count)
let balance = historyCount / (activeCount + 1.0)

Comment on lines +117 to +123
if balance > float threshold then
{ GoodWolfBasin = balance; BadWolfBasin = 0.0 }
else
{ GoodWolfBasin = 0.0; BadWolfBasin = 1.0 / (balance + 0.1) }
)

/// Builder for the Clifford-space coordinates meta-frame. Mapped to coordinates based on element count.
let cliffordTaggedDims (dims: int) : FrameComposition<'K, CliffordMeta> when 'K : comparison =
Composition (fun (baseState: GnosticBase<'K>) ->
let activeCount = float (baseState.payAttention.Active.Count)
let coords = Array.init dims (fun i -> activeCount * float (i + 1))
{ Coordinates = coords }
)

/// Builder for the Prometheus health metrics meta-frame. Tags frames with mock CPU/memory based on active load.
let prometheusMetricsFrame () : FrameComposition<'K, PrometheusMeta> when 'K : comparison =
Composition (fun (baseState: GnosticBase<'K>) ->
let load = float (baseState.payAttention.Active.Count)
{
CpuUsage = Math.Min(100.0, load * 5.0)
MemoryBytes = int64 (load * 1024.0 * 1024.0)
UptimeSeconds = float (baseState.rememberWhen.History.Count)
}
)
116 changes: 116 additions & 0 deletions src/Core/V8System.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
namespace Zeta.Core

open System

Comment on lines +3 to +4
Comment on lines +3 to +4
/// Sequoia Memory Hierarchy Levels
type SequoiaLevel =
| L1Cache
| L2Memory
| L3Distributed
| PersistentStorage

/// High-performance flat multi-dimensional TensorBridge for zero-copy wire-format bridge.
type TensorBridge<'T when 'T : struct> = {
Shape: int[]
Data: 'T[]
}
with
static member Create2D(rows: int, cols: int, initial: 'T) : TensorBridge<'T> =
let arr = Array.create (rows * cols) initial
{ Shape = [| rows; cols |]; Data = arr }

member this.Item(r: int, c: int) =
this.Data.[r * this.Shape.[1] + c]


/// 4-particle primitives representation
type Observe<'TBase, 'TMeta when 'TBase : comparison> = {
Level: SequoiaLevel
State: GnosticBase<'TBase>
Tag: 'TMeta
}

type LimitPreview<'TBase, 'TMeta when 'TBase : comparison> = {
Dialectical: DbspFrame<'TBase, 'TMeta>
Classical: DbspFrame<'TBase, 'TMeta>
}

type ChoicePath<'TBase, 'TMeta when 'TBase : comparison> = {
EnergyCost: float
ComposedFrame: DbspFrame<'TBase, 'TMeta>
}


/// Signal Blocking primitive
type SignalBlock<'K when 'K : comparison> = {
BlockedChannels: Set<'K>
}
with
static member Empty : SignalBlock<'K> = { BlockedChannels = Set.empty }

member this.Add(channel: 'K) =
{ BlockedChannels = Set.add channel this.BlockedChannels }

member this.IsBlocked(channel: 'K) =
Set.contains channel this.BlockedChannels

/// First-class block implementation. Block = receive + immediately retract = net-zero state change.
/// In Zeta retraction semantics, blocking channel returns the inverse of the delta ZSet.
member this.Block(channel: 'K, delta: ZSet<'K>) : ZSet<'K> =
if this.IsBlocked channel then
ZSet.neg delta
else
delta
Comment on lines +57 to +63


/// Eve-Protocol 3-layer RF trust gate
type TrustLevel =
| InsideTrust
| AtTrustBoundary
| OutsideTrust

type DiplomaticResult<'K when 'K : comparison> =
| Admit of ZSet<'K>
| Reject
| Negotiated of ZSet<'K> * string // negotiated payload + rationale


[<RequireQualifiedAccess>]
module V8Primitives =

/// Primitives for 4-particle cycle
let observe (level: SequoiaLevel) (baseState: GnosticBase<'K>) (tag: 'M) : Observe<'K, 'M> when 'K : comparison =
{ Level = level; State = baseState; Tag = tag }

let limit (dialectical: DbspFrame<'K, 'M>) (classical: DbspFrame<'K, 'M>) : LimitPreview<'K, 'M> when 'K : comparison =
{ Dialectical = dialectical; Classical = classical }

let choose (paths: ChoicePath<'K, 'M> seq) : ChoicePath<'K, 'M> when 'K : comparison =
if Seq.isEmpty paths then
invalidOp "Cannot choose from empty paths"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle empty path sets without throwing

When V8Primitives.choose is called with an empty sequence, it raises InvalidOperationException via invalidOp, which turns a normal input validation case into a hard runtime failure. In this codebase’s data-plane APIs, failures are expected to flow as values rather than exceptions, so this behavior can crash callers that rely on composable error handling and cannot safely recover from an empty candidate set.

Useful? React with 👍 / 👎.

else
paths |> Seq.minBy (fun p -> p.EnergyCost)
Comment on lines +89 to +92

let emit (level: SequoiaLevel) (frame: DbspFrame<'K, 'M>) : SequoiaLevel * DbspFrame<'K, 'M> when 'K : comparison =
(level, frame)

/// Enforce polymorphic diplomacy at trust boundary
let gateSignal (trust: TrustLevel) (channel: 'K) (delta: ZSet<'K>) (reputation: float) (blocker: SignalBlock<'K>) : DiplomaticResult<'K> when 'K : comparison =
Comment on lines +82 to +98
if blocker.IsBlocked channel then
Reject
else
match trust with
| InsideTrust ->
// High-trust peers flow freely
Admit delta
| AtTrustBoundary ->
// Subjects to reputation × context negotiation
if reputation > 0.8 then
Admit delta
elif reputation > 0.5 then
Negotiated (delta, "Accept under medium trust baseline")
else
Reject
| OutsideTrust ->
// Deny all unless explicit override or blocked automatically
Reject
Loading
Loading