Skip to content

[trajectory-grader] Implement recurrence-laminarity - #55659

Merged
pelikhan merged 3 commits into
mainfrom
copilot/trajectory-grader-implement-recurrence-laminarity
Aug 25, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/trajectory-grader-implement-recurrence-laminarity

Conversation

Copilot AI commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Ships recurrence-laminarity (Tier 1, rank 7) from the trajectory graders catalog. The original generating run produced the grader but failed to push, so the change is re-applied here.

LAM isolates stagnation — consecutive steps all matching one earlier fixed state — which none of the built-in graders nor the two already-shipped recurrence graders measure: recurrence-determinism captures ordered repeated subsequences (diagonal structure) and state-revisit-probability-rep only counts revisits.

Changes

  • shared/graders/recurrence-laminarity.md (new) — self-contained importable fragment with one graders.recurrence-laminarity entry (unit: ratio, direction: lower_is_better, min: 0.0, max: 1.0) and a pure inline script. Builds the state-recurrence matrix R[i][j] = sequence[i] === sequence[j] (line of identity excluded) over the canonical state sequence and returns vertical-line points (length ≥ 2) / all recurrent points. Column-wise scan, ordered-pair counting on both numerator and denominator — same convention as recurrence-determinism.
  • State normalization — reused verbatim from recurrence-determinism: states[].id, states[].firstEventIndex, events[].index, with fallbacks for string states and missing event indices.
  • Degenerate inputs — message result for fewer than four state visits; vacuous 0 when no recurrent pairs exist.
  • shared/graders/README.md — status flipped to Implemented (7 of 25); no other rows touched.

Behavior

The metric cleanly separates stagnation from ordered repetition:

["a","a","a","a","b","c"]  // → 0.83  stuck on `a`
["a","b","c","a","b","c"]  // → 0     ordered repeat: DET's signal, not LAM's
["a","b","c","a","d","e"]  // → 0     isolated revisit
["a","b"]                  // → not applicable (< 4 visits)

Import with:

imports:
  - shared/graders/recurrence-laminarity.md

Copilot AI and others added 2 commits August 25, 2026 05:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add recurrence-laminarity grader implementation [trajectory-grader] Implement recurrence-laminarity Aug 25, 2026
Copilot AI requested a review from pelikhan August 25, 2026 05:33
@pelikhan
pelikhan marked this pull request as ready for review August 25, 2026 05:38
Copilot AI balanced review requested due to automatic review settings August 25, 2026 05:38
@pelikhan
pelikhan merged commit b0aad33 into main Aug 25, 2026
@pelikhan
pelikhan deleted the copilot/trajectory-grader-implement-recurrence-laminarity branch August 25, 2026 05:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds the Tier 1 recurrence-laminarity trajectory grader for detecting stagnation through vertical recurrence structures.

Changes:

  • Implements canonical state normalization and RQA LAM calculation.
  • Handles short and non-recurrent trajectories.
  • Marks the grader as implemented in the catalog.
Show a summary per file
File Description
.github/workflows/shared/graders/recurrence-laminarity.md Defines the importable grader and metric script.
.github/workflows/shared/graders/README.md Updates implementation status.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.8

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.

[trajectory-grader] Implement recurrence-laminarity

3 participants