Skip to content

fix(foresight): minimal corridor self-heal no-wedge stack - #423

Merged
rita-aga merged 4 commits into
mainfrom
codex/arn-65-minimal-self-heal
Jun 18, 2026
Merged

fix(foresight): minimal corridor self-heal no-wedge stack#423
rita-aga merged 4 commits into
mainfrom
codex/arn-65-minimal-self-heal

Conversation

@rita-aga

@rita-aga rita-aga commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Minimal ARN-65 / Lane 3 no-wedge reliability stack against main.

This intentionally does not replace or force-push over PR #422 (codex/searched-corridor). #422 remains the broad searched-corridor handoff and is currently conflicting because it carries broad active branch history. This PR is the non-destructive, mergeable narrow self-heal path.

Scope:

  • Endpoint.Sampled -> ResumeWriter self-heal for dead/orphaned endpoint writers.
  • Endpoint.UnderRepair -> ResumeEndpointScoring self-heal for terminal claims that never scored.
  • World.Active -> ResumeWorldCascade self-heal for terminal claims with unset canonical_path_id.
  • World.Seeding -> ResumeSeed self-heal for missed/stalled SeedComplete.

Files

  • crates/temperpaw/tests/corridor_engine_contract.rs
  • os-apps/paw-foresight/policies/foresight.cedar
  • os-apps/paw-foresight/specs/endpoint.ioa.toml
  • os-apps/paw-foresight/specs/model.csdl.xml
  • os-apps/paw-foresight/specs/world.ioa.toml
  • os-apps/paw-foresight/wasm/aggregate_costs/src/lib.rs
  • os-apps/paw-foresight/wasm/sample_endpoints/src/lib.rs

Merge-State Diagnosis

PR #422 is mergeable=CONFLICTING because codex/searched-corridor carries broad searched-corridor history while main has overlapping corridor/platform changes. A safe minimal replay onto origin/main had only one mechanical conflict in the corridor contract test placement; this branch preserves main's packaging test and appends the self-heal contracts.

Current PR #423 state: mergeable=MERGEABLE; GitHub checks queued at time of opening.

Verification

Fresh proof rerun on pushed branch codex/arn-65-minimal-self-heal:

  • cargo test -p temperpaw --test corridor_engine_contract passed 17/17.
  • cargo build -p temperpaw passed.
  • cargo build --manifest-path os-apps/paw-foresight/wasm/sample_endpoints/Cargo.toml --target wasm32-unknown-unknown --release --locked passed.
  • cargo build --manifest-path os-apps/paw-foresight/wasm/aggregate_costs/Cargo.toml --target wasm32-unknown-unknown --release --locked passed.
  • cargo build --manifest-path os-apps/paw-foresight/wasm/seed_world/Cargo.toml --target wasm32-unknown-unknown --release --locked passed.

Canonical E2E Plan

Current canonical target after Lane 4: Railway foresight deployment 55c673b1-1aa2-455f-befe-065b35683e70 on Postgres-v79y; /readyz is ready.

After deploy/install of this PR to foresight, run:

python3 scripts/prove_corridor_e2e.py \
  --base-url https://foresight-production-72d1.up.railway.app \
  --tenant default \
  --api-key <FORESIGHT_API_KEY> \
  --model <approved model> \
  --provider <approved provider> \
  --budget 2 \
  --skip-dwellers \
  --timeout-min 60

Needed for live proof: deployment/install authorization and a live FORESIGHT_API_KEY/model/provider choice. Unauthenticated /paw/version returns 401.

rita-aga and others added 4 commits June 18, 2026 15:04
Endpoint.Sampled sat in allow_indefinite_states with no state_timeout, so a
writer session that died — or a server restart that orphaned its in-flight
provider call — wedged the endpoint forever, and the diversity-gate barrier
never fired because one sibling bundle was never written. Observed live on prod
world en-019ed392 (2026-06-16): all 3 endpoint writers hung on their first model
call; the run could only continue via hand re-spawn.

Mirror Path's Solving/Repaired/Challenged self-heal: a 900s state_timeout on
Sampled re-spawns the writer via a new ResumeWriter self-loop action, which
shares phase_resteer with the gate's ReSteer (re-spawn with the endpoint's
stance + any revision_brief). Budget sits well above a healthy writer (~3 min
observed) so a live session is never double-spawned; a late duplicate's
BundleWritten no-ops once the endpoint has left Sampled.

- specs/endpoint.ioa.toml: drop Sampled from allow_indefinite_states; add the
  Sampled state_timeout and the ResumeWriter action.
- wasm/sample_endpoints: route ReSteer | ResumeWriter -> phase_resteer.
- policies/foresight.cedar: permit system-dispatched ResumeWriter on Endpoint.
- corridor_engine_contract: pin Sampled self-heal (13 passing; +1).

Host tests 12/12; contract suite 13/13.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
)

Add World.Active ResumeWorldCascade and Endpoint.UnderRepair
ResumeEndpointScoring state_timeouts with aggregate_costs handlers.
Re-running world_cascade when all claims are terminal but canonical_path_id
is unset prevents the en-019ed392 wedge; endpoint scoring self-heal covers
missed ScoreComplete dispatches. Contract tests 3/3 pass.
@rita-aga

Copy link
Copy Markdown
Collaborator Author

CI note: initial GitHub checks run failed during cargo clippy --locked -p temperpaw -p paw-codex-worker --all-targets -- -D warnings before compiling this PR's code because crates.io dependency fetch for argon2 failed with curl HTTP2 framing error. I reran failed jobs; rerun job is queued: https://github.com/nerdsane/temperpaw/actions/runs/27783160683

@rita-aga

Copy link
Copy Markdown
Collaborator Author

CI/deploy-readiness update: rerun passed. PR #423 is now mergeable=MERGEABLE, mergeStateStatus=CLEAN, and CI checks completed successfully: https://github.com/nerdsane/temperpaw/actions/runs/27783160683/job/82213127171

Per orchestration, Codex/provider auth is intentionally held until the other lanes are ready for a meaningful live Foresight run. This PR is code/CI ready for review/deploy planning; final canonical e2e should wait until Lane 2 + Lane 3 are landed/deployed and fresh Codex auth is requested then.

@rita-aga
rita-aga marked this pull request as ready for review June 18, 2026 20:05
@rita-aga
rita-aga merged commit 1b6ef55 into main Jun 18, 2026
1 of 2 checks passed
@rita-aga

Copy link
Copy Markdown
Collaborator Author

ARN-65 post-merge status:

  • PR fix(foresight): minimal corridor self-heal no-wedge stack #423 is merged to main as 1b6ef55135d643c9c0effe54ba087ff00e211f65 (merged 2026-06-18T20:05:24Z). CI was green: https://github.com/nerdsane/temperpaw/actions/runs/27783160683/job/82213127171
  • Local proof on the branch was green before merge: cargo test -p temperpaw --test corridor_engine_contract, cargo build -p temperpaw, and release WASM builds for sample_endpoints, aggregate_costs, and seed_world.
  • Current Railway foresight production service is healthy but still on deployment 55c673b1-1aa2-455f-befe-065b35683e70 (latest deploy 2026-06-18 18:55:53 UTC), so this merge is not yet live there.
  • Non-auth deployment gate: production app capabilities are Genesis-pinned. A Railway deploy alone is not sufficient proof that the new paw-foresight specs/Cedar/WASM are installed. Need the Genesis publish/update/install path for paw-foresight (new pinned temperpaw/paw-foresight@HASH installed into foresight/tenant default, and bootstrap refs updated/reconciled if that is how the service is pinned), plus a runtime/image deploy if needed.
  • Final no-wedge e2e remains intentionally Codex-provider-auth-gated; do not request fresh Codex auth until deploy/install is complete and the other lanes are ready for the meaningful live run.

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.

1 participant