Add worktree-local Intent policy overlays
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- authorization, cli, security
Hướng nghiên cứu
Bắt đầu bằng cách lần theo đường dẫn policy hiện có của package.json và các consumer của effective-policy được nêu trong issue: list, load, stale, chẩn đoán hỗ trợ, install --map và hooks. Triển khai và xác minh resolver được bảo vệ cho .intent/config.local.json để việc theo dõi bằng Git và các kiểm tra bỏ qua chính xác, việc xác thực, biên dịch selector, các loại trừ, hành vi di chuyển và thứ tự ưu tiên của shared policy khớp với các tiêu chí chấp nhận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Intent policy is currently shared through package.json. A user cannot add worktree-local grants or denials without changing committed repository policy. Local state also needs strict Git safety rules so it cannot be silently tracked or hide .intent/hooks.
User outcome
A user can manually create a valid .intent/config.local.json beside the nearest owning package.json. Intent applies it automatically as personal worktree state: local skills can broaden shared defaults, local excludes can add denials, and shared excludes remain final.
Example:
{
"skills": [
"@acme/private-skill"
],
"exclude": [
"@acme/unsafe-skill"
]
}
In scope
- Add
.intent/config.local.jsondiscovery beside the nearest owningpackage.jsonas the sole local policy source. Keeppackage.jsonas the sole shared committed source. - Provide reusable guarded local resolver and storage behavior that future installer or review work may consume.
- Require local policy operations to run in a Git worktree. Use only the exact sidecar path in
$GIT_COMMON_DIR/info/exclude; do not ignore.intent/, and preserve.intent/hooks. - Check that the exact local path is untracked on every local read and write. Reject tracked paths even when
info/excludecontains the path. - Support a top-level JSON object with optional
skillsandexcludefields, where at least one field is present. Parse present fields strictly as arrays of valid strings under the existing selector and exclusion grammars. - Activate a manually created valid local file automatically. Fail closed when a present local file is tracked, unreadable, malformed, or not exactly ignored.
- Compile shared and local skill selectors independently. For declared shared policy, grant a candidate when either predicate matches. Preserve existing package, exact-skill, wildcard, npm, and workspace semantics.
- Preserve migration behavior when shared
intent.skillsis absent and localskillsis omitted or[]. A non-empty localskills, including["*"], ends that migration mode. - Apply shared and local exclusions as final additive denials. Local policy must never restore a skill denied by shared policy.
- Make all policy consumers use the same effective-policy resolver: list, load, stale, support diagnostics, install
--map, and hooks.
Acceptance criteria
- A valid manual
.intent/config.local.jsonbeside the nearest owningpackage.jsonis discovered and applied automatically in a Git worktree. - The local file is accepted only when the exact path is untracked and exactly ignored through
$GIT_COMMON_DIR/info/exclude; the check applies to both reads and writes. .intent/hooksremains usable, and the implementation never ignores.intent/as a whole directory.- A tracked, unreadable, malformed, or not-exactly-ignored present local file fails closed with actionable diagnostics.
- The local object rejects unknown top-level fields, accepts only optional
skillsandexclude, requires at least one of them, and validates each present array under existing selector or exclusion rules. - Shared and local selector sets are compiled independently. For declared shared policy, a candidate is granted when either set matches without changing package, exact-skill, wildcard, npm, or workspace semantics.
- Shared and local exclusions both deny matching candidates after grant selection. A shared exclusion cannot be bypassed locally.
- When shared
intent.skillsis absent, omitted or empty localskillspreserves current migration behavior. A non-empty localskills, including["*"], ends it. list,load,stale, support diagnostics, install--map, and hooks resolve the same effective policy and report local-source provenance where they already report policy diagnostics.- The work introduces no
.intent/config.json, global local-policy store, new dependency, destination-selection UI, preview, confirmation, package writing, content delivery, locks, hashes, or Git skill-source support.
Related work
Blocked by: None. #219 is completed prior behavior. #220 and #221 may integrate local policy when available but can proceed independently with package.json-only behavior. #222 independent.
#220 owns interactive destination selection if and when it integrates local configuration. #221 owns repeat review if and when it integrates local configuration.
- Ngôn ngữ chính
- TypeScript
- Star
- 331
- Fork
- 22
- Merge trung bình
- 12 giờ 17 phút
- Pull request đã merge (30 ngày)
- 51
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/intent
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Tất cả issue của TanStack/intent
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100