Skip to content

Implement the E002 offline instrumentation replayer#10

Merged
AUo959 merged 1 commit into
mainfrom
agent/e002-offline-replayer
Jul 14, 2026
Merged

Implement the E002 offline instrumentation replayer#10
AUo959 merged 1 commit into
mainfrom
agent/e002-offline-replayer

Conversation

@AUo959

@AUo959 AUo959 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • implement a dependency-free E002 archive reader and offline replayer with no E001 simulator or workload imports
  • verify the frozen E001 archive, manifest, trace digests, summary self-digests, and canonical event sequences
  • reconstruct all loop, work, readiness, obligation, mode, and interlock state at pre- and post-tick boundaries
  • emit the frozen 25-field telemetry schema using integers and reduced rational objects only
  • preserve typed capacity, fault, semantic-rejection, stale-authority, and reciprocal-debt channels
  • implement exact ROC-AUC analysis for the predeclared T1–T3 targets and H4 threshold evaluation
  • add a repeat-before-package evidence generator and protected Python 3.13 runner
  • update readiness and registry state to implemented / evidence pending

Boundaries

The implementation is read-only and does not import or invoke E001 transition code. It cannot authorize transfers, mutate capacity credit, reorder work, or promote the local dry-run into a canonical result. H1 is reported as offline_supported_shadow_not_evaluated; optional shadow mode remains a later decision.

Validation

  • PYTHONPATH=src python -m unittest discover -s tests -p "test_*.py" -v — 20 tests passed
  • python tools/check_repository.py
  • git diff --check
  • local packaged dry-run: 72 runs, 207,360 telemetry records, zero invalid runs, zero determinism mismatches
  • local evidence archive checksum verified; compressed size 3.6 MB

The local run is implementation validation only. The canonical E002 evidence workflow will run from the merged Python 3.13 commit before results are interpreted or promoted.

Copilot AI review requested due to automatic review settings July 14, 2026 04:51
@AUo959
AUo959 marked this pull request as ready for review July 14, 2026 04:52
@AUo959
AUo959 merged commit a992361 into main Jul 14, 2026
3 checks passed
@AUo959
AUo959 deleted the agent/e002-offline-replayer branch July 14, 2026 04:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the E002 “offline instrumentation replayer” as a dependency-free, read-only Stage B pipeline that verifies the frozen E001 evidence archive, reconstructs tick-boundary state, emits deterministic exact-rational telemetry, and produces repeatable aggregate analysis and packaging.

Changes:

  • Added superloop_e002 offline archive reader + replayer with deterministic telemetry emission, run summaries, and aggregate ROC-AUC/H4 analysis.
  • Added an evidence generator script and a protected GitHub Actions workflow to generate/repeat/package canonical E002 evidence under Python 3.13.
  • Added/updated documentation and readiness/registry statuses to reflect E002 implementation availability and evidence-pending state.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/generate_e002_evidence.py Generates E002 evidence, validates determinism by repeating replay, and packages output into a deterministic tarball + SHA256.
tests/test_e002_replayer.py Adds coverage for archive verification, determinism, telemetry schema invariants, and “no E001 runtime imports” enforcement.
tests/README.md Documents E002 test invariants and how to run the full implementation suite.
src/superloop_e002/replayer.py Core E002 implementation: frozen-archive verification, state reconstruction, telemetry emission, and aggregate analysis.
src/superloop_e002/model.py Canonical JSON/digest utilities, exact rational wire encoding, and exact ROC-AUC implementation.
src/superloop_e002/init.py Exposes the public E002 API surface (EvidenceArchive, replay_*).
src/README.md Documents E002 Stage B usage and canonical evidence generation command.
REPOSITORY_READINESS.md Updates the critical path and marks E002 Stage B implementation checklist items as complete (evidence still pending).
registry/CONCEPT_REGISTRY.md Updates E002 registry status to “Implemented / evidence pending”.
experiments/README.md Updates E002 status and adds an implementation summary section.
experiments/E002/results/README.md Documents the canonical generator + protected runner, and reiterates that no evidence is promoted yet.
.github/workflows/e002-canonical-evidence.yml Adds a protected workflow to generate and upload digest-verified canonical evidence artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +52 to +53
if output.exists() and any(output.iterdir()):
raise ValueError(f"output directory is not empty: {output}")
Comment on lines +41 to +46
info = archive.gettarinfo(str(path), arcname=str(path.relative_to(source)))
info.mtime = 0
info.uid = 0
info.gid = 0
info.uname = ""
info.gname = ""
def test_archive_and_all_source_digests_verify(self) -> None:
with EvidenceArchive(ARCHIVE) as archive:
self.assertEqual(72, len(archive.run_ids))
self.assertEqual(ARCHIVE_SHA256, __import__("hashlib").sha256(ARCHIVE.read_bytes()).hexdigest())

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c995419ef2

ℹ️ 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".

interlock_id = record["interlock_id"]
receiver_conductance = parse_rational(record["receiver_conductance"])
candidate_flow = parse_rational(record["candidate_flow"])
observations["T1"].append(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter T1 observations to ready interlocks

For the T1 comparison, the E002 spec defines the pneumatic score as 1 - F* only “for an interlock with ready demand” (experiments/E002/EXPERIMENT__E002__NONCAUSAL_PNEUMATIC_INSTRUMENTATION__v0.1__2026-07-14.md:269-273). This loop appends a T1 row for every interlock record, including records whose reconstructed source_ready is false; those no-demand negatives can dominate the AUC and H4 counts and change the experiment classification without evaluating the predeclared target population. Please skip T1 rows unless the interlock has ready demand/source readiness.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants