Skip to content

fix(cosh-ng): [shell] stabilize raw cli tests#1327

Closed
samchu-zsl wants to merge 1 commit into
alibaba:mainfrom
samchu-zsl:fix/cosh-ng/raw-cli-test-debt
Closed

fix(cosh-ng): [shell] stabilize raw cli tests#1327
samchu-zsl wants to merge 1 commit into
alibaba:mainfrom
samchu-zsl:fix/cosh-ng/raw-cli-test-debt

Conversation

@samchu-zsl

Copy link
Copy Markdown
Collaborator

Description

Stabilizes the cosh-shell raw CLI test suite without changing the shell runtime semantics. The patch keeps raw mode returning the final shell command status, and moves the fixes into test harness behavior and assertions so Linux, zsh, locale, git, and renderer differences are explicit in tests.

This is a test-debt remediation change for cosh-ng; production module boundaries and runtime behavior are intentionally left unchanged.

Related Issue

no-issue: test debt remediation

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional change)
  • Performance improvement
  • CI/CD or build changes

Scope

  • cosh (copilot-shell)
  • cosh-ng (cosh-ng)
  • sec-core (agent-sec-core)
  • skill (os-skills)
  • sight (agentsight)
  • tokenless (tokenless)
  • ckpt (ws-ckpt)
  • memory (agent-memory)
  • anolisa (anolisa-cli)
  • skillfs (SkillFS)
  • Multiple / Project-wide

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • For cosh: Lint passes, type check passes, and tests pass
  • For cosh-ng: cargo clippy --all-targets -- -D warnings and cargo fmt --check pass
  • For sec-core (Rust): cargo clippy -- -D warnings and cargo fmt --check pass
  • For sec-core (Python): Ruff format and pytest pass
  • For skill: Skill directory structure is valid and shell scripts pass syntax check
  • For sight: cargo clippy -- -D warnings and cargo fmt --check pass
  • For tokenless: cargo clippy -- -D warnings and cargo fmt --check pass
  • For memory (Linux only): cargo clippy --all-targets -- -D warnings, cargo fmt --check, and cargo test pass
  • For anolisa: cargo clippy --all-targets --locked -- -D warnings, cargo fmt --all --check, and cargo test --locked pass
  • For skillfs: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace pass
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

  • cargo fmt --package cosh-shell --all -- --check
  • git diff --check
  • git diff --cached --check
  • cargo test --package cosh-shell --lib (638 passed; 0 failed)
  • cargo test --package cosh-shell --test logic (5 passed; 0 failed)
  • cargo test --package cosh-shell --test protocol (21 passed; 0 failed)
  • cargo test --package cosh-shell --test shell_host -- --test-threads=4 (37 passed; 0 failed; 1 ignored)
  • cargo test --package cosh-shell --test raw_cli -- --nocapture (301 passed; 0 failed; 1 ignored)

Additional Notes

  • crates/cosh-shell/scripts/check-layout.sh still reports existing layout debt unrelated to this tests-only patch: root src/logging.rs, large production files, and source heavy-test risk.
  • This PR is draft until the reviewer confirms whether no-issue is acceptable or provides an issue number.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@samchu-zsl samchu-zsl force-pushed the fix/cosh-ng/raw-cli-test-debt branch from 8914f8a to a877f94 Compare July 4, 2026 03:17
@samchu-zsl samchu-zsl changed the title fix(shell): stabilize raw cli tests fix(cosh-ng): [shell] stabilize raw cli tests Jul 4, 2026
Keep raw mode semantics unchanged and move the fixes into the raw_cli harness
and assertions. This preserves the shell-first runtime contract while making
Linux, zsh, locale, git, and renderer differences explicit in tests.

The remaining layout audit debt is documented separately because this patch
avoids production module movement.

Signed-off-by: shenglongzhu <samchu.zsl@alibaba-inc.com>
@samchu-zsl samchu-zsl force-pushed the fix/cosh-ng/raw-cli-test-debt branch from a877f94 to e6d3f12 Compare July 4, 2026 03:56
@samchu-zsl samchu-zsl marked this pull request as ready for review July 4, 2026 04:55
@SunnyQjm

SunnyQjm commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

PR number: #1327
head_sha: e6d3f12
pr_updated_at_observed: 2026-07-06T21:45:29Z
reviewed_at: 2026-07-06T23:12:50Z
baseline_run: true (local automation memory was missing; updated existing same-marker Conversation comment)

Findings

  • [P2] src/cosh-ng/crates/cosh-shell/tests/raw_cli/startup.rs:442: this raw CLI startup test removes the explicit no-BEL regression guard. The test still checks the ghost prompt text, but a renderer regression that emits \x07 while drawing the prompt would now pass. Please restore a narrow !output.contains('\x07') assertion here, or document why BEL is now allowed with equivalent replacement coverage.
  • [P2] PR metadata/status: GitHub currently reports mergeStateStatus=DIRTY, which blocks merge independent of this test-only diff. Please rebase/resolve conflicts before final merge review.
  • [P2] CLA / issue linkage: license/cla is still PENDING, and the PR uses no-issue: test debt remediation with no linked issue. Please resolve CLA and either link a tracking issue or get explicit maintainer acceptance for the no-issue exception.

Open Questions

  • Is no-issue: test debt remediation acceptable for this repo, or should this be tied to a raw CLI test-debt tracking issue?

Validation

  • Reviewed: PR metadata, head SHA, changed files, patch, Conversation comments, review submissions, review threads, related issue extraction/search, and local cosh-ng code organization SDD.
  • Related issues: PR body says no-issue; closingIssuesReferences is empty; keyword searches for raw CLI/test debt, cosh-shell raw cli, and startup health prompt BEL did not find a matching open issue.
  • Structure result: 未发现 blocking package/module/public API 组织问题;diff is confined to src/cosh-ng/crates/cosh-shell/tests/** and does not add root src/*.rs, production pub, self-crate cosh_shell:: production paths, forbidden dependency directions, lockfile, .env, or unrelated crates.
  • Status checks observed: PR Lint success, CI/Test cosh-ng success; license/cla pending; merge state dirty.
  • Not run: local checkout tests, crates/cosh-shell/scripts/check-layout.sh, or focused raw CLI tests.

@SunnyQjm SunnyQjm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. Existing review notes are treated as non-blocking for this PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants