chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:39:17 +08:00
commit 4ed4e9ff99
1368 changed files with 334957 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# Credit Note Example Repo
This tiny repo exists to support `examples/sandbox/docs/coding_task.py`.
The task is intentionally small so a sandbox coding agent can inspect the repo, apply a minimal patch, and prove the fix with one targeted shell test command.
@@ -0,0 +1,6 @@
#!/bin/sh
customer="$1"
amount="$2"
printf 'Credit note for %s: -$%s debit.\n' "$customer" "$amount"
+14
View File
@@ -0,0 +1,14 @@
# Task
`credit_note.sh` formats a credit note incorrectly:
- It prints a debit label instead of a credit label.
- It preserves the sign instead of always showing the credited amount as positive.
Use the smallest correct fix, then run this exact verification command from the `repo/` directory:
`sh tests/test_credit_note.sh`
If you use `apply_patch`, the patch paths must still be relative to the sandbox workspace root. That means the file paths should be `repo/credit_note.sh` and `repo/tests/test_credit_note.sh`.
Do not change the test expectations.
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
actual_positive="$(sh credit_note.sh Northwind 12.50)"
if [ "$actual_positive" != 'Credit note for Northwind: $12.50 credit.' ]; then
printf 'expected positive case to pass, got: %s\n' "$actual_positive" >&2
exit 1
fi
actual_negative="$(sh credit_note.sh Northwind -12.50)"
if [ "$actual_negative" != 'Credit note for Northwind: $12.50 credit.' ]; then
printf 'expected negative case to pass, got: %s\n' "$actual_negative" >&2
exit 1
fi
printf '2 passed\n'