MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / canMachineWrite

Function canMachineWrite

src/skills/provenance.ts:59–65  ·  view source on GitHub ↗
(name: string, existing: ProvenanceLike | undefined | null)

Source from the content-addressed store, hash-verified

57 * --force` is a human action and is intentionally not gated here.
58 */
59export 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}

Callers 2

promoteCandidateFunction · 0.85

Calls 1

isProtectedFunction · 0.85

Tested by

no test coverage detected