From c2404197e4a8907fe140dfbef699177a5a4583b9 Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Wed, 2 Sep 2026 09:37:19 -0700 Subject: [PATCH] Honor ancestor hook disable config AI assistance disclosure: Codex implemented and verified this fix under maintainer direction. --- skill/scripts/context.mjs | 3 +++ tests/context.test.mjs | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/skill/scripts/context.mjs b/skill/scripts/context.mjs index efd015c15..1df6415d7 100644 --- a/skill/scripts/context.mjs +++ b/skill/scripts/context.mjs @@ -1352,6 +1352,9 @@ function automaticHookMode(ctx) { if (!hookEnabledAt(activeRoot)) return 'none'; const manifests = HOOK_MANIFESTS_BY_PROVIDER[IMPECCABLE_PROVIDER_ID] || []; for (const root of hookManifestSearchRoots(ctx)) { + // A manifest can live above the resolved product. Honor the hook lifecycle + // config beside that manifest before treating it as active coverage. + if (!hookEnabledAt(root)) continue; for (const rel of manifests) { const raw = readJson(path.join(root, rel)); if (raw?.hooks && valueHasHookMarker(raw.hooks)) { diff --git a/tests/context.test.mjs b/tests/context.test.mjs index a698bf369..48355d218 100644 --- a/tests/context.test.mjs +++ b/tests/context.test.mjs @@ -1219,6 +1219,18 @@ describe('context.mjs CLI', () => { }); assert.equal(res.status, 0, res.stderr); assert.doesNotMatch(res.stdout, /MANUAL_DETECTOR_REQUIRED:/); + + fs.mkdirSync(path.join(repo, '.impeccable'), { recursive: true }); + fs.writeFileSync(path.join(repo, '.impeccable', 'config.local.json'), JSON.stringify({ + hook: { enabled: false }, + })); + const disabled = spawnSync(process.execPath, [path.join(scripts, 'context.mjs')], { + cwd: project, + encoding: 'utf8', + env: { ...process.env, IMPECCABLE_NO_UPDATE_CHECK: '1', IMPECCABLE_NO_STALENESS_CHECK: '1' }, + }); + assert.equal(disabled.status, 0, disabled.stderr); + assert.match(disabled.stdout, /MANUAL_DETECTOR_REQUIRED:/); }); it('does not borrow a hook manifest from the invoking workspace when targeting a sibling', () => {