Repository navigation
Closed
Labels
app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)Package/app: opencode-config-normalize (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/blockedQueue or user escalation stateQueue or user escalation statesource/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/blockedQueue or user escalation stateQueue or user escalation statestatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Problem
When pkgs/opencode-config-normalize/normalize.sh repairs a config, its atomic temp-file replacement preserves the POSIX mode bits but drops file-specific extended ACL entries. A named user/group ACL on the original config is silently lost when the temp inode replaces it. If the directory has a default ACL, the new temp may inherit that default, but that is not the original file's ACL and does not preserve file-specific entries.
Evidence (reproduced on current main)
normalize.sh:55captures onlystat.S_IMODE(path.stat().st_mode).normalize.sh:685-700writes to atempfile.mkstempsibling, applies onlyos.fchmod(..., original_mode), fsyncs, thentmp.replace(path).- Fixture: mode
0640, ACLuser:1001:r--andmask::r--; after a real repair, mode remains640but the named user ACL and ACL mask are gone. The repaired JSON content is correct. - A second fixture confirmed a file-specific
user:1002:---ACL disappears even when the directory supplies a default ACL; entries that reappear came from default-ACL inheritance on the new temp inode, not preservation of the original. bash pkgs/opencode-config-normalize/normalize_test.shpasses all 27 cases, includingmode-preservedandsymlink-refused; there is no ACL assertion.
Why it matters
A config may use an ACL to grant or restrict access for a specific local account independently of its mode bits. A successful normalization then silently changes that access policy. The file's content and 0600/0640 mode can look correct while its ACL has changed.
Acceptance criteria
- A fixture with a file-specific named POSIX ACL is repaired and retains the same ACL entries/mask afterward (where ACL tooling/filesystem support is available; otherwise the test reports an explicit skip).
- Default-directory ACL inheritance is not mistaken for preserving the original file ACL.
- ACL preservation behavior is documented, including behavior on platforms/filesystems without supported ACL operations.
- All existing
normalize_test.shcases still pass.
Related and deduplication
- opencode-config-normalize: the repair write discards the config's permissions (0600 -> 0644) and silently severs a symlinked config — tmp+replace with no mode copy and no symlink handling (normalize.sh:126-128) #3180 (closed) fixed mode-bit loss and symlink replacement in this same write path. Its body, acceptance criteria, triage and merged fix cover
stat.S_IMODE/fchmodand symlink refusal, but do not mention ACLs or extended attributes; this is the remaining metadata gap, not a duplicate of those fixes. - Searched all-state issues for
opencode-config-normalizeand open PRs for the same component; no ACL-preservation issue or implementation was found. A search for ACL in open issue titles/body yielded no matching ACL-handling issue.
Metadata
Metadata
Assignees
Labels
app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)Package/app: opencode-config-normalize (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)queue/blockedQueue or user escalation stateQueue or user escalation statesource/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus/blockedQueue or user escalation stateQueue or user escalation statestatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
developing-today commentedon Nov 18, 2026
CODE-4374
dezren39 commentedon Nov 18, 2026
agent-note:v1
state: picked up
task: 20822
issue: #11836
lane: oc-code-01 (OpenChamber scheduled lane, repo-worker-code)
at: 2026-11-18T17:38Z
Claimed triage task 20822; first checkpoint includes
origin: openchamber-scheduled-lane. Fresh GitHub verification confirms #11836 remains OPEN, assigned to Drew, and has no held/user-owned/do-not-merge/do-not-auto-edit labels. The current atomic write path captures mode bits and fchmods a new inode before replace.setfaclandgetfaclare installed and/homeis ext4, so I will try a focused reproduction in an isolated temporary directory; no code changes are in scope.dezren39 commentedon Nov 18, 2026
Triage findings (task 20822)
Confirmed on the current checkout; no repository code was changed. The write path saves
stat.S_IMODE, creates a replacement inode withmkstemp, applies onlyfchmod, then atomically replaces the config. It does not snapshot or restore ACLs.Reproduction on ext4 with
setfacl/getfaclavailable: an originaluser:65534:r--ACL entry andmask::r--disappeared after a real repair; mode stayed0640. A second reproduction gave the parent directory a default ACL for user 65534 and added a file-specific entry for user 65533. After replacement, the new file had inherited 65534 but lost file-specific 65533. This distinguishes default inheritance from preserving the original file ACL.bash pkgs/opencode-config-normalize/normalize_test.shpasses all 27 existing cases; none asserts ACL preservation.Recommended implementation/test scope: before replacement, snapshot the original file access ACL numerically; after writing and applying mode to the temporary inode, restore that ACL to the temp file and verify it matches before rename. If an extended ACL is present but cannot be read/restored/verified, fail closed and leave the original file untouched rather than silently dropping access policy. Add an ACL-capability-gated regression test with a directory default ACL plus a distinct file-specific named-user ACL and mask, asserting the file-specific entry survives repair and inherited defaults are not mistaken for the source ACL. Keep unsupported-platform behavior explicit.
Routing this bounded implementation as a follow-up queue task; this triage task made no code changes.
dezren39 commentedon Nov 18, 2026
Routing note: The bounded implementation follow-up is deliberately not queued in this pass because creation of its packet file was explicitly canceled. I am not retrying the same enqueue through another mechanism. Triage evidence and recommended scope are recorded above; a later authorized lane can create the implementation packet. No implementation/code changes were made by this triage task.
dezren39 commentedon Nov 18, 2026
Task 20823 picked up for fresh triage verification. #11836 remains open and assigned to dezren39; no matching open PR exists. Prior fresh findings on #11836 document a reproducible ACL-loss mechanism and recommend ACL snapshot/restore/verify plus a capability-gated regression test. I am rechecking the current default-branch write path and reproduction, with no production edits in scope.
1 remaining item
dezren39 commentedon Nov 18, 2026
Triage verification (task 20823, lane oc-code-04)
Freshly checked on current
main(49fa683); issue #11836 remains OPEN and assigned to dezren39, with no matching open PR. No production files were changed.I independently confirmed the loss on this host (
setfacl/getfaclavailable; filesystem reported bystat -fas ext2/ext3): the normalizer capturesstat.S_IMODE, writes a new inode, appliesfchmod, and replaces the original without snapshotting its ACL. A named-user ACL and mask disappeared after actual repair while mode remained 0640. With a parent default ACL for user 65534 and a distinct file-specific entry for 65533, replacement inherited 65534 but lost 65533. This distinguishes directory-default inheritance from preserving the original access ACL.bash pkgs/opencode-config-normalize/normalize_test.shpassed all 27 existing cases; none covers ACLs.Recommended implementation/test scope: snapshot the source access ACL before replacement, restore it to the temporary inode, and verify it before rename; if an extended ACL cannot be read/restored/verified, fail closed and leave the original untouched. Add a capability-gated regression with a default ACL and a distinct file-specific named-user ACL/mask, asserting that the source entry survives repair; keep unsupported-platform behavior explicit.
Routing blocker: the preceding triage note for task 20822 explicitly records that follow-up packet creation was canceled and must not be retried through another mechanism. I therefore did not enqueue a duplicate follow-up. The cancellation is the concrete routing blocker; a later authorized lane can create the implementation packet.
dezren39 commentedon Nov 18, 2026
Task 20823 verified the ACL-loss reproduction and documented implementation/test scope above. The queue packet has a material defect:
payload.kindissmall_fix, but its title, body, and acceptance define a triage-only task. The broker consequently applies fix-class completion rules and rejects a triaged outcome without a verified disposition/successor. The prior task's note explicitly canceled follow-up packet creation and forbids retrying it through another mechanism, so I did not create one. Blocked aspacket_defect; no tracked code changes.Merge pull request #12007 from developing-today/fix/11836-normalize-acl
dezren39 commentedon Nov 22, 2026
Merged work, still open. Every pull request that references this issue has merged (#12007) and none is open, but the issue kept
status:in-review. Tasks that name it as a blocker have been waiting on it.status:in-reviewis removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").By: Claude, 2026-11-22 flow review.
Generated by Claude Code
dezren39 commentedon Nov 23, 2026
agent-note:v1
state: done
issue: #11836
lane: aai
worker: claude-lane-aai
origin: packet-defect census feed (via #13191 census, comment 7104845806)
stage: verified -> closed
Done check run against current main, per the 2026-11-22 flow-review instruction on this issue ("run the issue's done check against main; close the issue if it passes").
Premise/ownership: issue OPEN, all 9 comments read; no live lane claim (prior comments are completed triage from 2026-11-18 and the flow-review note). The implementation already landed in PR #12007 (merged 2026-11-19T03:29:18Z, merge commit 4491209): normalize.sh snapshots the raw
system.posix_acl_accessxattr before the atomic replace, restores it on the temp inode after fchmod, verifies it, and fails closed (exit 1, config untouched) when the ACL cannot be read/restored/verified; header documents behavior on platforms/filesystems without POSIX ACL support.Verification (laptop amd-6, files extracted from origin/main 4421467,
bash pkgs/opencode-config-normalize/normalize_test.sh):acl-preservedPASS — file-specific named ACL survives a real repair (acceptance criterion 1)acl-not-inheritedPASS — directory default-ACL inheritance is not mistaken for preservation (criterion 2)mode-preservedandsymlink-refusedcases (criterion 4)All acceptance criteria are met on main. Closing as completed. The stale
status/blocked/queue/blockedlabels reflected the cancelled queue packet, not the code state.