Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
4559643
fix(patch): preserve nested checkout snapshot context
mldangelo-oai Oct 5, 2026
78308b7
fix(patch): stage submodule updates through parent paths
mldangelo-oai Oct 5, 2026
7a5915c
fix(patch): integrate publication context with nested accounting
mldangelo-oai Oct 5, 2026
3bb2a3b
fix(patch): align nested accounting with publication context
mldangelo-oai Oct 5, 2026
c5e65d8
Merge commit '8060266120b8fc6aefebadc9aede8b8666636e68' into mdangelo…
mldangelo-oai Oct 5, 2026
32d35ee
fix(cli): capture publication paths before assessment
mldangelo-oai Oct 5, 2026
d0f6ca5
Merge commit 'c760a0d9d9c34485291fd37765821b9687bcdc84' into mdangelo…
mldangelo-oai Oct 5, 2026
b81102d
fix(patch): reuse captured paths for publication
mldangelo-oai Oct 5, 2026
fb218aa
Merge commit '9ec834bc202f6846bea5ee1a3f033fae2a6b7188' into mdangelo…
mldangelo-oai Oct 5, 2026
4c66c1d
Merge commit '5d2718c47a2e6fc0f32cfc99ba1274c943d249be' into mdangelo…
mldangelo-oai Oct 5, 2026
28ad53f
Merge remote-tracking branch 'origin/main' into HEAD
mldangelo-oai Oct 5, 2026
f41f8e0
Merge commit '003c5904501ebc4f6bf91fd8ffed3bc051383e85' into mdangelo…
mldangelo-oai Oct 5, 2026
be97862
test(patch): use Git path spelling for alias fixtures
mldangelo-oai Oct 5, 2026
5a0df91
Merge remote-tracking branch 'origin/main' into HEAD
mldangelo-oai Oct 5, 2026
467a08a
Merge commit '94f70c8a752812658b6df652962544f7f6241683' into mdangelo…
mldangelo-oai Oct 5, 2026
b007335
fix(patch): retain nested Git replacement settings
mldangelo-oai Oct 5, 2026
544b183
Merge commit 'refs/triage/pr1297-5a0df91' into mdangelo/codex/patch-s…
mldangelo-oai Oct 5, 2026
b583787
Merge upstream main into patch command context foundation
mldangelo-oai Oct 5, 2026
23c85b0
Merge commit 'b583787a5705414b7b48e4a383a760e45aecf104' into mdangelo…
mldangelo-oai Oct 5, 2026
a1ce0b8
fix(patch): preserve nested replacement namespaces
mldangelo-oai Oct 5, 2026
03851d1
Merge remote-tracking branch 'origin/mdangelo/codex/patch-publication…
mldangelo-oai Oct 5, 2026
ceb152b
Merge remote-tracking branch 'origin/main' into HEAD
mldangelo-oai Oct 5, 2026
bf1ef7e
Merge remote-tracking branch 'origin/mdangelo/codex/patch-snapshot-ac…
mldangelo-oai Oct 5, 2026
26b75db
fix(patch): preserve shared alternate objects for nested snapshots
mldangelo-oai Oct 5, 2026
e55cd05
Merge commit '21186d3bad436f8438f2012f0a698af6d46cf14d' into HEAD
mldangelo-oai Oct 5, 2026
a0c2f33
fix(cli): preserve relative nested object lookup context
mldangelo-oai Oct 5, 2026
7d381be
test(plugin): support isolated helper checks on Python 3.10
codex Oct 5, 2026
67d5949
fix(patch): preserve nested alternate object stores
mldangelo-oai Oct 5, 2026
1cfc149
Merge commit 'b1541d31e76c0f299848a58fc74a98885eb8694c' into HEAD
mldangelo-oai Oct 5, 2026
d737e0b
Merge main into PR branch
mldangelo-oai Oct 5, 2026
eb96b62
Merge concurrent snapshot accounting fixes
mldangelo-oai Oct 5, 2026
ea91f70
Merge commit '59fcb1e8ecbd61fe87238caa866f632100e790a1' into HEAD
mldangelo-oai Oct 5, 2026
8abde75
style(test): format combined Git alternate controls
mldangelo-oai Oct 5, 2026
cfe372b
Merge commit '3a01c3cfb10c6e1c5daf50720de048bac08c99cb' into HEAD
mldangelo-oai Oct 5, 2026
b511938
Merge reviewed parent history
mldangelo-oai Oct 5, 2026
439772d
Merge reviewed patch test inventory correction
mldangelo-oai Oct 6, 2026
41b749c
Merge latest main into PR branch
mldangelo-oai Oct 6, 2026
06f1317
Merge commit '41b749caafd6995564751ad6c2a2acbb60046060' into mdangelo…
mldangelo-oai Oct 6, 2026
c6e12f3
Merge commit '86853ea258fcf7b4d4db9d5408bd236b3c5ecb8c' into mdangelo…
mldangelo-oai Oct 6, 2026
ea4dc24
Merge commit 'refs/codex/pr-repair/1297-transition-head' into HEAD
mldangelo-oai Oct 6, 2026
e4e3973
Merge commit 'cfba7201ef3b8af0baa717428ec748043f7dec37' into HEAD
mldangelo-oai Oct 6, 2026
ac20c90
Merge commit 'refs/codex/pr-repair/1297-current-remote' into HEAD
mldangelo-oai Oct 6, 2026
77bfaaf
Merge commit '94750c397c39bc4e7cb6d554cde784f643d246dc' into HEAD
mldangelo-oai Oct 6, 2026
6b6fd0e
Merge latest main into PR branch
mldangelo-oai Oct 6, 2026
bae44d8
Merge latest main into PR branch
mldangelo-oai Oct 6, 2026
44782e4
Keep configured object pools readable in nested patch snapshots
mldangelo-oai Oct 6, 2026
24613d1
Merge commit '91b0a3b44105dcfdc7155568b94c3d9cdd7c03cd'; commit 'refs…
mldangelo-oai Oct 6, 2026
de5d459
Compare preserved Git index bytes with stable hashes
mldangelo-oai Oct 6, 2026
012a9c7
Correct primary object pool index assertions
mldangelo-oai Oct 6, 2026
927b67e
Merge latest main into PR branch
mldangelo-oai Oct 6, 2026
d9a9a8c
Preserve configured storage for nested checkouts without local objects
mldangelo-oai Oct 6, 2026
681c948
Merge commit '05591341a5adbc313bc1efed8dfb399b268984d4'; commit 'refs…
mldangelo-oai Oct 6, 2026
3f5a61c
Merge commit 'c52366068c9a1e5ba5b026a7bfc70eb546033299' into HEAD
mldangelo-oai Oct 6, 2026
b0f6166
fix(sdk): retain nested Git object storage and invocation context
mldangelo-oai Oct 6, 2026
d2b3dcc
Merge commit 'c15f8effa' into HEAD
mldangelo-oai Oct 6, 2026
7969176
Merge commit '96a5dc57cd5355eddd2d38b84b6f5c3b20d176eb' into HEAD
mldangelo-oai Oct 6, 2026
898f48e
Capture alternate object paths before patch changes cwd
mldangelo-oai Oct 6, 2026
9deb3bc
Merge commit 'refs/codex/author-1297-current-main' into HEAD
mldangelo-oai Oct 6, 2026
3c2917b
fix(ci): preserve the existing Markdown formatting scope
mldangelo-oai Oct 6, 2026
48c8f71
Use existing environment lookup for alternate paths
mldangelo-oai Oct 6, 2026
bdcd0d3
Merge commit 'refs/codex/pr-repair/1296/shared-candidate-current-main…
mldangelo-oai Oct 6, 2026
3af9af7
fix(ci): retain current main Markdown QA scope
mldangelo-oai Oct 6, 2026
8f71dfa
fix(patch): account for newly initialized submodule edits
mldangelo-oai Oct 6, 2026
67d8da4
Merge commit '4c0b5e7168fb80d04bdf125badfcea957f836d0a' into HEAD
mldangelo-oai Oct 6, 2026
efe47be
Merge publication fixes into snapshot accounting
mldangelo-oai Oct 6, 2026
c3cc4c3
Merge commit 'ccbcfbcfd2e1882c219e3122df61892d796cdeec' into mdangelo…
mldangelo-oai Oct 6, 2026
fb08e12
fix(patch): compare newly initialized children with their HEAD
mldangelo-oai Oct 6, 2026
41eff7a
Merge commit 'f8e1ddb806bfadc34ac0cee576f75880adcee154' into mdangelo…
mldangelo-oai Oct 6, 2026
7dd65be
fix(patch): separate snapshot revisions from file paths
mldangelo-oai Oct 6, 2026
d7333c0
fix(patch): retain outer executable boundary for nested validation
mldangelo-oai Oct 6, 2026
41aac82
fix(patch): compare replacement children against their current baseline
mldangelo-oai Oct 6, 2026
5d384b9
Merge updated publication dependency and simplify snapshot accounting
mldangelo-oai Oct 6, 2026
4cc1564
fix(workbench): preserve previews for padded hunk counts
mldangelo-oai Oct 6, 2026
0530df3
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
112204e
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
2fc5c05
Merge publication parent and retain recursive patch accounting
mldangelo-oai Oct 6, 2026
f47aa31
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
14720ab
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
30fb2f0
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
ab4583c
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
ce8c926
Merge current patch preview changes and preserve publication context
mldangelo-oai Oct 6, 2026
a78ca48
Merge commit '35a1d2962459d94e8be232c025ae7094068a00f2' into HEAD
mldangelo-oai Oct 6, 2026
0aeec2b
fix(patch): preserve alternate paths when invocation directory changes
mldangelo-oai Oct 6, 2026
c8bb82e
Preserve configured parent object alternates for nested snapshots
mldangelo-oai Oct 6, 2026
aa1aeae
Merge patch publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
30a56dd
Merge publication updates into patch preview fixes
mldangelo-oai Oct 6, 2026
8e27c37
Merge patch preview history
mldangelo-oai Oct 6, 2026
8e9e370
Merge publication fixes into patch preview updates
mldangelo-oai Oct 6, 2026
1ff52fc
Merge publication fixes into patch preview updates
mldangelo-oai Oct 7, 2026
06bd3ce
Merge publication fixes into patch preview updates
mldangelo-oai Oct 7, 2026
6047107
Merge publication fixes into patch preview updates
mldangelo-oai Oct 7, 2026
ec3739f
Merge publication fixes into patch preview updates
mldangelo-oai Oct 7, 2026
42bccc6
Merge portable Git fixes into patch preview updates
mldangelo-oai Oct 7, 2026
4b229a9
Merge caller discovery fix into patch preview updates
mldangelo-oai Oct 7, 2026
1498e97
Merge selected directory type check into patch preview updates
mldangelo-oai Oct 7, 2026
0105498
Merge commit 'd6da43e169c7c62615ecd88f1d783543487240f1' into HEAD
mldangelo-oai Oct 7, 2026
b57a95d
Merge commit 'b50de7e954d01578753dcd43d7a5b50e2a625226' into mdangelo…
mldangelo-oai Oct 7, 2026
9c24a6b
Merge commit '00a52546d8c83743a5b521c72719e514f72ce78a' into mdangelo…
mldangelo-oai Oct 7, 2026
8ee6d87
Merge patch publication fixes
mldangelo-oai Oct 7, 2026
d6b1b45
Merge Windows workflow timeout adjustment
mldangelo-oai Oct 7, 2026
1de447e
Merge Windows parallel workflow allowance
mldangelo-oai Oct 7, 2026
6f4fe20
Merge repository command test typing correction
mldangelo-oai Oct 7, 2026
8110998
Merge commit '068da50d62d2baa77e7106ea0e97734302fbb496' into mdangelo…
mldangelo-oai Oct 7, 2026
a80989e
Merge current publication base and retain patch snapshot accounting
mldangelo-oai Oct 10, 2026
37e8233
Merge reviewed publication fixture followup
mldangelo-oai Oct 10, 2026
3985ac8
Merge reviewed publication controls into snapshot accounting
mldangelo-oai Oct 10, 2026
2900c91
Integrate reviewed Git discovery and configuration bindings
mldangelo-oai Oct 10, 2026
6cbc3b9
Integrate reviewed nested worktree binding fixes
mldangelo-oai Oct 10, 2026
d919b76
Integrate reviewed side-effect-free Git discovery
mldangelo-oai Oct 10, 2026
ebbf567
Merge commit '14624cb395812c95018c4088a0b15703063b3273' into HEAD
mldangelo-oai Oct 10, 2026
620750e
Merge commit 'fb5455ad95b673430f7ef3fad4675e78c222ae46' into HEAD
mldangelo-oai Oct 10, 2026
c9f5c2c
Merge parent snapshot discovery and configuration fixes
mldangelo-oai Oct 10, 2026
6f57853
Merge parent native hook selection fixes
mldangelo-oai Oct 10, 2026
3d67174
Merge ordinary directory compatibility into patch accounting
mldangelo-oai Oct 10, 2026
a58cea4
Merge effective Git configuration fixes into patch accounting
mldangelo-oai Oct 10, 2026
e8456ae
Merge isolated patch permissions into snapshot accounting
mldangelo-oai Oct 10, 2026
c0b6654
Merge native platform fixes into patch snapshot accounting
mldangelo-oai Oct 10, 2026
03620e3
Merge platform test job budget correction
mldangelo-oai Oct 10, 2026
e894c98
Merge Windows publication fixture and timing corrections
mldangelo-oai Oct 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/codex-security/scripts/workbench_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,8 @@ def patch_artifact_preview(
hunk_lines = 0
elif match := re.match(rb"@@ -\d+(?:,(\d+))? \+\d+(?:,(\d+))? @@", chunk):
hunk_lines = sum(
int(count) if count is not None else 1 for count in match.groups()
int(count.lstrip(b"0") or b"0") if count is not None else 1
for count in match.groups()
)
elif hunk_lines == 0 and chunk.startswith(b"+++ "):
new_headers += 1
Expand Down
65 changes: 63 additions & 2 deletions plugins/codex-security/tests/test_workbench_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3356,7 +3356,7 @@ def test_patch_statistics_count_blank_context_lines(tmp_path: Path, blank_contex
assert stats == {"additions": 2, "deletions": 2, "fileCount": 2, "previewTruncated": False}


def test_patch_preview_tolerates_integer_conversion_failure(tmp_path: Path) -> None:
def test_patch_preview_accepts_padded_hunk_counts(tmp_path: Path) -> None:
namespace = runpy.run_path(str(SCRIPT))
count = b"0" * 5000 + b"1"
patch = (
Expand All @@ -3368,7 +3368,68 @@ def test_patch_preview_tolerates_integer_conversion_failure(tmp_path: Path) -> N
subprocess.run(["git", "apply", "--check", "patch.diff"], cwd=tmp_path, check=True)
assert namespace["patch_artifact_preview"](
tmp_path, "patch.diff", f"sha256:{hashlib.sha256(patch).hexdigest()}"
) == (None, None)
) == (
patch.decode(),
{"additions": 1, "deletions": 1, "fileCount": 1, "previewTruncated": False},
)


@pytest.mark.parametrize("padded", [False, True])
def test_saved_scan_remains_readable_with_large_hunk_counts(tmp_path: Path, padded: bool) -> None:
state_dir = tmp_path / "state"
target = tmp_path / "target"
target.mkdir()
(target / "source.txt").write_text("original\n")
scan_id, scan_dir = start_saved_scan(state_dir, target, tmp_path / "scans")
write_completed_contract(scan_dir, scan_id, target, relative_path="source.txt")
completed = run_workbench(state_dir, "complete-scan", "--scan-id", scan_id)["scan"]
occurrence_id = completed["findings"][0]["occurrenceId"]
count = "0" * 4300 + "1" if padded else "9" * 4301
patch = f"--- a/source.txt\n+++ b/source.txt\n@@ -1,{count} +1,{count} @@\n-original\n+fixed\n"
patch_path = scan_dir / "remediation.patch"
patch_path.write_text(patch)
if padded:
subprocess.run(["git", "apply", "--check", str(patch_path)], cwd=target, check=True)
request_id = str(uuid.uuid4())
token = str(uuid.uuid4())
run_workbench(
state_dir,
"request-finding-remediation",
"--occurrence-id",
occurrence_id,
"--request-id",
request_id,
"--action-token",
token,
)
run_workbench(
state_dir,
"set-finding-remediation",
"--occurrence-id",
occurrence_id,
"--request-id",
request_id,
"--action-token",
token,
"--expected-version",
"1",
"--state",
"generated",
"--patch-path",
patch_path.name,
"--patch-digest",
f"sha256:{hashlib.sha256(patch_path.read_bytes()).hexdigest()}",
)
saved = run_workbench(state_dir, "get-scan", "--scan-id", scan_id)["scan"]
remediation = saved["findings"][0]["remediationState"]
assert remediation["state"] == "generated"
if padded:
assert remediation["patch"] == patch_path.read_bytes().decode()
assert remediation["patchStats"]["additions"] == 1
assert remediation["patchStats"]["deletions"] == 1
else:
assert remediation["patch"] is None
assert remediation["patchStats"] is None


@pytest.mark.cross_platform
Expand Down
Loading