mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-17 20:19:29 +00:00
pre-push(17.4): a file new in head is new, not comparison unknown
ChangeContext records the paths Git reports as added. An entailed, undischarged operation in an added file, with complete head evidence and no identical operation in any base answer, is classified new (file_added_in_head) instead of base_incomplete; admission accepts that reason as change evidence. Unpaired add/delete pushes and every other unknown comparison keep their vetoes. An engine finding whose novelty is established and whose only vetoes are capability vetoes is shown as an advisory engine finding, not an alert. Requirement 9.4. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
15999a09e1
commit
511de4b75f
@@ -111,6 +111,9 @@ class ChangeContext(Contract):
|
||||
# are not encoded or decoded by this field.
|
||||
path_encoding: Literal["text", "filesystem-bytes-hex"] = "text"
|
||||
line_correspondences: tuple[LineCorrespondence, ...] = ()
|
||||
# Paths Git reports as added (status A) in head, in this context's path encoding. A rename
|
||||
# target is not added. Only a lexical fact: novelty still needs complete head evidence.
|
||||
added_paths: tuple[str, ...] = ()
|
||||
|
||||
def decode_path(self, path: str) -> str:
|
||||
"""Return the filesystem spelling for matching ordinary question paths.
|
||||
@@ -130,6 +133,7 @@ class ChangeContext(Contract):
|
||||
*(s.path for s in self.spans),
|
||||
*(p for r in self.renames for p in (r.base_path, r.head_path)),
|
||||
*(p for m in self.line_correspondences for p in (m.base_path, m.head_path)),
|
||||
*self.added_paths,
|
||||
]
|
||||
for path in paths:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user