Skip to content

feat(shell): land scan module (from closed #13) and bump tinybus - #14

Merged
senamakel merged 4 commits into
mainfrom
vendor-refresh
Sep 30, 2026
Merged

senamakel merged 4 commits into
mainfrom
vendor-refresh

Conversation

@senamakel

Copy link
Copy Markdown
Member

Re-lands the two commits from closed PR #13 (branch oh-w2-tinybox-on-v0.1.8, a1b5bf0) that add the public tinybox_core::shell::scan module and tests. The OpenHuman host (crates/openhuman-core security/policy) imports tinybox_core::shell::scan, so main needs it. Also bumps nested tinybus to df6f990. fmt, clippy -D warnings, tests and docs pass locally.

senamakel and others added 4 commits September 30, 2026 09:21
Make the scan module publicly accessible and add a dedicated test module for it, enabling external use of the scanning functionality and keeping its tests separate from the existing shell tests.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed an unnecessary `continue` statement in the quote state machine that was unreachable after the closing quote handling. Also refactored two `match` expressions into more idiomatic `let Some` patterns with guard conditions, making the control flow clearer without changing behaviour.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 4 billable files and costs up to $1.00.

Or wait 15 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2006c87d-fa74-4342-8de2-128022aee30f

📥 Commits

Reviewing files that changed from the base of the PR and between 4004386 and 2a56dca.

📒 Files selected for processing (4)
  • crates/tinybox-core/src/shell/mod.rs
  • crates/tinybox-core/src/shell/scan.rs
  • crates/tinybox-core/src/shell/scan_test.rs
  • vendor/tinybus

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-09-30T09:40:42.872576Z 2a56dca 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.

@senamakel
senamakel merged commit 479d0e3 into main Sep 30, 2026
9 checks passed
@tinysweeper

tinysweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Incomplete
Priority: none
Reviewed head: 2a56dca3295e
Updated: 1790761339 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 2 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 6

Completeness: Incomplete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Could not review: crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/scan_test.rs

Before merge

  • Complete the critique review for crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/scan_test.rs.
  • Complete the security review for crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan_test.rs.

How this fits together

flowchart LR
  n0["script<br/>changed"]:::changed
  n1["push"]:::impacted
  n2["strip_quoted_heredoc_bodies"]:::impacted
  n3["is_empty"]:::impacted
  n4["command_line"]:::impacted
  n5["split_unquoted_segments"]:::impacted
  n6["quote"]:::impacted
  n0 -->|calls| n1
  n0 -->|calls| n3
  n0 -->|calls| n4
  n0 -->|calls| n6
  n2 -->|calls| n1
  n2 -->|calls| n3
  n4 -->|calls| n6
  n5 -->|calls| n1
  n5 -->|calls| n3
  n6 -->|calls| n1
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/scan_test.rs
  • Lane summary: Reviewed 0 files; 0 findings. 3 files could not be reviewed: crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/scan_test.rs.

security

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan_test.rs
  • Lane summary: Reviewed 0 files; 0 findings. 3 files could not be reviewed: crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan_test.rs.

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Adds a new public `scan` module with quote-aware shell command scanners and a comprehensive test suite. The tests are deterministic, cover the documented cases, and would fail if the behaviour changed. No problems found.}, _The code index is behind this pull request (indexed at `a1b5bf0af217`), so retrieved context may be out of date._ _2 memory call(s) failed (model: cortex: v1/answer: timed out after 20s), so this review saw part of what the engine holds._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: _The code index is behind this pull request (indexed at `a1b5bf0af217`), so retrieved context may be out of date._ _2 memory call(s) failed (model: cortex: v1/answer: timed out after 20s), so this review saw part of what the engine holds._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No end-to-end harness in this repository: no e2e test files and no e2e workflow.
Evidence and run details
  • Models: ladder/vectors, deepseek/deepseek-v4-flash
  • Spend: $0.006932
  • Tokens: 50559 input · 15525 output · 5888 cached · 1144 embedding
Head State Pass summary
2a56dca3295e incomplete 0 active finding(s), 0 resolved finding(s) (at 1790761339)

tinysweeper 0.1.0

@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: 2a56dca329

ℹ️ 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".

'\\' => escaped = true,
'\'' => quote = QuoteState::Single,
'"' => quote = QuoteState::Double,
'<' if chars.next_if(|(_, c)| *c == '<').is_some() => {

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 Ignore heredoc markers in inert shell text

Because this pass records every << before it knows which lines are heredoc bodies—and does not recognize shell comments—inert text can create fake heredocs. For example, cat <<'EOF'\nliteral <<'X'\nEOF\necho ok\nrm -rf / queues X from the body and then blanks the live rm line; true # <<'X'\nrm -rf / has the same effect. A policy guard scanning the returned string therefore misses commands the shell will execute, so operators must be discovered only in actual command text while processing lines sequentially.

Useful? React with 👍 / 👎.

Comment on lines +404 to +408
while next_delim < operators.len() && operators[next_delim] < line_end {
// The last operator on a line wins: `cat << 'A' << 'B'` reads A's
// body first, but only tracking one at a time is enough for the
// guard, and a nested case simply keeps scanning as today.
open = Some(delimiters[next_delim].clone());

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 Preserve earlier unquoted heredoc bodies

When an unquoted heredoc precedes a quoted one, such as cat <<EOF <<'Q'\n$(danger)\nEOF\nliteral\nQ, operators contains only Q, so this loop opens it immediately after the command line and blanks the earlier unquoted body. The shell reads heredocs in redirection order and expands $(danger) in the EOF body, meaning policy scanning the stripped result misses live command substitution; track all heredocs in order and blank only the bodies whose own delimiter was quoted.

Useful? React with 👍 / 👎.

Comment on lines +433 to +435
let Some(quote @ ('\'' | '"')) = chars.next() else {
return None;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recognize partially quoted heredoc delimiters

Shell quote removal disables heredoc-body expansion when any part of the delimiter word is quoted, including forms such as <<\EOF and <<E"OF", but this parser accepts only tokens beginning with a single or double quote. Consequently these valid quoted heredocs are returned unchanged and inert body text containing $(), backticks, or & can be rejected by downstream guards; parse quoting throughout the delimiter word and remember whether any character was quoted.

Useful? React with 👍 / 👎.

Comment on lines +389 to +391
if let Some(delim) = open.clone() {
if line.trim() == delim {
open = None;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match heredoc terminators using shell whitespace rules

For ordinary <<, the delimiter must appear exactly by itself; only <<- permits leading tabs, and neither form permits arbitrary surrounding whitespace. Using trim() therefore ends stripping early on a body line such as EOF, leaving the remainder of the still-inert quoted body visible to policy scanners and causing false rejections. Compare exactly for <<, and for <<- remove only leading tab characters.

Useful? React with 👍 / 👎.

@tinysweeper tinysweeper 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.

tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/tinybox-core/src/shell/mod.rs, crates/tinybox-core/src/shell/scan.rs, crates/tinybox-core/src/shell/scan_test.rs.

             $0.0069 · 50,559 in / 15,525 out · 5,888 cached (12%) · ladder/vectors, deepseek/deepseek-v4-flash · 1,144 embedded
tests:       $0.0029 · 24,270 in / 5,105 out  · 3,072 cached (13%) · deepseek/deepseek-v4-flash
description: $0.0024 · 14,847 in / 7,032 out  · 2,304 cached (16%) · deepseek/deepseek-v4-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Sep 30, 2026
@senamakel
senamakel deleted the vendor-refresh branch October 11, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant