Implement the E001 Stage A observation chamber#6
Conversation
There was a problem hiding this comment.
Pull request overview
Implements the E001 Stage A “observation chamber”: a deterministic, dependency-free discrete-event simulator with a frozen 72-run canonical matrix, plus supporting workloads, CLI, manifests, and regression tests to validate determinism and hard invariants.
Changes:
- Added deterministic E001 Stage A simulator with trace/summary generation, matrix execution, and manifest generation.
- Introduced frozen canonical workloads/matrix configuration and a CLI to run single simulations or the full matrix to an explicit output directory.
- Added invariant/determinism regression tests and wired them into the repository integrity GitHub Actions workflow.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_e001_simulator.py |
Adds determinism + invariant regression coverage across single runs and the full 72-run matrix. |
tests/README.md |
Documents how to run the Stage A unit test suite locally. |
src/superloop_e001/workloads.py |
Defines frozen scenario/config/seed matrix and canonical offered streams + workload digests. |
src/superloop_e001/simulator.py |
Implements the discrete-event simulator, canonical JSONL trace, summaries, manifest, and evidence writer. |
src/superloop_e001/cli.py |
Adds CLI entrypoints for single-run and matrix execution, plus result/manifest output. |
src/superloop_e001/__main__.py |
Enables python -m superloop_e001 execution. |
src/superloop_e001/__init__.py |
Exposes primary public API (run_simulation, run_matrix, RunResult). |
src/README.md |
Documents how to run E001 Stage A locally and where evidence is written. |
experiments/E001/config/CANONICAL_MATRIX__E001__v0.1__2026-07-13.json |
Adds canonical frozen matrix configuration used by tests and tooling. |
.github/workflows/repository-integrity.yml |
Runs the new E001 invariant test suite in the integrity workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| coordination_types = { | ||
| "propose", | ||
| "credit_grant", | ||
| "credit_deny", | ||
| "validate", | ||
| "receipt", | ||
| "wait", | ||
| } |
| "stale_rejection_count": self.stale_rejection_count, | ||
| "stale_authorization_count": self.stale_authorization_count, | ||
| "duplicate_promotion_count": self.duplicate_promotion_count, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d69f06cef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| commit_event = self._emit( | ||
| tick=tick, | ||
| event_type="transfer_commit", |
There was a problem hiding this comment.
Attach leases to batch transfer commits
For central and global-barrier runs that use this batch path, the emitted transfer_commit records leave lease_fresh_until as null, even though the E001 hard invariant requires every transfer commit to have current validation and an unexpired lease (experiments/E001/EXPERIMENT__E001__THREE_RING_BOUNDED_FLOW__v0.1__2026-07-13.md:270). Those canonical runs are still summarized with zero invariant violations because _check_invariants does not validate leases, so the generated evidence can pass the validity gate while violating the frozen trace contract.
Useful? React with 👍 / 👎.
| "p95": self._nearest_rank(latencies, 0.95), | ||
| "maximum": max(latencies) if latencies else None, | ||
| }, | ||
| "maximum_wait": self._maximum_wait(), |
There was a problem hiding this comment.
Report starvation duration in summaries
The summary serializes maximum_wait but never includes a separate starvation-duration metric, while the E001 metrics contract requires both maximum wait and starvation duration (experiments/E001/EXPERIMENT__E001__THREE_RING_BOUNDED_FLOW__v0.1__2026-07-13.md:252). Any consumer of the run or matrix JSON summaries therefore cannot evaluate the declared starvation metric for canonical runs, even though the run is reported as valid.
Useful? React with 👍 / 👎.
What changed
integrityworkflowWhy
E001 now has a frozen experimental contract but needs an inspectable instrument before any result can be interpreted. This change implements that instrument without promoting generated runs or making Python a permanent substrate claim.
Validation
PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_*.py' -v— 12 passedPYTHONPATH=src python3 -m superloop_e001.cli matrix --output /tmp/superloop-e001-smoke-20260713-r4— 72 runs, zero invalid run IDs, zero workload-equivalence mismatchespython3 tools/check_repository.py— passedPYTHONPATH=src python3 -m py_compile src/superloop_e001/*.py tests/test_e001_simulator.py— passedgit diff --check— passedEvidence boundary
The matrix run above is a smoke validation of the implementation. Generated traces and summaries were kept outside the repository. Canonical E001 evidence and interpretation will be promoted separately after the runtime source commit is reviewed.