Skip to content

fix: ground string header tab claim and clarify chr wording contracts (#276, #304) - #307

Open
mobileskyfi wants to merge 1 commit into
mainfrom
fix-276-304-string-header
Open

fix: ground string header tab claim and clarify chr wording contracts (#276, #304)#307
mobileskyfi wants to merge 1 commit into
mainfrom
fix-276-304-string-header

Conversation

@mobileskyfi

@mobileskyfi mobileskyfi commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Closes #276, closes #304

Verification: bun run lint ✔, bun run test ✔ (40 integration skipped without CHR), bun run build ✔, bun run lint:ci
Single PR for both nits as requested.

Summary by CodeRabbit

  • Documentation
    • Clarified how control whitespace is escaped to preserve original string content during decoding.
    • Updated device-behavior contract documentation to distinguish accepted codes, error wording, and version boundaries.

…#276, #304)

- src/core/routeros-string.ts: replace ungrounded 'expands each tab to four
  spaces while reading a string literal' with defensive wording that escaping
  preserves the caller's bytes. Cite RouterOS 7.20 changelog nuance:
  version-gated, width-configurable via tab-width, scoped to script editor
  not proven as string-literal expansion.
- test/integration/chr.ts: split accepted-set grouping into ACCEPTED SET vs
  WORDING CONTRACT vs VERSION BOUNDARY per test/AGENTS.md and #304.

Keeps escaping correct, no behavior change.
Copilot AI lite review requested due to automatic review settings August 29, 2026 22:07
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 173f131c-0d1c-473c-9cdb-617b21cc9d4d

📥 Commits

Reviewing files that changed from the base of the PR and between d2a6ea3 and 5cd1c47.

📒 Files selected for processing (2)
  • src/core/routeros-string.ts
  • test/integration/chr.ts

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: CHR smoke (stable)
  • GitHub Check: Corpus census
  • GitHub Check: copilot-pull-request-reviewer
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (4)
**1. Declare the split in `test/integration/chr.ts`, never inline.**

📄 CodeRabbit inference engine (test/AGENTS.md)

Files:

  • test/integration/chr.ts
Transport or RouterOS-touching code is not done until `bun run test:integration` passes.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • src/core/routeros-string.ts
  • test/integration/chr.ts
- Put long-running, RouterOS-backed, or platform-specific tests under `test/integration/` and wire them through QA or lab workflows. "Platform-specific" includes process-level tests that spawn the real `src/cli.ts` through `cli-process.ts` ...

📄 CodeRabbit inference engine (test/AGENTS.md)

Files:

  • test/integration/chr.ts
Use Bun-native TypeScript and Web APIs where possible

📄 CodeRabbit inference engine (src/AGENTS.md)

Files:

  • src/core/routeros-string.ts
🔇 Additional comments (2)
src/core/routeros-string.ts (1)

7-14: LGTM!

test/integration/chr.ts (1)

120-122: LGTM!


📝 Walkthrough

Walkthrough

The pull request updates two documentation comments. It clarifies the RouterOS string escaping rationale and distinguishes accepted sets, wording contracts, and version boundaries in device-behaviour tests.

Changes

RouterOS string escaping documentation

Layer / File(s) Summary
Clarify string escaping rationale
src/core/routeros-string.ts
The routerOsStringLiteral comment now describes control-whitespace escaping, byte preservation, and the version-gated, editor-scoped RouterOS 7.20 behaviour. The function is unchanged.

Device-behaviour contract terminology

Layer / File(s) Summary
Classify device contract shapes
test/integration/chr.ts
The section header now distinguishes accepted sets, wording contracts, and version boundaries.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 5cd1c

This PR clarifies string-escaping documentation and separates integration-test contract descriptions without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies both primary changes: revising the string-header tab claim and clarifying CHR wording contracts. It also references issues #276 and #304.
Description check ✅ Passed The description explains both changes, links them to issues #276 and #304, records validation results, and states the RouterOS assumptions. It omits the template headings and change-type checkboxes, b…
Linked Issues check ✅ Passed The changes satisfy #276 by replacing the ungrounded tab-expansion claim with defensive wording while preserving escaping behavior. They satisfy #304 by separating accepted sets, wording contracts, an…
Out of Scope Changes check ✅ Passed The pull request changes only documentation comments in src/core/routeros-string.ts and test/integration/chr.ts. Both changes directly support linked issues #276 and #304, with no unrelated behavior o…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Full details: Description check

Explanation

The description explains both changes, links them to issues #276 and #304, records validation results, and states the RouterOS assumptions. It omits the template headings and change-type checkboxes, but the required information is otherwise present.

Full details: Linked Issues check

Explanation

The changes satisfy #276 by replacing the ungrounded tab-expansion claim with defensive wording while preserving escaping behavior. They satisfy #304 by separating accepted sets, wording contracts, and version boundaries and by including PARSE_REJECTED_HINT and *_SINCE via routerOsAtLeast(...).

Full details: Out of Scope Changes check

Explanation

The pull request changes only documentation comments in src/core/routeros-string.ts and test/integration/chr.ts. Both changes directly support linked issues #276 and #304, with no unrelated behavior or scope changes.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-276-304-string-header

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.

Copilot AI 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.

Pull request overview

This PR addresses two documentation/wording nits to better ground RouterOS behavior claims and clarify the integration test “device-behaviour contracts” taxonomy.

Changes:

  • Updates routerOsStringLiteral header comment to remove an ungrounded “tabs expand to four spaces” claim and replace it with version-gated, defensive wording referencing the 7.20 changelog nuance.
  • Refines test/integration/chr.ts commentary to separate “accepted set”, “wording contract”, and “version boundary” concepts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/core/routeros-string.ts Rewords the header comment to avoid asserting unproven device behavior while keeping the rationale for escaping intact.
test/integration/chr.ts Clarifies the taxonomy of device-dependent expectation patterns used in CHR-backed integration tests.

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

Comment thread test/integration/chr.ts
@@ -117,11 +117,9 @@ export function exampleIds(count: number): number[] {
// answer at a call site; see `test/AGENTS.md` → "Device-dependent expectations".
//
// Two shapes, and they are not interchangeable:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants