npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ku0/conformance-kit

v0.9.0

Published

LFCC v0.9 RC QA Conformance Kit - Fuzz + Semantic Double-Blind

Readme

LFCC Conformance Kit

QA Conformance Kit for verifying LFCC v0.9 RC determinism and "no drift" invariants.

Overview

This kit continuously verifies that:

  • Loro replicated state and LFCC Shadow Model produce identical canonical trees
  • Operations are deterministic: same seed → same ops → same outcomes
  • Failures are reproducible with actionable artifacts

Quick Start

# Run conformance tests (50 seeds × 200 steps)
pnpm conformance:run --seeds 50 --steps 200

# Run with verbose output
pnpm conformance:run --seeds 10 --steps 100 --verbose

# Replay a failed run
pnpm conformance:replay artifacts/<runId>/ops.shrunk.json

# Run package tests (vitest)
pnpm -C packages/conformance-kit test

# Run tests single-threaded (CI/low resource)
pnpm -C packages/conformance-kit test -- --maxThreads=1

Architecture

conformance-kit/
├── adapters/        # Pluggable interfaces for Loro, Shadow, Canonicalizer
├── op-fuzzer/       # Operation generator + shrinker
├── double-blind/    # Harness comparing Loro vs Shadow
├── artifacts/       # Failure serialization + diff reporting
├── runner/          # Test orchestration
└── cli/             # Command-line tools

Adapter Interfaces

The kit uses pluggable adapters to support both real implementations and mocks:

import type { LoroAdapter, ShadowAdapter, CanonicalizerAdapter } from '@ku0/conformance-kit';

// Implement these interfaces for your real Loro/Shadow bridge
interface LoroAdapter {
  loadSnapshot(bytes: Uint8Array): void;
  exportSnapshot(): Uint8Array;
  applyOp(op: FuzzOp): ApplyResult;
  getFrontierTag(): string;
  getBlockIds(): string[];
  getBlock(blockId: string): BlockInfo | null;
  getTextLength(blockId: string): number;
}

FuzzOp Types

Operations aligned with LFCC op taxonomy:

type FuzzOp =
  | InsertText      // Insert text at offset
  | DeleteText      // Delete text range
  | AddMark         // Add mark to range
  | RemoveMark      // Remove mark from range
  | SplitBlock      // Split block (Enter key)
  | JoinWithPrev    // Join with previous (Backspace)
  | ReorderBlock    // Move block to new position
  | WrapInList      // Wrap blocks in list
  | UnwrapListItem  // Unwrap list item
  | TableInsertRow  // Insert table row
  | TableInsertColumn
  | TableDeleteRow
  | TableDeleteColumn
  | Paste           // Paste canonical fragment
  | Undo
  | Redo;

Generator

Seeded generator for valid random operation programs:

import { generateProgram, DEFAULT_GEN_CONFIG } from '@ku0/conformance-kit';

// Generate deterministic program
const ops = generateProgram(seed, steps, config, adapter);

// Same seed always produces same ops
const ops1 = generateProgram(42, 100, config, adapter1);
const ops2 = generateProgram(42, 100, config, adapter2);
// ops1 === ops2 ✓

Stress Modes

const config = {
  ...DEFAULT_GEN_CONFIG,
  stressMode: 'typingBurst',    // Many small text inserts
  // or: 'structureStorm'       // Many splits/reorders/table ops
  // or: 'markChaos'            // Overlapping marks
  // or: 'balanced'             // Default mix
};

Shrinker

Minimizes failing programs to minimal repro:

import { shrinkProgram } from '@ku0/conformance-kit';

const result = await shrinkProgram(failingOps, predicateFails);
// result.shrunkOps is minimal sequence that still fails

Double-Blind Harness

Runs same program against Loro and Shadow, compares canonical output:

import { DoubleBlindHarness } from '@ku0/conformance-kit';

const harness = new DoubleBlindHarness(loro, shadow, canonicalizer, {
  checkpointPolicy: 'everyN',
  checkpointInterval: 10,
});

const result = await harness.run(seed, ops);
if (!result.passed) {
  console.log('Mismatch at step:', result.firstMismatch.stepIndex);
}

Checkpoint Policies

  • everyStep - Compare after every operation (slowest, most thorough)
  • everyN - Compare every N steps (default for CI)
  • structureOnly - Compare only after structural ops

Artifacts

On failure, the kit saves actionable artifacts:

artifacts/<runId>/
├── seed.json              # Seed and timestamp
├── config.json            # Generator configuration
├── initial_snapshot.loro.bin
├── ops.original.json      # Full operation sequence
├── ops.shrunk.json        # Minimized failing sequence
├── fail_step.txt          # Failure details
├── canon.loro.json        # Loro canonical tree
├── canon.shadow.json      # Shadow canonical tree
├── canon.diff.txt         # Readable diff
├── frontiers.log.jsonl    # Frontier log
└── notes.md               # Human-readable report

CI Integration

Fast Gate (PR blocking)

pnpm conformance:run --ci-fast
# 50 seeds × 200 steps, checkpoint every 10 ops
# Target: < 5 minutes

Nightly Stress (non-blocking)

pnpm conformance:run --ci-nightly
# 500 seeds × 2000 steps, checkpoint every op
# Includes large paste cases and structure storm

GitHub Actions Example

jobs:
  conformance-fast:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v2
      - run: pnpm install
      - run: pnpm conformance:run --ci-fast
      - uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: conformance-artifacts
          path: artifacts/

  conformance-nightly:
    runs-on: ubuntu-latest
    if: github.event_name == 'schedule'
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v2
      - run: pnpm install
      - run: pnpm conformance:run --ci-nightly --artifacts ./nightly-artifacts
      - uses: actions/upload-artifact@v4
        with:
          name: nightly-artifacts
          path: nightly-artifacts/

CLI Reference

pnpm conformance:run [options]

Options:
  --seeds <n>              Number of seeds (default: 50)
  --steps <n>              Steps per seed (default: 200)
  --start-seed <n>         Starting seed (default: 1)
  --checkpoint-every <n>   Checkpoint interval (default: 10)
  --checkpoint-all         Checkpoint every step
  --checkpoint-structure   Checkpoint only after structural ops
  --stress                 Enable structure storm mode
  --stress-mode <mode>     typingBurst | structureStorm | markChaos | balanced
  --artifacts <dir>        Output directory (default: ./artifacts)
  --stop-on-failure        Stop on first failure
  --max-failures <n>       Max failures to collect (default: 10)
  --verbose, -v            Verbose output
  --no-shrink              Disable program shrinking
  --ci-fast                CI fast gate config
  --ci-nightly             CI nightly stress config

Extending

Custom Adapters

import { AdapterFactory, LoroAdapter } from '@ku0/conformance-kit';

class MyLoroAdapter implements LoroAdapter {
  // Implement interface methods
}

class MyAdapterFactory implements AdapterFactory {
  createLoroAdapter() { return new MyLoroAdapter(); }
  createShadowAdapter() { return new MyShadowAdapter(); }
  createCanonicalizerAdapter() { return new MyCanonicalizerAdapter(); }
}

// Use with runner
const runner = new ConformanceRunner(new MyAdapterFactory(), config);

Custom Operations

Extend FuzzOp type and update generator for domain-specific operations.

Design Principles

  1. Semantic equality - Compare canonical trees, not HTML
  2. Deterministic - Same seed → same ops → same outcomes
  3. Actionable failures - Seed + snapshot + minimal op sequence + diff
  4. Pluggable - Works with mocks or real implementations
  5. CI-ready - Fast gate + nightly stress configurations

License

MIT