Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Observer Console",
"runtimeExecutable": ".venv/bin/python",
"runtimeArgs": ["scripts/observer_console.py", "--no-open", "--port", "8899"],
"runtimeArgs": ["tools/console/server.py", "--no-open", "--port", "8899"],
"port": 8899
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python -m pip install -e . pytest
- name: Compile check
run: |
python -m compileall -q src scripts
python -m compileall -q src analysis experiments tools
- name: Unit tests
run: |
python -m pytest -q
13 changes: 6 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ python -m pip install -e ".[research]"

For experiment-driven work, use the repo workflow note:

- [docs/RESEARCH_WORKFLOW.md](docs/RESEARCH_WORKFLOW.md)
- [docs/workflow/RESEARCH_WORKFLOW.md](docs/workflow/RESEARCH_WORKFLOW.md)

It covers:
- how to orient from `RESEARCH.md`
- how to orient from `docs/research/RESEARCH.md`
- how to define success criteria before runs
- how to verify provenance before interpretation
- how to update the research log after each session
Expand All @@ -41,8 +41,8 @@ It covers:
These match what CI runs:

```bash
# Compile-check the active runtime + scripts
python -m compileall -q src scripts
# Compile-check the active runtime and support tools
python -m compileall -q src analysis experiments tools

# Run the test suite
python -m pytest -q
Expand All @@ -52,9 +52,8 @@ The test suite is small but guards against drift — CLI semantic-layer parsing,
branchpoint-analyzer defaults, README quickstart commands pointing at the unified
runtime. Add tests when adding features that other agents will rely on.

The legacy modules (`baseline_hysteresis_v1/`, `v1.5/`, `intervention_engine_v1.5_v2/`,
`adaptive_controller_system4/`) are kept as historical reference for the v1
The legacy modules (`archive/prototypes/`, `archive/controller/`, and `archive/analysis/`) are kept as historical reference for the v1
paper. Production research uses `src/runtime_lab/` — invoked via
`python -m runtime_lab.cli.main {observe|stress|hysteresis|control}` or the
warm-model daemon at `scripts/observer_daemon.py`. Don't add new code to the
warm-model daemon at `tools/observer_daemon.py`. Don't add new code to the
legacy directories.
62 changes: 34 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ actual token-decision timeline, creates matched counterfactuals, measures what
changes, and saves enough provenance to challenge every result. `Act`—including
controller research—comes later.

See [`docs/OBSERVER_FOUNDATIONS.md`](docs/OBSERVER_FOUNDATIONS.md) for the
See [`docs/foundations/OBSERVER_FOUNDATIONS.md`](docs/foundations/OBSERVER_FOUNDATIONS.md) for the
scientific and runtime contract.

## Read The Paper First
Expand Down Expand Up @@ -57,19 +57,19 @@ thesis remains paused.

Start with:

- `docs/OBSERVER_FOUNDATIONS.md` for what Observer is and what each result can
- `docs/foundations/OBSERVER_FOUNDATIONS.md` for what Observer is and what each result can
prove.
- `RESEARCH.md` for the active evidence ledger and next experiment.
- `docs/FOUNDATION_CALIBRATION_2026-07-19.md` for the first repaired-protocol
- `docs/research/RESEARCH.md` for the active evidence ledger and next experiment.
- `docs/results/FOUNDATION_CALIBRATION_2026-07-19.md` for the first repaired-protocol
target-model result.
- `docs/Q2_PROPAGATION_CALIBRATION_2026-07-19.md` for the downstream-layer
- `docs/results/Q2_PROPAGATION_CALIBRATION_2026-07-19.md` for the downstream-layer
propagation result.
- `docs/Q3_BASIN_MAPPING_2026-07-19.md` for the causal paired-continuation
- `docs/results/Q3_BASIN_MAPPING_2026-07-19.md` for the causal paired-continuation
outcome result and negative prediction gate.
- `docs/Q3_M3R2_REPLICATION_2026-07-19.md` for the fresh-prompt replication,
- `docs/results/Q3_M3R2_REPLICATION_2026-07-19.md` for the fresh-prompt replication,
stronger negative Q3 result, and procedural non-replication.
- `RESEARCH_CONTROLLER.md` for the archived controller evidence.
- `docs/RESEARCH_WORKFLOW.md` for the experiment handoff discipline.
- `archive/controller/RESEARCH_CONTROLLER.md` for the archived controller evidence.
- `docs/workflow/RESEARCH_WORKFLOW.md` for the experiment handoff discipline.

---

Expand Down Expand Up @@ -292,29 +292,35 @@ foundation.
intervention-free branch continuation, and declared branch-blind rubrics
- Simple diagnostic baselines plus a deterministic synthetic validator
- Experimental runs reported in the paper were executed on a single NVIDIA H200 GPU via RunPod
- Reporting checklist in `REPRODUCIBILITY.md`
- Reporting checklist in `docs/research/REPRODUCIBILITY.md`

---

## Project Layout

```
src/runtime_lab/ active implementation and unified CLI
scripts/ offline analyzers, warm-model daemon, console
tests/ guard tests (CLI parsing, doc/CI hygiene)
runs/ local run artifacts (ignored by git)
docs/ paper, workflow note, assets
RESEARCH.md active evidence ledger and calibration program
RESEARCH_CONTROLLER.md archived controller arc (Phase 1, F1–F29)
docs/OBSERVER_FOUNDATIONS.md active scientific/runtime contract
baseline_hysteresis_v1/ legacy v1 hysteresis prototype (historical)
v1.5/ legacy v1.5 observability prototype (historical)
intervention_engine_v1.5_v2/ legacy v2 intervention prototype (historical)
adaptive_controller_system4/ legacy controller prototype (historical)
## Repository Layout

The active implementation is kept separate from experiment tooling, documentation, and historical research. The Python package remains named `runtime_lab` for compatibility.

```text
observer/
├── src/runtime_lab/ active measurement package and unified CLI
├── experiments/ reusable calibration runners
├── analysis/ offline artifact analyzers
├── tools/ daemon, validation, and console tooling
│ └── console/static/ console web assets
├── tests/ contract and behavioral tests
├── docs/
│ ├── foundations/ active scientific/runtime contract
│ ├── research/ active evidence ledger and reproducibility
│ ├── results/ dated calibration and replication reports
│ ├── workflow/ experiment handoff guidance
│ └── observer_paper.html hosted paper source (stable Pages path)
└── archive/
├── controller/ historical controller arc
├── prototypes/ superseded runtime prototypes
└── analysis/ superseded analyzers
```

The `legacy v*` directories are kept for reproducing v1-paper results and as
historical reference. New work goes in `src/runtime_lab/`.
New research code belongs in `src/runtime_lab/`, `experiments/`, `analysis/`, or `tools/`. The `archive/` tree is preserved for historical reproduction and context; it is not part of the active evidence pipeline.

---

Expand All @@ -335,7 +341,7 @@ Or cite via `CITATION.cff`. The current preprint is the v2 paper at
[`docs/observer_paper.html`](docs/observer_paper.html) (also hosted at
<https://aeon0199.github.io/observer/observer_paper.html>). v1 (February 2026,
"Closed-Loop Stability Control...") is superseded but preserved in git history;
its central claim was falsified in v2 — see paper §10 and `RESEARCH_CONTROLLER.md`
its central claim was falsified in v2 — see paper §10 and `archive/controller/RESEARCH_CONTROLLER.md`
for the full evidence chain.

---
Expand Down
1 change: 1 addition & 0 deletions analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Offline analysis tools for Observer experiment artifacts."""
File renamed without changes.
File renamed without changes.
21 changes: 11 additions & 10 deletions scripts/analyze_propagation.py → analysis/analyze_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
from statistics import mean
from typing import Any, Iterable, Mapping, Sequence

import sys

from runtime_lab.core.io.hashing import hash_config
try:
from scripts.run_propagation_calibration import (
control_magnitude,
validate_cell_summary,
)
except ModuleNotFoundError:
from run_propagation_calibration import (
control_magnitude,
validate_cell_summary,
)

PROJECT_ROOT = Path(__file__).resolve().parents[1]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))

from experiments.run_propagation_calibration import (
control_magnitude,
validate_cell_summary,
)


METRICS = (
Expand Down
13 changes: 13 additions & 0 deletions archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Observer Archive

This tree contains historical Observer implementations and research records.

Nothing under `archive/` is part of the active runtime or current evidence pipeline. The active system lives in `src/runtime_lab/`; reusable experiment runners live in `experiments/`; offline analyzers live in `analysis/`; and operational tools live in `tools/`.

## Contents

- `controller/` — the archived closed-loop controller arc and its implementation.
- `prototypes/` — earlier hysteresis, observability, and intervention prototypes.
- `analysis/` — superseded analyzers retained for historical reproduction.

Historical results remain valuable as context, but current claims must follow the repaired contracts documented under `docs/`.
1 change: 1 addition & 0 deletions archive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Historical Observer implementations preserved for reference."""
1 change: 1 addition & 0 deletions archive/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Archived analysis modules; not part of the active runtime."""
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
> the historical record when supported by their artifacts.
>
> The active contract is
> [docs/OBSERVER_FOUNDATIONS.md](docs/OBSERVER_FOUNDATIONS.md). Controller work
> [docs/foundations/OBSERVER_FOUNDATIONS.md](../../docs/foundations/OBSERVER_FOUNDATIONS.md). Controller work
> remains paused.

> **Status: ARCHIVED.** This document records the closed-loop control research arc that ran from 2026-02 through 2026-04-19. That arc is complete — the naive-controller hypothesis is falsified on Qwen3-1.7B (see F28) and the interpretability phenomenon that emerged (F25 branchpoint hijacking) is model-specific in its consequences (F29).
>
> **For current active work, see [RESEARCH.md](RESEARCH.md) — the Mapping Program.** That document sets the research agenda going forward.
> **For current active work, see [docs/research/RESEARCH.md](../../docs/research/RESEARCH.md) — the Mapping Program.** That document sets the research agenda going forward.
>
> This doc remains the authoritative record of findings F1–F29. When the active doc references an established fact (e.g., "per F25 Part A…"), the evidence lives here. Do not edit this file unless you're correcting a factual error in one of the findings — new work belongs in RESEARCH.md.
>
Expand Down Expand Up @@ -259,7 +259,7 @@ Ordered by data-value _right now_. Tackle top-down unless the human overrides.

### [x] TD1 — Warm-model daemon *(complete 2026-04-18)*
- **Status**: complete
- **Outcome**: `scripts/observer_daemon.py` built. Loads model once, reads JSON-lines from stdin, dispatches to any runner (observe/stress/hysteresis/control) via new `prebuilt_backend` kwarg. Measured speedup: **~16× on reused requests** (observe: 30s cold → 1.8s warm after first run). E2 phase A ran in 3.4 min (would have been ~15 min cold). Dashboard JobManager does NOT yet use the daemon — it still spawns subprocesses — but batch orchestrators (`/tmp/run_e2_phase_a.py` style) talk to it directly. Dashboard integration is the follow-up (TD3).
- **Outcome**: `tools/observer_daemon.py` built. Loads model once, reads JSON-lines from stdin, dispatches to any runner (observe/stress/hysteresis/control) via new `prebuilt_backend` kwarg. Measured speedup: **~16× on reused requests** (observe: 30s cold → 1.8s warm after first run). E2 phase A ran in 3.4 min (would have been ~15 min cold). Dashboard JobManager does NOT yet use the daemon — it still spawns subprocesses — but batch orchestrators (`/tmp/run_e2_phase_a.py` style) talk to it directly. Dashboard integration is the follow-up (TD3).

### [ ] TD2 — Fix recovery-metric numerical instability (F9)
- **Status**: pending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@ def run_adaptive_controller_system4(
"""

# Locate code modules relative to this file.
root = Path(__file__).resolve().parents[1]
v2_dir = _resolve_existing_dir(root, ("intervention_engine_v1.5_v2",))
root = Path(__file__).resolve().parents[3]
v2_dir = _resolve_existing_dir(root, ("archive/prototypes/intervention_engine_v1.5_v2",))
if str(v2_dir) not in sys.path:
sys.path.insert(0, str(v2_dir))

v2_backend_path = v2_dir / "backend.py"
v2_diag_bridge_path = v2_dir / "diagnostics_bridge.py"
v2_sae_adapter_path = v2_dir / "sae_adapter.py"
dashboard_path = root / "adaptive_controller_system4" / "dashboard.py"
dashboard_path = root / "archive/controller/adaptive_controller_system4" / "dashboard.py"

v2_backend = _load_module_from_path("adaptive_v2_backend", v2_backend_path)
v2_diag_bridge = _load_module_from_path("adaptive_v2_diag_bridge", v2_diag_bridge_path)
Expand Down Expand Up @@ -709,7 +709,7 @@ def run_adaptive_controller_system4(

parser = argparse.ArgumentParser(description="Adaptive-controller demo: composite diagnostics + pluggable intervention hook")
parser.add_argument("--prompt", type=str, default="Explain how airplanes fly in a clear, accurate way.")
parser.add_argument("--model", type=str, default=None, help="Model key from intervention_engine_v1.5_v2/models.json (or omit for default)")
parser.add_argument("--model", type=str, default=None, help="Model key from archive/prototypes/intervention_engine_v1.5_v2/models.json (or omit for default)")
parser.add_argument("--max-new-tokens", type=int, default=64)
parser.add_argument("--layer", type=int, default=-1, help="Layer index to hook (negative allowed)")
parser.add_argument("--ma-window", type=int, default=3, help="Moving average window for controller")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def _load_module_from_path(module_name: str, path: Path) -> Any:


def _load_v2_module(root: Path):
return _load_module_from_path("adaptive_v2_intervention", root / "intervention_engine_v1.5_v2" / "intervention.py")
return _load_module_from_path("adaptive_v2_intervention", root / "archive/prototypes/intervention_engine_v1.5_v2" / "intervention.py")


def _load_control_module(root: Path):
return _load_module_from_path("adaptive_control_loop", root / "adaptive_controller_system4" / "adaptive_loop.py")
return _load_module_from_path("adaptive_control_loop", root / "archive/controller/adaptive_controller_system4" / "adaptive_loop.py")


def run_observe(args, root: Path):
Expand Down Expand Up @@ -120,7 +120,7 @@ def run_control(args, root: Path):


def main():
root = Path(__file__).resolve().parents[1]
root = Path(__file__).resolve().parents[3]

parser = argparse.ArgumentParser(description="Adaptive-controller unified runner")
parser.add_argument("mode", choices=["observe", "stress", "control"])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions archive/research-plans/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Archived Research Plans

These are historical implementation plans from earlier Observer research phases. They are retained as provenance for how the foundation rebuild and basin experiments were designed.

The current repository-organization plan remains under `docs/superpowers/plans/` with the active project documentation.
14 changes: 14 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Observer Documentation

This directory contains the current scientific contract, research record, experiment reports, workflow guidance, and the hosted paper.

- `foundations/` — the active Observe → Perturb → Compare → Prove contract.
- `research/` — the active evidence ledger and reproducibility checklist.
- `results/` — dated calibration and replication reports.
- `workflow/` — the handoff and experiment workflow.
- `observer_paper.html` — the hosted paper source; its path is kept stable for GitHub Pages.
- `assets/` — paper artwork and other documentation assets.

Historical controller research and superseded implementations live under the repository-level `archive/` directory.

Historical process plans are preserved under the repository-level `archive/research-plans/` directory.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Every scientific claim should be traceable to evidence that can reject it:
The diagnostic validator is:

```bash
python scripts/validate_diagnostics.py \
python tools/validate_diagnostics.py \
--json-out /tmp/observer-diagnostic-validation.json
```

Expand Down
Loading
Loading