Repository navigation
Verify saved stage input keys before accepting check receipts #1308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -303,6 +303,15 @@ def settings_fingerprint(config: Config, worktree: Path, *, base: str | None = N | |
| return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest() | ||
|
|
||
|
|
||
| def receipt_inputs_match(config: Config, worktree: Path, report: CheckReport) -> bool: | ||
| try: | ||
| base = _check_base(config, worktree) | ||
| return all(result.input_key == _input_key(config, worktree, result.command, base) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. important: Treating None == None as a match brings back the stale-receipt bug for declared stages whose key cannot be computed This delta removes the
In any of these cases the receipt stops tracking the stage's regular files. Example: with The new test Smallest fix: keep reuse eligibility separate from receipt verification. Reuse can stay disabled when a key is |
||
| for result in report.results) | ||
| except (SandboxUnavailable, OSError, _proc.ProcTimeout, _proc.ToolMissing): | ||
| return False | ||
|
|
||
|
|
||
| def _input_key(config: Config, worktree: Path, command: str, base: str) -> str | None: | ||
| if not base or (command not in config.inputs and "." not in config.inputs.get("*", ())): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Inlined predicate drops a named helper Removing |
||
| return None | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.