Skip to content

fix(simple): validate chain in stamp.py and add unit test suite (#314) - #323

Merged
ryoari merged 2 commits into
AOSSIE-Org:mainfrom
tejasprasad2008-afk:fix/stamp-validate-chain-entries
Nov 15, 2026
Merged

ryoari merged 2 commits into
AOSSIE-Org:mainfrom
tejasprasad2008-afk:fix/stamp-validate-chain-entries

Conversation

@tejasprasad2008-afk

Copy link
Copy Markdown
Contributor

Description

Fixes #314. stamp.py --check previously exited 0 on an empty chain.jsonl because the verification loop ran 0 times, and crashed with an unhandled JSONDecodeError traceback on corrupted JSON lines.

Changes

  • Aligns chain parsing in stamp.py with ovl.py:read_chain (clean exit on missing file, line-numbered JSONDecodeError, and fail-closed check on empty chains).
  • Introduces tests/simple/test_stamp.py with unit tests for empty, malformed, and valid chain files.

Reproduction & Verification

Reproduction Before Fix

Verification After Fix

  • pytest tests/simple/test_stamp.py passes (4 passed in 0.25s).
  • Full test suite passes: pytest tests/ (108 passed, 1 skipped).

AI Usage Disclosure

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.
  • I have used the following AI models and tools: Gemini for code review and test suite formulation.

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0f69273 and d5437cb.

Files selected for processing: 2

  • simple/stamp.py
  • tests/simple/test_stamp.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ryoari
ryoari marked this pull request as ready for review November 15, 2026 00:46

@ryoari ryoari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this fixes #314: stamp.py --check now fails on an empty chain instead of passing with nothing checked, and a damaged line gives the same message as ovl.py verify. Merging.

@ryoari
ryoari merged commit d9531ad into AOSSIE-Org:main Nov 15, 2026
6 checks passed
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.

[BUG]: stamp.py --check passes on an empty chain.jsonl, and stamp.py gives a raw traceback on a damaged one

2 participants