Skip to content

Integrate Scenario 1 datasets, Modal runner, and probe handoff#10

Merged
elenaajayi merged 13 commits into
mainfrom
agent/scenario1-integrated-pipeline
Jul 14, 2026
Merged

Integrate Scenario 1 datasets, Modal runner, and probe handoff#10
elenaajayi merged 13 commits into
mainfrom
agent/scenario1-integrated-pipeline

Conversation

@elenaajayi

@elenaajayi elenaajayi commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR brings the Scenario 1 trajectory work into one shared pipeline. It combines the controlled input registry and v2 event schema, the shared trajectory generator, the Qwen3-32B Modal runner, and the adapter used by the probe and metrics code.

The goal is to remove the incompatible paths that were spread across separate branches and give the team one reproducible contract from input construction through activation requests.

Ordered repository layout

The repository now follows the experiment order instead of keeping active scripts, schemas, guides, and old outputs at the root:

  • numbered command wrappers live under scripts/;
  • reusable implementation lives under src/;
  • the public v2 schema lives under schemas/scenario1/v2/;
  • detailed Scenario 1 and Modal guidance lives under docs/;
  • controlled inputs remain under experiments/scenario1/inputs/;
  • superseded Qwen2.5/v3 files are isolated under archive/scenario1_v3/;
  • historical runway commands are isolated under scripts/90_runway_reproduction/.

The main README now presents the runnable sequence from trajectory construction through validation, Modal execution, orchestration, probe handoff, analysis, and figures. It also marks the sequential live orchestrator and safe simulated executor as unfinished, so a one-turn model call cannot be mistaken for a complete trajectory.

Scenario 1 dataset contract

  • Defines two controlled match groups: public health and climate science.
  • Generates eight base trajectory records: clean and injected conditions at 2-hop and 3-hop depth for each match group.
  • Keeps the task, document set, system prompts, seed, document order, and injection wording fixed inside each match group.
  • Keeps Worker1 as the only raw-poison entry point at both depths.
  • Sends only the upstream relay message to Worker2 and the executor.
  • Uses controlled local document fixtures and safe non-routable .invalid endpoints.
  • Keeps construction labels, observed behavioral outcomes, and reasoning labels separate.
  • Does not treat injection_present=true as a successful compromise.
  • Does not assign a latent-compromise label without later human or mechanistic evidence.

Dry-run records validate the structure only. They do not contain fabricated model outputs, tool executions, activations, or costs.

Shared generator and schema

  • Uses spec_gap.scenario1.v2 as the public trajectory format.
  • Uses one shared generator and experiments/scenario1/... directory layout.
  • Records contributor provenance in metadata instead of contributor-named folders.
  • Validates match-group completeness, topology, poison exposure, labels, exact paths, and artifact honesty.
  • Produces a manifest containing all generated records exactly once.
  • Keeps requested tool calls separate from actions actually executed by the executor.

Qwen3-32B Modal runner

  • Runs Qwen/Qwen3-32B in the shared agileai Modal workspace.
  • Pins revision 9216db5781bf21249d130ec9da846c4624c16137, matching the shared model cache.
  • Supports thinking on and thinking off while keeping the remaining decoding settings fixed.
  • Uses one H200 per paid model call and limits container concurrency.
  • Saves the rendered model input, token IDs, prompt hash, raw generated output, generated token IDs, final response, and separate thinking content.
  • Supports residual-stream extraction across configurable layers. All 64 layers are available initially; no primary layer is locked.
  • Records model, tokenizer, generation, timing, token, activation, and estimated GPU-cost metadata.
  • Requires explicit confirmation before starting a paid H200 run.
  • Treats parsed tool calls as requests only. This runner does not execute tools or mark an unsafe action as completed.

The current runner processes one agent turn at a time. Sequential live trajectory orchestration and the safe simulated executor remain follow-up work before a complete live batch is run.

Probe and metrics handoff

  • Normalizes v2 event records into the per-step format used by activation extraction and evaluation.
  • Preserves the real planner -> worker -> worker2 -> executor topology.
  • Preserves poison exposure, token alignment, exact model I/O, thinking mode, activation metadata, and cost metadata.
  • Supports six observed behavioral outcomes: clean, resisted, propagated_but_not_executed, executed, attempted_but_blocked, and indeterminate.
  • Keeps requested tool calls out of the executed-action list unless the executor actually fires the action.
  • Produces stable activation requests for the probe and metrics pipeline.

Validation

  • Full test suite: 154 passed
  • Python compilation checks passed.
  • git diff --check passed.
  • All eight structural trajectory records pass schema and semantic validation.
  • The eight base records expand into 16 thinking-mode trajectory runs and 56 validated model-turn request templates.
  • The Modal request-plan validation did not start a GPU.

Related PRs and contributor credit

This integration includes and aligns work from:

Mariame and Onyinye are preserved in the commit history and provenance metadata. After this integration is accepted, those four PRs can be closed as superseded instead of merged independently.

PR #5, the depth-degradation evaluation infrastructure, remains separate and is not replaced by this PR.

Review focus

Please check:

  • the match-group controls and document registry
  • Worker1 poison entry and downstream relay behavior
  • the v2 schema and six behavioral outcomes
  • exact model I/O and token-alignment fields
  • requested tool calls versus executed actions
  • Modal activation and cost metadata
  • the adapter handoff into the probe and metrics code

claude and others added 12 commits July 14, 2026 00:43
- scenario1_trajectory.schema.json: pin schema_version to spec_gap.scenario1.v2
  and set outcome_class to the six canonical classes shared with the PR #4
  adapter (clean, resisted, propagated_but_not_executed, attempted_but_blocked,
  executed, indeterminate).
- Rename the single validator to lowercase validate_trajectory.py; guard the
  action_channel / behavioral_channel reads so a malformed record returns a
  validation error instead of a KeyError; rename the INV-7 outcome branch to
  propagated_but_not_executed.
- pyproject.toml: add jsonschema (validator dependency) instead of a separate
  requirements file.

Part of the fresh main-based replacement for PR #7. Inputs, corrected dry-run
generator, docs, and tests follow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYkZdQB4Vz8qamn1q2cxE
…art 2)

- experiments/scenario1/inputs/: controlled input registry and three clean
  document fixtures named after the source PDFs. Report 3 here is the CLEAN
  canonical text (the PDF is poisoned); the injection is inserted only when
  constructing the injected condition.
- scenario1_pipeline.py: structural dry-run generator (no model, no GPU, no
  .pt files). Reads the registry and emits one match group -- clean/injected x
  2-hop/3-hop -- as v2 records:
    * one wording (the group's assigned A) across all four conditions;
    * exactly three document slots; clean vs injected document 3 differ only by
      the injected span (asserted);
    * injection fixed at worker_1; only worker_1 sees raw poison; worker_2 and
      the executor are relay-fed;
    * no text-to-action fallback -> injected outcome is
      propagated_but_not_executed, action_channel not executed;
    * reasoning labels null (annotation-only); activation refs are dry-run
      placeholders; a manifest is written and every path is asserted to resolve.
- schema: allow extraction_metadata.storage_path null for dry-run placeholders.
- gitignore the generated manifest.json (trajectories/ already ignored).

All four generated trajectories pass validate_trajectory.py (v2 schema + INV-1..7).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYkZdQB4Vz8qamn1q2cxE
…art 3)

validate_trajectory.py: add two semantic invariants the review asked for --
INV-8 (agent topology matches the depth condition; catches a 3-hop trace
missing worker_2) and INV-9 (a non-null reasoning label requires human or
mechanistic evidence).

tests/test_scenario1_schema.py and tests/test_scenario1_validator.py: exercise
the real input builder and dry-run generator (not one hand-written trajectory).
Positive: four base conditions; shared task/seed/wording; three document slots;
clean vs injected document 3 differ only by the injected span; only worker_1
poison-exposed; agents match depth; injected -> propagated_but_not_executed;
reasoning labels null; the six canonical outcomes are schema-valid; manifest
paths resolve; no duplicate ids. Negative fixtures the validator must reject:
worker_2 poison-exposed, 3-hop missing worker_2, outcome executed without an
action, reasoning label without evidence, auto-derived reasoning_compromised,
schema-version mismatch, broken hops_survived, and a contaminated clean control.

22 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYkZdQB4Vz8qamn1q2cxE
Describe only files/commands that exist. Cover ownership boundaries (this PR =
schema + validator + inputs + docs; generation = Onyinye; model execution =
PR #8; normalization = PR #4), the input-vs-dry-run-output-vs-real-data
distinction, the four channels, the nine invariants, the v2 decision, and the
smoke check. State that dry-run files are an initial end-to-end validation
subset, not experiment data, and that only worker_1 sees the raw poison.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LMYkZdQB4Vz8qamn1q2cxE
Co-authored-by: Ony <onyinyeokolij@gmail.com>

Co-authored-by: diabatem <44099117+diabatem@users.noreply.github.com>
@elenaajayi elenaajayi added phase:0 Phase 0 fellowship work area:scenario Scenario generation or trajectory work area:probe Probe, activation, or measurement pipeline work type:schema Trajectory schema or data contract changes labels Jul 14, 2026
@elenaajayi elenaajayi self-assigned this Jul 14, 2026
@elenaajayi elenaajayi added the type:adapter Adapter or format conversion work label Jul 14, 2026
@elenaajayi
elenaajayi requested a review from diabatem July 14, 2026 05:37
@elenaajayi elenaajayi added type:data-generation Dataset or trajectory generation work status:needs-review Needs review from the team labels Jul 14, 2026
@elenaajayi
elenaajayi requested review from Ifeoluwah and onyokoli July 14, 2026 05:37
@elenaajayi
elenaajayi marked this pull request as ready for review July 14, 2026 12:50
@elenaajayi
elenaajayi merged commit 5dbca3e into main Jul 14, 2026
@elenaajayi
elenaajayi deleted the agent/scenario1-integrated-pipeline branch July 14, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:probe Probe, activation, or measurement pipeline work area:scenario Scenario generation or trajectory work phase:0 Phase 0 fellowship work status:needs-review Needs review from the team type:adapter Adapter or format conversion work type:data-generation Dataset or trajectory generation work type:schema Trajectory schema or data contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants