Skip to content

fix: validate exact error output in example checker - #7

Draft
1932819331hy-debug wants to merge 1 commit into
getsotto:mainfrom
1932819331hy-debug:fix/exact-example-error-output
Draft

1932819331hy-debug wants to merge 1 commit into
getsotto:mainfrom
1932819331hy-debug:fix/exact-example-error-output

Conversation

@1932819331hy-debug

Copy link
Copy Markdown

Summary

Fixes #3.

The example checker currently accepts any missing/empty-secret stderr that
contains the expected message. A real Python child emitting that message
followed by an unexpected diagnostic passes the original checker.

This change requires the exact message and newline, while allowing only the
known exit status 1 trailer for go run. Other prefixes, suffixes, exit codes
and unexpected stdout are rejected. Failure messages still withhold child
output.

Adds standard-library regression tests, runs them in the existing maintenance
workflow, and documents the local command. The three-OS/nine-language matrix,
action pins, permissions and Sotto integration steps are unchanged.

Verification

Tested on Linux with Python 3.12.14 and Node.js 24.19.0:

  • python3 -m unittest discover -s tests -v: 10 tests pass. Before the fix,
    the new suite produced 49 failing subcases.
  • python3 scripts/check_examples.py python javascript: all eight real demo
    cases pass.
  • A real synthetic Python subprocess reproduces the original false pass;
    the patched checker rejects the same output without disclosure.
  • An independent review checked 180 stderr boundary cases across all nine
    checker language selections, using synthetic subprocess results.
  • Python compilation and git diff --check pass.

Real Go and the other six non-Python/JavaScript runtimes were not exercised
locally; their real execution and macOS/Windows coverage remain for CI. No
Sotto installation, integration, keychain or credential operations were run.

This fixes validation in the examples repository, not the production secret
store. AI assistance was used for implementation, tests and independent review.

Signed-off-by: YU HUANG <343001481+1932819331hy-debug@users.noreply.github.com>
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.

Example checker accepts unexpected stderr on missing or empty secrets

1 participant