Skip to content

Add local submission history log to guard daily submission slots - #17

Merged
alessiodevoto merged 3 commits into
NVIDIA:mainfrom
k66inthesky:k66/submission-history-log
Aug 4, 2026
Merged

Add local submission history log to guard daily submission slots#17
alessiodevoto merged 3 commits into
NVIDIA:mainfrom
k66inthesky:k66/submission-history-log

Conversation

@k66inthesky

Copy link
Copy Markdown
Contributor

Why

submission.md already warns "never rerun this script blindly — each successful submission call can spend one competition submission slot" and the skill's troubleshooting guidance tells agents to read existing logs before retrying, but nothing writes a structured log. When a submit_kernel.py run crashes mid-poll or its terminal output is gone, an agent has no local way to tell whether the daily slot was already spent, so the safe-retry guidance can't actually be followed.

This complements submission_quota.py (#9): quota asks Kaggle how many slots remain today; the history log shows what this workspace already submitted and how it scored, with no API call.

What

  • submit_kernel.py appends each submission attempt (accepted/failed, with the error text) and each finished evaluation (complete/error/timeout, with the public score) to data/submissions.jsonl — the same project-root data/ convention as the kernel and discussion caches. Logging is best-effort and can never break an in-flight submission.
  • New scripts/submission_log.py holds the append/read/merge logic as pure functions; evaluation events fold into their submission attempt by the same (competition, message) key submit_kernel.py uses to match submissions on Kaggle.
  • New scripts/submission_history.py renders the merged history (Rich table, or --as-json), filterable by competition slug/URL, kernel ref, and limit. Local-only: no Kaggle API calls, no credentials.
  • submission.md documents the log, the history command, and points the "never rerun blindly" guidance at it.

Testing

  • 13 new offline unit tests in tests/test_submission_history.py: append/read roundtrip, malformed-line tolerance, merge semantics (including reused messages), filtering/limits, the submit_kernel.py hooks via a fake API object, and the CLI's JSON/empty-log output.
  • uv run pytest: 55 passed, 12 skipped (baseline before this change: 42 passed, 12 skipped). No live-API tests needed.
  • claude plugin validate .: passed.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 3, 2026 23:05

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 adds a local, append-only submission history log to the Kaggle skill so reruns can determine what has already been submitted/evaluated (and with what score) even if a prior submit_kernel.py run crashed or lost terminal output.

Changes:

  • Add submission_log.py to append/read a JSONL log and merge submission+evaluation events into submission-attempt rows.
  • Hook submit_kernel.py to log submission attempts (accepted/failed) and evaluation outcomes (complete/error/timeout).
  • Add submission_history.py CLI and update submission.md, plus offline unit tests covering log behavior and CLI output.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_submission_history.py Adds offline unit tests for logging, merging, filtering/limits, and CLI JSON/empty-log behavior.
skills/nvidia-kaggle-skill/submission.md Documents the new local submission history log and the submission_history.py command.
skills/nvidia-kaggle-skill/scripts/submit_kernel.py Adds best-effort logging hooks for submission attempts and evaluation outcomes.
skills/nvidia-kaggle-skill/scripts/submission_log.py Introduces the JSONL append/read utilities and event-to-attempt merge logic.
skills/nvidia-kaggle-skill/scripts/submission_history.py Adds a Rich/JSON CLI to render merged submission history from the local log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/nvidia-kaggle-skill/scripts/submission_log.py
Comment thread skills/nvidia-kaggle-skill/scripts/submission_log.py
Comment thread skills/nvidia-kaggle-skill/scripts/submission_log.py
Comment thread skills/nvidia-kaggle-skill/scripts/submission_history.py Outdated
@alessiodevoto

Copy link
Copy Markdown
Collaborator

Hi @k66inthesky thanks for opening this PR! The PR looks nice overall, I left a couple of small comments 🙂

@k66inthesky

Copy link
Copy Markdown
Contributor Author

@alessiodevoto Both comments are addressed in 04f3941 — thanks for the catch!

  • submission_attempts() now skips attempts with a falsy accepted, with a regression test for accepted submit → failed retry (same message) → evaluation.
  • --as-json now always emits valid JSON ([] for an empty log), also covered by a test.

Local tests are fully passing:

$ pytest tests/test_submission_history.py -q
18 passed in 0.09s

$ pytest tests/ -q
60 passed, 12 skipped in 2.12s

alessiodevoto
alessiodevoto previously approved these changes Jul 9, 2026
@alessiodevoto
alessiodevoto self-requested a review July 9, 2026 10:16
@alessiodevoto
alessiodevoto dismissed their stale review July 9, 2026 10:20

new DCO rules

@alessiodevoto

Copy link
Copy Markdown
Collaborator

Hi @k66inthesky, thanks for fixing! One final thing before we can merge, could you rebase on main and follow the contributing guidelines (sorry we just updated them) ? You should:

  • amend your commits
  • add the required headers in python files

Then we'll be able to merge 🙂 . Thank you!

k66inthesky and others added 3 commits July 11, 2026 19:44
submit_kernel.py now appends every submission attempt and finished
evaluation to data/submissions.jsonl, and a new submission_history.py
renders the merged history. Before rerunning a submission, a workflow
can check what previous runs already submitted — even when the run
crashed mid-poll or its terminal output is gone — instead of blindly
spending another daily submission slot. Logging is best-effort and can
never break an in-flight submission; the history command is local-only
and needs no Kaggle credentials.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: k66inthesky <k66inthesky@gmail.com>
…gged_at

A timeout is not a terminal Kaggle state — evaluation keeps running after
we stop polling — so a later evaluation event for the same (competition,
message) may now overwrite a prior timeout in the merged history. And
logged_at is now set after the caller's record fields, so the log's own
timestamp can never be overridden.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: k66inthesky <k66inthesky@gmail.com>
- submission_attempts() no longer folds an evaluation into a submit
  attempt Kaggle rejected, so a failed retry reusing the same message
  cannot swallow the score of the earlier accepted submission.
- submission_history --as-json now always emits valid JSON, printing []
  for an empty log instead of a Rich warning.
- Add regression tests for both.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: k66inthesky <k66inthesky@gmail.com>
@k66inthesky
k66inthesky force-pushed the k66/submission-history-log branch from 04f3941 to a09bab0 Compare July 11, 2026 12:05
@k66inthesky

Copy link
Copy Markdown
Contributor Author

@alessiodevoto Done! Rebased onto latest main — the branch is now 3 clean commits, all signed off (DCO check is green), and the new Python files have the required SPDX headers. Local runs of the license check and uv run pytest (63 passed, 12 skipped) are both passing. Ready for another look 🙂

Hi @k66inthesky, thanks for fixing! One final thing before we can merge, could you rebase on main and follow the contributing guidelines (sorry we just updated them) ? You should:

  • amend your commits
  • add the required headers in python files

Then we'll be able to merge 🙂 . Thank you!

@alessiodevoto alessiodevoto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @k66inthesky sorry I missed this one! Thanks for implementing the changes, just reviewed LGTM! Merging 🙂

@alessiodevoto
alessiodevoto merged commit 2b78cf2 into NVIDIA:main Aug 4, 2026
3 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.

3 participants