Skip to content

[trajectory-grader] Implement recurrence-trapping-time #55826

Description

@github-actions

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: README.md, .github/workflows/shared/graders/README.md, .github/workflows/shared/graders/recurrence-trapping-time.md

Summary

Implements recurrence-trapping-time (Tier 1, rank 8) — the next grader in catalog order after state-revisit-probability-rep, recurrence-determinism, and recurrence-laminarity.

Grader: recurrence-trapping-time (RQA TT)

Computes the RQA "trapping time" metric: the mean length of vertical line structures (length ≥ 2) in the state-recurrence matrix built from the canonical state/event sequence. This measures the average number of consecutive steps an agent stays "trapped" once it starts re-entering a previously visited state.

Distinct from existing graders:

  • Complements recurrence-laminarity (LAM), which measures the fraction of recurrent structure that is vertical (stagnation), by instead quantifying the typical duration of each stagnation episode.
  • Distinct from built-in loop/retry graders, which don't use the RQA vertical-line-length formulation.
  • Distinct from recurrence-determinism, which measures diagonal (ordered repeated subsequence) structure, not vertical (single-state stagnation) structure.

Required IR fields: canonical states[] (with id, optional firstEventIndex) and events[] (with index) from the Trajectory IR — same fields already consumed by recurrence-laminarity and recurrence-determinism.

Implementation notes:

  • Follows the same candidate-resolution and state-ordering normalization used by recurrence-laminarity.md/recurrence-determinism.md.
  • Returns a deterministic "not applicable" result when fewer than 4 canonical state visits exist, and a vacuous 0 when no vertical recurrence structures are found.
  • Pure inline script; no network, no require/import, no nondeterminism.

Catalog update

Flipped recurrence-trapping-time status from Not started to Implemented in shared/graders/README.md. See shared/graders/README.md for the full catalog — 8 of 25 implemented.

Files changed

  • .github/workflows/shared/graders/recurrence-trapping-time.md (new)
  • .github/workflows/shared/graders/README.md (status flip only)

Generated by 🧮 Daily Trajectory Grader Implementer · copilot · auto · 56.2 AIC · ⌖ 7 AIC · ⊞ 10.2K ·

  • expires on Sep 8, 2026, 8:38 AM UTC-08:00

Note

This was originally intended as a pull request, but the git push operation failed.

Original error: The process '/usr/bin/git' failed with exit code 1

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

Create the pull request manually
# Download the artifact from the workflow run
gh run download '32872112188' -n agent -D '/tmp/agent-32872112188'

# Resolve the bundle source ref, fetch it into a temporary ref, then create the local branch
bundle_path='/tmp/agent-32872112188/aw-daily-trajectory-grader-recurrence-trapping-time.bundle'
temp_ref='refs/bundles/create-pr-daily-trajectory-grader-recurrence-trapping-time-4baf20dcd0639179-e3510f7c'
target_ref='refs/heads/daily-trajectory-grader-recurrence-trapping-time-4baf20dcd0639179'
bundle_source_ref=$(git bundle list-heads "$bundle_path" | awk '$2 ~ /^refs\/heads\// { print $2 }')
if [ -z "$bundle_source_ref" ]; then
  bundle_source_ref=$(git bundle list-heads "$bundle_path" | awk '$2 == "HEAD" { print $2 }')
fi
if [ "$(printf '%s\n' "$bundle_source_ref" | sed '/^$/d' | wc -l | tr -d ' ')" != "1" ]; then
  echo "Expected exactly one bundle source ref, found: $bundle_source_ref" >&2
  exit 1
fi
git fetch "$bundle_path" "${bundle_source_ref}:${temp_ref}"
git update-ref "$target_ref" "$temp_ref"
git checkout 'daily-trajectory-grader-recurrence-trapping-time-4baf20dcd0639179'
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d "$temp_ref"

# Push the branch to the target remote
git push 'origin' 'daily-trajectory-grader-recurrence-trapping-time-4baf20dcd0639179'

# Create the pull request
gh pr create --title '[trajectory-grader] Implement recurrence-trapping-time' --base 'main' --head 'daily-trajectory-grader-recurrence-trapping-time-4baf20dcd0639179' --repo 'github/gh-aw'

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions