Skip to content

Instantly share code, notes, and snippets.

View copyleftdev's full-sized avatar

Don Johnson copyleftdev

View GitHub Profile
@copyleftdev
copyleftdev / oddly-exact-optimizer-mutation-gate.md
Created July 25, 2026 06:08
Oddly Exact optimizer guard mutation gate: 11 of 11 mutations caught

Oddly Exact: repaired optimizer mutation gate

The contract audit found that optimizer iteration counts and grid resolution had no published upper ceilings. The repair added and enforced these limits:

  • maximum iterations: 100000
  • maximum grid resolution: 1000000

The focused mutation pass selected every mutation generated for validate_max_iters and validate_grid_resolution, including replacements

@copyleftdev
copyleftdev / oddly-exact-contract-challenge.sh
Created July 25, 2026 06:08
Oddly Exact replay: reject unknown fields and refuse unbounded optimizer work
#!/usr/bin/env bash
set -euo pipefail
# Replay the three requests that exposed contract and resource-boundary gaps in
# Oddly Exact. Run from the agent-calc repository:
#
# cargo build --locked
# bash oddly-exact-contract-challenge.sh
calc_bin="${1:-target/debug/agent-calc}"
@copyleftdev
copyleftdev / oddly-exact-nist-mutation-record.md
Created July 25, 2026 06:08
Oddly Exact NIST mutation record: 389 tests passed, Longley caught the formula defect

Oddly Exact: NIST mutation record

This record supports the article “389 Tests Passed. NIST Still Caught the Bug.”

  • Pre-repair baseline: 8e87c2fbee580efb7d38690634a0ee60d0d77dff
  • Rust package: agent-calc 0.1.0
  • Contract: calc1/0.1.0
  • Mutation runner: cargo-mutants 27.0.0
  • External reference: NIST Statistical Reference Datasets, Longley linear
@copyleftdev
copyleftdev / Dockerfile
Created May 26, 2026 19:58
micro-containers: WASM/WASI Dockerfile — scratch base + wasip1 binary
# WASM image — compiled to WASI preview1 target (Go 1.21+).
# The resulting container holds a single .wasm binary on a scratch base.
# Run via Docker+Wasm (experimental) or directly with wasmtime/wasmedge.
# Build (from repo root): docker build -f runtimes/wasm/Dockerfile -t micro-containers-wasm .
FROM golang:1.24 AS builder
WORKDIR /src
COPY go.mod ./
RUN go mod download
COPY cmd/wasm/ ./cmd/wasm/
@copyleftdev
copyleftdev / Dockerfile
Created May 26, 2026 19:58
micro-containers: distroless OCI Dockerfile — same image for runc, gVisor, Kata, Firecracker
# OCI image — works with runc, gVisor (runsc), Kata (QEMU), and Kata (Firecracker).
# The runtime is injected via RUNTIME_NAME at `docker run` time.
# Build: docker build -t micro-containers .
FROM golang:1.24-alpine AS builder
WORKDIR /src
COPY go.mod ./
RUN go mod download
COPY cmd/server/ ./cmd/server/
RUN CGO_ENABLED=0 GOOS=linux go build \
@copyleftdev
copyleftdev / main.go
Created May 26, 2026 19:58
micro-containers: WASI preview1 variant — JSON to stdout (no net/http in wasip1)
// WASI preview1 target — compiled with GOOS=wasip1 GOARCH=wasm.
// net/http is not available in wasip1; this demonstrates env access,
// stdout, and runtime introspection inside a WASM container.
// The wasi-http proposal (https://github.com/WebAssembly/wasi-http)
// will bring full HTTP support to WASI in a future Go release.
package main
import (
"encoding/json"
"fmt"
@copyleftdev
copyleftdev / main.go
Created May 26, 2026 19:58
micro-containers: Go HTTP server — runtime metadata at GET /health
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"runtime"
"time"
)
@copyleftdev
copyleftdev / linux-archaeology.md
Created May 25, 2026 20:44
linux-archaeology Claude Code skill — reasoning chains for pipe & stream primitives

linux-archaeology

Reason through shell pipeline problems and surface the right forgotten Linux command. Each section maps a real situation to a specific tool with concrete invocations.

TRIGGER

Invoke this skill when the user:

  • Wants to monitor a running process, file, or resource without modifying the process
  • Needs to send output to both the screen and a file at the same time
@copyleftdev
copyleftdev / linux-parallel.sh
Created May 25, 2026 20:44
parallel — run many independent tasks concurrently with job control
# parallel — GNU parallel: xargs -P with sane defaults
# sudo apt install parallel
# Basic concurrent execution:
cat tasks.txt | parallel <command> {}
ls *.sh | parallel bash {}
# Control concurrency:
cat tasks.txt | parallel -j4 <command> {} # max 4 jobs
cat tasks.txt | parallel -j0 <command> {} # one per CPU core
@copyleftdev
copyleftdev / linux-vidir.sh
Created May 25, 2026 20:44
vidir — rename or delete a batch of files in your text editor
# vidir — edit a directory listing in $EDITOR (from moreutils)
# sudo apt install moreutils
vidir directory/ # open all files in editor
ls *.sh | vidir - # open a specific subset
# In your editor:
# - Edit a path → renames the file
# - Delete a line → deletes the file
# - Change directory prefix → moves the file