Skip to content

test: cover brief agent-mode output - #212

Merged
Rome-1 merged 1 commit into
Raftersecurity:mainfrom
pedropachecog:test/issue-28-brief-agent-mode
Jul 29, 2026
Merged

test: cover brief agent-mode output#212
Rome-1 merged 1 commit into
Raftersecurity:mainfrom
pedropachecog:test/issue-28-brief-agent-mode

Conversation

@pedropachecog

Copy link
Copy Markdown
Contributor

Summary

This adds matching regression tests for rafter --agent brief scanning in Node and Python. The Node test uses spawnSync to capture both output streams, while the Python test invokes the root Typer app with color=True. Both cases require a successful exit and real Rafter content, then reject escape characters and emoji so agent mode stays plain.

Why

Issue #28 originally listed broader brief coverage, but most of that coverage landed before this change. In the issue discussion, the maintainer identified agent-mode output as the highest-priority remaining gap. Both CLIs already produce plain output; this PR adds mirrored regression coverage so a later formatting change cannot silently break that contract.

Related issue

Addresses the agent-mode portion of #28. The Node internal-helper parity work remains a separate follow-up.

Test plan

  • pnpm run build
  • pnpm exec vitest run tests/brief.test.ts (29 passed)
  • .\.venv\Scripts\pytest.exe tests\test_brief.py -v (36 passed)
  • Linux Node 20: pnpm test (1,986 passed, 53 skipped)
  • Linux Python 3.11: python -m pytest tests/ -v (1,540 passed, 9 skipped)
  • git diff --check upstream/main...HEAD
  • node .\node\dist\index.js secrets . --diff upstream/main --engine patterns --no-auto-update --format json (zero findings)
  • rafter run --mode fast (scan 77e6f82e-ebd7-422a-bc14-1f54ab73e68d): no findings in either changed test file. Those files remained byte-identical after the conflict-free rebase. The repository-wide scan also reported 20 errors, 32 warnings, and 54 notes in unmodified files.

Spec update

None. This is a test-only change and does not alter CLI behavior.

Checklist

  • Both Node and Python implementations updated
  • Tests pass in both (pnpm test + pytest)
  • Versions match in node/package.json and python/pyproject.toml
  • shared-docs/CLI_SPEC.md updated (not required because CLI behavior did not change)
  • No secrets, credentials, or API keys in the diff
  • AI assistance disclosed and included in the commit trailer

Prepared with OpenAI Codex. The commit includes a Co-Authored-By trailer.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@Rome-1

Rome-1 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks — this is a clean, well-scoped addition. Checked it against the tree: the --agent flag and the Python agent-mode gating are real, the helper refactor from execFileSync to spawnSync preserves the shape the other brief tests rely on, and forcing FORCE_COLOR=1 before asserting no ANSI/emoji is exactly the right way to prove agent mode holds under a hostile env rather than passing vacuously. The Python autouse fixture that resets the global agent-mode is a nice touch.

Appreciate scoping it to the agent-mode slice and leaving the internal-helper parity as a follow-up on #28.

Merging — thanks for the contribution.

@Rome-1
Rome-1 merged commit 4f977b9 into Raftersecurity:main Jul 29, 2026
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.

2 participants