Skip to content

feat(#868): grant first_clear on a completed map-node replay - #916

Merged
zgeoff merged 1 commit into
mainfrom
feat/868-first-clear-grants
Aug 15, 2026
Merged

feat(#868): grant first_clear on a completed map-node replay#916
zgeoff merged 1 commit into
mainfrom
feat/868-first-clear-grants

Conversation

@zgeoff

@zgeoff zgeoff commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Description

Closes #868

applyMatch in the replay worker now grants a first_clear when a verified segment's last
replayed checkpoint is a completed terminal on a world_map_node scope, spread into the
existing applyVerifiedSegment call alongside items/chain.

  • Gate is narrower than isForwardExited: a fail, stop, or cap forward-exits the chain without
    clearing a node, documented with a // comment.
  • Compares the checkpoint's type field against the string literal 'completed' rather than the
    ActivityCheckpointType enum — oxlint's type-aware no-unsafe-enum-comparison rejects the enum
    form here, matching is-forward-exited.ts's existing style.
  • avatarGrants's upsert semantics make re-verifying an already-granted node a no-op.

Testing

  • bun run typecheck passes
  • bun run test passes
  • bun run lint passes
  • New tests added for new functionality

Five new tests in run-frontier.test.ts cover: a completed map-node run grants first_clear
keyed by scopeID; a failed terminal grants nothing; a mid-run stopped forward-exit grants
nothing; a completed terminal on a non-map-node scope grants nothing; re-verifying an
already-granted node lands no duplicate row.

The replay pipeline verifies a run's completed terminal but never granted
first_clear, leaving the completion frontier permanently empty for node
selection, reveal authorization, and offline reconcile to consume.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fd45f3d0-b64c-41b0-a909-088d39cf3acd


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@zgeoff
zgeoff merged commit fca3e89 into main Aug 15, 2026
7 checks passed
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.

emit first_clear grants from the replay pipeline on verified node completion

1 participant