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

Method check

src/agent/read-ledger.ts:95–101  ·  view source on GitHub ↗

* Pure gate decision for ONE existing file about to be mutated. * `currentMtimeMs` is the file's mtime on disk right now (caller stats it). * Non-existent files never reach this check (creation is always allowed).

(absPath: string, currentMtimeMs: number)

Source from the content-addressed store, hash-verified

93 * Non-existent files never reach this check (creation is always allowed).
94 */
95 check(absPath: string, currentMtimeMs: number): GateVerdict {
96 const recorded = this.seen.get(absPath);
97 if (recorded === undefined) return { ok: false, kind: 'unread', path: absPath };
98 // Allow a small clock-precision slack (some filesystems round mtime).
99 if (currentMtimeMs > recorded + 1) return { ok: false, kind: 'stale', path: absPath };
100 return { ok: true };
101 }
102
103 size(): number {
104 return this.seen.size;

Callers 2

executeToolCallMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected