Skip to content

fix: reject conflicting qcoffee source modes - #37

Merged
tiye merged 2 commits into
feat/program-fingerprintfrom
fix/qcoffee-source-mode-conflicts
Aug 23, 2026
Merged

fix: reject conflicting qcoffee source modes#37
tiye merged 2 commits into
feat/program-fingerprintfrom
fix/qcoffee-source-mode-conflicts

Conversation

@tiye

@tiye tiye commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • reject multiple qcoffee source inputs and repeated execution modes
  • close the -e ... --check FILE overwrite loophole
  • synchronize CLI contracts and all five executable manuals

Validation

  • make check
  • focused qcoffee conflict regression tests
  • make docs
  • git diff --check

This PR is chained after PR #36 and is intentionally not merged automatically.

Copilot AI lite review requested due to automatic review settings August 22, 2026 14:50

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 tightens qcoffee CLI argument validation to reject conflicting/duplicate “source input” and “execution mode” combinations (closing a -e ... --check FILE overwrite loophole), and updates the RFCs/manuals/docs plus regression tests to match the clarified contract.

Changes:

  • Enforce mutual exclusivity between -e/positional/STDIN source inputs and --check/--dump-bytecode/--fingerprint/--stats execution modes, and reject repeated mode flags.
  • Add CLI regression tests for -e + --check conflicts and repeated --dump-bytecode.
  • Synchronize the CLI contract text across RFC 0027 / RFC 0080 and all rendered manuals (qc/md/html).

Reviewed changes

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

Show a summary per file
File Description
tests/cli_tools.rs Adds regression coverage for conflicting source/mode inputs and repeated execution modes.
src/main.rs Implements stricter CLI parsing to reject conflicting source inputs and repeated mode flags.
RFCs/0080-cli-bytecode-fingerprint.md Updates fingerprint mode contract to explicitly require a single source input and mutual exclusion.
RFCs/0027-cli-check-mode.md Clarifies check mode cannot be combined with -e/script path/other source inputs.
manuals/manual.zh-CN.qc Updates manual text to state single source input + conflicting mode rejection.
manuals/manual.latin.qc Same contract clarification (Latin manual).
manuals/manual.en.qc Same contract clarification (English manual).
manuals/manual.devanagari-sa.qc Same contract clarification (Sanskrit/Devanagari manual).
manuals/manual.classical-zh.qc Same contract clarification (Classical Chinese manual).
docs/manual.zh-CN.md Updates rendered Markdown manual to reflect new CLI constraints.
docs/manual.zh-CN.html Updates rendered HTML manual to reflect new CLI constraints.
docs/manual.latin.md Updates rendered Markdown manual to reflect new CLI constraints.
docs/manual.latin.html Updates rendered HTML manual to reflect new CLI constraints.
docs/manual.en.md Updates rendered Markdown manual to reflect new CLI constraints.
docs/manual.en.html Updates rendered HTML manual to reflect new CLI constraints.
docs/manual.devanagari.sa.md Updates rendered Markdown manual to reflect new CLI constraints.
docs/manual.devanagari-sa.html Updates rendered HTML manual to reflect new CLI constraints.
docs/manual.classical-zh.md Updates rendered Markdown manual to reflect new CLI constraints.
docs/manual.classical-zh.html Updates rendered HTML manual to reflect new CLI constraints.
Suppressed comments (1)

src/main.rs:161

  • --check accepts a following flag (e.g. qcoffee --check --stats) as the FILE argument and then fails with a read error (exit 1) instead of a usage error (exit 2). This is inconsistent with --dump-bytecode/--fingerprint arg validation and contradicts the documented “usage error on missing/invalid file parameter” behavior.
                if source.is_some() || dump || check || fingerprint || stats {
                    eprintln!(
                        "--check, --dump-bytecode, --fingerprint, and --stats are execution-mode alternatives"
                    );
                    return ExitCode::from(2);

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

Comment thread src/main.rs Outdated
@tiye
tiye force-pushed the fix/qtest-global-order branch from 5899cc9 to c23925b Compare August 23, 2026 04:39
Base automatically changed from fix/qtest-global-order to feat/program-fingerprint August 23, 2026 04:40
@tiye
tiye force-pushed the fix/qcoffee-source-mode-conflicts branch from ee6c8c9 to 691109f Compare August 23, 2026 04:43
@tiye
tiye merged commit 152aa4a into feat/program-fingerprint Aug 23, 2026
2 checks passed
@tiye
tiye deleted the fix/qcoffee-source-mode-conflicts branch August 23, 2026 04:44
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