Skip to content

Instantly share code, notes, and snippets.

View copyleftdev's full-sized avatar
🎯
Focusing

Don Johnson copyleftdev

🎯
Focusing
View GitHub Profile
@copyleftdev
copyleftdev / store.py
Created October 10, 2026 05:12
Evidence-Driven Development: Tiny Tasks SQLite implementation. Source: https://github.com/copyleftdev/evidence-driven-development
"""Task creation with durable, payload-bound request IDs."""
from contextlib import closing
from pathlib import Path
import re
import sqlite3
class Conflict(ValueError):
pass
@copyleftdev
copyleftdev / experiment.json
Created October 10, 2026 05:12
Evidence-Driven Development: Tiny Tasks experiment contract. Source: https://github.com/copyleftdev/evidence-driven-development
{
"version": 1,
"recorded_before_implementation_utc": "2026-10-10T04:20:05.620665+00:00",
"question": "Can a tiny local task list preserve acknowledged tasks and make repeated create requests safe across fresh processes?",
"hypothesis": "The SQLite implementation passes every declared claim with nonzero exercise counts. Deliberately volatile and duplicate-accepting implementations are rejected for the defects they contain.",
"claims": {
"restart": "An acknowledged task is visible unchanged to a fresh process.",
"retry": "An identical request ID and title return the same task, including after an ignored successful response and across eight concurrent processes.",
"conflict": "Reusing a request ID with a different title fails without changing the saved task.",
"validation": "An empty title fails without adding a task."
@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