Skip to content

The operators pack: The Severing (D/C/ce/yw) + The Gatekeeper (%)#7

Merged
StrangeNoob merged 2 commits into
mainfrom
feature/severing-gatekeeper
Jul 3, 2026
Merged

The operators pack: The Severing (D/C/ce/yw) + The Gatekeeper (%)#7
StrangeNoob merged 2 commits into
mainfrom
feature/severing-gatekeeper

Conversation

@StrangeNoob

Copy link
Copy Markdown
Owner

Summary

Closes the last two small-engine gaps from docs/LESSON-GAP-ANALYSIS.md. 20 of 29 curriculum lessons now shipped; everything remaining needs a medium+ engine feature (command-line mode, visual mode, macros...).

New lessons

Act Lesson Teaches
II · 14 The Severing D C ce yw
III · 19 The Gatekeeper % (code-flavored buffers)

Engine

  • D / C to-end-of-line operators — C inserts at the cut point without the normal-mode clamp
  • c+e accepted alongside cw (real Vim's cw acts like ce inside a word; the engine models that and now says so)
  • Charwise register: yw yanks inline text; p/P branch on a new linewise flag and paste within the line, cursor landing on the pasted text's last character. yy/p linewise behavior unchanged (regression-tested)
  • % bracket matching: nested-aware, multi-line, both directions, ()/[]/{}
  • 14 new table-driven engine test cases, TDD throughout

Content

  • Every new challenge has an authored optimal solution in solvable_test.go, verified winnable at par
  • The Severing c4 is a small golf: yw w P echoes a word inline
  • The Gatekeeper pars are chosen so % strictly beats G/f-based alternatives
  • D/C appended to allowedKeys of the lessons that follow (and % to Power Surge)

Test plan

  • go test ./... green
  • go vet, gofmt -l clean
  • Binary builds; version smoke run

The operators pack — the last small-engine consensus gaps from the
lesson gap analysis. The game grows from 18 to 20 lessons.

Engine:
- D deletes to end of line; C does the same and enters Insert at the
  cut point (no normal-mode clamp)
- c+e operator alias (real cw acts like ce inside a word — documented)
- yw yanks charwise: the register gains a linewise flag, and p/P paste
  inline for charwise content (cursor lands on the pasted text's last
  character, like Vim); yy keeps its linewise behavior
- % bracket matching: nested-aware, multi-line, both directions,
  for () [] {}

Content:
- The Severing (Act II, order 14): one challenge per key, including a
  yank-echo golf (yw w P)
- The Gatekeeper (Act III, order 19): code-flavored buffers, forward
  and backward % jumps
- D/C (and % for Power Surge) appended to later lessons' allowedKeys

Docs: LESSONS.md/CSV statuses (20 shipped / 9 planned), README journey
table, gap analysis matrix and shortlist updated — everything still
open needs a medium-or-larger engine feature.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@StrangeNoob, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9db6c509-6ca0-4f84-82d5-60d46a304afd

📥 Commits

Reviewing files that changed from the base of the PR and between 1a39a71 and b9af436.

⛔ Files ignored due to path filters (1)
  • docs/lessons.csv is excluded by !**/*.csv
📒 Files selected for processing (16)
  • README.md
  • assets/lessons/act2-14-the-severing.json
  • assets/lessons/act2-15-the-shapeshifter.json
  • assets/lessons/act3-16-trace-evasion.json
  • assets/lessons/act3-17-backtrace.json
  • assets/lessons/act3-18-the-marksman.json
  • assets/lessons/act3-19-the-gatekeeper.json
  • assets/lessons/act3-20-power-surge.json
  • docs/LESSON-GAP-ANALYSIS.md
  • docs/LESSONS.md
  • internal/content/loader_test.go
  • internal/content/solvable_test.go
  • internal/engine/edit.go
  • internal/engine/engine.go
  • internal/engine/match_bracket_test.go
  • internal/engine/severing_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/severing-gatekeeper

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.

…tion

The '?' gap is small-engine but blocked on the hint-key collision, so the
closure claim now excludes it. Also note that deletes don't fill the paste
register (only yy/yw do) — a deliberate engine simplification flagged by
review, kept for consistency across all delete paths.
@StrangeNoob

Copy link
Copy Markdown
Owner Author

CodeRabbit CLI review disposition (4 findings):

  • D/C don't fill the paste register (2 major): intentionally skipped. No delete in this engine fills the register (x, dw, dd, cw, cc never have — only y does). Making just D/C register-aware would be inconsistent, and making all deletes register-aware changes behavior in shipped rooms. Recorded as a known simplification in the gap analysis; revisit if a lesson ever teaches delete-then-paste.
  • Test cursor off-by-one (minor): finding is incorrect. The charwise register holds "abracadabra " (trailing space, cols 16–27 after paste); vim leaves the cursor on the last pasted character — the space at col 27, exactly what the test asserts.
  • Gap-analysis wording (minor): fixed — the closure claim now excludes the ? gap (small but blocked on the hint-key collision).

@StrangeNoob StrangeNoob merged commit 71ecbf6 into main Jul 3, 2026
2 checks passed
@StrangeNoob StrangeNoob deleted the feature/severing-gatekeeper branch July 3, 2026 13:18
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