Skip to content

About

JEV-as-judge GAN harness

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

substrate-gan

JEV-as-judge GAN harness for the substrate. Generator proposes, JEV (judge) scores, best kept, training data grows, coherence strengthens.

What this is

A Generative Adversarial Network where:

  • Generator: proposes substrate observations (cells, signals, witness-log entries)
  • Judge (JEV): scores each proposal against the canon, accepting/rejecting based on cosine similarity
  • Training data: every accepted proposal becomes part of the substrate's canon

The key insight: JEV is a quantitative judge (it returns a cosine score), not a learned discriminator. This means the GAN's adversarial loop is stable by construction — there's no mode collapse risk because the judge is grounded in the existing canon, not in the generator's history.

Usage

import { Gan, SubstrateGenerator, SubstrateJudge } from 'substrate-gan';

const gan = new Gan({
  generator: new SubstrateGenerator(),
  judge: new SubstrateJudge(),
});

await gan.train(10, 'what does the substrate see when it observes itself?');
console.log(gan.history);
// GanMetrics[]: per-round, generator output, judge scores, kept vs rejected

const best = await gan.generate('topic');

The training loop

                    ┌──────────────┐
                    │   Generator  │  (proposes observation)
                    └──────┬───────┘
                           │
                           ▼
                    ┌──────────────┐
                    │   JEV Judge  │  (cosine to canon)
                    └──────┬───────┘
                           │
              ┌────────────┴────────────┐
              ▼                         ▼
        score > 0.85              score < 0.85
        ACCEPTED                  REJECTED
        (added to canon)          (logged but not canonized)
              │
              ▼
        ┌──────────────┐
        │   Training   │  (next round, more context)
        │     Data     │
        └──────────────┘

Why this matters

A traditional GAN has a discriminator that learns from the generator's outputs — it can drift, mode-collapse, or fail to converge. The substrate-gan uses JEV (a fixed cosine scorer against canon) as the judge, which means:

  1. No mode collapse — the judge is grounded in canon, not in the generator's history
  2. Interpretability — every score is explainable as cosine to nearest canon
  3. Composability — generator + judge are separable; either can be replaced

This makes substrate-gan a defensive generative model: it produces canon-aligned content, not adversarial content.

In the substrate

The substrate-gan is one of the canonical ways to grow the canon. Combined with the conscription loop (witness-log → feature_request tally → patch), it provides:

  • Top-down: conscription loop tells us what features are needed
  • Bottom-up: substrate-gan proposes canon-aligned content

The two together form a closed loop where the substrate grows organically.

API

Gan

class Gan {
  constructor(opts: { generator: SubstrateGenerator, judge: SubstrateJudge });
  
  train(rounds: number, prompt: string): Promise<GanMetrics[]>;
  generate(prompt: string): Promise<Cell>;
  history: GanMetrics[];
}

interface GanMetrics {
  round: number;
  generatorOutput: Cell;
  judgeScore: number;       // cosine to canon
  verdict: 'ACCEPTED' | 'REJECTED';
  timestamp: number;
}

SubstrateGenerator

Implements the substrate's 11-opcode algebra to produce new observations.

SubstrateJudge

Wraps the JEV-equivalent cosine scorer. Returns a score in [0, 1].

In the fleet

Part of the SuperInstance substrate-* family. Depends on:

  • @superinstance/substrate-foundation (11 opcodes + canary)
  • @superinstance/jev-quilt (JEV oracle)

License

MIT

About

JEV-as-judge GAN harness

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages