From 9c06cbed34d7b254f63ca5648fbbc3a06439a81c Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 3 Nov 2026 10:31:17 +0000 Subject: [PATCH] feat(skill-contracts): default the contract check on (GST-1088) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- changelog.d/capy-gst-1088-flip-contracts.md | 1 + lib/skill-route.ts | 2 +- test/setup-skill-hooks-gate.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog.d/capy-gst-1088-flip-contracts.md diff --git a/changelog.d/capy-gst-1088-flip-contracts.md b/changelog.d/capy-gst-1088-flip-contracts.md new file mode 100644 index 000000000..f94b8ce18 --- /dev/null +++ b/changelog.d/capy-gst-1088-flip-contracts.md @@ -0,0 +1 @@ +The skill contract check is now on by default (GST-1088): when a skill with a contract block ends without its required outputs, the Stop hook blocks once and names what is missing. Turn it off with `gstack-config set skill_contracts off` or `./setup --no-skill-contracts`. diff --git a/lib/skill-route.ts b/lib/skill-route.ts index 69ad89c43..9a095e144 100644 --- a/lib/skill-route.ts +++ b/lib/skill-route.ts @@ -37,7 +37,7 @@ export const SWITCH_ENV: Record = { /** Each switch's one default. setup, gstack-config and gstack-skill-route read it through `gstack-skill-route --default `; the hooks read it here. */ export const SWITCH_DEFAULT: Record = { skill_routing: 'off', - skill_contracts: 'off', + skill_contracts: 'on', }; export function normalizeSwitch(raw: string | null | undefined): 'on' | 'off' | null { diff --git a/test/setup-skill-hooks-gate.test.ts b/test/setup-skill-hooks-gate.test.ts index 3af9dd5e1..03b3bbde3 100644 --- a/test/setup-skill-hooks-gate.test.ts +++ b/test/setup-skill-hooks-gate.test.ts @@ -194,9 +194,9 @@ describe('SWITCH_DEFAULT is the one default (a flip PR changes one line)', () => expect(SWITCH_DEFAULT.skill_routing).toBe('off'); }); - test('pin: skill_contracts defaults to off today (a flip PR changes lib/skill-route.ts line 40 and this pin)', () => { - expect(original.split('\n')[39]).toBe(" skill_contracts: 'off',"); - expect(SWITCH_DEFAULT.skill_contracts).toBe('off'); + test('pin: skill_contracts defaults to on today (a flip PR changes lib/skill-route.ts line 40 and this pin)', () => { + expect(original.split('\n')[39]).toBe(" skill_contracts: 'on',"); + expect(SWITCH_DEFAULT.skill_contracts).toBe('on'); }); test('every reader agrees with SWITCH_DEFAULT: gstack-config, setup, the routing hook and the Stop hook', () => {