Layer 1 core: Wright-Fisher knowledge-transmission model with E1-E2
Scaffold plus the Layer 1 analytical core and the first two experiments. - knowledge/: truth, metrics, teachers (2.7.1 shared-switch construction), step, lineage, experiment, config, seeding (imported as `knowledge`). - Validation spine green: neutral decay (Pred 1), fixation (Pred 2), exact mutation-drift equilibrium (Pred 3), union coverage (Pred 5). 68 tests pass. - E1 reproduces tail-first collapse. E2 delivers the headline: a grounding phase boundary g* << 1, with stationary H tracking the exact H_eq closed form (g=0.005 -> 68% of truth diversity; g=0.05 -> 96%). - Reproducibility: uv venv from a hash-pinned uv.lock is the source of truth; every run writes results.parquet + resolved_config.yaml + manifest.json (lib versions, git commit, sha256). Figures and manifests tracked; the large regenerable parquet is gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
a6eb9b7512
33 changed files with 4356 additions and 0 deletions
22
Makefile
Normal file
22
Makefile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Layer 1 automation. The uv venv (built from the committed uv.lock) is the
|
||||
# reproducibility source of truth; every target runs inside it via `uv run`.
|
||||
|
||||
.PHONY: env test layer1 figures clean
|
||||
|
||||
env: ## build .venv from the committed lockfile
|
||||
uv sync --extra dev
|
||||
|
||||
test: ## correctness tests + scientific-validation tests (the spine of trust)
|
||||
uv run pytest
|
||||
|
||||
layer1: ## run experiments (E1-E2 done; E3-E6 appended as implemented)
|
||||
uv run python -m knowledge.experiment configs/layer1/E1.yaml
|
||||
uv run python -m knowledge.experiment configs/layer1/E2.yaml
|
||||
|
||||
figures: ## regenerate figures from committed results
|
||||
MPLBACKEND=Agg uv run python figures/plot_E1.py
|
||||
MPLBACKEND=Agg uv run python figures/plot_E2.py
|
||||
|
||||
clean: ## remove caches and generated results (keeps committed manifests)
|
||||
rm -rf .pytest_cache **/__pycache__
|
||||
find results -type f ! -name '.gitkeep' -delete 2>/dev/null || true
|
||||
Loading…
Add table
Add a link
Reference in a new issue