An OSS contribution should clear a local score before model review. The score freezes reproduction, patch scope, tests, and rollback. A model may comment later, but it must not set the bar.
This note gives a proposed gate for ordinary bug-fix pull requests. The checker below is a template, not a recorded benchmark. No runtime metric in this draft comes from a live maintainer host.
The failure this gate stops
A loose patch invite produces comments about tone and naming. The maintainer still lacks a failing command and a bounded diff. Review time goes to prose, not to the defect.
A model amplifies that failure when the prompt is vague. It will happily discuss style while the bug stays open. The gate blocks that prompt until local evidence exists.
What the scorecard stores
The packet lives in one directory beside the clone. Five notes carry fixed weights that sum to one hundred. A missing note scores zero for that weight.
repro.md holds the failing command and the observed result. patch.diff holds the candidate change and nothing beyond it. tests.md holds the fail command and the later pass command.
scope.txt holds git diff stat output plus a path allowlist. rollback.md holds the branch name and the drop command. The weights are twenty, forty, twenty, ten, and ten.
Forty points sit on the diff because scope creep is common. Twenty points sit on reproduction because hearsay is common. The remaining forty points cover tests, scope, and rollback.
Step 1. Freeze the reproduction
The contributor creates a clean directory and a shallow clone. The branch name carries the issue id and the word repro. Work does not start on the default branch.
The clone URL below is a placeholder, not a real project. The contributor replaces it with the target repository. A depth of one is enough for a small bug note.
mkdir -p oss-scorecard
cd oss-scorecard
git clone --depth 1 https://example.com/org/project.git src
cd src
git switch -c issue-1842-repro
The contributor runs the smallest command that shows the bug. The note stores the command, the exit code, and key lines. Tokens, emails, and internal host names are redacted first.
set -o pipefail
./scripts/repro.sh > ../repro.md 2>&1
printf 'exit:%s\n' $? >> ../repro.md
A needed fixture is committed on the throwaway branch. A private database dump never enters the note. A maintainer should rerun the command on a normal laptop.
Step 2. Bound the patch
The fix starts only after the failing command is saved. The diff stays inside the path allowlist in scope.txt. Extra refactors move to a separate pull request.
The contributor writes scope.txt from git diff stat. An allowlist of paths is appended under that stat. The full diff is saved as patch.diff in the packet.
git diff --stat > ../scope.txt
printf '\nallow:\n' >> ../scope.txt
git diff --name-only >> ../scope.txt
git diff > ../patch.diff
A lockfile edit without a stated reason fails review. A hand edit of a generated file also fails review. Those two checks stay human after the score passes.
Step 3. Attach the test evidence
tests.md lists the fail command and the pass command. The same script name should appear on both lines. A renamed test with no behavior change does not count.
The note records the expected exit code for each run. One line names the assertion that holds after the patch. Timing claims stay out unless a local clock was recorded.
cat > ../tests.md << 'EOF'
fail: ./scripts/repro.sh
pass: ./scripts/repro.sh
expect_fail_exit: 1
expect_pass_exit: 0
assertion: the parser rejects an empty name field
EOF
Step 4. Write the rollback note
rollback.md tells a reviewer how to abandon the branch. It includes the branch name and any files the patch adds. It omits credentials for any shared staging host.
cat > ../rollback.md << 'EOF'
branch: issue-1842-repro
drop: git switch main && git branch -D issue-1842-repro
added_files: none
data_loss: none expected
EOF
Step 5. Run the local checker
The checker looks at presence, weight, and rough length. It does not execute the project tests by itself. A passing score only permits a later comment request.
The script below is proposed code for a local laptop. It has not been certified against a specific language runtime. The contributor should read it before trusting the exit code.
#!/usr/bin/env python3
'''Proposed local gate for an unexecuted template.'''
import pathlib
import sys
REQUIRED = {
'repro.md': 20,
'patch.diff': 40,
'tests.md': 20,
'scope.txt': 10,
'rollback.md': 10,
}
MIN_CHARS = 40
HOLD_BELOW = 80
def score_packet(root: pathlib.Path) -> int:
total = 0
for name, weight in REQUIRED.items():
path = root / name
if not path.is_file():
print('missing ' + name)
continue
text = path.read_text(encoding='utf-8').strip()
if len(text) < MIN_CHARS:
print('thin ' + name)
continue
total += weight
return total
def main() -> int:
root = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else '.')
total = score_packet(root)
print('score ' + str(total))
if total < HOLD_BELOW:
print('hold the model prompt')
return 1
print('scorecard is ready for a model pass')
return 0
if __name__ == '__main__':
raise SystemExit(main())
python3 gate_check.py ..
A score under eighty stops the workflow at once. The contributor repairs the thin note and reruns the checker. The threshold is not lowered merely to ship faster.
A missing ten-point file can still clear eighty. The illustrative output below shows that scoring hole. The contributor should not treat ninety as full evidence.
missing rollback.md
score 90
scorecard is ready for a model pass
Step 6. Send the card to a model
MonkeyCode enters only after the local gate has passed. Disclosure: This article was prepared as part of MonkeyCode's product outreach. The product is a review aid here, not the acceptance authority.
The operator states that free model access is available. The operator also states that a free server option exists. This draft does not treat either offer as permanent.
Current limits belong on the product page, not in this note. No token quota, model name, or machine size is assumed. Those details change, and stale numbers would mislead a team.
The free server fits when the maintainer host must stay clean. The upload should contain the five notes, not the whole clone. A smaller packet is easier to redact and easier to audit.
The model task should stay narrow on purpose. It scores each file against the written weights. It lists gaps, contradictions, and risky file paths.
It does not rewrite the patch as the first action. The prompt below is a template for that narrow task. The contributor pastes the five notes under that prompt.
Review the five scorecard files only.
Score each file from 0 to its weight.
Cite a line for every deducted point.
List contradictions between repro.md and tests.md.
Do not propose a new feature.
Stop if a secret or credential appears.
Step 7. Sort every model comment
A fixed decision table keeps the human owner visible. Each comment maps to exactly one local action. The model does not merge, rebase, or close the issue.
| Comment type | Local action | Model role |
|---|---|---|
| Missing command | Return to reproduction | Point at the empty field |
| Path outside allowlist | Split the diff | Name the extra path |
| Test rename only | Demand a behavior check | Flag the mismatch |
| Speculative refactor | Defer to another issue | Must not expand scope |
| Possible secret | Stop and redact | Must not repeat the secret |
| Logic doubt with a citation | Reproduce on the laptop | May suggest a check command |
The contributor applies the table before editing the commit text. A comment is accepted only after a local command confirms it. Comments that cite files outside the packet are discarded.
Limits of the gate
File length is only a weak proxy for truth. A long incorrect repro.md can still earn twenty points. The reviewer reruns the command instead of trusting the score.
The checker ignores comment quality and project license terms. Some projects forbid sending code to an external host. That policy is read before any free server upload.
Free model access can rate-limit, queue, or change without notice. A sprint plan should not depend on an unchecked offer. The same packet keeps a fully local review path.
This gate is a poor fit for urgent security patches. Those diffs may contain exploit detail that should stay private. A trusted maintainer channel replaces a general model host.
Generated files and binary assets need extra local rules. The sample checker does not parse diff headers. The team extends it before use on a release branch.
Who should skip this workflow
Teams skip it when the bug is not reproduced locally. Teams skip it when the license blocks external model review. Teams skip it when they need measured model accuracy.
Auth changes and credential grants also sit outside this gate. A scorecard cannot prove that an auth change is safe. That proof belongs in a dedicated security review.
New contributors may still use the file list as a writing aid. They ask a human maintainer which files may be shared. The model pass is optional, not a requirement to contribute.
Keep the merge with the maintainer
The useful order is reproduce, patch, test, then model review. The eighty-point checker enforces that order on disk. The human maintainer still owns the merge decision.
A redacted scorecard is the only packet that should leave the laptop. A contributor checks MonkeyCode's current free model and server offer.
Top comments (0)