Skip to content

fix: isolate scoped manifest staging - #183

Merged
junior-ricon merged 3 commits into
junior/obfuscate-batchingfrom
johnson/fix-scoped-manifest-staging
Jul 27, 2026
Merged

fix: isolate scoped manifest staging#183
junior-ricon merged 3 commits into
junior/obfuscate-batchingfrom
johnson/fix-scoped-manifest-staging

Conversation

@johnson-ricon

Copy link
Copy Markdown
Contributor

Finding

Scoped obfuscation decided against HEAD and staged the whole working manifest whenever one scoped mapping was new. That leaked unrelated unstaged manifest mappings into the index. Reconstructing from HEAD alone also drops manifest deletions already selected by notes stage --all.

Fix

  • snapshot the indexed manifest once for scoped decisions
  • construct the staged manifest from the existing index plus only mappings renamed by this operation
  • write that filtered manifest through Git's path-aware clean filters without replacing the full working manifest
  • cover isolation of an unrelated unstaged mapping

Validation

  • mise run test test/obfuscate.bats (83 passed)
  • focused notes commit --all regression
  • mise run test (409 BATS plus 9 Python passed)
  • all 8 configured codebase lint rules
  • README, Bash syntax, and git diff --check
  • Fold pre-commit OK; pre-push had only expected new-branch and inherited unsigned-history warnings

One initial full-suite run exposed the notes commit --all index-basis regression. The fix now uses the indexed manifest; the focused regression and complete rerun pass.

@junior-ricon

Copy link
Copy Markdown
Contributor

@johnson-ricon Thanks for fixing scoped manifest staging around the index. During follow-up review I found one remaining invariant: operation mappings were appended after indexed rows, while the working manifest is canonically sorted by readable name. An early-sorting new mapping could therefore leave an order-only hidden divergence after commit.

Under Or's approval I pushed signed commit 9d83656766f488135c22211d83e5270fc8bb19d4 directly to this fix-it branch. It canonically sorts the staged index/operation union and strengthens the regression with an early alpha.md mapping, a later indexed gamma.txt mapping, and an unrelated unstaged beta.md mapping; after commit, removing only the intentional unrelated row leaves no manifest diff. Focused 83 tests, full 409 BATS plus 9 Python tests, all eight lints, README, syntax, diff, and preflight checks pass locally. I'll wait for refreshed hosted checks before merging this fix-it.

@junior-ricon

Copy link
Copy Markdown
Contributor

Follow-up: after #182 merged into the shared base as 816a384058a211e091086adb1274e320e0e47391, this branch conflicted in the adjacent regressions and generated test badge. I merged that exact base, preserved all collision and canonical-order cases, regenerated the 420-test badge, and reran the combined focused 86-test suite successfully. The resulting signed merge head is ff15135aad05674a409c7f676f4a0e5705f51d61; refreshed hosted checks are the remaining gate before #183 merges.

@junior-ricon
junior-ricon merged commit 51b5981 into junior/obfuscate-batching Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants