(name: string, existing: ProvenanceLike | undefined | null)
| 57 | * --force` is a human action and is intentionally not gated here. |
| 58 | */ |
| 59 | export function canMachineWrite(name: string, existing: ProvenanceLike | undefined | null): OverwriteDecision { |
| 60 | if (!existing) return { allowed: true, reason: 'no existing skill' }; |
| 61 | if (isProtected(existing)) { |
| 62 | return { allowed: false, reason: `"${name}" is human-authored/edited (provenance protected) — machine overwrite refused` }; |
| 63 | } |
| 64 | return { allowed: true, reason: `"${name}" is a prior machine capture — may be curated` }; |
| 65 | } |
no test coverage detected