fix(deploy): ignore Python bytecode downstream - #435
Conversation
|
Thank you for this — and welcome. This is a real defect, the diagnosis in #430 is accurate, and you picked the right shape of fix: additive, no design question attached, with a regression test alongside it. Your evidence reproduces on my machine too. There is one thing to change before it can merge, and it is not something your evidence could have surfaced. The managed ignore block is written in two places
skip {
if ($0 == "" || ($0 in managed) || $0 ~ /^#/) { next }
skip = 0
}
ReproductionThree real
At deploy #3 the adopter's Suggested changeTwo lines, next to their sibling in the same table: managed["*.acx-local"] = 1
+ managed["__pycache__/"] = 1
+ managed["*.pyc"] = 1This is the same two-place edit #173 made when Why your green run did not catch itPlease don't read the above as a process failing on your side — the repo did not give you a way to see it:
If you are willing, a test that runs One thing you can skip#430 asks for parity in the PowerShell path. That is already satisfied: CI has not run yet because workflow runs from a fork need maintainer approval. I have read the full diff (16 lines across two files, nothing else in it), so there is no hold-up on that side. Thanks again for taking the time to send this properly — issue reference, classification, evidence and a test. It is a genuinely good first contribution and I would like to merge it. |
|
Quick follow-up: I approved the workflow runs, and CI came back fully green — 18 passed, 1 skipped, 0 failed, including Please don't read that as "ready to merge" — it is the coverage gap from my previous comment, now demonstrated rather than argued. Eighteen green checks, and not one of them deploys twice, so the I mention it because a green CI on your own PR is a reasonable thing to trust, and here it would have misled you through no fault of yours. |
…y idempotent (KbWen#430) Completes KbWen#435. The submitted patterns were not in the managed[] strip table, so every re-deploy left the old block outside the markers and the adopter's .gitignore grew by 14 lines (measured 33 -> 47 -> 61). - Emit `.agentcortex/**/__pycache__/` instead of repo-wide `__pycache__/` and `*.pyc`: all deployed .py files live under .agentcortex/, and a repo-wide rule would also ignore the adopter's own bytecode. - Add the entry to managed[] so the block is replaced, not duplicated. - Tests: every emitted entry must be strippable; every deployed .py must sit under the scoped pattern; a real double deploy must leave .gitignore byte-identical, keep adopter rules, ignore framework bytecode and not the adopter's. - Backlog KbWen#191 -> In Progress. Co-authored-by: zerone0x <39543393+zerone0x@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…host git config (KbWen#430) Review follow-ups on KbWen#435: - An older deploy.sh stops stripping at the first block entry it does not know, leaving every later block line outside the markers. With the new entry mid-block, alternating main/branch deploys grew .gitignore by 10-13 lines per round (measured 36 -> 46 -> 49 -> 59 -> 62 -> 72). Placed last, a downgrade leaves one stray line; alternation adds 3 lines per round (36 -> 36 -> 39 -> 39 -> 42). The managed[] table now says to add future entries last. - The double-deploy test ran `git check-ignore` under the developer's global excludes file, so a machine ignoring __pycache__/ globally failed it on correct code. It now passes an empty core.excludesFile. Co-authored-by: zerone0x <39543393+zerone0x@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…Wen#430) `Path.write_text(newline=)` is 3.10+; test_write_text_newline_ratchet flagged it in the full suite. Write the adopter fixture as bytes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SSoT Ship History entry (rotated at cap 10), heartbeat 170 -> 171, backlog KbWen#191 Shipped with the row rewritten to what actually shipped, Work Log archived and chained into INDEX.jsonl. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Taking this over to land it@zerone0x, there has been no update for a week since the review. As offered then, I have finished the change on your branch rather than letting it stall. Your commit stays in the history, and the new commit credits you as co-author. Thank you again: the issue reference, classification and test made this easy to pick up. Nothing was force-pushed. I merged What changed from the submitted version, and why
EvidenceThree real
Mutation checks (each invariant broken on purpose, then restored byte-identical):
An independent review pass found two more issues. I reproduced both before fixing them:
Also run against the real downstream flows, each compared with
Validator tallies are unchanged in every case. Test runs:
For existing adoptersAnyone who already committed git rm -r --cached .agentcortex/tools/__pycache__Closes #430. |
Maintainer update (2026-09-14)
Taken over after the review went unanswered for a week. The comment below has the rationale and evidence. The PR now does something different from the original summary further down:
.agentcortex/**/__pycache__/, to the managed downstream.gitignoreblock, instead of repo-wide__pycache__/+*.pyc. The line is registered inmanaged[]and written last in the block..pymust sit under the scoped pattern.gitignorebyte-identical and must not ignore the adopter's own bytecodeCloses #430
Original submission:
Summary
__pycache__/and*.pycto the managed downstream.gitignoredefaults written bydeploy.sh.Classification
Evidence
Checklist
validate.shpasses locally