fix(sec-core): skip read-only raw user skills - #3183
Merged
edonyzpc merged 1 commit intoSep 15, 2026
Merged
Conversation
1570005763
requested review from
RemindD,
casparant,
edonyzpc and
kid9
as code owners
September 9, 2026 03:06
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
edonyzpc
reviewed
Sep 9, 2026
edonyzpc
requested changes
Sep 9, 2026
1570005763
force-pushed
the
codex/sec-core-readonly-raw-user
branch
from
September 10, 2026 08:56
f2a994f to
c8a2339
Compare
Extend the existing batch guard to unmanaged raw user defaults resolved from XDG. Auto-remember those skills by exact path so a writable sibling does not disable the read-only skip through parent-glob promotion. Keep explicit scans and managed user skills strict. Preserve existing configuration patterns because their origin is unknown. This does not create activation state or change SkillFS exposure. Fixes: 85f94e6 ("feat(sec-core): cover raw user skill discovery") Assisted-by: Codex:0.153.4 Signed-off-by: 九钟 <duanyongshuai.dys@alibaba-inc.com>
1570005763
force-pushed
the
codex/sec-core-readonly-raw-user
branch
from
September 10, 2026 09:12
c8a2339 to
ee494fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#3146 added raw user skills to default discovery. Images with read-only raw skills then fail during
initorscan --allwhen Ledger tries to create.skill-meta. Auto-remembering a writable sibling asparent/*can also make the read-only skill appear managed and disable the batch skip on the same or next run.What changed
Extend the existing batch guard to host-backed, unmanaged, read-only skills directly under the raw user default root, resolved through the existing XDG helper. Return
status=skipped,reasonCode=readonly_default_skill, andpersisted=falsebefore scanning or writing skill metadata. Auto-remember raw user skills by individual path so successful writable siblings do not expand managed coverage; other roots keep their existing registration rules.Related issue
no-issue: focused follow-up regression fix for the raw user discovery added by #3146.
User / Agent impact
Read-only raw defaults no longer fail an otherwise successful batch, including mixed writable/read-only siblings and repeated runs in either discovery order. Writable skills scan normally; explicit scans and managed user skills retain write errors. Skips do not produce an attestation or activation state.
Risk and compatibility
The skip is limited to exact default-root children with non-writable Ledger state. Existing
readonly_system_skillresults, SkillFS/resolver errors, and real scan/write errors retain their behavior. No new CLI option, configuration field, dependency, manifest format, or activation/SkillFS behavior is introduced.Existing
managedSkillDirspatterns are preserved because configuration does not record whether a pattern was user-configured or auto-generated. A pre-existing raw-root glob therefore remains managed and strict. After confirming unintended coverage, users can replace that glob with individual paths they intend to manage; there is no automatic configuration migration.Validation
Python 3.11.6 on macOS: 263 passed, 3 subtests passed. The nine new regression cases were first run against the previous implementation and failed as expected.
cd src/agent-sec-core PYTHONPATH=agent-sec-cli/src:tests/unit-test python -m pytest -q \ tests/unit-test/skill_ledger/{test_config,test_canonical_workflows,test_live_root}.py \ tests/unit-test/security_middleware/backends/test_skill_ledger_backend.py \ tests/integration-test/skill-ledger/test_skill_ledger_integration.pymake python-code-pretty,git diff --check, andbash scripts/docs-lint.shpassed. Incremental Ruff found no new findings; two pre-existing test import-order findings remain unchanged.initandscan --all, both sibling orders, read-only skill roots and existing metadata directories, two consecutive runs, exact-path registration, untouched skipped content, and strict explicit/exact-managed/glob-managed failures. Configuration tests also cover HOME fallback, custom XDG roots, later sibling additions, repeated registration, and preservation of existing patterns.c8a2339ca023ba9e5280e263169d6a56fc3201d4commit and 8 counterfactual checks reproducing the review issue onf2a994fd5..skill-meta. Root and non-root write probes returnEROFS. All 16 repeated mixed-directory runs on the fix exit 0 with stable skips; three strict scans retainEROFSfailures.The subsequent
ee494fe65update only trims README detail. Production code and tests are identical to the Linux-tested revision; documentation lint and diff checks passed.Documentation and rollback
README summaries cover the batch skip behavior. Individual-path auto-registration and existing-pattern details are documented in both user-guide languages and the existing Ledger design contract. Revert this commit to restore previous behavior. The change adds no stored-state format migration; rollback preserves already-recorded individual paths.