Skip to content

fix(id): world-line verbs need their word boundary (#1507) - #1508

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/1507-worldline-logs-boundary
Oct 27, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/1507-worldline-logs-boundary

Conversation

@dezren39

@dezren39 dezren39 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #1507.

/logs was the only verb in the shared world-line grammar (pkgs/id/src/world_line.rs) parsed with a bare strip_prefix and no word boundary, so /logs5 / /logs55 / /logs<TAB>5 silently tailed the world's event log instead of being refused — every sibling verb requires the exact verb or verb + space + argument. Bare /document and /input fell through to "unknown command" because their arms only matched with a trailing space, while the trailing-space forms produced the usage message.

  • /logs arm now uses the same line == verb || line.starts_with(verb + " ") guard as /records and /documents.
  • Bare /document / /input return their usage messages.
  • New unit test glued_and_bare_verbs_do_not_parse_as_commands pins the glued, tab-glued, and bare forms; existing tests unchanged.

Verification: verbatim-parser probe (rustc, laptop) before/after — glued forms moved from Logs { seconds } to the unknown-command message, /logs 5 and all control verbs unchanged. Targeted cargo test --lib world_line run on the laptop; CI covers the rest.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Bare /document and /input commands now display their usage instructions.
    • /logs is recognized when entered alone or followed by a space. Glued or tab-separated arguments now receive the unknown-command response.

/logs used a bare strip_prefix, so /logs5 and /logs55 silently tailed the log for 5/55 seconds, and a tab glued the same way; every other verb requires the exact verb or verb+space+argument. /document and /input only matched with a trailing space, so the bare verbs fell through to unknown command instead of their usage. Pin all of it in a new unit test.
@dezren39
dezren39 requested a review from a team as a code owner October 27, 2026 19:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T19:38:05.014113Z 3eaec33 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) app/id Package/app: id (pkgs/ or apps/ in this repo) source/creator Filed by the new-issue-creator job labels Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6ef4d132-19e8-41f6-a78e-08521c065fe4
Commits

Reviewing files that changed from the base of the PR and between 931f177 and 3eaec33.

Files selected for processing: 1
  • pkgs/id/src/world_line.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The shared world-line parser now returns usage messages for bare /document and /input. It recognizes /logs only when the command is exact or followed by a space. Tests cover these parser boundaries.

Changes: World-line command parsing

Layer / File(s) Summary
Command parsing and boundary tests
pkgs/id/src/world_line.rs
Bare /document and /input return their usage messages. /logs accepts an exact command or a space-delimited argument; glued and tab-separated arguments fall through to the unknown-command message. Tests cover these cases.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 3eaec

No actionable merge-blocking risk is identified in the scoped parser changes. Merge after normal checks pass.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: fixing word-boundary handling for world-line verbs.
Linked Issues check Passed Directly linked issue #1507 is open and is the only active target. Its coding requirements are parser-boundary fixes in pkgs/id/src/world_line.rs. The diff against merge base 931f177 meets each one:
…
Out of Scope Changes check Passed The whole-PR change set, per the summary and the file diff, touches only pkgs/id/src/world_line.rs (+36/-2). Each hunk maps to #1507: the /document and /input bare-verb arms, the /logs guard, and the …
Full details: Linked Issues check

Explanation

Directly linked issue #1507 is open and is the only active target. Its coding requirements are parser-boundary fixes in pkgs/id/src/world_line.rs. The diff against merge base 931f177 meets each one:

  1. Glued /logs arguments: the /logs arm now requires line == "/logs" or line.starts_with("/logs "). /logs5 and /logs55 fall through to the catch-all "unknown command; type /help" Message. /logs and /logs 5 still return Logs { seconds: None } and Logs { seconds: Some(5) }.
  2. Bare verbs: new exact-match arms return "usage: /document <name>" for /document and "usage: /input <hex>" for /input. These match the trailing-space forms.
  3. Unit tests: glued_and_bare_verbs_do_not_parse_as_commands covers /logs5, /logs55, the tab-glued /logs\t5 (refused, consistent with the space rule the issue allows), /document, and /input. The existing tests in the module are unchanged and their assertions still hold on the new code by inspection.
  4. The WorldLine enum and its variants are unchanged, so SSH and pump consumers need no changes. I did not inspect the consumer test files (world_ssh.rs, commands/world.rs). Their pass or fail state is not confirmed here. The author reports only a targeted cargo test --lib world_line run; CI is stated to cover the rest.
    The #819 consumer defects are out of scope, as the issue states.
Full details: Out of Scope Changes check

Explanation

The whole-PR change set, per the summary and the file diff, touches only pkgs/id/src/world_line.rs (+36/-2). Each hunk maps to #1507: the /document and /input bare-verb arms, the /logs guard, and the new unit test. The existing tests are not modified. No consumer, enum, or unrelated code changed. No change lacks a connection to the linked issue.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.0)

Clippy execution timed out

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eaec33da0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/id/src/world_line.rs
}

#[test]
fn glued_and_bare_verbs_do_not_parse_as_commands() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefix the new test name with test_

The new test omits the test_ prefix explicitly required by the Naming rule in pkgs/id/AGENTS.md. Rename it to test_glued_and_bare_verbs_do_not_parse_as_commands to comply with the scoped repository convention.

AGENTS.md reference: pkgs/id/AGENTS.md:L140-L140

Useful? React with 👍 / 👎.

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

Labels

app/id Package/app: id (pkgs/ or apps/ in this repo) kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job

Projects

None yet

1 participant