mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-03 01:46:55 +02:00
fix(qa-evidence,observer): reject placeholder metadata and replay-only learning; declare the docs atomic-write target
- materialize measures revision, runtime and cwd itself and rejects supplied values that differ (CI run wrote revision "HEAD" and runtime "bun"), and refuses learning checkpoints that replay the same probe, naming the fix. - The docs write observer treats Claude Code's atomic temp for the authorized doc target as transient, so a temp renamed before its per-file watch no longer marks the observation incomplete (ship-docsync-completion flake). Per-file monitoring outside declared targets stays fail-closed.
This commit is contained in:
1 parent
131d43be0a
commit
1643cd94de
5 files changed
+50
-12
No files matched your search
@@ -72,7 +72,7 @@ export interface QAWriteObservation {
|
||||
limits: string[];
|
||||
}
|
||||
|
||||
export async function observeQAWrites(root: string, options: { reportDirectory?: string; evidenceProducer?: boolean } = {}) {
|
||||
export async function observeQAWrites(root: string, options: { reportDirectory?: string; evidenceProducer?: boolean; atomicTargets?: string[] } = {}) {
|
||||
if (process.platform !== 'linux') throw new Error('QA write observer unavailable: Linux inotify required');
|
||||
if (fs.realpathSync(root) !== root) throw new Error('Observer root must be canonical');
|
||||
let reportDirectory: string | undefined;
|
||||
@@ -82,7 +82,8 @@ export async function observeQAWrites(root: string, options: { reportDirectory?:
|
||||
reportDirectory = path.relative(root, directory);
|
||||
}
|
||||
const transientFile = (relative: string) => qaWriteAllowed(relative, 'qa-only')
|
||||
|| (reportDirectory !== undefined && relative.startsWith(reportDirectory + path.sep));
|
||||
|| (reportDirectory !== undefined && relative.startsWith(reportDirectory + path.sep))
|
||||
|| (options.atomicTargets ?? []).some(target => relative.startsWith(target + '.tmp.') && /^\.tmp\.[1-9]\d*\.[0-9a-f]{12}$/.test(relative.slice(target.length)));
|
||||
const before = qaTreeSnapshot(root);
|
||||
const { dlopen, FFIType, ptr } = await import('bun:ffi');
|
||||
const libc = dlopen('libc.so.6', {
|
||||
|
||||
Reference in new issue
Block a user