-
Notifications
You must be signed in to change notification settings - Fork 1
ops(active-trajectory): binary direction split + NUL-safe parsing + lease-rejected-after-dry-run message + deferred follow-ups #836
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
9314d9f
e17c5ca
d2bf214
52d8e03
6d3d2b4
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 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -105,36 +105,36 @@ Best blade (Amara): *"Line-count dominance is a smoke detector. Content equivale | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| The drift trajectory is a metric; the GATE is the ledger. Hand-counts drift; ledgers from `git diff --numstat` don't. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| git diff --numstat origin/main..acehack/main | awk ' | ||||||||||||||||||||||||||||||
| # Binary files: numstat emits "-\t-\t<path>". They have no countable lines, | ||||||||||||||||||||||||||||||
| # but content can still be lost on hard-reset. Count them separately so | ||||||||||||||||||||||||||||||
| # they require explicit classification rather than being silently dropped. | ||||||||||||||||||||||||||||||
| $1 == "-" && $2 == "-" { | ||||||||||||||||||||||||||||||
| binary_files += 1 | ||||||||||||||||||||||||||||||
| next | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| add += $1; del += $2; files += 1 | ||||||||||||||||||||||||||||||
| if ($1 == 0) zero_files += 1 | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| END { | ||||||||||||||||||||||||||||||
| print "text_modified_files=" files | ||||||||||||||||||||||||||||||
| print "zero_acehack_only_files=" zero_files | ||||||||||||||||||||||||||||||
| print "potential_loss_lines=" add | ||||||||||||||||||||||||||||||
| print "lfg_newer_lines=" del | ||||||||||||||||||||||||||||||
| print "binary_modified_files=" (binary_files+0) | ||||||||||||||||||||||||||||||
| if ((binary_files+0) > 0) { | ||||||||||||||||||||||||||||||
| print "WARNING: binary files in diff need separate classification (lines uncountable)." | ||||||||||||||||||||||||||||||
| print "Run: git diff --name-status origin/main..acehack/main | awk '\''$1!~/^[D]$/'\'' | grep -F -f <(git diff --numstat origin/main..acehack/main | awk '\''$1==\"-\"{print $3}'\'')" | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ' | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
| The ledger is computed in two passes (text via `numstat`, binary direction via `name-status`). Per multi-AI review 2026-04-29T10:50Z: binary files emit `-/-` in `numstat` because lines aren't countable, but they CAN be erased on hard-reset, so they need direction classification — `acehack-only` vs `lfg-only` vs `modified-on-both`. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **The shell snippet below is ILLUSTRATIVE, NOT DURABLE.** Per multi-AI review 2026-04-29T11:05Z (Codex + Copilot 7-thread cluster + Amara): the inline awk/grep approach below has real NUL-safety bugs and is not portable across awk implementations: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - `awk $3` with default whitespace FS breaks on paths with spaces (need `FS='\t'`). | ||||||||||||||||||||||||||||||
| - `grep -Ff` reads newline-delimited patterns, not NUL-delimited (the `ORS="\0"` write doesn't compose with `grep -f`). | ||||||||||||||||||||||||||||||
| - `numstat -z` rename/copy records are `adds<TAB>dels<TAB>NUL old<NUL>new<NUL>`, not just one NUL-delimited row. | ||||||||||||||||||||||||||||||
| - `name-status -z` rename/copy rows are `status<NUL>old<NUL>new<NUL>` (3 fields), not `status<NUL>path<NUL>` (2 fields). The toggle parser desynchronizes. | ||||||||||||||||||||||||||||||
| - `RS='\0'` / `ORS='\0'` is a gawk extension; macOS BSD awk doesn't support it. | ||||||||||||||||||||||||||||||
| - `/tmp/binary-paths.nul` is a fixed path with no `mktemp` + `trap` cleanup; clobber-prone under concurrency. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| The durable home for the gate-runner is `tools/zero-zero-zero/check-gate.sh` (deferred follow-up, see "Deferred follow-ups" below). That script must be tested against fixtures including: paths with spaces, binary add, binary delete, binary modify, binary rename, binary copy, gawk-vs-BSD-awk. | ||||||||||||||||||||||||||||||
|
AceHack marked this conversation as resolved.
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| **Stopgap rule for this round**: if either `binary_acehack_only_files > 0` OR `binary_modified_or_renamed_files > 0` in this ledger (the two gate-relevant binary metrics emitted by the new script), do NOT rely on the inline snippet to classify direction. Use `git diff --name-status -z origin/main..acehack/main -- <path>` per binary file + direct `git show` evidence, manually, until the gate-runner script exists. (`binary_lfg_only_files > 0` is NOT a stopgap trigger — LFG-only files get added on hard-reset; no AceHack content lost.) | ||||||||||||||||||||||||||||||
|
AceHack marked this conversation as resolved.
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
Comment on lines
+121
to
+122
|
||||||||||||||||||||||||||||||
| **The inline shell snippet was REMOVED 2026-04-29T11:20Z** per multi-AI review packet (Codex P0 + Copilot 5-thread cluster + Amara). Even with an "illustrative" disclaimer, a broken parser left in the doc encourages copy-paste use of code that has 6 known bugs (awk default-FS path-with-spaces breakage, `grep -Ff` not NUL-aware, name-status `-z` rename-record desync, gawk-only `RS='\0'`, fixed `/tmp/binary-paths.nul` not race-safe, missing semantic LFG-only-vs-modified distinction). | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| The conceptual structure remains correct (three binary buckets — `acehack_only`, `lfg_only`, `modified_or_renamed`). The execution belongs in `tools/zero-zero-zero/check-gate.sh` as a real script with fixtures (paths with spaces, binary add/delete/modify/rename/copy, gawk-vs-BSD-awk portability, `mktemp` + `trap` cleanup). That script is the highest-priority deferred follow-up. | ||||||||||||||||||||||||||||||
|
Comment on lines
+119
to
+125
|
||||||||||||||||||||||||||||||
| The durable home for the gate-runner is `tools/zero-zero-zero/check-gate.sh` (deferred follow-up, see "Deferred follow-ups" below). That script must be tested against fixtures including: paths with spaces, binary add, binary delete, binary modify, binary rename, binary copy, gawk-vs-BSD-awk. | |
| **Stopgap rule for this round**: if either `binary_acehack_only_files > 0` OR `binary_modified_or_renamed_files > 0` in this ledger (the two gate-relevant binary metrics emitted by the new script), do NOT rely on the inline snippet to classify direction. Use `git diff --name-status -z origin/main..acehack/main -- <path>` per binary file + direct `git show` evidence, manually, until the gate-runner script exists. (`binary_lfg_only_files > 0` is NOT a stopgap trigger — LFG-only files get added on hard-reset; no AceHack content lost.) | |
| **The inline shell snippet was REMOVED 2026-04-29T11:20Z** per multi-AI review packet (Codex P0 + Copilot 5-thread cluster + Amara). Even with an "illustrative" disclaimer, a broken parser left in the doc encourages copy-paste use of code that has 6 known bugs (awk default-FS path-with-spaces breakage, `grep -Ff` not NUL-aware, name-status `-z` rename-record desync, gawk-only `RS='\0'`, fixed `/tmp/binary-paths.nul` not race-safe, missing semantic LFG-only-vs-modified distinction). | |
| The conceptual structure remains correct (three binary buckets — `acehack_only`, `lfg_only`, `modified_or_renamed`). The execution belongs in `tools/zero-zero-zero/check-gate.sh` as a real script with fixtures (paths with spaces, binary add/delete/modify/rename/copy, gawk-vs-BSD-awk portability, `mktemp` + `trap` cleanup). That script is the highest-priority deferred follow-up. | |
| The planned durable home for the gate-runner is `tools/zero-zero-zero/check-gate.sh`, but that path does not exist in the repository yet (deferred follow-up, see "Deferred follow-ups" below). Until it lands, the authoritative temporary instructions are the stopgap/manual-classification rules in this section. When created, that script must be tested against fixtures including: paths with spaces, binary add, binary delete, binary modify, binary rename, binary copy, gawk-vs-BSD-awk. | |
| **Stopgap rule for this round**: if either `binary_acehack_only_files > 0` OR `binary_modified_or_renamed_files > 0` in this ledger (the two gate-relevant binary metrics emitted by the new script), do NOT rely on the inline snippet to classify direction. Use `git diff --name-status -z origin/main..acehack/main -- <path>` per binary file + direct `git show` evidence, manually, until the gate-runner script exists. (`binary_lfg_only_files > 0` is NOT a stopgap trigger — LFG-only files get added on hard-reset; no AceHack content lost.) | |
| **The inline shell snippet was REMOVED 2026-04-29T11:20Z** per multi-AI review packet (Codex P0 + Copilot 5-thread cluster + Amara). Even with an "illustrative" disclaimer, a broken parser left in the doc encourages copy-paste use of code that has 6 known bugs (awk default-FS path-with-spaces breakage, `grep -Ff` not NUL-aware, name-status `-z` rename-record desync, gawk-only `RS='\0'`, fixed `/tmp/binary-paths.nul` not race-safe, missing semantic LFG-only-vs-modified distinction). | |
| The conceptual structure remains correct (three binary buckets — `acehack_only`, `lfg_only`, `modified_or_renamed`). The execution belongs in a real script with fixtures (paths with spaces, binary add/delete/modify/rename/copy, gawk-vs-BSD-awk portability, `mktemp` + `trap` cleanup). The planned file path for that script is `tools/zero-zero-zero/check-gate.sh`, but that file has not been created yet. That script remains the highest-priority deferred follow-up. |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bullet says the future gate-runner should emit “all 9 gate conditions”, but the gate list above currently contains 11 lines. Please reconcile the count (either adjust the bullet to match the current gate, or update the gate list/counting so it really is 9) to avoid cross-reference drift.
| - **Gate-runner script** (now bumped to highest priority among deferred follow-ups): build `tools/zero-zero-zero/check-gate.sh` that emits a machine-readable summary of all 9 gate conditions and fails closed. Replaces the prose ledger AND the illustrative inline snippet above with a verifiable-by-execution gate. Per multi-AI review 2026-04-29T11:05Z (Codex P1 + Copilot 5 threads + Amara): the durable script must be tested against fixtures: paths with spaces, binary add, binary delete, binary modify, binary rename, binary copy, gawk-vs-BSD-awk portability, `mktemp` + `trap` cleanup. Until the script lands, binary direction MUST be classified manually via `git diff --name-status -z` per file + direct `git show` evidence. Best blade (Amara): *"The binary hole is found. The gate condition is right. The parser still needs teeth."* | |
| - **Gate-runner script** (now bumped to highest priority among deferred follow-ups): build `tools/zero-zero-zero/check-gate.sh` that emits a machine-readable summary of all 11 gate conditions and fails closed. Replaces the prose ledger AND the illustrative inline snippet above with a verifiable-by-execution gate. Per multi-AI review 2026-04-29T11:05Z (Codex P1 + Copilot 5 threads + Amara): the durable script must be tested against fixtures: paths with spaces, binary add, binary delete, binary modify, binary rename, binary copy, gawk-vs-BSD-awk portability, `mktemp` + `trap` cleanup. Until the script lands, binary direction MUST be classified manually via `git diff --name-status -z` per file + direct `git show` evidence. Best blade (Amara): *"The binary hole is found. The gate condition is right. The parser still needs teeth."* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refers to a “shell snippet below” / “inline snippet”, but the snippet has been removed in this revision, so the wording is now misleading. Suggest rephrasing to refer to the previously-removed snippet (or delete the “below/inline” references) so readers don’t hunt for code that isn’t there.